/*! third party licenses: js/vendor.LICENSE.txt */
const appName = "viewer";
const appVersion = "2.3.0";
import { g as getDefaultExportFromCjs, p as process$1, c as commonjsGlobal } from "./viewer-main.mjs";
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}
function _classCallCheck(a, n2) {
  if (!(a instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function toPrimitive(t2, r2) {
  if ("object" != _typeof(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i = e2.call(t2, r2 || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r2 ? String : Number)(t2);
}
function toPropertyKey(t2) {
  var i = toPrimitive(t2, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}
function _defineProperties(e2, r2) {
  for (var t2 = 0; t2 < r2.length; t2++) {
    var o = r2[t2];
    o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e2, toPropertyKey(o.key), o);
  }
}
function _createClass(e2, r2, t2) {
  return r2 && _defineProperties(e2.prototype, r2), Object.defineProperty(e2, "prototype", {
    writable: false
  }), e2;
}
function _defineProperty(e2, r2, t2) {
  return (r2 = toPropertyKey(r2)) in e2 ? Object.defineProperty(e2, r2, {
    value: t2,
    enumerable: true,
    configurable: true,
    writable: true
  }) : e2[r2] = t2, e2;
}
var react = { exports: {} };
var react_production_min = {};
/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var l$2 = Symbol.for("react.element"), n$2 = Symbol.for("react.portal"), p$3 = Symbol.for("react.fragment"), q$3 = Symbol.for("react.strict_mode"), r$1 = Symbol.for("react.profiler"), t$2 = Symbol.for("react.provider"), u$1 = Symbol.for("react.context"), v$4 = Symbol.for("react.forward_ref"), w$2 = Symbol.for("react.suspense"), x$2 = Symbol.for("react.memo"), y$2 = Symbol.for("react.lazy"), z$3 = Symbol.iterator;
function A$2(a) {
  if (null === a || "object" !== typeof a) return null;
  a = z$3 && a[z$3] || a["@@iterator"];
  return "function" === typeof a ? a : null;
}
var B$2 = { isMounted: function() {
  return false;
}, enqueueForceUpdate: function() {
}, enqueueReplaceState: function() {
}, enqueueSetState: function() {
} }, C$2 = Object.assign, D$2 = {};
function E$2(a, b2, e2) {
  this.props = a;
  this.context = b2;
  this.refs = D$2;
  this.updater = e2 || B$2;
}
E$2.prototype.isReactComponent = {};
E$2.prototype.setState = function(a, b2) {
  if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
  this.updater.enqueueSetState(this, a, b2, "setState");
};
E$2.prototype.forceUpdate = function(a) {
  this.updater.enqueueForceUpdate(this, a, "forceUpdate");
};
function F$1() {
}
F$1.prototype = E$2.prototype;
function G$2(a, b2, e2) {
  this.props = a;
  this.context = b2;
  this.refs = D$2;
  this.updater = e2 || B$2;
}
var H$2 = G$2.prototype = new F$1();
H$2.constructor = G$2;
C$2(H$2, E$2.prototype);
H$2.isPureReactComponent = true;
var I$2 = Array.isArray, J$1 = Object.prototype.hasOwnProperty, K$2 = { current: null }, L$2 = { key: true, ref: true, __self: true, __source: true };
function M$2(a, b2, e2) {
  var d2, c2 = {}, k2 = null, h2 = null;
  if (null != b2) for (d2 in void 0 !== b2.ref && (h2 = b2.ref), void 0 !== b2.key && (k2 = "" + b2.key), b2) J$1.call(b2, d2) && !L$2.hasOwnProperty(d2) && (c2[d2] = b2[d2]);
  var g2 = arguments.length - 2;
  if (1 === g2) c2.children = e2;
  else if (1 < g2) {
    for (var f2 = Array(g2), m2 = 0; m2 < g2; m2++) f2[m2] = arguments[m2 + 2];
    c2.children = f2;
  }
  if (a && a.defaultProps) for (d2 in g2 = a.defaultProps, g2) void 0 === c2[d2] && (c2[d2] = g2[d2]);
  return { $$typeof: l$2, type: a, key: k2, ref: h2, props: c2, _owner: K$2.current };
}
function N$2(a, b2) {
  return { $$typeof: l$2, type: a.type, key: b2, ref: a.ref, props: a.props, _owner: a._owner };
}
function O$1(a) {
  return "object" === typeof a && null !== a && a.$$typeof === l$2;
}
function escape(a) {
  var b2 = { "=": "=0", ":": "=2" };
  return "$" + a.replace(/[=:]/g, function(a2) {
    return b2[a2];
  });
}
var P$2 = /\/+/g;
function Q$2(a, b2) {
  return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b2.toString(36);
}
function R$1(a, b2, e2, d2, c2) {
  var k2 = typeof a;
  if ("undefined" === k2 || "boolean" === k2) a = null;
  var h2 = false;
  if (null === a) h2 = true;
  else switch (k2) {
    case "string":
    case "number":
      h2 = true;
      break;
    case "object":
      switch (a.$$typeof) {
        case l$2:
        case n$2:
          h2 = true;
      }
  }
  if (h2) return h2 = a, c2 = c2(h2), a = "" === d2 ? "." + Q$2(h2, 0) : d2, I$2(c2) ? (e2 = "", null != a && (e2 = a.replace(P$2, "$&/") + "/"), R$1(c2, b2, e2, "", function(a2) {
    return a2;
  })) : null != c2 && (O$1(c2) && (c2 = N$2(c2, e2 + (!c2.key || h2 && h2.key === c2.key ? "" : ("" + c2.key).replace(P$2, "$&/") + "/") + a)), b2.push(c2)), 1;
  h2 = 0;
  d2 = "" === d2 ? "." : d2 + ":";
  if (I$2(a)) for (var g2 = 0; g2 < a.length; g2++) {
    k2 = a[g2];
    var f2 = d2 + Q$2(k2, g2);
    h2 += R$1(k2, b2, e2, f2, c2);
  }
  else if (f2 = A$2(a), "function" === typeof f2) for (a = f2.call(a), g2 = 0; !(k2 = a.next()).done; ) k2 = k2.value, f2 = d2 + Q$2(k2, g2++), h2 += R$1(k2, b2, e2, f2, c2);
  else if ("object" === k2) throw b2 = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b2 ? "object with keys {" + Object.keys(a).join(", ") + "}" : b2) + "). If you meant to render a collection of children, use an array instead.");
  return h2;
}
function S$2(a, b2, e2) {
  if (null == a) return a;
  var d2 = [], c2 = 0;
  R$1(a, d2, "", "", function(a2) {
    return b2.call(e2, a2, c2++);
  });
  return d2;
}
function T$2(a) {
  if (-1 === a._status) {
    var b2 = a._result;
    b2 = b2();
    b2.then(function(b3) {
      if (0 === a._status || -1 === a._status) a._status = 1, a._result = b3;
    }, function(b3) {
      if (0 === a._status || -1 === a._status) a._status = 2, a._result = b3;
    });
    -1 === a._status && (a._status = 0, a._result = b2);
  }
  if (1 === a._status) return a._result.default;
  throw a._result;
}
var U$2 = { current: null }, V$2 = { transition: null }, W$2 = { ReactCurrentDispatcher: U$2, ReactCurrentBatchConfig: V$2, ReactCurrentOwner: K$2 };
function X$2() {
  throw Error("act(...) is not supported in production builds of React.");
}
react_production_min.Children = { map: S$2, forEach: function(a, b2, e2) {
  S$2(a, function() {
    b2.apply(this, arguments);
  }, e2);
}, count: function(a) {
  var b2 = 0;
  S$2(a, function() {
    b2++;
  });
  return b2;
}, toArray: function(a) {
  return S$2(a, function(a2) {
    return a2;
  }) || [];
}, only: function(a) {
  if (!O$1(a)) throw Error("React.Children.only expected to receive a single React element child.");
  return a;
} };
react_production_min.Component = E$2;
react_production_min.Fragment = p$3;
react_production_min.Profiler = r$1;
react_production_min.PureComponent = G$2;
react_production_min.StrictMode = q$3;
react_production_min.Suspense = w$2;
react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W$2;
react_production_min.act = X$2;
react_production_min.cloneElement = function(a, b2, e2) {
  if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + ".");
  var d2 = C$2({}, a.props), c2 = a.key, k2 = a.ref, h2 = a._owner;
  if (null != b2) {
    void 0 !== b2.ref && (k2 = b2.ref, h2 = K$2.current);
    void 0 !== b2.key && (c2 = "" + b2.key);
    if (a.type && a.type.defaultProps) var g2 = a.type.defaultProps;
    for (f2 in b2) J$1.call(b2, f2) && !L$2.hasOwnProperty(f2) && (d2[f2] = void 0 === b2[f2] && void 0 !== g2 ? g2[f2] : b2[f2]);
  }
  var f2 = arguments.length - 2;
  if (1 === f2) d2.children = e2;
  else if (1 < f2) {
    g2 = Array(f2);
    for (var m2 = 0; m2 < f2; m2++) g2[m2] = arguments[m2 + 2];
    d2.children = g2;
  }
  return { $$typeof: l$2, type: a.type, key: c2, ref: k2, props: d2, _owner: h2 };
};
react_production_min.createContext = function(a) {
  a = { $$typeof: u$1, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null };
  a.Provider = { $$typeof: t$2, _context: a };
  return a.Consumer = a;
};
react_production_min.createElement = M$2;
react_production_min.createFactory = function(a) {
  var b2 = M$2.bind(null, a);
  b2.type = a;
  return b2;
};
react_production_min.createRef = function() {
  return { current: null };
};
react_production_min.forwardRef = function(a) {
  return { $$typeof: v$4, render: a };
};
react_production_min.isValidElement = O$1;
react_production_min.lazy = function(a) {
  return { $$typeof: y$2, _payload: { _status: -1, _result: a }, _init: T$2 };
};
react_production_min.memo = function(a, b2) {
  return { $$typeof: x$2, type: a, compare: void 0 === b2 ? null : b2 };
};
react_production_min.startTransition = function(a) {
  var b2 = V$2.transition;
  V$2.transition = {};
  try {
    a();
  } finally {
    V$2.transition = b2;
  }
};
react_production_min.unstable_act = X$2;
react_production_min.useCallback = function(a, b2) {
  return U$2.current.useCallback(a, b2);
};
react_production_min.useContext = function(a) {
  return U$2.current.useContext(a);
};
react_production_min.useDebugValue = function() {
};
react_production_min.useDeferredValue = function(a) {
  return U$2.current.useDeferredValue(a);
};
react_production_min.useEffect = function(a, b2) {
  return U$2.current.useEffect(a, b2);
};
react_production_min.useId = function() {
  return U$2.current.useId();
};
react_production_min.useImperativeHandle = function(a, b2, e2) {
  return U$2.current.useImperativeHandle(a, b2, e2);
};
react_production_min.useInsertionEffect = function(a, b2) {
  return U$2.current.useInsertionEffect(a, b2);
};
react_production_min.useLayoutEffect = function(a, b2) {
  return U$2.current.useLayoutEffect(a, b2);
};
react_production_min.useMemo = function(a, b2) {
  return U$2.current.useMemo(a, b2);
};
react_production_min.useReducer = function(a, b2, e2) {
  return U$2.current.useReducer(a, b2, e2);
};
react_production_min.useRef = function(a) {
  return U$2.current.useRef(a);
};
react_production_min.useState = function(a) {
  return U$2.current.useState(a);
};
react_production_min.useSyncExternalStore = function(a, b2, e2) {
  return U$2.current.useSyncExternalStore(a, b2, e2);
};
react_production_min.useTransition = function() {
  return U$2.current.useTransition();
};
react_production_min.version = "18.3.1";
{
  react.exports = react_production_min;
}
var reactExports = react.exports;
const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
var reactDom = { exports: {} };
var reactDom_production_min = {};
var scheduler = { exports: {} };
var scheduler_production_min = {};
/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
(function(exports) {
  function f2(a, b2) {
    var c2 = a.length;
    a.push(b2);
    a: for (; 0 < c2; ) {
      var d2 = c2 - 1 >>> 1, e2 = a[d2];
      if (0 < g2(e2, b2)) a[d2] = b2, a[c2] = e2, c2 = d2;
      else break a;
    }
  }
  function h2(a) {
    return 0 === a.length ? null : a[0];
  }
  function k2(a) {
    if (0 === a.length) return null;
    var b2 = a[0], c2 = a.pop();
    if (c2 !== b2) {
      a[0] = c2;
      a: for (var d2 = 0, e2 = a.length, w2 = e2 >>> 1; d2 < w2; ) {
        var m2 = 2 * (d2 + 1) - 1, C2 = a[m2], n2 = m2 + 1, x2 = a[n2];
        if (0 > g2(C2, c2)) n2 < e2 && 0 > g2(x2, C2) ? (a[d2] = x2, a[n2] = c2, d2 = n2) : (a[d2] = C2, a[m2] = c2, d2 = m2);
        else if (n2 < e2 && 0 > g2(x2, c2)) a[d2] = x2, a[n2] = c2, d2 = n2;
        else break a;
      }
    }
    return b2;
  }
  function g2(a, b2) {
    var c2 = a.sortIndex - b2.sortIndex;
    return 0 !== c2 ? c2 : a.id - b2.id;
  }
  if ("object" === typeof performance && "function" === typeof performance.now) {
    var l2 = performance;
    exports.unstable_now = function() {
      return l2.now();
    };
  } else {
    var p2 = Date, q2 = p2.now();
    exports.unstable_now = function() {
      return p2.now() - q2;
    };
  }
  var r2 = [], t2 = [], u2 = 1, v2 = null, y2 = 3, z2 = false, A2 = false, B2 = false, D2 = "function" === typeof setTimeout ? setTimeout : null, E2 = "function" === typeof clearTimeout ? clearTimeout : null, F2 = "undefined" !== typeof setImmediate ? setImmediate : null;
  "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling);
  function G2(a) {
    for (var b2 = h2(t2); null !== b2; ) {
      if (null === b2.callback) k2(t2);
      else if (b2.startTime <= a) k2(t2), b2.sortIndex = b2.expirationTime, f2(r2, b2);
      else break;
      b2 = h2(t2);
    }
  }
  function H2(a) {
    B2 = false;
    G2(a);
    if (!A2) if (null !== h2(r2)) A2 = true, I2(J2);
    else {
      var b2 = h2(t2);
      null !== b2 && K2(H2, b2.startTime - a);
    }
  }
  function J2(a, b2) {
    A2 = false;
    B2 && (B2 = false, E2(L2), L2 = -1);
    z2 = true;
    var c2 = y2;
    try {
      G2(b2);
      for (v2 = h2(r2); null !== v2 && (!(v2.expirationTime > b2) || a && !M2()); ) {
        var d2 = v2.callback;
        if ("function" === typeof d2) {
          v2.callback = null;
          y2 = v2.priorityLevel;
          var e2 = d2(v2.expirationTime <= b2);
          b2 = exports.unstable_now();
          "function" === typeof e2 ? v2.callback = e2 : v2 === h2(r2) && k2(r2);
          G2(b2);
        } else k2(r2);
        v2 = h2(r2);
      }
      if (null !== v2) var w2 = true;
      else {
        var m2 = h2(t2);
        null !== m2 && K2(H2, m2.startTime - b2);
        w2 = false;
      }
      return w2;
    } finally {
      v2 = null, y2 = c2, z2 = false;
    }
  }
  var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1;
  function M2() {
    return exports.unstable_now() - Q2 < P2 ? false : true;
  }
  function R2() {
    if (null !== O2) {
      var a = exports.unstable_now();
      Q2 = a;
      var b2 = true;
      try {
        b2 = O2(true, a);
      } finally {
        b2 ? S2() : (N2 = false, O2 = null);
      }
    } else N2 = false;
  }
  var S2;
  if ("function" === typeof F2) S2 = function() {
    F2(R2);
  };
  else if ("undefined" !== typeof MessageChannel) {
    var T2 = new MessageChannel(), U2 = T2.port2;
    T2.port1.onmessage = R2;
    S2 = function() {
      U2.postMessage(null);
    };
  } else S2 = function() {
    D2(R2, 0);
  };
  function I2(a) {
    O2 = a;
    N2 || (N2 = true, S2());
  }
  function K2(a, b2) {
    L2 = D2(function() {
      a(exports.unstable_now());
    }, b2);
  }
  exports.unstable_IdlePriority = 5;
  exports.unstable_ImmediatePriority = 1;
  exports.unstable_LowPriority = 4;
  exports.unstable_NormalPriority = 3;
  exports.unstable_Profiling = null;
  exports.unstable_UserBlockingPriority = 2;
  exports.unstable_cancelCallback = function(a) {
    a.callback = null;
  };
  exports.unstable_continueExecution = function() {
    A2 || z2 || (A2 = true, I2(J2));
  };
  exports.unstable_forceFrameRate = function(a) {
    0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5;
  };
  exports.unstable_getCurrentPriorityLevel = function() {
    return y2;
  };
  exports.unstable_getFirstCallbackNode = function() {
    return h2(r2);
  };
  exports.unstable_next = function(a) {
    switch (y2) {
      case 1:
      case 2:
      case 3:
        var b2 = 3;
        break;
      default:
        b2 = y2;
    }
    var c2 = y2;
    y2 = b2;
    try {
      return a();
    } finally {
      y2 = c2;
    }
  };
  exports.unstable_pauseExecution = function() {
  };
  exports.unstable_requestPaint = function() {
  };
  exports.unstable_runWithPriority = function(a, b2) {
    switch (a) {
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
        break;
      default:
        a = 3;
    }
    var c2 = y2;
    y2 = a;
    try {
      return b2();
    } finally {
      y2 = c2;
    }
  };
  exports.unstable_scheduleCallback = function(a, b2, c2) {
    var d2 = exports.unstable_now();
    "object" === typeof c2 && null !== c2 ? (c2 = c2.delay, c2 = "number" === typeof c2 && 0 < c2 ? d2 + c2 : d2) : c2 = d2;
    switch (a) {
      case 1:
        var e2 = -1;
        break;
      case 2:
        e2 = 250;
        break;
      case 5:
        e2 = 1073741823;
        break;
      case 4:
        e2 = 1e4;
        break;
      default:
        e2 = 5e3;
    }
    e2 = c2 + e2;
    a = { id: u2++, callback: b2, priorityLevel: a, startTime: c2, expirationTime: e2, sortIndex: -1 };
    c2 > d2 ? (a.sortIndex = c2, f2(t2, a), null === h2(r2) && a === h2(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c2 - d2))) : (a.sortIndex = e2, f2(r2, a), A2 || z2 || (A2 = true, I2(J2)));
    return a;
  };
  exports.unstable_shouldYield = M2;
  exports.unstable_wrapCallback = function(a) {
    var b2 = y2;
    return function() {
      var c2 = y2;
      y2 = b2;
      try {
        return a.apply(this, arguments);
      } finally {
        y2 = c2;
      }
    };
  };
})(scheduler_production_min);
{
  scheduler.exports = scheduler_production_min;
}
var schedulerExports = scheduler.exports;
/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var aa = reactExports, ca = schedulerExports;
function p$2(a) {
  for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c2 = 1; c2 < arguments.length; c2++) b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
  return "Minified React error #" + a + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
}
var da = /* @__PURE__ */ new Set(), ea = {};
function fa(a, b2) {
  ha(a, b2);
  ha(a + "Capture", b2);
}
function ha(a, b2) {
  ea[a] = b2;
  for (a = 0; a < b2.length; a++) da.add(b2[a]);
}
var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), ja = Object.prototype.hasOwnProperty, ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, la = {}, ma = {};
function oa(a) {
  if (ja.call(ma, a)) return true;
  if (ja.call(la, a)) return false;
  if (ka.test(a)) return ma[a] = true;
  la[a] = true;
  return false;
}
function pa(a, b2, c2, d2) {
  if (null !== c2 && 0 === c2.type) return false;
  switch (typeof b2) {
    case "function":
    case "symbol":
      return true;
    case "boolean":
      if (d2) return false;
      if (null !== c2) return !c2.acceptsBooleans;
      a = a.toLowerCase().slice(0, 5);
      return "data-" !== a && "aria-" !== a;
    default:
      return false;
  }
}
function qa(a, b2, c2, d2) {
  if (null === b2 || "undefined" === typeof b2 || pa(a, b2, c2, d2)) return true;
  if (d2) return false;
  if (null !== c2) switch (c2.type) {
    case 3:
      return !b2;
    case 4:
      return false === b2;
    case 5:
      return isNaN(b2);
    case 6:
      return isNaN(b2) || 1 > b2;
  }
  return false;
}
function v$3(a, b2, c2, d2, e2, f2, g2) {
  this.acceptsBooleans = 2 === b2 || 3 === b2 || 4 === b2;
  this.attributeName = d2;
  this.attributeNamespace = e2;
  this.mustUseProperty = c2;
  this.propertyName = a;
  this.type = b2;
  this.sanitizeURL = f2;
  this.removeEmptyString = g2;
}
var z$2 = {};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) {
  z$2[a] = new v$3(a, 0, false, a, null, false, false);
});
[["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a) {
  var b2 = a[0];
  z$2[b2] = new v$3(b2, 1, false, a[1], null, false, false);
});
["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a) {
  z$2[a] = new v$3(a, 2, false, a.toLowerCase(), null, false, false);
});
["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a) {
  z$2[a] = new v$3(a, 2, false, a, null, false, false);
});
"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) {
  z$2[a] = new v$3(a, 3, false, a.toLowerCase(), null, false, false);
});
["checked", "multiple", "muted", "selected"].forEach(function(a) {
  z$2[a] = new v$3(a, 3, true, a, null, false, false);
});
["capture", "download"].forEach(function(a) {
  z$2[a] = new v$3(a, 4, false, a, null, false, false);
});
["cols", "rows", "size", "span"].forEach(function(a) {
  z$2[a] = new v$3(a, 6, false, a, null, false, false);
});
["rowSpan", "start"].forEach(function(a) {
  z$2[a] = new v$3(a, 5, false, a.toLowerCase(), null, false, false);
});
var ra = /[\-:]([a-z])/g;
function sa(a) {
  return a[1].toUpperCase();
}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) {
  var b2 = a.replace(
    ra,
    sa
  );
  z$2[b2] = new v$3(b2, 1, false, a, null, false, false);
});
"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) {
  var b2 = a.replace(ra, sa);
  z$2[b2] = new v$3(b2, 1, false, a, "http://www.w3.org/1999/xlink", false, false);
});
["xml:base", "xml:lang", "xml:space"].forEach(function(a) {
  var b2 = a.replace(ra, sa);
  z$2[b2] = new v$3(b2, 1, false, a, "http://www.w3.org/XML/1998/namespace", false, false);
});
["tabIndex", "crossOrigin"].forEach(function(a) {
  z$2[a] = new v$3(a, 1, false, a.toLowerCase(), null, false, false);
});
z$2.xlinkHref = new v$3("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false);
["src", "href", "action", "formAction"].forEach(function(a) {
  z$2[a] = new v$3(a, 1, false, a.toLowerCase(), null, true, true);
});
function ta(a, b2, c2, d2) {
  var e2 = z$2.hasOwnProperty(b2) ? z$2[b2] : null;
  if (null !== e2 ? 0 !== e2.type : d2 || !(2 < b2.length) || "o" !== b2[0] && "O" !== b2[0] || "n" !== b2[1] && "N" !== b2[1]) qa(b2, c2, e2, d2) && (c2 = null), d2 || null === e2 ? oa(b2) && (null === c2 ? a.removeAttribute(b2) : a.setAttribute(b2, "" + c2)) : e2.mustUseProperty ? a[e2.propertyName] = null === c2 ? 3 === e2.type ? false : "" : c2 : (b2 = e2.attributeName, d2 = e2.attributeNamespace, null === c2 ? a.removeAttribute(b2) : (e2 = e2.type, c2 = 3 === e2 || 4 === e2 && true === c2 ? "" : "" + c2, d2 ? a.setAttributeNS(d2, b2, c2) : a.setAttribute(b2, c2)));
}
var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, va = Symbol.for("react.element"), wa = Symbol.for("react.portal"), ya = Symbol.for("react.fragment"), za = Symbol.for("react.strict_mode"), Aa = Symbol.for("react.profiler"), Ba = Symbol.for("react.provider"), Ca = Symbol.for("react.context"), Da = Symbol.for("react.forward_ref"), Ea = Symbol.for("react.suspense"), Fa = Symbol.for("react.suspense_list"), Ga = Symbol.for("react.memo"), Ha = Symbol.for("react.lazy");
var Ia = Symbol.for("react.offscreen");
var Ja = Symbol.iterator;
function Ka(a) {
  if (null === a || "object" !== typeof a) return null;
  a = Ja && a[Ja] || a["@@iterator"];
  return "function" === typeof a ? a : null;
}
var A$1 = Object.assign, La;
function Ma(a) {
  if (void 0 === La) try {
    throw Error();
  } catch (c2) {
    var b2 = c2.stack.trim().match(/\n( *(at )?)/);
    La = b2 && b2[1] || "";
  }
  return "\n" + La + a;
}
var Na = false;
function Oa(a, b2) {
  if (!a || Na) return "";
  Na = true;
  var c2 = Error.prepareStackTrace;
  Error.prepareStackTrace = void 0;
  try {
    if (b2) if (b2 = function() {
      throw Error();
    }, Object.defineProperty(b2.prototype, "props", { set: function() {
      throw Error();
    } }), "object" === typeof Reflect && Reflect.construct) {
      try {
        Reflect.construct(b2, []);
      } catch (l2) {
        var d2 = l2;
      }
      Reflect.construct(a, [], b2);
    } else {
      try {
        b2.call();
      } catch (l2) {
        d2 = l2;
      }
      a.call(b2.prototype);
    }
    else {
      try {
        throw Error();
      } catch (l2) {
        d2 = l2;
      }
      a();
    }
  } catch (l2) {
    if (l2 && d2 && "string" === typeof l2.stack) {
      for (var e2 = l2.stack.split("\n"), f2 = d2.stack.split("\n"), g2 = e2.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e2[g2] !== f2[h2]; ) h2--;
      for (; 1 <= g2 && 0 <= h2; g2--, h2--) if (e2[g2] !== f2[h2]) {
        if (1 !== g2 || 1 !== h2) {
          do
            if (g2--, h2--, 0 > h2 || e2[g2] !== f2[h2]) {
              var k2 = "\n" + e2[g2].replace(" at new ", " at ");
              a.displayName && k2.includes("<anonymous>") && (k2 = k2.replace("<anonymous>", a.displayName));
              return k2;
            }
          while (1 <= g2 && 0 <= h2);
        }
        break;
      }
    }
  } finally {
    Na = false, Error.prepareStackTrace = c2;
  }
  return (a = a ? a.displayName || a.name : "") ? Ma(a) : "";
}
function Pa(a) {
  switch (a.tag) {
    case 5:
      return Ma(a.type);
    case 16:
      return Ma("Lazy");
    case 13:
      return Ma("Suspense");
    case 19:
      return Ma("SuspenseList");
    case 0:
    case 2:
    case 15:
      return a = Oa(a.type, false), a;
    case 11:
      return a = Oa(a.type.render, false), a;
    case 1:
      return a = Oa(a.type, true), a;
    default:
      return "";
  }
}
function Qa(a) {
  if (null == a) return null;
  if ("function" === typeof a) return a.displayName || a.name || null;
  if ("string" === typeof a) return a;
  switch (a) {
    case ya:
      return "Fragment";
    case wa:
      return "Portal";
    case Aa:
      return "Profiler";
    case za:
      return "StrictMode";
    case Ea:
      return "Suspense";
    case Fa:
      return "SuspenseList";
  }
  if ("object" === typeof a) switch (a.$$typeof) {
    case Ca:
      return (a.displayName || "Context") + ".Consumer";
    case Ba:
      return (a._context.displayName || "Context") + ".Provider";
    case Da:
      var b2 = a.render;
      a = a.displayName;
      a || (a = b2.displayName || b2.name || "", a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef");
      return a;
    case Ga:
      return b2 = a.displayName || null, null !== b2 ? b2 : Qa(a.type) || "Memo";
    case Ha:
      b2 = a._payload;
      a = a._init;
      try {
        return Qa(a(b2));
      } catch (c2) {
      }
  }
  return null;
}
function Ra(a) {
  var b2 = a.type;
  switch (a.tag) {
    case 24:
      return "Cache";
    case 9:
      return (b2.displayName || "Context") + ".Consumer";
    case 10:
      return (b2._context.displayName || "Context") + ".Provider";
    case 18:
      return "DehydratedFragment";
    case 11:
      return a = b2.render, a = a.displayName || a.name || "", b2.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef");
    case 7:
      return "Fragment";
    case 5:
      return b2;
    case 4:
      return "Portal";
    case 3:
      return "Root";
    case 6:
      return "Text";
    case 16:
      return Qa(b2);
    case 8:
      return b2 === za ? "StrictMode" : "Mode";
    case 22:
      return "Offscreen";
    case 12:
      return "Profiler";
    case 21:
      return "Scope";
    case 13:
      return "Suspense";
    case 19:
      return "SuspenseList";
    case 25:
      return "TracingMarker";
    case 1:
    case 0:
    case 17:
    case 2:
    case 14:
    case 15:
      if ("function" === typeof b2) return b2.displayName || b2.name || null;
      if ("string" === typeof b2) return b2;
  }
  return null;
}
function Sa(a) {
  switch (typeof a) {
    case "boolean":
    case "number":
    case "string":
    case "undefined":
      return a;
    case "object":
      return a;
    default:
      return "";
  }
}
function Ta(a) {
  var b2 = a.type;
  return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b2 || "radio" === b2);
}
function Ua(a) {
  var b2 = Ta(a) ? "checked" : "value", c2 = Object.getOwnPropertyDescriptor(a.constructor.prototype, b2), d2 = "" + a[b2];
  if (!a.hasOwnProperty(b2) && "undefined" !== typeof c2 && "function" === typeof c2.get && "function" === typeof c2.set) {
    var e2 = c2.get, f2 = c2.set;
    Object.defineProperty(a, b2, { configurable: true, get: function() {
      return e2.call(this);
    }, set: function(a2) {
      d2 = "" + a2;
      f2.call(this, a2);
    } });
    Object.defineProperty(a, b2, { enumerable: c2.enumerable });
    return { getValue: function() {
      return d2;
    }, setValue: function(a2) {
      d2 = "" + a2;
    }, stopTracking: function() {
      a._valueTracker = null;
      delete a[b2];
    } };
  }
}
function Va(a) {
  a._valueTracker || (a._valueTracker = Ua(a));
}
function Wa(a) {
  if (!a) return false;
  var b2 = a._valueTracker;
  if (!b2) return true;
  var c2 = b2.getValue();
  var d2 = "";
  a && (d2 = Ta(a) ? a.checked ? "true" : "false" : a.value);
  a = d2;
  return a !== c2 ? (b2.setValue(a), true) : false;
}
function Xa(a) {
  a = a || ("undefined" !== typeof document ? document : void 0);
  if ("undefined" === typeof a) return null;
  try {
    return a.activeElement || a.body;
  } catch (b2) {
    return a.body;
  }
}
function Ya(a, b2) {
  var c2 = b2.checked;
  return A$1({}, b2, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c2 ? c2 : a._wrapperState.initialChecked });
}
function Za(a, b2) {
  var c2 = null == b2.defaultValue ? "" : b2.defaultValue, d2 = null != b2.checked ? b2.checked : b2.defaultChecked;
  c2 = Sa(null != b2.value ? b2.value : c2);
  a._wrapperState = { initialChecked: d2, initialValue: c2, controlled: "checkbox" === b2.type || "radio" === b2.type ? null != b2.checked : null != b2.value };
}
function ab(a, b2) {
  b2 = b2.checked;
  null != b2 && ta(a, "checked", b2, false);
}
function bb(a, b2) {
  ab(a, b2);
  var c2 = Sa(b2.value), d2 = b2.type;
  if (null != c2) if ("number" === d2) {
    if (0 === c2 && "" === a.value || a.value != c2) a.value = "" + c2;
  } else a.value !== "" + c2 && (a.value = "" + c2);
  else if ("submit" === d2 || "reset" === d2) {
    a.removeAttribute("value");
    return;
  }
  b2.hasOwnProperty("value") ? cb(a, b2.type, c2) : b2.hasOwnProperty("defaultValue") && cb(a, b2.type, Sa(b2.defaultValue));
  null == b2.checked && null != b2.defaultChecked && (a.defaultChecked = !!b2.defaultChecked);
}
function db(a, b2, c2) {
  if (b2.hasOwnProperty("value") || b2.hasOwnProperty("defaultValue")) {
    var d2 = b2.type;
    if (!("submit" !== d2 && "reset" !== d2 || void 0 !== b2.value && null !== b2.value)) return;
    b2 = "" + a._wrapperState.initialValue;
    c2 || b2 === a.value || (a.value = b2);
    a.defaultValue = b2;
  }
  c2 = a.name;
  "" !== c2 && (a.name = "");
  a.defaultChecked = !!a._wrapperState.initialChecked;
  "" !== c2 && (a.name = c2);
}
function cb(a, b2, c2) {
  if ("number" !== b2 || Xa(a.ownerDocument) !== a) null == c2 ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c2 && (a.defaultValue = "" + c2);
}
var eb = Array.isArray;
function fb(a, b2, c2, d2) {
  a = a.options;
  if (b2) {
    b2 = {};
    for (var e2 = 0; e2 < c2.length; e2++) b2["$" + c2[e2]] = true;
    for (c2 = 0; c2 < a.length; c2++) e2 = b2.hasOwnProperty("$" + a[c2].value), a[c2].selected !== e2 && (a[c2].selected = e2), e2 && d2 && (a[c2].defaultSelected = true);
  } else {
    c2 = "" + Sa(c2);
    b2 = null;
    for (e2 = 0; e2 < a.length; e2++) {
      if (a[e2].value === c2) {
        a[e2].selected = true;
        d2 && (a[e2].defaultSelected = true);
        return;
      }
      null !== b2 || a[e2].disabled || (b2 = a[e2]);
    }
    null !== b2 && (b2.selected = true);
  }
}
function gb(a, b2) {
  if (null != b2.dangerouslySetInnerHTML) throw Error(p$2(91));
  return A$1({}, b2, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue });
}
function hb(a, b2) {
  var c2 = b2.value;
  if (null == c2) {
    c2 = b2.children;
    b2 = b2.defaultValue;
    if (null != c2) {
      if (null != b2) throw Error(p$2(92));
      if (eb(c2)) {
        if (1 < c2.length) throw Error(p$2(93));
        c2 = c2[0];
      }
      b2 = c2;
    }
    null == b2 && (b2 = "");
    c2 = b2;
  }
  a._wrapperState = { initialValue: Sa(c2) };
}
function ib(a, b2) {
  var c2 = Sa(b2.value), d2 = Sa(b2.defaultValue);
  null != c2 && (c2 = "" + c2, c2 !== a.value && (a.value = c2), null == b2.defaultValue && a.defaultValue !== c2 && (a.defaultValue = c2));
  null != d2 && (a.defaultValue = "" + d2);
}
function jb(a) {
  var b2 = a.textContent;
  b2 === a._wrapperState.initialValue && "" !== b2 && null !== b2 && (a.value = b2);
}
function kb(a) {
  switch (a) {
    case "svg":
      return "http://www.w3.org/2000/svg";
    case "math":
      return "http://www.w3.org/1998/Math/MathML";
    default:
      return "http://www.w3.org/1999/xhtml";
  }
}
function lb(a, b2) {
  return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b2) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b2 ? "http://www.w3.org/1999/xhtml" : a;
}
var mb, nb = function(a) {
  return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b2, c2, d2, e2) {
    MSApp.execUnsafeLocalFunction(function() {
      return a(b2, c2, d2, e2);
    });
  } : a;
}(function(a, b2) {
  if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b2;
  else {
    mb = mb || document.createElement("div");
    mb.innerHTML = "<svg>" + b2.valueOf().toString() + "</svg>";
    for (b2 = mb.firstChild; a.firstChild; ) a.removeChild(a.firstChild);
    for (; b2.firstChild; ) a.appendChild(b2.firstChild);
  }
});
function ob(a, b2) {
  if (b2) {
    var c2 = a.firstChild;
    if (c2 && c2 === a.lastChild && 3 === c2.nodeType) {
      c2.nodeValue = b2;
      return;
    }
  }
  a.textContent = b2;
}
var pb = {
  animationIterationCount: true,
  aspectRatio: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
}, qb = ["Webkit", "ms", "Moz", "O"];
Object.keys(pb).forEach(function(a) {
  qb.forEach(function(b2) {
    b2 = b2 + a.charAt(0).toUpperCase() + a.substring(1);
    pb[b2] = pb[a];
  });
});
function rb(a, b2, c2) {
  return null == b2 || "boolean" === typeof b2 || "" === b2 ? "" : c2 || "number" !== typeof b2 || 0 === b2 || pb.hasOwnProperty(a) && pb[a] ? ("" + b2).trim() : b2 + "px";
}
function sb(a, b2) {
  a = a.style;
  for (var c2 in b2) if (b2.hasOwnProperty(c2)) {
    var d2 = 0 === c2.indexOf("--"), e2 = rb(c2, b2[c2], d2);
    "float" === c2 && (c2 = "cssFloat");
    d2 ? a.setProperty(c2, e2) : a[c2] = e2;
  }
}
var tb = A$1({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true });
function ub(a, b2) {
  if (b2) {
    if (tb[a] && (null != b2.children || null != b2.dangerouslySetInnerHTML)) throw Error(p$2(137, a));
    if (null != b2.dangerouslySetInnerHTML) {
      if (null != b2.children) throw Error(p$2(60));
      if ("object" !== typeof b2.dangerouslySetInnerHTML || !("__html" in b2.dangerouslySetInnerHTML)) throw Error(p$2(61));
    }
    if (null != b2.style && "object" !== typeof b2.style) throw Error(p$2(62));
  }
}
function vb(a, b2) {
  if (-1 === a.indexOf("-")) return "string" === typeof b2.is;
  switch (a) {
    case "annotation-xml":
    case "color-profile":
    case "font-face":
    case "font-face-src":
    case "font-face-uri":
    case "font-face-format":
    case "font-face-name":
    case "missing-glyph":
      return false;
    default:
      return true;
  }
}
var wb = null;
function xb(a) {
  a = a.target || a.srcElement || window;
  a.correspondingUseElement && (a = a.correspondingUseElement);
  return 3 === a.nodeType ? a.parentNode : a;
}
var yb = null, zb = null, Ab = null;
function Bb(a) {
  if (a = Cb(a)) {
    if ("function" !== typeof yb) throw Error(p$2(280));
    var b2 = a.stateNode;
    b2 && (b2 = Db(b2), yb(a.stateNode, a.type, b2));
  }
}
function Eb(a) {
  zb ? Ab ? Ab.push(a) : Ab = [a] : zb = a;
}
function Fb() {
  if (zb) {
    var a = zb, b2 = Ab;
    Ab = zb = null;
    Bb(a);
    if (b2) for (a = 0; a < b2.length; a++) Bb(b2[a]);
  }
}
function Gb(a, b2) {
  return a(b2);
}
function Hb() {
}
var Ib = false;
function Jb(a, b2, c2) {
  if (Ib) return a(b2, c2);
  Ib = true;
  try {
    return Gb(a, b2, c2);
  } finally {
    if (Ib = false, null !== zb || null !== Ab) Hb(), Fb();
  }
}
function Kb(a, b2) {
  var c2 = a.stateNode;
  if (null === c2) return null;
  var d2 = Db(c2);
  if (null === d2) return null;
  c2 = d2[b2];
  a: switch (b2) {
    case "onClick":
    case "onClickCapture":
    case "onDoubleClick":
    case "onDoubleClickCapture":
    case "onMouseDown":
    case "onMouseDownCapture":
    case "onMouseMove":
    case "onMouseMoveCapture":
    case "onMouseUp":
    case "onMouseUpCapture":
    case "onMouseEnter":
      (d2 = !d2.disabled) || (a = a.type, d2 = !("button" === a || "input" === a || "select" === a || "textarea" === a));
      a = !d2;
      break a;
    default:
      a = false;
  }
  if (a) return null;
  if (c2 && "function" !== typeof c2) throw Error(p$2(231, b2, typeof c2));
  return c2;
}
var Lb = false;
if (ia) try {
  var Mb = {};
  Object.defineProperty(Mb, "passive", { get: function() {
    Lb = true;
  } });
  window.addEventListener("test", Mb, Mb);
  window.removeEventListener("test", Mb, Mb);
} catch (a) {
  Lb = false;
}
function Nb(a, b2, c2, d2, e2, f2, g2, h2, k2) {
  var l2 = Array.prototype.slice.call(arguments, 3);
  try {
    b2.apply(c2, l2);
  } catch (m2) {
    this.onError(m2);
  }
}
var Ob = false, Pb = null, Qb = false, Rb = null, Sb = { onError: function(a) {
  Ob = true;
  Pb = a;
} };
function Tb(a, b2, c2, d2, e2, f2, g2, h2, k2) {
  Ob = false;
  Pb = null;
  Nb.apply(Sb, arguments);
}
function Ub(a, b2, c2, d2, e2, f2, g2, h2, k2) {
  Tb.apply(this, arguments);
  if (Ob) {
    if (Ob) {
      var l2 = Pb;
      Ob = false;
      Pb = null;
    } else throw Error(p$2(198));
    Qb || (Qb = true, Rb = l2);
  }
}
function Vb(a) {
  var b2 = a, c2 = a;
  if (a.alternate) for (; b2.return; ) b2 = b2.return;
  else {
    a = b2;
    do
      b2 = a, 0 !== (b2.flags & 4098) && (c2 = b2.return), a = b2.return;
    while (a);
  }
  return 3 === b2.tag ? c2 : null;
}
function Wb(a) {
  if (13 === a.tag) {
    var b2 = a.memoizedState;
    null === b2 && (a = a.alternate, null !== a && (b2 = a.memoizedState));
    if (null !== b2) return b2.dehydrated;
  }
  return null;
}
function Xb(a) {
  if (Vb(a) !== a) throw Error(p$2(188));
}
function Yb(a) {
  var b2 = a.alternate;
  if (!b2) {
    b2 = Vb(a);
    if (null === b2) throw Error(p$2(188));
    return b2 !== a ? null : a;
  }
  for (var c2 = a, d2 = b2; ; ) {
    var e2 = c2.return;
    if (null === e2) break;
    var f2 = e2.alternate;
    if (null === f2) {
      d2 = e2.return;
      if (null !== d2) {
        c2 = d2;
        continue;
      }
      break;
    }
    if (e2.child === f2.child) {
      for (f2 = e2.child; f2; ) {
        if (f2 === c2) return Xb(e2), a;
        if (f2 === d2) return Xb(e2), b2;
        f2 = f2.sibling;
      }
      throw Error(p$2(188));
    }
    if (c2.return !== d2.return) c2 = e2, d2 = f2;
    else {
      for (var g2 = false, h2 = e2.child; h2; ) {
        if (h2 === c2) {
          g2 = true;
          c2 = e2;
          d2 = f2;
          break;
        }
        if (h2 === d2) {
          g2 = true;
          d2 = e2;
          c2 = f2;
          break;
        }
        h2 = h2.sibling;
      }
      if (!g2) {
        for (h2 = f2.child; h2; ) {
          if (h2 === c2) {
            g2 = true;
            c2 = f2;
            d2 = e2;
            break;
          }
          if (h2 === d2) {
            g2 = true;
            d2 = f2;
            c2 = e2;
            break;
          }
          h2 = h2.sibling;
        }
        if (!g2) throw Error(p$2(189));
      }
    }
    if (c2.alternate !== d2) throw Error(p$2(190));
  }
  if (3 !== c2.tag) throw Error(p$2(188));
  return c2.stateNode.current === c2 ? a : b2;
}
function Zb(a) {
  a = Yb(a);
  return null !== a ? $b(a) : null;
}
function $b(a) {
  if (5 === a.tag || 6 === a.tag) return a;
  for (a = a.child; null !== a; ) {
    var b2 = $b(a);
    if (null !== b2) return b2;
    a = a.sibling;
  }
  return null;
}
var ac = ca.unstable_scheduleCallback, bc = ca.unstable_cancelCallback, cc = ca.unstable_shouldYield, dc = ca.unstable_requestPaint, B$1 = ca.unstable_now, ec = ca.unstable_getCurrentPriorityLevel, fc = ca.unstable_ImmediatePriority, gc = ca.unstable_UserBlockingPriority, hc = ca.unstable_NormalPriority, ic = ca.unstable_LowPriority, jc = ca.unstable_IdlePriority, kc = null, lc = null;
function mc(a) {
  if (lc && "function" === typeof lc.onCommitFiberRoot) try {
    lc.onCommitFiberRoot(kc, a, void 0, 128 === (a.current.flags & 128));
  } catch (b2) {
  }
}
var oc = Math.clz32 ? Math.clz32 : nc, pc = Math.log, qc = Math.LN2;
function nc(a) {
  a >>>= 0;
  return 0 === a ? 32 : 31 - (pc(a) / qc | 0) | 0;
}
var rc = 64, sc = 4194304;
function tc(a) {
  switch (a & -a) {
    case 1:
      return 1;
    case 2:
      return 2;
    case 4:
      return 4;
    case 8:
      return 8;
    case 16:
      return 16;
    case 32:
      return 32;
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return a & 4194240;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
      return a & 130023424;
    case 134217728:
      return 134217728;
    case 268435456:
      return 268435456;
    case 536870912:
      return 536870912;
    case 1073741824:
      return 1073741824;
    default:
      return a;
  }
}
function uc(a, b2) {
  var c2 = a.pendingLanes;
  if (0 === c2) return 0;
  var d2 = 0, e2 = a.suspendedLanes, f2 = a.pingedLanes, g2 = c2 & 268435455;
  if (0 !== g2) {
    var h2 = g2 & ~e2;
    0 !== h2 ? d2 = tc(h2) : (f2 &= g2, 0 !== f2 && (d2 = tc(f2)));
  } else g2 = c2 & ~e2, 0 !== g2 ? d2 = tc(g2) : 0 !== f2 && (d2 = tc(f2));
  if (0 === d2) return 0;
  if (0 !== b2 && b2 !== d2 && 0 === (b2 & e2) && (e2 = d2 & -d2, f2 = b2 & -b2, e2 >= f2 || 16 === e2 && 0 !== (f2 & 4194240))) return b2;
  0 !== (d2 & 4) && (d2 |= c2 & 16);
  b2 = a.entangledLanes;
  if (0 !== b2) for (a = a.entanglements, b2 &= d2; 0 < b2; ) c2 = 31 - oc(b2), e2 = 1 << c2, d2 |= a[c2], b2 &= ~e2;
  return d2;
}
function vc(a, b2) {
  switch (a) {
    case 1:
    case 2:
    case 4:
      return b2 + 250;
    case 8:
    case 16:
    case 32:
    case 64:
    case 128:
    case 256:
    case 512:
    case 1024:
    case 2048:
    case 4096:
    case 8192:
    case 16384:
    case 32768:
    case 65536:
    case 131072:
    case 262144:
    case 524288:
    case 1048576:
    case 2097152:
      return b2 + 5e3;
    case 4194304:
    case 8388608:
    case 16777216:
    case 33554432:
    case 67108864:
      return -1;
    case 134217728:
    case 268435456:
    case 536870912:
    case 1073741824:
      return -1;
    default:
      return -1;
  }
}
function wc(a, b2) {
  for (var c2 = a.suspendedLanes, d2 = a.pingedLanes, e2 = a.expirationTimes, f2 = a.pendingLanes; 0 < f2; ) {
    var g2 = 31 - oc(f2), h2 = 1 << g2, k2 = e2[g2];
    if (-1 === k2) {
      if (0 === (h2 & c2) || 0 !== (h2 & d2)) e2[g2] = vc(h2, b2);
    } else k2 <= b2 && (a.expiredLanes |= h2);
    f2 &= ~h2;
  }
}
function xc(a) {
  a = a.pendingLanes & -1073741825;
  return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0;
}
function yc() {
  var a = rc;
  rc <<= 1;
  0 === (rc & 4194240) && (rc = 64);
  return a;
}
function zc(a) {
  for (var b2 = [], c2 = 0; 31 > c2; c2++) b2.push(a);
  return b2;
}
function Ac(a, b2, c2) {
  a.pendingLanes |= b2;
  536870912 !== b2 && (a.suspendedLanes = 0, a.pingedLanes = 0);
  a = a.eventTimes;
  b2 = 31 - oc(b2);
  a[b2] = c2;
}
function Bc(a, b2) {
  var c2 = a.pendingLanes & ~b2;
  a.pendingLanes = b2;
  a.suspendedLanes = 0;
  a.pingedLanes = 0;
  a.expiredLanes &= b2;
  a.mutableReadLanes &= b2;
  a.entangledLanes &= b2;
  b2 = a.entanglements;
  var d2 = a.eventTimes;
  for (a = a.expirationTimes; 0 < c2; ) {
    var e2 = 31 - oc(c2), f2 = 1 << e2;
    b2[e2] = 0;
    d2[e2] = -1;
    a[e2] = -1;
    c2 &= ~f2;
  }
}
function Cc(a, b2) {
  var c2 = a.entangledLanes |= b2;
  for (a = a.entanglements; c2; ) {
    var d2 = 31 - oc(c2), e2 = 1 << d2;
    e2 & b2 | a[d2] & b2 && (a[d2] |= b2);
    c2 &= ~e2;
  }
}
var C$1 = 0;
function Dc(a) {
  a &= -a;
  return 1 < a ? 4 < a ? 0 !== (a & 268435455) ? 16 : 536870912 : 4 : 1;
}
var Ec, Fc, Gc, Hc, Ic, Jc = false, Kc = [], Lc = null, Mc = null, Nc = null, Oc = /* @__PURE__ */ new Map(), Pc = /* @__PURE__ */ new Map(), Qc = [], Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function Sc(a, b2) {
  switch (a) {
    case "focusin":
    case "focusout":
      Lc = null;
      break;
    case "dragenter":
    case "dragleave":
      Mc = null;
      break;
    case "mouseover":
    case "mouseout":
      Nc = null;
      break;
    case "pointerover":
    case "pointerout":
      Oc.delete(b2.pointerId);
      break;
    case "gotpointercapture":
    case "lostpointercapture":
      Pc.delete(b2.pointerId);
  }
}
function Tc(a, b2, c2, d2, e2, f2) {
  if (null === a || a.nativeEvent !== f2) return a = { blockedOn: b2, domEventName: c2, eventSystemFlags: d2, nativeEvent: f2, targetContainers: [e2] }, null !== b2 && (b2 = Cb(b2), null !== b2 && Fc(b2)), a;
  a.eventSystemFlags |= d2;
  b2 = a.targetContainers;
  null !== e2 && -1 === b2.indexOf(e2) && b2.push(e2);
  return a;
}
function Uc(a, b2, c2, d2, e2) {
  switch (b2) {
    case "focusin":
      return Lc = Tc(Lc, a, b2, c2, d2, e2), true;
    case "dragenter":
      return Mc = Tc(Mc, a, b2, c2, d2, e2), true;
    case "mouseover":
      return Nc = Tc(Nc, a, b2, c2, d2, e2), true;
    case "pointerover":
      var f2 = e2.pointerId;
      Oc.set(f2, Tc(Oc.get(f2) || null, a, b2, c2, d2, e2));
      return true;
    case "gotpointercapture":
      return f2 = e2.pointerId, Pc.set(f2, Tc(Pc.get(f2) || null, a, b2, c2, d2, e2)), true;
  }
  return false;
}
function Vc(a) {
  var b2 = Wc(a.target);
  if (null !== b2) {
    var c2 = Vb(b2);
    if (null !== c2) {
      if (b2 = c2.tag, 13 === b2) {
        if (b2 = Wb(c2), null !== b2) {
          a.blockedOn = b2;
          Ic(a.priority, function() {
            Gc(c2);
          });
          return;
        }
      } else if (3 === b2 && c2.stateNode.current.memoizedState.isDehydrated) {
        a.blockedOn = 3 === c2.tag ? c2.stateNode.containerInfo : null;
        return;
      }
    }
  }
  a.blockedOn = null;
}
function Xc(a) {
  if (null !== a.blockedOn) return false;
  for (var b2 = a.targetContainers; 0 < b2.length; ) {
    var c2 = Yc(a.domEventName, a.eventSystemFlags, b2[0], a.nativeEvent);
    if (null === c2) {
      c2 = a.nativeEvent;
      var d2 = new c2.constructor(c2.type, c2);
      wb = d2;
      c2.target.dispatchEvent(d2);
      wb = null;
    } else return b2 = Cb(c2), null !== b2 && Fc(b2), a.blockedOn = c2, false;
    b2.shift();
  }
  return true;
}
function Zc(a, b2, c2) {
  Xc(a) && c2.delete(b2);
}
function $c() {
  Jc = false;
  null !== Lc && Xc(Lc) && (Lc = null);
  null !== Mc && Xc(Mc) && (Mc = null);
  null !== Nc && Xc(Nc) && (Nc = null);
  Oc.forEach(Zc);
  Pc.forEach(Zc);
}
function ad(a, b2) {
  a.blockedOn === b2 && (a.blockedOn = null, Jc || (Jc = true, ca.unstable_scheduleCallback(ca.unstable_NormalPriority, $c)));
}
function bd(a) {
  function b2(b3) {
    return ad(b3, a);
  }
  if (0 < Kc.length) {
    ad(Kc[0], a);
    for (var c2 = 1; c2 < Kc.length; c2++) {
      var d2 = Kc[c2];
      d2.blockedOn === a && (d2.blockedOn = null);
    }
  }
  null !== Lc && ad(Lc, a);
  null !== Mc && ad(Mc, a);
  null !== Nc && ad(Nc, a);
  Oc.forEach(b2);
  Pc.forEach(b2);
  for (c2 = 0; c2 < Qc.length; c2++) d2 = Qc[c2], d2.blockedOn === a && (d2.blockedOn = null);
  for (; 0 < Qc.length && (c2 = Qc[0], null === c2.blockedOn); ) Vc(c2), null === c2.blockedOn && Qc.shift();
}
var cd = ua.ReactCurrentBatchConfig, dd = true;
function ed(a, b2, c2, d2) {
  var e2 = C$1, f2 = cd.transition;
  cd.transition = null;
  try {
    C$1 = 1, fd(a, b2, c2, d2);
  } finally {
    C$1 = e2, cd.transition = f2;
  }
}
function gd(a, b2, c2, d2) {
  var e2 = C$1, f2 = cd.transition;
  cd.transition = null;
  try {
    C$1 = 4, fd(a, b2, c2, d2);
  } finally {
    C$1 = e2, cd.transition = f2;
  }
}
function fd(a, b2, c2, d2) {
  if (dd) {
    var e2 = Yc(a, b2, c2, d2);
    if (null === e2) hd(a, b2, d2, id, c2), Sc(a, d2);
    else if (Uc(e2, a, b2, c2, d2)) d2.stopPropagation();
    else if (Sc(a, d2), b2 & 4 && -1 < Rc.indexOf(a)) {
      for (; null !== e2; ) {
        var f2 = Cb(e2);
        null !== f2 && Ec(f2);
        f2 = Yc(a, b2, c2, d2);
        null === f2 && hd(a, b2, d2, id, c2);
        if (f2 === e2) break;
        e2 = f2;
      }
      null !== e2 && d2.stopPropagation();
    } else hd(a, b2, d2, null, c2);
  }
}
var id = null;
function Yc(a, b2, c2, d2) {
  id = null;
  a = xb(d2);
  a = Wc(a);
  if (null !== a) if (b2 = Vb(a), null === b2) a = null;
  else if (c2 = b2.tag, 13 === c2) {
    a = Wb(b2);
    if (null !== a) return a;
    a = null;
  } else if (3 === c2) {
    if (b2.stateNode.current.memoizedState.isDehydrated) return 3 === b2.tag ? b2.stateNode.containerInfo : null;
    a = null;
  } else b2 !== a && (a = null);
  id = a;
  return null;
}
function jd(a) {
  switch (a) {
    case "cancel":
    case "click":
    case "close":
    case "contextmenu":
    case "copy":
    case "cut":
    case "auxclick":
    case "dblclick":
    case "dragend":
    case "dragstart":
    case "drop":
    case "focusin":
    case "focusout":
    case "input":
    case "invalid":
    case "keydown":
    case "keypress":
    case "keyup":
    case "mousedown":
    case "mouseup":
    case "paste":
    case "pause":
    case "play":
    case "pointercancel":
    case "pointerdown":
    case "pointerup":
    case "ratechange":
    case "reset":
    case "resize":
    case "seeked":
    case "submit":
    case "touchcancel":
    case "touchend":
    case "touchstart":
    case "volumechange":
    case "change":
    case "selectionchange":
    case "textInput":
    case "compositionstart":
    case "compositionend":
    case "compositionupdate":
    case "beforeblur":
    case "afterblur":
    case "beforeinput":
    case "blur":
    case "fullscreenchange":
    case "focus":
    case "hashchange":
    case "popstate":
    case "select":
    case "selectstart":
      return 1;
    case "drag":
    case "dragenter":
    case "dragexit":
    case "dragleave":
    case "dragover":
    case "mousemove":
    case "mouseout":
    case "mouseover":
    case "pointermove":
    case "pointerout":
    case "pointerover":
    case "scroll":
    case "toggle":
    case "touchmove":
    case "wheel":
    case "mouseenter":
    case "mouseleave":
    case "pointerenter":
    case "pointerleave":
      return 4;
    case "message":
      switch (ec()) {
        case fc:
          return 1;
        case gc:
          return 4;
        case hc:
        case ic:
          return 16;
        case jc:
          return 536870912;
        default:
          return 16;
      }
    default:
      return 16;
  }
}
var kd = null, ld = null, md = null;
function nd() {
  if (md) return md;
  var a, b2 = ld, c2 = b2.length, d2, e2 = "value" in kd ? kd.value : kd.textContent, f2 = e2.length;
  for (a = 0; a < c2 && b2[a] === e2[a]; a++) ;
  var g2 = c2 - a;
  for (d2 = 1; d2 <= g2 && b2[c2 - d2] === e2[f2 - d2]; d2++) ;
  return md = e2.slice(a, 1 < d2 ? 1 - d2 : void 0);
}
function od(a) {
  var b2 = a.keyCode;
  "charCode" in a ? (a = a.charCode, 0 === a && 13 === b2 && (a = 13)) : a = b2;
  10 === a && (a = 13);
  return 32 <= a || 13 === a ? a : 0;
}
function pd() {
  return true;
}
function qd() {
  return false;
}
function rd(a) {
  function b2(b3, d2, e2, f2, g2) {
    this._reactName = b3;
    this._targetInst = e2;
    this.type = d2;
    this.nativeEvent = f2;
    this.target = g2;
    this.currentTarget = null;
    for (var c2 in a) a.hasOwnProperty(c2) && (b3 = a[c2], this[c2] = b3 ? b3(f2) : f2[c2]);
    this.isDefaultPrevented = (null != f2.defaultPrevented ? f2.defaultPrevented : false === f2.returnValue) ? pd : qd;
    this.isPropagationStopped = qd;
    return this;
  }
  A$1(b2.prototype, { preventDefault: function() {
    this.defaultPrevented = true;
    var a2 = this.nativeEvent;
    a2 && (a2.preventDefault ? a2.preventDefault() : "unknown" !== typeof a2.returnValue && (a2.returnValue = false), this.isDefaultPrevented = pd);
  }, stopPropagation: function() {
    var a2 = this.nativeEvent;
    a2 && (a2.stopPropagation ? a2.stopPropagation() : "unknown" !== typeof a2.cancelBubble && (a2.cancelBubble = true), this.isPropagationStopped = pd);
  }, persist: function() {
  }, isPersistent: pd });
  return b2;
}
var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a) {
  return a.timeStamp || Date.now();
}, defaultPrevented: 0, isTrusted: 0 }, td = rd(sd), ud = A$1({}, sd, { view: 0, detail: 0 }), vd = rd(ud), wd, xd, yd, Ad = A$1({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a) {
  return void 0 === a.relatedTarget ? a.fromElement === a.srcElement ? a.toElement : a.fromElement : a.relatedTarget;
}, movementX: function(a) {
  if ("movementX" in a) return a.movementX;
  a !== yd && (yd && "mousemove" === a.type ? (wd = a.screenX - yd.screenX, xd = a.screenY - yd.screenY) : xd = wd = 0, yd = a);
  return wd;
}, movementY: function(a) {
  return "movementY" in a ? a.movementY : xd;
} }), Bd = rd(Ad), Cd = A$1({}, Ad, { dataTransfer: 0 }), Dd = rd(Cd), Ed = A$1({}, ud, { relatedTarget: 0 }), Fd = rd(Ed), Gd = A$1({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Hd = rd(Gd), Id = A$1({}, sd, { clipboardData: function(a) {
  return "clipboardData" in a ? a.clipboardData : window.clipboardData;
} }), Jd = rd(Id), Kd = A$1({}, sd, { data: 0 }), Ld = rd(Kd), Md = {
  Esc: "Escape",
  Spacebar: " ",
  Left: "ArrowLeft",
  Up: "ArrowUp",
  Right: "ArrowRight",
  Down: "ArrowDown",
  Del: "Delete",
  Win: "OS",
  Menu: "ContextMenu",
  Apps: "ContextMenu",
  Scroll: "ScrollLock",
  MozPrintableKey: "Unidentified"
}, Nd = {
  8: "Backspace",
  9: "Tab",
  12: "Clear",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  19: "Pause",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  45: "Insert",
  46: "Delete",
  112: "F1",
  113: "F2",
  114: "F3",
  115: "F4",
  116: "F5",
  117: "F6",
  118: "F7",
  119: "F8",
  120: "F9",
  121: "F10",
  122: "F11",
  123: "F12",
  144: "NumLock",
  145: "ScrollLock",
  224: "Meta"
}, Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
function Pd(a) {
  var b2 = this.nativeEvent;
  return b2.getModifierState ? b2.getModifierState(a) : (a = Od[a]) ? !!b2[a] : false;
}
function zd() {
  return Pd;
}
var Qd = A$1({}, ud, { key: function(a) {
  if (a.key) {
    var b2 = Md[a.key] || a.key;
    if ("Unidentified" !== b2) return b2;
  }
  return "keypress" === a.type ? (a = od(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? Nd[a.keyCode] || "Unidentified" : "";
}, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a) {
  return "keypress" === a.type ? od(a) : 0;
}, keyCode: function(a) {
  return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
}, which: function(a) {
  return "keypress" === a.type ? od(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0;
} }), Rd = rd(Qd), Sd = A$1({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), Td = rd(Sd), Ud = A$1({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }), Vd = rd(Ud), Wd = A$1({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xd = rd(Wd), Yd = A$1({}, Ad, {
  deltaX: function(a) {
    return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0;
  },
  deltaY: function(a) {
    return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0;
  },
  deltaZ: 0,
  deltaMode: 0
}), Zd = rd(Yd), $d = [9, 13, 27, 32], ae$1 = ia && "CompositionEvent" in window, be$1 = null;
ia && "documentMode" in document && (be$1 = document.documentMode);
var ce$1 = ia && "TextEvent" in window && !be$1, de$1 = ia && (!ae$1 || be$1 && 8 < be$1 && 11 >= be$1), ee$1 = String.fromCharCode(32), fe$1 = false;
function ge$1(a, b2) {
  switch (a) {
    case "keyup":
      return -1 !== $d.indexOf(b2.keyCode);
    case "keydown":
      return 229 !== b2.keyCode;
    case "keypress":
    case "mousedown":
    case "focusout":
      return true;
    default:
      return false;
  }
}
function he$1(a) {
  a = a.detail;
  return "object" === typeof a && "data" in a ? a.data : null;
}
var ie$1 = false;
function je$1(a, b2) {
  switch (a) {
    case "compositionend":
      return he$1(b2);
    case "keypress":
      if (32 !== b2.which) return null;
      fe$1 = true;
      return ee$1;
    case "textInput":
      return a = b2.data, a === ee$1 && fe$1 ? null : a;
    default:
      return null;
  }
}
function ke$1(a, b2) {
  if (ie$1) return "compositionend" === a || !ae$1 && ge$1(a, b2) ? (a = nd(), md = ld = kd = null, ie$1 = false, a) : null;
  switch (a) {
    case "paste":
      return null;
    case "keypress":
      if (!(b2.ctrlKey || b2.altKey || b2.metaKey) || b2.ctrlKey && b2.altKey) {
        if (b2.char && 1 < b2.char.length) return b2.char;
        if (b2.which) return String.fromCharCode(b2.which);
      }
      return null;
    case "compositionend":
      return de$1 && "ko" !== b2.locale ? null : b2.data;
    default:
      return null;
  }
}
var le$1 = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true };
function me(a) {
  var b2 = a && a.nodeName && a.nodeName.toLowerCase();
  return "input" === b2 ? !!le$1[a.type] : "textarea" === b2 ? true : false;
}
function ne$1(a, b2, c2, d2) {
  Eb(d2);
  b2 = oe$1(b2, "onChange");
  0 < b2.length && (c2 = new td("onChange", "change", null, c2, d2), a.push({ event: c2, listeners: b2 }));
}
var pe$1 = null, qe$1 = null;
function re$1(a) {
  se$1(a, 0);
}
function te$1(a) {
  var b2 = ue(a);
  if (Wa(b2)) return a;
}
function ve$1(a, b2) {
  if ("change" === a) return b2;
}
var we$1 = false;
if (ia) {
  var xe$1;
  if (ia) {
    var ye$1 = "oninput" in document;
    if (!ye$1) {
      var ze$1 = document.createElement("div");
      ze$1.setAttribute("oninput", "return;");
      ye$1 = "function" === typeof ze$1.oninput;
    }
    xe$1 = ye$1;
  } else xe$1 = false;
  we$1 = xe$1 && (!document.documentMode || 9 < document.documentMode);
}
function Ae$1() {
  pe$1 && (pe$1.detachEvent("onpropertychange", Be$1), qe$1 = pe$1 = null);
}
function Be$1(a) {
  if ("value" === a.propertyName && te$1(qe$1)) {
    var b2 = [];
    ne$1(b2, qe$1, a, xb(a));
    Jb(re$1, b2);
  }
}
function Ce(a, b2, c2) {
  "focusin" === a ? (Ae$1(), pe$1 = b2, qe$1 = c2, pe$1.attachEvent("onpropertychange", Be$1)) : "focusout" === a && Ae$1();
}
function De$1(a) {
  if ("selectionchange" === a || "keyup" === a || "keydown" === a) return te$1(qe$1);
}
function Ee$1(a, b2) {
  if ("click" === a) return te$1(b2);
}
function Fe$1(a, b2) {
  if ("input" === a || "change" === a) return te$1(b2);
}
function Ge(a, b2) {
  return a === b2 && (0 !== a || 1 / a === 1 / b2) || a !== a && b2 !== b2;
}
var He$1 = "function" === typeof Object.is ? Object.is : Ge;
function Ie(a, b2) {
  if (He$1(a, b2)) return true;
  if ("object" !== typeof a || null === a || "object" !== typeof b2 || null === b2) return false;
  var c2 = Object.keys(a), d2 = Object.keys(b2);
  if (c2.length !== d2.length) return false;
  for (d2 = 0; d2 < c2.length; d2++) {
    var e2 = c2[d2];
    if (!ja.call(b2, e2) || !He$1(a[e2], b2[e2])) return false;
  }
  return true;
}
function Je(a) {
  for (; a && a.firstChild; ) a = a.firstChild;
  return a;
}
function Ke(a, b2) {
  var c2 = Je(a);
  a = 0;
  for (var d2; c2; ) {
    if (3 === c2.nodeType) {
      d2 = a + c2.textContent.length;
      if (a <= b2 && d2 >= b2) return { node: c2, offset: b2 - a };
      a = d2;
    }
    a: {
      for (; c2; ) {
        if (c2.nextSibling) {
          c2 = c2.nextSibling;
          break a;
        }
        c2 = c2.parentNode;
      }
      c2 = void 0;
    }
    c2 = Je(c2);
  }
}
function Le$1(a, b2) {
  return a && b2 ? a === b2 ? true : a && 3 === a.nodeType ? false : b2 && 3 === b2.nodeType ? Le$1(a, b2.parentNode) : "contains" in a ? a.contains(b2) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b2) & 16) : false : false;
}
function Me$1() {
  for (var a = window, b2 = Xa(); b2 instanceof a.HTMLIFrameElement; ) {
    try {
      var c2 = "string" === typeof b2.contentWindow.location.href;
    } catch (d2) {
      c2 = false;
    }
    if (c2) a = b2.contentWindow;
    else break;
    b2 = Xa(a.document);
  }
  return b2;
}
function Ne$1(a) {
  var b2 = a && a.nodeName && a.nodeName.toLowerCase();
  return b2 && ("input" === b2 && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b2 || "true" === a.contentEditable);
}
function Oe$1(a) {
  var b2 = Me$1(), c2 = a.focusedElem, d2 = a.selectionRange;
  if (b2 !== c2 && c2 && c2.ownerDocument && Le$1(c2.ownerDocument.documentElement, c2)) {
    if (null !== d2 && Ne$1(c2)) {
      if (b2 = d2.start, a = d2.end, void 0 === a && (a = b2), "selectionStart" in c2) c2.selectionStart = b2, c2.selectionEnd = Math.min(a, c2.value.length);
      else if (a = (b2 = c2.ownerDocument || document) && b2.defaultView || window, a.getSelection) {
        a = a.getSelection();
        var e2 = c2.textContent.length, f2 = Math.min(d2.start, e2);
        d2 = void 0 === d2.end ? f2 : Math.min(d2.end, e2);
        !a.extend && f2 > d2 && (e2 = d2, d2 = f2, f2 = e2);
        e2 = Ke(c2, f2);
        var g2 = Ke(
          c2,
          d2
        );
        e2 && g2 && (1 !== a.rangeCount || a.anchorNode !== e2.node || a.anchorOffset !== e2.offset || a.focusNode !== g2.node || a.focusOffset !== g2.offset) && (b2 = b2.createRange(), b2.setStart(e2.node, e2.offset), a.removeAllRanges(), f2 > d2 ? (a.addRange(b2), a.extend(g2.node, g2.offset)) : (b2.setEnd(g2.node, g2.offset), a.addRange(b2)));
      }
    }
    b2 = [];
    for (a = c2; a = a.parentNode; ) 1 === a.nodeType && b2.push({ element: a, left: a.scrollLeft, top: a.scrollTop });
    "function" === typeof c2.focus && c2.focus();
    for (c2 = 0; c2 < b2.length; c2++) a = b2[c2], a.element.scrollLeft = a.left, a.element.scrollTop = a.top;
  }
}
var Pe = ia && "documentMode" in document && 11 >= document.documentMode, Qe = null, Re$1 = null, Se$1 = null, Te$1 = false;
function Ue(a, b2, c2) {
  var d2 = c2.window === c2 ? c2.document : 9 === c2.nodeType ? c2 : c2.ownerDocument;
  Te$1 || null == Qe || Qe !== Xa(d2) || (d2 = Qe, "selectionStart" in d2 && Ne$1(d2) ? d2 = { start: d2.selectionStart, end: d2.selectionEnd } : (d2 = (d2.ownerDocument && d2.ownerDocument.defaultView || window).getSelection(), d2 = { anchorNode: d2.anchorNode, anchorOffset: d2.anchorOffset, focusNode: d2.focusNode, focusOffset: d2.focusOffset }), Se$1 && Ie(Se$1, d2) || (Se$1 = d2, d2 = oe$1(Re$1, "onSelect"), 0 < d2.length && (b2 = new td("onSelect", "select", null, b2, c2), a.push({ event: b2, listeners: d2 }), b2.target = Qe)));
}
function Ve$1(a, b2) {
  var c2 = {};
  c2[a.toLowerCase()] = b2.toLowerCase();
  c2["Webkit" + a] = "webkit" + b2;
  c2["Moz" + a] = "moz" + b2;
  return c2;
}
var We$1 = { animationend: Ve$1("Animation", "AnimationEnd"), animationiteration: Ve$1("Animation", "AnimationIteration"), animationstart: Ve$1("Animation", "AnimationStart"), transitionend: Ve$1("Transition", "TransitionEnd") }, Xe$1 = {}, Ye$1 = {};
ia && (Ye$1 = document.createElement("div").style, "AnimationEvent" in window || (delete We$1.animationend.animation, delete We$1.animationiteration.animation, delete We$1.animationstart.animation), "TransitionEvent" in window || delete We$1.transitionend.transition);
function Ze(a) {
  if (Xe$1[a]) return Xe$1[a];
  if (!We$1[a]) return a;
  var b2 = We$1[a], c2;
  for (c2 in b2) if (b2.hasOwnProperty(c2) && c2 in Ye$1) return Xe$1[a] = b2[c2];
  return a;
}
var $e$1 = Ze("animationend"), af = Ze("animationiteration"), bf = Ze("animationstart"), cf = Ze("transitionend"), df = /* @__PURE__ */ new Map(), ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
function ff(a, b2) {
  df.set(a, b2);
  fa(b2, [a]);
}
for (var gf = 0; gf < ef.length; gf++) {
  var hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1);
  ff(jf, "on" + kf);
}
ff($e$1, "onAnimationEnd");
ff(af, "onAnimationIteration");
ff(bf, "onAnimationStart");
ff("dblclick", "onDoubleClick");
ff("focusin", "onFocus");
ff("focusout", "onBlur");
ff(cf, "onTransitionEnd");
ha("onMouseEnter", ["mouseout", "mouseover"]);
ha("onMouseLeave", ["mouseout", "mouseover"]);
ha("onPointerEnter", ["pointerout", "pointerover"]);
ha("onPointerLeave", ["pointerout", "pointerover"]);
fa("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" "));
fa("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));
fa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]);
fa("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" "));
fa("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" "));
fa("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));
function nf(a, b2, c2) {
  var d2 = a.type || "unknown-event";
  a.currentTarget = c2;
  Ub(d2, b2, void 0, a);
  a.currentTarget = null;
}
function se$1(a, b2) {
  b2 = 0 !== (b2 & 4);
  for (var c2 = 0; c2 < a.length; c2++) {
    var d2 = a[c2], e2 = d2.event;
    d2 = d2.listeners;
    a: {
      var f2 = void 0;
      if (b2) for (var g2 = d2.length - 1; 0 <= g2; g2--) {
        var h2 = d2[g2], k2 = h2.instance, l2 = h2.currentTarget;
        h2 = h2.listener;
        if (k2 !== f2 && e2.isPropagationStopped()) break a;
        nf(e2, h2, l2);
        f2 = k2;
      }
      else for (g2 = 0; g2 < d2.length; g2++) {
        h2 = d2[g2];
        k2 = h2.instance;
        l2 = h2.currentTarget;
        h2 = h2.listener;
        if (k2 !== f2 && e2.isPropagationStopped()) break a;
        nf(e2, h2, l2);
        f2 = k2;
      }
    }
  }
  if (Qb) throw a = Rb, Qb = false, Rb = null, a;
}
function D$1(a, b2) {
  var c2 = b2[of];
  void 0 === c2 && (c2 = b2[of] = /* @__PURE__ */ new Set());
  var d2 = a + "__bubble";
  c2.has(d2) || (pf(b2, a, 2, false), c2.add(d2));
}
function qf(a, b2, c2) {
  var d2 = 0;
  b2 && (d2 |= 4);
  pf(c2, a, d2, b2);
}
var rf = "_reactListening" + Math.random().toString(36).slice(2);
function sf(a) {
  if (!a[rf]) {
    a[rf] = true;
    da.forEach(function(b3) {
      "selectionchange" !== b3 && (mf.has(b3) || qf(b3, false, a), qf(b3, true, a));
    });
    var b2 = 9 === a.nodeType ? a : a.ownerDocument;
    null === b2 || b2[rf] || (b2[rf] = true, qf("selectionchange", false, b2));
  }
}
function pf(a, b2, c2, d2) {
  switch (jd(b2)) {
    case 1:
      var e2 = ed;
      break;
    case 4:
      e2 = gd;
      break;
    default:
      e2 = fd;
  }
  c2 = e2.bind(null, b2, c2, a);
  e2 = void 0;
  !Lb || "touchstart" !== b2 && "touchmove" !== b2 && "wheel" !== b2 || (e2 = true);
  d2 ? void 0 !== e2 ? a.addEventListener(b2, c2, { capture: true, passive: e2 }) : a.addEventListener(b2, c2, true) : void 0 !== e2 ? a.addEventListener(b2, c2, { passive: e2 }) : a.addEventListener(b2, c2, false);
}
function hd(a, b2, c2, d2, e2) {
  var f2 = d2;
  if (0 === (b2 & 1) && 0 === (b2 & 2) && null !== d2) a: for (; ; ) {
    if (null === d2) return;
    var g2 = d2.tag;
    if (3 === g2 || 4 === g2) {
      var h2 = d2.stateNode.containerInfo;
      if (h2 === e2 || 8 === h2.nodeType && h2.parentNode === e2) break;
      if (4 === g2) for (g2 = d2.return; null !== g2; ) {
        var k2 = g2.tag;
        if (3 === k2 || 4 === k2) {
          if (k2 = g2.stateNode.containerInfo, k2 === e2 || 8 === k2.nodeType && k2.parentNode === e2) return;
        }
        g2 = g2.return;
      }
      for (; null !== h2; ) {
        g2 = Wc(h2);
        if (null === g2) return;
        k2 = g2.tag;
        if (5 === k2 || 6 === k2) {
          d2 = f2 = g2;
          continue a;
        }
        h2 = h2.parentNode;
      }
    }
    d2 = d2.return;
  }
  Jb(function() {
    var d3 = f2, e3 = xb(c2), g3 = [];
    a: {
      var h3 = df.get(a);
      if (void 0 !== h3) {
        var k3 = td, n2 = a;
        switch (a) {
          case "keypress":
            if (0 === od(c2)) break a;
          case "keydown":
          case "keyup":
            k3 = Rd;
            break;
          case "focusin":
            n2 = "focus";
            k3 = Fd;
            break;
          case "focusout":
            n2 = "blur";
            k3 = Fd;
            break;
          case "beforeblur":
          case "afterblur":
            k3 = Fd;
            break;
          case "click":
            if (2 === c2.button) break a;
          case "auxclick":
          case "dblclick":
          case "mousedown":
          case "mousemove":
          case "mouseup":
          case "mouseout":
          case "mouseover":
          case "contextmenu":
            k3 = Bd;
            break;
          case "drag":
          case "dragend":
          case "dragenter":
          case "dragexit":
          case "dragleave":
          case "dragover":
          case "dragstart":
          case "drop":
            k3 = Dd;
            break;
          case "touchcancel":
          case "touchend":
          case "touchmove":
          case "touchstart":
            k3 = Vd;
            break;
          case $e$1:
          case af:
          case bf:
            k3 = Hd;
            break;
          case cf:
            k3 = Xd;
            break;
          case "scroll":
            k3 = vd;
            break;
          case "wheel":
            k3 = Zd;
            break;
          case "copy":
          case "cut":
          case "paste":
            k3 = Jd;
            break;
          case "gotpointercapture":
          case "lostpointercapture":
          case "pointercancel":
          case "pointerdown":
          case "pointermove":
          case "pointerout":
          case "pointerover":
          case "pointerup":
            k3 = Td;
        }
        var t2 = 0 !== (b2 & 4), J2 = !t2 && "scroll" === a, x2 = t2 ? null !== h3 ? h3 + "Capture" : null : h3;
        t2 = [];
        for (var w2 = d3, u2; null !== w2; ) {
          u2 = w2;
          var F2 = u2.stateNode;
          5 === u2.tag && null !== F2 && (u2 = F2, null !== x2 && (F2 = Kb(w2, x2), null != F2 && t2.push(tf(w2, F2, u2))));
          if (J2) break;
          w2 = w2.return;
        }
        0 < t2.length && (h3 = new k3(h3, n2, null, c2, e3), g3.push({ event: h3, listeners: t2 }));
      }
    }
    if (0 === (b2 & 7)) {
      a: {
        h3 = "mouseover" === a || "pointerover" === a;
        k3 = "mouseout" === a || "pointerout" === a;
        if (h3 && c2 !== wb && (n2 = c2.relatedTarget || c2.fromElement) && (Wc(n2) || n2[uf])) break a;
        if (k3 || h3) {
          h3 = e3.window === e3 ? e3 : (h3 = e3.ownerDocument) ? h3.defaultView || h3.parentWindow : window;
          if (k3) {
            if (n2 = c2.relatedTarget || c2.toElement, k3 = d3, n2 = n2 ? Wc(n2) : null, null !== n2 && (J2 = Vb(n2), n2 !== J2 || 5 !== n2.tag && 6 !== n2.tag)) n2 = null;
          } else k3 = null, n2 = d3;
          if (k3 !== n2) {
            t2 = Bd;
            F2 = "onMouseLeave";
            x2 = "onMouseEnter";
            w2 = "mouse";
            if ("pointerout" === a || "pointerover" === a) t2 = Td, F2 = "onPointerLeave", x2 = "onPointerEnter", w2 = "pointer";
            J2 = null == k3 ? h3 : ue(k3);
            u2 = null == n2 ? h3 : ue(n2);
            h3 = new t2(F2, w2 + "leave", k3, c2, e3);
            h3.target = J2;
            h3.relatedTarget = u2;
            F2 = null;
            Wc(e3) === d3 && (t2 = new t2(x2, w2 + "enter", n2, c2, e3), t2.target = u2, t2.relatedTarget = J2, F2 = t2);
            J2 = F2;
            if (k3 && n2) b: {
              t2 = k3;
              x2 = n2;
              w2 = 0;
              for (u2 = t2; u2; u2 = vf(u2)) w2++;
              u2 = 0;
              for (F2 = x2; F2; F2 = vf(F2)) u2++;
              for (; 0 < w2 - u2; ) t2 = vf(t2), w2--;
              for (; 0 < u2 - w2; ) x2 = vf(x2), u2--;
              for (; w2--; ) {
                if (t2 === x2 || null !== x2 && t2 === x2.alternate) break b;
                t2 = vf(t2);
                x2 = vf(x2);
              }
              t2 = null;
            }
            else t2 = null;
            null !== k3 && wf(g3, h3, k3, t2, false);
            null !== n2 && null !== J2 && wf(g3, J2, n2, t2, true);
          }
        }
      }
      a: {
        h3 = d3 ? ue(d3) : window;
        k3 = h3.nodeName && h3.nodeName.toLowerCase();
        if ("select" === k3 || "input" === k3 && "file" === h3.type) var na = ve$1;
        else if (me(h3)) if (we$1) na = Fe$1;
        else {
          na = De$1;
          var xa = Ce;
        }
        else (k3 = h3.nodeName) && "input" === k3.toLowerCase() && ("checkbox" === h3.type || "radio" === h3.type) && (na = Ee$1);
        if (na && (na = na(a, d3))) {
          ne$1(g3, na, c2, e3);
          break a;
        }
        xa && xa(a, h3, d3);
        "focusout" === a && (xa = h3._wrapperState) && xa.controlled && "number" === h3.type && cb(h3, "number", h3.value);
      }
      xa = d3 ? ue(d3) : window;
      switch (a) {
        case "focusin":
          if (me(xa) || "true" === xa.contentEditable) Qe = xa, Re$1 = d3, Se$1 = null;
          break;
        case "focusout":
          Se$1 = Re$1 = Qe = null;
          break;
        case "mousedown":
          Te$1 = true;
          break;
        case "contextmenu":
        case "mouseup":
        case "dragend":
          Te$1 = false;
          Ue(g3, c2, e3);
          break;
        case "selectionchange":
          if (Pe) break;
        case "keydown":
        case "keyup":
          Ue(g3, c2, e3);
      }
      var $a;
      if (ae$1) b: {
        switch (a) {
          case "compositionstart":
            var ba = "onCompositionStart";
            break b;
          case "compositionend":
            ba = "onCompositionEnd";
            break b;
          case "compositionupdate":
            ba = "onCompositionUpdate";
            break b;
        }
        ba = void 0;
      }
      else ie$1 ? ge$1(a, c2) && (ba = "onCompositionEnd") : "keydown" === a && 229 === c2.keyCode && (ba = "onCompositionStart");
      ba && (de$1 && "ko" !== c2.locale && (ie$1 || "onCompositionStart" !== ba ? "onCompositionEnd" === ba && ie$1 && ($a = nd()) : (kd = e3, ld = "value" in kd ? kd.value : kd.textContent, ie$1 = true)), xa = oe$1(d3, ba), 0 < xa.length && (ba = new Ld(ba, a, null, c2, e3), g3.push({ event: ba, listeners: xa }), $a ? ba.data = $a : ($a = he$1(c2), null !== $a && (ba.data = $a))));
      if ($a = ce$1 ? je$1(a, c2) : ke$1(a, c2)) d3 = oe$1(d3, "onBeforeInput"), 0 < d3.length && (e3 = new Ld("onBeforeInput", "beforeinput", null, c2, e3), g3.push({ event: e3, listeners: d3 }), e3.data = $a);
    }
    se$1(g3, b2);
  });
}
function tf(a, b2, c2) {
  return { instance: a, listener: b2, currentTarget: c2 };
}
function oe$1(a, b2) {
  for (var c2 = b2 + "Capture", d2 = []; null !== a; ) {
    var e2 = a, f2 = e2.stateNode;
    5 === e2.tag && null !== f2 && (e2 = f2, f2 = Kb(a, c2), null != f2 && d2.unshift(tf(a, f2, e2)), f2 = Kb(a, b2), null != f2 && d2.push(tf(a, f2, e2)));
    a = a.return;
  }
  return d2;
}
function vf(a) {
  if (null === a) return null;
  do
    a = a.return;
  while (a && 5 !== a.tag);
  return a ? a : null;
}
function wf(a, b2, c2, d2, e2) {
  for (var f2 = b2._reactName, g2 = []; null !== c2 && c2 !== d2; ) {
    var h2 = c2, k2 = h2.alternate, l2 = h2.stateNode;
    if (null !== k2 && k2 === d2) break;
    5 === h2.tag && null !== l2 && (h2 = l2, e2 ? (k2 = Kb(c2, f2), null != k2 && g2.unshift(tf(c2, k2, h2))) : e2 || (k2 = Kb(c2, f2), null != k2 && g2.push(tf(c2, k2, h2))));
    c2 = c2.return;
  }
  0 !== g2.length && a.push({ event: b2, listeners: g2 });
}
var xf = /\r\n?/g, yf = /\u0000|\uFFFD/g;
function zf(a) {
  return ("string" === typeof a ? a : "" + a).replace(xf, "\n").replace(yf, "");
}
function Af(a, b2, c2) {
  b2 = zf(b2);
  if (zf(a) !== b2 && c2) throw Error(p$2(425));
}
function Bf() {
}
var Cf = null, Df = null;
function Ef(a, b2) {
  return "textarea" === a || "noscript" === a || "string" === typeof b2.children || "number" === typeof b2.children || "object" === typeof b2.dangerouslySetInnerHTML && null !== b2.dangerouslySetInnerHTML && null != b2.dangerouslySetInnerHTML.__html;
}
var Ff = "function" === typeof setTimeout ? setTimeout : void 0, Gf = "function" === typeof clearTimeout ? clearTimeout : void 0, Hf = "function" === typeof Promise ? Promise : void 0, Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a) {
  return Hf.resolve(null).then(a).catch(If);
} : Ff;
function If(a) {
  setTimeout(function() {
    throw a;
  });
}
function Kf(a, b2) {
  var c2 = b2, d2 = 0;
  do {
    var e2 = c2.nextSibling;
    a.removeChild(c2);
    if (e2 && 8 === e2.nodeType) if (c2 = e2.data, "/$" === c2) {
      if (0 === d2) {
        a.removeChild(e2);
        bd(b2);
        return;
      }
      d2--;
    } else "$" !== c2 && "$?" !== c2 && "$!" !== c2 || d2++;
    c2 = e2;
  } while (c2);
  bd(b2);
}
function Lf(a) {
  for (; null != a; a = a.nextSibling) {
    var b2 = a.nodeType;
    if (1 === b2 || 3 === b2) break;
    if (8 === b2) {
      b2 = a.data;
      if ("$" === b2 || "$!" === b2 || "$?" === b2) break;
      if ("/$" === b2) return null;
    }
  }
  return a;
}
function Mf(a) {
  a = a.previousSibling;
  for (var b2 = 0; a; ) {
    if (8 === a.nodeType) {
      var c2 = a.data;
      if ("$" === c2 || "$!" === c2 || "$?" === c2) {
        if (0 === b2) return a;
        b2--;
      } else "/$" === c2 && b2++;
    }
    a = a.previousSibling;
  }
  return null;
}
var Nf = Math.random().toString(36).slice(2), Of = "__reactFiber$" + Nf, Pf = "__reactProps$" + Nf, uf = "__reactContainer$" + Nf, of = "__reactEvents$" + Nf, Qf = "__reactListeners$" + Nf, Rf = "__reactHandles$" + Nf;
function Wc(a) {
  var b2 = a[Of];
  if (b2) return b2;
  for (var c2 = a.parentNode; c2; ) {
    if (b2 = c2[uf] || c2[Of]) {
      c2 = b2.alternate;
      if (null !== b2.child || null !== c2 && null !== c2.child) for (a = Mf(a); null !== a; ) {
        if (c2 = a[Of]) return c2;
        a = Mf(a);
      }
      return b2;
    }
    a = c2;
    c2 = a.parentNode;
  }
  return null;
}
function Cb(a) {
  a = a[Of] || a[uf];
  return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a;
}
function ue(a) {
  if (5 === a.tag || 6 === a.tag) return a.stateNode;
  throw Error(p$2(33));
}
function Db(a) {
  return a[Pf] || null;
}
var Sf = [], Tf = -1;
function Uf(a) {
  return { current: a };
}
function E$1(a) {
  0 > Tf || (a.current = Sf[Tf], Sf[Tf] = null, Tf--);
}
function G$1(a, b2) {
  Tf++;
  Sf[Tf] = a.current;
  a.current = b2;
}
var Vf = {}, H$1 = Uf(Vf), Wf = Uf(false), Xf = Vf;
function Yf(a, b2) {
  var c2 = a.type.contextTypes;
  if (!c2) return Vf;
  var d2 = a.stateNode;
  if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2) return d2.__reactInternalMemoizedMaskedChildContext;
  var e2 = {}, f2;
  for (f2 in c2) e2[f2] = b2[f2];
  d2 && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b2, a.__reactInternalMemoizedMaskedChildContext = e2);
  return e2;
}
function Zf(a) {
  a = a.childContextTypes;
  return null !== a && void 0 !== a;
}
function $f() {
  E$1(Wf);
  E$1(H$1);
}
function ag(a, b2, c2) {
  if (H$1.current !== Vf) throw Error(p$2(168));
  G$1(H$1, b2);
  G$1(Wf, c2);
}
function bg(a, b2, c2) {
  var d2 = a.stateNode;
  b2 = b2.childContextTypes;
  if ("function" !== typeof d2.getChildContext) return c2;
  d2 = d2.getChildContext();
  for (var e2 in d2) if (!(e2 in b2)) throw Error(p$2(108, Ra(a) || "Unknown", e2));
  return A$1({}, c2, d2);
}
function cg(a) {
  a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Vf;
  Xf = H$1.current;
  G$1(H$1, a);
  G$1(Wf, Wf.current);
  return true;
}
function dg(a, b2, c2) {
  var d2 = a.stateNode;
  if (!d2) throw Error(p$2(169));
  c2 ? (a = bg(a, b2, Xf), d2.__reactInternalMemoizedMergedChildContext = a, E$1(Wf), E$1(H$1), G$1(H$1, a)) : E$1(Wf);
  G$1(Wf, c2);
}
var eg = null, fg = false, gg = false;
function hg(a) {
  null === eg ? eg = [a] : eg.push(a);
}
function ig(a) {
  fg = true;
  hg(a);
}
function jg() {
  if (!gg && null !== eg) {
    gg = true;
    var a = 0, b2 = C$1;
    try {
      var c2 = eg;
      for (C$1 = 1; a < c2.length; a++) {
        var d2 = c2[a];
        do
          d2 = d2(true);
        while (null !== d2);
      }
      eg = null;
      fg = false;
    } catch (e2) {
      throw null !== eg && (eg = eg.slice(a + 1)), ac(fc, jg), e2;
    } finally {
      C$1 = b2, gg = false;
    }
  }
  return null;
}
var kg = [], lg = 0, mg = null, ng = 0, og = [], pg = 0, qg = null, rg = 1, sg = "";
function tg(a, b2) {
  kg[lg++] = ng;
  kg[lg++] = mg;
  mg = a;
  ng = b2;
}
function ug(a, b2, c2) {
  og[pg++] = rg;
  og[pg++] = sg;
  og[pg++] = qg;
  qg = a;
  var d2 = rg;
  a = sg;
  var e2 = 32 - oc(d2) - 1;
  d2 &= ~(1 << e2);
  c2 += 1;
  var f2 = 32 - oc(b2) + e2;
  if (30 < f2) {
    var g2 = e2 - e2 % 5;
    f2 = (d2 & (1 << g2) - 1).toString(32);
    d2 >>= g2;
    e2 -= g2;
    rg = 1 << 32 - oc(b2) + e2 | c2 << e2 | d2;
    sg = f2 + a;
  } else rg = 1 << f2 | c2 << e2 | d2, sg = a;
}
function vg(a) {
  null !== a.return && (tg(a, 1), ug(a, 1, 0));
}
function wg(a) {
  for (; a === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null;
  for (; a === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null;
}
var xg = null, yg = null, I$1 = false, zg = null;
function Ag(a, b2) {
  var c2 = Bg(5, null, null, 0);
  c2.elementType = "DELETED";
  c2.stateNode = b2;
  c2.return = a;
  b2 = a.deletions;
  null === b2 ? (a.deletions = [c2], a.flags |= 16) : b2.push(c2);
}
function Cg(a, b2) {
  switch (a.tag) {
    case 5:
      var c2 = a.type;
      b2 = 1 !== b2.nodeType || c2.toLowerCase() !== b2.nodeName.toLowerCase() ? null : b2;
      return null !== b2 ? (a.stateNode = b2, xg = a, yg = Lf(b2.firstChild), true) : false;
    case 6:
      return b2 = "" === a.pendingProps || 3 !== b2.nodeType ? null : b2, null !== b2 ? (a.stateNode = b2, xg = a, yg = null, true) : false;
    case 13:
      return b2 = 8 !== b2.nodeType ? null : b2, null !== b2 ? (c2 = null !== qg ? { id: rg, overflow: sg } : null, a.memoizedState = { dehydrated: b2, treeContext: c2, retryLane: 1073741824 }, c2 = Bg(18, null, null, 0), c2.stateNode = b2, c2.return = a, a.child = c2, xg = a, yg = null, true) : false;
    default:
      return false;
  }
}
function Dg(a) {
  return 0 !== (a.mode & 1) && 0 === (a.flags & 128);
}
function Eg(a) {
  if (I$1) {
    var b2 = yg;
    if (b2) {
      var c2 = b2;
      if (!Cg(a, b2)) {
        if (Dg(a)) throw Error(p$2(418));
        b2 = Lf(c2.nextSibling);
        var d2 = xg;
        b2 && Cg(a, b2) ? Ag(d2, c2) : (a.flags = a.flags & -4097 | 2, I$1 = false, xg = a);
      }
    } else {
      if (Dg(a)) throw Error(p$2(418));
      a.flags = a.flags & -4097 | 2;
      I$1 = false;
      xg = a;
    }
  }
}
function Fg(a) {
  for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return;
  xg = a;
}
function Gg(a) {
  if (a !== xg) return false;
  if (!I$1) return Fg(a), I$1 = true, false;
  var b2;
  (b2 = 3 !== a.tag) && !(b2 = 5 !== a.tag) && (b2 = a.type, b2 = "head" !== b2 && "body" !== b2 && !Ef(a.type, a.memoizedProps));
  if (b2 && (b2 = yg)) {
    if (Dg(a)) throw Hg(), Error(p$2(418));
    for (; b2; ) Ag(a, b2), b2 = Lf(b2.nextSibling);
  }
  Fg(a);
  if (13 === a.tag) {
    a = a.memoizedState;
    a = null !== a ? a.dehydrated : null;
    if (!a) throw Error(p$2(317));
    a: {
      a = a.nextSibling;
      for (b2 = 0; a; ) {
        if (8 === a.nodeType) {
          var c2 = a.data;
          if ("/$" === c2) {
            if (0 === b2) {
              yg = Lf(a.nextSibling);
              break a;
            }
            b2--;
          } else "$" !== c2 && "$!" !== c2 && "$?" !== c2 || b2++;
        }
        a = a.nextSibling;
      }
      yg = null;
    }
  } else yg = xg ? Lf(a.stateNode.nextSibling) : null;
  return true;
}
function Hg() {
  for (var a = yg; a; ) a = Lf(a.nextSibling);
}
function Ig() {
  yg = xg = null;
  I$1 = false;
}
function Jg(a) {
  null === zg ? zg = [a] : zg.push(a);
}
var Kg = ua.ReactCurrentBatchConfig;
function Lg(a, b2, c2) {
  a = c2.ref;
  if (null !== a && "function" !== typeof a && "object" !== typeof a) {
    if (c2._owner) {
      c2 = c2._owner;
      if (c2) {
        if (1 !== c2.tag) throw Error(p$2(309));
        var d2 = c2.stateNode;
      }
      if (!d2) throw Error(p$2(147, a));
      var e2 = d2, f2 = "" + a;
      if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f2) return b2.ref;
      b2 = function(a2) {
        var b3 = e2.refs;
        null === a2 ? delete b3[f2] : b3[f2] = a2;
      };
      b2._stringRef = f2;
      return b2;
    }
    if ("string" !== typeof a) throw Error(p$2(284));
    if (!c2._owner) throw Error(p$2(290, a));
  }
  return a;
}
function Mg(a, b2) {
  a = Object.prototype.toString.call(b2);
  throw Error(p$2(31, "[object Object]" === a ? "object with keys {" + Object.keys(b2).join(", ") + "}" : a));
}
function Ng(a) {
  var b2 = a._init;
  return b2(a._payload);
}
function Og(a) {
  function b2(b3, c3) {
    if (a) {
      var d3 = b3.deletions;
      null === d3 ? (b3.deletions = [c3], b3.flags |= 16) : d3.push(c3);
    }
  }
  function c2(c3, d3) {
    if (!a) return null;
    for (; null !== d3; ) b2(c3, d3), d3 = d3.sibling;
    return null;
  }
  function d2(a2, b3) {
    for (a2 = /* @__PURE__ */ new Map(); null !== b3; ) null !== b3.key ? a2.set(b3.key, b3) : a2.set(b3.index, b3), b3 = b3.sibling;
    return a2;
  }
  function e2(a2, b3) {
    a2 = Pg(a2, b3);
    a2.index = 0;
    a2.sibling = null;
    return a2;
  }
  function f2(b3, c3, d3) {
    b3.index = d3;
    if (!a) return b3.flags |= 1048576, c3;
    d3 = b3.alternate;
    if (null !== d3) return d3 = d3.index, d3 < c3 ? (b3.flags |= 2, c3) : d3;
    b3.flags |= 2;
    return c3;
  }
  function g2(b3) {
    a && null === b3.alternate && (b3.flags |= 2);
    return b3;
  }
  function h2(a2, b3, c3, d3) {
    if (null === b3 || 6 !== b3.tag) return b3 = Qg(c3, a2.mode, d3), b3.return = a2, b3;
    b3 = e2(b3, c3);
    b3.return = a2;
    return b3;
  }
  function k2(a2, b3, c3, d3) {
    var f3 = c3.type;
    if (f3 === ya) return m2(a2, b3, c3.props.children, d3, c3.key);
    if (null !== b3 && (b3.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === Ha && Ng(f3) === b3.type)) return d3 = e2(b3, c3.props), d3.ref = Lg(a2, b3, c3), d3.return = a2, d3;
    d3 = Rg(c3.type, c3.key, c3.props, null, a2.mode, d3);
    d3.ref = Lg(a2, b3, c3);
    d3.return = a2;
    return d3;
  }
  function l2(a2, b3, c3, d3) {
    if (null === b3 || 4 !== b3.tag || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation) return b3 = Sg(c3, a2.mode, d3), b3.return = a2, b3;
    b3 = e2(b3, c3.children || []);
    b3.return = a2;
    return b3;
  }
  function m2(a2, b3, c3, d3, f3) {
    if (null === b3 || 7 !== b3.tag) return b3 = Tg(c3, a2.mode, d3, f3), b3.return = a2, b3;
    b3 = e2(b3, c3);
    b3.return = a2;
    return b3;
  }
  function q2(a2, b3, c3) {
    if ("string" === typeof b3 && "" !== b3 || "number" === typeof b3) return b3 = Qg("" + b3, a2.mode, c3), b3.return = a2, b3;
    if ("object" === typeof b3 && null !== b3) {
      switch (b3.$$typeof) {
        case va:
          return c3 = Rg(b3.type, b3.key, b3.props, null, a2.mode, c3), c3.ref = Lg(a2, null, b3), c3.return = a2, c3;
        case wa:
          return b3 = Sg(b3, a2.mode, c3), b3.return = a2, b3;
        case Ha:
          var d3 = b3._init;
          return q2(a2, d3(b3._payload), c3);
      }
      if (eb(b3) || Ka(b3)) return b3 = Tg(b3, a2.mode, c3, null), b3.return = a2, b3;
      Mg(a2, b3);
    }
    return null;
  }
  function r2(a2, b3, c3, d3) {
    var e3 = null !== b3 ? b3.key : null;
    if ("string" === typeof c3 && "" !== c3 || "number" === typeof c3) return null !== e3 ? null : h2(a2, b3, "" + c3, d3);
    if ("object" === typeof c3 && null !== c3) {
      switch (c3.$$typeof) {
        case va:
          return c3.key === e3 ? k2(a2, b3, c3, d3) : null;
        case wa:
          return c3.key === e3 ? l2(a2, b3, c3, d3) : null;
        case Ha:
          return e3 = c3._init, r2(
            a2,
            b3,
            e3(c3._payload),
            d3
          );
      }
      if (eb(c3) || Ka(c3)) return null !== e3 ? null : m2(a2, b3, c3, d3, null);
      Mg(a2, c3);
    }
    return null;
  }
  function y2(a2, b3, c3, d3, e3) {
    if ("string" === typeof d3 && "" !== d3 || "number" === typeof d3) return a2 = a2.get(c3) || null, h2(b3, a2, "" + d3, e3);
    if ("object" === typeof d3 && null !== d3) {
      switch (d3.$$typeof) {
        case va:
          return a2 = a2.get(null === d3.key ? c3 : d3.key) || null, k2(b3, a2, d3, e3);
        case wa:
          return a2 = a2.get(null === d3.key ? c3 : d3.key) || null, l2(b3, a2, d3, e3);
        case Ha:
          var f3 = d3._init;
          return y2(a2, b3, c3, f3(d3._payload), e3);
      }
      if (eb(d3) || Ka(d3)) return a2 = a2.get(c3) || null, m2(b3, a2, d3, e3, null);
      Mg(b3, d3);
    }
    return null;
  }
  function n2(e3, g3, h3, k3) {
    for (var l3 = null, m3 = null, u2 = g3, w2 = g3 = 0, x2 = null; null !== u2 && w2 < h3.length; w2++) {
      u2.index > w2 ? (x2 = u2, u2 = null) : x2 = u2.sibling;
      var n3 = r2(e3, u2, h3[w2], k3);
      if (null === n3) {
        null === u2 && (u2 = x2);
        break;
      }
      a && u2 && null === n3.alternate && b2(e3, u2);
      g3 = f2(n3, g3, w2);
      null === m3 ? l3 = n3 : m3.sibling = n3;
      m3 = n3;
      u2 = x2;
    }
    if (w2 === h3.length) return c2(e3, u2), I$1 && tg(e3, w2), l3;
    if (null === u2) {
      for (; w2 < h3.length; w2++) u2 = q2(e3, h3[w2], k3), null !== u2 && (g3 = f2(u2, g3, w2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2);
      I$1 && tg(e3, w2);
      return l3;
    }
    for (u2 = d2(e3, u2); w2 < h3.length; w2++) x2 = y2(u2, e3, w2, h3[w2], k3), null !== x2 && (a && null !== x2.alternate && u2.delete(null === x2.key ? w2 : x2.key), g3 = f2(x2, g3, w2), null === m3 ? l3 = x2 : m3.sibling = x2, m3 = x2);
    a && u2.forEach(function(a2) {
      return b2(e3, a2);
    });
    I$1 && tg(e3, w2);
    return l3;
  }
  function t2(e3, g3, h3, k3) {
    var l3 = Ka(h3);
    if ("function" !== typeof l3) throw Error(p$2(150));
    h3 = l3.call(h3);
    if (null == h3) throw Error(p$2(151));
    for (var u2 = l3 = null, m3 = g3, w2 = g3 = 0, x2 = null, n3 = h3.next(); null !== m3 && !n3.done; w2++, n3 = h3.next()) {
      m3.index > w2 ? (x2 = m3, m3 = null) : x2 = m3.sibling;
      var t3 = r2(e3, m3, n3.value, k3);
      if (null === t3) {
        null === m3 && (m3 = x2);
        break;
      }
      a && m3 && null === t3.alternate && b2(e3, m3);
      g3 = f2(t3, g3, w2);
      null === u2 ? l3 = t3 : u2.sibling = t3;
      u2 = t3;
      m3 = x2;
    }
    if (n3.done) return c2(
      e3,
      m3
    ), I$1 && tg(e3, w2), l3;
    if (null === m3) {
      for (; !n3.done; w2++, n3 = h3.next()) n3 = q2(e3, n3.value, k3), null !== n3 && (g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3);
      I$1 && tg(e3, w2);
      return l3;
    }
    for (m3 = d2(e3, m3); !n3.done; w2++, n3 = h3.next()) n3 = y2(m3, e3, w2, n3.value, k3), null !== n3 && (a && null !== n3.alternate && m3.delete(null === n3.key ? w2 : n3.key), g3 = f2(n3, g3, w2), null === u2 ? l3 = n3 : u2.sibling = n3, u2 = n3);
    a && m3.forEach(function(a2) {
      return b2(e3, a2);
    });
    I$1 && tg(e3, w2);
    return l3;
  }
  function J2(a2, d3, f3, h3) {
    "object" === typeof f3 && null !== f3 && f3.type === ya && null === f3.key && (f3 = f3.props.children);
    if ("object" === typeof f3 && null !== f3) {
      switch (f3.$$typeof) {
        case va:
          a: {
            for (var k3 = f3.key, l3 = d3; null !== l3; ) {
              if (l3.key === k3) {
                k3 = f3.type;
                if (k3 === ya) {
                  if (7 === l3.tag) {
                    c2(a2, l3.sibling);
                    d3 = e2(l3, f3.props.children);
                    d3.return = a2;
                    a2 = d3;
                    break a;
                  }
                } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === Ha && Ng(k3) === l3.type) {
                  c2(a2, l3.sibling);
                  d3 = e2(l3, f3.props);
                  d3.ref = Lg(a2, l3, f3);
                  d3.return = a2;
                  a2 = d3;
                  break a;
                }
                c2(a2, l3);
                break;
              } else b2(a2, l3);
              l3 = l3.sibling;
            }
            f3.type === ya ? (d3 = Tg(f3.props.children, a2.mode, h3, f3.key), d3.return = a2, a2 = d3) : (h3 = Rg(f3.type, f3.key, f3.props, null, a2.mode, h3), h3.ref = Lg(a2, d3, f3), h3.return = a2, a2 = h3);
          }
          return g2(a2);
        case wa:
          a: {
            for (l3 = f3.key; null !== d3; ) {
              if (d3.key === l3) if (4 === d3.tag && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) {
                c2(a2, d3.sibling);
                d3 = e2(d3, f3.children || []);
                d3.return = a2;
                a2 = d3;
                break a;
              } else {
                c2(a2, d3);
                break;
              }
              else b2(a2, d3);
              d3 = d3.sibling;
            }
            d3 = Sg(f3, a2.mode, h3);
            d3.return = a2;
            a2 = d3;
          }
          return g2(a2);
        case Ha:
          return l3 = f3._init, J2(a2, d3, l3(f3._payload), h3);
      }
      if (eb(f3)) return n2(a2, d3, f3, h3);
      if (Ka(f3)) return t2(a2, d3, f3, h3);
      Mg(a2, f3);
    }
    return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d3 && 6 === d3.tag ? (c2(a2, d3.sibling), d3 = e2(d3, f3), d3.return = a2, a2 = d3) : (c2(a2, d3), d3 = Qg(f3, a2.mode, h3), d3.return = a2, a2 = d3), g2(a2)) : c2(a2, d3);
  }
  return J2;
}
var Ug = Og(true), Vg = Og(false), Wg = Uf(null), Xg = null, Yg = null, Zg = null;
function $g() {
  Zg = Yg = Xg = null;
}
function ah(a) {
  var b2 = Wg.current;
  E$1(Wg);
  a._currentValue = b2;
}
function bh(a, b2, c2) {
  for (; null !== a; ) {
    var d2 = a.alternate;
    (a.childLanes & b2) !== b2 ? (a.childLanes |= b2, null !== d2 && (d2.childLanes |= b2)) : null !== d2 && (d2.childLanes & b2) !== b2 && (d2.childLanes |= b2);
    if (a === c2) break;
    a = a.return;
  }
}
function ch(a, b2) {
  Xg = a;
  Zg = Yg = null;
  a = a.dependencies;
  null !== a && null !== a.firstContext && (0 !== (a.lanes & b2) && (dh = true), a.firstContext = null);
}
function eh(a) {
  var b2 = a._currentValue;
  if (Zg !== a) if (a = { context: a, memoizedValue: b2, next: null }, null === Yg) {
    if (null === Xg) throw Error(p$2(308));
    Yg = a;
    Xg.dependencies = { lanes: 0, firstContext: a };
  } else Yg = Yg.next = a;
  return b2;
}
var fh = null;
function gh(a) {
  null === fh ? fh = [a] : fh.push(a);
}
function hh(a, b2, c2, d2) {
  var e2 = b2.interleaved;
  null === e2 ? (c2.next = c2, gh(b2)) : (c2.next = e2.next, e2.next = c2);
  b2.interleaved = c2;
  return ih(a, d2);
}
function ih(a, b2) {
  a.lanes |= b2;
  var c2 = a.alternate;
  null !== c2 && (c2.lanes |= b2);
  c2 = a;
  for (a = a.return; null !== a; ) a.childLanes |= b2, c2 = a.alternate, null !== c2 && (c2.childLanes |= b2), c2 = a, a = a.return;
  return 3 === c2.tag ? c2.stateNode : null;
}
var jh = false;
function kh(a) {
  a.updateQueue = { baseState: a.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
}
function lh(a, b2) {
  a = a.updateQueue;
  b2.updateQueue === a && (b2.updateQueue = { baseState: a.baseState, firstBaseUpdate: a.firstBaseUpdate, lastBaseUpdate: a.lastBaseUpdate, shared: a.shared, effects: a.effects });
}
function mh(a, b2) {
  return { eventTime: a, lane: b2, tag: 0, payload: null, callback: null, next: null };
}
function nh(a, b2, c2) {
  var d2 = a.updateQueue;
  if (null === d2) return null;
  d2 = d2.shared;
  if (0 !== (K$1 & 2)) {
    var e2 = d2.pending;
    null === e2 ? b2.next = b2 : (b2.next = e2.next, e2.next = b2);
    d2.pending = b2;
    return ih(a, c2);
  }
  e2 = d2.interleaved;
  null === e2 ? (b2.next = b2, gh(d2)) : (b2.next = e2.next, e2.next = b2);
  d2.interleaved = b2;
  return ih(a, c2);
}
function oh(a, b2, c2) {
  b2 = b2.updateQueue;
  if (null !== b2 && (b2 = b2.shared, 0 !== (c2 & 4194240))) {
    var d2 = b2.lanes;
    d2 &= a.pendingLanes;
    c2 |= d2;
    b2.lanes = c2;
    Cc(a, c2);
  }
}
function ph(a, b2) {
  var c2 = a.updateQueue, d2 = a.alternate;
  if (null !== d2 && (d2 = d2.updateQueue, c2 === d2)) {
    var e2 = null, f2 = null;
    c2 = c2.firstBaseUpdate;
    if (null !== c2) {
      do {
        var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null };
        null === f2 ? e2 = f2 = g2 : f2 = f2.next = g2;
        c2 = c2.next;
      } while (null !== c2);
      null === f2 ? e2 = f2 = b2 : f2 = f2.next = b2;
    } else e2 = f2 = b2;
    c2 = { baseState: d2.baseState, firstBaseUpdate: e2, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects };
    a.updateQueue = c2;
    return;
  }
  a = c2.lastBaseUpdate;
  null === a ? c2.firstBaseUpdate = b2 : a.next = b2;
  c2.lastBaseUpdate = b2;
}
function qh(a, b2, c2, d2) {
  var e2 = a.updateQueue;
  jh = false;
  var f2 = e2.firstBaseUpdate, g2 = e2.lastBaseUpdate, h2 = e2.shared.pending;
  if (null !== h2) {
    e2.shared.pending = null;
    var k2 = h2, l2 = k2.next;
    k2.next = null;
    null === g2 ? f2 = l2 : g2.next = l2;
    g2 = k2;
    var m2 = a.alternate;
    null !== m2 && (m2 = m2.updateQueue, h2 = m2.lastBaseUpdate, h2 !== g2 && (null === h2 ? m2.firstBaseUpdate = l2 : h2.next = l2, m2.lastBaseUpdate = k2));
  }
  if (null !== f2) {
    var q2 = e2.baseState;
    g2 = 0;
    m2 = l2 = k2 = null;
    h2 = f2;
    do {
      var r2 = h2.lane, y2 = h2.eventTime;
      if ((d2 & r2) === r2) {
        null !== m2 && (m2 = m2.next = {
          eventTime: y2,
          lane: 0,
          tag: h2.tag,
          payload: h2.payload,
          callback: h2.callback,
          next: null
        });
        a: {
          var n2 = a, t2 = h2;
          r2 = b2;
          y2 = c2;
          switch (t2.tag) {
            case 1:
              n2 = t2.payload;
              if ("function" === typeof n2) {
                q2 = n2.call(y2, q2, r2);
                break a;
              }
              q2 = n2;
              break a;
            case 3:
              n2.flags = n2.flags & -65537 | 128;
            case 0:
              n2 = t2.payload;
              r2 = "function" === typeof n2 ? n2.call(y2, q2, r2) : n2;
              if (null === r2 || void 0 === r2) break a;
              q2 = A$1({}, q2, r2);
              break a;
            case 2:
              jh = true;
          }
        }
        null !== h2.callback && 0 !== h2.lane && (a.flags |= 64, r2 = e2.effects, null === r2 ? e2.effects = [h2] : r2.push(h2));
      } else y2 = { eventTime: y2, lane: r2, tag: h2.tag, payload: h2.payload, callback: h2.callback, next: null }, null === m2 ? (l2 = m2 = y2, k2 = q2) : m2 = m2.next = y2, g2 |= r2;
      h2 = h2.next;
      if (null === h2) if (h2 = e2.shared.pending, null === h2) break;
      else r2 = h2, h2 = r2.next, r2.next = null, e2.lastBaseUpdate = r2, e2.shared.pending = null;
    } while (1);
    null === m2 && (k2 = q2);
    e2.baseState = k2;
    e2.firstBaseUpdate = l2;
    e2.lastBaseUpdate = m2;
    b2 = e2.shared.interleaved;
    if (null !== b2) {
      e2 = b2;
      do
        g2 |= e2.lane, e2 = e2.next;
      while (e2 !== b2);
    } else null === f2 && (e2.shared.lanes = 0);
    rh |= g2;
    a.lanes = g2;
    a.memoizedState = q2;
  }
}
function sh(a, b2, c2) {
  a = b2.effects;
  b2.effects = null;
  if (null !== a) for (b2 = 0; b2 < a.length; b2++) {
    var d2 = a[b2], e2 = d2.callback;
    if (null !== e2) {
      d2.callback = null;
      d2 = c2;
      if ("function" !== typeof e2) throw Error(p$2(191, e2));
      e2.call(d2);
    }
  }
}
var th = {}, uh = Uf(th), vh = Uf(th), wh = Uf(th);
function xh(a) {
  if (a === th) throw Error(p$2(174));
  return a;
}
function yh(a, b2) {
  G$1(wh, b2);
  G$1(vh, a);
  G$1(uh, th);
  a = b2.nodeType;
  switch (a) {
    case 9:
    case 11:
      b2 = (b2 = b2.documentElement) ? b2.namespaceURI : lb(null, "");
      break;
    default:
      a = 8 === a ? b2.parentNode : b2, b2 = a.namespaceURI || null, a = a.tagName, b2 = lb(b2, a);
  }
  E$1(uh);
  G$1(uh, b2);
}
function zh() {
  E$1(uh);
  E$1(vh);
  E$1(wh);
}
function Ah(a) {
  xh(wh.current);
  var b2 = xh(uh.current);
  var c2 = lb(b2, a.type);
  b2 !== c2 && (G$1(vh, a), G$1(uh, c2));
}
function Bh(a) {
  vh.current === a && (E$1(uh), E$1(vh));
}
var L$1 = Uf(0);
function Ch(a) {
  for (var b2 = a; null !== b2; ) {
    if (13 === b2.tag) {
      var c2 = b2.memoizedState;
      if (null !== c2 && (c2 = c2.dehydrated, null === c2 || "$?" === c2.data || "$!" === c2.data)) return b2;
    } else if (19 === b2.tag && void 0 !== b2.memoizedProps.revealOrder) {
      if (0 !== (b2.flags & 128)) return b2;
    } else if (null !== b2.child) {
      b2.child.return = b2;
      b2 = b2.child;
      continue;
    }
    if (b2 === a) break;
    for (; null === b2.sibling; ) {
      if (null === b2.return || b2.return === a) return null;
      b2 = b2.return;
    }
    b2.sibling.return = b2.return;
    b2 = b2.sibling;
  }
  return null;
}
var Dh = [];
function Eh() {
  for (var a = 0; a < Dh.length; a++) Dh[a]._workInProgressVersionPrimary = null;
  Dh.length = 0;
}
var Fh = ua.ReactCurrentDispatcher, Gh = ua.ReactCurrentBatchConfig, Hh = 0, M$1 = null, N$1 = null, O = null, Ih = false, Jh = false, Kh = 0, Lh = 0;
function P$1() {
  throw Error(p$2(321));
}
function Mh(a, b2) {
  if (null === b2) return false;
  for (var c2 = 0; c2 < b2.length && c2 < a.length; c2++) if (!He$1(a[c2], b2[c2])) return false;
  return true;
}
function Nh(a, b2, c2, d2, e2, f2) {
  Hh = f2;
  M$1 = b2;
  b2.memoizedState = null;
  b2.updateQueue = null;
  b2.lanes = 0;
  Fh.current = null === a || null === a.memoizedState ? Oh : Ph;
  a = c2(d2, e2);
  if (Jh) {
    f2 = 0;
    do {
      Jh = false;
      Kh = 0;
      if (25 <= f2) throw Error(p$2(301));
      f2 += 1;
      O = N$1 = null;
      b2.updateQueue = null;
      Fh.current = Qh;
      a = c2(d2, e2);
    } while (Jh);
  }
  Fh.current = Rh;
  b2 = null !== N$1 && null !== N$1.next;
  Hh = 0;
  O = N$1 = M$1 = null;
  Ih = false;
  if (b2) throw Error(p$2(300));
  return a;
}
function Sh() {
  var a = 0 !== Kh;
  Kh = 0;
  return a;
}
function Th() {
  var a = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
  null === O ? M$1.memoizedState = O = a : O = O.next = a;
  return O;
}
function Uh() {
  if (null === N$1) {
    var a = M$1.alternate;
    a = null !== a ? a.memoizedState : null;
  } else a = N$1.next;
  var b2 = null === O ? M$1.memoizedState : O.next;
  if (null !== b2) O = b2, N$1 = a;
  else {
    if (null === a) throw Error(p$2(310));
    N$1 = a;
    a = { memoizedState: N$1.memoizedState, baseState: N$1.baseState, baseQueue: N$1.baseQueue, queue: N$1.queue, next: null };
    null === O ? M$1.memoizedState = O = a : O = O.next = a;
  }
  return O;
}
function Vh(a, b2) {
  return "function" === typeof b2 ? b2(a) : b2;
}
function Wh(a) {
  var b2 = Uh(), c2 = b2.queue;
  if (null === c2) throw Error(p$2(311));
  c2.lastRenderedReducer = a;
  var d2 = N$1, e2 = d2.baseQueue, f2 = c2.pending;
  if (null !== f2) {
    if (null !== e2) {
      var g2 = e2.next;
      e2.next = f2.next;
      f2.next = g2;
    }
    d2.baseQueue = e2 = f2;
    c2.pending = null;
  }
  if (null !== e2) {
    f2 = e2.next;
    d2 = d2.baseState;
    var h2 = g2 = null, k2 = null, l2 = f2;
    do {
      var m2 = l2.lane;
      if ((Hh & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d2 = l2.hasEagerState ? l2.eagerState : a(d2, l2.action);
      else {
        var q2 = {
          lane: m2,
          action: l2.action,
          hasEagerState: l2.hasEagerState,
          eagerState: l2.eagerState,
          next: null
        };
        null === k2 ? (h2 = k2 = q2, g2 = d2) : k2 = k2.next = q2;
        M$1.lanes |= m2;
        rh |= m2;
      }
      l2 = l2.next;
    } while (null !== l2 && l2 !== f2);
    null === k2 ? g2 = d2 : k2.next = h2;
    He$1(d2, b2.memoizedState) || (dh = true);
    b2.memoizedState = d2;
    b2.baseState = g2;
    b2.baseQueue = k2;
    c2.lastRenderedState = d2;
  }
  a = c2.interleaved;
  if (null !== a) {
    e2 = a;
    do
      f2 = e2.lane, M$1.lanes |= f2, rh |= f2, e2 = e2.next;
    while (e2 !== a);
  } else null === e2 && (c2.lanes = 0);
  return [b2.memoizedState, c2.dispatch];
}
function Xh(a) {
  var b2 = Uh(), c2 = b2.queue;
  if (null === c2) throw Error(p$2(311));
  c2.lastRenderedReducer = a;
  var d2 = c2.dispatch, e2 = c2.pending, f2 = b2.memoizedState;
  if (null !== e2) {
    c2.pending = null;
    var g2 = e2 = e2.next;
    do
      f2 = a(f2, g2.action), g2 = g2.next;
    while (g2 !== e2);
    He$1(f2, b2.memoizedState) || (dh = true);
    b2.memoizedState = f2;
    null === b2.baseQueue && (b2.baseState = f2);
    c2.lastRenderedState = f2;
  }
  return [f2, d2];
}
function Yh() {
}
function Zh(a, b2) {
  var c2 = M$1, d2 = Uh(), e2 = b2(), f2 = !He$1(d2.memoizedState, e2);
  f2 && (d2.memoizedState = e2, dh = true);
  d2 = d2.queue;
  $h(ai.bind(null, c2, d2, a), [a]);
  if (d2.getSnapshot !== b2 || f2 || null !== O && O.memoizedState.tag & 1) {
    c2.flags |= 2048;
    bi(9, ci.bind(null, c2, d2, e2, b2), void 0, null);
    if (null === Q$1) throw Error(p$2(349));
    0 !== (Hh & 30) || di(c2, b2, e2);
  }
  return e2;
}
function di(a, b2, c2) {
  a.flags |= 16384;
  a = { getSnapshot: b2, value: c2 };
  b2 = M$1.updateQueue;
  null === b2 ? (b2 = { lastEffect: null, stores: null }, M$1.updateQueue = b2, b2.stores = [a]) : (c2 = b2.stores, null === c2 ? b2.stores = [a] : c2.push(a));
}
function ci(a, b2, c2, d2) {
  b2.value = c2;
  b2.getSnapshot = d2;
  ei(b2) && fi(a);
}
function ai(a, b2, c2) {
  return c2(function() {
    ei(b2) && fi(a);
  });
}
function ei(a) {
  var b2 = a.getSnapshot;
  a = a.value;
  try {
    var c2 = b2();
    return !He$1(a, c2);
  } catch (d2) {
    return true;
  }
}
function fi(a) {
  var b2 = ih(a, 1);
  null !== b2 && gi(b2, a, 1, -1);
}
function hi(a) {
  var b2 = Th();
  "function" === typeof a && (a = a());
  b2.memoizedState = b2.baseState = a;
  a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a };
  b2.queue = a;
  a = a.dispatch = ii.bind(null, M$1, a);
  return [b2.memoizedState, a];
}
function bi(a, b2, c2, d2) {
  a = { tag: a, create: b2, destroy: c2, deps: d2, next: null };
  b2 = M$1.updateQueue;
  null === b2 ? (b2 = { lastEffect: null, stores: null }, M$1.updateQueue = b2, b2.lastEffect = a.next = a) : (c2 = b2.lastEffect, null === c2 ? b2.lastEffect = a.next = a : (d2 = c2.next, c2.next = a, a.next = d2, b2.lastEffect = a));
  return a;
}
function ji() {
  return Uh().memoizedState;
}
function ki(a, b2, c2, d2) {
  var e2 = Th();
  M$1.flags |= a;
  e2.memoizedState = bi(1 | b2, c2, void 0, void 0 === d2 ? null : d2);
}
function li(a, b2, c2, d2) {
  var e2 = Uh();
  d2 = void 0 === d2 ? null : d2;
  var f2 = void 0;
  if (null !== N$1) {
    var g2 = N$1.memoizedState;
    f2 = g2.destroy;
    if (null !== d2 && Mh(d2, g2.deps)) {
      e2.memoizedState = bi(b2, c2, f2, d2);
      return;
    }
  }
  M$1.flags |= a;
  e2.memoizedState = bi(1 | b2, c2, f2, d2);
}
function mi(a, b2) {
  return ki(8390656, 8, a, b2);
}
function $h(a, b2) {
  return li(2048, 8, a, b2);
}
function ni(a, b2) {
  return li(4, 2, a, b2);
}
function oi(a, b2) {
  return li(4, 4, a, b2);
}
function pi(a, b2) {
  if ("function" === typeof b2) return a = a(), b2(a), function() {
    b2(null);
  };
  if (null !== b2 && void 0 !== b2) return a = a(), b2.current = a, function() {
    b2.current = null;
  };
}
function qi(a, b2, c2) {
  c2 = null !== c2 && void 0 !== c2 ? c2.concat([a]) : null;
  return li(4, 4, pi.bind(null, b2, a), c2);
}
function ri() {
}
function si(a, b2) {
  var c2 = Uh();
  b2 = void 0 === b2 ? null : b2;
  var d2 = c2.memoizedState;
  if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0];
  c2.memoizedState = [a, b2];
  return a;
}
function ti(a, b2) {
  var c2 = Uh();
  b2 = void 0 === b2 ? null : b2;
  var d2 = c2.memoizedState;
  if (null !== d2 && null !== b2 && Mh(b2, d2[1])) return d2[0];
  a = a();
  c2.memoizedState = [a, b2];
  return a;
}
function ui(a, b2, c2) {
  if (0 === (Hh & 21)) return a.baseState && (a.baseState = false, dh = true), a.memoizedState = c2;
  He$1(c2, b2) || (c2 = yc(), M$1.lanes |= c2, rh |= c2, a.baseState = true);
  return b2;
}
function vi(a, b2) {
  var c2 = C$1;
  C$1 = 0 !== c2 && 4 > c2 ? c2 : 4;
  a(true);
  var d2 = Gh.transition;
  Gh.transition = {};
  try {
    a(false), b2();
  } finally {
    C$1 = c2, Gh.transition = d2;
  }
}
function wi() {
  return Uh().memoizedState;
}
function xi(a, b2, c2) {
  var d2 = yi(a);
  c2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null };
  if (zi(a)) Ai(b2, c2);
  else if (c2 = hh(a, b2, c2, d2), null !== c2) {
    var e2 = R();
    gi(c2, a, d2, e2);
    Bi(c2, b2, d2);
  }
}
function ii(a, b2, c2) {
  var d2 = yi(a), e2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null };
  if (zi(a)) Ai(b2, e2);
  else {
    var f2 = a.alternate;
    if (0 === a.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b2.lastRenderedReducer, null !== f2)) try {
      var g2 = b2.lastRenderedState, h2 = f2(g2, c2);
      e2.hasEagerState = true;
      e2.eagerState = h2;
      if (He$1(h2, g2)) {
        var k2 = b2.interleaved;
        null === k2 ? (e2.next = e2, gh(b2)) : (e2.next = k2.next, k2.next = e2);
        b2.interleaved = e2;
        return;
      }
    } catch (l2) {
    } finally {
    }
    c2 = hh(a, b2, e2, d2);
    null !== c2 && (e2 = R(), gi(c2, a, d2, e2), Bi(c2, b2, d2));
  }
}
function zi(a) {
  var b2 = a.alternate;
  return a === M$1 || null !== b2 && b2 === M$1;
}
function Ai(a, b2) {
  Jh = Ih = true;
  var c2 = a.pending;
  null === c2 ? b2.next = b2 : (b2.next = c2.next, c2.next = b2);
  a.pending = b2;
}
function Bi(a, b2, c2) {
  if (0 !== (c2 & 4194240)) {
    var d2 = b2.lanes;
    d2 &= a.pendingLanes;
    c2 |= d2;
    b2.lanes = c2;
    Cc(a, c2);
  }
}
var Rh = { readContext: eh, useCallback: P$1, useContext: P$1, useEffect: P$1, useImperativeHandle: P$1, useInsertionEffect: P$1, useLayoutEffect: P$1, useMemo: P$1, useReducer: P$1, useRef: P$1, useState: P$1, useDebugValue: P$1, useDeferredValue: P$1, useTransition: P$1, useMutableSource: P$1, useSyncExternalStore: P$1, useId: P$1, unstable_isNewReconciler: false }, Oh = { readContext: eh, useCallback: function(a, b2) {
  Th().memoizedState = [a, void 0 === b2 ? null : b2];
  return a;
}, useContext: eh, useEffect: mi, useImperativeHandle: function(a, b2, c2) {
  c2 = null !== c2 && void 0 !== c2 ? c2.concat([a]) : null;
  return ki(
    4194308,
    4,
    pi.bind(null, b2, a),
    c2
  );
}, useLayoutEffect: function(a, b2) {
  return ki(4194308, 4, a, b2);
}, useInsertionEffect: function(a, b2) {
  return ki(4, 2, a, b2);
}, useMemo: function(a, b2) {
  var c2 = Th();
  b2 = void 0 === b2 ? null : b2;
  a = a();
  c2.memoizedState = [a, b2];
  return a;
}, useReducer: function(a, b2, c2) {
  var d2 = Th();
  b2 = void 0 !== c2 ? c2(b2) : b2;
  d2.memoizedState = d2.baseState = b2;
  a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a, lastRenderedState: b2 };
  d2.queue = a;
  a = a.dispatch = xi.bind(null, M$1, a);
  return [d2.memoizedState, a];
}, useRef: function(a) {
  var b2 = Th();
  a = { current: a };
  return b2.memoizedState = a;
}, useState: hi, useDebugValue: ri, useDeferredValue: function(a) {
  return Th().memoizedState = a;
}, useTransition: function() {
  var a = hi(false), b2 = a[0];
  a = vi.bind(null, a[1]);
  Th().memoizedState = a;
  return [b2, a];
}, useMutableSource: function() {
}, useSyncExternalStore: function(a, b2, c2) {
  var d2 = M$1, e2 = Th();
  if (I$1) {
    if (void 0 === c2) throw Error(p$2(407));
    c2 = c2();
  } else {
    c2 = b2();
    if (null === Q$1) throw Error(p$2(349));
    0 !== (Hh & 30) || di(d2, b2, c2);
  }
  e2.memoizedState = c2;
  var f2 = { value: c2, getSnapshot: b2 };
  e2.queue = f2;
  mi(ai.bind(
    null,
    d2,
    f2,
    a
  ), [a]);
  d2.flags |= 2048;
  bi(9, ci.bind(null, d2, f2, c2, b2), void 0, null);
  return c2;
}, useId: function() {
  var a = Th(), b2 = Q$1.identifierPrefix;
  if (I$1) {
    var c2 = sg;
    var d2 = rg;
    c2 = (d2 & ~(1 << 32 - oc(d2) - 1)).toString(32) + c2;
    b2 = ":" + b2 + "R" + c2;
    c2 = Kh++;
    0 < c2 && (b2 += "H" + c2.toString(32));
    b2 += ":";
  } else c2 = Lh++, b2 = ":" + b2 + "r" + c2.toString(32) + ":";
  return a.memoizedState = b2;
}, unstable_isNewReconciler: false }, Ph = {
  readContext: eh,
  useCallback: si,
  useContext: eh,
  useEffect: $h,
  useImperativeHandle: qi,
  useInsertionEffect: ni,
  useLayoutEffect: oi,
  useMemo: ti,
  useReducer: Wh,
  useRef: ji,
  useState: function() {
    return Wh(Vh);
  },
  useDebugValue: ri,
  useDeferredValue: function(a) {
    var b2 = Uh();
    return ui(b2, N$1.memoizedState, a);
  },
  useTransition: function() {
    var a = Wh(Vh)[0], b2 = Uh().memoizedState;
    return [a, b2];
  },
  useMutableSource: Yh,
  useSyncExternalStore: Zh,
  useId: wi,
  unstable_isNewReconciler: false
}, Qh = { readContext: eh, useCallback: si, useContext: eh, useEffect: $h, useImperativeHandle: qi, useInsertionEffect: ni, useLayoutEffect: oi, useMemo: ti, useReducer: Xh, useRef: ji, useState: function() {
  return Xh(Vh);
}, useDebugValue: ri, useDeferredValue: function(a) {
  var b2 = Uh();
  return null === N$1 ? b2.memoizedState = a : ui(b2, N$1.memoizedState, a);
}, useTransition: function() {
  var a = Xh(Vh)[0], b2 = Uh().memoizedState;
  return [a, b2];
}, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi, unstable_isNewReconciler: false };
function Ci(a, b2) {
  if (a && a.defaultProps) {
    b2 = A$1({}, b2);
    a = a.defaultProps;
    for (var c2 in a) void 0 === b2[c2] && (b2[c2] = a[c2]);
    return b2;
  }
  return b2;
}
function Di(a, b2, c2, d2) {
  b2 = a.memoizedState;
  c2 = c2(d2, b2);
  c2 = null === c2 || void 0 === c2 ? b2 : A$1({}, b2, c2);
  a.memoizedState = c2;
  0 === a.lanes && (a.updateQueue.baseState = c2);
}
var Ei = { isMounted: function(a) {
  return (a = a._reactInternals) ? Vb(a) === a : false;
}, enqueueSetState: function(a, b2, c2) {
  a = a._reactInternals;
  var d2 = R(), e2 = yi(a), f2 = mh(d2, e2);
  f2.payload = b2;
  void 0 !== c2 && null !== c2 && (f2.callback = c2);
  b2 = nh(a, f2, e2);
  null !== b2 && (gi(b2, a, e2, d2), oh(b2, a, e2));
}, enqueueReplaceState: function(a, b2, c2) {
  a = a._reactInternals;
  var d2 = R(), e2 = yi(a), f2 = mh(d2, e2);
  f2.tag = 1;
  f2.payload = b2;
  void 0 !== c2 && null !== c2 && (f2.callback = c2);
  b2 = nh(a, f2, e2);
  null !== b2 && (gi(b2, a, e2, d2), oh(b2, a, e2));
}, enqueueForceUpdate: function(a, b2) {
  a = a._reactInternals;
  var c2 = R(), d2 = yi(a), e2 = mh(c2, d2);
  e2.tag = 2;
  void 0 !== b2 && null !== b2 && (e2.callback = b2);
  b2 = nh(a, e2, d2);
  null !== b2 && (gi(b2, a, d2, c2), oh(b2, a, d2));
} };
function Fi(a, b2, c2, d2, e2, f2, g2) {
  a = a.stateNode;
  return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Ie(c2, d2) || !Ie(e2, f2) : true;
}
function Gi(a, b2, c2) {
  var d2 = false, e2 = Vf;
  var f2 = b2.contextType;
  "object" === typeof f2 && null !== f2 ? f2 = eh(f2) : (e2 = Zf(b2) ? Xf : H$1.current, d2 = b2.contextTypes, f2 = (d2 = null !== d2 && void 0 !== d2) ? Yf(a, e2) : Vf);
  b2 = new b2(c2, f2);
  a.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null;
  b2.updater = Ei;
  a.stateNode = b2;
  b2._reactInternals = a;
  d2 && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e2, a.__reactInternalMemoizedMaskedChildContext = f2);
  return b2;
}
function Hi(a, b2, c2, d2) {
  a = b2.state;
  "function" === typeof b2.componentWillReceiveProps && b2.componentWillReceiveProps(c2, d2);
  "function" === typeof b2.UNSAFE_componentWillReceiveProps && b2.UNSAFE_componentWillReceiveProps(c2, d2);
  b2.state !== a && Ei.enqueueReplaceState(b2, b2.state, null);
}
function Ii(a, b2, c2, d2) {
  var e2 = a.stateNode;
  e2.props = c2;
  e2.state = a.memoizedState;
  e2.refs = {};
  kh(a);
  var f2 = b2.contextType;
  "object" === typeof f2 && null !== f2 ? e2.context = eh(f2) : (f2 = Zf(b2) ? Xf : H$1.current, e2.context = Yf(a, f2));
  e2.state = a.memoizedState;
  f2 = b2.getDerivedStateFromProps;
  "function" === typeof f2 && (Di(a, b2, f2, c2), e2.state = a.memoizedState);
  "function" === typeof b2.getDerivedStateFromProps || "function" === typeof e2.getSnapshotBeforeUpdate || "function" !== typeof e2.UNSAFE_componentWillMount && "function" !== typeof e2.componentWillMount || (b2 = e2.state, "function" === typeof e2.componentWillMount && e2.componentWillMount(), "function" === typeof e2.UNSAFE_componentWillMount && e2.UNSAFE_componentWillMount(), b2 !== e2.state && Ei.enqueueReplaceState(e2, e2.state, null), qh(a, c2, e2, d2), e2.state = a.memoizedState);
  "function" === typeof e2.componentDidMount && (a.flags |= 4194308);
}
function Ji(a, b2) {
  try {
    var c2 = "", d2 = b2;
    do
      c2 += Pa(d2), d2 = d2.return;
    while (d2);
    var e2 = c2;
  } catch (f2) {
    e2 = "\nError generating stack: " + f2.message + "\n" + f2.stack;
  }
  return { value: a, source: b2, stack: e2, digest: null };
}
function Ki(a, b2, c2) {
  return { value: a, source: null, stack: null != c2 ? c2 : null, digest: null != b2 ? b2 : null };
}
function Li(a, b2) {
  try {
    console.error(b2.value);
  } catch (c2) {
    setTimeout(function() {
      throw c2;
    });
  }
}
var Mi = "function" === typeof WeakMap ? WeakMap : Map;
function Ni(a, b2, c2) {
  c2 = mh(-1, c2);
  c2.tag = 3;
  c2.payload = { element: null };
  var d2 = b2.value;
  c2.callback = function() {
    Oi || (Oi = true, Pi = d2);
    Li(a, b2);
  };
  return c2;
}
function Qi(a, b2, c2) {
  c2 = mh(-1, c2);
  c2.tag = 3;
  var d2 = a.type.getDerivedStateFromError;
  if ("function" === typeof d2) {
    var e2 = b2.value;
    c2.payload = function() {
      return d2(e2);
    };
    c2.callback = function() {
      Li(a, b2);
    };
  }
  var f2 = a.stateNode;
  null !== f2 && "function" === typeof f2.componentDidCatch && (c2.callback = function() {
    Li(a, b2);
    "function" !== typeof d2 && (null === Ri ? Ri = /* @__PURE__ */ new Set([this]) : Ri.add(this));
    var c3 = b2.stack;
    this.componentDidCatch(b2.value, { componentStack: null !== c3 ? c3 : "" });
  });
  return c2;
}
function Si(a, b2, c2) {
  var d2 = a.pingCache;
  if (null === d2) {
    d2 = a.pingCache = new Mi();
    var e2 = /* @__PURE__ */ new Set();
    d2.set(b2, e2);
  } else e2 = d2.get(b2), void 0 === e2 && (e2 = /* @__PURE__ */ new Set(), d2.set(b2, e2));
  e2.has(c2) || (e2.add(c2), a = Ti.bind(null, a, b2, c2), b2.then(a, a));
}
function Ui(a) {
  do {
    var b2;
    if (b2 = 13 === a.tag) b2 = a.memoizedState, b2 = null !== b2 ? null !== b2.dehydrated ? true : false : true;
    if (b2) return a;
    a = a.return;
  } while (null !== a);
  return null;
}
function Vi(a, b2, c2, d2, e2) {
  if (0 === (a.mode & 1)) return a === b2 ? a.flags |= 65536 : (a.flags |= 128, c2.flags |= 131072, c2.flags &= -52805, 1 === c2.tag && (null === c2.alternate ? c2.tag = 17 : (b2 = mh(-1, 1), b2.tag = 2, nh(c2, b2, 1))), c2.lanes |= 1), a;
  a.flags |= 65536;
  a.lanes = e2;
  return a;
}
var Wi = ua.ReactCurrentOwner, dh = false;
function Xi(a, b2, c2, d2) {
  b2.child = null === a ? Vg(b2, null, c2, d2) : Ug(b2, a.child, c2, d2);
}
function Yi(a, b2, c2, d2, e2) {
  c2 = c2.render;
  var f2 = b2.ref;
  ch(b2, e2);
  d2 = Nh(a, b2, c2, d2, f2, e2);
  c2 = Sh();
  if (null !== a && !dh) return b2.updateQueue = a.updateQueue, b2.flags &= -2053, a.lanes &= ~e2, Zi(a, b2, e2);
  I$1 && c2 && vg(b2);
  b2.flags |= 1;
  Xi(a, b2, d2, e2);
  return b2.child;
}
function $i(a, b2, c2, d2, e2) {
  if (null === a) {
    var f2 = c2.type;
    if ("function" === typeof f2 && !aj(f2) && void 0 === f2.defaultProps && null === c2.compare && void 0 === c2.defaultProps) return b2.tag = 15, b2.type = f2, bj(a, b2, f2, d2, e2);
    a = Rg(c2.type, null, d2, b2, b2.mode, e2);
    a.ref = b2.ref;
    a.return = b2;
    return b2.child = a;
  }
  f2 = a.child;
  if (0 === (a.lanes & e2)) {
    var g2 = f2.memoizedProps;
    c2 = c2.compare;
    c2 = null !== c2 ? c2 : Ie;
    if (c2(g2, d2) && a.ref === b2.ref) return Zi(a, b2, e2);
  }
  b2.flags |= 1;
  a = Pg(f2, d2);
  a.ref = b2.ref;
  a.return = b2;
  return b2.child = a;
}
function bj(a, b2, c2, d2, e2) {
  if (null !== a) {
    var f2 = a.memoizedProps;
    if (Ie(f2, d2) && a.ref === b2.ref) if (dh = false, b2.pendingProps = d2 = f2, 0 !== (a.lanes & e2)) 0 !== (a.flags & 131072) && (dh = true);
    else return b2.lanes = a.lanes, Zi(a, b2, e2);
  }
  return cj(a, b2, c2, d2, e2);
}
function dj(a, b2, c2) {
  var d2 = b2.pendingProps, e2 = d2.children, f2 = null !== a ? a.memoizedState : null;
  if ("hidden" === d2.mode) if (0 === (b2.mode & 1)) b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G$1(ej, fj), fj |= c2;
  else {
    if (0 === (c2 & 1073741824)) return a = null !== f2 ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a, cachePool: null, transitions: null }, b2.updateQueue = null, G$1(ej, fj), fj |= a, null;
    b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null };
    d2 = null !== f2 ? f2.baseLanes : c2;
    G$1(ej, fj);
    fj |= d2;
  }
  else null !== f2 ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, G$1(ej, fj), fj |= d2;
  Xi(a, b2, e2, c2);
  return b2.child;
}
function gj(a, b2) {
  var c2 = b2.ref;
  if (null === a && null !== c2 || null !== a && a.ref !== c2) b2.flags |= 512, b2.flags |= 2097152;
}
function cj(a, b2, c2, d2, e2) {
  var f2 = Zf(c2) ? Xf : H$1.current;
  f2 = Yf(b2, f2);
  ch(b2, e2);
  c2 = Nh(a, b2, c2, d2, f2, e2);
  d2 = Sh();
  if (null !== a && !dh) return b2.updateQueue = a.updateQueue, b2.flags &= -2053, a.lanes &= ~e2, Zi(a, b2, e2);
  I$1 && d2 && vg(b2);
  b2.flags |= 1;
  Xi(a, b2, c2, e2);
  return b2.child;
}
function hj(a, b2, c2, d2, e2) {
  if (Zf(c2)) {
    var f2 = true;
    cg(b2);
  } else f2 = false;
  ch(b2, e2);
  if (null === b2.stateNode) ij(a, b2), Gi(b2, c2, d2), Ii(b2, c2, d2, e2), d2 = true;
  else if (null === a) {
    var g2 = b2.stateNode, h2 = b2.memoizedProps;
    g2.props = h2;
    var k2 = g2.context, l2 = c2.contextType;
    "object" === typeof l2 && null !== l2 ? l2 = eh(l2) : (l2 = Zf(c2) ? Xf : H$1.current, l2 = Yf(b2, l2));
    var m2 = c2.getDerivedStateFromProps, q2 = "function" === typeof m2 || "function" === typeof g2.getSnapshotBeforeUpdate;
    q2 || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== d2 || k2 !== l2) && Hi(b2, g2, d2, l2);
    jh = false;
    var r2 = b2.memoizedState;
    g2.state = r2;
    qh(b2, d2, g2, e2);
    k2 = b2.memoizedState;
    h2 !== d2 || r2 !== k2 || Wf.current || jh ? ("function" === typeof m2 && (Di(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = jh || Fi(b2, c2, h2, d2, r2, k2, l2)) ? (q2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), d2 = false);
  } else {
    g2 = b2.stateNode;
    lh(a, b2);
    h2 = b2.memoizedProps;
    l2 = b2.type === b2.elementType ? h2 : Ci(b2.type, h2);
    g2.props = l2;
    q2 = b2.pendingProps;
    r2 = g2.context;
    k2 = c2.contextType;
    "object" === typeof k2 && null !== k2 ? k2 = eh(k2) : (k2 = Zf(c2) ? Xf : H$1.current, k2 = Yf(b2, k2));
    var y2 = c2.getDerivedStateFromProps;
    (m2 = "function" === typeof y2 || "function" === typeof g2.getSnapshotBeforeUpdate) || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== q2 || r2 !== k2) && Hi(b2, g2, d2, k2);
    jh = false;
    r2 = b2.memoizedState;
    g2.state = r2;
    qh(b2, d2, g2, e2);
    var n2 = b2.memoizedState;
    h2 !== q2 || r2 !== n2 || Wf.current || jh ? ("function" === typeof y2 && (Di(b2, c2, y2, d2), n2 = b2.memoizedState), (l2 = jh || Fi(b2, c2, l2, d2, r2, n2, k2) || false) ? (m2 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, n2, k2), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, n2, k2)), "function" === typeof g2.componentDidUpdate && (b2.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a.memoizedProps && r2 === a.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a.memoizedProps && r2 === a.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d2, b2.memoizedState = n2), g2.props = d2, g2.state = n2, g2.context = k2, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a.memoizedProps && r2 === a.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a.memoizedProps && r2 === a.memoizedState || (b2.flags |= 1024), d2 = false);
  }
  return jj(a, b2, c2, d2, f2, e2);
}
function jj(a, b2, c2, d2, e2, f2) {
  gj(a, b2);
  var g2 = 0 !== (b2.flags & 128);
  if (!d2 && !g2) return e2 && dg(b2, c2, false), Zi(a, b2, f2);
  d2 = b2.stateNode;
  Wi.current = b2;
  var h2 = g2 && "function" !== typeof c2.getDerivedStateFromError ? null : d2.render();
  b2.flags |= 1;
  null !== a && g2 ? (b2.child = Ug(b2, a.child, null, f2), b2.child = Ug(b2, null, h2, f2)) : Xi(a, b2, h2, f2);
  b2.memoizedState = d2.state;
  e2 && dg(b2, c2, true);
  return b2.child;
}
function kj(a) {
  var b2 = a.stateNode;
  b2.pendingContext ? ag(a, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && ag(a, b2.context, false);
  yh(a, b2.containerInfo);
}
function lj(a, b2, c2, d2, e2) {
  Ig();
  Jg(e2);
  b2.flags |= 256;
  Xi(a, b2, c2, d2);
  return b2.child;
}
var mj = { dehydrated: null, treeContext: null, retryLane: 0 };
function nj(a) {
  return { baseLanes: a, cachePool: null, transitions: null };
}
function oj(a, b2, c2) {
  var d2 = b2.pendingProps, e2 = L$1.current, f2 = false, g2 = 0 !== (b2.flags & 128), h2;
  (h2 = g2) || (h2 = null !== a && null === a.memoizedState ? false : 0 !== (e2 & 2));
  if (h2) f2 = true, b2.flags &= -129;
  else if (null === a || null !== a.memoizedState) e2 |= 1;
  G$1(L$1, e2 & 1);
  if (null === a) {
    Eg(b2);
    a = b2.memoizedState;
    if (null !== a && (a = a.dehydrated, null !== a)) return 0 === (b2.mode & 1) ? b2.lanes = 1 : "$!" === a.data ? b2.lanes = 8 : b2.lanes = 1073741824, null;
    g2 = d2.children;
    a = d2.fallback;
    return f2 ? (d2 = b2.mode, f2 = b2.child, g2 = { mode: "hidden", children: g2 }, 0 === (d2 & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g2) : f2 = pj(g2, d2, 0, null), a = Tg(a, d2, c2, null), f2.return = b2, a.return = b2, f2.sibling = a, b2.child = f2, b2.child.memoizedState = nj(c2), b2.memoizedState = mj, a) : qj(b2, g2);
  }
  e2 = a.memoizedState;
  if (null !== e2 && (h2 = e2.dehydrated, null !== h2)) return rj(a, b2, g2, d2, h2, e2, c2);
  if (f2) {
    f2 = d2.fallback;
    g2 = b2.mode;
    e2 = a.child;
    h2 = e2.sibling;
    var k2 = { mode: "hidden", children: d2.children };
    0 === (g2 & 1) && b2.child !== e2 ? (d2 = b2.child, d2.childLanes = 0, d2.pendingProps = k2, b2.deletions = null) : (d2 = Pg(e2, k2), d2.subtreeFlags = e2.subtreeFlags & 14680064);
    null !== h2 ? f2 = Pg(h2, f2) : (f2 = Tg(f2, g2, c2, null), f2.flags |= 2);
    f2.return = b2;
    d2.return = b2;
    d2.sibling = f2;
    b2.child = d2;
    d2 = f2;
    f2 = b2.child;
    g2 = a.child.memoizedState;
    g2 = null === g2 ? nj(c2) : { baseLanes: g2.baseLanes | c2, cachePool: null, transitions: g2.transitions };
    f2.memoizedState = g2;
    f2.childLanes = a.childLanes & ~c2;
    b2.memoizedState = mj;
    return d2;
  }
  f2 = a.child;
  a = f2.sibling;
  d2 = Pg(f2, { mode: "visible", children: d2.children });
  0 === (b2.mode & 1) && (d2.lanes = c2);
  d2.return = b2;
  d2.sibling = null;
  null !== a && (c2 = b2.deletions, null === c2 ? (b2.deletions = [a], b2.flags |= 16) : c2.push(a));
  b2.child = d2;
  b2.memoizedState = null;
  return d2;
}
function qj(a, b2) {
  b2 = pj({ mode: "visible", children: b2 }, a.mode, 0, null);
  b2.return = a;
  return a.child = b2;
}
function sj(a, b2, c2, d2) {
  null !== d2 && Jg(d2);
  Ug(b2, a.child, null, c2);
  a = qj(b2, b2.pendingProps.children);
  a.flags |= 2;
  b2.memoizedState = null;
  return a;
}
function rj(a, b2, c2, d2, e2, f2, g2) {
  if (c2) {
    if (b2.flags & 256) return b2.flags &= -257, d2 = Ki(Error(p$2(422))), sj(a, b2, g2, d2);
    if (null !== b2.memoizedState) return b2.child = a.child, b2.flags |= 128, null;
    f2 = d2.fallback;
    e2 = b2.mode;
    d2 = pj({ mode: "visible", children: d2.children }, e2, 0, null);
    f2 = Tg(f2, e2, g2, null);
    f2.flags |= 2;
    d2.return = b2;
    f2.return = b2;
    d2.sibling = f2;
    b2.child = d2;
    0 !== (b2.mode & 1) && Ug(b2, a.child, null, g2);
    b2.child.memoizedState = nj(g2);
    b2.memoizedState = mj;
    return f2;
  }
  if (0 === (b2.mode & 1)) return sj(a, b2, g2, null);
  if ("$!" === e2.data) {
    d2 = e2.nextSibling && e2.nextSibling.dataset;
    if (d2) var h2 = d2.dgst;
    d2 = h2;
    f2 = Error(p$2(419));
    d2 = Ki(f2, d2, void 0);
    return sj(a, b2, g2, d2);
  }
  h2 = 0 !== (g2 & a.childLanes);
  if (dh || h2) {
    d2 = Q$1;
    if (null !== d2) {
      switch (g2 & -g2) {
        case 4:
          e2 = 2;
          break;
        case 16:
          e2 = 8;
          break;
        case 64:
        case 128:
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
        case 67108864:
          e2 = 32;
          break;
        case 536870912:
          e2 = 268435456;
          break;
        default:
          e2 = 0;
      }
      e2 = 0 !== (e2 & (d2.suspendedLanes | g2)) ? 0 : e2;
      0 !== e2 && e2 !== f2.retryLane && (f2.retryLane = e2, ih(a, e2), gi(d2, a, e2, -1));
    }
    tj();
    d2 = Ki(Error(p$2(421)));
    return sj(a, b2, g2, d2);
  }
  if ("$?" === e2.data) return b2.flags |= 128, b2.child = a.child, b2 = uj.bind(null, a), e2._reactRetry = b2, null;
  a = f2.treeContext;
  yg = Lf(e2.nextSibling);
  xg = b2;
  I$1 = true;
  zg = null;
  null !== a && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a.id, sg = a.overflow, qg = b2);
  b2 = qj(b2, d2.children);
  b2.flags |= 4096;
  return b2;
}
function vj(a, b2, c2) {
  a.lanes |= b2;
  var d2 = a.alternate;
  null !== d2 && (d2.lanes |= b2);
  bh(a.return, b2, c2);
}
function wj(a, b2, c2, d2, e2) {
  var f2 = a.memoizedState;
  null === f2 ? a.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e2 } : (f2.isBackwards = b2, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d2, f2.tail = c2, f2.tailMode = e2);
}
function xj(a, b2, c2) {
  var d2 = b2.pendingProps, e2 = d2.revealOrder, f2 = d2.tail;
  Xi(a, b2, d2.children, c2);
  d2 = L$1.current;
  if (0 !== (d2 & 2)) d2 = d2 & 1 | 2, b2.flags |= 128;
  else {
    if (null !== a && 0 !== (a.flags & 128)) a: for (a = b2.child; null !== a; ) {
      if (13 === a.tag) null !== a.memoizedState && vj(a, c2, b2);
      else if (19 === a.tag) vj(a, c2, b2);
      else if (null !== a.child) {
        a.child.return = a;
        a = a.child;
        continue;
      }
      if (a === b2) break a;
      for (; null === a.sibling; ) {
        if (null === a.return || a.return === b2) break a;
        a = a.return;
      }
      a.sibling.return = a.return;
      a = a.sibling;
    }
    d2 &= 1;
  }
  G$1(L$1, d2);
  if (0 === (b2.mode & 1)) b2.memoizedState = null;
  else switch (e2) {
    case "forwards":
      c2 = b2.child;
      for (e2 = null; null !== c2; ) a = c2.alternate, null !== a && null === Ch(a) && (e2 = c2), c2 = c2.sibling;
      c2 = e2;
      null === c2 ? (e2 = b2.child, b2.child = null) : (e2 = c2.sibling, c2.sibling = null);
      wj(b2, false, e2, c2, f2);
      break;
    case "backwards":
      c2 = null;
      e2 = b2.child;
      for (b2.child = null; null !== e2; ) {
        a = e2.alternate;
        if (null !== a && null === Ch(a)) {
          b2.child = e2;
          break;
        }
        a = e2.sibling;
        e2.sibling = c2;
        c2 = e2;
        e2 = a;
      }
      wj(b2, true, c2, null, f2);
      break;
    case "together":
      wj(b2, false, null, null, void 0);
      break;
    default:
      b2.memoizedState = null;
  }
  return b2.child;
}
function ij(a, b2) {
  0 === (b2.mode & 1) && null !== a && (a.alternate = null, b2.alternate = null, b2.flags |= 2);
}
function Zi(a, b2, c2) {
  null !== a && (b2.dependencies = a.dependencies);
  rh |= b2.lanes;
  if (0 === (c2 & b2.childLanes)) return null;
  if (null !== a && b2.child !== a.child) throw Error(p$2(153));
  if (null !== b2.child) {
    a = b2.child;
    c2 = Pg(a, a.pendingProps);
    b2.child = c2;
    for (c2.return = b2; null !== a.sibling; ) a = a.sibling, c2 = c2.sibling = Pg(a, a.pendingProps), c2.return = b2;
    c2.sibling = null;
  }
  return b2.child;
}
function yj(a, b2, c2) {
  switch (b2.tag) {
    case 3:
      kj(b2);
      Ig();
      break;
    case 5:
      Ah(b2);
      break;
    case 1:
      Zf(b2.type) && cg(b2);
      break;
    case 4:
      yh(b2, b2.stateNode.containerInfo);
      break;
    case 10:
      var d2 = b2.type._context, e2 = b2.memoizedProps.value;
      G$1(Wg, d2._currentValue);
      d2._currentValue = e2;
      break;
    case 13:
      d2 = b2.memoizedState;
      if (null !== d2) {
        if (null !== d2.dehydrated) return G$1(L$1, L$1.current & 1), b2.flags |= 128, null;
        if (0 !== (c2 & b2.child.childLanes)) return oj(a, b2, c2);
        G$1(L$1, L$1.current & 1);
        a = Zi(a, b2, c2);
        return null !== a ? a.sibling : null;
      }
      G$1(L$1, L$1.current & 1);
      break;
    case 19:
      d2 = 0 !== (c2 & b2.childLanes);
      if (0 !== (a.flags & 128)) {
        if (d2) return xj(a, b2, c2);
        b2.flags |= 128;
      }
      e2 = b2.memoizedState;
      null !== e2 && (e2.rendering = null, e2.tail = null, e2.lastEffect = null);
      G$1(L$1, L$1.current);
      if (d2) break;
      else return null;
    case 22:
    case 23:
      return b2.lanes = 0, dj(a, b2, c2);
  }
  return Zi(a, b2, c2);
}
var zj, Aj, Bj, Cj;
zj = function(a, b2) {
  for (var c2 = b2.child; null !== c2; ) {
    if (5 === c2.tag || 6 === c2.tag) a.appendChild(c2.stateNode);
    else if (4 !== c2.tag && null !== c2.child) {
      c2.child.return = c2;
      c2 = c2.child;
      continue;
    }
    if (c2 === b2) break;
    for (; null === c2.sibling; ) {
      if (null === c2.return || c2.return === b2) return;
      c2 = c2.return;
    }
    c2.sibling.return = c2.return;
    c2 = c2.sibling;
  }
};
Aj = function() {
};
Bj = function(a, b2, c2, d2) {
  var e2 = a.memoizedProps;
  if (e2 !== d2) {
    a = b2.stateNode;
    xh(uh.current);
    var f2 = null;
    switch (c2) {
      case "input":
        e2 = Ya(a, e2);
        d2 = Ya(a, d2);
        f2 = [];
        break;
      case "select":
        e2 = A$1({}, e2, { value: void 0 });
        d2 = A$1({}, d2, { value: void 0 });
        f2 = [];
        break;
      case "textarea":
        e2 = gb(a, e2);
        d2 = gb(a, d2);
        f2 = [];
        break;
      default:
        "function" !== typeof e2.onClick && "function" === typeof d2.onClick && (a.onclick = Bf);
    }
    ub(c2, d2);
    var g2;
    c2 = null;
    for (l2 in e2) if (!d2.hasOwnProperty(l2) && e2.hasOwnProperty(l2) && null != e2[l2]) if ("style" === l2) {
      var h2 = e2[l2];
      for (g2 in h2) h2.hasOwnProperty(g2) && (c2 || (c2 = {}), c2[g2] = "");
    } else "dangerouslySetInnerHTML" !== l2 && "children" !== l2 && "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && "autoFocus" !== l2 && (ea.hasOwnProperty(l2) ? f2 || (f2 = []) : (f2 = f2 || []).push(l2, null));
    for (l2 in d2) {
      var k2 = d2[l2];
      h2 = null != e2 ? e2[l2] : void 0;
      if (d2.hasOwnProperty(l2) && k2 !== h2 && (null != k2 || null != h2)) if ("style" === l2) if (h2) {
        for (g2 in h2) !h2.hasOwnProperty(g2) || k2 && k2.hasOwnProperty(g2) || (c2 || (c2 = {}), c2[g2] = "");
        for (g2 in k2) k2.hasOwnProperty(g2) && h2[g2] !== k2[g2] && (c2 || (c2 = {}), c2[g2] = k2[g2]);
      } else c2 || (f2 || (f2 = []), f2.push(
        l2,
        c2
      )), c2 = k2;
      else "dangerouslySetInnerHTML" === l2 ? (k2 = k2 ? k2.__html : void 0, h2 = h2 ? h2.__html : void 0, null != k2 && h2 !== k2 && (f2 = f2 || []).push(l2, k2)) : "children" === l2 ? "string" !== typeof k2 && "number" !== typeof k2 || (f2 = f2 || []).push(l2, "" + k2) : "suppressContentEditableWarning" !== l2 && "suppressHydrationWarning" !== l2 && (ea.hasOwnProperty(l2) ? (null != k2 && "onScroll" === l2 && D$1("scroll", a), f2 || h2 === k2 || (f2 = [])) : (f2 = f2 || []).push(l2, k2));
    }
    c2 && (f2 = f2 || []).push("style", c2);
    var l2 = f2;
    if (b2.updateQueue = l2) b2.flags |= 4;
  }
};
Cj = function(a, b2, c2, d2) {
  c2 !== d2 && (b2.flags |= 4);
};
function Dj(a, b2) {
  if (!I$1) switch (a.tailMode) {
    case "hidden":
      b2 = a.tail;
      for (var c2 = null; null !== b2; ) null !== b2.alternate && (c2 = b2), b2 = b2.sibling;
      null === c2 ? a.tail = null : c2.sibling = null;
      break;
    case "collapsed":
      c2 = a.tail;
      for (var d2 = null; null !== c2; ) null !== c2.alternate && (d2 = c2), c2 = c2.sibling;
      null === d2 ? b2 || null === a.tail ? a.tail = null : a.tail.sibling = null : d2.sibling = null;
  }
}
function S$1(a) {
  var b2 = null !== a.alternate && a.alternate.child === a.child, c2 = 0, d2 = 0;
  if (b2) for (var e2 = a.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags & 14680064, d2 |= e2.flags & 14680064, e2.return = a, e2 = e2.sibling;
  else for (e2 = a.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags, d2 |= e2.flags, e2.return = a, e2 = e2.sibling;
  a.subtreeFlags |= d2;
  a.childLanes = c2;
  return b2;
}
function Ej(a, b2, c2) {
  var d2 = b2.pendingProps;
  wg(b2);
  switch (b2.tag) {
    case 2:
    case 16:
    case 15:
    case 0:
    case 11:
    case 7:
    case 8:
    case 12:
    case 9:
    case 14:
      return S$1(b2), null;
    case 1:
      return Zf(b2.type) && $f(), S$1(b2), null;
    case 3:
      d2 = b2.stateNode;
      zh();
      E$1(Wf);
      E$1(H$1);
      Eh();
      d2.pendingContext && (d2.context = d2.pendingContext, d2.pendingContext = null);
      if (null === a || null === a.child) Gg(b2) ? b2.flags |= 4 : null === a || a.memoizedState.isDehydrated && 0 === (b2.flags & 256) || (b2.flags |= 1024, null !== zg && (Fj(zg), zg = null));
      Aj(a, b2);
      S$1(b2);
      return null;
    case 5:
      Bh(b2);
      var e2 = xh(wh.current);
      c2 = b2.type;
      if (null !== a && null != b2.stateNode) Bj(a, b2, c2, d2, e2), a.ref !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152);
      else {
        if (!d2) {
          if (null === b2.stateNode) throw Error(p$2(166));
          S$1(b2);
          return null;
        }
        a = xh(uh.current);
        if (Gg(b2)) {
          d2 = b2.stateNode;
          c2 = b2.type;
          var f2 = b2.memoizedProps;
          d2[Of] = b2;
          d2[Pf] = f2;
          a = 0 !== (b2.mode & 1);
          switch (c2) {
            case "dialog":
              D$1("cancel", d2);
              D$1("close", d2);
              break;
            case "iframe":
            case "object":
            case "embed":
              D$1("load", d2);
              break;
            case "video":
            case "audio":
              for (e2 = 0; e2 < lf.length; e2++) D$1(lf[e2], d2);
              break;
            case "source":
              D$1("error", d2);
              break;
            case "img":
            case "image":
            case "link":
              D$1(
                "error",
                d2
              );
              D$1("load", d2);
              break;
            case "details":
              D$1("toggle", d2);
              break;
            case "input":
              Za(d2, f2);
              D$1("invalid", d2);
              break;
            case "select":
              d2._wrapperState = { wasMultiple: !!f2.multiple };
              D$1("invalid", d2);
              break;
            case "textarea":
              hb(d2, f2), D$1("invalid", d2);
          }
          ub(c2, f2);
          e2 = null;
          for (var g2 in f2) if (f2.hasOwnProperty(g2)) {
            var h2 = f2[g2];
            "children" === g2 ? "string" === typeof h2 ? d2.textContent !== h2 && (true !== f2.suppressHydrationWarning && Af(d2.textContent, h2, a), e2 = ["children", h2]) : "number" === typeof h2 && d2.textContent !== "" + h2 && (true !== f2.suppressHydrationWarning && Af(
              d2.textContent,
              h2,
              a
            ), e2 = ["children", "" + h2]) : ea.hasOwnProperty(g2) && null != h2 && "onScroll" === g2 && D$1("scroll", d2);
          }
          switch (c2) {
            case "input":
              Va(d2);
              db(d2, f2, true);
              break;
            case "textarea":
              Va(d2);
              jb(d2);
              break;
            case "select":
            case "option":
              break;
            default:
              "function" === typeof f2.onClick && (d2.onclick = Bf);
          }
          d2 = e2;
          b2.updateQueue = d2;
          null !== d2 && (b2.flags |= 4);
        } else {
          g2 = 9 === e2.nodeType ? e2 : e2.ownerDocument;
          "http://www.w3.org/1999/xhtml" === a && (a = kb(c2));
          "http://www.w3.org/1999/xhtml" === a ? "script" === c2 ? (a = g2.createElement("div"), a.innerHTML = "<script><\/script>", a = a.removeChild(a.firstChild)) : "string" === typeof d2.is ? a = g2.createElement(c2, { is: d2.is }) : (a = g2.createElement(c2), "select" === c2 && (g2 = a, d2.multiple ? g2.multiple = true : d2.size && (g2.size = d2.size))) : a = g2.createElementNS(a, c2);
          a[Of] = b2;
          a[Pf] = d2;
          zj(a, b2, false, false);
          b2.stateNode = a;
          a: {
            g2 = vb(c2, d2);
            switch (c2) {
              case "dialog":
                D$1("cancel", a);
                D$1("close", a);
                e2 = d2;
                break;
              case "iframe":
              case "object":
              case "embed":
                D$1("load", a);
                e2 = d2;
                break;
              case "video":
              case "audio":
                for (e2 = 0; e2 < lf.length; e2++) D$1(lf[e2], a);
                e2 = d2;
                break;
              case "source":
                D$1("error", a);
                e2 = d2;
                break;
              case "img":
              case "image":
              case "link":
                D$1(
                  "error",
                  a
                );
                D$1("load", a);
                e2 = d2;
                break;
              case "details":
                D$1("toggle", a);
                e2 = d2;
                break;
              case "input":
                Za(a, d2);
                e2 = Ya(a, d2);
                D$1("invalid", a);
                break;
              case "option":
                e2 = d2;
                break;
              case "select":
                a._wrapperState = { wasMultiple: !!d2.multiple };
                e2 = A$1({}, d2, { value: void 0 });
                D$1("invalid", a);
                break;
              case "textarea":
                hb(a, d2);
                e2 = gb(a, d2);
                D$1("invalid", a);
                break;
              default:
                e2 = d2;
            }
            ub(c2, e2);
            h2 = e2;
            for (f2 in h2) if (h2.hasOwnProperty(f2)) {
              var k2 = h2[f2];
              "style" === f2 ? sb(a, k2) : "dangerouslySetInnerHTML" === f2 ? (k2 = k2 ? k2.__html : void 0, null != k2 && nb(a, k2)) : "children" === f2 ? "string" === typeof k2 ? ("textarea" !== c2 || "" !== k2) && ob(a, k2) : "number" === typeof k2 && ob(a, "" + k2) : "suppressContentEditableWarning" !== f2 && "suppressHydrationWarning" !== f2 && "autoFocus" !== f2 && (ea.hasOwnProperty(f2) ? null != k2 && "onScroll" === f2 && D$1("scroll", a) : null != k2 && ta(a, f2, k2, g2));
            }
            switch (c2) {
              case "input":
                Va(a);
                db(a, d2, false);
                break;
              case "textarea":
                Va(a);
                jb(a);
                break;
              case "option":
                null != d2.value && a.setAttribute("value", "" + Sa(d2.value));
                break;
              case "select":
                a.multiple = !!d2.multiple;
                f2 = d2.value;
                null != f2 ? fb(a, !!d2.multiple, f2, false) : null != d2.defaultValue && fb(
                  a,
                  !!d2.multiple,
                  d2.defaultValue,
                  true
                );
                break;
              default:
                "function" === typeof e2.onClick && (a.onclick = Bf);
            }
            switch (c2) {
              case "button":
              case "input":
              case "select":
              case "textarea":
                d2 = !!d2.autoFocus;
                break a;
              case "img":
                d2 = true;
                break a;
              default:
                d2 = false;
            }
          }
          d2 && (b2.flags |= 4);
        }
        null !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152);
      }
      S$1(b2);
      return null;
    case 6:
      if (a && null != b2.stateNode) Cj(a, b2, a.memoizedProps, d2);
      else {
        if ("string" !== typeof d2 && null === b2.stateNode) throw Error(p$2(166));
        c2 = xh(wh.current);
        xh(uh.current);
        if (Gg(b2)) {
          d2 = b2.stateNode;
          c2 = b2.memoizedProps;
          d2[Of] = b2;
          if (f2 = d2.nodeValue !== c2) {
            if (a = xg, null !== a) switch (a.tag) {
              case 3:
                Af(d2.nodeValue, c2, 0 !== (a.mode & 1));
                break;
              case 5:
                true !== a.memoizedProps.suppressHydrationWarning && Af(d2.nodeValue, c2, 0 !== (a.mode & 1));
            }
          }
          f2 && (b2.flags |= 4);
        } else d2 = (9 === c2.nodeType ? c2 : c2.ownerDocument).createTextNode(d2), d2[Of] = b2, b2.stateNode = d2;
      }
      S$1(b2);
      return null;
    case 13:
      E$1(L$1);
      d2 = b2.memoizedState;
      if (null === a || null !== a.memoizedState && null !== a.memoizedState.dehydrated) {
        if (I$1 && null !== yg && 0 !== (b2.mode & 1) && 0 === (b2.flags & 128)) Hg(), Ig(), b2.flags |= 98560, f2 = false;
        else if (f2 = Gg(b2), null !== d2 && null !== d2.dehydrated) {
          if (null === a) {
            if (!f2) throw Error(p$2(318));
            f2 = b2.memoizedState;
            f2 = null !== f2 ? f2.dehydrated : null;
            if (!f2) throw Error(p$2(317));
            f2[Of] = b2;
          } else Ig(), 0 === (b2.flags & 128) && (b2.memoizedState = null), b2.flags |= 4;
          S$1(b2);
          f2 = false;
        } else null !== zg && (Fj(zg), zg = null), f2 = true;
        if (!f2) return b2.flags & 65536 ? b2 : null;
      }
      if (0 !== (b2.flags & 128)) return b2.lanes = c2, b2;
      d2 = null !== d2;
      d2 !== (null !== a && null !== a.memoizedState) && d2 && (b2.child.flags |= 8192, 0 !== (b2.mode & 1) && (null === a || 0 !== (L$1.current & 1) ? 0 === T$1 && (T$1 = 3) : tj()));
      null !== b2.updateQueue && (b2.flags |= 4);
      S$1(b2);
      return null;
    case 4:
      return zh(), Aj(a, b2), null === a && sf(b2.stateNode.containerInfo), S$1(b2), null;
    case 10:
      return ah(b2.type._context), S$1(b2), null;
    case 17:
      return Zf(b2.type) && $f(), S$1(b2), null;
    case 19:
      E$1(L$1);
      f2 = b2.memoizedState;
      if (null === f2) return S$1(b2), null;
      d2 = 0 !== (b2.flags & 128);
      g2 = f2.rendering;
      if (null === g2) if (d2) Dj(f2, false);
      else {
        if (0 !== T$1 || null !== a && 0 !== (a.flags & 128)) for (a = b2.child; null !== a; ) {
          g2 = Ch(a);
          if (null !== g2) {
            b2.flags |= 128;
            Dj(f2, false);
            d2 = g2.updateQueue;
            null !== d2 && (b2.updateQueue = d2, b2.flags |= 4);
            b2.subtreeFlags = 0;
            d2 = c2;
            for (c2 = b2.child; null !== c2; ) f2 = c2, a = d2, f2.flags &= 14680066, g2 = f2.alternate, null === g2 ? (f2.childLanes = 0, f2.lanes = a, f2.child = null, f2.subtreeFlags = 0, f2.memoizedProps = null, f2.memoizedState = null, f2.updateQueue = null, f2.dependencies = null, f2.stateNode = null) : (f2.childLanes = g2.childLanes, f2.lanes = g2.lanes, f2.child = g2.child, f2.subtreeFlags = 0, f2.deletions = null, f2.memoizedProps = g2.memoizedProps, f2.memoizedState = g2.memoizedState, f2.updateQueue = g2.updateQueue, f2.type = g2.type, a = g2.dependencies, f2.dependencies = null === a ? null : { lanes: a.lanes, firstContext: a.firstContext }), c2 = c2.sibling;
            G$1(L$1, L$1.current & 1 | 2);
            return b2.child;
          }
          a = a.sibling;
        }
        null !== f2.tail && B$1() > Gj && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304);
      }
      else {
        if (!d2) if (a = Ch(g2), null !== a) {
          if (b2.flags |= 128, d2 = true, c2 = a.updateQueue, null !== c2 && (b2.updateQueue = c2, b2.flags |= 4), Dj(f2, true), null === f2.tail && "hidden" === f2.tailMode && !g2.alternate && !I$1) return S$1(b2), null;
        } else 2 * B$1() - f2.renderingStartTime > Gj && 1073741824 !== c2 && (b2.flags |= 128, d2 = true, Dj(f2, false), b2.lanes = 4194304);
        f2.isBackwards ? (g2.sibling = b2.child, b2.child = g2) : (c2 = f2.last, null !== c2 ? c2.sibling = g2 : b2.child = g2, f2.last = g2);
      }
      if (null !== f2.tail) return b2 = f2.tail, f2.rendering = b2, f2.tail = b2.sibling, f2.renderingStartTime = B$1(), b2.sibling = null, c2 = L$1.current, G$1(L$1, d2 ? c2 & 1 | 2 : c2 & 1), b2;
      S$1(b2);
      return null;
    case 22:
    case 23:
      return Hj(), d2 = null !== b2.memoizedState, null !== a && null !== a.memoizedState !== d2 && (b2.flags |= 8192), d2 && 0 !== (b2.mode & 1) ? 0 !== (fj & 1073741824) && (S$1(b2), b2.subtreeFlags & 6 && (b2.flags |= 8192)) : S$1(b2), null;
    case 24:
      return null;
    case 25:
      return null;
  }
  throw Error(p$2(156, b2.tag));
}
function Ij(a, b2) {
  wg(b2);
  switch (b2.tag) {
    case 1:
      return Zf(b2.type) && $f(), a = b2.flags, a & 65536 ? (b2.flags = a & -65537 | 128, b2) : null;
    case 3:
      return zh(), E$1(Wf), E$1(H$1), Eh(), a = b2.flags, 0 !== (a & 65536) && 0 === (a & 128) ? (b2.flags = a & -65537 | 128, b2) : null;
    case 5:
      return Bh(b2), null;
    case 13:
      E$1(L$1);
      a = b2.memoizedState;
      if (null !== a && null !== a.dehydrated) {
        if (null === b2.alternate) throw Error(p$2(340));
        Ig();
      }
      a = b2.flags;
      return a & 65536 ? (b2.flags = a & -65537 | 128, b2) : null;
    case 19:
      return E$1(L$1), null;
    case 4:
      return zh(), null;
    case 10:
      return ah(b2.type._context), null;
    case 22:
    case 23:
      return Hj(), null;
    case 24:
      return null;
    default:
      return null;
  }
}
var Jj = false, U$1 = false, Kj = "function" === typeof WeakSet ? WeakSet : Set, V$1 = null;
function Lj(a, b2) {
  var c2 = a.ref;
  if (null !== c2) if ("function" === typeof c2) try {
    c2(null);
  } catch (d2) {
    W$1(a, b2, d2);
  }
  else c2.current = null;
}
function Mj(a, b2, c2) {
  try {
    c2();
  } catch (d2) {
    W$1(a, b2, d2);
  }
}
var Nj = false;
function Oj(a, b2) {
  Cf = dd;
  a = Me$1();
  if (Ne$1(a)) {
    if ("selectionStart" in a) var c2 = { start: a.selectionStart, end: a.selectionEnd };
    else a: {
      c2 = (c2 = a.ownerDocument) && c2.defaultView || window;
      var d2 = c2.getSelection && c2.getSelection();
      if (d2 && 0 !== d2.rangeCount) {
        c2 = d2.anchorNode;
        var e2 = d2.anchorOffset, f2 = d2.focusNode;
        d2 = d2.focusOffset;
        try {
          c2.nodeType, f2.nodeType;
        } catch (F2) {
          c2 = null;
          break a;
        }
        var g2 = 0, h2 = -1, k2 = -1, l2 = 0, m2 = 0, q2 = a, r2 = null;
        b: for (; ; ) {
          for (var y2; ; ) {
            q2 !== c2 || 0 !== e2 && 3 !== q2.nodeType || (h2 = g2 + e2);
            q2 !== f2 || 0 !== d2 && 3 !== q2.nodeType || (k2 = g2 + d2);
            3 === q2.nodeType && (g2 += q2.nodeValue.length);
            if (null === (y2 = q2.firstChild)) break;
            r2 = q2;
            q2 = y2;
          }
          for (; ; ) {
            if (q2 === a) break b;
            r2 === c2 && ++l2 === e2 && (h2 = g2);
            r2 === f2 && ++m2 === d2 && (k2 = g2);
            if (null !== (y2 = q2.nextSibling)) break;
            q2 = r2;
            r2 = q2.parentNode;
          }
          q2 = y2;
        }
        c2 = -1 === h2 || -1 === k2 ? null : { start: h2, end: k2 };
      } else c2 = null;
    }
    c2 = c2 || { start: 0, end: 0 };
  } else c2 = null;
  Df = { focusedElem: a, selectionRange: c2 };
  dd = false;
  for (V$1 = b2; null !== V$1; ) if (b2 = V$1, a = b2.child, 0 !== (b2.subtreeFlags & 1028) && null !== a) a.return = b2, V$1 = a;
  else for (; null !== V$1; ) {
    b2 = V$1;
    try {
      var n2 = b2.alternate;
      if (0 !== (b2.flags & 1024)) switch (b2.tag) {
        case 0:
        case 11:
        case 15:
          break;
        case 1:
          if (null !== n2) {
            var t2 = n2.memoizedProps, J2 = n2.memoizedState, x2 = b2.stateNode, w2 = x2.getSnapshotBeforeUpdate(b2.elementType === b2.type ? t2 : Ci(b2.type, t2), J2);
            x2.__reactInternalSnapshotBeforeUpdate = w2;
          }
          break;
        case 3:
          var u2 = b2.stateNode.containerInfo;
          1 === u2.nodeType ? u2.textContent = "" : 9 === u2.nodeType && u2.documentElement && u2.removeChild(u2.documentElement);
          break;
        case 5:
        case 6:
        case 4:
        case 17:
          break;
        default:
          throw Error(p$2(163));
      }
    } catch (F2) {
      W$1(b2, b2.return, F2);
    }
    a = b2.sibling;
    if (null !== a) {
      a.return = b2.return;
      V$1 = a;
      break;
    }
    V$1 = b2.return;
  }
  n2 = Nj;
  Nj = false;
  return n2;
}
function Pj(a, b2, c2) {
  var d2 = b2.updateQueue;
  d2 = null !== d2 ? d2.lastEffect : null;
  if (null !== d2) {
    var e2 = d2 = d2.next;
    do {
      if ((e2.tag & a) === a) {
        var f2 = e2.destroy;
        e2.destroy = void 0;
        void 0 !== f2 && Mj(b2, c2, f2);
      }
      e2 = e2.next;
    } while (e2 !== d2);
  }
}
function Qj(a, b2) {
  b2 = b2.updateQueue;
  b2 = null !== b2 ? b2.lastEffect : null;
  if (null !== b2) {
    var c2 = b2 = b2.next;
    do {
      if ((c2.tag & a) === a) {
        var d2 = c2.create;
        c2.destroy = d2();
      }
      c2 = c2.next;
    } while (c2 !== b2);
  }
}
function Rj(a) {
  var b2 = a.ref;
  if (null !== b2) {
    var c2 = a.stateNode;
    switch (a.tag) {
      case 5:
        a = c2;
        break;
      default:
        a = c2;
    }
    "function" === typeof b2 ? b2(a) : b2.current = a;
  }
}
function Sj(a) {
  var b2 = a.alternate;
  null !== b2 && (a.alternate = null, Sj(b2));
  a.child = null;
  a.deletions = null;
  a.sibling = null;
  5 === a.tag && (b2 = a.stateNode, null !== b2 && (delete b2[Of], delete b2[Pf], delete b2[of], delete b2[Qf], delete b2[Rf]));
  a.stateNode = null;
  a.return = null;
  a.dependencies = null;
  a.memoizedProps = null;
  a.memoizedState = null;
  a.pendingProps = null;
  a.stateNode = null;
  a.updateQueue = null;
}
function Tj(a) {
  return 5 === a.tag || 3 === a.tag || 4 === a.tag;
}
function Uj(a) {
  a: for (; ; ) {
    for (; null === a.sibling; ) {
      if (null === a.return || Tj(a.return)) return null;
      a = a.return;
    }
    a.sibling.return = a.return;
    for (a = a.sibling; 5 !== a.tag && 6 !== a.tag && 18 !== a.tag; ) {
      if (a.flags & 2) continue a;
      if (null === a.child || 4 === a.tag) continue a;
      else a.child.return = a, a = a.child;
    }
    if (!(a.flags & 2)) return a.stateNode;
  }
}
function Vj(a, b2, c2) {
  var d2 = a.tag;
  if (5 === d2 || 6 === d2) a = a.stateNode, b2 ? 8 === c2.nodeType ? c2.parentNode.insertBefore(a, b2) : c2.insertBefore(a, b2) : (8 === c2.nodeType ? (b2 = c2.parentNode, b2.insertBefore(a, c2)) : (b2 = c2, b2.appendChild(a)), c2 = c2._reactRootContainer, null !== c2 && void 0 !== c2 || null !== b2.onclick || (b2.onclick = Bf));
  else if (4 !== d2 && (a = a.child, null !== a)) for (Vj(a, b2, c2), a = a.sibling; null !== a; ) Vj(a, b2, c2), a = a.sibling;
}
function Wj(a, b2, c2) {
  var d2 = a.tag;
  if (5 === d2 || 6 === d2) a = a.stateNode, b2 ? c2.insertBefore(a, b2) : c2.appendChild(a);
  else if (4 !== d2 && (a = a.child, null !== a)) for (Wj(a, b2, c2), a = a.sibling; null !== a; ) Wj(a, b2, c2), a = a.sibling;
}
var X$1 = null, Xj = false;
function Yj(a, b2, c2) {
  for (c2 = c2.child; null !== c2; ) Zj(a, b2, c2), c2 = c2.sibling;
}
function Zj(a, b2, c2) {
  if (lc && "function" === typeof lc.onCommitFiberUnmount) try {
    lc.onCommitFiberUnmount(kc, c2);
  } catch (h2) {
  }
  switch (c2.tag) {
    case 5:
      U$1 || Lj(c2, b2);
    case 6:
      var d2 = X$1, e2 = Xj;
      X$1 = null;
      Yj(a, b2, c2);
      X$1 = d2;
      Xj = e2;
      null !== X$1 && (Xj ? (a = X$1, c2 = c2.stateNode, 8 === a.nodeType ? a.parentNode.removeChild(c2) : a.removeChild(c2)) : X$1.removeChild(c2.stateNode));
      break;
    case 18:
      null !== X$1 && (Xj ? (a = X$1, c2 = c2.stateNode, 8 === a.nodeType ? Kf(a.parentNode, c2) : 1 === a.nodeType && Kf(a, c2), bd(a)) : Kf(X$1, c2.stateNode));
      break;
    case 4:
      d2 = X$1;
      e2 = Xj;
      X$1 = c2.stateNode.containerInfo;
      Xj = true;
      Yj(a, b2, c2);
      X$1 = d2;
      Xj = e2;
      break;
    case 0:
    case 11:
    case 14:
    case 15:
      if (!U$1 && (d2 = c2.updateQueue, null !== d2 && (d2 = d2.lastEffect, null !== d2))) {
        e2 = d2 = d2.next;
        do {
          var f2 = e2, g2 = f2.destroy;
          f2 = f2.tag;
          void 0 !== g2 && (0 !== (f2 & 2) ? Mj(c2, b2, g2) : 0 !== (f2 & 4) && Mj(c2, b2, g2));
          e2 = e2.next;
        } while (e2 !== d2);
      }
      Yj(a, b2, c2);
      break;
    case 1:
      if (!U$1 && (Lj(c2, b2), d2 = c2.stateNode, "function" === typeof d2.componentWillUnmount)) try {
        d2.props = c2.memoizedProps, d2.state = c2.memoizedState, d2.componentWillUnmount();
      } catch (h2) {
        W$1(c2, b2, h2);
      }
      Yj(a, b2, c2);
      break;
    case 21:
      Yj(a, b2, c2);
      break;
    case 22:
      c2.mode & 1 ? (U$1 = (d2 = U$1) || null !== c2.memoizedState, Yj(a, b2, c2), U$1 = d2) : Yj(a, b2, c2);
      break;
    default:
      Yj(a, b2, c2);
  }
}
function ak(a) {
  var b2 = a.updateQueue;
  if (null !== b2) {
    a.updateQueue = null;
    var c2 = a.stateNode;
    null === c2 && (c2 = a.stateNode = new Kj());
    b2.forEach(function(b3) {
      var d2 = bk.bind(null, a, b3);
      c2.has(b3) || (c2.add(b3), b3.then(d2, d2));
    });
  }
}
function ck(a, b2) {
  var c2 = b2.deletions;
  if (null !== c2) for (var d2 = 0; d2 < c2.length; d2++) {
    var e2 = c2[d2];
    try {
      var f2 = a, g2 = b2, h2 = g2;
      a: for (; null !== h2; ) {
        switch (h2.tag) {
          case 5:
            X$1 = h2.stateNode;
            Xj = false;
            break a;
          case 3:
            X$1 = h2.stateNode.containerInfo;
            Xj = true;
            break a;
          case 4:
            X$1 = h2.stateNode.containerInfo;
            Xj = true;
            break a;
        }
        h2 = h2.return;
      }
      if (null === X$1) throw Error(p$2(160));
      Zj(f2, g2, e2);
      X$1 = null;
      Xj = false;
      var k2 = e2.alternate;
      null !== k2 && (k2.return = null);
      e2.return = null;
    } catch (l2) {
      W$1(e2, b2, l2);
    }
  }
  if (b2.subtreeFlags & 12854) for (b2 = b2.child; null !== b2; ) dk(b2, a), b2 = b2.sibling;
}
function dk(a, b2) {
  var c2 = a.alternate, d2 = a.flags;
  switch (a.tag) {
    case 0:
    case 11:
    case 14:
    case 15:
      ck(b2, a);
      ek(a);
      if (d2 & 4) {
        try {
          Pj(3, a, a.return), Qj(3, a);
        } catch (t2) {
          W$1(a, a.return, t2);
        }
        try {
          Pj(5, a, a.return);
        } catch (t2) {
          W$1(a, a.return, t2);
        }
      }
      break;
    case 1:
      ck(b2, a);
      ek(a);
      d2 & 512 && null !== c2 && Lj(c2, c2.return);
      break;
    case 5:
      ck(b2, a);
      ek(a);
      d2 & 512 && null !== c2 && Lj(c2, c2.return);
      if (a.flags & 32) {
        var e2 = a.stateNode;
        try {
          ob(e2, "");
        } catch (t2) {
          W$1(a, a.return, t2);
        }
      }
      if (d2 & 4 && (e2 = a.stateNode, null != e2)) {
        var f2 = a.memoizedProps, g2 = null !== c2 ? c2.memoizedProps : f2, h2 = a.type, k2 = a.updateQueue;
        a.updateQueue = null;
        if (null !== k2) try {
          "input" === h2 && "radio" === f2.type && null != f2.name && ab(e2, f2);
          vb(h2, g2);
          var l2 = vb(h2, f2);
          for (g2 = 0; g2 < k2.length; g2 += 2) {
            var m2 = k2[g2], q2 = k2[g2 + 1];
            "style" === m2 ? sb(e2, q2) : "dangerouslySetInnerHTML" === m2 ? nb(e2, q2) : "children" === m2 ? ob(e2, q2) : ta(e2, m2, q2, l2);
          }
          switch (h2) {
            case "input":
              bb(e2, f2);
              break;
            case "textarea":
              ib(e2, f2);
              break;
            case "select":
              var r2 = e2._wrapperState.wasMultiple;
              e2._wrapperState.wasMultiple = !!f2.multiple;
              var y2 = f2.value;
              null != y2 ? fb(e2, !!f2.multiple, y2, false) : r2 !== !!f2.multiple && (null != f2.defaultValue ? fb(
                e2,
                !!f2.multiple,
                f2.defaultValue,
                true
              ) : fb(e2, !!f2.multiple, f2.multiple ? [] : "", false));
          }
          e2[Pf] = f2;
        } catch (t2) {
          W$1(a, a.return, t2);
        }
      }
      break;
    case 6:
      ck(b2, a);
      ek(a);
      if (d2 & 4) {
        if (null === a.stateNode) throw Error(p$2(162));
        e2 = a.stateNode;
        f2 = a.memoizedProps;
        try {
          e2.nodeValue = f2;
        } catch (t2) {
          W$1(a, a.return, t2);
        }
      }
      break;
    case 3:
      ck(b2, a);
      ek(a);
      if (d2 & 4 && null !== c2 && c2.memoizedState.isDehydrated) try {
        bd(b2.containerInfo);
      } catch (t2) {
        W$1(a, a.return, t2);
      }
      break;
    case 4:
      ck(b2, a);
      ek(a);
      break;
    case 13:
      ck(b2, a);
      ek(a);
      e2 = a.child;
      e2.flags & 8192 && (f2 = null !== e2.memoizedState, e2.stateNode.isHidden = f2, !f2 || null !== e2.alternate && null !== e2.alternate.memoizedState || (fk = B$1()));
      d2 & 4 && ak(a);
      break;
    case 22:
      m2 = null !== c2 && null !== c2.memoizedState;
      a.mode & 1 ? (U$1 = (l2 = U$1) || m2, ck(b2, a), U$1 = l2) : ck(b2, a);
      ek(a);
      if (d2 & 8192) {
        l2 = null !== a.memoizedState;
        if ((a.stateNode.isHidden = l2) && !m2 && 0 !== (a.mode & 1)) for (V$1 = a, m2 = a.child; null !== m2; ) {
          for (q2 = V$1 = m2; null !== V$1; ) {
            r2 = V$1;
            y2 = r2.child;
            switch (r2.tag) {
              case 0:
              case 11:
              case 14:
              case 15:
                Pj(4, r2, r2.return);
                break;
              case 1:
                Lj(r2, r2.return);
                var n2 = r2.stateNode;
                if ("function" === typeof n2.componentWillUnmount) {
                  d2 = r2;
                  c2 = r2.return;
                  try {
                    b2 = d2, n2.props = b2.memoizedProps, n2.state = b2.memoizedState, n2.componentWillUnmount();
                  } catch (t2) {
                    W$1(d2, c2, t2);
                  }
                }
                break;
              case 5:
                Lj(r2, r2.return);
                break;
              case 22:
                if (null !== r2.memoizedState) {
                  gk(q2);
                  continue;
                }
            }
            null !== y2 ? (y2.return = r2, V$1 = y2) : gk(q2);
          }
          m2 = m2.sibling;
        }
        a: for (m2 = null, q2 = a; ; ) {
          if (5 === q2.tag) {
            if (null === m2) {
              m2 = q2;
              try {
                e2 = q2.stateNode, l2 ? (f2 = e2.style, "function" === typeof f2.setProperty ? f2.setProperty("display", "none", "important") : f2.display = "none") : (h2 = q2.stateNode, k2 = q2.memoizedProps.style, g2 = void 0 !== k2 && null !== k2 && k2.hasOwnProperty("display") ? k2.display : null, h2.style.display = rb("display", g2));
              } catch (t2) {
                W$1(a, a.return, t2);
              }
            }
          } else if (6 === q2.tag) {
            if (null === m2) try {
              q2.stateNode.nodeValue = l2 ? "" : q2.memoizedProps;
            } catch (t2) {
              W$1(a, a.return, t2);
            }
          } else if ((22 !== q2.tag && 23 !== q2.tag || null === q2.memoizedState || q2 === a) && null !== q2.child) {
            q2.child.return = q2;
            q2 = q2.child;
            continue;
          }
          if (q2 === a) break a;
          for (; null === q2.sibling; ) {
            if (null === q2.return || q2.return === a) break a;
            m2 === q2 && (m2 = null);
            q2 = q2.return;
          }
          m2 === q2 && (m2 = null);
          q2.sibling.return = q2.return;
          q2 = q2.sibling;
        }
      }
      break;
    case 19:
      ck(b2, a);
      ek(a);
      d2 & 4 && ak(a);
      break;
    case 21:
      break;
    default:
      ck(
        b2,
        a
      ), ek(a);
  }
}
function ek(a) {
  var b2 = a.flags;
  if (b2 & 2) {
    try {
      a: {
        for (var c2 = a.return; null !== c2; ) {
          if (Tj(c2)) {
            var d2 = c2;
            break a;
          }
          c2 = c2.return;
        }
        throw Error(p$2(160));
      }
      switch (d2.tag) {
        case 5:
          var e2 = d2.stateNode;
          d2.flags & 32 && (ob(e2, ""), d2.flags &= -33);
          var f2 = Uj(a);
          Wj(a, f2, e2);
          break;
        case 3:
        case 4:
          var g2 = d2.stateNode.containerInfo, h2 = Uj(a);
          Vj(a, h2, g2);
          break;
        default:
          throw Error(p$2(161));
      }
    } catch (k2) {
      W$1(a, a.return, k2);
    }
    a.flags &= -3;
  }
  b2 & 4096 && (a.flags &= -4097);
}
function hk(a, b2, c2) {
  V$1 = a;
  ik(a);
}
function ik(a, b2, c2) {
  for (var d2 = 0 !== (a.mode & 1); null !== V$1; ) {
    var e2 = V$1, f2 = e2.child;
    if (22 === e2.tag && d2) {
      var g2 = null !== e2.memoizedState || Jj;
      if (!g2) {
        var h2 = e2.alternate, k2 = null !== h2 && null !== h2.memoizedState || U$1;
        h2 = Jj;
        var l2 = U$1;
        Jj = g2;
        if ((U$1 = k2) && !l2) for (V$1 = e2; null !== V$1; ) g2 = V$1, k2 = g2.child, 22 === g2.tag && null !== g2.memoizedState ? jk(e2) : null !== k2 ? (k2.return = g2, V$1 = k2) : jk(e2);
        for (; null !== f2; ) V$1 = f2, ik(f2), f2 = f2.sibling;
        V$1 = e2;
        Jj = h2;
        U$1 = l2;
      }
      kk(a);
    } else 0 !== (e2.subtreeFlags & 8772) && null !== f2 ? (f2.return = e2, V$1 = f2) : kk(a);
  }
}
function kk(a) {
  for (; null !== V$1; ) {
    var b2 = V$1;
    if (0 !== (b2.flags & 8772)) {
      var c2 = b2.alternate;
      try {
        if (0 !== (b2.flags & 8772)) switch (b2.tag) {
          case 0:
          case 11:
          case 15:
            U$1 || Qj(5, b2);
            break;
          case 1:
            var d2 = b2.stateNode;
            if (b2.flags & 4 && !U$1) if (null === c2) d2.componentDidMount();
            else {
              var e2 = b2.elementType === b2.type ? c2.memoizedProps : Ci(b2.type, c2.memoizedProps);
              d2.componentDidUpdate(e2, c2.memoizedState, d2.__reactInternalSnapshotBeforeUpdate);
            }
            var f2 = b2.updateQueue;
            null !== f2 && sh(b2, f2, d2);
            break;
          case 3:
            var g2 = b2.updateQueue;
            if (null !== g2) {
              c2 = null;
              if (null !== b2.child) switch (b2.child.tag) {
                case 5:
                  c2 = b2.child.stateNode;
                  break;
                case 1:
                  c2 = b2.child.stateNode;
              }
              sh(b2, g2, c2);
            }
            break;
          case 5:
            var h2 = b2.stateNode;
            if (null === c2 && b2.flags & 4) {
              c2 = h2;
              var k2 = b2.memoizedProps;
              switch (b2.type) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  k2.autoFocus && c2.focus();
                  break;
                case "img":
                  k2.src && (c2.src = k2.src);
              }
            }
            break;
          case 6:
            break;
          case 4:
            break;
          case 12:
            break;
          case 13:
            if (null === b2.memoizedState) {
              var l2 = b2.alternate;
              if (null !== l2) {
                var m2 = l2.memoizedState;
                if (null !== m2) {
                  var q2 = m2.dehydrated;
                  null !== q2 && bd(q2);
                }
              }
            }
            break;
          case 19:
          case 17:
          case 21:
          case 22:
          case 23:
          case 25:
            break;
          default:
            throw Error(p$2(163));
        }
        U$1 || b2.flags & 512 && Rj(b2);
      } catch (r2) {
        W$1(b2, b2.return, r2);
      }
    }
    if (b2 === a) {
      V$1 = null;
      break;
    }
    c2 = b2.sibling;
    if (null !== c2) {
      c2.return = b2.return;
      V$1 = c2;
      break;
    }
    V$1 = b2.return;
  }
}
function gk(a) {
  for (; null !== V$1; ) {
    var b2 = V$1;
    if (b2 === a) {
      V$1 = null;
      break;
    }
    var c2 = b2.sibling;
    if (null !== c2) {
      c2.return = b2.return;
      V$1 = c2;
      break;
    }
    V$1 = b2.return;
  }
}
function jk(a) {
  for (; null !== V$1; ) {
    var b2 = V$1;
    try {
      switch (b2.tag) {
        case 0:
        case 11:
        case 15:
          var c2 = b2.return;
          try {
            Qj(4, b2);
          } catch (k2) {
            W$1(b2, c2, k2);
          }
          break;
        case 1:
          var d2 = b2.stateNode;
          if ("function" === typeof d2.componentDidMount) {
            var e2 = b2.return;
            try {
              d2.componentDidMount();
            } catch (k2) {
              W$1(b2, e2, k2);
            }
          }
          var f2 = b2.return;
          try {
            Rj(b2);
          } catch (k2) {
            W$1(b2, f2, k2);
          }
          break;
        case 5:
          var g2 = b2.return;
          try {
            Rj(b2);
          } catch (k2) {
            W$1(b2, g2, k2);
          }
      }
    } catch (k2) {
      W$1(b2, b2.return, k2);
    }
    if (b2 === a) {
      V$1 = null;
      break;
    }
    var h2 = b2.sibling;
    if (null !== h2) {
      h2.return = b2.return;
      V$1 = h2;
      break;
    }
    V$1 = b2.return;
  }
}
var lk = Math.ceil, mk = ua.ReactCurrentDispatcher, nk = ua.ReactCurrentOwner, ok = ua.ReactCurrentBatchConfig, K$1 = 0, Q$1 = null, Y$1 = null, Z$1 = 0, fj = 0, ej = Uf(0), T$1 = 0, pk = null, rh = 0, qk = 0, rk = 0, sk = null, tk = null, fk = 0, Gj = Infinity, uk = null, Oi = false, Pi = null, Ri = null, vk = false, wk = null, xk = 0, yk = 0, zk = null, Ak = -1, Bk = 0;
function R() {
  return 0 !== (K$1 & 6) ? B$1() : -1 !== Ak ? Ak : Ak = B$1();
}
function yi(a) {
  if (0 === (a.mode & 1)) return 1;
  if (0 !== (K$1 & 2) && 0 !== Z$1) return Z$1 & -Z$1;
  if (null !== Kg.transition) return 0 === Bk && (Bk = yc()), Bk;
  a = C$1;
  if (0 !== a) return a;
  a = window.event;
  a = void 0 === a ? 16 : jd(a.type);
  return a;
}
function gi(a, b2, c2, d2) {
  if (50 < yk) throw yk = 0, zk = null, Error(p$2(185));
  Ac(a, c2, d2);
  if (0 === (K$1 & 2) || a !== Q$1) a === Q$1 && (0 === (K$1 & 2) && (qk |= c2), 4 === T$1 && Ck(a, Z$1)), Dk(a, d2), 1 === c2 && 0 === K$1 && 0 === (b2.mode & 1) && (Gj = B$1() + 500, fg && jg());
}
function Dk(a, b2) {
  var c2 = a.callbackNode;
  wc(a, b2);
  var d2 = uc(a, a === Q$1 ? Z$1 : 0);
  if (0 === d2) null !== c2 && bc(c2), a.callbackNode = null, a.callbackPriority = 0;
  else if (b2 = d2 & -d2, a.callbackPriority !== b2) {
    null != c2 && bc(c2);
    if (1 === b2) 0 === a.tag ? ig(Ek.bind(null, a)) : hg(Ek.bind(null, a)), Jf(function() {
      0 === (K$1 & 6) && jg();
    }), c2 = null;
    else {
      switch (Dc(d2)) {
        case 1:
          c2 = fc;
          break;
        case 4:
          c2 = gc;
          break;
        case 16:
          c2 = hc;
          break;
        case 536870912:
          c2 = jc;
          break;
        default:
          c2 = hc;
      }
      c2 = Fk(c2, Gk.bind(null, a));
    }
    a.callbackPriority = b2;
    a.callbackNode = c2;
  }
}
function Gk(a, b2) {
  Ak = -1;
  Bk = 0;
  if (0 !== (K$1 & 6)) throw Error(p$2(327));
  var c2 = a.callbackNode;
  if (Hk() && a.callbackNode !== c2) return null;
  var d2 = uc(a, a === Q$1 ? Z$1 : 0);
  if (0 === d2) return null;
  if (0 !== (d2 & 30) || 0 !== (d2 & a.expiredLanes) || b2) b2 = Ik(a, d2);
  else {
    b2 = d2;
    var e2 = K$1;
    K$1 |= 2;
    var f2 = Jk();
    if (Q$1 !== a || Z$1 !== b2) uk = null, Gj = B$1() + 500, Kk(a, b2);
    do
      try {
        Lk();
        break;
      } catch (h2) {
        Mk(a, h2);
      }
    while (1);
    $g();
    mk.current = f2;
    K$1 = e2;
    null !== Y$1 ? b2 = 0 : (Q$1 = null, Z$1 = 0, b2 = T$1);
  }
  if (0 !== b2) {
    2 === b2 && (e2 = xc(a), 0 !== e2 && (d2 = e2, b2 = Nk(a, e2)));
    if (1 === b2) throw c2 = pk, Kk(a, 0), Ck(a, d2), Dk(a, B$1()), c2;
    if (6 === b2) Ck(a, d2);
    else {
      e2 = a.current.alternate;
      if (0 === (d2 & 30) && !Ok(e2) && (b2 = Ik(a, d2), 2 === b2 && (f2 = xc(a), 0 !== f2 && (d2 = f2, b2 = Nk(a, f2))), 1 === b2)) throw c2 = pk, Kk(a, 0), Ck(a, d2), Dk(a, B$1()), c2;
      a.finishedWork = e2;
      a.finishedLanes = d2;
      switch (b2) {
        case 0:
        case 1:
          throw Error(p$2(345));
        case 2:
          Pk(a, tk, uk);
          break;
        case 3:
          Ck(a, d2);
          if ((d2 & 130023424) === d2 && (b2 = fk + 500 - B$1(), 10 < b2)) {
            if (0 !== uc(a, 0)) break;
            e2 = a.suspendedLanes;
            if ((e2 & d2) !== d2) {
              R();
              a.pingedLanes |= a.suspendedLanes & e2;
              break;
            }
            a.timeoutHandle = Ff(Pk.bind(null, a, tk, uk), b2);
            break;
          }
          Pk(a, tk, uk);
          break;
        case 4:
          Ck(a, d2);
          if ((d2 & 4194240) === d2) break;
          b2 = a.eventTimes;
          for (e2 = -1; 0 < d2; ) {
            var g2 = 31 - oc(d2);
            f2 = 1 << g2;
            g2 = b2[g2];
            g2 > e2 && (e2 = g2);
            d2 &= ~f2;
          }
          d2 = e2;
          d2 = B$1() - d2;
          d2 = (120 > d2 ? 120 : 480 > d2 ? 480 : 1080 > d2 ? 1080 : 1920 > d2 ? 1920 : 3e3 > d2 ? 3e3 : 4320 > d2 ? 4320 : 1960 * lk(d2 / 1960)) - d2;
          if (10 < d2) {
            a.timeoutHandle = Ff(Pk.bind(null, a, tk, uk), d2);
            break;
          }
          Pk(a, tk, uk);
          break;
        case 5:
          Pk(a, tk, uk);
          break;
        default:
          throw Error(p$2(329));
      }
    }
  }
  Dk(a, B$1());
  return a.callbackNode === c2 ? Gk.bind(null, a) : null;
}
function Nk(a, b2) {
  var c2 = sk;
  a.current.memoizedState.isDehydrated && (Kk(a, b2).flags |= 256);
  a = Ik(a, b2);
  2 !== a && (b2 = tk, tk = c2, null !== b2 && Fj(b2));
  return a;
}
function Fj(a) {
  null === tk ? tk = a : tk.push.apply(tk, a);
}
function Ok(a) {
  for (var b2 = a; ; ) {
    if (b2.flags & 16384) {
      var c2 = b2.updateQueue;
      if (null !== c2 && (c2 = c2.stores, null !== c2)) for (var d2 = 0; d2 < c2.length; d2++) {
        var e2 = c2[d2], f2 = e2.getSnapshot;
        e2 = e2.value;
        try {
          if (!He$1(f2(), e2)) return false;
        } catch (g2) {
          return false;
        }
      }
    }
    c2 = b2.child;
    if (b2.subtreeFlags & 16384 && null !== c2) c2.return = b2, b2 = c2;
    else {
      if (b2 === a) break;
      for (; null === b2.sibling; ) {
        if (null === b2.return || b2.return === a) return true;
        b2 = b2.return;
      }
      b2.sibling.return = b2.return;
      b2 = b2.sibling;
    }
  }
  return true;
}
function Ck(a, b2) {
  b2 &= ~rk;
  b2 &= ~qk;
  a.suspendedLanes |= b2;
  a.pingedLanes &= ~b2;
  for (a = a.expirationTimes; 0 < b2; ) {
    var c2 = 31 - oc(b2), d2 = 1 << c2;
    a[c2] = -1;
    b2 &= ~d2;
  }
}
function Ek(a) {
  if (0 !== (K$1 & 6)) throw Error(p$2(327));
  Hk();
  var b2 = uc(a, 0);
  if (0 === (b2 & 1)) return Dk(a, B$1()), null;
  var c2 = Ik(a, b2);
  if (0 !== a.tag && 2 === c2) {
    var d2 = xc(a);
    0 !== d2 && (b2 = d2, c2 = Nk(a, d2));
  }
  if (1 === c2) throw c2 = pk, Kk(a, 0), Ck(a, b2), Dk(a, B$1()), c2;
  if (6 === c2) throw Error(p$2(345));
  a.finishedWork = a.current.alternate;
  a.finishedLanes = b2;
  Pk(a, tk, uk);
  Dk(a, B$1());
  return null;
}
function Qk(a, b2) {
  var c2 = K$1;
  K$1 |= 1;
  try {
    return a(b2);
  } finally {
    K$1 = c2, 0 === K$1 && (Gj = B$1() + 500, fg && jg());
  }
}
function Rk(a) {
  null !== wk && 0 === wk.tag && 0 === (K$1 & 6) && Hk();
  var b2 = K$1;
  K$1 |= 1;
  var c2 = ok.transition, d2 = C$1;
  try {
    if (ok.transition = null, C$1 = 1, a) return a();
  } finally {
    C$1 = d2, ok.transition = c2, K$1 = b2, 0 === (K$1 & 6) && jg();
  }
}
function Hj() {
  fj = ej.current;
  E$1(ej);
}
function Kk(a, b2) {
  a.finishedWork = null;
  a.finishedLanes = 0;
  var c2 = a.timeoutHandle;
  -1 !== c2 && (a.timeoutHandle = -1, Gf(c2));
  if (null !== Y$1) for (c2 = Y$1.return; null !== c2; ) {
    var d2 = c2;
    wg(d2);
    switch (d2.tag) {
      case 1:
        d2 = d2.type.childContextTypes;
        null !== d2 && void 0 !== d2 && $f();
        break;
      case 3:
        zh();
        E$1(Wf);
        E$1(H$1);
        Eh();
        break;
      case 5:
        Bh(d2);
        break;
      case 4:
        zh();
        break;
      case 13:
        E$1(L$1);
        break;
      case 19:
        E$1(L$1);
        break;
      case 10:
        ah(d2.type._context);
        break;
      case 22:
      case 23:
        Hj();
    }
    c2 = c2.return;
  }
  Q$1 = a;
  Y$1 = a = Pg(a.current, null);
  Z$1 = fj = b2;
  T$1 = 0;
  pk = null;
  rk = qk = rh = 0;
  tk = sk = null;
  if (null !== fh) {
    for (b2 = 0; b2 < fh.length; b2++) if (c2 = fh[b2], d2 = c2.interleaved, null !== d2) {
      c2.interleaved = null;
      var e2 = d2.next, f2 = c2.pending;
      if (null !== f2) {
        var g2 = f2.next;
        f2.next = e2;
        d2.next = g2;
      }
      c2.pending = d2;
    }
    fh = null;
  }
  return a;
}
function Mk(a, b2) {
  do {
    var c2 = Y$1;
    try {
      $g();
      Fh.current = Rh;
      if (Ih) {
        for (var d2 = M$1.memoizedState; null !== d2; ) {
          var e2 = d2.queue;
          null !== e2 && (e2.pending = null);
          d2 = d2.next;
        }
        Ih = false;
      }
      Hh = 0;
      O = N$1 = M$1 = null;
      Jh = false;
      Kh = 0;
      nk.current = null;
      if (null === c2 || null === c2.return) {
        T$1 = 1;
        pk = b2;
        Y$1 = null;
        break;
      }
      a: {
        var f2 = a, g2 = c2.return, h2 = c2, k2 = b2;
        b2 = Z$1;
        h2.flags |= 32768;
        if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) {
          var l2 = k2, m2 = h2, q2 = m2.tag;
          if (0 === (m2.mode & 1) && (0 === q2 || 11 === q2 || 15 === q2)) {
            var r2 = m2.alternate;
            r2 ? (m2.updateQueue = r2.updateQueue, m2.memoizedState = r2.memoizedState, m2.lanes = r2.lanes) : (m2.updateQueue = null, m2.memoizedState = null);
          }
          var y2 = Ui(g2);
          if (null !== y2) {
            y2.flags &= -257;
            Vi(y2, g2, h2, f2, b2);
            y2.mode & 1 && Si(f2, l2, b2);
            b2 = y2;
            k2 = l2;
            var n2 = b2.updateQueue;
            if (null === n2) {
              var t2 = /* @__PURE__ */ new Set();
              t2.add(k2);
              b2.updateQueue = t2;
            } else n2.add(k2);
            break a;
          } else {
            if (0 === (b2 & 1)) {
              Si(f2, l2, b2);
              tj();
              break a;
            }
            k2 = Error(p$2(426));
          }
        } else if (I$1 && h2.mode & 1) {
          var J2 = Ui(g2);
          if (null !== J2) {
            0 === (J2.flags & 65536) && (J2.flags |= 256);
            Vi(J2, g2, h2, f2, b2);
            Jg(Ji(k2, h2));
            break a;
          }
        }
        f2 = k2 = Ji(k2, h2);
        4 !== T$1 && (T$1 = 2);
        null === sk ? sk = [f2] : sk.push(f2);
        f2 = g2;
        do {
          switch (f2.tag) {
            case 3:
              f2.flags |= 65536;
              b2 &= -b2;
              f2.lanes |= b2;
              var x2 = Ni(f2, k2, b2);
              ph(f2, x2);
              break a;
            case 1:
              h2 = k2;
              var w2 = f2.type, u2 = f2.stateNode;
              if (0 === (f2.flags & 128) && ("function" === typeof w2.getDerivedStateFromError || null !== u2 && "function" === typeof u2.componentDidCatch && (null === Ri || !Ri.has(u2)))) {
                f2.flags |= 65536;
                b2 &= -b2;
                f2.lanes |= b2;
                var F2 = Qi(f2, h2, b2);
                ph(f2, F2);
                break a;
              }
          }
          f2 = f2.return;
        } while (null !== f2);
      }
      Sk(c2);
    } catch (na) {
      b2 = na;
      Y$1 === c2 && null !== c2 && (Y$1 = c2 = c2.return);
      continue;
    }
    break;
  } while (1);
}
function Jk() {
  var a = mk.current;
  mk.current = Rh;
  return null === a ? Rh : a;
}
function tj() {
  if (0 === T$1 || 3 === T$1 || 2 === T$1) T$1 = 4;
  null === Q$1 || 0 === (rh & 268435455) && 0 === (qk & 268435455) || Ck(Q$1, Z$1);
}
function Ik(a, b2) {
  var c2 = K$1;
  K$1 |= 2;
  var d2 = Jk();
  if (Q$1 !== a || Z$1 !== b2) uk = null, Kk(a, b2);
  do
    try {
      Tk();
      break;
    } catch (e2) {
      Mk(a, e2);
    }
  while (1);
  $g();
  K$1 = c2;
  mk.current = d2;
  if (null !== Y$1) throw Error(p$2(261));
  Q$1 = null;
  Z$1 = 0;
  return T$1;
}
function Tk() {
  for (; null !== Y$1; ) Uk(Y$1);
}
function Lk() {
  for (; null !== Y$1 && !cc(); ) Uk(Y$1);
}
function Uk(a) {
  var b2 = Vk(a.alternate, a, fj);
  a.memoizedProps = a.pendingProps;
  null === b2 ? Sk(a) : Y$1 = b2;
  nk.current = null;
}
function Sk(a) {
  var b2 = a;
  do {
    var c2 = b2.alternate;
    a = b2.return;
    if (0 === (b2.flags & 32768)) {
      if (c2 = Ej(c2, b2, fj), null !== c2) {
        Y$1 = c2;
        return;
      }
    } else {
      c2 = Ij(c2, b2);
      if (null !== c2) {
        c2.flags &= 32767;
        Y$1 = c2;
        return;
      }
      if (null !== a) a.flags |= 32768, a.subtreeFlags = 0, a.deletions = null;
      else {
        T$1 = 6;
        Y$1 = null;
        return;
      }
    }
    b2 = b2.sibling;
    if (null !== b2) {
      Y$1 = b2;
      return;
    }
    Y$1 = b2 = a;
  } while (null !== b2);
  0 === T$1 && (T$1 = 5);
}
function Pk(a, b2, c2) {
  var d2 = C$1, e2 = ok.transition;
  try {
    ok.transition = null, C$1 = 1, Wk(a, b2, c2, d2);
  } finally {
    ok.transition = e2, C$1 = d2;
  }
  return null;
}
function Wk(a, b2, c2, d2) {
  do
    Hk();
  while (null !== wk);
  if (0 !== (K$1 & 6)) throw Error(p$2(327));
  c2 = a.finishedWork;
  var e2 = a.finishedLanes;
  if (null === c2) return null;
  a.finishedWork = null;
  a.finishedLanes = 0;
  if (c2 === a.current) throw Error(p$2(177));
  a.callbackNode = null;
  a.callbackPriority = 0;
  var f2 = c2.lanes | c2.childLanes;
  Bc(a, f2);
  a === Q$1 && (Y$1 = Q$1 = null, Z$1 = 0);
  0 === (c2.subtreeFlags & 2064) && 0 === (c2.flags & 2064) || vk || (vk = true, Fk(hc, function() {
    Hk();
    return null;
  }));
  f2 = 0 !== (c2.flags & 15990);
  if (0 !== (c2.subtreeFlags & 15990) || f2) {
    f2 = ok.transition;
    ok.transition = null;
    var g2 = C$1;
    C$1 = 1;
    var h2 = K$1;
    K$1 |= 4;
    nk.current = null;
    Oj(a, c2);
    dk(c2, a);
    Oe$1(Df);
    dd = !!Cf;
    Df = Cf = null;
    a.current = c2;
    hk(c2);
    dc();
    K$1 = h2;
    C$1 = g2;
    ok.transition = f2;
  } else a.current = c2;
  vk && (vk = false, wk = a, xk = e2);
  f2 = a.pendingLanes;
  0 === f2 && (Ri = null);
  mc(c2.stateNode);
  Dk(a, B$1());
  if (null !== b2) for (d2 = a.onRecoverableError, c2 = 0; c2 < b2.length; c2++) e2 = b2[c2], d2(e2.value, { componentStack: e2.stack, digest: e2.digest });
  if (Oi) throw Oi = false, a = Pi, Pi = null, a;
  0 !== (xk & 1) && 0 !== a.tag && Hk();
  f2 = a.pendingLanes;
  0 !== (f2 & 1) ? a === zk ? yk++ : (yk = 0, zk = a) : yk = 0;
  jg();
  return null;
}
function Hk() {
  if (null !== wk) {
    var a = Dc(xk), b2 = ok.transition, c2 = C$1;
    try {
      ok.transition = null;
      C$1 = 16 > a ? 16 : a;
      if (null === wk) var d2 = false;
      else {
        a = wk;
        wk = null;
        xk = 0;
        if (0 !== (K$1 & 6)) throw Error(p$2(331));
        var e2 = K$1;
        K$1 |= 4;
        for (V$1 = a.current; null !== V$1; ) {
          var f2 = V$1, g2 = f2.child;
          if (0 !== (V$1.flags & 16)) {
            var h2 = f2.deletions;
            if (null !== h2) {
              for (var k2 = 0; k2 < h2.length; k2++) {
                var l2 = h2[k2];
                for (V$1 = l2; null !== V$1; ) {
                  var m2 = V$1;
                  switch (m2.tag) {
                    case 0:
                    case 11:
                    case 15:
                      Pj(8, m2, f2);
                  }
                  var q2 = m2.child;
                  if (null !== q2) q2.return = m2, V$1 = q2;
                  else for (; null !== V$1; ) {
                    m2 = V$1;
                    var r2 = m2.sibling, y2 = m2.return;
                    Sj(m2);
                    if (m2 === l2) {
                      V$1 = null;
                      break;
                    }
                    if (null !== r2) {
                      r2.return = y2;
                      V$1 = r2;
                      break;
                    }
                    V$1 = y2;
                  }
                }
              }
              var n2 = f2.alternate;
              if (null !== n2) {
                var t2 = n2.child;
                if (null !== t2) {
                  n2.child = null;
                  do {
                    var J2 = t2.sibling;
                    t2.sibling = null;
                    t2 = J2;
                  } while (null !== t2);
                }
              }
              V$1 = f2;
            }
          }
          if (0 !== (f2.subtreeFlags & 2064) && null !== g2) g2.return = f2, V$1 = g2;
          else b: for (; null !== V$1; ) {
            f2 = V$1;
            if (0 !== (f2.flags & 2048)) switch (f2.tag) {
              case 0:
              case 11:
              case 15:
                Pj(9, f2, f2.return);
            }
            var x2 = f2.sibling;
            if (null !== x2) {
              x2.return = f2.return;
              V$1 = x2;
              break b;
            }
            V$1 = f2.return;
          }
        }
        var w2 = a.current;
        for (V$1 = w2; null !== V$1; ) {
          g2 = V$1;
          var u2 = g2.child;
          if (0 !== (g2.subtreeFlags & 2064) && null !== u2) u2.return = g2, V$1 = u2;
          else b: for (g2 = w2; null !== V$1; ) {
            h2 = V$1;
            if (0 !== (h2.flags & 2048)) try {
              switch (h2.tag) {
                case 0:
                case 11:
                case 15:
                  Qj(9, h2);
              }
            } catch (na) {
              W$1(h2, h2.return, na);
            }
            if (h2 === g2) {
              V$1 = null;
              break b;
            }
            var F2 = h2.sibling;
            if (null !== F2) {
              F2.return = h2.return;
              V$1 = F2;
              break b;
            }
            V$1 = h2.return;
          }
        }
        K$1 = e2;
        jg();
        if (lc && "function" === typeof lc.onPostCommitFiberRoot) try {
          lc.onPostCommitFiberRoot(kc, a);
        } catch (na) {
        }
        d2 = true;
      }
      return d2;
    } finally {
      C$1 = c2, ok.transition = b2;
    }
  }
  return false;
}
function Xk(a, b2, c2) {
  b2 = Ji(c2, b2);
  b2 = Ni(a, b2, 1);
  a = nh(a, b2, 1);
  b2 = R();
  null !== a && (Ac(a, 1, b2), Dk(a, b2));
}
function W$1(a, b2, c2) {
  if (3 === a.tag) Xk(a, a, c2);
  else for (; null !== b2; ) {
    if (3 === b2.tag) {
      Xk(b2, a, c2);
      break;
    } else if (1 === b2.tag) {
      var d2 = b2.stateNode;
      if ("function" === typeof b2.type.getDerivedStateFromError || "function" === typeof d2.componentDidCatch && (null === Ri || !Ri.has(d2))) {
        a = Ji(c2, a);
        a = Qi(b2, a, 1);
        b2 = nh(b2, a, 1);
        a = R();
        null !== b2 && (Ac(b2, 1, a), Dk(b2, a));
        break;
      }
    }
    b2 = b2.return;
  }
}
function Ti(a, b2, c2) {
  var d2 = a.pingCache;
  null !== d2 && d2.delete(b2);
  b2 = R();
  a.pingedLanes |= a.suspendedLanes & c2;
  Q$1 === a && (Z$1 & c2) === c2 && (4 === T$1 || 3 === T$1 && (Z$1 & 130023424) === Z$1 && 500 > B$1() - fk ? Kk(a, 0) : rk |= c2);
  Dk(a, b2);
}
function Yk(a, b2) {
  0 === b2 && (0 === (a.mode & 1) ? b2 = 1 : (b2 = sc, sc <<= 1, 0 === (sc & 130023424) && (sc = 4194304)));
  var c2 = R();
  a = ih(a, b2);
  null !== a && (Ac(a, b2, c2), Dk(a, c2));
}
function uj(a) {
  var b2 = a.memoizedState, c2 = 0;
  null !== b2 && (c2 = b2.retryLane);
  Yk(a, c2);
}
function bk(a, b2) {
  var c2 = 0;
  switch (a.tag) {
    case 13:
      var d2 = a.stateNode;
      var e2 = a.memoizedState;
      null !== e2 && (c2 = e2.retryLane);
      break;
    case 19:
      d2 = a.stateNode;
      break;
    default:
      throw Error(p$2(314));
  }
  null !== d2 && d2.delete(b2);
  Yk(a, c2);
}
var Vk;
Vk = function(a, b2, c2) {
  if (null !== a) if (a.memoizedProps !== b2.pendingProps || Wf.current) dh = true;
  else {
    if (0 === (a.lanes & c2) && 0 === (b2.flags & 128)) return dh = false, yj(a, b2, c2);
    dh = 0 !== (a.flags & 131072) ? true : false;
  }
  else dh = false, I$1 && 0 !== (b2.flags & 1048576) && ug(b2, ng, b2.index);
  b2.lanes = 0;
  switch (b2.tag) {
    case 2:
      var d2 = b2.type;
      ij(a, b2);
      a = b2.pendingProps;
      var e2 = Yf(b2, H$1.current);
      ch(b2, c2);
      e2 = Nh(null, b2, d2, a, e2, c2);
      var f2 = Sh();
      b2.flags |= 1;
      "object" === typeof e2 && null !== e2 && "function" === typeof e2.render && void 0 === e2.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, Zf(d2) ? (f2 = true, cg(b2)) : f2 = false, b2.memoizedState = null !== e2.state && void 0 !== e2.state ? e2.state : null, kh(b2), e2.updater = Ei, b2.stateNode = e2, e2._reactInternals = b2, Ii(b2, d2, a, c2), b2 = jj(null, b2, d2, true, f2, c2)) : (b2.tag = 0, I$1 && f2 && vg(b2), Xi(null, b2, e2, c2), b2 = b2.child);
      return b2;
    case 16:
      d2 = b2.elementType;
      a: {
        ij(a, b2);
        a = b2.pendingProps;
        e2 = d2._init;
        d2 = e2(d2._payload);
        b2.type = d2;
        e2 = b2.tag = Zk(d2);
        a = Ci(d2, a);
        switch (e2) {
          case 0:
            b2 = cj(null, b2, d2, a, c2);
            break a;
          case 1:
            b2 = hj(null, b2, d2, a, c2);
            break a;
          case 11:
            b2 = Yi(null, b2, d2, a, c2);
            break a;
          case 14:
            b2 = $i(null, b2, d2, Ci(d2.type, a), c2);
            break a;
        }
        throw Error(p$2(
          306,
          d2,
          ""
        ));
      }
      return b2;
    case 0:
      return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci(d2, e2), cj(a, b2, d2, e2, c2);
    case 1:
      return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci(d2, e2), hj(a, b2, d2, e2, c2);
    case 3:
      a: {
        kj(b2);
        if (null === a) throw Error(p$2(387));
        d2 = b2.pendingProps;
        f2 = b2.memoizedState;
        e2 = f2.element;
        lh(a, b2);
        qh(b2, d2, null, c2);
        var g2 = b2.memoizedState;
        d2 = g2.element;
        if (f2.isDehydrated) if (f2 = { element: d2, isDehydrated: false, cache: g2.cache, pendingSuspenseBoundaries: g2.pendingSuspenseBoundaries, transitions: g2.transitions }, b2.updateQueue.baseState = f2, b2.memoizedState = f2, b2.flags & 256) {
          e2 = Ji(Error(p$2(423)), b2);
          b2 = lj(a, b2, d2, c2, e2);
          break a;
        } else if (d2 !== e2) {
          e2 = Ji(Error(p$2(424)), b2);
          b2 = lj(a, b2, d2, c2, e2);
          break a;
        } else for (yg = Lf(b2.stateNode.containerInfo.firstChild), xg = b2, I$1 = true, zg = null, c2 = Vg(b2, null, d2, c2), b2.child = c2; c2; ) c2.flags = c2.flags & -3 | 4096, c2 = c2.sibling;
        else {
          Ig();
          if (d2 === e2) {
            b2 = Zi(a, b2, c2);
            break a;
          }
          Xi(a, b2, d2, c2);
        }
        b2 = b2.child;
      }
      return b2;
    case 5:
      return Ah(b2), null === a && Eg(b2), d2 = b2.type, e2 = b2.pendingProps, f2 = null !== a ? a.memoizedProps : null, g2 = e2.children, Ef(d2, e2) ? g2 = null : null !== f2 && Ef(d2, f2) && (b2.flags |= 32), gj(a, b2), Xi(a, b2, g2, c2), b2.child;
    case 6:
      return null === a && Eg(b2), null;
    case 13:
      return oj(a, b2, c2);
    case 4:
      return yh(b2, b2.stateNode.containerInfo), d2 = b2.pendingProps, null === a ? b2.child = Ug(b2, null, d2, c2) : Xi(a, b2, d2, c2), b2.child;
    case 11:
      return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci(d2, e2), Yi(a, b2, d2, e2, c2);
    case 7:
      return Xi(a, b2, b2.pendingProps, c2), b2.child;
    case 8:
      return Xi(a, b2, b2.pendingProps.children, c2), b2.child;
    case 12:
      return Xi(a, b2, b2.pendingProps.children, c2), b2.child;
    case 10:
      a: {
        d2 = b2.type._context;
        e2 = b2.pendingProps;
        f2 = b2.memoizedProps;
        g2 = e2.value;
        G$1(Wg, d2._currentValue);
        d2._currentValue = g2;
        if (null !== f2) if (He$1(f2.value, g2)) {
          if (f2.children === e2.children && !Wf.current) {
            b2 = Zi(a, b2, c2);
            break a;
          }
        } else for (f2 = b2.child, null !== f2 && (f2.return = b2); null !== f2; ) {
          var h2 = f2.dependencies;
          if (null !== h2) {
            g2 = f2.child;
            for (var k2 = h2.firstContext; null !== k2; ) {
              if (k2.context === d2) {
                if (1 === f2.tag) {
                  k2 = mh(-1, c2 & -c2);
                  k2.tag = 2;
                  var l2 = f2.updateQueue;
                  if (null !== l2) {
                    l2 = l2.shared;
                    var m2 = l2.pending;
                    null === m2 ? k2.next = k2 : (k2.next = m2.next, m2.next = k2);
                    l2.pending = k2;
                  }
                }
                f2.lanes |= c2;
                k2 = f2.alternate;
                null !== k2 && (k2.lanes |= c2);
                bh(
                  f2.return,
                  c2,
                  b2
                );
                h2.lanes |= c2;
                break;
              }
              k2 = k2.next;
            }
          } else if (10 === f2.tag) g2 = f2.type === b2.type ? null : f2.child;
          else if (18 === f2.tag) {
            g2 = f2.return;
            if (null === g2) throw Error(p$2(341));
            g2.lanes |= c2;
            h2 = g2.alternate;
            null !== h2 && (h2.lanes |= c2);
            bh(g2, c2, b2);
            g2 = f2.sibling;
          } else g2 = f2.child;
          if (null !== g2) g2.return = f2;
          else for (g2 = f2; null !== g2; ) {
            if (g2 === b2) {
              g2 = null;
              break;
            }
            f2 = g2.sibling;
            if (null !== f2) {
              f2.return = g2.return;
              g2 = f2;
              break;
            }
            g2 = g2.return;
          }
          f2 = g2;
        }
        Xi(a, b2, e2.children, c2);
        b2 = b2.child;
      }
      return b2;
    case 9:
      return e2 = b2.type, d2 = b2.pendingProps.children, ch(b2, c2), e2 = eh(e2), d2 = d2(e2), b2.flags |= 1, Xi(a, b2, d2, c2), b2.child;
    case 14:
      return d2 = b2.type, e2 = Ci(d2, b2.pendingProps), e2 = Ci(d2.type, e2), $i(a, b2, d2, e2, c2);
    case 15:
      return bj(a, b2, b2.type, b2.pendingProps, c2);
    case 17:
      return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : Ci(d2, e2), ij(a, b2), b2.tag = 1, Zf(d2) ? (a = true, cg(b2)) : a = false, ch(b2, c2), Gi(b2, d2, e2), Ii(b2, d2, e2, c2), jj(null, b2, d2, true, a, c2);
    case 19:
      return xj(a, b2, c2);
    case 22:
      return dj(a, b2, c2);
  }
  throw Error(p$2(156, b2.tag));
};
function Fk(a, b2) {
  return ac(a, b2);
}
function $k(a, b2, c2, d2) {
  this.tag = a;
  this.key = c2;
  this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
  this.index = 0;
  this.ref = null;
  this.pendingProps = b2;
  this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
  this.mode = d2;
  this.subtreeFlags = this.flags = 0;
  this.deletions = null;
  this.childLanes = this.lanes = 0;
  this.alternate = null;
}
function Bg(a, b2, c2, d2) {
  return new $k(a, b2, c2, d2);
}
function aj(a) {
  a = a.prototype;
  return !(!a || !a.isReactComponent);
}
function Zk(a) {
  if ("function" === typeof a) return aj(a) ? 1 : 0;
  if (void 0 !== a && null !== a) {
    a = a.$$typeof;
    if (a === Da) return 11;
    if (a === Ga) return 14;
  }
  return 2;
}
function Pg(a, b2) {
  var c2 = a.alternate;
  null === c2 ? (c2 = Bg(a.tag, b2, a.key, a.mode), c2.elementType = a.elementType, c2.type = a.type, c2.stateNode = a.stateNode, c2.alternate = a, a.alternate = c2) : (c2.pendingProps = b2, c2.type = a.type, c2.flags = 0, c2.subtreeFlags = 0, c2.deletions = null);
  c2.flags = a.flags & 14680064;
  c2.childLanes = a.childLanes;
  c2.lanes = a.lanes;
  c2.child = a.child;
  c2.memoizedProps = a.memoizedProps;
  c2.memoizedState = a.memoizedState;
  c2.updateQueue = a.updateQueue;
  b2 = a.dependencies;
  c2.dependencies = null === b2 ? null : { lanes: b2.lanes, firstContext: b2.firstContext };
  c2.sibling = a.sibling;
  c2.index = a.index;
  c2.ref = a.ref;
  return c2;
}
function Rg(a, b2, c2, d2, e2, f2) {
  var g2 = 2;
  d2 = a;
  if ("function" === typeof a) aj(a) && (g2 = 1);
  else if ("string" === typeof a) g2 = 5;
  else a: switch (a) {
    case ya:
      return Tg(c2.children, e2, f2, b2);
    case za:
      g2 = 8;
      e2 |= 8;
      break;
    case Aa:
      return a = Bg(12, c2, b2, e2 | 2), a.elementType = Aa, a.lanes = f2, a;
    case Ea:
      return a = Bg(13, c2, b2, e2), a.elementType = Ea, a.lanes = f2, a;
    case Fa:
      return a = Bg(19, c2, b2, e2), a.elementType = Fa, a.lanes = f2, a;
    case Ia:
      return pj(c2, e2, f2, b2);
    default:
      if ("object" === typeof a && null !== a) switch (a.$$typeof) {
        case Ba:
          g2 = 10;
          break a;
        case Ca:
          g2 = 9;
          break a;
        case Da:
          g2 = 11;
          break a;
        case Ga:
          g2 = 14;
          break a;
        case Ha:
          g2 = 16;
          d2 = null;
          break a;
      }
      throw Error(p$2(130, null == a ? a : typeof a, ""));
  }
  b2 = Bg(g2, c2, b2, e2);
  b2.elementType = a;
  b2.type = d2;
  b2.lanes = f2;
  return b2;
}
function Tg(a, b2, c2, d2) {
  a = Bg(7, a, d2, b2);
  a.lanes = c2;
  return a;
}
function pj(a, b2, c2, d2) {
  a = Bg(22, a, d2, b2);
  a.elementType = Ia;
  a.lanes = c2;
  a.stateNode = { isHidden: false };
  return a;
}
function Qg(a, b2, c2) {
  a = Bg(6, a, null, b2);
  a.lanes = c2;
  return a;
}
function Sg(a, b2, c2) {
  b2 = Bg(4, null !== a.children ? a.children : [], a.key, b2);
  b2.lanes = c2;
  b2.stateNode = { containerInfo: a.containerInfo, pendingChildren: null, implementation: a.implementation };
  return b2;
}
function al(a, b2, c2, d2, e2) {
  this.tag = b2;
  this.containerInfo = a;
  this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
  this.timeoutHandle = -1;
  this.callbackNode = this.pendingContext = this.context = null;
  this.callbackPriority = 0;
  this.eventTimes = zc(0);
  this.expirationTimes = zc(-1);
  this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
  this.entanglements = zc(0);
  this.identifierPrefix = d2;
  this.onRecoverableError = e2;
  this.mutableSourceEagerHydrationData = null;
}
function bl(a, b2, c2, d2, e2, f2, g2, h2, k2) {
  a = new al(a, b2, c2, h2, k2);
  1 === b2 ? (b2 = 1, true === f2 && (b2 |= 8)) : b2 = 0;
  f2 = Bg(3, null, null, b2);
  a.current = f2;
  f2.stateNode = a;
  f2.memoizedState = { element: d2, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null };
  kh(f2);
  return a;
}
function cl(a, b2, c2) {
  var d2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  return { $$typeof: wa, key: null == d2 ? null : "" + d2, children: a, containerInfo: b2, implementation: c2 };
}
function dl(a) {
  if (!a) return Vf;
  a = a._reactInternals;
  a: {
    if (Vb(a) !== a || 1 !== a.tag) throw Error(p$2(170));
    var b2 = a;
    do {
      switch (b2.tag) {
        case 3:
          b2 = b2.stateNode.context;
          break a;
        case 1:
          if (Zf(b2.type)) {
            b2 = b2.stateNode.__reactInternalMemoizedMergedChildContext;
            break a;
          }
      }
      b2 = b2.return;
    } while (null !== b2);
    throw Error(p$2(171));
  }
  if (1 === a.tag) {
    var c2 = a.type;
    if (Zf(c2)) return bg(a, c2, b2);
  }
  return b2;
}
function el(a, b2, c2, d2, e2, f2, g2, h2, k2) {
  a = bl(c2, d2, true, a, e2, f2, g2, h2, k2);
  a.context = dl(null);
  c2 = a.current;
  d2 = R();
  e2 = yi(c2);
  f2 = mh(d2, e2);
  f2.callback = void 0 !== b2 && null !== b2 ? b2 : null;
  nh(c2, f2, e2);
  a.current.lanes = e2;
  Ac(a, e2, d2);
  Dk(a, d2);
  return a;
}
function fl(a, b2, c2, d2) {
  var e2 = b2.current, f2 = R(), g2 = yi(e2);
  c2 = dl(c2);
  null === b2.context ? b2.context = c2 : b2.pendingContext = c2;
  b2 = mh(f2, g2);
  b2.payload = { element: a };
  d2 = void 0 === d2 ? null : d2;
  null !== d2 && (b2.callback = d2);
  a = nh(e2, b2, g2);
  null !== a && (gi(a, e2, g2, f2), oh(a, e2, g2));
  return g2;
}
function gl(a) {
  a = a.current;
  if (!a.child) return null;
  switch (a.child.tag) {
    case 5:
      return a.child.stateNode;
    default:
      return a.child.stateNode;
  }
}
function hl(a, b2) {
  a = a.memoizedState;
  if (null !== a && null !== a.dehydrated) {
    var c2 = a.retryLane;
    a.retryLane = 0 !== c2 && c2 < b2 ? c2 : b2;
  }
}
function il(a, b2) {
  hl(a, b2);
  (a = a.alternate) && hl(a, b2);
}
function jl() {
  return null;
}
var kl = "function" === typeof reportError ? reportError : function(a) {
  console.error(a);
};
function ll(a) {
  this._internalRoot = a;
}
ml.prototype.render = ll.prototype.render = function(a) {
  var b2 = this._internalRoot;
  if (null === b2) throw Error(p$2(409));
  fl(a, b2, null, null);
};
ml.prototype.unmount = ll.prototype.unmount = function() {
  var a = this._internalRoot;
  if (null !== a) {
    this._internalRoot = null;
    var b2 = a.containerInfo;
    Rk(function() {
      fl(null, a, null, null);
    });
    b2[uf] = null;
  }
};
function ml(a) {
  this._internalRoot = a;
}
ml.prototype.unstable_scheduleHydration = function(a) {
  if (a) {
    var b2 = Hc();
    a = { blockedOn: null, target: a, priority: b2 };
    for (var c2 = 0; c2 < Qc.length && 0 !== b2 && b2 < Qc[c2].priority; c2++) ;
    Qc.splice(c2, 0, a);
    0 === c2 && Vc(a);
  }
};
function nl(a) {
  return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType);
}
function ol(a) {
  return !(!a || 1 !== a.nodeType && 9 !== a.nodeType && 11 !== a.nodeType && (8 !== a.nodeType || " react-mount-point-unstable " !== a.nodeValue));
}
function pl() {
}
function ql(a, b2, c2, d2, e2) {
  if (e2) {
    if ("function" === typeof d2) {
      var f2 = d2;
      d2 = function() {
        var a2 = gl(g2);
        f2.call(a2);
      };
    }
    var g2 = el(b2, d2, a, 0, null, false, false, "", pl);
    a._reactRootContainer = g2;
    a[uf] = g2.current;
    sf(8 === a.nodeType ? a.parentNode : a);
    Rk();
    return g2;
  }
  for (; e2 = a.lastChild; ) a.removeChild(e2);
  if ("function" === typeof d2) {
    var h2 = d2;
    d2 = function() {
      var a2 = gl(k2);
      h2.call(a2);
    };
  }
  var k2 = bl(a, 0, false, null, null, false, false, "", pl);
  a._reactRootContainer = k2;
  a[uf] = k2.current;
  sf(8 === a.nodeType ? a.parentNode : a);
  Rk(function() {
    fl(b2, k2, c2, d2);
  });
  return k2;
}
function rl(a, b2, c2, d2, e2) {
  var f2 = c2._reactRootContainer;
  if (f2) {
    var g2 = f2;
    if ("function" === typeof e2) {
      var h2 = e2;
      e2 = function() {
        var a2 = gl(g2);
        h2.call(a2);
      };
    }
    fl(b2, g2, a, e2);
  } else g2 = ql(c2, b2, a, e2, d2);
  return gl(g2);
}
Ec = function(a) {
  switch (a.tag) {
    case 3:
      var b2 = a.stateNode;
      if (b2.current.memoizedState.isDehydrated) {
        var c2 = tc(b2.pendingLanes);
        0 !== c2 && (Cc(b2, c2 | 1), Dk(b2, B$1()), 0 === (K$1 & 6) && (Gj = B$1() + 500, jg()));
      }
      break;
    case 13:
      Rk(function() {
        var b3 = ih(a, 1);
        if (null !== b3) {
          var c3 = R();
          gi(b3, a, 1, c3);
        }
      }), il(a, 1);
  }
};
Fc = function(a) {
  if (13 === a.tag) {
    var b2 = ih(a, 134217728);
    if (null !== b2) {
      var c2 = R();
      gi(b2, a, 134217728, c2);
    }
    il(a, 134217728);
  }
};
Gc = function(a) {
  if (13 === a.tag) {
    var b2 = yi(a), c2 = ih(a, b2);
    if (null !== c2) {
      var d2 = R();
      gi(c2, a, b2, d2);
    }
    il(a, b2);
  }
};
Hc = function() {
  return C$1;
};
Ic = function(a, b2) {
  var c2 = C$1;
  try {
    return C$1 = a, b2();
  } finally {
    C$1 = c2;
  }
};
yb = function(a, b2, c2) {
  switch (b2) {
    case "input":
      bb(a, c2);
      b2 = c2.name;
      if ("radio" === c2.type && null != b2) {
        for (c2 = a; c2.parentNode; ) c2 = c2.parentNode;
        c2 = c2.querySelectorAll("input[name=" + JSON.stringify("" + b2) + '][type="radio"]');
        for (b2 = 0; b2 < c2.length; b2++) {
          var d2 = c2[b2];
          if (d2 !== a && d2.form === a.form) {
            var e2 = Db(d2);
            if (!e2) throw Error(p$2(90));
            Wa(d2);
            bb(d2, e2);
          }
        }
      }
      break;
    case "textarea":
      ib(a, c2);
      break;
    case "select":
      b2 = c2.value, null != b2 && fb(a, !!c2.multiple, b2, false);
  }
};
Gb = Qk;
Hb = Rk;
var sl = { usingClientEntryPoint: false, Events: [Cb, ue, Db, Eb, Fb, Qk] }, tl = { findFiberByHostInstance: Wc, bundleType: 0, version: "18.3.1", rendererPackageName: "react-dom" };
var ul = { bundleType: tl.bundleType, version: tl.version, rendererPackageName: tl.rendererPackageName, rendererConfig: tl.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: ua.ReactCurrentDispatcher, findHostInstanceByFiber: function(a) {
  a = Zb(a);
  return null === a ? null : a.stateNode;
}, findFiberByHostInstance: tl.findFiberByHostInstance || jl, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1-next-f1338f8080-20240426" };
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
  var vl = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (!vl.isDisabled && vl.supportsFiber) try {
    kc = vl.inject(ul), lc = vl;
  } catch (a) {
  }
}
reactDom_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = sl;
reactDom_production_min.createPortal = function(a, b2) {
  var c2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
  if (!nl(b2)) throw Error(p$2(200));
  return cl(a, b2, null, c2);
};
reactDom_production_min.createRoot = function(a, b2) {
  if (!nl(a)) throw Error(p$2(299));
  var c2 = false, d2 = "", e2 = kl;
  null !== b2 && void 0 !== b2 && (true === b2.unstable_strictMode && (c2 = true), void 0 !== b2.identifierPrefix && (d2 = b2.identifierPrefix), void 0 !== b2.onRecoverableError && (e2 = b2.onRecoverableError));
  b2 = bl(a, 1, false, null, null, c2, false, d2, e2);
  a[uf] = b2.current;
  sf(8 === a.nodeType ? a.parentNode : a);
  return new ll(b2);
};
reactDom_production_min.findDOMNode = function(a) {
  if (null == a) return null;
  if (1 === a.nodeType) return a;
  var b2 = a._reactInternals;
  if (void 0 === b2) {
    if ("function" === typeof a.render) throw Error(p$2(188));
    a = Object.keys(a).join(",");
    throw Error(p$2(268, a));
  }
  a = Zb(b2);
  a = null === a ? null : a.stateNode;
  return a;
};
reactDom_production_min.flushSync = function(a) {
  return Rk(a);
};
reactDom_production_min.hydrate = function(a, b2, c2) {
  if (!ol(b2)) throw Error(p$2(200));
  return rl(null, a, b2, true, c2);
};
reactDom_production_min.hydrateRoot = function(a, b2, c2) {
  if (!nl(a)) throw Error(p$2(405));
  var d2 = null != c2 && c2.hydratedSources || null, e2 = false, f2 = "", g2 = kl;
  null !== c2 && void 0 !== c2 && (true === c2.unstable_strictMode && (e2 = true), void 0 !== c2.identifierPrefix && (f2 = c2.identifierPrefix), void 0 !== c2.onRecoverableError && (g2 = c2.onRecoverableError));
  b2 = el(b2, null, a, 1, null != c2 ? c2 : null, e2, false, f2, g2);
  a[uf] = b2.current;
  sf(a);
  if (d2) for (a = 0; a < d2.length; a++) c2 = d2[a], e2 = c2._getVersion, e2 = e2(c2._source), null == b2.mutableSourceEagerHydrationData ? b2.mutableSourceEagerHydrationData = [c2, e2] : b2.mutableSourceEagerHydrationData.push(
    c2,
    e2
  );
  return new ml(b2);
};
reactDom_production_min.render = function(a, b2, c2) {
  if (!ol(b2)) throw Error(p$2(200));
  return rl(null, a, b2, false, c2);
};
reactDom_production_min.unmountComponentAtNode = function(a) {
  if (!ol(a)) throw Error(p$2(40));
  return a._reactRootContainer ? (Rk(function() {
    rl(null, null, a, false, function() {
      a._reactRootContainer = null;
      a[uf] = null;
    });
  }), true) : false;
};
reactDom_production_min.unstable_batchedUpdates = Qk;
reactDom_production_min.unstable_renderSubtreeIntoContainer = function(a, b2, c2, d2) {
  if (!ol(c2)) throw Error(p$2(200));
  if (null == a || void 0 === a._reactInternals) throw Error(p$2(38));
  return rl(a, b2, c2, false, d2);
};
reactDom_production_min.version = "18.3.1-next-f1338f8080-20240426";
function checkDCE() {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
    return;
  }
  try {
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    console.error(err);
  }
}
{
  checkDCE();
  reactDom.exports = reactDom_production_min;
}
var reactDomExports = reactDom.exports;
var createRoot;
var m$3 = reactDomExports;
{
  createRoot = m$3.createRoot;
  m$3.hydrateRoot;
}
function _objectWithoutPropertiesLoose(r2, e2) {
  if (null == r2) return {};
  var t2 = {};
  for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
    if (e2.includes(n2)) continue;
    t2[n2] = r2[n2];
  }
  return t2;
}
function _objectWithoutProperties(e2, t2) {
  if (null == e2) return {};
  var o, r2, i = _objectWithoutPropertiesLoose(e2, t2);
  if (Object.getOwnPropertySymbols) {
    var s = Object.getOwnPropertySymbols(e2);
    for (r2 = 0; r2 < s.length; r2++) o = s[r2], t2.includes(o) || {}.propertyIsEnumerable.call(e2, o) && (i[o] = e2[o]);
  }
  return i;
}
var propTypes$a = { exports: {} };
var ReactPropTypesSecret$1 = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
var ReactPropTypesSecret = ReactPropTypesSecret_1;
function emptyFunction() {
}
function emptyFunctionWithReset() {
}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
var factoryWithThrowingShims = function() {
  function shim(props, propName, componentName, location, propFullName, secret) {
    if (secret === ReactPropTypesSecret) {
      return;
    }
    var err = new Error(
      "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
    );
    err.name = "Invariant Violation";
    throw err;
  }
  shim.isRequired = shim;
  function getShim() {
    return shim;
  }
  var ReactPropTypes = {
    array: shim,
    bool: shim,
    func: shim,
    number: shim,
    object: shim,
    string: shim,
    symbol: shim,
    any: shim,
    arrayOf: getShim,
    element: shim,
    elementType: shim,
    instanceOf: getShim,
    node: shim,
    objectOf: getShim,
    oneOf: getShim,
    oneOfType: getShim,
    shape: getShim,
    exact: getShim,
    checkPropTypes: emptyFunctionWithReset,
    resetWarningCache: emptyFunction
  };
  ReactPropTypes.PropTypes = ReactPropTypes;
  return ReactPropTypes;
};
{
  propTypes$a.exports = factoryWithThrowingShims();
}
var propTypesExports = propTypes$a.exports;
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
var reactIs$2 = { exports: {} };
var reactIs_production_min$1 = {};
/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var b$2 = Symbol.for("react.element"), c$1 = Symbol.for("react.portal"), d$1 = Symbol.for("react.fragment"), e$1 = Symbol.for("react.strict_mode"), f$1 = Symbol.for("react.profiler"), g$2 = Symbol.for("react.provider"), h$1 = Symbol.for("react.context"), k$2 = Symbol.for("react.server_context"), l$1 = Symbol.for("react.forward_ref"), m$2 = Symbol.for("react.suspense"), n$1 = Symbol.for("react.suspense_list"), p$1 = Symbol.for("react.memo"), q$2 = Symbol.for("react.lazy"), t$1 = Symbol.for("react.offscreen"), u;
u = Symbol.for("react.module.reference");
function v$2(a) {
  if ("object" === typeof a && null !== a) {
    var r2 = a.$$typeof;
    switch (r2) {
      case b$2:
        switch (a = a.type, a) {
          case d$1:
          case f$1:
          case e$1:
          case m$2:
          case n$1:
            return a;
          default:
            switch (a = a && a.$$typeof, a) {
              case k$2:
              case h$1:
              case l$1:
              case q$2:
              case p$1:
              case g$2:
                return a;
              default:
                return r2;
            }
        }
      case c$1:
        return r2;
    }
  }
}
reactIs_production_min$1.ContextConsumer = h$1;
reactIs_production_min$1.ContextProvider = g$2;
reactIs_production_min$1.Element = b$2;
reactIs_production_min$1.ForwardRef = l$1;
reactIs_production_min$1.Fragment = d$1;
reactIs_production_min$1.Lazy = q$2;
reactIs_production_min$1.Memo = p$1;
reactIs_production_min$1.Portal = c$1;
reactIs_production_min$1.Profiler = f$1;
reactIs_production_min$1.StrictMode = e$1;
reactIs_production_min$1.Suspense = m$2;
reactIs_production_min$1.SuspenseList = n$1;
reactIs_production_min$1.isAsyncMode = function() {
  return false;
};
reactIs_production_min$1.isConcurrentMode = function() {
  return false;
};
reactIs_production_min$1.isContextConsumer = function(a) {
  return v$2(a) === h$1;
};
reactIs_production_min$1.isContextProvider = function(a) {
  return v$2(a) === g$2;
};
reactIs_production_min$1.isElement = function(a) {
  return "object" === typeof a && null !== a && a.$$typeof === b$2;
};
reactIs_production_min$1.isForwardRef = function(a) {
  return v$2(a) === l$1;
};
reactIs_production_min$1.isFragment = function(a) {
  return v$2(a) === d$1;
};
reactIs_production_min$1.isLazy = function(a) {
  return v$2(a) === q$2;
};
reactIs_production_min$1.isMemo = function(a) {
  return v$2(a) === p$1;
};
reactIs_production_min$1.isPortal = function(a) {
  return v$2(a) === c$1;
};
reactIs_production_min$1.isProfiler = function(a) {
  return v$2(a) === f$1;
};
reactIs_production_min$1.isStrictMode = function(a) {
  return v$2(a) === e$1;
};
reactIs_production_min$1.isSuspense = function(a) {
  return v$2(a) === m$2;
};
reactIs_production_min$1.isSuspenseList = function(a) {
  return v$2(a) === n$1;
};
reactIs_production_min$1.isValidElementType = function(a) {
  return "string" === typeof a || "function" === typeof a || a === d$1 || a === f$1 || a === e$1 || a === m$2 || a === n$1 || a === t$1 || "object" === typeof a && null !== a && (a.$$typeof === q$2 || a.$$typeof === p$1 || a.$$typeof === g$2 || a.$$typeof === h$1 || a.$$typeof === l$1 || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
};
reactIs_production_min$1.typeOf = v$2;
{
  reactIs$2.exports = reactIs_production_min$1;
}
var reactIsExports$1 = reactIs$2.exports;
function stylis_min(W2) {
  function M2(d2, c2, e2, h2, a) {
    for (var m2 = 0, b2 = 0, v2 = 0, n2 = 0, q2, g2, x2 = 0, K2 = 0, k2, u2 = k2 = q2 = 0, l2 = 0, r2 = 0, I2 = 0, t2 = 0, B3 = e2.length, J2 = B3 - 1, y2, f2 = "", p2 = "", F3 = "", G3 = "", C2; l2 < B3; ) {
      g2 = e2.charCodeAt(l2);
      l2 === J2 && 0 !== b2 + n2 + v2 + m2 && (0 !== b2 && (g2 = 47 === b2 ? 10 : 47), n2 = v2 = m2 = 0, B3++, J2++);
      if (0 === b2 + n2 + v2 + m2) {
        if (l2 === J2 && (0 < r2 && (f2 = f2.replace(N2, "")), 0 < f2.trim().length)) {
          switch (g2) {
            case 32:
            case 9:
            case 59:
            case 13:
            case 10:
              break;
            default:
              f2 += e2.charAt(l2);
          }
          g2 = 59;
        }
        switch (g2) {
          case 123:
            f2 = f2.trim();
            q2 = f2.charCodeAt(0);
            k2 = 1;
            for (t2 = ++l2; l2 < B3; ) {
              switch (g2 = e2.charCodeAt(l2)) {
                case 123:
                  k2++;
                  break;
                case 125:
                  k2--;
                  break;
                case 47:
                  switch (g2 = e2.charCodeAt(l2 + 1)) {
                    case 42:
                    case 47:
                      a: {
                        for (u2 = l2 + 1; u2 < J2; ++u2) {
                          switch (e2.charCodeAt(u2)) {
                            case 47:
                              if (42 === g2 && 42 === e2.charCodeAt(u2 - 1) && l2 + 2 !== u2) {
                                l2 = u2 + 1;
                                break a;
                              }
                              break;
                            case 10:
                              if (47 === g2) {
                                l2 = u2 + 1;
                                break a;
                              }
                          }
                        }
                        l2 = u2;
                      }
                  }
                  break;
                case 91:
                  g2++;
                case 40:
                  g2++;
                case 34:
                case 39:
                  for (; l2++ < J2 && e2.charCodeAt(l2) !== g2; ) {
                  }
              }
              if (0 === k2) break;
              l2++;
            }
            k2 = e2.substring(t2, l2);
            0 === q2 && (q2 = (f2 = f2.replace(ca2, "").trim()).charCodeAt(0));
            switch (q2) {
              case 64:
                0 < r2 && (f2 = f2.replace(N2, ""));
                g2 = f2.charCodeAt(1);
                switch (g2) {
                  case 100:
                  case 109:
                  case 115:
                  case 45:
                    r2 = c2;
                    break;
                  default:
                    r2 = O2;
                }
                k2 = M2(c2, r2, k2, g2, a + 1);
                t2 = k2.length;
                0 < A2 && (r2 = X2(O2, f2, I2), C2 = H2(3, k2, r2, c2, D2, z2, t2, g2, a, h2), f2 = r2.join(""), void 0 !== C2 && 0 === (t2 = (k2 = C2.trim()).length) && (g2 = 0, k2 = ""));
                if (0 < t2) switch (g2) {
                  case 115:
                    f2 = f2.replace(da2, ea2);
                  case 100:
                  case 109:
                  case 45:
                    k2 = f2 + "{" + k2 + "}";
                    break;
                  case 107:
                    f2 = f2.replace(fa2, "$1 $2");
                    k2 = f2 + "{" + k2 + "}";
                    k2 = 1 === w2 || 2 === w2 && L2("@" + k2, 3) ? "@-webkit-" + k2 + "@" + k2 : "@" + k2;
                    break;
                  default:
                    k2 = f2 + k2, 112 === h2 && (k2 = (p2 += k2, ""));
                }
                else k2 = "";
                break;
              default:
                k2 = M2(c2, X2(c2, f2, I2), k2, h2, a + 1);
            }
            F3 += k2;
            k2 = I2 = r2 = u2 = q2 = 0;
            f2 = "";
            g2 = e2.charCodeAt(++l2);
            break;
          case 125:
          case 59:
            f2 = (0 < r2 ? f2.replace(N2, "") : f2).trim();
            if (1 < (t2 = f2.length)) switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 = H2(1, f2, c2, d2, D2, z2, p2.length, h2, a, h2)) && 0 === (t2 = (f2 = C2.trim()).length) && (f2 = "\0\0"), q2 = f2.charCodeAt(0), g2 = f2.charCodeAt(1), q2) {
              case 0:
                break;
              case 64:
                if (105 === g2 || 99 === g2) {
                  G3 += f2 + e2.charAt(l2);
                  break;
                }
              default:
                58 !== f2.charCodeAt(t2 - 1) && (p2 += P2(f2, q2, g2, f2.charCodeAt(2)));
            }
            I2 = r2 = u2 = q2 = 0;
            f2 = "";
            g2 = e2.charCodeAt(++l2);
        }
      }
      switch (g2) {
        case 13:
        case 10:
          47 === b2 ? b2 = 0 : 0 === 1 + q2 && 107 !== h2 && 0 < f2.length && (r2 = 1, f2 += "\0");
          0 < A2 * Y2 && H2(0, f2, c2, d2, D2, z2, p2.length, h2, a, h2);
          z2 = 1;
          D2++;
          break;
        case 59:
        case 125:
          if (0 === b2 + n2 + v2 + m2) {
            z2++;
            break;
          }
        default:
          z2++;
          y2 = e2.charAt(l2);
          switch (g2) {
            case 9:
            case 32:
              if (0 === n2 + m2 + b2) switch (x2) {
                case 44:
                case 58:
                case 9:
                case 32:
                  y2 = "";
                  break;
                default:
                  32 !== g2 && (y2 = " ");
              }
              break;
            case 0:
              y2 = "\\0";
              break;
            case 12:
              y2 = "\\f";
              break;
            case 11:
              y2 = "\\v";
              break;
            case 38:
              0 === n2 + b2 + m2 && (r2 = I2 = 1, y2 = "\f" + y2);
              break;
            case 108:
              if (0 === n2 + b2 + m2 + E2 && 0 < u2) switch (l2 - u2) {
                case 2:
                  112 === x2 && 58 === e2.charCodeAt(l2 - 3) && (E2 = x2);
                case 8:
                  111 === K2 && (E2 = K2);
              }
              break;
            case 58:
              0 === n2 + b2 + m2 && (u2 = l2);
              break;
            case 44:
              0 === b2 + v2 + n2 + m2 && (r2 = 1, y2 += "\r");
              break;
            case 34:
            case 39:
              0 === b2 && (n2 = n2 === g2 ? 0 : 0 === n2 ? g2 : n2);
              break;
            case 91:
              0 === n2 + b2 + v2 && m2++;
              break;
            case 93:
              0 === n2 + b2 + v2 && m2--;
              break;
            case 41:
              0 === n2 + b2 + m2 && v2--;
              break;
            case 40:
              if (0 === n2 + b2 + m2) {
                if (0 === q2) switch (2 * x2 + 3 * K2) {
                  case 533:
                    break;
                  default:
                    q2 = 1;
                }
                v2++;
              }
              break;
            case 64:
              0 === b2 + v2 + n2 + m2 + u2 + k2 && (k2 = 1);
              break;
            case 42:
            case 47:
              if (!(0 < n2 + m2 + v2)) switch (b2) {
                case 0:
                  switch (2 * g2 + 3 * e2.charCodeAt(l2 + 1)) {
                    case 235:
                      b2 = 47;
                      break;
                    case 220:
                      t2 = l2, b2 = 42;
                  }
                  break;
                case 42:
                  47 === g2 && 42 === x2 && t2 + 2 !== l2 && (33 === e2.charCodeAt(t2 + 2) && (p2 += e2.substring(t2, l2 + 1)), y2 = "", b2 = 0);
              }
          }
          0 === b2 && (f2 += y2);
      }
      K2 = x2;
      x2 = g2;
      l2++;
    }
    t2 = p2.length;
    if (0 < t2) {
      r2 = c2;
      if (0 < A2 && (C2 = H2(2, p2, r2, d2, D2, z2, t2, h2, a, h2), void 0 !== C2 && 0 === (p2 = C2).length)) return G3 + p2 + F3;
      p2 = r2.join(",") + "{" + p2 + "}";
      if (0 !== w2 * E2) {
        2 !== w2 || L2(p2, 2) || (E2 = 0);
        switch (E2) {
          case 111:
            p2 = p2.replace(ha2, ":-moz-$1") + p2;
            break;
          case 112:
            p2 = p2.replace(Q2, "::-webkit-input-$1") + p2.replace(Q2, "::-moz-$1") + p2.replace(Q2, ":-ms-input-$1") + p2;
        }
        E2 = 0;
      }
    }
    return G3 + p2 + F3;
  }
  function X2(d2, c2, e2) {
    var h2 = c2.trim().split(ia2);
    c2 = h2;
    var a = h2.length, m2 = d2.length;
    switch (m2) {
      case 0:
      case 1:
        var b2 = 0;
        for (d2 = 0 === m2 ? "" : d2[0] + " "; b2 < a; ++b2) {
          c2[b2] = Z2(d2, c2[b2], e2).trim();
        }
        break;
      default:
        var v2 = b2 = 0;
        for (c2 = []; b2 < a; ++b2) {
          for (var n2 = 0; n2 < m2; ++n2) {
            c2[v2++] = Z2(d2[n2] + " ", h2[b2], e2).trim();
          }
        }
    }
    return c2;
  }
  function Z2(d2, c2, e2) {
    var h2 = c2.charCodeAt(0);
    33 > h2 && (h2 = (c2 = c2.trim()).charCodeAt(0));
    switch (h2) {
      case 38:
        return c2.replace(F2, "$1" + d2.trim());
      case 58:
        return d2.trim() + c2.replace(F2, "$1" + d2.trim());
      default:
        if (0 < 1 * e2 && 0 < c2.indexOf("\f")) return c2.replace(F2, (58 === d2.charCodeAt(0) ? "" : "$1") + d2.trim());
    }
    return d2 + c2;
  }
  function P2(d2, c2, e2, h2) {
    var a = d2 + ";", m2 = 2 * c2 + 3 * e2 + 4 * h2;
    if (944 === m2) {
      d2 = a.indexOf(":", 9) + 1;
      var b2 = a.substring(d2, a.length - 1).trim();
      b2 = a.substring(0, d2).trim() + b2 + ";";
      return 1 === w2 || 2 === w2 && L2(b2, 1) ? "-webkit-" + b2 + b2 : b2;
    }
    if (0 === w2 || 2 === w2 && !L2(a, 1)) return a;
    switch (m2) {
      case 1015:
        return 97 === a.charCodeAt(10) ? "-webkit-" + a + a : a;
      case 951:
        return 116 === a.charCodeAt(3) ? "-webkit-" + a + a : a;
      case 963:
        return 110 === a.charCodeAt(5) ? "-webkit-" + a + a : a;
      case 1009:
        if (100 !== a.charCodeAt(4)) break;
      case 969:
      case 942:
        return "-webkit-" + a + a;
      case 978:
        return "-webkit-" + a + "-moz-" + a + a;
      case 1019:
      case 983:
        return "-webkit-" + a + "-moz-" + a + "-ms-" + a + a;
      case 883:
        if (45 === a.charCodeAt(8)) return "-webkit-" + a + a;
        if (0 < a.indexOf("image-set(", 11)) return a.replace(ja2, "$1-webkit-$2") + a;
        break;
      case 932:
        if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
          case 103:
            return "-webkit-box-" + a.replace("-grow", "") + "-webkit-" + a + "-ms-" + a.replace("grow", "positive") + a;
          case 115:
            return "-webkit-" + a + "-ms-" + a.replace("shrink", "negative") + a;
          case 98:
            return "-webkit-" + a + "-ms-" + a.replace("basis", "preferred-size") + a;
        }
        return "-webkit-" + a + "-ms-" + a + a;
      case 964:
        return "-webkit-" + a + "-ms-flex-" + a + a;
      case 1023:
        if (99 !== a.charCodeAt(8)) break;
        b2 = a.substring(a.indexOf(":", 15)).replace("flex-", "").replace("space-between", "justify");
        return "-webkit-box-pack" + b2 + "-webkit-" + a + "-ms-flex-pack" + b2 + a;
      case 1005:
        return ka2.test(a) ? a.replace(aa2, ":-webkit-") + a.replace(aa2, ":-moz-") + a : a;
      case 1e3:
        b2 = a.substring(13).trim();
        c2 = b2.indexOf("-") + 1;
        switch (b2.charCodeAt(0) + b2.charCodeAt(c2)) {
          case 226:
            b2 = a.replace(G2, "tb");
            break;
          case 232:
            b2 = a.replace(G2, "tb-rl");
            break;
          case 220:
            b2 = a.replace(G2, "lr");
            break;
          default:
            return a;
        }
        return "-webkit-" + a + "-ms-" + b2 + a;
      case 1017:
        if (-1 === a.indexOf("sticky", 9)) break;
      case 975:
        c2 = (a = d2).length - 10;
        b2 = (33 === a.charCodeAt(c2) ? a.substring(0, c2) : a).substring(d2.indexOf(":", 7) + 1).trim();
        switch (m2 = b2.charCodeAt(0) + (b2.charCodeAt(7) | 0)) {
          case 203:
            if (111 > b2.charCodeAt(8)) break;
          case 115:
            a = a.replace(b2, "-webkit-" + b2) + ";" + a;
            break;
          case 207:
          case 102:
            a = a.replace(b2, "-webkit-" + (102 < m2 ? "inline-" : "") + "box") + ";" + a.replace(b2, "-webkit-" + b2) + ";" + a.replace(b2, "-ms-" + b2 + "box") + ";" + a;
        }
        return a + ";";
      case 938:
        if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
          case 105:
            return b2 = a.replace("-items", ""), "-webkit-" + a + "-webkit-box-" + b2 + "-ms-flex-" + b2 + a;
          case 115:
            return "-webkit-" + a + "-ms-flex-item-" + a.replace(ba, "") + a;
          default:
            return "-webkit-" + a + "-ms-flex-line-pack" + a.replace("align-content", "").replace(ba, "") + a;
        }
        break;
      case 973:
      case 989:
        if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
      case 931:
      case 953:
        if (true === la2.test(d2)) return 115 === (b2 = d2.substring(d2.indexOf(":") + 1)).charCodeAt(0) ? P2(d2.replace("stretch", "fill-available"), c2, e2, h2).replace(":fill-available", ":stretch") : a.replace(b2, "-webkit-" + b2) + a.replace(b2, "-moz-" + b2.replace("fill-", "")) + a;
        break;
      case 962:
        if (a = "-webkit-" + a + (102 === a.charCodeAt(5) ? "-ms-" + a : "") + a, 211 === e2 + h2 && 105 === a.charCodeAt(13) && 0 < a.indexOf("transform", 10)) return a.substring(0, a.indexOf(";", 27) + 1).replace(ma2, "$1-webkit-$2") + a;
    }
    return a;
  }
  function L2(d2, c2) {
    var e2 = d2.indexOf(1 === c2 ? ":" : "{"), h2 = d2.substring(0, 3 !== c2 ? e2 : 10);
    e2 = d2.substring(e2 + 1, d2.length - 1);
    return R2(2 !== c2 ? h2 : h2.replace(na, "$1"), e2, c2);
  }
  function ea2(d2, c2) {
    var e2 = P2(c2, c2.charCodeAt(0), c2.charCodeAt(1), c2.charCodeAt(2));
    return e2 !== c2 + ";" ? e2.replace(oa2, " or ($1)").substring(4) : "(" + c2 + ")";
  }
  function H2(d2, c2, e2, h2, a, m2, b2, v2, n2, q2) {
    for (var g2 = 0, x2 = c2, w3; g2 < A2; ++g2) {
      switch (w3 = S2[g2].call(B2, d2, x2, e2, h2, a, m2, b2, v2, n2, q2)) {
        case void 0:
        case false:
        case true:
        case null:
          break;
        default:
          x2 = w3;
      }
    }
    if (x2 !== c2) return x2;
  }
  function T2(d2) {
    switch (d2) {
      case void 0:
      case null:
        A2 = S2.length = 0;
        break;
      default:
        if ("function" === typeof d2) S2[A2++] = d2;
        else if ("object" === typeof d2) for (var c2 = 0, e2 = d2.length; c2 < e2; ++c2) {
          T2(d2[c2]);
        }
        else Y2 = !!d2 | 0;
    }
    return T2;
  }
  function U2(d2) {
    d2 = d2.prefix;
    void 0 !== d2 && (R2 = null, d2 ? "function" !== typeof d2 ? w2 = 1 : (w2 = 2, R2 = d2) : w2 = 0);
    return U2;
  }
  function B2(d2, c2) {
    var e2 = d2;
    33 > e2.charCodeAt(0) && (e2 = e2.trim());
    V2 = e2;
    e2 = [V2];
    if (0 < A2) {
      var h2 = H2(-1, c2, e2, e2, D2, z2, 0, 0, 0, 0);
      void 0 !== h2 && "string" === typeof h2 && (c2 = h2);
    }
    var a = M2(O2, e2, c2, 0, 0);
    0 < A2 && (h2 = H2(-2, a, e2, e2, D2, z2, a.length, 0, 0, 0), void 0 !== h2 && (a = h2));
    V2 = "";
    E2 = 0;
    z2 = D2 = 1;
    return a;
  }
  var ca2 = /^\0+/g, N2 = /[\0\r\f]/g, aa2 = /: */g, ka2 = /zoo|gra/, ma2 = /([,: ])(transform)/g, ia2 = /,\r+?/g, F2 = /([\t\r\n ])*\f?&/g, fa2 = /@(k\w+)\s*(\S*)\s*/, Q2 = /::(place)/g, ha2 = /:(read-only)/g, G2 = /[svh]\w+-[tblr]{2}/, da2 = /\(\s*(.*)\s*\)/g, oa2 = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la2 = /stretch|:\s*\w+\-(?:conte|avail)/, ja2 = /([^-])(image-set\()/, z2 = 1, D2 = 1, E2 = 0, w2 = 1, O2 = [], S2 = [], A2 = 0, R2 = null, Y2 = 0, V2 = "";
  B2.use = T2;
  B2.set = U2;
  void 0 !== W2 && U2(W2);
  return B2;
}
var unitlessKeys = {
  animationIterationCount: 1,
  borderImageOutset: 1,
  borderImageSlice: 1,
  borderImageWidth: 1,
  boxFlex: 1,
  boxFlexGroup: 1,
  boxOrdinalGroup: 1,
  columnCount: 1,
  columns: 1,
  flex: 1,
  flexGrow: 1,
  flexPositive: 1,
  flexShrink: 1,
  flexNegative: 1,
  flexOrder: 1,
  gridRow: 1,
  gridRowEnd: 1,
  gridRowSpan: 1,
  gridRowStart: 1,
  gridColumn: 1,
  gridColumnEnd: 1,
  gridColumnSpan: 1,
  gridColumnStart: 1,
  msGridRow: 1,
  msGridRowSpan: 1,
  msGridColumn: 1,
  msGridColumnSpan: 1,
  fontWeight: 1,
  lineHeight: 1,
  opacity: 1,
  order: 1,
  orphans: 1,
  tabSize: 1,
  widows: 1,
  zIndex: 1,
  zoom: 1,
  WebkitLineClamp: 1,
  // SVG-related properties
  fillOpacity: 1,
  floodOpacity: 1,
  stopOpacity: 1,
  strokeDasharray: 1,
  strokeDashoffset: 1,
  strokeMiterlimit: 1,
  strokeOpacity: 1,
  strokeWidth: 1
};
function memoize(fn2) {
  var cache = /* @__PURE__ */ Object.create(null);
  return function(arg) {
    if (cache[arg] === void 0) cache[arg] = fn2(arg);
    return cache[arg];
  };
}
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
var isPropValid = /* @__PURE__ */ memoize(
  function(prop) {
    return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
  }
  /* Z+1 */
);
var reactIs$1 = { exports: {} };
var reactIs_production_min = {};
/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var b$1 = "function" === typeof Symbol && Symbol.for, c = b$1 ? Symbol.for("react.element") : 60103, d = b$1 ? Symbol.for("react.portal") : 60106, e = b$1 ? Symbol.for("react.fragment") : 60107, f = b$1 ? Symbol.for("react.strict_mode") : 60108, g$1 = b$1 ? Symbol.for("react.profiler") : 60114, h = b$1 ? Symbol.for("react.provider") : 60109, k$1 = b$1 ? Symbol.for("react.context") : 60110, l = b$1 ? Symbol.for("react.async_mode") : 60111, m$1 = b$1 ? Symbol.for("react.concurrent_mode") : 60111, n = b$1 ? Symbol.for("react.forward_ref") : 60112, p = b$1 ? Symbol.for("react.suspense") : 60113, q$1 = b$1 ? Symbol.for("react.suspense_list") : 60120, r = b$1 ? Symbol.for("react.memo") : 60115, t = b$1 ? Symbol.for("react.lazy") : 60116, v$1 = b$1 ? Symbol.for("react.block") : 60121, w$1 = b$1 ? Symbol.for("react.fundamental") : 60117, x$1 = b$1 ? Symbol.for("react.responder") : 60118, y$1 = b$1 ? Symbol.for("react.scope") : 60119;
function z$1(a) {
  if ("object" === typeof a && null !== a) {
    var u2 = a.$$typeof;
    switch (u2) {
      case c:
        switch (a = a.type, a) {
          case l:
          case m$1:
          case e:
          case g$1:
          case f:
          case p:
            return a;
          default:
            switch (a = a && a.$$typeof, a) {
              case k$1:
              case n:
              case t:
              case r:
              case h:
                return a;
              default:
                return u2;
            }
        }
      case d:
        return u2;
    }
  }
}
function A(a) {
  return z$1(a) === m$1;
}
reactIs_production_min.AsyncMode = l;
reactIs_production_min.ConcurrentMode = m$1;
reactIs_production_min.ContextConsumer = k$1;
reactIs_production_min.ContextProvider = h;
reactIs_production_min.Element = c;
reactIs_production_min.ForwardRef = n;
reactIs_production_min.Fragment = e;
reactIs_production_min.Lazy = t;
reactIs_production_min.Memo = r;
reactIs_production_min.Portal = d;
reactIs_production_min.Profiler = g$1;
reactIs_production_min.StrictMode = f;
reactIs_production_min.Suspense = p;
reactIs_production_min.isAsyncMode = function(a) {
  return A(a) || z$1(a) === l;
};
reactIs_production_min.isConcurrentMode = A;
reactIs_production_min.isContextConsumer = function(a) {
  return z$1(a) === k$1;
};
reactIs_production_min.isContextProvider = function(a) {
  return z$1(a) === h;
};
reactIs_production_min.isElement = function(a) {
  return "object" === typeof a && null !== a && a.$$typeof === c;
};
reactIs_production_min.isForwardRef = function(a) {
  return z$1(a) === n;
};
reactIs_production_min.isFragment = function(a) {
  return z$1(a) === e;
};
reactIs_production_min.isLazy = function(a) {
  return z$1(a) === t;
};
reactIs_production_min.isMemo = function(a) {
  return z$1(a) === r;
};
reactIs_production_min.isPortal = function(a) {
  return z$1(a) === d;
};
reactIs_production_min.isProfiler = function(a) {
  return z$1(a) === g$1;
};
reactIs_production_min.isStrictMode = function(a) {
  return z$1(a) === f;
};
reactIs_production_min.isSuspense = function(a) {
  return z$1(a) === p;
};
reactIs_production_min.isValidElementType = function(a) {
  return "string" === typeof a || "function" === typeof a || a === e || a === m$1 || a === g$1 || a === f || a === p || a === q$1 || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k$1 || a.$$typeof === n || a.$$typeof === w$1 || a.$$typeof === x$1 || a.$$typeof === y$1 || a.$$typeof === v$1);
};
reactIs_production_min.typeOf = z$1;
{
  reactIs$1.exports = reactIs_production_min;
}
var reactIsExports = reactIs$1.exports;
var reactIs = reactIsExports;
var REACT_STATICS = {
  childContextTypes: true,
  contextType: true,
  contextTypes: true,
  defaultProps: true,
  displayName: true,
  getDefaultProps: true,
  getDerivedStateFromError: true,
  getDerivedStateFromProps: true,
  mixins: true,
  propTypes: true,
  type: true
};
var KNOWN_STATICS = {
  name: true,
  length: true,
  prototype: true,
  caller: true,
  callee: true,
  arguments: true,
  arity: true
};
var FORWARD_REF_STATICS = {
  "$$typeof": true,
  render: true,
  defaultProps: true,
  displayName: true,
  propTypes: true
};
var MEMO_STATICS = {
  "$$typeof": true,
  compare: true,
  defaultProps: true,
  displayName: true,
  propTypes: true,
  type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
  if (reactIs.isMemo(component)) {
    return MEMO_STATICS;
  }
  return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
  if (typeof sourceComponent !== "string") {
    if (objectPrototype) {
      var inheritedComponent = getPrototypeOf(sourceComponent);
      if (inheritedComponent && inheritedComponent !== objectPrototype) {
        hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
      }
    }
    var keys = getOwnPropertyNames(sourceComponent);
    if (getOwnPropertySymbols) {
      keys = keys.concat(getOwnPropertySymbols(sourceComponent));
    }
    var targetStatics = getStatics(targetComponent);
    var sourceStatics = getStatics(sourceComponent);
    for (var i = 0; i < keys.length; ++i) {
      var key = keys[i];
      if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
        var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
        try {
          defineProperty(targetComponent, key, descriptor);
        } catch (e2) {
        }
      }
    }
  }
  return targetComponent;
}
var hoistNonReactStatics_cjs = hoistNonReactStatics;
const m = /* @__PURE__ */ getDefaultExportFromCjs(hoistNonReactStatics_cjs);
var define_process_env_default = {};
function y() {
  return (y = Object.assign || function(e2) {
    for (var t2 = 1; t2 < arguments.length; t2++) {
      var n2 = arguments[t2];
      for (var r2 in n2) Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]);
    }
    return e2;
  }).apply(this, arguments);
}
var v = function(e2, t2) {
  for (var n2 = [e2[0]], r2 = 0, o2 = t2.length; r2 < o2; r2 += 1) n2.push(t2[r2], e2[r2 + 1]);
  return n2;
}, g = function(t2) {
  return null !== t2 && "object" == typeof t2 && "[object Object]" === (t2.toString ? t2.toString() : Object.prototype.toString.call(t2)) && !reactIsExports$1.typeOf(t2);
}, S = Object.freeze([]), w = Object.freeze({});
function E(e2) {
  return "function" == typeof e2;
}
function b(e2) {
  return e2.displayName || e2.name || "Component";
}
function _(e2) {
  return e2 && "string" == typeof e2.styledComponentId;
}
var N = "undefined" != typeof process$1 && void 0 !== define_process_env_default && (define_process_env_default.REACT_APP_SC_ATTR || define_process_env_default.SC_ATTR) || "data-styled", C = "undefined" != typeof window && "HTMLElement" in window, I = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process$1 && void 0 !== define_process_env_default && (void 0 !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && "" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY && define_process_env_default.REACT_APP_SC_DISABLE_SPEEDY : void 0 !== define_process_env_default.SC_DISABLE_SPEEDY && "" !== define_process_env_default.SC_DISABLE_SPEEDY ? "false" !== define_process_env_default.SC_DISABLE_SPEEDY && define_process_env_default.SC_DISABLE_SPEEDY : false)), P = {};
function D(e2) {
  for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) n2[r2 - 1] = arguments[r2];
  throw new Error("An error occurred. See https://git.io/JUIaE#" + e2 + " for more information." + (n2.length > 0 ? " Args: " + n2.join(", ") : ""));
}
var j = function() {
  function e2(e3) {
    this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e3;
  }
  var t2 = e2.prototype;
  return t2.indexOfGroup = function(e3) {
    for (var t3 = 0, n2 = 0; n2 < e3; n2++) t3 += this.groupSizes[n2];
    return t3;
  }, t2.insertRules = function(e3, t3) {
    if (e3 >= this.groupSizes.length) {
      for (var n2 = this.groupSizes, r2 = n2.length, o2 = r2; e3 >= o2; ) (o2 <<= 1) < 0 && D(16, "" + e3);
      this.groupSizes = new Uint32Array(o2), this.groupSizes.set(n2), this.length = o2;
      for (var s2 = r2; s2 < o2; s2++) this.groupSizes[s2] = 0;
    }
    for (var i2 = this.indexOfGroup(e3 + 1), a2 = 0, c2 = t3.length; a2 < c2; a2++) this.tag.insertRule(i2, t3[a2]) && (this.groupSizes[e3]++, i2++);
  }, t2.clearGroup = function(e3) {
    if (e3 < this.length) {
      var t3 = this.groupSizes[e3], n2 = this.indexOfGroup(e3), r2 = n2 + t3;
      this.groupSizes[e3] = 0;
      for (var o2 = n2; o2 < r2; o2++) this.tag.deleteRule(n2);
    }
  }, t2.getGroup = function(e3) {
    var t3 = "";
    if (e3 >= this.length || 0 === this.groupSizes[e3]) return t3;
    for (var n2 = this.groupSizes[e3], r2 = this.indexOfGroup(e3), o2 = r2 + n2, s2 = r2; s2 < o2; s2++) t3 += this.tag.getRule(s2) + "/*!sc*/\n";
    return t3;
  }, e2;
}(), T = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), k = 1, V = function(e2) {
  if (T.has(e2)) return T.get(e2);
  for (; x.has(k); ) k++;
  var t2 = k++;
  return T.set(e2, t2), x.set(t2, e2), t2;
}, B = function(e2) {
  return x.get(e2);
}, z = function(e2, t2) {
  t2 >= k && (k = t2 + 1), T.set(e2, t2), x.set(t2, e2);
}, M = "style[" + N + '][data-styled-version="5.3.11"]', G = new RegExp("^" + N + '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'), L = function(e2, t2, n2) {
  for (var r2, o2 = n2.split(","), s2 = 0, i2 = o2.length; s2 < i2; s2++) (r2 = o2[s2]) && e2.registerName(t2, r2);
}, F = function(e2, t2) {
  for (var n2 = (t2.textContent || "").split("/*!sc*/\n"), r2 = [], o2 = 0, s2 = n2.length; o2 < s2; o2++) {
    var i2 = n2[o2].trim();
    if (i2) {
      var a2 = i2.match(G);
      if (a2) {
        var c2 = 0 | parseInt(a2[1], 10), u2 = a2[2];
        0 !== c2 && (z(u2, c2), L(e2, u2, a2[3]), e2.getTag().insertRules(c2, r2)), r2.length = 0;
      } else r2.push(i2);
    }
  }
}, Y = function() {
  return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null;
}, q = function(e2) {
  var t2 = document.head, n2 = e2 || t2, r2 = document.createElement("style"), o2 = function(e3) {
    for (var t3 = e3.childNodes, n3 = t3.length; n3 >= 0; n3--) {
      var r3 = t3[n3];
      if (r3 && 1 === r3.nodeType && r3.hasAttribute(N)) return r3;
    }
  }(n2), s2 = void 0 !== o2 ? o2.nextSibling : null;
  r2.setAttribute(N, "active"), r2.setAttribute("data-styled-version", "5.3.11");
  var i2 = Y();
  return i2 && r2.setAttribute("nonce", i2), n2.insertBefore(r2, s2), r2;
}, H = function() {
  function e2(e3) {
    var t3 = this.element = q(e3);
    t3.appendChild(document.createTextNode("")), this.sheet = function(e4) {
      if (e4.sheet) return e4.sheet;
      for (var t4 = document.styleSheets, n2 = 0, r2 = t4.length; n2 < r2; n2++) {
        var o2 = t4[n2];
        if (o2.ownerNode === e4) return o2;
      }
      D(17);
    }(t3), this.length = 0;
  }
  var t2 = e2.prototype;
  return t2.insertRule = function(e3, t3) {
    try {
      return this.sheet.insertRule(t3, e3), this.length++, true;
    } catch (e4) {
      return false;
    }
  }, t2.deleteRule = function(e3) {
    this.sheet.deleteRule(e3), this.length--;
  }, t2.getRule = function(e3) {
    var t3 = this.sheet.cssRules[e3];
    return void 0 !== t3 && "string" == typeof t3.cssText ? t3.cssText : "";
  }, e2;
}(), $ = function() {
  function e2(e3) {
    var t3 = this.element = q(e3);
    this.nodes = t3.childNodes, this.length = 0;
  }
  var t2 = e2.prototype;
  return t2.insertRule = function(e3, t3) {
    if (e3 <= this.length && e3 >= 0) {
      var n2 = document.createTextNode(t3), r2 = this.nodes[e3];
      return this.element.insertBefore(n2, r2 || null), this.length++, true;
    }
    return false;
  }, t2.deleteRule = function(e3) {
    this.element.removeChild(this.nodes[e3]), this.length--;
  }, t2.getRule = function(e3) {
    return e3 < this.length ? this.nodes[e3].textContent : "";
  }, e2;
}(), W = function() {
  function e2(e3) {
    this.rules = [], this.length = 0;
  }
  var t2 = e2.prototype;
  return t2.insertRule = function(e3, t3) {
    return e3 <= this.length && (this.rules.splice(e3, 0, t3), this.length++, true);
  }, t2.deleteRule = function(e3) {
    this.rules.splice(e3, 1), this.length--;
  }, t2.getRule = function(e3) {
    return e3 < this.length ? this.rules[e3] : "";
  }, e2;
}(), U = C, J = { isServer: !C, useCSSOMInjection: !I }, X = function() {
  function e2(e3, t3, n2) {
    void 0 === e3 && (e3 = w), void 0 === t3 && (t3 = {}), this.options = y({}, J, {}, e3), this.gs = t3, this.names = new Map(n2), this.server = !!e3.isServer, !this.server && C && U && (U = false, function(e4) {
      for (var t4 = document.querySelectorAll(M), n3 = 0, r2 = t4.length; n3 < r2; n3++) {
        var o2 = t4[n3];
        o2 && "active" !== o2.getAttribute(N) && (F(e4, o2), o2.parentNode && o2.parentNode.removeChild(o2));
      }
    }(this));
  }
  e2.registerId = function(e3) {
    return V(e3);
  };
  var t2 = e2.prototype;
  return t2.reconstructWithOptions = function(t3, n2) {
    return void 0 === n2 && (n2 = true), new e2(y({}, this.options, {}, t3), this.gs, n2 && this.names || void 0);
  }, t2.allocateGSInstance = function(e3) {
    return this.gs[e3] = (this.gs[e3] || 0) + 1;
  }, t2.getTag = function() {
    return this.tag || (this.tag = (n2 = (t3 = this.options).isServer, r2 = t3.useCSSOMInjection, o2 = t3.target, e3 = n2 ? new W(o2) : r2 ? new H(o2) : new $(o2), new j(e3)));
    var e3, t3, n2, r2, o2;
  }, t2.hasNameForId = function(e3, t3) {
    return this.names.has(e3) && this.names.get(e3).has(t3);
  }, t2.registerName = function(e3, t3) {
    if (V(e3), this.names.has(e3)) this.names.get(e3).add(t3);
    else {
      var n2 = /* @__PURE__ */ new Set();
      n2.add(t3), this.names.set(e3, n2);
    }
  }, t2.insertRules = function(e3, t3, n2) {
    this.registerName(e3, t3), this.getTag().insertRules(V(e3), n2);
  }, t2.clearNames = function(e3) {
    this.names.has(e3) && this.names.get(e3).clear();
  }, t2.clearRules = function(e3) {
    this.getTag().clearGroup(V(e3)), this.clearNames(e3);
  }, t2.clearTag = function() {
    this.tag = void 0;
  }, t2.toString = function() {
    return function(e3) {
      for (var t3 = e3.getTag(), n2 = t3.length, r2 = "", o2 = 0; o2 < n2; o2++) {
        var s2 = B(o2);
        if (void 0 !== s2) {
          var i2 = e3.names.get(s2), a2 = t3.getGroup(o2);
          if (i2 && a2 && i2.size) {
            var c2 = N + ".g" + o2 + '[id="' + s2 + '"]', u2 = "";
            void 0 !== i2 && i2.forEach(function(e4) {
              e4.length > 0 && (u2 += e4 + ",");
            }), r2 += "" + a2 + c2 + '{content:"' + u2 + '"}/*!sc*/\n';
          }
        }
      }
      return r2;
    }(this);
  }, e2;
}(), Z = /(a)(d)/gi, K = function(e2) {
  return String.fromCharCode(e2 + (e2 > 25 ? 39 : 97));
};
function Q(e2) {
  var t2, n2 = "";
  for (t2 = Math.abs(e2); t2 > 52; t2 = t2 / 52 | 0) n2 = K(t2 % 52) + n2;
  return (K(t2 % 52) + n2).replace(Z, "$1-$2");
}
var ee = function(e2, t2) {
  for (var n2 = t2.length; n2; ) e2 = 33 * e2 ^ t2.charCodeAt(--n2);
  return e2;
}, te = function(e2) {
  return ee(5381, e2);
};
function ne(e2) {
  for (var t2 = 0; t2 < e2.length; t2 += 1) {
    var n2 = e2[t2];
    if (E(n2) && !_(n2)) return false;
  }
  return true;
}
var re = te("5.3.11"), oe = function() {
  function e2(e3, t2, n2) {
    this.rules = e3, this.staticRulesId = "", this.isStatic = (void 0 === n2 || n2.isStatic) && ne(e3), this.componentId = t2, this.baseHash = ee(re, t2), this.baseStyle = n2, X.registerId(t2);
  }
  return e2.prototype.generateAndInjectStyles = function(e3, t2, n2) {
    var r2 = this.componentId, o2 = [];
    if (this.baseStyle && o2.push(this.baseStyle.generateAndInjectStyles(e3, t2, n2)), this.isStatic && !n2.hash) if (this.staticRulesId && t2.hasNameForId(r2, this.staticRulesId)) o2.push(this.staticRulesId);
    else {
      var s2 = _e(this.rules, e3, t2, n2).join(""), i2 = Q(ee(this.baseHash, s2) >>> 0);
      if (!t2.hasNameForId(r2, i2)) {
        var a2 = n2(s2, "." + i2, void 0, r2);
        t2.insertRules(r2, i2, a2);
      }
      o2.push(i2), this.staticRulesId = i2;
    }
    else {
      for (var c2 = this.rules.length, u2 = ee(this.baseHash, n2.hash), l2 = "", d2 = 0; d2 < c2; d2++) {
        var h2 = this.rules[d2];
        if ("string" == typeof h2) l2 += h2;
        else if (h2) {
          var p2 = _e(h2, e3, t2, n2), f2 = Array.isArray(p2) ? p2.join("") : p2;
          u2 = ee(u2, f2 + d2), l2 += f2;
        }
      }
      if (l2) {
        var m2 = Q(u2 >>> 0);
        if (!t2.hasNameForId(r2, m2)) {
          var y2 = n2(l2, "." + m2, void 0, r2);
          t2.insertRules(r2, m2, y2);
        }
        o2.push(m2);
      }
    }
    return o2.join(" ");
  }, e2;
}(), se = /^\s*\/\/.*$/gm, ie = [":", "[", ".", "#"];
function ae(e2) {
  var t2, n2, r2, o2, s2 = w, i2 = s2.options, a2 = void 0 === i2 ? w : i2, c2 = s2.plugins, u2 = void 0 === c2 ? S : c2, l2 = new stylis_min(a2), d2 = [], p2 = /* @__PURE__ */ function(e3) {
    function t3(t4) {
      if (t4) try {
        e3(t4 + "}");
      } catch (e4) {
      }
    }
    return function(n3, r3, o3, s3, i3, a3, c3, u3, l3, d3) {
      switch (n3) {
        case 1:
          if (0 === l3 && 64 === r3.charCodeAt(0)) return e3(r3 + ";"), "";
          break;
        case 2:
          if (0 === u3) return r3 + "/*|*/";
          break;
        case 3:
          switch (u3) {
            case 102:
            case 112:
              return e3(o3[0] + r3), "";
            default:
              return r3 + (0 === d3 ? "/*|*/" : "");
          }
        case -2:
          r3.split("/*|*/}").forEach(t3);
      }
    };
  }(function(e3) {
    d2.push(e3);
  }), f2 = function(e3, r3, s3) {
    return 0 === r3 && -1 !== ie.indexOf(s3[n2.length]) || s3.match(o2) ? e3 : "." + t2;
  };
  function m2(e3, s3, i3, a3) {
    void 0 === a3 && (a3 = "&");
    var c3 = e3.replace(se, ""), u3 = s3 && i3 ? i3 + " " + s3 + " { " + c3 + " }" : c3;
    return t2 = a3, n2 = s3, r2 = new RegExp("\\" + n2 + "\\b", "g"), o2 = new RegExp("(\\" + n2 + "\\b){2,}"), l2(i3 || !s3 ? "" : s3, u3);
  }
  return l2.use([].concat(u2, [function(e3, t3, o3) {
    2 === e3 && o3.length && o3[0].lastIndexOf(n2) > 0 && (o3[0] = o3[0].replace(r2, f2));
  }, p2, function(e3) {
    if (-2 === e3) {
      var t3 = d2;
      return d2 = [], t3;
    }
  }])), m2.hash = u2.length ? u2.reduce(function(e3, t3) {
    return t3.name || D(15), ee(e3, t3.name);
  }, 5381).toString() : "", m2;
}
var ce = React.createContext();
ce.Consumer;
var le = React.createContext(), de = (le.Consumer, new X()), he = ae();
function pe() {
  return reactExports.useContext(ce) || de;
}
function fe() {
  return reactExports.useContext(le) || he;
}
var ye = function() {
  function e2(e3, t2) {
    var n2 = this;
    this.inject = function(e4, t3) {
      void 0 === t3 && (t3 = he);
      var r2 = n2.name + t3.hash;
      e4.hasNameForId(n2.id, r2) || e4.insertRules(n2.id, r2, t3(n2.rules, r2, "@keyframes"));
    }, this.toString = function() {
      return D(12, String(n2.name));
    }, this.name = e3, this.id = "sc-keyframes-" + e3, this.rules = t2;
  }
  return e2.prototype.getName = function(e3) {
    return void 0 === e3 && (e3 = he), this.name + e3.hash;
  }, e2;
}(), ve = /([A-Z])/, ge = /([A-Z])/g, Se = /^ms-/, we = function(e2) {
  return "-" + e2.toLowerCase();
};
function Ee(e2) {
  return ve.test(e2) ? e2.replace(ge, we).replace(Se, "-ms-") : e2;
}
var be = function(e2) {
  return null == e2 || false === e2 || "" === e2;
};
function _e(e2, n2, r2, o2) {
  if (Array.isArray(e2)) {
    for (var s2, i2 = [], a2 = 0, c2 = e2.length; a2 < c2; a2 += 1) "" !== (s2 = _e(e2[a2], n2, r2, o2)) && (Array.isArray(s2) ? i2.push.apply(i2, s2) : i2.push(s2));
    return i2;
  }
  if (be(e2)) return "";
  if (_(e2)) return "." + e2.styledComponentId;
  if (E(e2)) {
    if ("function" != typeof (l2 = e2) || l2.prototype && l2.prototype.isReactComponent || !n2) return e2;
    var u2 = e2(n2);
    return _e(u2, n2, r2, o2);
  }
  var l2;
  return e2 instanceof ye ? r2 ? (e2.inject(r2, o2), e2.getName(o2)) : e2 : g(e2) ? function e3(t2, n3) {
    var r3, o3, s3 = [];
    for (var i3 in t2) t2.hasOwnProperty(i3) && !be(t2[i3]) && (Array.isArray(t2[i3]) && t2[i3].isCss || E(t2[i3]) ? s3.push(Ee(i3) + ":", t2[i3], ";") : g(t2[i3]) ? s3.push.apply(s3, e3(t2[i3], i3)) : s3.push(Ee(i3) + ": " + (r3 = i3, null == (o3 = t2[i3]) || "boolean" == typeof o3 || "" === o3 ? "" : "number" != typeof o3 || 0 === o3 || r3 in unitlessKeys || r3.startsWith("--") ? String(o3).trim() : o3 + "px") + ";"));
    return n3 ? [n3 + " {"].concat(s3, ["}"]) : s3;
  }(e2) : e2.toString();
}
var Ne = function(e2) {
  return Array.isArray(e2) && (e2.isCss = true), e2;
};
function Ae(e2) {
  for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) n2[r2 - 1] = arguments[r2];
  return E(e2) || g(e2) ? Ne(_e(v(S, [e2].concat(n2)))) : 0 === n2.length && 1 === e2.length && "string" == typeof e2[0] ? e2 : Ne(_e(v(e2, n2)));
}
var Oe = function(e2, t2, n2) {
  return void 0 === n2 && (n2 = w), e2.theme !== n2.theme && e2.theme || t2 || n2.theme;
}, Re = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, De = /(^-|-$)/g;
function je(e2) {
  return e2.replace(Re, "-").replace(De, "");
}
var Te = function(e2) {
  return Q(te(e2) >>> 0);
};
function xe(e2) {
  return "string" == typeof e2 && true;
}
var ke = function(e2) {
  return "function" == typeof e2 || "object" == typeof e2 && null !== e2 && !Array.isArray(e2);
}, Ve = function(e2) {
  return "__proto__" !== e2 && "constructor" !== e2 && "prototype" !== e2;
};
function Be(e2, t2, n2) {
  var r2 = e2[n2];
  ke(t2) && ke(r2) ? ze(r2, t2) : e2[n2] = t2;
}
function ze(e2) {
  for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) n2[r2 - 1] = arguments[r2];
  for (var o2 = 0, s2 = n2; o2 < s2.length; o2++) {
    var i2 = s2[o2];
    if (ke(i2)) for (var a2 in i2) Ve(a2) && Be(e2, i2[a2], a2);
  }
  return e2;
}
var Me = React.createContext();
Me.Consumer;
function Le(e2) {
  var t2 = reactExports.useContext(Me), n2 = reactExports.useMemo(function() {
    return function(e3, t3) {
      if (!e3) return D(14);
      if (E(e3)) {
        var n3 = e3(t3);
        return n3;
      }
      return Array.isArray(e3) || "object" != typeof e3 ? D(8) : t3 ? y({}, t3, {}, e3) : e3;
    }(e2.theme, t2);
  }, [e2.theme, t2]);
  return e2.children ? React.createElement(Me.Provider, { value: n2 }, e2.children) : null;
}
var Fe = {};
function Ye(e2, t2, n2) {
  var o2 = _(e2), i2 = !xe(e2), a2 = t2.attrs, c2 = void 0 === a2 ? S : a2, l2 = t2.componentId, d2 = void 0 === l2 ? function(e3, t3) {
    var n3 = "string" != typeof e3 ? "sc" : je(e3);
    Fe[n3] = (Fe[n3] || 0) + 1;
    var r2 = n3 + "-" + Te("5.3.11" + n3 + Fe[n3]);
    return t3 ? t3 + "-" + r2 : r2;
  }(t2.displayName, t2.parentComponentId) : l2, h2 = t2.displayName, p2 = void 0 === h2 ? function(e3) {
    return xe(e3) ? "styled." + e3 : "Styled(" + b(e3) + ")";
  }(e2) : h2, v2 = t2.displayName && t2.componentId ? je(t2.displayName) + "-" + t2.componentId : t2.componentId || d2, g2 = o2 && e2.attrs ? Array.prototype.concat(e2.attrs, c2).filter(Boolean) : c2, N2 = t2.shouldForwardProp;
  o2 && e2.shouldForwardProp && (N2 = t2.shouldForwardProp ? function(n3, r2, o3) {
    return e2.shouldForwardProp(n3, r2, o3) && t2.shouldForwardProp(n3, r2, o3);
  } : e2.shouldForwardProp);
  var A2, C2 = new oe(n2, v2, o2 ? e2.componentStyle : void 0), I2 = C2.isStatic && 0 === c2.length, P2 = function(e3, t3) {
    return function(e4, t4, n3, r2) {
      var o3 = e4.attrs, i3 = e4.componentStyle, a3 = e4.defaultProps, c3 = e4.foldedComponentIds, l3 = e4.shouldForwardProp, d3 = e4.styledComponentId, h3 = e4.target, p3 = function(e5, t5, n4) {
        void 0 === e5 && (e5 = w);
        var r3 = y({}, t5, { theme: e5 }), o4 = {};
        return n4.forEach(function(e6) {
          var t6, n5, s2, i4 = e6;
          for (t6 in E(i4) && (i4 = i4(r3)), i4) r3[t6] = o4[t6] = "className" === t6 ? (n5 = o4[t6], s2 = i4[t6], n5 && s2 ? n5 + " " + s2 : n5 || s2) : i4[t6];
        }), [r3, o4];
      }(Oe(t4, reactExports.useContext(Me), a3) || w, t4, o3), m2 = p3[0], v3 = p3[1], g3 = function(e5, t5, n4, r3) {
        var o4 = pe(), s2 = fe(), i4 = t5 ? e5.generateAndInjectStyles(w, o4, s2) : e5.generateAndInjectStyles(n4, o4, s2);
        return i4;
      }(i3, r2, m2), S2 = n3, b2 = v3.$as || t4.$as || v3.as || t4.as || h3, _2 = xe(b2), N3 = v3 !== t4 ? y({}, t4, {}, v3) : t4, A3 = {};
      for (var C3 in N3) "$" !== C3[0] && "as" !== C3 && ("forwardedAs" === C3 ? A3.as = N3[C3] : (l3 ? l3(C3, isPropValid, b2) : !_2 || isPropValid(C3)) && (A3[C3] = N3[C3]));
      return t4.style && v3.style !== t4.style && (A3.style = y({}, t4.style, {}, v3.style)), A3.className = Array.prototype.concat(c3, d3, g3 !== d3 ? g3 : null, t4.className, v3.className).filter(Boolean).join(" "), A3.ref = S2, reactExports.createElement(b2, A3);
    }(A2, e3, t3, I2);
  };
  return P2.displayName = p2, (A2 = React.forwardRef(P2)).attrs = g2, A2.componentStyle = C2, A2.displayName = p2, A2.shouldForwardProp = N2, A2.foldedComponentIds = o2 ? Array.prototype.concat(e2.foldedComponentIds, e2.styledComponentId) : S, A2.styledComponentId = v2, A2.target = o2 ? e2.target : e2, A2.withComponent = function(e3) {
    var r2 = t2.componentId, o3 = function(e4, t3) {
      if (null == e4) return {};
      var n3, r3, o4 = {}, s3 = Object.keys(e4);
      for (r3 = 0; r3 < s3.length; r3++) n3 = s3[r3], t3.indexOf(n3) >= 0 || (o4[n3] = e4[n3]);
      return o4;
    }(t2, ["componentId"]), s2 = r2 && r2 + "-" + (xe(e3) ? e3 : je(b(e3)));
    return Ye(e3, y({}, o3, { attrs: g2, componentId: s2 }), n2);
  }, Object.defineProperty(A2, "defaultProps", { get: function() {
    return this._foldedDefaultProps;
  }, set: function(t3) {
    this._foldedDefaultProps = o2 ? ze({}, e2.defaultProps, t3) : t3;
  } }), Object.defineProperty(A2, "toString", { value: function() {
    return "." + A2.styledComponentId;
  } }), i2 && m(A2, e2, { attrs: true, componentStyle: true, displayName: true, foldedComponentIds: true, shouldForwardProp: true, styledComponentId: true, target: true, withComponent: true }), A2;
}
var qe = function(e2) {
  return function e3(t2, r2, o2) {
    if (void 0 === o2 && (o2 = w), !reactIsExports$1.isValidElementType(r2)) return D(1, String(r2));
    var s2 = function() {
      return t2(r2, o2, Ae.apply(void 0, arguments));
    };
    return s2.withConfig = function(n2) {
      return e3(t2, r2, y({}, o2, {}, n2));
    }, s2.attrs = function(n2) {
      return e3(t2, r2, y({}, o2, { attrs: Array.prototype.concat(o2.attrs, n2).filter(Boolean) }));
    }, s2;
  }(Ye, e2);
};
["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "textPath", "tspan"].forEach(function(e2) {
  qe[e2] = qe(e2);
});
var He = function() {
  function e2(e3, t3) {
    this.rules = e3, this.componentId = t3, this.isStatic = ne(e3), X.registerId(this.componentId + 1);
  }
  var t2 = e2.prototype;
  return t2.createStyles = function(e3, t3, n2, r2) {
    var o2 = r2(_e(this.rules, t3, n2, r2).join(""), ""), s2 = this.componentId + e3;
    n2.insertRules(s2, s2, o2);
  }, t2.removeStyles = function(e3, t3) {
    t3.clearRules(this.componentId + e3);
  }, t2.renderStyles = function(e3, t3, n2, r2) {
    e3 > 2 && X.registerId(this.componentId + e3), this.removeStyles(e3, n2), this.createStyles(e3, t3, n2, r2);
  }, e2;
}();
function $e(e2) {
  for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), o2 = 1; o2 < t2; o2++) n2[o2 - 1] = arguments[o2];
  var i2 = Ae.apply(void 0, [e2].concat(n2)), a2 = "sc-global-" + Te(JSON.stringify(i2)), u2 = new He(i2, a2);
  function d2(e3) {
    var t3 = pe(), n3 = fe(), o3 = reactExports.useContext(Me), d3 = reactExports.useRef(t3.allocateGSInstance(a2)).current;
    return t3.server && h2(d3, e3, t3, o3, n3), reactExports.useLayoutEffect(function() {
      if (!t3.server) return h2(d3, e3, t3, o3, n3), function() {
        return u2.removeStyles(d3, t3);
      };
    }, [d3, e3, t3, o3, n3]), null;
  }
  function h2(e3, t3, n3, r2, o3) {
    if (u2.isStatic) u2.renderStyles(e3, P, n3, o3);
    else {
      var s2 = y({}, t3, { theme: Oe(t3, r2, d2.defaultProps) });
      u2.renderStyles(e3, s2, n3, o3);
    }
  }
  return React.memo(d2);
}
function We(e2) {
  for (var t2 = arguments.length, n2 = new Array(t2 > 1 ? t2 - 1 : 0), r2 = 1; r2 < t2; r2++) n2[r2 - 1] = arguments[r2];
  var o2 = Ae.apply(void 0, [e2].concat(n2)).join(""), s2 = Te(o2);
  return new ye(s2, o2);
}
var Xe = function() {
  return reactExports.useContext(Me);
};
var lodash_merge = { exports: {} };
lodash_merge.exports;
(function(module, exports) {
  var LARGE_ARRAY_SIZE = 200;
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
  var HOT_COUNT = 800, HOT_SPAN = 16;
  var MAX_SAFE_INTEGER2 = 9007199254740991;
  var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
  var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  var reIsHostCtor = /^\[object .+?Constructor\]$/;
  var reIsUint = /^(?:0|[1-9]\d*)$/;
  var typedArrayTags = {};
  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  var root = freeGlobal || freeSelf || Function("return this")();
  var freeExports = exports && !exports.nodeType && exports;
  var freeModule = freeExports && true && module && !module.nodeType && module;
  var moduleExports = freeModule && freeModule.exports === freeExports;
  var freeProcess = moduleExports && freeGlobal.process;
  var nodeUtil = function() {
    try {
      var types = freeModule && freeModule.require && freeModule.require("util").types;
      if (types) {
        return types;
      }
      return freeProcess && freeProcess.binding && freeProcess.binding("util");
    } catch (e2) {
    }
  }();
  var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  function apply2(func, thisArg, args) {
    switch (args.length) {
      case 0:
        return func.call(thisArg);
      case 1:
        return func.call(thisArg, args[0]);
      case 2:
        return func.call(thisArg, args[0], args[1]);
      case 3:
        return func.call(thisArg, args[0], args[1], args[2]);
    }
    return func.apply(thisArg, args);
  }
  function baseTimes(n2, iteratee) {
    var index = -1, result = Array(n2);
    while (++index < n2) {
      result[index] = iteratee(index);
    }
    return result;
  }
  function baseUnary(func) {
    return function(value) {
      return func(value);
    };
  }
  function getValue(object, key) {
    return object == null ? void 0 : object[key];
  }
  function overArg(func, transform) {
    return function(arg) {
      return func(transform(arg));
    };
  }
  var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
  var coreJsData = root["__core-js_shared__"];
  var funcToString = funcProto.toString;
  var hasOwnProperty = objectProto.hasOwnProperty;
  var maskSrcKey = function() {
    var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
    return uid ? "Symbol(src)_1." + uid : "";
  }();
  var nativeObjectToString = objectProto.toString;
  var objectCtorString = funcToString.call(Object);
  var reIsNative = RegExp(
    "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  );
  var Buffer = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array = root.Uint8Array;
  Buffer ? Buffer.allocUnsafe : void 0;
  var getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
  var defineProperty2 = function() {
    try {
      var func = getNative(Object, "defineProperty");
      func({}, "", {});
      return func;
    } catch (e2) {
    }
  }();
  var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now;
  var Map2 = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
  var baseCreate = /* @__PURE__ */ function() {
    function object() {
    }
    return function(proto) {
      if (!isObject(proto)) {
        return {};
      }
      if (objectCreate) {
        return objectCreate(proto);
      }
      object.prototype = proto;
      var result = new object();
      object.prototype = void 0;
      return result;
    };
  }();
  function Hash(entries) {
    var index = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }
  function hashClear() {
    this.__data__ = nativeCreate ? nativeCreate(null) : {};
    this.size = 0;
  }
  function hashDelete(key) {
    var result = this.has(key) && delete this.__data__[key];
    this.size -= result ? 1 : 0;
    return result;
  }
  function hashGet(key) {
    var data = this.__data__;
    if (nativeCreate) {
      var result = data[key];
      return result === HASH_UNDEFINED ? void 0 : result;
    }
    return hasOwnProperty.call(data, key) ? data[key] : void 0;
  }
  function hashHas(key) {
    var data = this.__data__;
    return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
  }
  function hashSet(key, value) {
    var data = this.__data__;
    this.size += this.has(key) ? 0 : 1;
    data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
    return this;
  }
  Hash.prototype.clear = hashClear;
  Hash.prototype["delete"] = hashDelete;
  Hash.prototype.get = hashGet;
  Hash.prototype.has = hashHas;
  Hash.prototype.set = hashSet;
  function ListCache(entries) {
    var index = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }
  function listCacheClear() {
    this.__data__ = [];
    this.size = 0;
  }
  function listCacheDelete(key) {
    var data = this.__data__, index = assocIndexOf(data, key);
    if (index < 0) {
      return false;
    }
    var lastIndex = data.length - 1;
    if (index == lastIndex) {
      data.pop();
    } else {
      splice.call(data, index, 1);
    }
    --this.size;
    return true;
  }
  function listCacheGet(key) {
    var data = this.__data__, index = assocIndexOf(data, key);
    return index < 0 ? void 0 : data[index][1];
  }
  function listCacheHas(key) {
    return assocIndexOf(this.__data__, key) > -1;
  }
  function listCacheSet(key, value) {
    var data = this.__data__, index = assocIndexOf(data, key);
    if (index < 0) {
      ++this.size;
      data.push([key, value]);
    } else {
      data[index][1] = value;
    }
    return this;
  }
  ListCache.prototype.clear = listCacheClear;
  ListCache.prototype["delete"] = listCacheDelete;
  ListCache.prototype.get = listCacheGet;
  ListCache.prototype.has = listCacheHas;
  ListCache.prototype.set = listCacheSet;
  function MapCache(entries) {
    var index = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }
  function mapCacheClear() {
    this.size = 0;
    this.__data__ = {
      "hash": new Hash(),
      "map": new (Map2 || ListCache)(),
      "string": new Hash()
    };
  }
  function mapCacheDelete(key) {
    var result = getMapData(this, key)["delete"](key);
    this.size -= result ? 1 : 0;
    return result;
  }
  function mapCacheGet(key) {
    return getMapData(this, key).get(key);
  }
  function mapCacheHas(key) {
    return getMapData(this, key).has(key);
  }
  function mapCacheSet(key, value) {
    var data = getMapData(this, key), size = data.size;
    data.set(key, value);
    this.size += data.size == size ? 0 : 1;
    return this;
  }
  MapCache.prototype.clear = mapCacheClear;
  MapCache.prototype["delete"] = mapCacheDelete;
  MapCache.prototype.get = mapCacheGet;
  MapCache.prototype.has = mapCacheHas;
  MapCache.prototype.set = mapCacheSet;
  function Stack(entries) {
    var data = this.__data__ = new ListCache(entries);
    this.size = data.size;
  }
  function stackClear() {
    this.__data__ = new ListCache();
    this.size = 0;
  }
  function stackDelete(key) {
    var data = this.__data__, result = data["delete"](key);
    this.size = data.size;
    return result;
  }
  function stackGet(key) {
    return this.__data__.get(key);
  }
  function stackHas(key) {
    return this.__data__.has(key);
  }
  function stackSet(key, value) {
    var data = this.__data__;
    if (data instanceof ListCache) {
      var pairs = data.__data__;
      if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
        pairs.push([key, value]);
        this.size = ++data.size;
        return this;
      }
      data = this.__data__ = new MapCache(pairs);
    }
    data.set(key, value);
    this.size = data.size;
    return this;
  }
  Stack.prototype.clear = stackClear;
  Stack.prototype["delete"] = stackDelete;
  Stack.prototype.get = stackGet;
  Stack.prototype.has = stackHas;
  Stack.prototype.set = stackSet;
  function arrayLikeKeys(value, inherited) {
    var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
    for (var key in value) {
      if (!(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
      (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
      isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
      isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
      isIndex(key, length)))) {
        result.push(key);
      }
    }
    return result;
  }
  function assignMergeValue(object, key, value) {
    if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
      baseAssignValue(object, key, value);
    }
  }
  function assignValue(object, key, value) {
    var objValue = object[key];
    if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
      baseAssignValue(object, key, value);
    }
  }
  function assocIndexOf(array, key) {
    var length = array.length;
    while (length--) {
      if (eq(array[length][0], key)) {
        return length;
      }
    }
    return -1;
  }
  function baseAssignValue(object, key, value) {
    if (key == "__proto__" && defineProperty2) {
      defineProperty2(object, key, {
        "configurable": true,
        "enumerable": true,
        "value": value,
        "writable": true
      });
    } else {
      object[key] = value;
    }
  }
  var baseFor = createBaseFor();
  function baseGetTag(value) {
    if (value == null) {
      return value === void 0 ? undefinedTag : nullTag;
    }
    return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  }
  function baseIsArguments(value) {
    return isObjectLike(value) && baseGetTag(value) == argsTag;
  }
  function baseIsNative(value) {
    if (!isObject(value) || isMasked(value)) {
      return false;
    }
    var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
    return pattern.test(toSource(value));
  }
  function baseIsTypedArray(value) {
    return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  }
  function baseKeysIn(object) {
    if (!isObject(object)) {
      return nativeKeysIn(object);
    }
    var isProto = isPrototype(object), result = [];
    for (var key in object) {
      if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
        result.push(key);
      }
    }
    return result;
  }
  function baseMerge(object, source, srcIndex, customizer, stack) {
    if (object === source) {
      return;
    }
    baseFor(source, function(srcValue, key) {
      stack || (stack = new Stack());
      if (isObject(srcValue)) {
        baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
      } else {
        var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
        if (newValue === void 0) {
          newValue = srcValue;
        }
        assignMergeValue(object, key, newValue);
      }
    }, keysIn);
  }
  function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
    var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
    if (stacked) {
      assignMergeValue(object, key, stacked);
      return;
    }
    var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
    var isCommon = newValue === void 0;
    if (isCommon) {
      var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
      newValue = srcValue;
      if (isArr || isBuff || isTyped) {
        if (isArray(objValue)) {
          newValue = objValue;
        } else if (isArrayLikeObject(objValue)) {
          newValue = copyArray(objValue);
        } else if (isBuff) {
          isCommon = false;
          newValue = cloneBuffer(srcValue);
        } else if (isTyped) {
          isCommon = false;
          newValue = cloneTypedArray(srcValue);
        } else {
          newValue = [];
        }
      } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
        newValue = objValue;
        if (isArguments(objValue)) {
          newValue = toPlainObject(objValue);
        } else if (!isObject(objValue) || isFunction(objValue)) {
          newValue = initCloneObject(srcValue);
        }
      } else {
        isCommon = false;
      }
    }
    if (isCommon) {
      stack.set(srcValue, newValue);
      mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
      stack["delete"](srcValue);
    }
    assignMergeValue(object, key, newValue);
  }
  function baseRest(func, start2) {
    return setToString(overRest(func, start2, identity), func + "");
  }
  var baseSetToString = !defineProperty2 ? identity : function(func, string) {
    return defineProperty2(func, "toString", {
      "configurable": true,
      "enumerable": false,
      "value": constant(string),
      "writable": true
    });
  };
  function cloneBuffer(buffer, isDeep) {
    {
      return buffer.slice();
    }
  }
  function cloneArrayBuffer(arrayBuffer) {
    var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
    new Uint8Array(result).set(new Uint8Array(arrayBuffer));
    return result;
  }
  function cloneTypedArray(typedArray, isDeep) {
    var buffer = cloneArrayBuffer(typedArray.buffer);
    return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  }
  function copyArray(source, array) {
    var index = -1, length = source.length;
    array || (array = Array(length));
    while (++index < length) {
      array[index] = source[index];
    }
    return array;
  }
  function copyObject(source, props, object, customizer) {
    var isNew = !object;
    object || (object = {});
    var index = -1, length = props.length;
    while (++index < length) {
      var key = props[index];
      var newValue = void 0;
      if (newValue === void 0) {
        newValue = source[key];
      }
      if (isNew) {
        baseAssignValue(object, key, newValue);
      } else {
        assignValue(object, key, newValue);
      }
    }
    return object;
  }
  function createAssigner(assigner) {
    return baseRest(function(object, sources) {
      var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
      customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
      if (guard && isIterateeCall(sources[0], sources[1], guard)) {
        customizer = length < 3 ? void 0 : customizer;
        length = 1;
      }
      object = Object(object);
      while (++index < length) {
        var source = sources[index];
        if (source) {
          assigner(object, source, index, customizer);
        }
      }
      return object;
    });
  }
  function createBaseFor(fromRight) {
    return function(object, iteratee, keysFunc) {
      var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
      while (length--) {
        var key = props[++index];
        if (iteratee(iterable[key], key, iterable) === false) {
          break;
        }
      }
      return object;
    };
  }
  function getMapData(map, key) {
    var data = map.__data__;
    return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  }
  function getNative(object, key) {
    var value = getValue(object, key);
    return baseIsNative(value) ? value : void 0;
  }
  function getRawTag(value) {
    var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
    try {
      value[symToStringTag] = void 0;
      var unmasked = true;
    } catch (e2) {
    }
    var result = nativeObjectToString.call(value);
    if (unmasked) {
      if (isOwn) {
        value[symToStringTag] = tag;
      } else {
        delete value[symToStringTag];
      }
    }
    return result;
  }
  function initCloneObject(object) {
    return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  }
  function isIndex(value, length) {
    var type = typeof value;
    length = length == null ? MAX_SAFE_INTEGER2 : length;
    return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  }
  function isIterateeCall(value, index, object) {
    if (!isObject(object)) {
      return false;
    }
    var type = typeof index;
    if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
      return eq(object[index], value);
    }
    return false;
  }
  function isKeyable(value) {
    var type = typeof value;
    return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  }
  function isMasked(func) {
    return !!maskSrcKey && maskSrcKey in func;
  }
  function isPrototype(value) {
    var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
    return value === proto;
  }
  function nativeKeysIn(object) {
    var result = [];
    if (object != null) {
      for (var key in Object(object)) {
        result.push(key);
      }
    }
    return result;
  }
  function objectToString(value) {
    return nativeObjectToString.call(value);
  }
  function overRest(func, start2, transform) {
    start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
    return function() {
      var args = arguments, index = -1, length = nativeMax(args.length - start2, 0), array = Array(length);
      while (++index < length) {
        array[index] = args[start2 + index];
      }
      index = -1;
      var otherArgs = Array(start2 + 1);
      while (++index < start2) {
        otherArgs[index] = args[index];
      }
      otherArgs[start2] = transform(array);
      return apply2(func, this, otherArgs);
    };
  }
  function safeGet(object, key) {
    if (key === "constructor" && typeof object[key] === "function") {
      return;
    }
    if (key == "__proto__") {
      return;
    }
    return object[key];
  }
  var setToString = shortOut(baseSetToString);
  function shortOut(func) {
    var count = 0, lastCalled = 0;
    return function() {
      var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
      lastCalled = stamp;
      if (remaining > 0) {
        if (++count >= HOT_COUNT) {
          return arguments[0];
        }
      } else {
        count = 0;
      }
      return func.apply(void 0, arguments);
    };
  }
  function toSource(func) {
    if (func != null) {
      try {
        return funcToString.call(func);
      } catch (e2) {
      }
      try {
        return func + "";
      } catch (e2) {
      }
    }
    return "";
  }
  function eq(value, other) {
    return value === other || value !== value && other !== other;
  }
  var isArguments = baseIsArguments(/* @__PURE__ */ function() {
    return arguments;
  }()) ? baseIsArguments : function(value) {
    return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  };
  var isArray = Array.isArray;
  function isArrayLike(value) {
    return value != null && isLength(value.length) && !isFunction(value);
  }
  function isArrayLikeObject(value) {
    return isObjectLike(value) && isArrayLike(value);
  }
  var isBuffer = nativeIsBuffer || stubFalse;
  function isFunction(value) {
    if (!isObject(value)) {
      return false;
    }
    var tag = baseGetTag(value);
    return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  }
  function isLength(value) {
    return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
  }
  function isObject(value) {
    var type = typeof value;
    return value != null && (type == "object" || type == "function");
  }
  function isObjectLike(value) {
    return value != null && typeof value == "object";
  }
  function isPlainObject(value) {
    if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
      return false;
    }
    var proto = getPrototype(value);
    if (proto === null) {
      return true;
    }
    var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
    return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  }
  var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  function toPlainObject(value) {
    return copyObject(value, keysIn(value));
  }
  function keysIn(object) {
    return isArrayLike(object) ? arrayLikeKeys(object) : baseKeysIn(object);
  }
  var merge2 = createAssigner(function(object, source, srcIndex) {
    baseMerge(object, source, srcIndex);
  });
  function constant(value) {
    return function() {
      return value;
    };
  }
  function identity(value) {
    return value;
  }
  function stubFalse() {
    return false;
  }
  module.exports = merge2;
})(lodash_merge, lodash_merge.exports);
var lodash_mergeExports = lodash_merge.exports;
const merge = /* @__PURE__ */ getDefaultExportFromCjs(lodash_mergeExports);
var record = function record2(keys, valueType) {
  return keys.reduce(function(toObject, key) {
    return Object.assign(toObject, _defineProperty({}, key, valueType));
  }, {});
};
function _arrayLikeToArray$1(r2, a) {
  (null == a || a > r2.length) && (a = r2.length);
  for (var e2 = 0, n2 = Array(a); e2 < a; e2++) n2[e2] = r2[e2];
  return n2;
}
function _arrayWithoutHoles(r2) {
  if (Array.isArray(r2)) return _arrayLikeToArray$1(r2);
}
function _iterableToArray(r2) {
  if ("undefined" != typeof Symbol && null != r2[Symbol.iterator] || null != r2["@@iterator"]) return Array.from(r2);
}
function _unsupportedIterableToArray$1(r2, a) {
  if (r2) {
    if ("string" == typeof r2) return _arrayLikeToArray$1(r2, a);
    var t2 = {}.toString.call(r2).slice(8, -1);
    return "Object" === t2 && r2.constructor && (t2 = r2.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r2) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray$1(r2, a) : void 0;
  }
}
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(r2) {
  return _arrayWithoutHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray$1(r2) || _nonIterableSpread();
}
function generateClassNames(componentName, subClassNames) {
  var generateClassName = function generateClassName2(subClassName) {
    return "Sfx".concat(componentName).concat(subClassName ? "-".concat(subClassName) : "");
  };
  var classNameArray = [];
  if (subClassNames) {
    if (Array.isArray(subClassNames)) {
      classNameArray.push.apply(classNameArray, _toConsumableArray(subClassNames.filter(function(subClassName) {
        return typeof subClassName === "string";
      }).map(function(subClassName) {
        return generateClassName(subClassName);
      })));
    } else if (typeof subClassNames === "string") {
      classNameArray.push(generateClassName(subClassNames));
    }
  }
  if (classNameArray.length === 0) {
    classNameArray.push(generateClassName());
  }
  return classNameArray.join(" ");
}
function intrinsicComponent$1(render, displayName) {
  var component = /* @__PURE__ */ reactExports.forwardRef(render);
  component.displayName = render.name;
  return component;
}
function objectKeys(object) {
  return Object.keys(object);
}
function objectValues(object) {
  return Object.values(object);
}
function applyPolymorphicFunctionProp(prop) {
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }
  return typeof prop === "function" ? prop.apply(void 0, args) : prop;
}
function applyDisplayNames(styledObject) {
  return Object.keys(styledObject).reduce(function(newStyledObject, styledComponentName) {
    var styledComponent = styledObject[styledComponentName];
    styledComponent.displayName = "".concat(styledComponentName);
    return Object.assign(newStyledObject, _defineProperty({}, styledComponentName, styledComponent));
  }, {});
}
function setRef(ref, value) {
  if (typeof ref === "function") {
    ref(value);
  } else if (ref) {
    ref.current = value;
  }
}
function useForkRef(refA, refB) {
  return reactExports.useMemo(function() {
    if (refA == null && refB == null) {
      return null;
    }
    return function(refValue) {
      setRef(refA, refValue);
      setRef(refB, refValue);
    };
  }, [refA, refB]);
}
function restrictNumber$1(number) {
  var min2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  var max2 = arguments.length > 2 ? arguments[2] : void 0;
  var currentMax = max2 || 1e6;
  var convertedNumber = +number;
  return Math.min(Math.max(min2, convertedNumber), currentMax);
}
function mapNumber$1(number, oldMin, oldMax, newMin, newMax) {
  return (number - oldMin) * (newMax - newMin) / (oldMax - oldMin) + newMin;
}
var rgbStringToArray = function rgbStringToArray2(rgbColorString) {
  return rgbColorString.replaceAll(/[^\d,]/gi, "").split(",").map(function(n2) {
    return +n2;
  });
};
var hexToRgb = function hexToRgb2(hexColor) {
  if (!hexColor) return [0, 0, 0];
  return [Number.parseInt(hexColor.slice(1, 3), 16), Number.parseInt(hexColor.slice(3, 5), 16), Number.parseInt(hexColor.slice(5, 7), 16)];
};
var rgbChannelToHex = function rgbChannelToHex2(channel) {
  return channel.toString(16).padStart(2, "0");
};
var rgbToHex = function rgbToHex2() {
  for (var _len = arguments.length, rgbColor = new Array(_len), _key = 0; _key < _len; _key++) {
    rgbColor[_key] = arguments[_key];
  }
  return "#".concat(rgbColor.map(rgbChannelToHex).join(""));
};
var hslToHex = function hslToHex2(h2, s, l2) {
  var dividedL = l2 / 100;
  var a = s * Math.min(dividedL, 1 - dividedL) / 100;
  var f2 = function f3(n2) {
    var k2 = (n2 + h2 / 30) % 12;
    var color = dividedL - a * Math.max(Math.min(k2 - 3, 9 - k2, 1), -1);
    return rgbChannelToHex(Math.round(255 * color));
  };
  return "#".concat(f2(0)).concat(f2(8)).concat(f2(4));
};
var rgbToHsl = function rgbToHsl2() {
  for (var _len2 = arguments.length, rgbColor = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    rgbColor[_key2] = arguments[_key2];
  }
  var r2 = rgbColor[0], g2 = rgbColor[1], b2 = rgbColor[2];
  r2 /= 255;
  g2 /= 255;
  b2 /= 255;
  var min2 = Math.min(r2, g2, b2);
  var max2 = Math.max(r2, g2, b2);
  var h2;
  var s;
  var l2 = (max2 + min2) / 2;
  if (max2 === min2) {
    h2 = 0;
    s = 0;
  } else {
    var diff = max2 - min2;
    s = l2 > 0.5 ? diff / (2 - max2 - min2) : diff / (max2 + min2);
    switch (max2) {
      case r2:
        h2 = (g2 - b2) / diff + (g2 < b2 ? 6 : 0);
        break;
      case g2:
        h2 = (b2 - r2) / diff + 2;
        break;
      case b2:
        h2 = (r2 - g2) / diff + 4;
        break;
      default:
        h2 = 0;
    }
    h2 /= 6;
  }
  return [Math.round(h2 * 360), Math.round(s * 100), Math.round(l2 * 100)];
};
var colorToHsl = function colorToHsl2(color) {
  if (color.startsWith("#")) {
    var hex = color;
    if (color.length === 4) {
      hex = "#".concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]).concat(color[3]).concat(color[3]);
    }
    return rgbToHsl.apply(void 0, _toConsumableArray(hexToRgb(hex)));
  }
  if (color.startsWith("rgb")) {
    var colorInRgb = rgbStringToArray(color);
    return rgbToHsl.apply(void 0, _toConsumableArray(colorInRgb));
  }
  if (typeof color === "string") {
    return [0, 0, 0];
  }
  return color;
};
var colorToHex = function colorToHex2(color) {
  if (color.startsWith("#")) {
    if (color.length === 7) {
      return color;
    }
    return "#".concat(color[0]).concat(color[0]).concat(color[1]).concat(color[1]).concat(color[2]).concat(color[2]);
  }
  if (color.startsWith("rgb")) {
    return rgbToHex.apply(void 0, _toConsumableArray(rgbStringToArray(color)));
  }
  if (typeof color === "string") {
    return "#000000";
  }
  return color;
};
var checkIsBlack = function checkIsBlack2(s, l2) {
  return l2 === 0 && (s === 0 || s === 1);
};
var checkIsWhite = function checkIsWhite2(s, l2) {
  return s === 0 && l2 === 1;
};
var hsvToHsl = function hsvToHsl2(h2, s, v2) {
  var newS = s;
  var l2 = (2 - s) * v2 / 2;
  if (l2 !== 0) {
    if (l2 === 1) {
      newS = 0;
    } else if (l2 < 0.5) {
      newS = newS * v2 / (l2 * 2);
    } else {
      newS = newS * v2 / (2 - l2 * 2);
    }
  }
  var isBlack = checkIsBlack(newS, l2);
  return [isBlack || checkIsWhite(newS, l2) ? 0 : h2, isBlack ? 0 : Math.round(newS * 100), Math.round(l2 * 100)];
};
var hslToHsv = function hslToHsv2(h2, s, l2) {
  var newS = s;
  var newL = l2 * 2;
  newS *= newL <= 1 ? newL : 2 - newL;
  var v2 = (newL + newS) / 2;
  newS = 2 * newS / (newL + newS);
  var isBlack = checkIsBlack(newS, l2);
  return [isBlack || checkIsWhite(newS, l2) ? 0 : h2, isBlack ? 0 : Math.round(newS * 100), Math.round(v2 * 100)];
};
var validateHex = function validateHex2(color) {
  return /^#[\da-f]{6}$/i.test(color);
};
function getElemDocumentCoords$1(elem) {
  if (!elem) {
    return null;
  }
  var box = elem.getBoundingClientRect();
  var _document = document, body = _document.body;
  var docEl = document.documentElement;
  var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
  var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;
  var clientTop = docEl.clientTop || body.clientTop || 0;
  var clientLeft = docEl.clientLeft || body.clientLeft || 0;
  var top2 = box.top + scrollTop - clientTop;
  var left2 = box.left + scrollLeft - clientLeft;
  return {
    top: Math.round(top2),
    left: Math.round(left2),
    width: box.width,
    height: box.height
  };
}
function asc(a, b2) {
  return a - b2;
}
function valueToPercent(value, min2, max2) {
  return (value - min2) * 100 / (max2 - min2);
}
function percentToValue(percent, min2, max2) {
  return (max2 - min2) * percent + min2;
}
function getDecimalPrecision(num) {
  if (Math.abs(num) < 1) {
    var parts = num.toExponential().split("e-");
    var matissaDecimalPart = parts[0].split(".")[1];
    return (matissaDecimalPart ? matissaDecimalPart.length : 0) + Number.parseInt(parts[1], 10);
  }
  var decimalPart = num.toString().split(".")[1];
  return decimalPart ? decimalPart.length : 0;
}
function roundValueToStep(value, step, min2) {
  var nearest = Math.round((value - min2) / step) * step + min2;
  return Number(nearest.toFixed(getDecimalPrecision(step)));
}
function setValueIndex(_ref) {
  var values = _ref.values, newValue = _ref.newValue, index = _ref.index;
  var output = values.slice();
  output[index] = newValue;
  return output.sort(asc);
}
function findClosest(values, currentValue) {
  var _values$reduce = values.reduce(function(acc, value, index) {
    var distance = Math.abs(currentValue - value);
    if (acc === null || distance < acc.distance || distance === acc.distance) {
      return {
        distance,
        index
      };
    }
    return acc;
  }, null), closestIndex = _values$reduce.index;
  return closestIndex;
}
function ownerDocument(node) {
  return node && node.ownerDocument || document;
}
function clamp(value, min2, max2) {
  if (value == null) {
    return min2;
  }
  return Math.min(Math.max(min2, value), max2);
}
function trackFinger(event, touchId) {
  if (touchId.current !== void 0 && event.changedTouches) {
    for (var i = 0; i < event.changedTouches.length; i += 1) {
      var touch = event.changedTouches[i];
      if (touch.identifier === touchId.current) {
        return {
          x: touch.clientX,
          y: touch.clientY
        };
      }
    }
    return false;
  }
  return {
    x: event.clientX,
    y: event.clientY
  };
}
var axisProps = {
  horizontal: {
    offset: function offset(percent) {
      return {
        left: "".concat(percent, "%")
      };
    },
    leap: function leap(percent) {
      return {
        width: "".concat(percent, "%")
      };
    }
  },
  "horizontal-reverse": {
    offset: function offset2(percent) {
      return {
        right: "".concat(percent, "%")
      };
    },
    leap: function leap2(percent) {
      return {
        width: "".concat(percent, "%")
      };
    }
  },
  vertical: {
    offset: function offset3(percent) {
      return {
        bottom: "".concat(percent, "%")
      };
    },
    leap: function leap3(percent) {
      return {
        height: "".concat(percent, "%")
      };
    }
  }
};
function focusThumb(_ref2) {
  var sliderRef = _ref2.sliderRef, activeIndex = _ref2.activeIndex, setActive = _ref2.setActive;
  var doc = ownerDocument(sliderRef.current);
  if (!sliderRef.current.contains(doc.activeElement) || Number(doc.activeElement.getAttribute("data-index")) !== activeIndex) {
    var _sliderRef$current$qu;
    (_sliderRef$current$qu = sliderRef.current.querySelector('[type="range"][data-index="'.concat(activeIndex, '"]'))) === null || _sliderRef$current$qu === void 0 || _sliderRef$current$qu.focus();
  }
  if (setActive) {
    setActive(activeIndex);
  }
}
var Color = {
  TextPrimary: "txt-primary",
  TextSecondary: "txt-secondary",
  TextSecondaryInvert: "txt-secondary-invert",
  TextPlaceholder: "txt-placeholder",
  TextWarning: "txt-warning",
  TextError: "txt-error",
  TextInfo: "txt-info",
  AccentPrimary: "accent-primary",
  AccentPrimaryHover: "accent-primary-hover",
  AccentPrimaryActive: "accent-primary-active",
  AccentPrimaryDisabled: "accent-primary-disabled",
  AccentSecondaryDisabled: "accent-secondary-disabled",
  AccentStateless: "accent-stateless",
  AccentStateless_0_4_Opacity: "accent-stateless_0_4_opacity",
  Accent_0_5_Opacity: "accent_0_5_opacity",
  Accent_1_2_Opacity: "accent_1_2_opacity",
  Accent_1_8_Opacity: "accent_1_8_opacity",
  Accent_2_8_Opacity: "accent_2_8_opacity",
  Accent_4_0_Opacity: "accent_4_0_opacity",
  BackgroundGrey: "bg-grey",
  BackgroundStateless: "bg-stateless",
  BackgroundActive: "bg-active",
  BackgroundBaseLight: "bg-base-light",
  BackgroundBaseMedium: "bg-base-medium",
  BackgroundPrimary: "bg-primary",
  BackgroundPrimaryLight: "bg-primary-light",
  BackgroundPrimaryHover: "bg-primary-hover",
  BackgroundPrimaryActive: "bg-primary-active",
  BackgroundPrimaryStateless: "bg-primary-stateless",
  BackgroundPrimary_0_5_Opacity: "bg-primary-0-5-opacity",
  BackgroundSecondary: "bg-secondary",
  BackgroundHover: "bg-hover",
  BackgroundGreen: "bg-green",
  BackgroundGreenMedium: "bg-green-medium",
  BackgroundBlue: "bg-blue",
  BackgroundRed: "bg-red",
  BackgroundRedLight: "bg-red-light",
  BackgroundRedMedium: "background-red-medium",
  BackgroundOrange: "bg-orange",
  BackgroundTooltip: "bg-tooltip",
  IconsPrimary: "icon-primary",
  IconsPrimaryOpacity_0_6: "icons-primary-opacity-0-6",
  IconsSecondary: "icons-secondary",
  IconsPlaceholder: "icons-placeholder",
  IconsInvert: "icons-invert",
  IconsMuted: "icons-muted",
  IconsPrimaryHover: "icons-primary-hover",
  IconsSecondaryHover: "icons-secondary-hover",
  ButtonPrimaryText: "btn-primary-text",
  ButtonPrimaryText_0_6: "btn-primary-text-0-6",
  ButtonPrimaryText_0_4: "btn-primary-text-0-4",
  ButtonDisabledText: "btn-disabled-text",
  ButtonSecondaryText: "btn-secondary-text",
  LinkPrimary: "link-primary",
  LinkStateless: "link-stateless",
  LinkHover: "link-hover",
  LinkActive: "link-active",
  LinkMuted: "link-muted",
  LinkPressed: "link-pressed",
  BordersPrimary: "borders-primary",
  BordersPrimaryHover: "borders-primary-hover",
  BordersSecondary: "borders-secondary",
  BordersStrong: "borders-strong",
  BordersInvert: "borders-invert",
  BorderHoverBottom: "border-hover-bottom",
  BorderActiveBottom: "border-active-bottom",
  BorderPrimaryStateless: "border-primary-stateless",
  BordersDisabled: "borders-disabled",
  BordersButton: "borders-button",
  BordersItem: "borders-item",
  BordersBaseLight: "borders-base-light",
  BordersBaseMedium: "borders-base-medium",
  BordersGreen: "borders-green",
  BordersGreenMedium: "borders-green-medium",
  BordersRed: "borders-red",
  ActiveSecondary: "active-secondary",
  ActiveSecondaryHover: "active-secondary-hover",
  Tag: "tag",
  StatesErrorDisabledText: "states-error-disabled-text",
  Error: "error",
  Error_0_28_Opacity: "error-0-28-opacity",
  Error_0_12_Opacity: "error-0-12-opacity",
  ErrorHover: "error-hover",
  ErrorActive: "error-active",
  Success: "success",
  SuccessHover: "success-hover",
  SuccessActive: "success-Active",
  Warning: "warning",
  WarningHover: "warning-hover",
  WarningActive: "warning-active",
  Info: "info",
  Modified: "modified",
  Red: "red",
  Orange: "orange",
  Salad: "salad",
  Green: "green",
  Blue: "blue",
  Indigo: "indigo",
  Violet: "violet",
  Pink: "pink",
  GradientRight: "gradient-right",
  Extra_0_3_Overlay: "extra-0-3-overlay",
  GradientRightActive: "gradient-right-active",
  GradientRightHover: "gradient-right-hover",
  Extra_0_5_Overlay: "extra-0-5-overlay",
  Extra_0_7_Overlay: "extra-0-7-overlay",
  Extra_0_9_Overlay: "extra-0-9-overlay",
  Red_0_1_Overlay: "red-0-1-overlay",
  Orange_0_1_Overlay: "orange-0-1-overlay",
  Accent_0_8_Overlay: "accent-0-8-overlay",
  Link: "link",
  Camera: "camera",
  GoogleDrive: "google-drive",
  Dropbox: "dropbox",
  OneDrive: "one-drive",
  Device: "device",
  Instagram: "instagram",
  FreeImages: "free-images",
  FreeIcons: "free-icons",
  Canvas: "canvas",
  Box: "box",
  ScreenCast: "screen-cast",
  Unsplash: "unsplash",
  LightShadow: "light-shadow",
  MediumShadow: "medium-shadow",
  LargeShadow: "large-shadow",
  XLargeShadow: "x-large-shadow"
};
var scrollBar = function scrollBar2(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["scrollbar-color:", " ", ";scrollbar-width:thin;::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{margin-block:6px;}::-webkit-scrollbar-thumb{background:", ";border:4px solid ", ";border-radius:99px;padding:4px 6px;background-clip:padding-box;}"], palette[Color.IconsMuted], palette[Color.ActiveSecondary], palette[Color.Extra_0_3_Overlay], palette[Color.ActiveSecondary]);
};
var Breakpoint = {
  Xs: "xs",
  Sm: "sm",
  Md: "md",
  Lg: "lg",
  Xl: "xl",
  Xxl: "xxl",
  Xxxl: "xxxl"
};
var Shadows = {
  ShadowSm: "shadow-sm",
  ShadowMd: "shadow-md",
  ShadowLg: "shadow-lg",
  ShadowXl: "shadow-xl",
  Label: "label",
  Header: "header",
  HeaderPopup: "header-popup",
  FooterPopup: "footer-popup",
  LeftPanelMd: "left-panel-md",
  RightPanelMd: "right-panel-md",
  LeftPanelSm: "left-panel-sm",
  RightPanelSm: "right-panel-sm"
};
var FontWeight = {
  Thin: 100,
  ExtraLight: 200,
  Light: 300,
  Regular: 400,
  Medium: 500,
  SemiBold: 600,
  Bold: 700,
  ExtraBold: 800,
  Black: 900
};
var FontVariant = {
  TextExtraSmall: "text-extra-small",
  TextSmall: "text-small",
  TextSmallUp: "text-small-up",
  TextMedium: "text-medium",
  TextLarge: "text-large",
  TextExtraLarge: "text-extra-large",
  TextXExtraLarge: "text-x-extra-large",
  TitleH6: "title-h6",
  TitleH5: "title-h5",
  TitleH4: "title-h4",
  TitleH3: "title-h3",
  TitleH2: "title-h2",
  TitleH1: "title-h1",
  LabelExtraSmall: "label-extra-small",
  LabelExtraSmallEmphasis: "label-extra-small-emphasis",
  LabelExtraSmallUp: "label-extra-small-up",
  LabelSmall: "label-small",
  LabelSmallEmphasis: "label-small-emphasis",
  LabelSmallUp: "label-small-up",
  LabelSmallUpEmphasis: "label-small-up-emphasis",
  LabelMedium: "label-medium",
  LabelMediumEmphasis: "label-medium-emphasis",
  LabelLarge: "label-large",
  LabelLargeEmphasis: "label-large-emphasis",
  LabelLargeUp: "label-large-up",
  LabelExtraLargeEmphasis: "label-extra-large-emphasis",
  LabelExtraLarge: "label-extra-large",
  LabelXExtraLargeEmphasis: "label-x-extra-large-emphasis",
  LabelXExtraLarge: "label-x-extra-large",
  LabelXXExtraLargeEmphasis: "label-x-x-extra-large-emphasis",
  LabelXXExtraLarge: "label-x-x-extra-large",
  LabelXXXExtraLarge: "label-x-x-x-extra-large",
  ButtonSmEmphasis: "btn-sm-emphasis",
  ButtonSm: "btn-sm",
  ButtonSmUpEmphasis: "btn-sm-up-emphasis",
  ButtonSmUp: "btn-sm-up",
  ButtonMdEmphasis: "btn-md-emphasis",
  ButtonMd: "btn-md",
  ButtonLgEmphasis: "btn-lg-emphasis",
  ButtonLg: "btn-lg",
  ButtonLgUpEmphasis: "btn-lg-up-emphasis",
  ButtonLgUp: "btn-lg-up",
  LinkSmall: "link-small",
  LinkSmallEmphasis: "link-small-emphasis",
  LinkSmallUp: "link-small-up",
  LinkSmallUpEmphasis: "link-small-up-emphasis",
  LinkMedium: "link-medium",
  LinkMediumEmphasis: "link-medium-emphasis",
  LinkLarge: "link-large",
  LinkLargeEmphasis: "link-large-emphasis",
  LinkLargeUp: "link-large-up",
  LinkLargeUpEmphasis: "link-large-up-emphasis",
  InputSm: "input-sm",
  InputSmUp: "input-sm-up",
  InputMd: "input-md",
  InputLg: "input-lg"
};
var BorderRadiusSize = {
  Sm: "sm",
  Md: "md",
  Lg: "lg"
};
var Typography = /* @__PURE__ */ $e(["", ";"], function(_ref) {
  var theme = _ref.theme;
  var baseLineHeight = theme.typography.baseLineHeight;
  return Ae(["h1,h2,h3,h4,h5,h6,p,small{line-height:", ";}"], baseLineHeight);
});
function ownKeys$1j(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$1j(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$1j(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1j(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var defaultFontValue = {
  fontFamily: '"Roboto"',
  fontStyle: "normal",
  fontWeight: FontWeight.Regular
};
var getLabelFontVariants = function getLabelFontVariants2() {
  var _ref;
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _ref = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelExtraSmall, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "10px",
    lineHeight: "12px"
  }, fontOverride)), FontVariant.LabelExtraSmallEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: "Bold",
    fontSize: "10px",
    lineHeight: "12px"
  }, fontOverride)), FontVariant.LabelExtraSmallUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "11px",
    lineHeight: "12px"
  }, fontOverride)), FontVariant.LabelSmall, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.LabelSmallEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.LabelSmallUp, _objectSpread$1j(_objectSpread$1j({
    fontSize: "13px",
    lineHeight: "16px"
  }, defaultFontValue), fontOverride)), FontVariant.LabelSmallUpEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LabelMedium, _objectSpread$1j(_objectSpread$1j({
    fontSize: "14px",
    lineHeight: "16px"
  }, defaultFontValue), fontOverride)), FontVariant.LabelMediumEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LabelLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ref, FontVariant.LabelLargeEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.LabelLargeUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Regular,
    fontSize: "18px",
    lineHeight: "20px"
  }, fontOverride)), FontVariant.LabelExtraLargeEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "24px",
    lineHeight: "28px"
  }, fontOverride)), FontVariant.LabelExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Regular,
    fontSize: "24px",
    lineHeight: "28px"
  }, fontOverride)), FontVariant.LabelXExtraLargeEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "32px",
    lineHeight: "36px"
  }, fontOverride)), FontVariant.LabelXExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "32px",
    lineHeight: "36px"
  }, fontOverride)), FontVariant.LabelXXExtraLargeEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "48px",
    lineHeight: "54px"
  }, fontOverride)), FontVariant.LabelXXExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "48px",
    lineHeight: "54px"
  }, fontOverride)), FontVariant.LabelXXXExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "60px",
    lineHeight: "68px"
  }, fontOverride));
};
var getTextFontVariants = function getTextFontVariants2() {
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TextExtraSmall, _objectSpread$1j(_objectSpread$1j({}, getLabelFontVariants()[FontVariant.LabelExtraSmallUp]), {}, {
    lineHeight: "14px"
  }, fontOverride)), FontVariant.TextSmall, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "12px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.TextSmallUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "13px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.TextMedium, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "14px",
    lineHeight: "20px"
  }, fontOverride)), FontVariant.TextLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "16px",
    lineHeight: "22px"
  }, fontOverride)), FontVariant.TextExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "18px",
    lineHeight: "26px"
  }, fontOverride)), FontVariant.TextXExtraLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "28px",
    lineHeight: "40px"
  }, fontOverride));
};
var getButtonFontVariants = function getButtonFontVariants2() {
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.ButtonSmEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.ButtonSm, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.ButtonSmUpEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.ButtonSmUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.ButtonMdEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.ButtonMd, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.ButtonLgEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.ButtonLg, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.ButtonLgUpEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "18px",
    lineHeight: "20px"
  }, fontOverride)), FontVariant.ButtonLgUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "18px",
    lineHeight: "20px"
  }, fontOverride));
};
var getLinkFontVariants = function getLinkFontVariants2() {
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.LinkSmall, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.LinkSmallEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.LinkSmallUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LinkSmallUpEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LinkMedium, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LinkMediumEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.LinkLarge, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.LinkLargeEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.LinkLargeUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "18px",
    lineHeight: "20px"
  }, fontOverride)), FontVariant.LinkLargeUpEmphasis, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "18px",
    lineHeight: "20px"
  }, fontOverride));
};
var getInputFontVariants = function getInputFontVariants2() {
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.InputSm, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "12px",
    lineHeight: "14px"
  }, fontOverride)), FontVariant.InputSmUp, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "13px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.InputMd, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "14px",
    lineHeight: "16px"
  }, fontOverride)), FontVariant.InputLg, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontSize: "16px",
    lineHeight: "18px"
  }, fontOverride));
};
var getTitleFontVariants = function getTitleFontVariants2() {
  var fontOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FontVariant.TitleH6, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "12px",
    lineHeight: "18px"
  }, fontOverride)), FontVariant.TitleH5, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "14px",
    lineHeight: "21px"
  }, fontOverride)), FontVariant.TitleH4, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "16px",
    lineHeight: "24px"
  }, fontOverride)), FontVariant.TitleH3, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "18px",
    lineHeight: "27px"
  }, fontOverride)), FontVariant.TitleH2, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "20px",
    lineHeight: "30px"
  }, fontOverride)), FontVariant.TitleH1, _objectSpread$1j(_objectSpread$1j({}, defaultFontValue), {}, {
    fontWeight: FontWeight.Medium,
    fontSize: "28px",
    lineHeight: "42px"
  }, fontOverride));
};
var getDefaultTypography = function getDefaultTypography2() {
  var typographyOverride = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return _objectSpread$1j(_objectSpread$1j({
    fontFamily: defaultFontValue.fontFamily,
    baseLineHeight: 1.375
  }, typographyOverride), {}, {
    font: _objectSpread$1j(_objectSpread$1j(_objectSpread$1j(_objectSpread$1j(_objectSpread$1j(_objectSpread$1j({}, getLabelFontVariants(typographyOverride)), getTextFontVariants(typographyOverride)), getButtonFontVariants(typographyOverride)), getLinkFontVariants(typographyOverride)), getInputFontVariants(typographyOverride)), getTitleFontVariants(typographyOverride))
  });
};
var CommonStyles = /* @__PURE__ */ $e(["@keyframes spinner{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.Menu-open{overflow:hidden;}.Modal-open{overflow:hidden;}"]);
var _lightPalette;
var lightPalette = (_lightPalette = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.TextPrimary, "rgba(55, 65, 75, 1)"), Color.TextSecondary, "rgba(118, 138, 159, 1)"), Color.TextSecondaryInvert, "rgba(213, 216, 220, 1)"), Color.TextPlaceholder, "rgba(169, 182, 194, 1)"), Color.TextWarning, "rgba(196, 110, 0, 1)"), Color.TextError, "rgba(185, 33, 46, 1)"), Color.TextInfo, "rgba(35, 117, 171, 1)"), Color.AccentPrimary, "rgba(104, 121, 235, 1)"), Color.AccentPrimaryHover, "rgba(96, 111, 209, 1)"), Color.AccentPrimaryActive, "rgba(73, 88, 188, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.AccentPrimaryDisabled, "rgba(233, 238, 242, 1)"), Color.AccentSecondaryDisabled, "#F9FBFC"), Color.AccentStateless, "rgba(104, 121, 235, 1)"), Color.AccentStateless_0_4_Opacity, "rgba(104, 121, 235, 0.4)"), Color.Accent_0_5_Opacity, "rgba(104, 121, 235, 0.05)"), Color.Accent_1_2_Opacity, "rgba(104, 121, 235, 0.12)"), Color.Accent_1_8_Opacity, "rgba(104, 121, 235, 0.18)"), Color.Accent_2_8_Opacity, "rgba(104, 121, 235, 0.28)"), Color.Accent_4_0_Opacity, "rgba(104, 121, 235, 0.4)"), Color.BackgroundGrey, "rgba(216, 224, 232, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundStateless, "rgba(255, 255, 255, 1)"), Color.BackgroundActive, "rgba(243, 247, 250, 1)"), Color.BackgroundBaseLight, "rgba(235, 239, 252, 1)"), Color.BackgroundBaseMedium, "rgba(227, 231, 251, 1)"), Color.BackgroundPrimary, "rgba(248, 250, 251, 1)"), Color.BackgroundPrimaryLight, "rgba(243, 245, 247, 1)"), Color.BackgroundPrimaryHover, "rgba(239, 243, 246, 1)"), Color.BackgroundPrimaryActive, "rgba(93, 109, 126, 1)"), Color.BackgroundPrimary_0_5_Opacity, "rgba(255, 255, 255, 0.500)"), Color.BackgroundPrimaryStateless, "#CCD6DE"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BackgroundSecondary, "rgba(255, 255, 255, 1)"), Color.BackgroundHover, "rgba(249, 251, 252, 1)"), Color.BackgroundGreen, "rgba(237, 250, 244, 1)"), Color.BackgroundGreenMedium, "rgba(227, 250, 239, 1)"), Color.BackgroundBlue, "rgba(244, 249, 255, 1)"), Color.BackgroundRed, "rgba(253, 244, 242, 1)"), Color.BackgroundRedLight, "rgba(255, 245, 245, 1)"), Color.BackgroundRedMedium, "rgba(247, 228, 230, 1)"), Color.BackgroundOrange, "rgba(255, 249, 242, 1)"), Color.BackgroundTooltip, "rgba(79, 98, 118, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.IconsPrimary, "rgba(118, 138, 159, 1)"), Color.IconsPrimaryOpacity_0_6, "rgba(93, 109, 126, 0.600)"), Color.IconsSecondary, "rgba(151, 166, 182, 1)"), Color.IconsPlaceholder, "rgba(223, 231, 237, 1)"), Color.IconsInvert, "rgba(255, 255, 255, 1)"), Color.IconsMuted, "rgba(169, 182, 194, 1)"), Color.IconsPrimaryHover, "rgba(79, 98, 118, 1)"), Color.IconsSecondaryHover, "rgba(118, 138, 159, 1)"), Color.ButtonPrimaryText, "rgba(255, 255, 255, 1)"), Color.ButtonPrimaryText_0_6, "rgba(255, 255, 255, 0.6)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ButtonPrimaryText_0_4, "rgba(255, 255, 255, 0.4)"), Color.ButtonDisabledText, "rgba(169, 182, 194, 1)"), Color.ButtonSecondaryText, "rgba(0, 0, 0, 1)"), Color.LinkPrimary, "rgba(118, 138, 159, 1)"), Color.LinkStateless, "rgba(118, 138, 159, 1)"), Color.LinkHover, "rgba(79, 98, 118, 1)"), Color.LinkActive, "rgba(55, 65, 75, 1)"), Color.LinkPressed, "rgba(104, 121, 235, 1)"), Color.LinkMuted, "rgba(169, 182, 194, 1)"), Color.BordersPrimary, "rgba(204, 214, 222, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersPrimaryHover, "rgba(104, 118, 134, 1)"), Color.BordersSecondary, "rgba(236, 240, 243, 1)"), Color.BordersStrong, "rgba(204, 214, 222, 1)"), Color.BordersInvert, "rgba(85, 99, 115, 1)"), Color.BorderHoverBottom, "rgba(104, 121, 235, 0.18)"), Color.BorderActiveBottom, "#4958BC"), Color.BorderPrimaryStateless, "rgba(204, 214, 222, 1)"), Color.BordersDisabled, "rgba(73, 88, 188, 0.4)"), Color.BordersButton, "rgba(151, 166, 182, 1)"), Color.BordersItem, "rgba(226, 232, 236, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.BordersBaseLight, "rgba(211, 219, 250, 1)"), Color.BordersBaseMedium, "rgba(164, 175, 227, 1)"), Color.BordersGreen, "rgba(27, 161, 99, 0.22)"), Color.BordersGreenMedium, "rgba(27, 161, 99, 0.4)"), Color.BordersRed, "rgba(185, 33, 46, 0.4)"), Color.ActiveSecondary, "#FFFFFF"), Color.ActiveSecondaryHover, "rgba(104, 121, 235, 0.05)"), Color.Error, "rgba(246, 61, 61, 1)"), Color.Error_0_28_Opacity, "rgba(185, 33, 46, 0.28)"), Color.Error_0_12_Opacity, "rgba(255, 86, 78, 0.1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ErrorHover, "rgba(216, 46, 46, 1)"), Color.ErrorActive, "rgba(185, 33, 46, 1)"), Color.Success, "rgba(38, 193, 122, 1)"), Color.SuccessHover, "rgba(30, 154, 98, 1)"), Color.SuccessActive, "rgba(23, 116, 73, 1)"), Color.Warning, "rgba(255, 172, 74, 1)"), Color.WarningHover, "rgba(237, 145, 7, 1)"), Color.WarningActive, "rgba(224, 135, 0, 1)"), Color.Info, "rgba(41, 127, 184, 1)"), Color.Modified, "rgba(165, 166, 246, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.Red, "rgba(219, 46, 50, 1)"), Color.Orange, "rgba(255, 168, 0, 1)"), Color.Salad, "rgba(143, 176, 33, 1)"), Color.Green, "rgba(22, 160, 134, 1)"), Color.Blue, "rgba(41, 127, 184, 1)"), Color.Indigo, "rgba(91, 72, 162, 1)"), Color.Violet, "rgba(141, 68, 173, 1)"), Color.Pink, "rgba(211, 92, 158, 1)"), Color.GradientRight, "linear-gradient(270deg, #FFFFFF 1.56%, rgba(255, 255, 255, 0.89) 52.4%, rgba(255, 255, 255, 0.532165) 76.04%, rgba(255, 255, 255, 0) 100%)"), Color.Extra_0_3_Overlay, "rgba(79, 98, 118, 0.3)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GradientRightActive, "linear-gradient(270deg, #F3F7FA 1.56%, #F3F7FA 52.4%, rgba(243, 247, 250, 0.53) 76.04%, rgba(243, 247, 250, 0) 100%)"), Color.GradientRightHover, "linear-gradient(270deg, #F9FBFC 1.56%, #F9FBFC 52.4%, rgba(249, 251, 252, 0.53) 76.04%, rgba(249, 251, 252, 0) 100%)"), Color.Extra_0_5_Overlay, "rgba(79, 98, 118, 0.5)"), Color.Extra_0_7_Overlay, "rgba(79, 98, 118, 0.7)"), Color.Extra_0_9_Overlay, "rgba(79, 98, 118, 0.9)"), Color.Red_0_1_Overlay, "rgba(232, 91, 70, 0.1)"), Color.Orange_0_1_Overlay, "rgba(250, 157, 47, 0.1)"), Color.Accent_0_8_Overlay, "rgba(104, 121, 235, 0.08)"), Color.Link, "rgba(250, 166, 68, 1)"), Color.Camera, "rgba(73, 186, 224, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.GoogleDrive, "rgba(81, 136, 238, 1)"), Color.Dropbox, "rgba(17, 40, 124, 1)"), Color.OneDrive, "rgba(40, 100, 186, 1)"), Color.Device, "rgba(102, 73, 209, 1)"), Color.Instagram, "rgba(244, 70, 154, 1)"), Color.Unsplash, "rgba(173, 38, 220, 1)"), Color.FreeImages, "rgba(16, 163, 135, 1)"), Color.FreeIcons, "rgba(62, 207, 139, 1)"), Color.Canvas, "rgba(36, 190, 202, 1)"), Color.Box, "rgba(0, 97, 213, 1)"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_lightPalette, Color.ScreenCast, "rgba(48, 61, 78, 1)"), Color.Tag, "#889AAC"), Color.StatesErrorDisabledText, "rgba(185, 33, 46, 0.3)"), Color.LightShadow, "rgba(146, 166, 188, 0.2)"), Color.MediumShadow, "rgba(146, 166, 188, 0.24)"), Color.LargeShadow, "rgba(146, 166, 188, 0.32)"), Color.XLargeShadow, "rgba(146, 166, 188, 0.5)"));
var defaultPalette = lightPalette;
var _shadows;
var shadows = (_shadows = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_shadows, Shadows.ShadowSm, "0px 1px 2px 0px rgba(146, 166, 188, 0.2)"), Shadows.ShadowMd, " 0px 1px 4px 0px rgba(146, 166, 188, 0.24)"), Shadows.ShadowLg, " 0px 2px 6px 0px rgba(146, 166, 188, 0.32)"), Shadows.ShadowXl, " 0px 2px 6px 0px rgba(146, 166, 188, 0.5)"), Shadows.Label, " 0px 1px 3px 0px rgba(77, 78, 78, 0.15)"), Shadows.Header, " 0px 6px 10px 0px rgba(146, 166, 188, 0.2)"), Shadows.HeaderPopup, " 0px 3px 7px 0px rgba(146, 166, 188, 0.16)"), Shadows.FooterPopup, " 0px -4px 8px 0px rgba(208, 215, 220, 0.22)"), Shadows.LeftPanelMd, " 6px 8px 12px 0px rgba(146, 166, 188, 0.14)"), Shadows.RightPanelMd, "-6px 8px 12px 0px rgba(146, 166, 188, 0.14)"), _defineProperty(_defineProperty(_shadows, Shadows.LeftPanelSm, "6px -4px 12px 0px rgba(146, 166, 188, 0.14)"), Shadows.RightPanelSm, "-6px -4px 12px 0px rgba(146, 166, 188, 0.14)"));
var defaultShadows = shadows;
var defaultBreakpoints = {
  keys: [Breakpoint.Xs, Breakpoint.Sm, Breakpoint.Md, Breakpoint.Lg, Breakpoint.Xl],
  values: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, 0), Breakpoint.Sm, 576), Breakpoint.Md, 768), Breakpoint.Lg, 1084), Breakpoint.Xl, 1342), Breakpoint.Xxl, 1600), Breakpoint.Xxxl, 1920),
  classes: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Breakpoint.Xs, ".sfx-breakpoint-xs"), Breakpoint.Sm, ".sfx-breakpoint-sm"), Breakpoint.Md, ".sfx-breakpoint-md"), Breakpoint.Lg, ".sfx-breakpoint-lg"), Breakpoint.Xl, ".sfx-breakpoint-xl"), Breakpoint.Xxl, ".sfx-breakpoint-xxl"), Breakpoint.Xxxl, ".sfx-breakpoint-xxxl"),
  getBreakpointClass: function getBreakpointClass() {
    return "";
  },
  up: function up() {
    return "";
  },
  down: function down() {
    return "";
  },
  between: function between() {
    return "";
  },
  only: function only() {
    return "";
  }
};
var createBreakpoints = function createBreakpoints2(breakpoints) {
  var _breakpoints$values = breakpoints.values, values = _breakpoints$values === void 0 ? defaultBreakpoints.values : _breakpoints$values, _breakpoints$classes = breakpoints.classes, classes = _breakpoints$classes === void 0 ? defaultBreakpoints.classes : _breakpoints$classes;
  var unit = "px";
  var keys = Object.keys(values);
  var up2 = function up3(key) {
    var value = typeof values[key] === "number" ? values[key] : key;
    return "@media (min-width:".concat(value).concat(unit, ")");
  };
  var down2 = function down3(key) {
    var value = values[key];
    return "@media (max-width:".concat(value).concat(unit, ")");
  };
  var between2 = function between3(start2, end2) {
    var endIndex = keys.indexOf(end2);
    return "@media (min-width:".concat(values[start2]).concat(unit, ") and (max-width:").concat(values[keys[endIndex]]).concat(unit, ")");
  };
  var only2 = function only3(key) {
    if (keys.indexOf(key) + 1 < keys.length) {
      return between2(key, keys[keys.indexOf(key) + 1]);
    }
    return up2(key);
  };
  var getBreakpointClass2 = function getBreakpointClass3(width, hideSelector) {
    var removeSelector = function removeSelector2(str) {
      return str.slice(1);
    };
    if (width >= values.xs && width < values.sm) {
      return hideSelector ? removeSelector(classes.xs) : classes.xs;
    }
    if (width >= values.sm && width < values.md) {
      return hideSelector ? removeSelector(classes.sm) : classes.sm;
    }
    if (width >= values.md && width < values.lg) {
      return hideSelector ? removeSelector(classes.md) : classes.md;
    }
    if (width >= values.lg && width < values.xl) {
      return hideSelector ? removeSelector(classes.lg) : classes.lg;
    }
    if (width >= values.xl && width < values.xxl) {
      return hideSelector ? removeSelector(classes.xl) : classes.xl;
    }
    if (width >= values.xxl && width < values.xxxl) {
      return hideSelector ? removeSelector(classes.xxl) : classes.xxl;
    }
    if (width >= values.xxxl) {
      return hideSelector ? removeSelector(classes.xxxl) : classes.xxxl;
    }
    return hideSelector ? removeSelector(classes.md) : classes.md;
  };
  return {
    keys,
    values,
    classes,
    getBreakpointClass: getBreakpointClass2,
    up: up2,
    down: down2,
    between: between2,
    only: only2
  };
};
function ownKeys$1i(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$1i(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$1i(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1i(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var defaultShape = {
  borderRadius: _defineProperty(_defineProperty(_defineProperty({}, BorderRadiusSize.Sm, "2px"), BorderRadiusSize.Md, "4px"), BorderRadiusSize.Lg, "8px")
};
var ThemeProvider = function ThemeProvider2(_ref) {
  var children = _ref.children, _ref$theme = _ref.theme, theme = _ref$theme === void 0 ? {} : _ref$theme;
  var _theme$palette = theme.palette, paletteOverride = _theme$palette === void 0 ? {} : _theme$palette, _theme$breakpoints = theme.breakpoints, breakpointsOverride = _theme$breakpoints === void 0 ? {} : _theme$breakpoints, _theme$typography = theme.typography, typographyOverride = _theme$typography === void 0 ? {} : _theme$typography, _theme$shape = theme.shape, shapeOverride = _theme$shape === void 0 ? {} : _theme$shape, _theme$shadows = theme.shadows, shadowsOverride = _theme$shadows === void 0 ? {} : _theme$shadows;
  var finalTheme = reactExports.useMemo(function() {
    var palette = _objectSpread$1i(_objectSpread$1i({}, defaultPalette), paletteOverride);
    var breakpoints = createBreakpoints(breakpointsOverride);
    var shadows2 = _objectSpread$1i(_objectSpread$1i({}, defaultShadows), shadowsOverride);
    return {
      palette,
      breakpoints,
      typography: getDefaultTypography(typographyOverride),
      shape: _objectSpread$1i({}, merge(_objectSpread$1i({}, defaultShape), _objectSpread$1i({}, shapeOverride))),
      shadows: shadows2
    };
  }, [JSON.stringify(theme)]);
  return /* @__PURE__ */ React.createElement(Le, {
    theme: finalTheme
  }, /* @__PURE__ */ React.createElement(React.Fragment, null, applyPolymorphicFunctionProp(children, finalTheme), /* @__PURE__ */ React.createElement(CommonStyles, null), /* @__PURE__ */ React.createElement(Typography, null)));
};
var _getDefaultTypography = getDefaultTypography();
_getDefaultTypography.baseLineHeight;
_getDefaultTypography.font;
var typography = _objectWithoutProperties(_getDefaultTypography, ["baseLineHeight", "font"]);
ThemeProvider.propTypes = {
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func, PropTypes.arrayOf(PropTypes.node)]).isRequired,
  theme: PropTypes.exact({
    breakpoints: PropTypes.exact({
      keys: PropTypes.arrayOf(PropTypes.string),
      values: PropTypes.exact(record(objectValues(Breakpoint), PropTypes.number)),
      classes: PropTypes.exact(record(objectValues(Breakpoint), PropTypes.string)),
      getBreakpointClass: PropTypes.func,
      up: PropTypes.func,
      down: PropTypes.func,
      between: PropTypes.func,
      only: PropTypes.func
    }),
    palette: PropTypes.exact(record(objectValues(Color), PropTypes.string)),
    shadows: PropTypes.exact(record(objectValues(Shadows), PropTypes.string)),
    shape: PropTypes.exact({
      borderRadius: PropTypes.exact(record(objectValues(BorderRadiusSize), PropTypes.string))
    }),
    typography: PropTypes.exact(_objectSpread$1i({
      baseLineHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
      font: PropTypes.exact(record(objectValues(FontVariant), PropTypes.object))
    }, record(objectKeys(typography), PropTypes.string)))
  })
};
function _arrayWithHoles(r2) {
  if (Array.isArray(r2)) return r2;
}
function _iterableToArrayLimit(r2, l2) {
  var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
  if (null != t2) {
    var e2, n2, i, u2, a = [], f2 = true, o = false;
    try {
      if (i = (t2 = t2.call(r2)).next, 0 === l2) {
        if (Object(t2) !== t2) return;
        f2 = false;
      } else for (; !(f2 = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l2); f2 = true) ;
    } catch (r3) {
      o = true, n2 = r3;
    } finally {
      try {
        if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
      } finally {
        if (o) throw n2;
      }
    }
    return a;
  }
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(r2, e2) {
  return _arrayWithHoles(r2) || _iterableToArrayLimit(r2, e2) || _unsupportedIterableToArray$1(r2, e2) || _nonIterableRest();
}
function _extends() {
  return _extends = Object.assign ? Object.assign.bind() : function(n2) {
    for (var e2 = 1; e2 < arguments.length; e2++) {
      var t2 = arguments[e2];
      for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
    }
    return n2;
  }, _extends.apply(null, arguments);
}
var lib$3 = { exports: {} };
var _FullInternals$1 = {};
var _CoreInternals$1 = {};
var Global$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports._registerNode = exports.Konva = exports.glob = void 0;
  const PI_OVER_180 = Math.PI / 180;
  function detectBrowser() {
    return typeof window !== "undefined" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
  }
  exports.glob = typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" ? self : {};
  exports.Konva = {
    _global: exports.glob,
    version: "9.3.14",
    isBrowser: detectBrowser(),
    isUnminified: /param/.test(function(param) {
    }.toString()),
    dblClickWindow: 400,
    getAngle(angle) {
      return exports.Konva.angleDeg ? angle * PI_OVER_180 : angle;
    },
    enableTrace: false,
    pointerEventsEnabled: true,
    autoDrawEnabled: true,
    hitOnDragEnabled: false,
    capturePointerEventsEnabled: false,
    _mouseListenClick: false,
    _touchListenClick: false,
    _pointerListenClick: false,
    _mouseInDblClickWindow: false,
    _touchInDblClickWindow: false,
    _pointerInDblClickWindow: false,
    _mouseDblClickPointerId: null,
    _touchDblClickPointerId: null,
    _pointerDblClickPointerId: null,
    _fixTextRendering: false,
    pixelRatio: typeof window !== "undefined" && window.devicePixelRatio || 1,
    dragDistance: 3,
    angleDeg: true,
    showWarnings: true,
    dragButtons: [0, 1],
    isDragging() {
      return exports.Konva["DD"].isDragging;
    },
    isTransforming() {
      var _a2;
      return (_a2 = exports.Konva["Transformer"]) === null || _a2 === void 0 ? void 0 : _a2.isTransforming();
    },
    isDragReady() {
      return !!exports.Konva["DD"].node;
    },
    releaseCanvasOnDestroy: true,
    document: exports.glob.document,
    _injectGlobal(Konva2) {
      exports.glob.Konva = Konva2;
    }
  };
  const _registerNode = (NodeClass) => {
    exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;
  };
  exports._registerNode = _registerNode;
  exports.Konva._injectGlobal(exports.Konva);
})(Global$1);
var Util$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Util = exports.Transform = void 0;
  const Global_12 = Global$1;
  class Transform {
    constructor(m2 = [1, 0, 0, 1, 0, 0]) {
      this.dirty = false;
      this.m = m2 && m2.slice() || [1, 0, 0, 1, 0, 0];
    }
    reset() {
      this.m[0] = 1;
      this.m[1] = 0;
      this.m[2] = 0;
      this.m[3] = 1;
      this.m[4] = 0;
      this.m[5] = 0;
    }
    copy() {
      return new Transform(this.m);
    }
    copyInto(tr) {
      tr.m[0] = this.m[0];
      tr.m[1] = this.m[1];
      tr.m[2] = this.m[2];
      tr.m[3] = this.m[3];
      tr.m[4] = this.m[4];
      tr.m[5] = this.m[5];
    }
    point(point) {
      var m2 = this.m;
      return {
        x: m2[0] * point.x + m2[2] * point.y + m2[4],
        y: m2[1] * point.x + m2[3] * point.y + m2[5]
      };
    }
    translate(x2, y2) {
      this.m[4] += this.m[0] * x2 + this.m[2] * y2;
      this.m[5] += this.m[1] * x2 + this.m[3] * y2;
      return this;
    }
    scale(sx, sy) {
      this.m[0] *= sx;
      this.m[1] *= sx;
      this.m[2] *= sy;
      this.m[3] *= sy;
      return this;
    }
    rotate(rad) {
      var c2 = Math.cos(rad);
      var s = Math.sin(rad);
      var m11 = this.m[0] * c2 + this.m[2] * s;
      var m12 = this.m[1] * c2 + this.m[3] * s;
      var m21 = this.m[0] * -s + this.m[2] * c2;
      var m22 = this.m[1] * -s + this.m[3] * c2;
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      return this;
    }
    getTranslation() {
      return {
        x: this.m[4],
        y: this.m[5]
      };
    }
    skew(sx, sy) {
      var m11 = this.m[0] + this.m[2] * sy;
      var m12 = this.m[1] + this.m[3] * sy;
      var m21 = this.m[2] + this.m[0] * sx;
      var m22 = this.m[3] + this.m[1] * sx;
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      return this;
    }
    multiply(matrix) {
      var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];
      var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];
      var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];
      var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];
      var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];
      var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      this.m[4] = dx;
      this.m[5] = dy;
      return this;
    }
    invert() {
      var d2 = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);
      var m0 = this.m[3] * d2;
      var m1 = -this.m[1] * d2;
      var m2 = -this.m[2] * d2;
      var m3 = this.m[0] * d2;
      var m4 = d2 * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);
      var m5 = d2 * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);
      this.m[0] = m0;
      this.m[1] = m1;
      this.m[2] = m2;
      this.m[3] = m3;
      this.m[4] = m4;
      this.m[5] = m5;
      return this;
    }
    getMatrix() {
      return this.m;
    }
    decompose() {
      var a = this.m[0];
      var b2 = this.m[1];
      var c2 = this.m[2];
      var d2 = this.m[3];
      var e2 = this.m[4];
      var f2 = this.m[5];
      var delta = a * d2 - b2 * c2;
      let result = {
        x: e2,
        y: f2,
        rotation: 0,
        scaleX: 0,
        scaleY: 0,
        skewX: 0,
        skewY: 0
      };
      if (a != 0 || b2 != 0) {
        var r2 = Math.sqrt(a * a + b2 * b2);
        result.rotation = b2 > 0 ? Math.acos(a / r2) : -Math.acos(a / r2);
        result.scaleX = r2;
        result.scaleY = delta / r2;
        result.skewX = (a * c2 + b2 * d2) / delta;
        result.skewY = 0;
      } else if (c2 != 0 || d2 != 0) {
        var s = Math.sqrt(c2 * c2 + d2 * d2);
        result.rotation = Math.PI / 2 - (d2 > 0 ? Math.acos(-c2 / s) : -Math.acos(c2 / s));
        result.scaleX = delta / s;
        result.scaleY = s;
        result.skewX = 0;
        result.skewY = (a * c2 + b2 * d2) / delta;
      } else ;
      result.rotation = exports.Util._getRotation(result.rotation);
      return result;
    }
  }
  exports.Transform = Transform;
  var OBJECT_ARRAY = "[object Array]", OBJECT_NUMBER = "[object Number]", OBJECT_STRING = "[object String]", OBJECT_BOOLEAN = "[object Boolean]", PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH2 = "#", EMPTY_STRING2 = "", ZERO = "0", KONVA_WARNING = "Konva warning: ", KONVA_ERROR = "Konva error: ", RGB_PAREN = "rgb(", COLORS = {
    aliceblue: [240, 248, 255],
    antiquewhite: [250, 235, 215],
    aqua: [0, 255, 255],
    aquamarine: [127, 255, 212],
    azure: [240, 255, 255],
    beige: [245, 245, 220],
    bisque: [255, 228, 196],
    black: [0, 0, 0],
    blanchedalmond: [255, 235, 205],
    blue: [0, 0, 255],
    blueviolet: [138, 43, 226],
    brown: [165, 42, 42],
    burlywood: [222, 184, 135],
    cadetblue: [95, 158, 160],
    chartreuse: [127, 255, 0],
    chocolate: [210, 105, 30],
    coral: [255, 127, 80],
    cornflowerblue: [100, 149, 237],
    cornsilk: [255, 248, 220],
    crimson: [220, 20, 60],
    cyan: [0, 255, 255],
    darkblue: [0, 0, 139],
    darkcyan: [0, 139, 139],
    darkgoldenrod: [184, 132, 11],
    darkgray: [169, 169, 169],
    darkgreen: [0, 100, 0],
    darkgrey: [169, 169, 169],
    darkkhaki: [189, 183, 107],
    darkmagenta: [139, 0, 139],
    darkolivegreen: [85, 107, 47],
    darkorange: [255, 140, 0],
    darkorchid: [153, 50, 204],
    darkred: [139, 0, 0],
    darksalmon: [233, 150, 122],
    darkseagreen: [143, 188, 143],
    darkslateblue: [72, 61, 139],
    darkslategray: [47, 79, 79],
    darkslategrey: [47, 79, 79],
    darkturquoise: [0, 206, 209],
    darkviolet: [148, 0, 211],
    deeppink: [255, 20, 147],
    deepskyblue: [0, 191, 255],
    dimgray: [105, 105, 105],
    dimgrey: [105, 105, 105],
    dodgerblue: [30, 144, 255],
    firebrick: [178, 34, 34],
    floralwhite: [255, 255, 240],
    forestgreen: [34, 139, 34],
    fuchsia: [255, 0, 255],
    gainsboro: [220, 220, 220],
    ghostwhite: [248, 248, 255],
    gold: [255, 215, 0],
    goldenrod: [218, 165, 32],
    gray: [128, 128, 128],
    green: [0, 128, 0],
    greenyellow: [173, 255, 47],
    grey: [128, 128, 128],
    honeydew: [240, 255, 240],
    hotpink: [255, 105, 180],
    indianred: [205, 92, 92],
    indigo: [75, 0, 130],
    ivory: [255, 255, 240],
    khaki: [240, 230, 140],
    lavender: [230, 230, 250],
    lavenderblush: [255, 240, 245],
    lawngreen: [124, 252, 0],
    lemonchiffon: [255, 250, 205],
    lightblue: [173, 216, 230],
    lightcoral: [240, 128, 128],
    lightcyan: [224, 255, 255],
    lightgoldenrodyellow: [250, 250, 210],
    lightgray: [211, 211, 211],
    lightgreen: [144, 238, 144],
    lightgrey: [211, 211, 211],
    lightpink: [255, 182, 193],
    lightsalmon: [255, 160, 122],
    lightseagreen: [32, 178, 170],
    lightskyblue: [135, 206, 250],
    lightslategray: [119, 136, 153],
    lightslategrey: [119, 136, 153],
    lightsteelblue: [176, 196, 222],
    lightyellow: [255, 255, 224],
    lime: [0, 255, 0],
    limegreen: [50, 205, 50],
    linen: [250, 240, 230],
    magenta: [255, 0, 255],
    maroon: [128, 0, 0],
    mediumaquamarine: [102, 205, 170],
    mediumblue: [0, 0, 205],
    mediumorchid: [186, 85, 211],
    mediumpurple: [147, 112, 219],
    mediumseagreen: [60, 179, 113],
    mediumslateblue: [123, 104, 238],
    mediumspringgreen: [0, 250, 154],
    mediumturquoise: [72, 209, 204],
    mediumvioletred: [199, 21, 133],
    midnightblue: [25, 25, 112],
    mintcream: [245, 255, 250],
    mistyrose: [255, 228, 225],
    moccasin: [255, 228, 181],
    navajowhite: [255, 222, 173],
    navy: [0, 0, 128],
    oldlace: [253, 245, 230],
    olive: [128, 128, 0],
    olivedrab: [107, 142, 35],
    orange: [255, 165, 0],
    orangered: [255, 69, 0],
    orchid: [218, 112, 214],
    palegoldenrod: [238, 232, 170],
    palegreen: [152, 251, 152],
    paleturquoise: [175, 238, 238],
    palevioletred: [219, 112, 147],
    papayawhip: [255, 239, 213],
    peachpuff: [255, 218, 185],
    peru: [205, 133, 63],
    pink: [255, 192, 203],
    plum: [221, 160, 203],
    powderblue: [176, 224, 230],
    purple: [128, 0, 128],
    rebeccapurple: [102, 51, 153],
    red: [255, 0, 0],
    rosybrown: [188, 143, 143],
    royalblue: [65, 105, 225],
    saddlebrown: [139, 69, 19],
    salmon: [250, 128, 114],
    sandybrown: [244, 164, 96],
    seagreen: [46, 139, 87],
    seashell: [255, 245, 238],
    sienna: [160, 82, 45],
    silver: [192, 192, 192],
    skyblue: [135, 206, 235],
    slateblue: [106, 90, 205],
    slategray: [119, 128, 144],
    slategrey: [119, 128, 144],
    snow: [255, 255, 250],
    springgreen: [0, 255, 127],
    steelblue: [70, 130, 180],
    tan: [210, 180, 140],
    teal: [0, 128, 128],
    thistle: [216, 191, 216],
    transparent: [255, 255, 255, 0],
    tomato: [255, 99, 71],
    turquoise: [64, 224, 208],
    violet: [238, 130, 238],
    wheat: [245, 222, 179],
    white: [255, 255, 255],
    whitesmoke: [245, 245, 245],
    yellow: [255, 255, 0],
    yellowgreen: [154, 205, 5]
  }, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/, animQueue = [];
  const req = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame || function(f2) {
    setTimeout(f2, 60);
  };
  exports.Util = {
    _isElement(obj) {
      return !!(obj && obj.nodeType == 1);
    },
    _isFunction(obj) {
      return !!(obj && obj.constructor && obj.call && obj.apply);
    },
    _isPlainObject(obj) {
      return !!obj && obj.constructor === Object;
    },
    _isArray(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_ARRAY;
    },
    _isNumber(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_NUMBER && !isNaN(obj) && isFinite(obj);
    },
    _isString(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_STRING;
    },
    _isBoolean(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;
    },
    isObject(val) {
      return val instanceof Object;
    },
    isValidSelector(selector) {
      if (typeof selector !== "string") {
        return false;
      }
      var firstChar = selector[0];
      return firstChar === "#" || firstChar === "." || firstChar === firstChar.toUpperCase();
    },
    _sign(number) {
      if (number === 0) {
        return 1;
      }
      if (number > 0) {
        return 1;
      } else {
        return -1;
      }
    },
    requestAnimFrame(callback) {
      animQueue.push(callback);
      if (animQueue.length === 1) {
        req(function() {
          const queue = animQueue;
          animQueue = [];
          queue.forEach(function(cb2) {
            cb2();
          });
        });
      }
    },
    createCanvasElement() {
      var canvas = document.createElement("canvas");
      try {
        canvas.style = canvas.style || {};
      } catch (e2) {
      }
      return canvas;
    },
    createImageElement() {
      return document.createElement("img");
    },
    _isInDocument(el2) {
      while (el2 = el2.parentNode) {
        if (el2 == document) {
          return true;
        }
      }
      return false;
    },
    _urlToImage(url, callback) {
      var imageObj = exports.Util.createImageElement();
      imageObj.onload = function() {
        callback(imageObj);
      };
      imageObj.src = url;
    },
    _rgbToHex(r2, g2, b2) {
      return ((1 << 24) + (r2 << 16) + (g2 << 8) + b2).toString(16).slice(1);
    },
    _hexToRgb(hex) {
      hex = hex.replace(HASH2, EMPTY_STRING2);
      var bigint = parseInt(hex, 16);
      return {
        r: bigint >> 16 & 255,
        g: bigint >> 8 & 255,
        b: bigint & 255
      };
    },
    getRandomColor() {
      var randColor = (Math.random() * 16777215 << 0).toString(16);
      while (randColor.length < 6) {
        randColor = ZERO + randColor;
      }
      return HASH2 + randColor;
    },
    getRGB(color) {
      var rgb;
      if (color in COLORS) {
        rgb = COLORS[color];
        return {
          r: rgb[0],
          g: rgb[1],
          b: rgb[2]
        };
      } else if (color[0] === HASH2) {
        return this._hexToRgb(color.substring(1));
      } else if (color.substr(0, 4) === RGB_PAREN) {
        rgb = RGB_REGEX.exec(color.replace(/ /g, ""));
        return {
          r: parseInt(rgb[1], 10),
          g: parseInt(rgb[2], 10),
          b: parseInt(rgb[3], 10)
        };
      } else {
        return {
          r: 0,
          g: 0,
          b: 0
        };
      }
    },
    colorToRGBA(str) {
      str = str || "black";
      return exports.Util._namedColorToRBA(str) || exports.Util._hex3ColorToRGBA(str) || exports.Util._hex4ColorToRGBA(str) || exports.Util._hex6ColorToRGBA(str) || exports.Util._hex8ColorToRGBA(str) || exports.Util._rgbColorToRGBA(str) || exports.Util._rgbaColorToRGBA(str) || exports.Util._hslColorToRGBA(str);
    },
    _namedColorToRBA(str) {
      var c2 = COLORS[str.toLowerCase()];
      if (!c2) {
        return null;
      }
      return {
        r: c2[0],
        g: c2[1],
        b: c2[2],
        a: 1
      };
    },
    _rgbColorToRGBA(str) {
      if (str.indexOf("rgb(") === 0) {
        str = str.match(/rgb\(([^)]+)\)/)[1];
        var parts = str.split(/ *, */).map(Number);
        return {
          r: parts[0],
          g: parts[1],
          b: parts[2],
          a: 1
        };
      }
    },
    _rgbaColorToRGBA(str) {
      if (str.indexOf("rgba(") === 0) {
        str = str.match(/rgba\(([^)]+)\)/)[1];
        var parts = str.split(/ *, */).map((n2, index) => {
          if (n2.slice(-1) === "%") {
            return index === 3 ? parseInt(n2) / 100 : parseInt(n2) / 100 * 255;
          }
          return Number(n2);
        });
        return {
          r: parts[0],
          g: parts[1],
          b: parts[2],
          a: parts[3]
        };
      }
    },
    _hex8ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 9) {
        return {
          r: parseInt(str.slice(1, 3), 16),
          g: parseInt(str.slice(3, 5), 16),
          b: parseInt(str.slice(5, 7), 16),
          a: parseInt(str.slice(7, 9), 16) / 255
        };
      }
    },
    _hex6ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 7) {
        return {
          r: parseInt(str.slice(1, 3), 16),
          g: parseInt(str.slice(3, 5), 16),
          b: parseInt(str.slice(5, 7), 16),
          a: 1
        };
      }
    },
    _hex4ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 5) {
        return {
          r: parseInt(str[1] + str[1], 16),
          g: parseInt(str[2] + str[2], 16),
          b: parseInt(str[3] + str[3], 16),
          a: parseInt(str[4] + str[4], 16) / 255
        };
      }
    },
    _hex3ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 4) {
        return {
          r: parseInt(str[1] + str[1], 16),
          g: parseInt(str[2] + str[2], 16),
          b: parseInt(str[3] + str[3], 16),
          a: 1
        };
      }
    },
    _hslColorToRGBA(str) {
      if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
        const [_2, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str);
        const h2 = Number(hsl[0]) / 360;
        const s = Number(hsl[1]) / 100;
        const l2 = Number(hsl[2]) / 100;
        let t2;
        let t3;
        let val;
        if (s === 0) {
          val = l2 * 255;
          return {
            r: Math.round(val),
            g: Math.round(val),
            b: Math.round(val),
            a: 1
          };
        }
        if (l2 < 0.5) {
          t2 = l2 * (1 + s);
        } else {
          t2 = l2 + s - l2 * s;
        }
        const t1 = 2 * l2 - t2;
        const rgb = [0, 0, 0];
        for (let i = 0; i < 3; i++) {
          t3 = h2 + 1 / 3 * -(i - 1);
          if (t3 < 0) {
            t3++;
          }
          if (t3 > 1) {
            t3--;
          }
          if (6 * t3 < 1) {
            val = t1 + (t2 - t1) * 6 * t3;
          } else if (2 * t3 < 1) {
            val = t2;
          } else if (3 * t3 < 2) {
            val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
          } else {
            val = t1;
          }
          rgb[i] = val * 255;
        }
        return {
          r: Math.round(rgb[0]),
          g: Math.round(rgb[1]),
          b: Math.round(rgb[2]),
          a: 1
        };
      }
    },
    haveIntersection(r1, r2) {
      return !(r2.x > r1.x + r1.width || r2.x + r2.width < r1.x || r2.y > r1.y + r1.height || r2.y + r2.height < r1.y);
    },
    cloneObject(obj) {
      var retObj = {};
      for (var key in obj) {
        if (this._isPlainObject(obj[key])) {
          retObj[key] = this.cloneObject(obj[key]);
        } else if (this._isArray(obj[key])) {
          retObj[key] = this.cloneArray(obj[key]);
        } else {
          retObj[key] = obj[key];
        }
      }
      return retObj;
    },
    cloneArray(arr) {
      return arr.slice(0);
    },
    degToRad(deg) {
      return deg * PI_OVER_DEG180;
    },
    radToDeg(rad) {
      return rad * DEG180_OVER_PI;
    },
    _degToRad(deg) {
      exports.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead.");
      return exports.Util.degToRad(deg);
    },
    _radToDeg(rad) {
      exports.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead.");
      return exports.Util.radToDeg(rad);
    },
    _getRotation(radians) {
      return Global_12.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;
    },
    _capitalize(str) {
      return str.charAt(0).toUpperCase() + str.slice(1);
    },
    throw(str) {
      throw new Error(KONVA_ERROR + str);
    },
    error(str) {
      console.error(KONVA_ERROR + str);
    },
    warn(str) {
      if (!Global_12.Konva.showWarnings) {
        return;
      }
      console.warn(KONVA_WARNING + str);
    },
    each(obj, func) {
      for (var key in obj) {
        func(key, obj[key]);
      }
    },
    _inRange(val, left2, right2) {
      return left2 <= val && val < right2;
    },
    _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {
      var x4, y4, dist;
      var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
      if (pd2 == 0) {
        x4 = x1;
        y4 = y1;
        dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);
      } else {
        var u2 = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;
        if (u2 < 0) {
          x4 = x1;
          y4 = y1;
          dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);
        } else if (u2 > 1) {
          x4 = x2;
          y4 = y2;
          dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
        } else {
          x4 = x1 + u2 * (x2 - x1);
          y4 = y1 + u2 * (y2 - y1);
          dist = (x4 - x3) * (x4 - x3) + (y4 - y3) * (y4 - y3);
        }
      }
      return [x4, y4, dist];
    },
    _getProjectionToLine(pt, line, isClosed) {
      var pc2 = exports.Util.cloneObject(pt);
      var dist = Number.MAX_VALUE;
      line.forEach(function(p1, i) {
        if (!isClosed && i === line.length - 1) {
          return;
        }
        var p2 = line[(i + 1) % line.length];
        var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);
        var px = proj[0], py = proj[1], pdist = proj[2];
        if (pdist < dist) {
          pc2.x = px;
          pc2.y = py;
          dist = pdist;
        }
      });
      return pc2;
    },
    _prepareArrayForTween(startArray, endArray, isClosed) {
      var n2, start2 = [], end2 = [];
      if (startArray.length > endArray.length) {
        var temp = endArray;
        endArray = startArray;
        startArray = temp;
      }
      for (n2 = 0; n2 < startArray.length; n2 += 2) {
        start2.push({
          x: startArray[n2],
          y: startArray[n2 + 1]
        });
      }
      for (n2 = 0; n2 < endArray.length; n2 += 2) {
        end2.push({
          x: endArray[n2],
          y: endArray[n2 + 1]
        });
      }
      var newStart = [];
      end2.forEach(function(point) {
        var pr = exports.Util._getProjectionToLine(point, start2, isClosed);
        newStart.push(pr.x);
        newStart.push(pr.y);
      });
      return newStart;
    },
    _prepareToStringify(obj) {
      var desc;
      obj.visitedByCircularReferenceRemoval = true;
      for (var key in obj) {
        if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == "object")) {
          continue;
        }
        desc = Object.getOwnPropertyDescriptor(obj, key);
        if (obj[key].visitedByCircularReferenceRemoval || exports.Util._isElement(obj[key])) {
          if (desc.configurable) {
            delete obj[key];
          } else {
            return null;
          }
        } else if (exports.Util._prepareToStringify(obj[key]) === null) {
          if (desc.configurable) {
            delete obj[key];
          } else {
            return null;
          }
        }
      }
      delete obj.visitedByCircularReferenceRemoval;
      return obj;
    },
    _assign(target, source) {
      for (var key in source) {
        target[key] = source[key];
      }
      return target;
    },
    _getFirstPointerId(evt) {
      if (!evt.touches) {
        return evt.pointerId || 999;
      } else {
        return evt.changedTouches[0].identifier;
      }
    },
    releaseCanvas(...canvases) {
      if (!Global_12.Konva.releaseCanvasOnDestroy)
        return;
      canvases.forEach((c2) => {
        c2.width = 0;
        c2.height = 0;
      });
    },
    drawRoundedRectPath(context, width, height, cornerRadius) {
      let topLeft = 0;
      let topRight = 0;
      let bottomLeft = 0;
      let bottomRight = 0;
      if (typeof cornerRadius === "number") {
        topLeft = topRight = bottomLeft = bottomRight = Math.min(cornerRadius, width / 2, height / 2);
      } else {
        topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);
        topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);
        bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);
        bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);
      }
      context.moveTo(topLeft, 0);
      context.lineTo(width - topRight, 0);
      context.arc(width - topRight, topRight, topRight, Math.PI * 3 / 2, 0, false);
      context.lineTo(width, height - bottomRight);
      context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);
      context.lineTo(bottomLeft, height);
      context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);
      context.lineTo(0, topLeft);
      context.arc(topLeft, topLeft, topLeft, Math.PI, Math.PI * 3 / 2, false);
    }
  };
})(Util$1);
var Node$3 = {};
var Factory$1 = {};
var Validators$1 = {};
Object.defineProperty(Validators$1, "__esModule", { value: true });
Validators$1.getComponentValidator = Validators$1.getBooleanValidator = Validators$1.getNumberArrayValidator = Validators$1.getFunctionValidator = Validators$1.getStringOrGradientValidator = Validators$1.getStringValidator = Validators$1.getNumberOrAutoValidator = Validators$1.getNumberOrArrayOfNumbersValidator = Validators$1.getNumberValidator = Validators$1.alphaComponent = Validators$1.RGBComponent = void 0;
const Global_1$P = Global$1;
const Util_1$v = Util$1;
function _formatValue$1(val) {
  if (Util_1$v.Util._isString(val)) {
    return '"' + val + '"';
  }
  if (Object.prototype.toString.call(val) === "[object Number]") {
    return val;
  }
  if (Util_1$v.Util._isBoolean(val)) {
    return val;
  }
  return Object.prototype.toString.call(val);
}
function RGBComponent$1(val) {
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  }
  return Math.round(val);
}
Validators$1.RGBComponent = RGBComponent$1;
function alphaComponent$1(val) {
  if (val > 1) {
    return 1;
  } else if (val < 1e-4) {
    return 1e-4;
  }
  return val;
}
Validators$1.alphaComponent = alphaComponent$1;
function getNumberValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$v.Util._isNumber(val)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number.');
      }
      return val;
    };
  }
}
Validators$1.getNumberValidator = getNumberValidator$1;
function getNumberOrArrayOfNumbersValidator$1(noOfElements) {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      let isNumber = Util_1$v.Util._isNumber(val);
      let isValidArray = Util_1$v.Util._isArray(val) && val.length == noOfElements;
      if (!isNumber && !isValidArray) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number or Array<number>(' + noOfElements + ")");
      }
      return val;
    };
  }
}
Validators$1.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator$1;
function getNumberOrAutoValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      var isNumber = Util_1$v.Util._isNumber(val);
      var isAuto = val === "auto";
      if (!(isNumber || isAuto)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number or "auto".');
      }
      return val;
    };
  }
}
Validators$1.getNumberOrAutoValidator = getNumberOrAutoValidator$1;
function getStringValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$v.Util._isString(val)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a string.');
      }
      return val;
    };
  }
}
Validators$1.getStringValidator = getStringValidator$1;
function getStringOrGradientValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      const isString = Util_1$v.Util._isString(val);
      const isGradient = Object.prototype.toString.call(val) === "[object CanvasGradient]" || val && val.addColorStop;
      if (!(isString || isGradient)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a string or a native gradient.');
      }
      return val;
    };
  }
}
Validators$1.getStringOrGradientValidator = getStringOrGradientValidator$1;
function getFunctionValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$v.Util._isFunction(val)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a function.');
      }
      return val;
    };
  }
}
Validators$1.getFunctionValidator = getFunctionValidator$1;
function getNumberArrayValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
      if (TypedArray && val instanceof TypedArray) {
        return val;
      }
      if (!Util_1$v.Util._isArray(val)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a array of numbers.');
      } else {
        val.forEach(function(item) {
          if (!Util_1$v.Util._isNumber(item)) {
            Util_1$v.Util.warn('"' + attr + '" attribute has non numeric element ' + item + ". Make sure that all elements are numbers.");
          }
        });
      }
      return val;
    };
  }
}
Validators$1.getNumberArrayValidator = getNumberArrayValidator$1;
function getBooleanValidator$1() {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      var isBool = val === true || val === false;
      if (!isBool) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a boolean.');
      }
      return val;
    };
  }
}
Validators$1.getBooleanValidator = getBooleanValidator$1;
function getComponentValidator$1(components) {
  if (Global_1$P.Konva.isUnminified) {
    return function(val, attr) {
      if (val === void 0 || val === null) {
        return val;
      }
      if (!Util_1$v.Util.isObject(val)) {
        Util_1$v.Util.warn(_formatValue$1(val) + ' is a not valid value for "' + attr + '" attribute. The value should be an object with properties ' + components);
      }
      return val;
    };
  }
}
Validators$1.getComponentValidator = getComponentValidator$1;
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Factory = void 0;
  const Util_12 = Util$1;
  const Validators_12 = Validators$1;
  var GET = "get", SET2 = "set";
  exports.Factory = {
    addGetterSetter(constructor, attr, def, validator, after) {
      exports.Factory.addGetter(constructor, attr, def);
      exports.Factory.addSetter(constructor, attr, validator, after);
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    addGetter(constructor, attr, def) {
      var method = GET + Util_12.Util._capitalize(attr);
      constructor.prototype[method] = constructor.prototype[method] || function() {
        var val = this.attrs[attr];
        return val === void 0 ? def : val;
      };
    },
    addSetter(constructor, attr, validator, after) {
      var method = SET2 + Util_12.Util._capitalize(attr);
      if (!constructor.prototype[method]) {
        exports.Factory.overWriteSetter(constructor, attr, validator, after);
      }
    },
    overWriteSetter(constructor, attr, validator, after) {
      var method = SET2 + Util_12.Util._capitalize(attr);
      constructor.prototype[method] = function(val) {
        if (validator && val !== void 0 && val !== null) {
          val = validator.call(this, val, attr);
        }
        this._setAttr(attr, val);
        if (after) {
          after.call(this);
        }
        return this;
      };
    },
    addComponentsGetterSetter(constructor, attr, components, validator, after) {
      var len = components.length, capitalize = Util_12.Util._capitalize, getter = GET + capitalize(attr), setter = SET2 + capitalize(attr), n2, component;
      constructor.prototype[getter] = function() {
        var ret = {};
        for (n2 = 0; n2 < len; n2++) {
          component = components[n2];
          ret[component] = this.getAttr(attr + capitalize(component));
        }
        return ret;
      };
      var basicValidator = (0, Validators_12.getComponentValidator)(components);
      constructor.prototype[setter] = function(val) {
        var oldVal = this.attrs[attr], key;
        if (validator) {
          val = validator.call(this, val);
        }
        if (basicValidator) {
          basicValidator.call(this, val, attr);
        }
        for (key in val) {
          if (!val.hasOwnProperty(key)) {
            continue;
          }
          this._setAttr(attr + capitalize(key), val[key]);
        }
        if (!val) {
          components.forEach((component2) => {
            this._setAttr(attr + capitalize(component2), void 0);
          });
        }
        this._fireChangeEvent(attr, oldVal, val);
        if (after) {
          after.call(this);
        }
        return this;
      };
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    addOverloadedGetterSetter(constructor, attr) {
      var capitalizedAttr = Util_12.Util._capitalize(attr), setter = SET2 + capitalizedAttr, getter = GET + capitalizedAttr;
      constructor.prototype[attr] = function() {
        if (arguments.length) {
          this[setter](arguments[0]);
          return this;
        }
        return this[getter]();
      };
    },
    addDeprecatedGetterSetter(constructor, attr, def, validator) {
      Util_12.Util.error("Adding deprecated " + attr);
      var method = GET + Util_12.Util._capitalize(attr);
      var message = attr + " property is deprecated and will be removed soon. Look at Konva change log for more information.";
      constructor.prototype[method] = function() {
        Util_12.Util.error(message);
        var val = this.attrs[attr];
        return val === void 0 ? def : val;
      };
      exports.Factory.addSetter(constructor, attr, validator, function() {
        Util_12.Util.error(message);
      });
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    backCompat(constructor, methods) {
      Util_12.Util.each(methods, function(oldMethodName, newMethodName) {
        var method = constructor.prototype[newMethodName];
        var oldGetter = GET + Util_12.Util._capitalize(oldMethodName);
        var oldSetter = SET2 + Util_12.Util._capitalize(oldMethodName);
        function deprecated() {
          method.apply(this, arguments);
          Util_12.Util.error('"' + oldMethodName + '" method is deprecated and will be removed soon. Use ""' + newMethodName + '" instead.');
        }
        constructor.prototype[oldMethodName] = deprecated;
        constructor.prototype[oldGetter] = deprecated;
        constructor.prototype[oldSetter] = deprecated;
      });
    },
    afterSetFilter() {
      this._filterUpToDate = false;
    }
  };
})(Factory$1);
var Canvas$3 = {};
var Context$3 = {};
Object.defineProperty(Context$3, "__esModule", { value: true });
Context$3.HitContext = Context$3.SceneContext = Context$3.Context = void 0;
const Util_1$u = Util$1;
const Global_1$O = Global$1;
function simplifyArray$1(arr) {
  var retArr = [], len = arr.length, util = Util_1$u.Util, n2, val;
  for (n2 = 0; n2 < len; n2++) {
    val = arr[n2];
    if (util._isNumber(val)) {
      val = Math.round(val * 1e3) / 1e3;
    } else if (!util._isString(val)) {
      val = val + "";
    }
    retArr.push(val);
  }
  return retArr;
}
var COMMA$1 = ",", OPEN_PAREN$1 = "(", CLOSE_PAREN$1 = ")", OPEN_PAREN_BRACKET$1 = "([", CLOSE_BRACKET_PAREN$1 = "])", SEMICOLON$1 = ";", DOUBLE_PAREN$1 = "()", EQUALS$1 = "=", CONTEXT_METHODS$1 = [
  "arc",
  "arcTo",
  "beginPath",
  "bezierCurveTo",
  "clearRect",
  "clip",
  "closePath",
  "createLinearGradient",
  "createPattern",
  "createRadialGradient",
  "drawImage",
  "ellipse",
  "fill",
  "fillText",
  "getImageData",
  "createImageData",
  "lineTo",
  "moveTo",
  "putImageData",
  "quadraticCurveTo",
  "rect",
  "roundRect",
  "restore",
  "rotate",
  "save",
  "scale",
  "setLineDash",
  "setTransform",
  "stroke",
  "strokeText",
  "transform",
  "translate"
];
var CONTEXT_PROPERTIES$1 = [
  "fillStyle",
  "strokeStyle",
  "shadowColor",
  "shadowBlur",
  "shadowOffsetX",
  "shadowOffsetY",
  "letterSpacing",
  "lineCap",
  "lineDashOffset",
  "lineJoin",
  "lineWidth",
  "miterLimit",
  "direction",
  "font",
  "textAlign",
  "textBaseline",
  "globalAlpha",
  "globalCompositeOperation",
  "imageSmoothingEnabled"
];
const traceArrMax$1 = 100;
let Context$2 = class Context {
  constructor(canvas) {
    this.canvas = canvas;
    if (Global_1$O.Konva.enableTrace) {
      this.traceArr = [];
      this._enableTrace();
    }
  }
  fillShape(shape) {
    if (shape.fillEnabled()) {
      this._fill(shape);
    }
  }
  _fill(shape) {
  }
  strokeShape(shape) {
    if (shape.hasStroke()) {
      this._stroke(shape);
    }
  }
  _stroke(shape) {
  }
  fillStrokeShape(shape) {
    if (shape.attrs.fillAfterStrokeEnabled) {
      this.strokeShape(shape);
      this.fillShape(shape);
    } else {
      this.fillShape(shape);
      this.strokeShape(shape);
    }
  }
  getTrace(relaxed, rounded) {
    var traceArr = this.traceArr, len = traceArr.length, str = "", n2, trace, method, args;
    for (n2 = 0; n2 < len; n2++) {
      trace = traceArr[n2];
      method = trace.method;
      if (method) {
        args = trace.args;
        str += method;
        if (relaxed) {
          str += DOUBLE_PAREN$1;
        } else {
          if (Util_1$u.Util._isArray(args[0])) {
            str += OPEN_PAREN_BRACKET$1 + args.join(COMMA$1) + CLOSE_BRACKET_PAREN$1;
          } else {
            if (rounded) {
              args = args.map((a) => typeof a === "number" ? Math.floor(a) : a);
            }
            str += OPEN_PAREN$1 + args.join(COMMA$1) + CLOSE_PAREN$1;
          }
        }
      } else {
        str += trace.property;
        if (!relaxed) {
          str += EQUALS$1 + trace.val;
        }
      }
      str += SEMICOLON$1;
    }
    return str;
  }
  clearTrace() {
    this.traceArr = [];
  }
  _trace(str) {
    var traceArr = this.traceArr, len;
    traceArr.push(str);
    len = traceArr.length;
    if (len >= traceArrMax$1) {
      traceArr.shift();
    }
  }
  reset() {
    var pixelRatio = this.getCanvas().getPixelRatio();
    this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);
  }
  getCanvas() {
    return this.canvas;
  }
  clear(bounds) {
    var canvas = this.getCanvas();
    if (bounds) {
      this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);
    } else {
      this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);
    }
  }
  _applyLineCap(shape) {
    const lineCap = shape.attrs.lineCap;
    if (lineCap) {
      this.setAttr("lineCap", lineCap);
    }
  }
  _applyOpacity(shape) {
    var absOpacity = shape.getAbsoluteOpacity();
    if (absOpacity !== 1) {
      this.setAttr("globalAlpha", absOpacity);
    }
  }
  _applyLineJoin(shape) {
    const lineJoin = shape.attrs.lineJoin;
    if (lineJoin) {
      this.setAttr("lineJoin", lineJoin);
    }
  }
  setAttr(attr, val) {
    this._context[attr] = val;
  }
  arc(x2, y2, radius, startAngle, endAngle, counterClockwise) {
    this._context.arc(x2, y2, radius, startAngle, endAngle, counterClockwise);
  }
  arcTo(x1, y1, x2, y2, radius) {
    this._context.arcTo(x1, y1, x2, y2, radius);
  }
  beginPath() {
    this._context.beginPath();
  }
  bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x2, y2) {
    this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x2, y2);
  }
  clearRect(x2, y2, width, height) {
    this._context.clearRect(x2, y2, width, height);
  }
  clip(...args) {
    this._context.clip.apply(this._context, args);
  }
  closePath() {
    this._context.closePath();
  }
  createImageData(width, height) {
    var a = arguments;
    if (a.length === 2) {
      return this._context.createImageData(width, height);
    } else if (a.length === 1) {
      return this._context.createImageData(width);
    }
  }
  createLinearGradient(x0, y0, x1, y1) {
    return this._context.createLinearGradient(x0, y0, x1, y1);
  }
  createPattern(image, repetition) {
    return this._context.createPattern(image, repetition);
  }
  createRadialGradient(x0, y0, r0, x1, y1, r1) {
    return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);
  }
  drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {
    var a = arguments, _context = this._context;
    if (a.length === 3) {
      _context.drawImage(image, sx, sy);
    } else if (a.length === 5) {
      _context.drawImage(image, sx, sy, sWidth, sHeight);
    } else if (a.length === 9) {
      _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
    }
  }
  ellipse(x2, y2, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {
    this._context.ellipse(x2, y2, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);
  }
  isPointInPath(x2, y2, path, fillRule) {
    if (path) {
      return this._context.isPointInPath(path, x2, y2, fillRule);
    }
    return this._context.isPointInPath(x2, y2, fillRule);
  }
  fill(...args) {
    this._context.fill.apply(this._context, args);
  }
  fillRect(x2, y2, width, height) {
    this._context.fillRect(x2, y2, width, height);
  }
  strokeRect(x2, y2, width, height) {
    this._context.strokeRect(x2, y2, width, height);
  }
  fillText(text, x2, y2, maxWidth) {
    if (maxWidth) {
      this._context.fillText(text, x2, y2, maxWidth);
    } else {
      this._context.fillText(text, x2, y2);
    }
  }
  measureText(text) {
    return this._context.measureText(text);
  }
  getImageData(sx, sy, sw, sh2) {
    return this._context.getImageData(sx, sy, sw, sh2);
  }
  lineTo(x2, y2) {
    this._context.lineTo(x2, y2);
  }
  moveTo(x2, y2) {
    this._context.moveTo(x2, y2);
  }
  rect(x2, y2, width, height) {
    this._context.rect(x2, y2, width, height);
  }
  roundRect(x2, y2, width, height, radii) {
    this._context.roundRect(x2, y2, width, height, radii);
  }
  putImageData(imageData, dx, dy) {
    this._context.putImageData(imageData, dx, dy);
  }
  quadraticCurveTo(cpx, cpy, x2, y2) {
    this._context.quadraticCurveTo(cpx, cpy, x2, y2);
  }
  restore() {
    this._context.restore();
  }
  rotate(angle) {
    this._context.rotate(angle);
  }
  save() {
    this._context.save();
  }
  scale(x2, y2) {
    this._context.scale(x2, y2);
  }
  setLineDash(segments) {
    if (this._context.setLineDash) {
      this._context.setLineDash(segments);
    } else if ("mozDash" in this._context) {
      this._context["mozDash"] = segments;
    } else if ("webkitLineDash" in this._context) {
      this._context["webkitLineDash"] = segments;
    }
  }
  getLineDash() {
    return this._context.getLineDash();
  }
  setTransform(a, b2, c2, d2, e2, f2) {
    this._context.setTransform(a, b2, c2, d2, e2, f2);
  }
  stroke(path2d) {
    if (path2d) {
      this._context.stroke(path2d);
    } else {
      this._context.stroke();
    }
  }
  strokeText(text, x2, y2, maxWidth) {
    this._context.strokeText(text, x2, y2, maxWidth);
  }
  transform(a, b2, c2, d2, e2, f2) {
    this._context.transform(a, b2, c2, d2, e2, f2);
  }
  translate(x2, y2) {
    this._context.translate(x2, y2);
  }
  _enableTrace() {
    var that = this, len = CONTEXT_METHODS$1.length, origSetter = this.setAttr, n2, args;
    var func = function(methodName) {
      var origMethod = that[methodName], ret;
      that[methodName] = function() {
        args = simplifyArray$1(Array.prototype.slice.call(arguments, 0));
        ret = origMethod.apply(that, arguments);
        that._trace({
          method: methodName,
          args
        });
        return ret;
      };
    };
    for (n2 = 0; n2 < len; n2++) {
      func(CONTEXT_METHODS$1[n2]);
    }
    that.setAttr = function() {
      origSetter.apply(that, arguments);
      var prop = arguments[0];
      var val = arguments[1];
      if (prop === "shadowOffsetX" || prop === "shadowOffsetY" || prop === "shadowBlur") {
        val = val / this.canvas.getPixelRatio();
      }
      that._trace({
        property: prop,
        val
      });
    };
  }
  _applyGlobalCompositeOperation(node) {
    const op = node.attrs.globalCompositeOperation;
    var def = !op || op === "source-over";
    if (!def) {
      this.setAttr("globalCompositeOperation", op);
    }
  }
};
Context$3.Context = Context$2;
CONTEXT_PROPERTIES$1.forEach(function(prop) {
  Object.defineProperty(Context$2.prototype, prop, {
    get() {
      return this._context[prop];
    },
    set(val) {
      this._context[prop] = val;
    }
  });
});
let SceneContext$1 = class SceneContext extends Context$2 {
  constructor(canvas, { willReadFrequently = false } = {}) {
    super(canvas);
    this._context = canvas._canvas.getContext("2d", {
      willReadFrequently
    });
  }
  _fillColor(shape) {
    var fill = shape.fill();
    this.setAttr("fillStyle", fill);
    shape._fillFunc(this);
  }
  _fillPattern(shape) {
    this.setAttr("fillStyle", shape._getFillPattern());
    shape._fillFunc(this);
  }
  _fillLinearGradient(shape) {
    var grd = shape._getLinearGradient();
    if (grd) {
      this.setAttr("fillStyle", grd);
      shape._fillFunc(this);
    }
  }
  _fillRadialGradient(shape) {
    const grd = shape._getRadialGradient();
    if (grd) {
      this.setAttr("fillStyle", grd);
      shape._fillFunc(this);
    }
  }
  _fill(shape) {
    const hasColor = shape.fill(), fillPriority = shape.getFillPriority();
    if (hasColor && fillPriority === "color") {
      this._fillColor(shape);
      return;
    }
    const hasPattern = shape.getFillPatternImage();
    if (hasPattern && fillPriority === "pattern") {
      this._fillPattern(shape);
      return;
    }
    const hasLinearGradient = shape.getFillLinearGradientColorStops();
    if (hasLinearGradient && fillPriority === "linear-gradient") {
      this._fillLinearGradient(shape);
      return;
    }
    const hasRadialGradient = shape.getFillRadialGradientColorStops();
    if (hasRadialGradient && fillPriority === "radial-gradient") {
      this._fillRadialGradient(shape);
      return;
    }
    if (hasColor) {
      this._fillColor(shape);
    } else if (hasPattern) {
      this._fillPattern(shape);
    } else if (hasLinearGradient) {
      this._fillLinearGradient(shape);
    } else if (hasRadialGradient) {
      this._fillRadialGradient(shape);
    }
  }
  _strokeLinearGradient(shape) {
    const start2 = shape.getStrokeLinearGradientStartPoint(), end2 = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start2.x, start2.y, end2.x, end2.y);
    if (colorStops) {
      for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
        grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
      }
      this.setAttr("strokeStyle", grd);
    }
  }
  _stroke(shape) {
    var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();
    if (shape.hasStroke()) {
      if (!strokeScaleEnabled) {
        this.save();
        var pixelRatio = this.getCanvas().getPixelRatio();
        this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
      }
      this._applyLineCap(shape);
      if (dash && shape.dashEnabled()) {
        this.setLineDash(dash);
        this.setAttr("lineDashOffset", shape.dashOffset());
      }
      this.setAttr("lineWidth", shape.strokeWidth());
      if (!shape.getShadowForStrokeEnabled()) {
        this.setAttr("shadowColor", "rgba(0,0,0,0)");
      }
      var hasLinearGradient = shape.getStrokeLinearGradientColorStops();
      if (hasLinearGradient) {
        this._strokeLinearGradient(shape);
      } else {
        this.setAttr("strokeStyle", shape.stroke());
      }
      shape._strokeFunc(this);
      if (!strokeScaleEnabled) {
        this.restore();
      }
    }
  }
  _applyShadow(shape) {
    var _a2, _b2, _c;
    var color = (_a2 = shape.getShadowRGBA()) !== null && _a2 !== void 0 ? _a2 : "black", blur = (_b2 = shape.getShadowBlur()) !== null && _b2 !== void 0 ? _b2 : 5, offset5 = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
      x: 0,
      y: 0
    }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
    this.setAttr("shadowColor", color);
    this.setAttr("shadowBlur", blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));
    this.setAttr("shadowOffsetX", offset5.x * scaleX);
    this.setAttr("shadowOffsetY", offset5.y * scaleY);
  }
};
Context$3.SceneContext = SceneContext$1;
let HitContext$1 = class HitContext extends Context$2 {
  constructor(canvas) {
    super(canvas);
    this._context = canvas._canvas.getContext("2d", {
      willReadFrequently: true
    });
  }
  _fill(shape) {
    this.save();
    this.setAttr("fillStyle", shape.colorKey);
    shape._fillFuncHit(this);
    this.restore();
  }
  strokeShape(shape) {
    if (shape.hasHitStroke()) {
      this._stroke(shape);
    }
  }
  _stroke(shape) {
    if (shape.hasHitStroke()) {
      const strokeScaleEnabled = shape.getStrokeScaleEnabled();
      if (!strokeScaleEnabled) {
        this.save();
        var pixelRatio = this.getCanvas().getPixelRatio();
        this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
      }
      this._applyLineCap(shape);
      var hitStrokeWidth = shape.hitStrokeWidth();
      var strokeWidth = hitStrokeWidth === "auto" ? shape.strokeWidth() : hitStrokeWidth;
      this.setAttr("lineWidth", strokeWidth);
      this.setAttr("strokeStyle", shape.colorKey);
      shape._strokeFuncHit(this);
      if (!strokeScaleEnabled) {
        this.restore();
      }
    }
  }
};
Context$3.HitContext = HitContext$1;
Object.defineProperty(Canvas$3, "__esModule", { value: true });
Canvas$3.HitCanvas = Canvas$3.SceneCanvas = Canvas$3.Canvas = void 0;
const Util_1$t = Util$1;
const Context_1$1 = Context$3;
const Global_1$N = Global$1;
const Factory_1$17 = Factory$1;
const Validators_1$15 = Validators$1;
var _pixelRatio$1;
function getDevicePixelRatio$1() {
  if (_pixelRatio$1) {
    return _pixelRatio$1;
  }
  var canvas = Util_1$t.Util.createCanvasElement();
  var context = canvas.getContext("2d");
  _pixelRatio$1 = function() {
    var devicePixelRatio = Global_1$N.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
    return devicePixelRatio / backingStoreRatio;
  }();
  Util_1$t.Util.releaseCanvas(canvas);
  return _pixelRatio$1;
}
let Canvas$2 = class Canvas {
  constructor(config) {
    this.pixelRatio = 1;
    this.width = 0;
    this.height = 0;
    this.isCache = false;
    var conf = config || {};
    var pixelRatio = conf.pixelRatio || Global_1$N.Konva.pixelRatio || getDevicePixelRatio$1();
    this.pixelRatio = pixelRatio;
    this._canvas = Util_1$t.Util.createCanvasElement();
    this._canvas.style.padding = "0";
    this._canvas.style.margin = "0";
    this._canvas.style.border = "0";
    this._canvas.style.background = "transparent";
    this._canvas.style.position = "absolute";
    this._canvas.style.top = "0";
    this._canvas.style.left = "0";
  }
  getContext() {
    return this.context;
  }
  getPixelRatio() {
    return this.pixelRatio;
  }
  setPixelRatio(pixelRatio) {
    var previousRatio = this.pixelRatio;
    this.pixelRatio = pixelRatio;
    this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);
  }
  setWidth(width) {
    this.width = this._canvas.width = width * this.pixelRatio;
    this._canvas.style.width = width + "px";
    var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    _context.scale(pixelRatio, pixelRatio);
  }
  setHeight(height) {
    this.height = this._canvas.height = height * this.pixelRatio;
    this._canvas.style.height = height + "px";
    var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    _context.scale(pixelRatio, pixelRatio);
  }
  getWidth() {
    return this.width;
  }
  getHeight() {
    return this.height;
  }
  setSize(width, height) {
    this.setWidth(width || 0);
    this.setHeight(height || 0);
  }
  toDataURL(mimeType, quality) {
    try {
      return this._canvas.toDataURL(mimeType, quality);
    } catch (e2) {
      try {
        return this._canvas.toDataURL();
      } catch (err) {
        Util_1$t.Util.error("Unable to get data URL. " + err.message + " For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.");
        return "";
      }
    }
  }
};
Canvas$3.Canvas = Canvas$2;
Factory_1$17.Factory.addGetterSetter(Canvas$2, "pixelRatio", void 0, (0, Validators_1$15.getNumberValidator)());
let SceneCanvas$1 = class SceneCanvas extends Canvas$2 {
  constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
    super(config);
    this.context = new Context_1$1.SceneContext(this, {
      willReadFrequently: config.willReadFrequently
    });
    this.setSize(config.width, config.height);
  }
};
Canvas$3.SceneCanvas = SceneCanvas$1;
let HitCanvas$1 = class HitCanvas extends Canvas$2 {
  constructor(config = { width: 0, height: 0 }) {
    super(config);
    this.hitCanvas = true;
    this.context = new Context_1$1.HitContext(this);
    this.setSize(config.width, config.height);
  }
};
Canvas$3.HitCanvas = HitCanvas$1;
var DragAndDrop$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DD = void 0;
  const Global_12 = Global$1;
  const Util_12 = Util$1;
  exports.DD = {
    get isDragging() {
      var flag = false;
      exports.DD._dragElements.forEach((elem) => {
        if (elem.dragStatus === "dragging") {
          flag = true;
        }
      });
      return flag;
    },
    justDragged: false,
    get node() {
      var node;
      exports.DD._dragElements.forEach((elem) => {
        node = elem.node;
      });
      return node;
    },
    _dragElements: /* @__PURE__ */ new Map(),
    _drag(evt) {
      const nodesToFireEvents = [];
      exports.DD._dragElements.forEach((elem, key) => {
        const { node } = elem;
        const stage = node.getStage();
        stage.setPointersPositions(evt);
        if (elem.pointerId === void 0) {
          elem.pointerId = Util_12.Util._getFirstPointerId(evt);
        }
        const pos = stage._changedPointerPositions.find((pos2) => pos2.id === elem.pointerId);
        if (!pos) {
          return;
        }
        if (elem.dragStatus !== "dragging") {
          var dragDistance = node.dragDistance();
          var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));
          if (distance < dragDistance) {
            return;
          }
          node.startDrag({ evt });
          if (!node.isDragging()) {
            return;
          }
        }
        node._setDragPosition(evt, elem);
        nodesToFireEvents.push(node);
      });
      nodesToFireEvents.forEach((node) => {
        node.fire("dragmove", {
          type: "dragmove",
          target: node,
          evt
        }, true);
      });
    },
    _endDragBefore(evt) {
      const drawNodes = [];
      exports.DD._dragElements.forEach((elem) => {
        const { node } = elem;
        const stage = node.getStage();
        if (evt) {
          stage.setPointersPositions(evt);
        }
        const pos = stage._changedPointerPositions.find((pos2) => pos2.id === elem.pointerId);
        if (!pos) {
          return;
        }
        if (elem.dragStatus === "dragging" || elem.dragStatus === "stopped") {
          exports.DD.justDragged = true;
          Global_12.Konva._mouseListenClick = false;
          Global_12.Konva._touchListenClick = false;
          Global_12.Konva._pointerListenClick = false;
          elem.dragStatus = "stopped";
        }
        const drawNode = elem.node.getLayer() || elem.node instanceof Global_12.Konva["Stage"] && elem.node;
        if (drawNode && drawNodes.indexOf(drawNode) === -1) {
          drawNodes.push(drawNode);
        }
      });
      drawNodes.forEach((drawNode) => {
        drawNode.draw();
      });
    },
    _endDragAfter(evt) {
      exports.DD._dragElements.forEach((elem, key) => {
        if (elem.dragStatus === "stopped") {
          elem.node.fire("dragend", {
            type: "dragend",
            target: elem.node,
            evt
          }, true);
        }
        if (elem.dragStatus !== "dragging") {
          exports.DD._dragElements.delete(key);
        }
      });
    }
  };
  if (Global_12.Konva.isBrowser) {
    window.addEventListener("mouseup", exports.DD._endDragBefore, true);
    window.addEventListener("touchend", exports.DD._endDragBefore, true);
    window.addEventListener("mousemove", exports.DD._drag);
    window.addEventListener("touchmove", exports.DD._drag);
    window.addEventListener("mouseup", exports.DD._endDragAfter, false);
    window.addEventListener("touchend", exports.DD._endDragAfter, false);
  }
})(DragAndDrop$1);
Object.defineProperty(Node$3, "__esModule", { value: true });
Node$3.Node = void 0;
const Util_1$s = Util$1;
const Factory_1$16 = Factory$1;
const Canvas_1$3 = Canvas$3;
const Global_1$M = Global$1;
const DragAndDrop_1$1 = DragAndDrop$1;
const Validators_1$14 = Validators$1;
var ABSOLUTE_OPACITY$1 = "absoluteOpacity", ALL_LISTENERS$1 = "allEventListeners", ABSOLUTE_TRANSFORM$1 = "absoluteTransform", ABSOLUTE_SCALE$1 = "absoluteScale", CANVAS$1 = "canvas", CHANGE$1 = "Change", CHILDREN$1 = "children", KONVA$1 = "konva", LISTENING$1 = "listening", MOUSEENTER$1 = "mouseenter", MOUSELEAVE$1 = "mouseleave", SET$1 = "set", SHAPE$1 = "Shape", SPACE$3 = " ", STAGE$1 = "stage", TRANSFORM$1 = "transform", UPPER_STAGE$1 = "Stage", VISIBLE$1 = "visible", TRANSFORM_CHANGE_STR$3 = [
  "xChange.konva",
  "yChange.konva",
  "scaleXChange.konva",
  "scaleYChange.konva",
  "skewXChange.konva",
  "skewYChange.konva",
  "rotationChange.konva",
  "offsetXChange.konva",
  "offsetYChange.konva",
  "transformsEnabledChange.konva"
].join(SPACE$3);
let idCounter$1 = 1;
let Node$2 = class Node {
  constructor(config) {
    this._id = idCounter$1++;
    this.eventListeners = {};
    this.attrs = {};
    this.index = 0;
    this._allEventListeners = null;
    this.parent = null;
    this._cache = /* @__PURE__ */ new Map();
    this._attachedDepsListeners = /* @__PURE__ */ new Map();
    this._lastPos = null;
    this._batchingTransformChange = false;
    this._needClearTransformCache = false;
    this._filterUpToDate = false;
    this._isUnderCache = false;
    this._dragEventId = null;
    this._shouldFireChangeEvents = false;
    this.setAttrs(config);
    this._shouldFireChangeEvents = true;
  }
  hasChildren() {
    return false;
  }
  _clearCache(attr) {
    if ((attr === TRANSFORM$1 || attr === ABSOLUTE_TRANSFORM$1) && this._cache.get(attr)) {
      this._cache.get(attr).dirty = true;
    } else if (attr) {
      this._cache.delete(attr);
    } else {
      this._cache.clear();
    }
  }
  _getCache(attr, privateGetter) {
    var cache = this._cache.get(attr);
    var isTransform = attr === TRANSFORM$1 || attr === ABSOLUTE_TRANSFORM$1;
    var invalid = cache === void 0 || isTransform && cache.dirty === true;
    if (invalid) {
      cache = privateGetter.call(this);
      this._cache.set(attr, cache);
    }
    return cache;
  }
  _calculate(name, deps, getter) {
    if (!this._attachedDepsListeners.get(name)) {
      const depsString = deps.map((dep) => dep + "Change.konva").join(SPACE$3);
      this.on(depsString, () => {
        this._clearCache(name);
      });
      this._attachedDepsListeners.set(name, true);
    }
    return this._getCache(name, getter);
  }
  _getCanvasCache() {
    return this._cache.get(CANVAS$1);
  }
  _clearSelfAndDescendantCache(attr) {
    this._clearCache(attr);
    if (attr === ABSOLUTE_TRANSFORM$1) {
      this.fire("absoluteTransformChange");
    }
  }
  clearCache() {
    if (this._cache.has(CANVAS$1)) {
      const { scene, filter, hit } = this._cache.get(CANVAS$1);
      Util_1$s.Util.releaseCanvas(scene, filter, hit);
      this._cache.delete(CANVAS$1);
    }
    this._clearSelfAndDescendantCache();
    this._requestDraw();
    return this;
  }
  cache(config) {
    var conf = config || {};
    var rect = {};
    if (conf.x === void 0 || conf.y === void 0 || conf.width === void 0 || conf.height === void 0) {
      rect = this.getClientRect({
        skipTransform: true,
        relativeTo: this.getParent() || void 0
      });
    }
    var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x2 = conf.x === void 0 ? Math.floor(rect.x) : conf.x, y2 = conf.y === void 0 ? Math.floor(rect.y) : conf.y, offset5 = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;
    if (!width || !height) {
      Util_1$s.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");
      return;
    }
    const extraPaddingX = Math.abs(Math.round(rect.x) - x2) > 0.5 ? 1 : 0;
    const extraPaddingY = Math.abs(Math.round(rect.y) - y2) > 0.5 ? 1 : 0;
    width += offset5 * 2 + extraPaddingX;
    height += offset5 * 2 + extraPaddingY;
    x2 -= offset5;
    y2 -= offset5;
    var cachedSceneCanvas = new Canvas_1$3.SceneCanvas({
      pixelRatio,
      width,
      height
    }), cachedFilterCanvas = new Canvas_1$3.SceneCanvas({
      pixelRatio,
      width: 0,
      height: 0,
      willReadFrequently: true
    }), cachedHitCanvas = new Canvas_1$3.HitCanvas({
      pixelRatio: hitCanvasPixelRatio,
      width,
      height
    }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();
    cachedHitCanvas.isCache = true;
    cachedSceneCanvas.isCache = true;
    this._cache.delete(CANVAS$1);
    this._filterUpToDate = false;
    if (conf.imageSmoothingEnabled === false) {
      cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;
      cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;
    }
    sceneContext.save();
    hitContext.save();
    sceneContext.translate(-x2, -y2);
    hitContext.translate(-x2, -y2);
    this._isUnderCache = true;
    this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY$1);
    this._clearSelfAndDescendantCache(ABSOLUTE_SCALE$1);
    this.drawScene(cachedSceneCanvas, this);
    this.drawHit(cachedHitCanvas, this);
    this._isUnderCache = false;
    sceneContext.restore();
    hitContext.restore();
    if (drawBorder) {
      sceneContext.save();
      sceneContext.beginPath();
      sceneContext.rect(0, 0, width, height);
      sceneContext.closePath();
      sceneContext.setAttr("strokeStyle", "red");
      sceneContext.setAttr("lineWidth", 5);
      sceneContext.stroke();
      sceneContext.restore();
    }
    this._cache.set(CANVAS$1, {
      scene: cachedSceneCanvas,
      filter: cachedFilterCanvas,
      hit: cachedHitCanvas,
      x: x2,
      y: y2
    });
    this._requestDraw();
    return this;
  }
  isCached() {
    return this._cache.has(CANVAS$1);
  }
  getClientRect(config) {
    throw new Error('abstract "getClientRect" method call');
  }
  _transformedRect(rect, top2) {
    var points = [
      { x: rect.x, y: rect.y },
      { x: rect.x + rect.width, y: rect.y },
      { x: rect.x + rect.width, y: rect.y + rect.height },
      { x: rect.x, y: rect.y + rect.height }
    ];
    var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
    var trans = this.getAbsoluteTransform(top2);
    points.forEach(function(point) {
      var transformed = trans.point(point);
      if (minX === void 0) {
        minX = maxX = transformed.x;
        minY = maxY = transformed.y;
      }
      minX = Math.min(minX, transformed.x);
      minY = Math.min(minY, transformed.y);
      maxX = Math.max(maxX, transformed.x);
      maxY = Math.max(maxY, transformed.y);
    });
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  _drawCachedSceneCanvas(context) {
    context.save();
    context._applyOpacity(this);
    context._applyGlobalCompositeOperation(this);
    const canvasCache = this._getCanvasCache();
    context.translate(canvasCache.x, canvasCache.y);
    var cacheCanvas = this._getCachedSceneCanvas();
    var ratio = cacheCanvas.pixelRatio;
    context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);
    context.restore();
  }
  _drawCachedHitCanvas(context) {
    var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;
    context.save();
    context.translate(canvasCache.x, canvasCache.y);
    context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);
    context.restore();
  }
  _getCachedSceneCanvas() {
    var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n2, filter;
    if (filters) {
      if (!this._filterUpToDate) {
        var ratio = sceneCanvas.pixelRatio;
        filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);
        try {
          len = filters.length;
          filterContext.clear();
          filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);
          imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());
          for (n2 = 0; n2 < len; n2++) {
            filter = filters[n2];
            if (typeof filter !== "function") {
              Util_1$s.Util.error("Filter should be type of function, but got " + typeof filter + " instead. Please check correct filters");
              continue;
            }
            filter.call(this, imageData);
            filterContext.putImageData(imageData, 0, 0);
          }
        } catch (e2) {
          Util_1$s.Util.error("Unable to apply filter. " + e2.message + " This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.");
        }
        this._filterUpToDate = true;
      }
      return filterCanvas;
    }
    return sceneCanvas;
  }
  on(evtStr, handler) {
    this._cache && this._cache.delete(ALL_LISTENERS$1);
    if (arguments.length === 3) {
      return this._delegate.apply(this, arguments);
    }
    var events = evtStr.split(SPACE$3), len = events.length, n2, event, parts, baseEvent, name;
    for (n2 = 0; n2 < len; n2++) {
      event = events[n2];
      parts = event.split(".");
      baseEvent = parts[0];
      name = parts[1] || "";
      if (!this.eventListeners[baseEvent]) {
        this.eventListeners[baseEvent] = [];
      }
      this.eventListeners[baseEvent].push({
        name,
        handler
      });
    }
    return this;
  }
  off(evtStr, callback) {
    var events = (evtStr || "").split(SPACE$3), len = events.length, n2, t2, event, parts, baseEvent, name;
    this._cache && this._cache.delete(ALL_LISTENERS$1);
    if (!evtStr) {
      for (t2 in this.eventListeners) {
        this._off(t2);
      }
    }
    for (n2 = 0; n2 < len; n2++) {
      event = events[n2];
      parts = event.split(".");
      baseEvent = parts[0];
      name = parts[1];
      if (baseEvent) {
        if (this.eventListeners[baseEvent]) {
          this._off(baseEvent, name, callback);
        }
      } else {
        for (t2 in this.eventListeners) {
          this._off(t2, name, callback);
        }
      }
    }
    return this;
  }
  dispatchEvent(evt) {
    var e2 = {
      target: this,
      type: evt.type,
      evt
    };
    this.fire(evt.type, e2);
    return this;
  }
  addEventListener(type, handler) {
    this.on(type, function(evt) {
      handler.call(this, evt.evt);
    });
    return this;
  }
  removeEventListener(type) {
    this.off(type);
    return this;
  }
  _delegate(event, selector, handler) {
    var stopNode = this;
    this.on(event, function(evt) {
      var targets = evt.target.findAncestors(selector, true, stopNode);
      for (var i = 0; i < targets.length; i++) {
        evt = Util_1$s.Util.cloneObject(evt);
        evt.currentTarget = targets[i];
        handler.call(targets[i], evt);
      }
    });
  }
  remove() {
    if (this.isDragging()) {
      this.stopDrag();
    }
    DragAndDrop_1$1.DD._dragElements.delete(this._id);
    this._remove();
    return this;
  }
  _clearCaches() {
    this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM$1);
    this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY$1);
    this._clearSelfAndDescendantCache(ABSOLUTE_SCALE$1);
    this._clearSelfAndDescendantCache(STAGE$1);
    this._clearSelfAndDescendantCache(VISIBLE$1);
    this._clearSelfAndDescendantCache(LISTENING$1);
  }
  _remove() {
    this._clearCaches();
    var parent = this.getParent();
    if (parent && parent.children) {
      parent.children.splice(this.index, 1);
      parent._setChildrenIndices();
      this.parent = null;
    }
  }
  destroy() {
    this.remove();
    this.clearCache();
    return this;
  }
  getAttr(attr) {
    var method = "get" + Util_1$s.Util._capitalize(attr);
    if (Util_1$s.Util._isFunction(this[method])) {
      return this[method]();
    }
    return this.attrs[attr];
  }
  getAncestors() {
    var parent = this.getParent(), ancestors = [];
    while (parent) {
      ancestors.push(parent);
      parent = parent.getParent();
    }
    return ancestors;
  }
  getAttrs() {
    return this.attrs || {};
  }
  setAttrs(config) {
    this._batchTransformChanges(() => {
      var key, method;
      if (!config) {
        return this;
      }
      for (key in config) {
        if (key === CHILDREN$1) {
          continue;
        }
        method = SET$1 + Util_1$s.Util._capitalize(key);
        if (Util_1$s.Util._isFunction(this[method])) {
          this[method](config[key]);
        } else {
          this._setAttr(key, config[key]);
        }
      }
    });
    return this;
  }
  isListening() {
    return this._getCache(LISTENING$1, this._isListening);
  }
  _isListening(relativeTo) {
    const listening = this.listening();
    if (!listening) {
      return false;
    }
    const parent = this.getParent();
    if (parent && parent !== relativeTo && this !== relativeTo) {
      return parent._isListening(relativeTo);
    } else {
      return true;
    }
  }
  isVisible() {
    return this._getCache(VISIBLE$1, this._isVisible);
  }
  _isVisible(relativeTo) {
    const visible = this.visible();
    if (!visible) {
      return false;
    }
    const parent = this.getParent();
    if (parent && parent !== relativeTo && this !== relativeTo) {
      return parent._isVisible(relativeTo);
    } else {
      return true;
    }
  }
  shouldDrawHit(top2, skipDragCheck = false) {
    if (top2) {
      return this._isVisible(top2) && this._isListening(top2);
    }
    var layer = this.getLayer();
    var layerUnderDrag = false;
    DragAndDrop_1$1.DD._dragElements.forEach((elem) => {
      if (elem.dragStatus !== "dragging") {
        return;
      } else if (elem.node.nodeType === "Stage") {
        layerUnderDrag = true;
      } else if (elem.node.getLayer() === layer) {
        layerUnderDrag = true;
      }
    });
    var dragSkip = !skipDragCheck && !Global_1$M.Konva.hitOnDragEnabled && (layerUnderDrag || Global_1$M.Konva.isTransforming());
    return this.isListening() && this.isVisible() && !dragSkip;
  }
  show() {
    this.visible(true);
    return this;
  }
  hide() {
    this.visible(false);
    return this;
  }
  getZIndex() {
    return this.index || 0;
  }
  getAbsoluteZIndex() {
    var depth = this.getDepth(), that = this, index = 0, nodes, len, n2, child;
    function addChildren(children) {
      nodes = [];
      len = children.length;
      for (n2 = 0; n2 < len; n2++) {
        child = children[n2];
        index++;
        if (child.nodeType !== SHAPE$1) {
          nodes = nodes.concat(child.getChildren().slice());
        }
        if (child._id === that._id) {
          n2 = len;
        }
      }
      if (nodes.length > 0 && nodes[0].getDepth() <= depth) {
        addChildren(nodes);
      }
    }
    const stage = this.getStage();
    if (that.nodeType !== UPPER_STAGE$1 && stage) {
      addChildren(stage.getChildren());
    }
    return index;
  }
  getDepth() {
    var depth = 0, parent = this.parent;
    while (parent) {
      depth++;
      parent = parent.parent;
    }
    return depth;
  }
  _batchTransformChanges(func) {
    this._batchingTransformChange = true;
    func();
    this._batchingTransformChange = false;
    if (this._needClearTransformCache) {
      this._clearCache(TRANSFORM$1);
      this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM$1);
    }
    this._needClearTransformCache = false;
  }
  setPosition(pos) {
    this._batchTransformChanges(() => {
      this.x(pos.x);
      this.y(pos.y);
    });
    return this;
  }
  getPosition() {
    return {
      x: this.x(),
      y: this.y()
    };
  }
  getRelativePointerPosition() {
    const stage = this.getStage();
    if (!stage) {
      return null;
    }
    var pos = stage.getPointerPosition();
    if (!pos) {
      return null;
    }
    var transform = this.getAbsoluteTransform().copy();
    transform.invert();
    return transform.point(pos);
  }
  getAbsolutePosition(top2) {
    let haveCachedParent = false;
    let parent = this.parent;
    while (parent) {
      if (parent.isCached()) {
        haveCachedParent = true;
        break;
      }
      parent = parent.parent;
    }
    if (haveCachedParent && !top2) {
      top2 = true;
    }
    var absoluteMatrix = this.getAbsoluteTransform(top2).getMatrix(), absoluteTransform = new Util_1$s.Transform(), offset5 = this.offset();
    absoluteTransform.m = absoluteMatrix.slice();
    absoluteTransform.translate(offset5.x, offset5.y);
    return absoluteTransform.getTranslation();
  }
  setAbsolutePosition(pos) {
    const { x: x2, y: y2, ...origTrans } = this._clearTransform();
    this.attrs.x = x2;
    this.attrs.y = y2;
    this._clearCache(TRANSFORM$1);
    var it = this._getAbsoluteTransform().copy();
    it.invert();
    it.translate(pos.x, pos.y);
    pos = {
      x: this.attrs.x + it.getTranslation().x,
      y: this.attrs.y + it.getTranslation().y
    };
    this._setTransform(origTrans);
    this.setPosition({ x: pos.x, y: pos.y });
    this._clearCache(TRANSFORM$1);
    this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM$1);
    return this;
  }
  _setTransform(trans) {
    var key;
    for (key in trans) {
      this.attrs[key] = trans[key];
    }
  }
  _clearTransform() {
    var trans = {
      x: this.x(),
      y: this.y(),
      rotation: this.rotation(),
      scaleX: this.scaleX(),
      scaleY: this.scaleY(),
      offsetX: this.offsetX(),
      offsetY: this.offsetY(),
      skewX: this.skewX(),
      skewY: this.skewY()
    };
    this.attrs.x = 0;
    this.attrs.y = 0;
    this.attrs.rotation = 0;
    this.attrs.scaleX = 1;
    this.attrs.scaleY = 1;
    this.attrs.offsetX = 0;
    this.attrs.offsetY = 0;
    this.attrs.skewX = 0;
    this.attrs.skewY = 0;
    return trans;
  }
  move(change) {
    var changeX = change.x, changeY = change.y, x2 = this.x(), y2 = this.y();
    if (changeX !== void 0) {
      x2 += changeX;
    }
    if (changeY !== void 0) {
      y2 += changeY;
    }
    this.setPosition({ x: x2, y: y2 });
    return this;
  }
  _eachAncestorReverse(func, top2) {
    var family = [], parent = this.getParent(), len, n2;
    if (top2 && top2._id === this._id) {
      return;
    }
    family.unshift(this);
    while (parent && (!top2 || parent._id !== top2._id)) {
      family.unshift(parent);
      parent = parent.parent;
    }
    len = family.length;
    for (n2 = 0; n2 < len; n2++) {
      func(family[n2]);
    }
  }
  rotate(theta) {
    this.rotation(this.rotation() + theta);
    return this;
  }
  moveToTop() {
    if (!this.parent) {
      Util_1$s.Util.warn("Node has no parent. moveToTop function is ignored.");
      return false;
    }
    var index = this.index, len = this.parent.getChildren().length;
    if (index < len - 1) {
      this.parent.children.splice(index, 1);
      this.parent.children.push(this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveUp() {
    if (!this.parent) {
      Util_1$s.Util.warn("Node has no parent. moveUp function is ignored.");
      return false;
    }
    var index = this.index, len = this.parent.getChildren().length;
    if (index < len - 1) {
      this.parent.children.splice(index, 1);
      this.parent.children.splice(index + 1, 0, this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveDown() {
    if (!this.parent) {
      Util_1$s.Util.warn("Node has no parent. moveDown function is ignored.");
      return false;
    }
    var index = this.index;
    if (index > 0) {
      this.parent.children.splice(index, 1);
      this.parent.children.splice(index - 1, 0, this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveToBottom() {
    if (!this.parent) {
      Util_1$s.Util.warn("Node has no parent. moveToBottom function is ignored.");
      return false;
    }
    var index = this.index;
    if (index > 0) {
      this.parent.children.splice(index, 1);
      this.parent.children.unshift(this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  setZIndex(zIndex) {
    if (!this.parent) {
      Util_1$s.Util.warn("Node has no parent. zIndex parameter is ignored.");
      return this;
    }
    if (zIndex < 0 || zIndex >= this.parent.children.length) {
      Util_1$s.Util.warn("Unexpected value " + zIndex + " for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to " + (this.parent.children.length - 1) + ".");
    }
    var index = this.index;
    this.parent.children.splice(index, 1);
    this.parent.children.splice(zIndex, 0, this);
    this.parent._setChildrenIndices();
    return this;
  }
  getAbsoluteOpacity() {
    return this._getCache(ABSOLUTE_OPACITY$1, this._getAbsoluteOpacity);
  }
  _getAbsoluteOpacity() {
    var absOpacity = this.opacity();
    var parent = this.getParent();
    if (parent && !parent._isUnderCache) {
      absOpacity *= parent.getAbsoluteOpacity();
    }
    return absOpacity;
  }
  moveTo(newContainer) {
    if (this.getParent() !== newContainer) {
      this._remove();
      newContainer.add(this);
    }
    return this;
  }
  toObject() {
    var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;
    const obj = {
      attrs: {},
      className: this.getClassName()
    };
    for (key in attrs) {
      val = attrs[key];
      nonPlainObject = Util_1$s.Util.isObject(val) && !Util_1$s.Util._isPlainObject(val) && !Util_1$s.Util._isArray(val);
      if (nonPlainObject) {
        continue;
      }
      getter = typeof this[key] === "function" && this[key];
      delete attrs[key];
      defaultValue = getter ? getter.call(this) : null;
      attrs[key] = val;
      if (defaultValue !== val) {
        obj.attrs[key] = val;
      }
    }
    return Util_1$s.Util._prepareToStringify(obj);
  }
  toJSON() {
    return JSON.stringify(this.toObject());
  }
  getParent() {
    return this.parent;
  }
  findAncestors(selector, includeSelf, stopNode) {
    var res = [];
    if (includeSelf && this._isMatch(selector)) {
      res.push(this);
    }
    var ancestor = this.parent;
    while (ancestor) {
      if (ancestor === stopNode) {
        return res;
      }
      if (ancestor._isMatch(selector)) {
        res.push(ancestor);
      }
      ancestor = ancestor.parent;
    }
    return res;
  }
  isAncestorOf(node) {
    return false;
  }
  findAncestor(selector, includeSelf, stopNode) {
    return this.findAncestors(selector, includeSelf, stopNode)[0];
  }
  _isMatch(selector) {
    if (!selector) {
      return false;
    }
    if (typeof selector === "function") {
      return selector(this);
    }
    var selectorArr = selector.replace(/ /g, "").split(","), len = selectorArr.length, n2, sel;
    for (n2 = 0; n2 < len; n2++) {
      sel = selectorArr[n2];
      if (!Util_1$s.Util.isValidSelector(sel)) {
        Util_1$s.Util.warn('Selector "' + sel + '" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".');
        Util_1$s.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".');
        Util_1$s.Util.warn("Konva is awesome, right?");
      }
      if (sel.charAt(0) === "#") {
        if (this.id() === sel.slice(1)) {
          return true;
        }
      } else if (sel.charAt(0) === ".") {
        if (this.hasName(sel.slice(1))) {
          return true;
        }
      } else if (this.className === sel || this.nodeType === sel) {
        return true;
      }
    }
    return false;
  }
  getLayer() {
    var parent = this.getParent();
    return parent ? parent.getLayer() : null;
  }
  getStage() {
    return this._getCache(STAGE$1, this._getStage);
  }
  _getStage() {
    var parent = this.getParent();
    if (parent) {
      return parent.getStage();
    } else {
      return null;
    }
  }
  fire(eventType, evt = {}, bubble) {
    evt.target = evt.target || this;
    if (bubble) {
      this._fireAndBubble(eventType, evt);
    } else {
      this._fire(eventType, evt);
    }
    return this;
  }
  getAbsoluteTransform(top2) {
    if (top2) {
      return this._getAbsoluteTransform(top2);
    } else {
      return this._getCache(ABSOLUTE_TRANSFORM$1, this._getAbsoluteTransform);
    }
  }
  _getAbsoluteTransform(top2) {
    var at;
    if (top2) {
      at = new Util_1$s.Transform();
      this._eachAncestorReverse(function(node) {
        var transformsEnabled2 = node.transformsEnabled();
        if (transformsEnabled2 === "all") {
          at.multiply(node.getTransform());
        } else if (transformsEnabled2 === "position") {
          at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());
        }
      }, top2);
      return at;
    } else {
      at = this._cache.get(ABSOLUTE_TRANSFORM$1) || new Util_1$s.Transform();
      if (this.parent) {
        this.parent.getAbsoluteTransform().copyInto(at);
      } else {
        at.reset();
      }
      var transformsEnabled = this.transformsEnabled();
      if (transformsEnabled === "all") {
        at.multiply(this.getTransform());
      } else if (transformsEnabled === "position") {
        const x2 = this.attrs.x || 0;
        const y2 = this.attrs.y || 0;
        const offsetX = this.attrs.offsetX || 0;
        const offsetY = this.attrs.offsetY || 0;
        at.translate(x2 - offsetX, y2 - offsetY);
      }
      at.dirty = false;
      return at;
    }
  }
  getAbsoluteScale(top2) {
    var parent = this;
    while (parent) {
      if (parent._isUnderCache) {
        top2 = parent;
      }
      parent = parent.getParent();
    }
    const transform = this.getAbsoluteTransform(top2);
    const attrs = transform.decompose();
    return {
      x: attrs.scaleX,
      y: attrs.scaleY
    };
  }
  getAbsoluteRotation() {
    return this.getAbsoluteTransform().decompose().rotation;
  }
  getTransform() {
    return this._getCache(TRANSFORM$1, this._getTransform);
  }
  _getTransform() {
    var _a2, _b2;
    var m2 = this._cache.get(TRANSFORM$1) || new Util_1$s.Transform();
    m2.reset();
    var x2 = this.x(), y2 = this.y(), rotation = Global_1$M.Konva.getAngle(this.rotation()), scaleX = (_a2 = this.attrs.scaleX) !== null && _a2 !== void 0 ? _a2 : 1, scaleY = (_b2 = this.attrs.scaleY) !== null && _b2 !== void 0 ? _b2 : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
    if (x2 !== 0 || y2 !== 0) {
      m2.translate(x2, y2);
    }
    if (rotation !== 0) {
      m2.rotate(rotation);
    }
    if (skewX !== 0 || skewY !== 0) {
      m2.skew(skewX, skewY);
    }
    if (scaleX !== 1 || scaleY !== 1) {
      m2.scale(scaleX, scaleY);
    }
    if (offsetX !== 0 || offsetY !== 0) {
      m2.translate(-1 * offsetX, -1 * offsetY);
    }
    m2.dirty = false;
    return m2;
  }
  clone(obj) {
    var attrs = Util_1$s.Util.cloneObject(this.attrs), key, allListeners, len, n2, listener;
    for (key in obj) {
      attrs[key] = obj[key];
    }
    var node = new this.constructor(attrs);
    for (key in this.eventListeners) {
      allListeners = this.eventListeners[key];
      len = allListeners.length;
      for (n2 = 0; n2 < len; n2++) {
        listener = allListeners[n2];
        if (listener.name.indexOf(KONVA$1) < 0) {
          if (!node.eventListeners[key]) {
            node.eventListeners[key] = [];
          }
          node.eventListeners[key].push(listener);
        }
      }
    }
    return node;
  }
  _toKonvaCanvas(config) {
    config = config || {};
    var box = this.getClientRect();
    var stage = this.getStage(), x2 = config.x !== void 0 ? config.x : Math.floor(box.x), y2 = config.y !== void 0 ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1$3.SceneCanvas({
      width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),
      height: config.height || Math.ceil(box.height) || (stage ? stage.height() : 0),
      pixelRatio
    }), context = canvas.getContext();
    const bufferCanvas = new Canvas_1$3.SceneCanvas({
      width: canvas.width / canvas.pixelRatio + Math.abs(x2),
      height: canvas.height / canvas.pixelRatio + Math.abs(y2),
      pixelRatio: canvas.pixelRatio
    });
    if (config.imageSmoothingEnabled === false) {
      context._context.imageSmoothingEnabled = false;
    }
    context.save();
    if (x2 || y2) {
      context.translate(-1 * x2, -1 * y2);
    }
    this.drawScene(canvas, void 0, bufferCanvas);
    context.restore();
    return canvas;
  }
  toCanvas(config) {
    return this._toKonvaCanvas(config)._canvas;
  }
  toDataURL(config) {
    config = config || {};
    var mimeType = config.mimeType || null, quality = config.quality || null;
    var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);
    if (config.callback) {
      config.callback(url);
    }
    return url;
  }
  toImage(config) {
    return new Promise((resolve, reject) => {
      try {
        const callback = config === null || config === void 0 ? void 0 : config.callback;
        if (callback)
          delete config.callback;
        Util_1$s.Util._urlToImage(this.toDataURL(config), function(img) {
          resolve(img);
          callback === null || callback === void 0 ? void 0 : callback(img);
        });
      } catch (err) {
        reject(err);
      }
    });
  }
  toBlob(config) {
    return new Promise((resolve, reject) => {
      try {
        const callback = config === null || config === void 0 ? void 0 : config.callback;
        if (callback)
          delete config.callback;
        this.toCanvas(config).toBlob((blob) => {
          resolve(blob);
          callback === null || callback === void 0 ? void 0 : callback(blob);
        }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);
      } catch (err) {
        reject(err);
      }
    });
  }
  setSize(size) {
    this.width(size.width);
    this.height(size.height);
    return this;
  }
  getSize() {
    return {
      width: this.width(),
      height: this.height()
    };
  }
  getClassName() {
    return this.className || this.nodeType;
  }
  getType() {
    return this.nodeType;
  }
  getDragDistance() {
    if (this.attrs.dragDistance !== void 0) {
      return this.attrs.dragDistance;
    } else if (this.parent) {
      return this.parent.getDragDistance();
    } else {
      return Global_1$M.Konva.dragDistance;
    }
  }
  _off(type, name, callback) {
    var evtListeners = this.eventListeners[type], i, evtName, handler;
    for (i = 0; i < evtListeners.length; i++) {
      evtName = evtListeners[i].name;
      handler = evtListeners[i].handler;
      if ((evtName !== "konva" || name === "konva") && (!name || evtName === name) && (!callback || callback === handler)) {
        evtListeners.splice(i, 1);
        if (evtListeners.length === 0) {
          delete this.eventListeners[type];
          break;
        }
        i--;
      }
    }
  }
  _fireChangeEvent(attr, oldVal, newVal) {
    this._fire(attr + CHANGE$1, {
      oldVal,
      newVal
    });
  }
  addName(name) {
    if (!this.hasName(name)) {
      var oldName = this.name();
      var newName = oldName ? oldName + " " + name : name;
      this.name(newName);
    }
    return this;
  }
  hasName(name) {
    if (!name) {
      return false;
    }
    const fullName = this.name();
    if (!fullName) {
      return false;
    }
    var names = (fullName || "").split(/\s/g);
    return names.indexOf(name) !== -1;
  }
  removeName(name) {
    var names = (this.name() || "").split(/\s/g);
    var index = names.indexOf(name);
    if (index !== -1) {
      names.splice(index, 1);
      this.name(names.join(" "));
    }
    return this;
  }
  setAttr(attr, val) {
    var func = this[SET$1 + Util_1$s.Util._capitalize(attr)];
    if (Util_1$s.Util._isFunction(func)) {
      func.call(this, val);
    } else {
      this._setAttr(attr, val);
    }
    return this;
  }
  _requestDraw() {
    if (Global_1$M.Konva.autoDrawEnabled) {
      const drawNode = this.getLayer() || this.getStage();
      drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
    }
  }
  _setAttr(key, val) {
    var oldVal = this.attrs[key];
    if (oldVal === val && !Util_1$s.Util.isObject(val)) {
      return;
    }
    if (val === void 0 || val === null) {
      delete this.attrs[key];
    } else {
      this.attrs[key] = val;
    }
    if (this._shouldFireChangeEvents) {
      this._fireChangeEvent(key, oldVal, val);
    }
    this._requestDraw();
  }
  _setComponentAttr(key, component, val) {
    var oldVal;
    if (val !== void 0) {
      oldVal = this.attrs[key];
      if (!oldVal) {
        this.attrs[key] = this.getAttr(key);
      }
      this.attrs[key][component] = val;
      this._fireChangeEvent(key, oldVal, val);
    }
  }
  _fireAndBubble(eventType, evt, compareShape) {
    if (evt && this.nodeType === SHAPE$1) {
      evt.target = this;
    }
    var shouldStop = (eventType === MOUSEENTER$1 || eventType === MOUSELEAVE$1) && (compareShape && (this === compareShape || this.isAncestorOf && this.isAncestorOf(compareShape)) || this.nodeType === "Stage" && !compareShape);
    if (!shouldStop) {
      this._fire(eventType, evt);
      var stopBubble = (eventType === MOUSEENTER$1 || eventType === MOUSELEAVE$1) && compareShape && compareShape.isAncestorOf && compareShape.isAncestorOf(this) && !compareShape.isAncestorOf(this.parent);
      if ((evt && !evt.cancelBubble || !evt) && this.parent && this.parent.isListening() && !stopBubble) {
        if (compareShape && compareShape.parent) {
          this._fireAndBubble.call(this.parent, eventType, evt, compareShape);
        } else {
          this._fireAndBubble.call(this.parent, eventType, evt);
        }
      }
    }
  }
  _getProtoListeners(eventType) {
    var _a2, _b2, _c;
    const allListeners = (_a2 = this._cache.get(ALL_LISTENERS$1)) !== null && _a2 !== void 0 ? _a2 : {};
    let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
    if (events === void 0) {
      events = [];
      let obj = Object.getPrototypeOf(this);
      while (obj) {
        const hierarchyEvents = (_c = (_b2 = obj.eventListeners) === null || _b2 === void 0 ? void 0 : _b2[eventType]) !== null && _c !== void 0 ? _c : [];
        events.push(...hierarchyEvents);
        obj = Object.getPrototypeOf(obj);
      }
      allListeners[eventType] = events;
      this._cache.set(ALL_LISTENERS$1, allListeners);
    }
    return events;
  }
  _fire(eventType, evt) {
    evt = evt || {};
    evt.currentTarget = this;
    evt.type = eventType;
    const topListeners = this._getProtoListeners(eventType);
    if (topListeners) {
      for (var i = 0; i < topListeners.length; i++) {
        topListeners[i].handler.call(this, evt);
      }
    }
    const selfListeners = this.eventListeners[eventType];
    if (selfListeners) {
      for (var i = 0; i < selfListeners.length; i++) {
        selfListeners[i].handler.call(this, evt);
      }
    }
  }
  draw() {
    this.drawScene();
    this.drawHit();
    return this;
  }
  _createDragElement(evt) {
    var pointerId = evt ? evt.pointerId : void 0;
    var stage = this.getStage();
    var ap = this.getAbsolutePosition();
    if (!stage) {
      return;
    }
    var pos = stage._getPointerById(pointerId) || stage._changedPointerPositions[0] || ap;
    DragAndDrop_1$1.DD._dragElements.set(this._id, {
      node: this,
      startPointerPos: pos,
      offset: {
        x: pos.x - ap.x,
        y: pos.y - ap.y
      },
      dragStatus: "ready",
      pointerId
    });
  }
  startDrag(evt, bubbleEvent = true) {
    if (!DragAndDrop_1$1.DD._dragElements.has(this._id)) {
      this._createDragElement(evt);
    }
    const elem = DragAndDrop_1$1.DD._dragElements.get(this._id);
    elem.dragStatus = "dragging";
    this.fire("dragstart", {
      type: "dragstart",
      target: this,
      evt: evt && evt.evt
    }, bubbleEvent);
  }
  _setDragPosition(evt, elem) {
    const pos = this.getStage()._getPointerById(elem.pointerId);
    if (!pos) {
      return;
    }
    var newNodePos = {
      x: pos.x - elem.offset.x,
      y: pos.y - elem.offset.y
    };
    var dbf = this.dragBoundFunc();
    if (dbf !== void 0) {
      const bounded = dbf.call(this, newNodePos, evt);
      if (!bounded) {
        Util_1$s.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.");
      } else {
        newNodePos = bounded;
      }
    }
    if (!this._lastPos || this._lastPos.x !== newNodePos.x || this._lastPos.y !== newNodePos.y) {
      this.setAbsolutePosition(newNodePos);
      this._requestDraw();
    }
    this._lastPos = newNodePos;
  }
  stopDrag(evt) {
    const elem = DragAndDrop_1$1.DD._dragElements.get(this._id);
    if (elem) {
      elem.dragStatus = "stopped";
    }
    DragAndDrop_1$1.DD._endDragBefore(evt);
    DragAndDrop_1$1.DD._endDragAfter(evt);
  }
  setDraggable(draggable) {
    this._setAttr("draggable", draggable);
    this._dragChange();
  }
  isDragging() {
    const elem = DragAndDrop_1$1.DD._dragElements.get(this._id);
    return elem ? elem.dragStatus === "dragging" : false;
  }
  _listenDrag() {
    this._dragCleanup();
    this.on("mousedown.konva touchstart.konva", function(evt) {
      var shouldCheckButton = evt.evt["button"] !== void 0;
      var canDrag = !shouldCheckButton || Global_1$M.Konva.dragButtons.indexOf(evt.evt["button"]) >= 0;
      if (!canDrag) {
        return;
      }
      if (this.isDragging()) {
        return;
      }
      var hasDraggingChild = false;
      DragAndDrop_1$1.DD._dragElements.forEach((elem) => {
        if (this.isAncestorOf(elem.node)) {
          hasDraggingChild = true;
        }
      });
      if (!hasDraggingChild) {
        this._createDragElement(evt);
      }
    });
  }
  _dragChange() {
    if (this.attrs.draggable) {
      this._listenDrag();
    } else {
      this._dragCleanup();
      var stage = this.getStage();
      if (!stage) {
        return;
      }
      const dragElement = DragAndDrop_1$1.DD._dragElements.get(this._id);
      const isDragging = dragElement && dragElement.dragStatus === "dragging";
      const isReady = dragElement && dragElement.dragStatus === "ready";
      if (isDragging) {
        this.stopDrag();
      } else if (isReady) {
        DragAndDrop_1$1.DD._dragElements.delete(this._id);
      }
    }
  }
  _dragCleanup() {
    this.off("mousedown.konva");
    this.off("touchstart.konva");
  }
  isClientRectOnScreen(margin = { x: 0, y: 0 }) {
    const stage = this.getStage();
    if (!stage) {
      return false;
    }
    const screenRect = {
      x: -margin.x,
      y: -margin.y,
      width: stage.width() + 2 * margin.x,
      height: stage.height() + 2 * margin.y
    };
    return Util_1$s.Util.haveIntersection(screenRect, this.getClientRect());
  }
  static create(data, container) {
    if (Util_1$s.Util._isString(data)) {
      data = JSON.parse(data);
    }
    return this._createNode(data, container);
  }
  static _createNode(obj, container) {
    var className = Node.prototype.getClassName.call(obj), children = obj.children, no, len, n2;
    if (container) {
      obj.attrs.container = container;
    }
    if (!Global_1$M.Konva[className]) {
      Util_1$s.Util.warn('Can not find a node with class name "' + className + '". Fallback to "Shape".');
      className = "Shape";
    }
    const Class = Global_1$M.Konva[className];
    no = new Class(obj.attrs);
    if (children) {
      len = children.length;
      for (n2 = 0; n2 < len; n2++) {
        no.add(Node._createNode(children[n2]));
      }
    }
    return no;
  }
};
Node$3.Node = Node$2;
Node$2.prototype.nodeType = "Node";
Node$2.prototype._attrsAffectingSize = [];
Node$2.prototype.eventListeners = {};
Node$2.prototype.on.call(Node$2.prototype, TRANSFORM_CHANGE_STR$3, function() {
  if (this._batchingTransformChange) {
    this._needClearTransformCache = true;
    return;
  }
  this._clearCache(TRANSFORM$1);
  this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM$1);
});
Node$2.prototype.on.call(Node$2.prototype, "visibleChange.konva", function() {
  this._clearSelfAndDescendantCache(VISIBLE$1);
});
Node$2.prototype.on.call(Node$2.prototype, "listeningChange.konva", function() {
  this._clearSelfAndDescendantCache(LISTENING$1);
});
Node$2.prototype.on.call(Node$2.prototype, "opacityChange.konva", function() {
  this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY$1);
});
const addGetterSetter$1 = Factory_1$16.Factory.addGetterSetter;
addGetterSetter$1(Node$2, "zIndex");
addGetterSetter$1(Node$2, "absolutePosition");
addGetterSetter$1(Node$2, "position");
addGetterSetter$1(Node$2, "x", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "y", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "globalCompositeOperation", "source-over", (0, Validators_1$14.getStringValidator)());
addGetterSetter$1(Node$2, "opacity", 1, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "name", "", (0, Validators_1$14.getStringValidator)());
addGetterSetter$1(Node$2, "id", "", (0, Validators_1$14.getStringValidator)());
addGetterSetter$1(Node$2, "rotation", 0, (0, Validators_1$14.getNumberValidator)());
Factory_1$16.Factory.addComponentsGetterSetter(Node$2, "scale", ["x", "y"]);
addGetterSetter$1(Node$2, "scaleX", 1, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "scaleY", 1, (0, Validators_1$14.getNumberValidator)());
Factory_1$16.Factory.addComponentsGetterSetter(Node$2, "skew", ["x", "y"]);
addGetterSetter$1(Node$2, "skewX", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "skewY", 0, (0, Validators_1$14.getNumberValidator)());
Factory_1$16.Factory.addComponentsGetterSetter(Node$2, "offset", ["x", "y"]);
addGetterSetter$1(Node$2, "offsetX", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "offsetY", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "dragDistance", null, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "width", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "height", 0, (0, Validators_1$14.getNumberValidator)());
addGetterSetter$1(Node$2, "listening", true, (0, Validators_1$14.getBooleanValidator)());
addGetterSetter$1(Node$2, "preventDefault", true, (0, Validators_1$14.getBooleanValidator)());
addGetterSetter$1(Node$2, "filters", null, function(val) {
  this._filterUpToDate = false;
  return val;
});
addGetterSetter$1(Node$2, "visible", true, (0, Validators_1$14.getBooleanValidator)());
addGetterSetter$1(Node$2, "transformsEnabled", "all", (0, Validators_1$14.getStringValidator)());
addGetterSetter$1(Node$2, "size");
addGetterSetter$1(Node$2, "dragBoundFunc");
addGetterSetter$1(Node$2, "draggable", false, (0, Validators_1$14.getBooleanValidator)());
Factory_1$16.Factory.backCompat(Node$2, {
  rotateDeg: "rotate",
  setRotationDeg: "setRotation",
  getRotationDeg: "getRotation"
});
var Container$6 = {};
Object.defineProperty(Container$6, "__esModule", { value: true });
Container$6.Container = void 0;
const Factory_1$15 = Factory$1;
const Node_1$z = Node$3;
const Validators_1$13 = Validators$1;
let Container$5 = class Container extends Node_1$z.Node {
  constructor() {
    super(...arguments);
    this.children = [];
  }
  getChildren(filterFunc) {
    if (!filterFunc) {
      return this.children || [];
    }
    const children = this.children || [];
    var results = [];
    children.forEach(function(child) {
      if (filterFunc(child)) {
        results.push(child);
      }
    });
    return results;
  }
  hasChildren() {
    return this.getChildren().length > 0;
  }
  removeChildren() {
    this.getChildren().forEach((child) => {
      child.parent = null;
      child.index = 0;
      child.remove();
    });
    this.children = [];
    this._requestDraw();
    return this;
  }
  destroyChildren() {
    this.getChildren().forEach((child) => {
      child.parent = null;
      child.index = 0;
      child.destroy();
    });
    this.children = [];
    this._requestDraw();
    return this;
  }
  add(...children) {
    if (children.length === 0) {
      return this;
    }
    if (children.length > 1) {
      for (var i = 0; i < children.length; i++) {
        this.add(children[i]);
      }
      return this;
    }
    const child = children[0];
    if (child.getParent()) {
      child.moveTo(this);
      return this;
    }
    this._validateAdd(child);
    child.index = this.getChildren().length;
    child.parent = this;
    child._clearCaches();
    this.getChildren().push(child);
    this._fire("add", {
      child
    });
    this._requestDraw();
    return this;
  }
  destroy() {
    if (this.hasChildren()) {
      this.destroyChildren();
    }
    super.destroy();
    return this;
  }
  find(selector) {
    return this._generalFind(selector, false);
  }
  findOne(selector) {
    var result = this._generalFind(selector, true);
    return result.length > 0 ? result[0] : void 0;
  }
  _generalFind(selector, findOne) {
    var retArr = [];
    this._descendants((node) => {
      const valid = node._isMatch(selector);
      if (valid) {
        retArr.push(node);
      }
      if (valid && findOne) {
        return true;
      }
      return false;
    });
    return retArr;
  }
  _descendants(fn2) {
    let shouldStop = false;
    const children = this.getChildren();
    for (const child of children) {
      shouldStop = fn2(child);
      if (shouldStop) {
        return true;
      }
      if (!child.hasChildren()) {
        continue;
      }
      shouldStop = child._descendants(fn2);
      if (shouldStop) {
        return true;
      }
    }
    return false;
  }
  toObject() {
    var obj = Node_1$z.Node.prototype.toObject.call(this);
    obj.children = [];
    this.getChildren().forEach((child) => {
      obj.children.push(child.toObject());
    });
    return obj;
  }
  isAncestorOf(node) {
    var parent = node.getParent();
    while (parent) {
      if (parent._id === this._id) {
        return true;
      }
      parent = parent.getParent();
    }
    return false;
  }
  clone(obj) {
    var node = Node_1$z.Node.prototype.clone.call(this, obj);
    this.getChildren().forEach(function(no) {
      node.add(no.clone());
    });
    return node;
  }
  getAllIntersections(pos) {
    var arr = [];
    this.find("Shape").forEach((shape) => {
      if (shape.isVisible() && shape.intersects(pos)) {
        arr.push(shape);
      }
    });
    return arr;
  }
  _clearSelfAndDescendantCache(attr) {
    var _a2;
    super._clearSelfAndDescendantCache(attr);
    if (this.isCached()) {
      return;
    }
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(node) {
      node._clearSelfAndDescendantCache(attr);
    });
  }
  _setChildrenIndices() {
    var _a2;
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child, n2) {
      child.index = n2;
    });
    this._requestDraw();
  }
  drawScene(can, top2, bufferCanvas) {
    var layer = this.getLayer(), canvas = can || layer && layer.getCanvas(), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;
    var caching = canvas && canvas.isCache;
    if (!this.isVisible() && !caching) {
      return this;
    }
    if (cachedSceneCanvas) {
      context.save();
      var m2 = this.getAbsoluteTransform(top2).getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      this._drawCachedSceneCanvas(context);
      context.restore();
    } else {
      this._drawChildren("drawScene", canvas, top2, bufferCanvas);
    }
    return this;
  }
  drawHit(can, top2) {
    if (!this.shouldDrawHit(top2)) {
      return this;
    }
    var layer = this.getLayer(), canvas = can || layer && layer.hitCanvas, context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
    if (cachedHitCanvas) {
      context.save();
      var m2 = this.getAbsoluteTransform(top2).getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      this._drawCachedHitCanvas(context);
      context.restore();
    } else {
      this._drawChildren("drawHit", canvas, top2);
    }
    return this;
  }
  _drawChildren(drawMethod, canvas, top2, bufferCanvas) {
    var _a2;
    var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = typeof clipWidth === "number" && typeof clipHeight === "number" || clipFunc;
    const selfCache = top2 === this;
    if (hasClip) {
      context.save();
      var transform = this.getAbsoluteTransform(top2);
      var m2 = transform.getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      context.beginPath();
      let clipArgs;
      if (clipFunc) {
        clipArgs = clipFunc.call(this, context, this);
      } else {
        var clipX = this.clipX();
        var clipY = this.clipY();
        context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);
      }
      context.clip.apply(context, clipArgs);
      m2 = transform.copy().invert().getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
    }
    var hasComposition = !selfCache && this.globalCompositeOperation() !== "source-over" && drawMethod === "drawScene";
    if (hasComposition) {
      context.save();
      context._applyGlobalCompositeOperation(this);
    }
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child) {
      child[drawMethod](canvas, top2, bufferCanvas);
    });
    if (hasComposition) {
      context.restore();
    }
    if (hasClip) {
      context.restore();
    }
  }
  getClientRect(config = {}) {
    var _a2;
    var skipTransform = config.skipTransform;
    var relativeTo = config.relativeTo;
    var minX, minY, maxX, maxY;
    var selfRect = {
      x: Infinity,
      y: Infinity,
      width: 0,
      height: 0
    };
    var that = this;
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child) {
      if (!child.visible()) {
        return;
      }
      var rect = child.getClientRect({
        relativeTo: that,
        skipShadow: config.skipShadow,
        skipStroke: config.skipStroke
      });
      if (rect.width === 0 && rect.height === 0) {
        return;
      }
      if (minX === void 0) {
        minX = rect.x;
        minY = rect.y;
        maxX = rect.x + rect.width;
        maxY = rect.y + rect.height;
      } else {
        minX = Math.min(minX, rect.x);
        minY = Math.min(minY, rect.y);
        maxX = Math.max(maxX, rect.x + rect.width);
        maxY = Math.max(maxY, rect.y + rect.height);
      }
    });
    var shapes = this.find("Shape");
    var hasVisible = false;
    for (var i = 0; i < shapes.length; i++) {
      var shape = shapes[i];
      if (shape._isVisible(this)) {
        hasVisible = true;
        break;
      }
    }
    if (hasVisible && minX !== void 0) {
      selfRect = {
        x: minX,
        y: minY,
        width: maxX - minX,
        height: maxY - minY
      };
    } else {
      selfRect = {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      };
    }
    if (!skipTransform) {
      return this._transformedRect(selfRect, relativeTo);
    }
    return selfRect;
  }
};
Container$6.Container = Container$5;
Factory_1$15.Factory.addComponentsGetterSetter(Container$5, "clip", [
  "x",
  "y",
  "width",
  "height"
]);
Factory_1$15.Factory.addGetterSetter(Container$5, "clipX", void 0, (0, Validators_1$13.getNumberValidator)());
Factory_1$15.Factory.addGetterSetter(Container$5, "clipY", void 0, (0, Validators_1$13.getNumberValidator)());
Factory_1$15.Factory.addGetterSetter(Container$5, "clipWidth", void 0, (0, Validators_1$13.getNumberValidator)());
Factory_1$15.Factory.addGetterSetter(Container$5, "clipHeight", void 0, (0, Validators_1$13.getNumberValidator)());
Factory_1$15.Factory.addGetterSetter(Container$5, "clipFunc");
var Stage$2 = {};
var PointerEvents$1 = {};
Object.defineProperty(PointerEvents$1, "__esModule", { value: true });
PointerEvents$1.releaseCapture = PointerEvents$1.setPointerCapture = PointerEvents$1.hasPointerCapture = PointerEvents$1.createEvent = PointerEvents$1.getCapturedShape = void 0;
const Global_1$L = Global$1;
const Captures$1 = /* @__PURE__ */ new Map();
const SUPPORT_POINTER_EVENTS$1 = Global_1$L.Konva._global["PointerEvent"] !== void 0;
function getCapturedShape$1(pointerId) {
  return Captures$1.get(pointerId);
}
PointerEvents$1.getCapturedShape = getCapturedShape$1;
function createEvent$1(evt) {
  return {
    evt,
    pointerId: evt.pointerId
  };
}
PointerEvents$1.createEvent = createEvent$1;
function hasPointerCapture$1(pointerId, shape) {
  return Captures$1.get(pointerId) === shape;
}
PointerEvents$1.hasPointerCapture = hasPointerCapture$1;
function setPointerCapture$1(pointerId, shape) {
  releaseCapture$1(pointerId);
  const stage = shape.getStage();
  if (!stage)
    return;
  Captures$1.set(pointerId, shape);
  if (SUPPORT_POINTER_EVENTS$1) {
    shape._fire("gotpointercapture", createEvent$1(new PointerEvent("gotpointercapture")));
  }
}
PointerEvents$1.setPointerCapture = setPointerCapture$1;
function releaseCapture$1(pointerId, target) {
  const shape = Captures$1.get(pointerId);
  if (!shape)
    return;
  const stage = shape.getStage();
  if (stage && stage.content) ;
  Captures$1.delete(pointerId);
  if (SUPPORT_POINTER_EVENTS$1) {
    shape._fire("lostpointercapture", createEvent$1(new PointerEvent("lostpointercapture")));
  }
}
PointerEvents$1.releaseCapture = releaseCapture$1;
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Stage = exports.stages = void 0;
  const Util_12 = Util$1;
  const Factory_12 = Factory$1;
  const Container_12 = Container$6;
  const Global_12 = Global$1;
  const Canvas_12 = Canvas$3;
  const DragAndDrop_12 = DragAndDrop$1;
  const Global_22 = Global$1;
  const PointerEvents2 = PointerEvents$1;
  var STAGE2 = "Stage", STRING = "string", PX = "px", MOUSEOUT = "mouseout", MOUSELEAVE2 = "mouseleave", MOUSEOVER = "mouseover", MOUSEENTER2 = "mouseenter", MOUSEMOVE = "mousemove", MOUSEDOWN = "mousedown", MOUSEUP = "mouseup", POINTERMOVE = "pointermove", POINTERDOWN = "pointerdown", POINTERUP = "pointerup", POINTERCANCEL = "pointercancel", LOSTPOINTERCAPTURE = "lostpointercapture", POINTEROUT = "pointerout", POINTERLEAVE = "pointerleave", POINTEROVER = "pointerover", POINTERENTER = "pointerenter", CONTEXTMENU = "contextmenu", TOUCHSTART = "touchstart", TOUCHEND = "touchend", TOUCHMOVE = "touchmove", TOUCHCANCEL = "touchcancel", WHEEL = "wheel", MAX_LAYERS_NUMBER = 5, EVENTS = [
    [MOUSEENTER2, "_pointerenter"],
    [MOUSEDOWN, "_pointerdown"],
    [MOUSEMOVE, "_pointermove"],
    [MOUSEUP, "_pointerup"],
    [MOUSELEAVE2, "_pointerleave"],
    [TOUCHSTART, "_pointerdown"],
    [TOUCHMOVE, "_pointermove"],
    [TOUCHEND, "_pointerup"],
    [TOUCHCANCEL, "_pointercancel"],
    [MOUSEOVER, "_pointerover"],
    [WHEEL, "_wheel"],
    [CONTEXTMENU, "_contextmenu"],
    [POINTERDOWN, "_pointerdown"],
    [POINTERMOVE, "_pointermove"],
    [POINTERUP, "_pointerup"],
    [POINTERCANCEL, "_pointercancel"],
    [LOSTPOINTERCAPTURE, "_lostpointercapture"]
  ];
  const EVENTS_MAP = {
    mouse: {
      [POINTEROUT]: MOUSEOUT,
      [POINTERLEAVE]: MOUSELEAVE2,
      [POINTEROVER]: MOUSEOVER,
      [POINTERENTER]: MOUSEENTER2,
      [POINTERMOVE]: MOUSEMOVE,
      [POINTERDOWN]: MOUSEDOWN,
      [POINTERUP]: MOUSEUP,
      [POINTERCANCEL]: "mousecancel",
      pointerclick: "click",
      pointerdblclick: "dblclick"
    },
    touch: {
      [POINTEROUT]: "touchout",
      [POINTERLEAVE]: "touchleave",
      [POINTEROVER]: "touchover",
      [POINTERENTER]: "touchenter",
      [POINTERMOVE]: TOUCHMOVE,
      [POINTERDOWN]: TOUCHSTART,
      [POINTERUP]: TOUCHEND,
      [POINTERCANCEL]: TOUCHCANCEL,
      pointerclick: "tap",
      pointerdblclick: "dbltap"
    },
    pointer: {
      [POINTEROUT]: POINTEROUT,
      [POINTERLEAVE]: POINTERLEAVE,
      [POINTEROVER]: POINTEROVER,
      [POINTERENTER]: POINTERENTER,
      [POINTERMOVE]: POINTERMOVE,
      [POINTERDOWN]: POINTERDOWN,
      [POINTERUP]: POINTERUP,
      [POINTERCANCEL]: POINTERCANCEL,
      pointerclick: "pointerclick",
      pointerdblclick: "pointerdblclick"
    }
  };
  const getEventType = (type) => {
    if (type.indexOf("pointer") >= 0) {
      return "pointer";
    }
    if (type.indexOf("touch") >= 0) {
      return "touch";
    }
    return "mouse";
  };
  const getEventsMap = (eventType) => {
    const type = getEventType(eventType);
    if (type === "pointer") {
      return Global_12.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;
    }
    if (type === "touch") {
      return EVENTS_MAP.touch;
    }
    if (type === "mouse") {
      return EVENTS_MAP.mouse;
    }
  };
  function checkNoClip(attrs = {}) {
    if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {
      Util_12.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups.");
    }
    return attrs;
  }
  const NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;
  exports.stages = [];
  class Stage2 extends Container_12.Container {
    constructor(config) {
      super(checkNoClip(config));
      this._pointerPositions = [];
      this._changedPointerPositions = [];
      this._buildDOM();
      this._bindContentEvents();
      exports.stages.push(this);
      this.on("widthChange.konva heightChange.konva", this._resizeDOM);
      this.on("visibleChange.konva", this._checkVisibility);
      this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva", () => {
        checkNoClip(this.attrs);
      });
      this._checkVisibility();
    }
    _validateAdd(child) {
      const isLayer = child.getType() === "Layer";
      const isFastLayer = child.getType() === "FastLayer";
      const valid = isLayer || isFastLayer;
      if (!valid) {
        Util_12.Util.throw("You may only add layers to the stage.");
      }
    }
    _checkVisibility() {
      if (!this.content) {
        return;
      }
      const style2 = this.visible() ? "" : "none";
      this.content.style.display = style2;
    }
    setContainer(container) {
      if (typeof container === STRING) {
        if (container.charAt(0) === ".") {
          var className = container.slice(1);
          container = document.getElementsByClassName(className)[0];
        } else {
          var id2;
          if (container.charAt(0) !== "#") {
            id2 = container;
          } else {
            id2 = container.slice(1);
          }
          container = document.getElementById(id2);
        }
        if (!container) {
          throw "Can not find container in document with id " + id2;
        }
      }
      this._setAttr("container", container);
      if (this.content) {
        if (this.content.parentElement) {
          this.content.parentElement.removeChild(this.content);
        }
        container.appendChild(this.content);
      }
      return this;
    }
    shouldDrawHit() {
      return true;
    }
    clear() {
      var layers = this.children, len = layers.length, n2;
      for (n2 = 0; n2 < len; n2++) {
        layers[n2].clear();
      }
      return this;
    }
    clone(obj) {
      if (!obj) {
        obj = {};
      }
      obj.container = typeof document !== "undefined" && document.createElement("div");
      return Container_12.Container.prototype.clone.call(this, obj);
    }
    destroy() {
      super.destroy();
      var content = this.content;
      if (content && Util_12.Util._isInDocument(content)) {
        this.container().removeChild(content);
      }
      var index = exports.stages.indexOf(this);
      if (index > -1) {
        exports.stages.splice(index, 1);
      }
      Util_12.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);
      return this;
    }
    getPointerPosition() {
      const pos = this._pointerPositions[0] || this._changedPointerPositions[0];
      if (!pos) {
        Util_12.Util.warn(NO_POINTERS_MESSAGE);
        return null;
      }
      return {
        x: pos.x,
        y: pos.y
      };
    }
    _getPointerById(id2) {
      return this._pointerPositions.find((p2) => p2.id === id2);
    }
    getPointersPositions() {
      return this._pointerPositions;
    }
    getStage() {
      return this;
    }
    getContent() {
      return this.content;
    }
    _toKonvaCanvas(config) {
      config = config || {};
      config.x = config.x || 0;
      config.y = config.y || 0;
      config.width = config.width || this.width();
      config.height = config.height || this.height();
      var canvas = new Canvas_12.SceneCanvas({
        width: config.width,
        height: config.height,
        pixelRatio: config.pixelRatio || 1
      });
      var _context = canvas.getContext()._context;
      var layers = this.children;
      if (config.x || config.y) {
        _context.translate(-1 * config.x, -1 * config.y);
      }
      layers.forEach(function(layer) {
        if (!layer.isVisible()) {
          return;
        }
        var layerCanvas = layer._toKonvaCanvas(config);
        _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());
      });
      return canvas;
    }
    getIntersection(pos) {
      if (!pos) {
        return null;
      }
      var layers = this.children, len = layers.length, end2 = len - 1, n2;
      for (n2 = end2; n2 >= 0; n2--) {
        const shape = layers[n2].getIntersection(pos);
        if (shape) {
          return shape;
        }
      }
      return null;
    }
    _resizeDOM() {
      var width = this.width();
      var height = this.height();
      if (this.content) {
        this.content.style.width = width + PX;
        this.content.style.height = height + PX;
      }
      this.bufferCanvas.setSize(width, height);
      this.bufferHitCanvas.setSize(width, height);
      this.children.forEach((layer) => {
        layer.setSize({ width, height });
        layer.draw();
      });
    }
    add(layer, ...rest) {
      if (arguments.length > 1) {
        for (var i = 0; i < arguments.length; i++) {
          this.add(arguments[i]);
        }
        return this;
      }
      super.add(layer);
      var length = this.children.length;
      if (length > MAX_LAYERS_NUMBER) {
        Util_12.Util.warn("The stage has " + length + " layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.");
      }
      layer.setSize({ width: this.width(), height: this.height() });
      layer.draw();
      if (Global_12.Konva.isBrowser) {
        this.content.appendChild(layer.canvas._canvas);
      }
      return this;
    }
    getParent() {
      return null;
    }
    getLayer() {
      return null;
    }
    hasPointerCapture(pointerId) {
      return PointerEvents2.hasPointerCapture(pointerId, this);
    }
    setPointerCapture(pointerId) {
      PointerEvents2.setPointerCapture(pointerId, this);
    }
    releaseCapture(pointerId) {
      PointerEvents2.releaseCapture(pointerId, this);
    }
    getLayers() {
      return this.children;
    }
    _bindContentEvents() {
      if (!Global_12.Konva.isBrowser) {
        return;
      }
      EVENTS.forEach(([event, methodName]) => {
        this.content.addEventListener(event, (evt) => {
          this[methodName](evt);
        }, { passive: false });
      });
    }
    _pointerenter(evt) {
      this.setPointersPositions(evt);
      const events = getEventsMap(evt.type);
      if (events) {
        this._fire(events.pointerenter, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _pointerover(evt) {
      this.setPointersPositions(evt);
      const events = getEventsMap(evt.type);
      if (events) {
        this._fire(events.pointerover, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _getTargetShape(evenType) {
      let shape = this[evenType + "targetShape"];
      if (shape && !shape.getStage()) {
        shape = null;
      }
      return shape;
    }
    _pointerleave(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      var targetShape = this._getTargetShape(eventType);
      var eventsEnabled = !(Global_12.Konva.isDragging() || Global_12.Konva.isTransforming()) || Global_12.Konva.hitOnDragEnabled;
      if (targetShape && eventsEnabled) {
        targetShape._fireAndBubble(events.pointerout, { evt });
        targetShape._fireAndBubble(events.pointerleave, { evt });
        this._fire(events.pointerleave, {
          evt,
          target: this,
          currentTarget: this
        });
        this[eventType + "targetShape"] = null;
      } else if (eventsEnabled) {
        this._fire(events.pointerleave, {
          evt,
          target: this,
          currentTarget: this
        });
        this._fire(events.pointerout, {
          evt,
          target: this,
          currentTarget: this
        });
      }
      this.pointerPos = null;
      this._pointerPositions = [];
    }
    _pointerdown(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      var triggeredOnShape = false;
      this._changedPointerPositions.forEach((pos) => {
        var shape = this.getIntersection(pos);
        DragAndDrop_12.DD.justDragged = false;
        Global_12.Konva["_" + eventType + "ListenClick"] = true;
        if (!shape || !shape.isListening()) {
          this[eventType + "ClickStartShape"] = void 0;
          return;
        }
        if (Global_12.Konva.capturePointerEventsEnabled) {
          shape.setPointerCapture(pos.id);
        }
        this[eventType + "ClickStartShape"] = shape;
        shape._fireAndBubble(events.pointerdown, {
          evt,
          pointerId: pos.id
        });
        triggeredOnShape = true;
        const isTouch = evt.type.indexOf("touch") >= 0;
        if (shape.preventDefault() && evt.cancelable && isTouch) {
          evt.preventDefault();
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointerdown, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._pointerPositions[0].id
        });
      }
    }
    _pointermove(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      if (Global_12.Konva.isDragging() && DragAndDrop_12.DD.node.preventDefault() && evt.cancelable) {
        evt.preventDefault();
      }
      this.setPointersPositions(evt);
      var eventsEnabled = !(Global_12.Konva.isDragging() || Global_12.Konva.isTransforming()) || Global_12.Konva.hitOnDragEnabled;
      if (!eventsEnabled) {
        return;
      }
      var processedShapesIds = {};
      let triggeredOnShape = false;
      var targetShape = this._getTargetShape(eventType);
      this._changedPointerPositions.forEach((pos) => {
        const shape = PointerEvents2.getCapturedShape(pos.id) || this.getIntersection(pos);
        const pointerId = pos.id;
        const event = { evt, pointerId };
        var differentTarget = targetShape !== shape;
        if (differentTarget && targetShape) {
          targetShape._fireAndBubble(events.pointerout, { ...event }, shape);
          targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);
        }
        if (shape) {
          if (processedShapesIds[shape._id]) {
            return;
          }
          processedShapesIds[shape._id] = true;
        }
        if (shape && shape.isListening()) {
          triggeredOnShape = true;
          if (differentTarget) {
            shape._fireAndBubble(events.pointerover, { ...event }, targetShape);
            shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);
            this[eventType + "targetShape"] = shape;
          }
          shape._fireAndBubble(events.pointermove, { ...event });
        } else {
          if (targetShape) {
            this._fire(events.pointerover, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
            this[eventType + "targetShape"] = null;
          }
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointermove, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._changedPointerPositions[0].id
        });
      }
    }
    _pointerup(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      const clickStartShape = this[eventType + "ClickStartShape"];
      const clickEndShape = this[eventType + "ClickEndShape"];
      var processedShapesIds = {};
      let triggeredOnShape = false;
      this._changedPointerPositions.forEach((pos) => {
        const shape = PointerEvents2.getCapturedShape(pos.id) || this.getIntersection(pos);
        if (shape) {
          shape.releaseCapture(pos.id);
          if (processedShapesIds[shape._id]) {
            return;
          }
          processedShapesIds[shape._id] = true;
        }
        const pointerId = pos.id;
        const event = { evt, pointerId };
        let fireDblClick = false;
        if (Global_12.Konva["_" + eventType + "InDblClickWindow"]) {
          fireDblClick = true;
          clearTimeout(this[eventType + "DblTimeout"]);
        } else if (!DragAndDrop_12.DD.justDragged) {
          Global_12.Konva["_" + eventType + "InDblClickWindow"] = true;
          clearTimeout(this[eventType + "DblTimeout"]);
        }
        this[eventType + "DblTimeout"] = setTimeout(function() {
          Global_12.Konva["_" + eventType + "InDblClickWindow"] = false;
        }, Global_12.Konva.dblClickWindow);
        if (shape && shape.isListening()) {
          triggeredOnShape = true;
          this[eventType + "ClickEndShape"] = shape;
          shape._fireAndBubble(events.pointerup, { ...event });
          if (Global_12.Konva["_" + eventType + "ListenClick"] && clickStartShape && clickStartShape === shape) {
            shape._fireAndBubble(events.pointerclick, { ...event });
            if (fireDblClick && clickEndShape && clickEndShape === shape) {
              shape._fireAndBubble(events.pointerdblclick, { ...event });
            }
          }
        } else {
          this[eventType + "ClickEndShape"] = null;
          if (Global_12.Konva["_" + eventType + "ListenClick"]) {
            this._fire(events.pointerclick, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
          }
          if (fireDblClick) {
            this._fire(events.pointerdblclick, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
          }
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointerup, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._changedPointerPositions[0].id
        });
      }
      Global_12.Konva["_" + eventType + "ListenClick"] = false;
      if (evt.cancelable && eventType !== "touch") {
        evt.preventDefault();
      }
    }
    _contextmenu(evt) {
      this.setPointersPositions(evt);
      var shape = this.getIntersection(this.getPointerPosition());
      if (shape && shape.isListening()) {
        shape._fireAndBubble(CONTEXTMENU, { evt });
      } else {
        this._fire(CONTEXTMENU, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _wheel(evt) {
      this.setPointersPositions(evt);
      var shape = this.getIntersection(this.getPointerPosition());
      if (shape && shape.isListening()) {
        shape._fireAndBubble(WHEEL, { evt });
      } else {
        this._fire(WHEEL, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _pointercancel(evt) {
      this.setPointersPositions(evt);
      const shape = PointerEvents2.getCapturedShape(evt.pointerId) || this.getIntersection(this.getPointerPosition());
      if (shape) {
        shape._fireAndBubble(POINTERUP, PointerEvents2.createEvent(evt));
      }
      PointerEvents2.releaseCapture(evt.pointerId);
    }
    _lostpointercapture(evt) {
      PointerEvents2.releaseCapture(evt.pointerId);
    }
    setPointersPositions(evt) {
      var contentPosition = this._getContentPosition(), x2 = null, y2 = null;
      evt = evt ? evt : window.event;
      if (evt.touches !== void 0) {
        this._pointerPositions = [];
        this._changedPointerPositions = [];
        Array.prototype.forEach.call(evt.touches, (touch) => {
          this._pointerPositions.push({
            id: touch.identifier,
            x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,
            y: (touch.clientY - contentPosition.top) / contentPosition.scaleY
          });
        });
        Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {
          this._changedPointerPositions.push({
            id: touch.identifier,
            x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,
            y: (touch.clientY - contentPosition.top) / contentPosition.scaleY
          });
        });
      } else {
        x2 = (evt.clientX - contentPosition.left) / contentPosition.scaleX;
        y2 = (evt.clientY - contentPosition.top) / contentPosition.scaleY;
        this.pointerPos = {
          x: x2,
          y: y2
        };
        this._pointerPositions = [{ x: x2, y: y2, id: Util_12.Util._getFirstPointerId(evt) }];
        this._changedPointerPositions = [
          { x: x2, y: y2, id: Util_12.Util._getFirstPointerId(evt) }
        ];
      }
    }
    _setPointerPosition(evt) {
      Util_12.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.');
      this.setPointersPositions(evt);
    }
    _getContentPosition() {
      if (!this.content || !this.content.getBoundingClientRect) {
        return {
          top: 0,
          left: 0,
          scaleX: 1,
          scaleY: 1
        };
      }
      var rect = this.content.getBoundingClientRect();
      return {
        top: rect.top,
        left: rect.left,
        scaleX: rect.width / this.content.clientWidth || 1,
        scaleY: rect.height / this.content.clientHeight || 1
      };
    }
    _buildDOM() {
      this.bufferCanvas = new Canvas_12.SceneCanvas({
        width: this.width(),
        height: this.height()
      });
      this.bufferHitCanvas = new Canvas_12.HitCanvas({
        pixelRatio: 1,
        width: this.width(),
        height: this.height()
      });
      if (!Global_12.Konva.isBrowser) {
        return;
      }
      var container = this.container();
      if (!container) {
        throw "Stage has no container. A container is required.";
      }
      container.innerHTML = "";
      this.content = document.createElement("div");
      this.content.style.position = "relative";
      this.content.style.userSelect = "none";
      this.content.className = "konvajs-content";
      this.content.setAttribute("role", "presentation");
      container.appendChild(this.content);
      this._resizeDOM();
    }
    cache() {
      Util_12.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.");
      return this;
    }
    clearCache() {
      return this;
    }
    batchDraw() {
      this.getChildren().forEach(function(layer) {
        layer.batchDraw();
      });
      return this;
    }
  }
  exports.Stage = Stage2;
  Stage2.prototype.nodeType = STAGE2;
  (0, Global_22._registerNode)(Stage2);
  Factory_12.Factory.addGetterSetter(Stage2, "container");
  if (Global_12.Konva.isBrowser) {
    document.addEventListener("visibilitychange", () => {
      exports.stages.forEach((stage) => {
        stage.batchDraw();
      });
    });
  }
})(Stage$2);
var Layer$4 = {};
var Shape$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Shape = exports.shapes = void 0;
  const Global_12 = Global$1;
  const Util_12 = Util$1;
  const Factory_12 = Factory$1;
  const Node_12 = Node$3;
  const Validators_12 = Validators$1;
  const Global_22 = Global$1;
  const PointerEvents2 = PointerEvents$1;
  var HAS_SHADOW = "hasShadow";
  var SHADOW_RGBA = "shadowRGBA";
  var patternImage = "patternImage";
  var linearGradient = "linearGradient";
  var radialGradient = "radialGradient";
  let dummyContext2;
  function getDummyContext2() {
    if (dummyContext2) {
      return dummyContext2;
    }
    dummyContext2 = Util_12.Util.createCanvasElement().getContext("2d");
    return dummyContext2;
  }
  exports.shapes = {};
  function _fillFunc2(context) {
    const fillRule = this.attrs.fillRule;
    if (fillRule) {
      context.fill(fillRule);
    } else {
      context.fill();
    }
  }
  function _strokeFunc2(context) {
    context.stroke();
  }
  function _fillFuncHit(context) {
    const fillRule = this.attrs.fillRule;
    if (fillRule) {
      context.fill(fillRule);
    } else {
      context.fill();
    }
  }
  function _strokeFuncHit(context) {
    context.stroke();
  }
  function _clearHasShadowCache() {
    this._clearCache(HAS_SHADOW);
  }
  function _clearGetShadowRGBACache() {
    this._clearCache(SHADOW_RGBA);
  }
  function _clearFillPatternCache() {
    this._clearCache(patternImage);
  }
  function _clearLinearGradientCache() {
    this._clearCache(linearGradient);
  }
  function _clearRadialGradientCache() {
    this._clearCache(radialGradient);
  }
  class Shape2 extends Node_12.Node {
    constructor(config) {
      super(config);
      let key;
      while (true) {
        key = Util_12.Util.getRandomColor();
        if (key && !(key in exports.shapes)) {
          break;
        }
      }
      this.colorKey = key;
      exports.shapes[key] = this;
    }
    getContext() {
      Util_12.Util.warn("shape.getContext() method is deprecated. Please do not use it.");
      return this.getLayer().getContext();
    }
    getCanvas() {
      Util_12.Util.warn("shape.getCanvas() method is deprecated. Please do not use it.");
      return this.getLayer().getCanvas();
    }
    getSceneFunc() {
      return this.attrs.sceneFunc || this["_sceneFunc"];
    }
    getHitFunc() {
      return this.attrs.hitFunc || this["_hitFunc"];
    }
    hasShadow() {
      return this._getCache(HAS_SHADOW, this._hasShadow);
    }
    _hasShadow() {
      return this.shadowEnabled() && this.shadowOpacity() !== 0 && !!(this.shadowColor() || this.shadowBlur() || this.shadowOffsetX() || this.shadowOffsetY());
    }
    _getFillPattern() {
      return this._getCache(patternImage, this.__getFillPattern);
    }
    __getFillPattern() {
      if (this.fillPatternImage()) {
        var ctx = getDummyContext2();
        const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || "repeat");
        if (pattern && pattern.setTransform) {
          const tr = new Util_12.Transform();
          tr.translate(this.fillPatternX(), this.fillPatternY());
          tr.rotate(Global_12.Konva.getAngle(this.fillPatternRotation()));
          tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());
          tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());
          const m2 = tr.getMatrix();
          const matrix = typeof DOMMatrix === "undefined" ? {
            a: m2[0],
            b: m2[1],
            c: m2[2],
            d: m2[3],
            e: m2[4],
            f: m2[5]
          } : new DOMMatrix(m2);
          pattern.setTransform(matrix);
        }
        return pattern;
      }
    }
    _getLinearGradient() {
      return this._getCache(linearGradient, this.__getLinearGradient);
    }
    __getLinearGradient() {
      var colorStops = this.fillLinearGradientColorStops();
      if (colorStops) {
        var ctx = getDummyContext2();
        var start2 = this.fillLinearGradientStartPoint();
        var end2 = this.fillLinearGradientEndPoint();
        var grd = ctx.createLinearGradient(start2.x, start2.y, end2.x, end2.y);
        for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
          grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
        }
        return grd;
      }
    }
    _getRadialGradient() {
      return this._getCache(radialGradient, this.__getRadialGradient);
    }
    __getRadialGradient() {
      var colorStops = this.fillRadialGradientColorStops();
      if (colorStops) {
        var ctx = getDummyContext2();
        var start2 = this.fillRadialGradientStartPoint();
        var end2 = this.fillRadialGradientEndPoint();
        var grd = ctx.createRadialGradient(start2.x, start2.y, this.fillRadialGradientStartRadius(), end2.x, end2.y, this.fillRadialGradientEndRadius());
        for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
          grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
        }
        return grd;
      }
    }
    getShadowRGBA() {
      return this._getCache(SHADOW_RGBA, this._getShadowRGBA);
    }
    _getShadowRGBA() {
      if (!this.hasShadow()) {
        return;
      }
      var rgba = Util_12.Util.colorToRGBA(this.shadowColor());
      if (rgba) {
        return "rgba(" + rgba.r + "," + rgba.g + "," + rgba.b + "," + rgba.a * (this.shadowOpacity() || 1) + ")";
      }
    }
    hasFill() {
      return this._calculate("hasFill", [
        "fillEnabled",
        "fill",
        "fillPatternImage",
        "fillLinearGradientColorStops",
        "fillRadialGradientColorStops"
      ], () => {
        return this.fillEnabled() && !!(this.fill() || this.fillPatternImage() || this.fillLinearGradientColorStops() || this.fillRadialGradientColorStops());
      });
    }
    hasStroke() {
      return this._calculate("hasStroke", [
        "strokeEnabled",
        "strokeWidth",
        "stroke",
        "strokeLinearGradientColorStops"
      ], () => {
        return this.strokeEnabled() && this.strokeWidth() && !!(this.stroke() || this.strokeLinearGradientColorStops());
      });
    }
    hasHitStroke() {
      const width = this.hitStrokeWidth();
      if (width === "auto") {
        return this.hasStroke();
      }
      return this.strokeEnabled() && !!width;
    }
    intersects(point) {
      var stage = this.getStage();
      if (!stage) {
        return false;
      }
      const bufferHitCanvas = stage.bufferHitCanvas;
      bufferHitCanvas.getContext().clear();
      this.drawHit(bufferHitCanvas, void 0, true);
      const p2 = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;
      return p2[3] > 0;
    }
    destroy() {
      Node_12.Node.prototype.destroy.call(this);
      delete exports.shapes[this.colorKey];
      delete this.colorKey;
      return this;
    }
    _useBufferCanvas(forceFill) {
      var _a2;
      const perfectDrawEnabled = (_a2 = this.attrs.perfectDrawEnabled) !== null && _a2 !== void 0 ? _a2 : true;
      if (!perfectDrawEnabled) {
        return false;
      }
      const hasFill = forceFill || this.hasFill();
      const hasStroke = this.hasStroke();
      const isTransparent = this.getAbsoluteOpacity() !== 1;
      if (hasFill && hasStroke && isTransparent) {
        return true;
      }
      const hasShadow = this.hasShadow();
      const strokeForShadow = this.shadowForStrokeEnabled();
      if (hasFill && hasStroke && hasShadow && strokeForShadow) {
        return true;
      }
      return false;
    }
    setStrokeHitEnabled(val) {
      Util_12.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.");
      if (val) {
        this.hitStrokeWidth("auto");
      } else {
        this.hitStrokeWidth(0);
      }
    }
    getStrokeHitEnabled() {
      if (this.hitStrokeWidth() === 0) {
        return false;
      } else {
        return true;
      }
    }
    getSelfRect() {
      var size = this.size();
      return {
        x: this._centroid ? -size.width / 2 : 0,
        y: this._centroid ? -size.height / 2 : 0,
        width: size.width,
        height: size.height
      };
    }
    getClientRect(config = {}) {
      let hasCachedParent = false;
      let parent = this.getParent();
      while (parent) {
        if (parent.isCached()) {
          hasCachedParent = true;
          break;
        }
        parent = parent.getParent();
      }
      const skipTransform = config.skipTransform;
      const relativeTo = config.relativeTo || hasCachedParent && this.getStage() || void 0;
      const fillRect = this.getSelfRect();
      const applyStroke = !config.skipStroke && this.hasStroke();
      const strokeWidth = applyStroke && this.strokeWidth() || 0;
      const fillAndStrokeWidth = fillRect.width + strokeWidth;
      const fillAndStrokeHeight = fillRect.height + strokeWidth;
      const applyShadow = !config.skipShadow && this.hasShadow();
      const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;
      const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;
      const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);
      const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);
      const blurRadius = applyShadow && this.shadowBlur() || 0;
      const width = preWidth + blurRadius * 2;
      const height = preHeight + blurRadius * 2;
      const rect = {
        width,
        height,
        x: -(strokeWidth / 2 + blurRadius) + Math.min(shadowOffsetX, 0) + fillRect.x,
        y: -(strokeWidth / 2 + blurRadius) + Math.min(shadowOffsetY, 0) + fillRect.y
      };
      if (!skipTransform) {
        return this._transformedRect(rect, relativeTo);
      }
      return rect;
    }
    drawScene(can, top2, bufferCanvas) {
      var layer = this.getLayer();
      var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;
      var skipBuffer = canvas.isCache;
      var cachingSelf = top2 === this;
      if (!this.isVisible() && !cachingSelf) {
        return this;
      }
      if (cachedCanvas) {
        context.save();
        var m2 = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
        this._drawCachedSceneCanvas(context);
        context.restore();
        return this;
      }
      if (!drawFunc) {
        return this;
      }
      context.save();
      if (this._useBufferCanvas() && !skipBuffer) {
        stage = this.getStage();
        const bc2 = bufferCanvas || stage.bufferCanvas;
        bufferContext = bc2.getContext();
        bufferContext.clear();
        bufferContext.save();
        bufferContext._applyLineJoin(this);
        var o = this.getAbsoluteTransform(top2).getMatrix();
        bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
        drawFunc.call(this, bufferContext, this);
        bufferContext.restore();
        var ratio = bc2.pixelRatio;
        if (hasShadow) {
          context._applyShadow(this);
        }
        context._applyOpacity(this);
        context._applyGlobalCompositeOperation(this);
        context.drawImage(bc2._canvas, 0, 0, bc2.width / ratio, bc2.height / ratio);
      } else {
        context._applyLineJoin(this);
        if (!cachingSelf) {
          var o = this.getAbsoluteTransform(top2).getMatrix();
          context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
          context._applyOpacity(this);
          context._applyGlobalCompositeOperation(this);
        }
        if (hasShadow) {
          context._applyShadow(this);
        }
        drawFunc.call(this, context, this);
      }
      context.restore();
      return this;
    }
    drawHit(can, top2, skipDragCheck = false) {
      if (!this.shouldDrawHit(top2, skipDragCheck)) {
        return this;
      }
      var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
      if (!this.colorKey) {
        Util_12.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()");
      }
      if (cachedHitCanvas) {
        context.save();
        var m2 = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
        this._drawCachedHitCanvas(context);
        context.restore();
        return this;
      }
      if (!drawFunc) {
        return this;
      }
      context.save();
      context._applyLineJoin(this);
      const selfCache = this === top2;
      if (!selfCache) {
        var o = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
      }
      drawFunc.call(this, context, this);
      context.restore();
      return this;
    }
    drawHitFromCache(alphaThreshold = 0) {
      var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
      hitContext.clear();
      hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
      try {
        hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
        hitData = hitImageData.data;
        len = hitData.length;
        rgbColorKey = Util_12.Util._hexToRgb(this.colorKey);
        for (i = 0; i < len; i += 4) {
          alpha = hitData[i + 3];
          if (alpha > alphaThreshold) {
            hitData[i] = rgbColorKey.r;
            hitData[i + 1] = rgbColorKey.g;
            hitData[i + 2] = rgbColorKey.b;
            hitData[i + 3] = 255;
          } else {
            hitData[i + 3] = 0;
          }
        }
        hitContext.putImageData(hitImageData, 0, 0);
      } catch (e2) {
        Util_12.Util.error("Unable to draw hit graph from cached scene canvas. " + e2.message);
      }
      return this;
    }
    hasPointerCapture(pointerId) {
      return PointerEvents2.hasPointerCapture(pointerId, this);
    }
    setPointerCapture(pointerId) {
      PointerEvents2.setPointerCapture(pointerId, this);
    }
    releaseCapture(pointerId) {
      PointerEvents2.releaseCapture(pointerId, this);
    }
  }
  exports.Shape = Shape2;
  Shape2.prototype._fillFunc = _fillFunc2;
  Shape2.prototype._strokeFunc = _strokeFunc2;
  Shape2.prototype._fillFuncHit = _fillFuncHit;
  Shape2.prototype._strokeFuncHit = _strokeFuncHit;
  Shape2.prototype._centroid = false;
  Shape2.prototype.nodeType = "Shape";
  (0, Global_22._registerNode)(Shape2);
  Shape2.prototype.eventListeners = {};
  Shape2.prototype.on.call(Shape2.prototype, "shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", _clearHasShadowCache);
  Shape2.prototype.on.call(Shape2.prototype, "shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", _clearGetShadowRGBACache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva", _clearFillPatternCache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva", _clearLinearGradientCache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva", _clearRadialGradientCache);
  Factory_12.Factory.addGetterSetter(Shape2, "stroke", void 0, (0, Validators_12.getStringOrGradientValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "strokeWidth", 2, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillAfterStrokeEnabled", false);
  Factory_12.Factory.addGetterSetter(Shape2, "hitStrokeWidth", "auto", (0, Validators_12.getNumberOrAutoValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "strokeHitEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "perfectDrawEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowForStrokeEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "lineJoin");
  Factory_12.Factory.addGetterSetter(Shape2, "lineCap");
  Factory_12.Factory.addGetterSetter(Shape2, "sceneFunc");
  Factory_12.Factory.addGetterSetter(Shape2, "hitFunc");
  Factory_12.Factory.addGetterSetter(Shape2, "dash");
  Factory_12.Factory.addGetterSetter(Shape2, "dashOffset", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowColor", void 0, (0, Validators_12.getStringValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowBlur", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOpacity", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "shadowOffset", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOffsetX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOffsetY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternImage");
  Factory_12.Factory.addGetterSetter(Shape2, "fill", void 0, (0, Validators_12.getStringOrGradientValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartRadius", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndRadius", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternRepeat", "repeat");
  Factory_12.Factory.addGetterSetter(Shape2, "fillEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "shadowEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "dashEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeScaleEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPriority", "color");
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillPatternOffset", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternOffsetX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternOffsetY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillPatternScale", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternScaleX", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternScaleY", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillLinearGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "strokeLinearGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientStartPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientStartPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillLinearGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "strokeLinearGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientEndPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientEndPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillRadialGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillRadialGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternRotation", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRule", void 0, (0, Validators_12.getStringValidator)());
  Factory_12.Factory.backCompat(Shape2, {
    dashArray: "dash",
    getDashArray: "getDash",
    setDashArray: "getDash",
    drawFunc: "sceneFunc",
    getDrawFunc: "getSceneFunc",
    setDrawFunc: "setSceneFunc",
    drawHitFunc: "hitFunc",
    getDrawHitFunc: "getHitFunc",
    setDrawHitFunc: "setHitFunc"
  });
})(Shape$1);
Object.defineProperty(Layer$4, "__esModule", { value: true });
Layer$4.Layer = void 0;
const Util_1$r = Util$1;
const Container_1$3 = Container$6;
const Node_1$y = Node$3;
const Factory_1$14 = Factory$1;
const Canvas_1$2 = Canvas$3;
const Validators_1$12 = Validators$1;
const Shape_1$x = Shape$1;
const Global_1$K = Global$1;
var HASH$1 = "#", BEFORE_DRAW$1 = "beforeDraw", DRAW$1 = "draw", INTERSECTION_OFFSETS$1 = [
  { x: 0, y: 0 },
  { x: -1, y: -1 },
  { x: 1, y: -1 },
  { x: 1, y: 1 },
  { x: -1, y: 1 }
], INTERSECTION_OFFSETS_LEN$1 = INTERSECTION_OFFSETS$1.length;
let Layer$3 = class Layer extends Container_1$3.Container {
  constructor(config) {
    super(config);
    this.canvas = new Canvas_1$2.SceneCanvas();
    this.hitCanvas = new Canvas_1$2.HitCanvas({
      pixelRatio: 1
    });
    this._waitingForDraw = false;
    this.on("visibleChange.konva", this._checkVisibility);
    this._checkVisibility();
    this.on("imageSmoothingEnabledChange.konva", this._setSmoothEnabled);
    this._setSmoothEnabled();
  }
  createPNGStream() {
    const c2 = this.canvas._canvas;
    return c2.createPNGStream();
  }
  getCanvas() {
    return this.canvas;
  }
  getNativeCanvasElement() {
    return this.canvas._canvas;
  }
  getHitCanvas() {
    return this.hitCanvas;
  }
  getContext() {
    return this.getCanvas().getContext();
  }
  clear(bounds) {
    this.getContext().clear(bounds);
    this.getHitCanvas().getContext().clear(bounds);
    return this;
  }
  setZIndex(index) {
    super.setZIndex(index);
    var stage = this.getStage();
    if (stage && stage.content) {
      stage.content.removeChild(this.getNativeCanvasElement());
      if (index < stage.children.length - 1) {
        stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);
      } else {
        stage.content.appendChild(this.getNativeCanvasElement());
      }
    }
    return this;
  }
  moveToTop() {
    Node_1$y.Node.prototype.moveToTop.call(this);
    var stage = this.getStage();
    if (stage && stage.content) {
      stage.content.removeChild(this.getNativeCanvasElement());
      stage.content.appendChild(this.getNativeCanvasElement());
    }
    return true;
  }
  moveUp() {
    var moved = Node_1$y.Node.prototype.moveUp.call(this);
    if (!moved) {
      return false;
    }
    var stage = this.getStage();
    if (!stage || !stage.content) {
      return false;
    }
    stage.content.removeChild(this.getNativeCanvasElement());
    if (this.index < stage.children.length - 1) {
      stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);
    } else {
      stage.content.appendChild(this.getNativeCanvasElement());
    }
    return true;
  }
  moveDown() {
    if (Node_1$y.Node.prototype.moveDown.call(this)) {
      var stage = this.getStage();
      if (stage) {
        var children = stage.children;
        if (stage.content) {
          stage.content.removeChild(this.getNativeCanvasElement());
          stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);
        }
      }
      return true;
    }
    return false;
  }
  moveToBottom() {
    if (Node_1$y.Node.prototype.moveToBottom.call(this)) {
      var stage = this.getStage();
      if (stage) {
        var children = stage.children;
        if (stage.content) {
          stage.content.removeChild(this.getNativeCanvasElement());
          stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);
        }
      }
      return true;
    }
    return false;
  }
  getLayer() {
    return this;
  }
  remove() {
    var _canvas = this.getNativeCanvasElement();
    Node_1$y.Node.prototype.remove.call(this);
    if (_canvas && _canvas.parentNode && Util_1$r.Util._isInDocument(_canvas)) {
      _canvas.parentNode.removeChild(_canvas);
    }
    return this;
  }
  getStage() {
    return this.parent;
  }
  setSize({ width, height }) {
    this.canvas.setSize(width, height);
    this.hitCanvas.setSize(width, height);
    this._setSmoothEnabled();
    return this;
  }
  _validateAdd(child) {
    var type = child.getType();
    if (type !== "Group" && type !== "Shape") {
      Util_1$r.Util.throw("You may only add groups and shapes to a layer.");
    }
  }
  _toKonvaCanvas(config) {
    config = config || {};
    config.width = config.width || this.getWidth();
    config.height = config.height || this.getHeight();
    config.x = config.x !== void 0 ? config.x : this.x();
    config.y = config.y !== void 0 ? config.y : this.y();
    return Node_1$y.Node.prototype._toKonvaCanvas.call(this, config);
  }
  _checkVisibility() {
    const visible = this.visible();
    if (visible) {
      this.canvas._canvas.style.display = "block";
    } else {
      this.canvas._canvas.style.display = "none";
    }
  }
  _setSmoothEnabled() {
    this.getContext()._context.imageSmoothingEnabled = this.imageSmoothingEnabled();
  }
  getWidth() {
    if (this.parent) {
      return this.parent.width();
    }
  }
  setWidth() {
    Util_1$r.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.');
  }
  getHeight() {
    if (this.parent) {
      return this.parent.height();
    }
  }
  setHeight() {
    Util_1$r.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.');
  }
  batchDraw() {
    if (!this._waitingForDraw) {
      this._waitingForDraw = true;
      Util_1$r.Util.requestAnimFrame(() => {
        this.draw();
        this._waitingForDraw = false;
      });
    }
    return this;
  }
  getIntersection(pos) {
    if (!this.isListening() || !this.isVisible()) {
      return null;
    }
    var spiralSearchDistance = 1;
    var continueSearch = false;
    while (true) {
      for (let i = 0; i < INTERSECTION_OFFSETS_LEN$1; i++) {
        const intersectionOffset = INTERSECTION_OFFSETS$1[i];
        const obj = this._getIntersection({
          x: pos.x + intersectionOffset.x * spiralSearchDistance,
          y: pos.y + intersectionOffset.y * spiralSearchDistance
        });
        const shape = obj.shape;
        if (shape) {
          return shape;
        }
        continueSearch = !!obj.antialiased;
        if (!obj.antialiased) {
          break;
        }
      }
      if (continueSearch) {
        spiralSearchDistance += 1;
      } else {
        return null;
      }
    }
  }
  _getIntersection(pos) {
    const ratio = this.hitCanvas.pixelRatio;
    const p2 = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;
    const p3 = p2[3];
    if (p3 === 255) {
      const colorKey = Util_1$r.Util._rgbToHex(p2[0], p2[1], p2[2]);
      const shape = Shape_1$x.shapes[HASH$1 + colorKey];
      if (shape) {
        return {
          shape
        };
      }
      return {
        antialiased: true
      };
    } else if (p3 > 0) {
      return {
        antialiased: true
      };
    }
    return {};
  }
  drawScene(can, top2) {
    var layer = this.getLayer(), canvas = can || layer && layer.getCanvas();
    this._fire(BEFORE_DRAW$1, {
      node: this
    });
    if (this.clearBeforeDraw()) {
      canvas.getContext().clear();
    }
    Container_1$3.Container.prototype.drawScene.call(this, canvas, top2);
    this._fire(DRAW$1, {
      node: this
    });
    return this;
  }
  drawHit(can, top2) {
    var layer = this.getLayer(), canvas = can || layer && layer.hitCanvas;
    if (layer && layer.clearBeforeDraw()) {
      layer.getHitCanvas().getContext().clear();
    }
    Container_1$3.Container.prototype.drawHit.call(this, canvas, top2);
    return this;
  }
  enableHitGraph() {
    this.hitGraphEnabled(true);
    return this;
  }
  disableHitGraph() {
    this.hitGraphEnabled(false);
    return this;
  }
  setHitGraphEnabled(val) {
    Util_1$r.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead.");
    this.listening(val);
  }
  getHitGraphEnabled(val) {
    Util_1$r.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead.");
    return this.listening();
  }
  toggleHitCanvas() {
    if (!this.parent || !this.parent["content"]) {
      return;
    }
    var parent = this.parent;
    var added = !!this.hitCanvas._canvas.parentNode;
    if (added) {
      parent.content.removeChild(this.hitCanvas._canvas);
    } else {
      parent.content.appendChild(this.hitCanvas._canvas);
    }
  }
  destroy() {
    Util_1$r.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);
    return super.destroy();
  }
};
Layer$4.Layer = Layer$3;
Layer$3.prototype.nodeType = "Layer";
(0, Global_1$K._registerNode)(Layer$3);
Factory_1$14.Factory.addGetterSetter(Layer$3, "imageSmoothingEnabled", true);
Factory_1$14.Factory.addGetterSetter(Layer$3, "clearBeforeDraw", true);
Factory_1$14.Factory.addGetterSetter(Layer$3, "hitGraphEnabled", true, (0, Validators_1$12.getBooleanValidator)());
var FastLayer$3 = {};
Object.defineProperty(FastLayer$3, "__esModule", { value: true });
FastLayer$3.FastLayer = void 0;
const Util_1$q = Util$1;
const Layer_1$1 = Layer$4;
const Global_1$J = Global$1;
let FastLayer$2 = class FastLayer extends Layer_1$1.Layer {
  constructor(attrs) {
    super(attrs);
    this.listening(false);
    Util_1$q.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.');
  }
};
FastLayer$3.FastLayer = FastLayer$2;
FastLayer$2.prototype.nodeType = "FastLayer";
(0, Global_1$J._registerNode)(FastLayer$2);
var Group$4 = {};
Object.defineProperty(Group$4, "__esModule", { value: true });
Group$4.Group = void 0;
const Util_1$p = Util$1;
const Container_1$2 = Container$6;
const Global_1$I = Global$1;
let Group$3 = class Group extends Container_1$2.Container {
  _validateAdd(child) {
    var type = child.getType();
    if (type !== "Group" && type !== "Shape") {
      Util_1$p.Util.throw("You may only add groups and shapes to groups.");
    }
  }
};
Group$4.Group = Group$3;
Group$3.prototype.nodeType = "Group";
(0, Global_1$I._registerNode)(Group$3);
var Animation$3 = {};
Object.defineProperty(Animation$3, "__esModule", { value: true });
Animation$3.Animation = void 0;
const Global_1$H = Global$1;
const Util_1$o = Util$1;
const now$1 = function() {
  if (Global_1$H.glob.performance && Global_1$H.glob.performance.now) {
    return function() {
      return Global_1$H.glob.performance.now();
    };
  }
  return function() {
    return (/* @__PURE__ */ new Date()).getTime();
  };
}();
let Animation$2 = class Animation {
  constructor(func, layers) {
    this.id = Animation.animIdCounter++;
    this.frame = {
      time: 0,
      timeDiff: 0,
      lastTime: now$1(),
      frameRate: 0
    };
    this.func = func;
    this.setLayers(layers);
  }
  setLayers(layers) {
    let lays = [];
    if (layers) {
      lays = Array.isArray(layers) ? layers : [layers];
    }
    this.layers = lays;
    return this;
  }
  getLayers() {
    return this.layers;
  }
  addLayer(layer) {
    const layers = this.layers;
    const len = layers.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (layers[n2]._id === layer._id) {
        return false;
      }
    }
    this.layers.push(layer);
    return true;
  }
  isRunning() {
    const a = Animation;
    const animations = a.animations;
    const len = animations.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (animations[n2].id === this.id) {
        return true;
      }
    }
    return false;
  }
  start() {
    this.stop();
    this.frame.timeDiff = 0;
    this.frame.lastTime = now$1();
    Animation._addAnimation(this);
    return this;
  }
  stop() {
    Animation._removeAnimation(this);
    return this;
  }
  _updateFrameObject(time) {
    this.frame.timeDiff = time - this.frame.lastTime;
    this.frame.lastTime = time;
    this.frame.time += this.frame.timeDiff;
    this.frame.frameRate = 1e3 / this.frame.timeDiff;
  }
  static _addAnimation(anim) {
    this.animations.push(anim);
    this._handleAnimation();
  }
  static _removeAnimation(anim) {
    const id2 = anim.id;
    const animations = this.animations;
    const len = animations.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (animations[n2].id === id2) {
        this.animations.splice(n2, 1);
        break;
      }
    }
  }
  static _runFrames() {
    const layerHash = {};
    const animations = this.animations;
    for (let n2 = 0; n2 < animations.length; n2++) {
      const anim = animations[n2];
      const layers = anim.layers;
      const func = anim.func;
      anim._updateFrameObject(now$1());
      const layersLen = layers.length;
      let needRedraw;
      if (func) {
        needRedraw = func.call(anim, anim.frame) !== false;
      } else {
        needRedraw = true;
      }
      if (!needRedraw) {
        continue;
      }
      for (let i = 0; i < layersLen; i++) {
        const layer = layers[i];
        if (layer._id !== void 0) {
          layerHash[layer._id] = layer;
        }
      }
    }
    for (let key in layerHash) {
      if (!layerHash.hasOwnProperty(key)) {
        continue;
      }
      layerHash[key].batchDraw();
    }
  }
  static _animationLoop() {
    const Anim = Animation;
    if (Anim.animations.length) {
      Anim._runFrames();
      Util_1$o.Util.requestAnimFrame(Anim._animationLoop);
    } else {
      Anim.animRunning = false;
    }
  }
  static _handleAnimation() {
    if (!this.animRunning) {
      this.animRunning = true;
      Util_1$o.Util.requestAnimFrame(this._animationLoop);
    }
  }
};
Animation$3.Animation = Animation$2;
Animation$2.animations = [];
Animation$2.animIdCounter = 0;
Animation$2.animRunning = false;
var Tween$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Easings = exports.Tween = void 0;
  const Util_12 = Util$1;
  const Animation_12 = Animation$3;
  const Node_12 = Node$3;
  const Global_12 = Global$1;
  var blacklist = {
    node: 1,
    duration: 1,
    easing: 1,
    onFinish: 1,
    yoyo: 1
  }, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter2 = 0, colorAttrs = ["fill", "stroke", "shadowColor"];
  class TweenEngine {
    constructor(prop, propFunc, func, begin, finish, duration, yoyo) {
      this.prop = prop;
      this.propFunc = propFunc;
      this.begin = begin;
      this._pos = begin;
      this.duration = duration;
      this._change = 0;
      this.prevPos = 0;
      this.yoyo = yoyo;
      this._time = 0;
      this._position = 0;
      this._startTime = 0;
      this._finish = 0;
      this.func = func;
      this._change = finish - this.begin;
      this.pause();
    }
    fire(str) {
      var handler = this[str];
      if (handler) {
        handler();
      }
    }
    setTime(t2) {
      if (t2 > this.duration) {
        if (this.yoyo) {
          this._time = this.duration;
          this.reverse();
        } else {
          this.finish();
        }
      } else if (t2 < 0) {
        if (this.yoyo) {
          this._time = 0;
          this.play();
        } else {
          this.reset();
        }
      } else {
        this._time = t2;
        this.update();
      }
    }
    getTime() {
      return this._time;
    }
    setPosition(p2) {
      this.prevPos = this._pos;
      this.propFunc(p2);
      this._pos = p2;
    }
    getPosition(t2) {
      if (t2 === void 0) {
        t2 = this._time;
      }
      return this.func(t2, this.begin, this._change, this.duration);
    }
    play() {
      this.state = PLAYING;
      this._startTime = this.getTimer() - this._time;
      this.onEnterFrame();
      this.fire("onPlay");
    }
    reverse() {
      this.state = REVERSING;
      this._time = this.duration - this._time;
      this._startTime = this.getTimer() - this._time;
      this.onEnterFrame();
      this.fire("onReverse");
    }
    seek(t2) {
      this.pause();
      this._time = t2;
      this.update();
      this.fire("onSeek");
    }
    reset() {
      this.pause();
      this._time = 0;
      this.update();
      this.fire("onReset");
    }
    finish() {
      this.pause();
      this._time = this.duration;
      this.update();
      this.fire("onFinish");
    }
    update() {
      this.setPosition(this.getPosition(this._time));
      this.fire("onUpdate");
    }
    onEnterFrame() {
      var t2 = this.getTimer() - this._startTime;
      if (this.state === PLAYING) {
        this.setTime(t2);
      } else if (this.state === REVERSING) {
        this.setTime(this.duration - t2);
      }
    }
    pause() {
      this.state = PAUSED;
      this.fire("onPause");
    }
    getTimer() {
      return (/* @__PURE__ */ new Date()).getTime();
    }
  }
  class Tween2 {
    constructor(config) {
      var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
      if (typeof config.duration === "undefined") {
        duration = 0.3;
      } else if (config.duration === 0) {
        duration = 1e-3;
      } else {
        duration = config.duration;
      }
      this.node = node;
      this._id = idCounter2++;
      var layers = node.getLayer() || (node instanceof Global_12.Konva["Stage"] ? node.getLayers() : null);
      if (!layers) {
        Util_12.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first.");
      }
      this.anim = new Animation_12.Animation(function() {
        that.tween.onEnterFrame();
      }, layers);
      this.tween = new TweenEngine(key, function(i) {
        that._tweenFunc(i);
      }, easing, 0, 1, duration * 1e3, yoyo);
      this._addListeners();
      if (!Tween2.attrs[nodeId]) {
        Tween2.attrs[nodeId] = {};
      }
      if (!Tween2.attrs[nodeId][this._id]) {
        Tween2.attrs[nodeId][this._id] = {};
      }
      if (!Tween2.tweens[nodeId]) {
        Tween2.tweens[nodeId] = {};
      }
      for (key in config) {
        if (blacklist[key] === void 0) {
          this._addAttr(key, config[key]);
        }
      }
      this.reset();
      this.onFinish = config.onFinish;
      this.onReset = config.onReset;
      this.onUpdate = config.onUpdate;
    }
    _addAttr(key, end2) {
      var node = this.node, nodeId = node._id, start2, diff, tweenId, n2, len, trueEnd, trueStart, endRGBA;
      tweenId = Tween2.tweens[nodeId][key];
      if (tweenId) {
        delete Tween2.attrs[nodeId][tweenId][key];
      }
      start2 = node.getAttr(key);
      if (Util_12.Util._isArray(end2)) {
        diff = [];
        len = Math.max(end2.length, start2.length);
        if (key === "points" && end2.length !== start2.length) {
          if (end2.length > start2.length) {
            trueStart = start2;
            start2 = Util_12.Util._prepareArrayForTween(start2, end2, node.closed());
          } else {
            trueEnd = end2;
            end2 = Util_12.Util._prepareArrayForTween(end2, start2, node.closed());
          }
        }
        if (key.indexOf("fill") === 0) {
          for (n2 = 0; n2 < len; n2++) {
            if (n2 % 2 === 0) {
              diff.push(end2[n2] - start2[n2]);
            } else {
              var startRGBA = Util_12.Util.colorToRGBA(start2[n2]);
              endRGBA = Util_12.Util.colorToRGBA(end2[n2]);
              start2[n2] = startRGBA;
              diff.push({
                r: endRGBA.r - startRGBA.r,
                g: endRGBA.g - startRGBA.g,
                b: endRGBA.b - startRGBA.b,
                a: endRGBA.a - startRGBA.a
              });
            }
          }
        } else {
          for (n2 = 0; n2 < len; n2++) {
            diff.push(end2[n2] - start2[n2]);
          }
        }
      } else if (colorAttrs.indexOf(key) !== -1) {
        start2 = Util_12.Util.colorToRGBA(start2);
        endRGBA = Util_12.Util.colorToRGBA(end2);
        diff = {
          r: endRGBA.r - start2.r,
          g: endRGBA.g - start2.g,
          b: endRGBA.b - start2.b,
          a: endRGBA.a - start2.a
        };
      } else {
        diff = end2 - start2;
      }
      Tween2.attrs[nodeId][this._id][key] = {
        start: start2,
        diff,
        end: end2,
        trueEnd,
        trueStart
      };
      Tween2.tweens[nodeId][key] = this._id;
    }
    _tweenFunc(i) {
      var node = this.node, attrs = Tween2.attrs[node._id][this._id], key, attr, start2, diff, newVal, n2, len, end2;
      for (key in attrs) {
        attr = attrs[key];
        start2 = attr.start;
        diff = attr.diff;
        end2 = attr.end;
        if (Util_12.Util._isArray(start2)) {
          newVal = [];
          len = Math.max(start2.length, end2.length);
          if (key.indexOf("fill") === 0) {
            for (n2 = 0; n2 < len; n2++) {
              if (n2 % 2 === 0) {
                newVal.push((start2[n2] || 0) + diff[n2] * i);
              } else {
                newVal.push("rgba(" + Math.round(start2[n2].r + diff[n2].r * i) + "," + Math.round(start2[n2].g + diff[n2].g * i) + "," + Math.round(start2[n2].b + diff[n2].b * i) + "," + (start2[n2].a + diff[n2].a * i) + ")");
              }
            }
          } else {
            for (n2 = 0; n2 < len; n2++) {
              newVal.push((start2[n2] || 0) + diff[n2] * i);
            }
          }
        } else if (colorAttrs.indexOf(key) !== -1) {
          newVal = "rgba(" + Math.round(start2.r + diff.r * i) + "," + Math.round(start2.g + diff.g * i) + "," + Math.round(start2.b + diff.b * i) + "," + (start2.a + diff.a * i) + ")";
        } else {
          newVal = start2 + diff * i;
        }
        node.setAttr(key, newVal);
      }
    }
    _addListeners() {
      this.tween.onPlay = () => {
        this.anim.start();
      };
      this.tween.onReverse = () => {
        this.anim.start();
      };
      this.tween.onPause = () => {
        this.anim.stop();
      };
      this.tween.onFinish = () => {
        var node = this.node;
        var attrs = Tween2.attrs[node._id][this._id];
        if (attrs.points && attrs.points.trueEnd) {
          node.setAttr("points", attrs.points.trueEnd);
        }
        if (this.onFinish) {
          this.onFinish.call(this);
        }
      };
      this.tween.onReset = () => {
        var node = this.node;
        var attrs = Tween2.attrs[node._id][this._id];
        if (attrs.points && attrs.points.trueStart) {
          node.points(attrs.points.trueStart);
        }
        if (this.onReset) {
          this.onReset();
        }
      };
      this.tween.onUpdate = () => {
        if (this.onUpdate) {
          this.onUpdate.call(this);
        }
      };
    }
    play() {
      this.tween.play();
      return this;
    }
    reverse() {
      this.tween.reverse();
      return this;
    }
    reset() {
      this.tween.reset();
      return this;
    }
    seek(t2) {
      this.tween.seek(t2 * 1e3);
      return this;
    }
    pause() {
      this.tween.pause();
      return this;
    }
    finish() {
      this.tween.finish();
      return this;
    }
    destroy() {
      var nodeId = this.node._id, thisId = this._id, attrs = Tween2.tweens[nodeId], key;
      this.pause();
      for (key in attrs) {
        delete Tween2.tweens[nodeId][key];
      }
      delete Tween2.attrs[nodeId][thisId];
    }
  }
  exports.Tween = Tween2;
  Tween2.attrs = {};
  Tween2.tweens = {};
  Node_12.Node.prototype.to = function(params) {
    var onFinish = params.onFinish;
    params.node = this;
    params.onFinish = function() {
      this.destroy();
      if (onFinish) {
        onFinish();
      }
    };
    var tween = new Tween2(params);
    tween.play();
  };
  exports.Easings = {
    BackEaseIn(t2, b2, c2, d2) {
      var s = 1.70158;
      return c2 * (t2 /= d2) * t2 * ((s + 1) * t2 - s) + b2;
    },
    BackEaseOut(t2, b2, c2, d2) {
      var s = 1.70158;
      return c2 * ((t2 = t2 / d2 - 1) * t2 * ((s + 1) * t2 + s) + 1) + b2;
    },
    BackEaseInOut(t2, b2, c2, d2) {
      var s = 1.70158;
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * (t2 * t2 * (((s *= 1.525) + 1) * t2 - s)) + b2;
      }
      return c2 / 2 * ((t2 -= 2) * t2 * (((s *= 1.525) + 1) * t2 + s) + 2) + b2;
    },
    ElasticEaseIn(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2) === 1) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * 0.3;
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      return -(a * Math.pow(2, 10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2)) + b2;
    },
    ElasticEaseOut(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2) === 1) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * 0.3;
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      return a * Math.pow(2, -10 * t2) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2) + c2 + b2;
    },
    ElasticEaseInOut(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2 / 2) === 2) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * (0.3 * 1.5);
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      if (t2 < 1) {
        return -0.5 * (a * Math.pow(2, 10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2)) + b2;
      }
      return a * Math.pow(2, -10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2) * 0.5 + c2 + b2;
    },
    BounceEaseOut(t2, b2, c2, d2) {
      if ((t2 /= d2) < 1 / 2.75) {
        return c2 * (7.5625 * t2 * t2) + b2;
      } else if (t2 < 2 / 2.75) {
        return c2 * (7.5625 * (t2 -= 1.5 / 2.75) * t2 + 0.75) + b2;
      } else if (t2 < 2.5 / 2.75) {
        return c2 * (7.5625 * (t2 -= 2.25 / 2.75) * t2 + 0.9375) + b2;
      } else {
        return c2 * (7.5625 * (t2 -= 2.625 / 2.75) * t2 + 0.984375) + b2;
      }
    },
    BounceEaseIn(t2, b2, c2, d2) {
      return c2 - exports.Easings.BounceEaseOut(d2 - t2, 0, c2, d2) + b2;
    },
    BounceEaseInOut(t2, b2, c2, d2) {
      if (t2 < d2 / 2) {
        return exports.Easings.BounceEaseIn(t2 * 2, 0, c2, d2) * 0.5 + b2;
      } else {
        return exports.Easings.BounceEaseOut(t2 * 2 - d2, 0, c2, d2) * 0.5 + c2 * 0.5 + b2;
      }
    },
    EaseIn(t2, b2, c2, d2) {
      return c2 * (t2 /= d2) * t2 + b2;
    },
    EaseOut(t2, b2, c2, d2) {
      return -c2 * (t2 /= d2) * (t2 - 2) + b2;
    },
    EaseInOut(t2, b2, c2, d2) {
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * t2 * t2 + b2;
      }
      return -c2 / 2 * (--t2 * (t2 - 2) - 1) + b2;
    },
    StrongEaseIn(t2, b2, c2, d2) {
      return c2 * (t2 /= d2) * t2 * t2 * t2 * t2 + b2;
    },
    StrongEaseOut(t2, b2, c2, d2) {
      return c2 * ((t2 = t2 / d2 - 1) * t2 * t2 * t2 * t2 + 1) + b2;
    },
    StrongEaseInOut(t2, b2, c2, d2) {
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * t2 * t2 * t2 * t2 * t2 + b2;
      }
      return c2 / 2 * ((t2 -= 2) * t2 * t2 * t2 * t2 + 2) + b2;
    },
    Linear(t2, b2, c2, d2) {
      return c2 * t2 / d2 + b2;
    }
  };
})(Tween$1);
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Konva = void 0;
  const Global_12 = Global$1;
  const Util_12 = Util$1;
  const Node_12 = Node$3;
  const Container_12 = Container$6;
  const Stage_1 = Stage$2;
  const Layer_12 = Layer$4;
  const FastLayer_1 = FastLayer$3;
  const Group_12 = Group$4;
  const DragAndDrop_12 = DragAndDrop$1;
  const Shape_12 = Shape$1;
  const Animation_12 = Animation$3;
  const Tween_1 = Tween$1;
  const Context_12 = Context$3;
  const Canvas_12 = Canvas$3;
  exports.Konva = Util_12.Util._assign(Global_12.Konva, {
    Util: Util_12.Util,
    Transform: Util_12.Transform,
    Node: Node_12.Node,
    Container: Container_12.Container,
    Stage: Stage_1.Stage,
    stages: Stage_1.stages,
    Layer: Layer_12.Layer,
    FastLayer: FastLayer_1.FastLayer,
    Group: Group_12.Group,
    DD: DragAndDrop_12.DD,
    Shape: Shape_12.Shape,
    shapes: Shape_12.shapes,
    Animation: Animation_12.Animation,
    Tween: Tween_1.Tween,
    Easings: Tween_1.Easings,
    Context: Context_12.Context,
    Canvas: Canvas_12.Canvas
  });
  exports.default = exports.Konva;
})(_CoreInternals$1);
var Arc$3 = {};
Object.defineProperty(Arc$3, "__esModule", { value: true });
Arc$3.Arc = void 0;
const Factory_1$13 = Factory$1;
const Shape_1$w = Shape$1;
const Global_1$G = Global$1;
const Validators_1$11 = Validators$1;
const Global_2$6 = Global$1;
let Arc$2 = class Arc extends Shape_1$w.Shape {
  _sceneFunc(context) {
    var angle = Global_1$G.Konva.getAngle(this.angle()), clockwise = this.clockwise();
    context.beginPath();
    context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);
    context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
  getSelfRect() {
    const innerRadius = this.innerRadius();
    const outerRadius = this.outerRadius();
    const clockwise = this.clockwise();
    const angle = Global_1$G.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());
    const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));
    const boundRightRatio = 1;
    const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), 3 * Math.PI / 2));
    const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));
    const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);
    const boundRight = boundRightRatio * outerRadius;
    const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);
    const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);
    return {
      x: boundLeft,
      y: clockwise ? -1 * boundBottom : boundTop,
      width: boundRight - boundLeft,
      height: boundBottom - boundTop
    };
  }
};
Arc$3.Arc = Arc$2;
Arc$2.prototype._centroid = true;
Arc$2.prototype.className = "Arc";
Arc$2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_2$6._registerNode)(Arc$2);
Factory_1$13.Factory.addGetterSetter(Arc$2, "innerRadius", 0, (0, Validators_1$11.getNumberValidator)());
Factory_1$13.Factory.addGetterSetter(Arc$2, "outerRadius", 0, (0, Validators_1$11.getNumberValidator)());
Factory_1$13.Factory.addGetterSetter(Arc$2, "angle", 0, (0, Validators_1$11.getNumberValidator)());
Factory_1$13.Factory.addGetterSetter(Arc$2, "clockwise", false, (0, Validators_1$11.getBooleanValidator)());
var Arrow$6 = {};
var Line$5 = {};
Object.defineProperty(Line$5, "__esModule", { value: true });
Line$5.Line = void 0;
const Factory_1$12 = Factory$1;
const Shape_1$v = Shape$1;
const Validators_1$10 = Validators$1;
const Global_1$F = Global$1;
function getControlPoints$1(x0, y0, x1, y1, x2, y2, t2) {
  var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa2 = t2 * d01 / (d01 + d12), fb2 = t2 * d12 / (d01 + d12), p1x = x1 - fa2 * (x2 - x0), p1y = y1 - fa2 * (y2 - y0), p2x = x1 + fb2 * (x2 - x0), p2y = y1 + fb2 * (y2 - y0);
  return [p1x, p1y, p2x, p2y];
}
function expandPoints$1(p2, tension) {
  var len = p2.length, allPoints = [], n2, cp;
  for (n2 = 2; n2 < len - 2; n2 += 2) {
    cp = getControlPoints$1(p2[n2 - 2], p2[n2 - 1], p2[n2], p2[n2 + 1], p2[n2 + 2], p2[n2 + 3], tension);
    if (isNaN(cp[0])) {
      continue;
    }
    allPoints.push(cp[0]);
    allPoints.push(cp[1]);
    allPoints.push(p2[n2]);
    allPoints.push(p2[n2 + 1]);
    allPoints.push(cp[2]);
    allPoints.push(cp[3]);
  }
  return allPoints;
}
let Line$4 = class Line extends Shape_1$v.Shape {
  constructor(config) {
    super(config);
    this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva", function() {
      this._clearCache("tensionPoints");
    });
  }
  _sceneFunc(context) {
    var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n2;
    if (!length) {
      return;
    }
    context.beginPath();
    context.moveTo(points[0], points[1]);
    if (tension !== 0 && length > 4) {
      tp = this.getTensionPoints();
      len = tp.length;
      n2 = closed ? 0 : 4;
      if (!closed) {
        context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);
      }
      while (n2 < len - 2) {
        context.bezierCurveTo(tp[n2++], tp[n2++], tp[n2++], tp[n2++], tp[n2++], tp[n2++]);
      }
      if (!closed) {
        context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);
      }
    } else if (bezier) {
      n2 = 2;
      while (n2 < length) {
        context.bezierCurveTo(points[n2++], points[n2++], points[n2++], points[n2++], points[n2++], points[n2++]);
      }
    } else {
      for (n2 = 2; n2 < length; n2 += 2) {
        context.lineTo(points[n2], points[n2 + 1]);
      }
    }
    if (closed) {
      context.closePath();
      context.fillStrokeShape(this);
    } else {
      context.strokeShape(this);
    }
  }
  getTensionPoints() {
    return this._getCache("tensionPoints", this._getTensionPoints);
  }
  _getTensionPoints() {
    if (this.closed()) {
      return this._getTensionPointsClosed();
    } else {
      return expandPoints$1(this.points(), this.tension());
    }
  }
  _getTensionPointsClosed() {
    var p2 = this.points(), len = p2.length, tension = this.tension(), firstControlPoints = getControlPoints$1(p2[len - 2], p2[len - 1], p2[0], p2[1], p2[2], p2[3], tension), lastControlPoints = getControlPoints$1(p2[len - 4], p2[len - 3], p2[len - 2], p2[len - 1], p2[0], p2[1], tension), middle = expandPoints$1(p2, tension), tp = [firstControlPoints[2], firstControlPoints[3]].concat(middle).concat([
      lastControlPoints[0],
      lastControlPoints[1],
      p2[len - 2],
      p2[len - 1],
      lastControlPoints[2],
      lastControlPoints[3],
      firstControlPoints[0],
      firstControlPoints[1],
      p2[0],
      p2[1]
    ]);
    return tp;
  }
  getWidth() {
    return this.getSelfRect().width;
  }
  getHeight() {
    return this.getSelfRect().height;
  }
  getSelfRect() {
    var points = this.points();
    if (points.length < 4) {
      return {
        x: points[0] || 0,
        y: points[1] || 0,
        width: 0,
        height: 0
      };
    }
    if (this.tension() !== 0) {
      points = [
        points[0],
        points[1],
        ...this._getTensionPoints(),
        points[points.length - 2],
        points[points.length - 1]
      ];
    } else {
      points = this.points();
    }
    var minX = points[0];
    var maxX = points[0];
    var minY = points[1];
    var maxY = points[1];
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      minX = Math.min(minX, x2);
      maxX = Math.max(maxX, x2);
      minY = Math.min(minY, y2);
      maxY = Math.max(maxY, y2);
    }
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
};
Line$5.Line = Line$4;
Line$4.prototype.className = "Line";
Line$4.prototype._attrsAffectingSize = ["points", "bezier", "tension"];
(0, Global_1$F._registerNode)(Line$4);
Factory_1$12.Factory.addGetterSetter(Line$4, "closed", false);
Factory_1$12.Factory.addGetterSetter(Line$4, "bezier", false);
Factory_1$12.Factory.addGetterSetter(Line$4, "tension", 0, (0, Validators_1$10.getNumberValidator)());
Factory_1$12.Factory.addGetterSetter(Line$4, "points", [], (0, Validators_1$10.getNumberArrayValidator)());
var Path$3 = {};
var BezierFunctions$1 = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
  exports.tValues = [
    [],
    [],
    [
      -0.5773502691896257,
      0.5773502691896257
    ],
    [
      0,
      -0.7745966692414834,
      0.7745966692414834
    ],
    [
      -0.33998104358485626,
      0.33998104358485626,
      -0.8611363115940526,
      0.8611363115940526
    ],
    [
      0,
      -0.5384693101056831,
      0.5384693101056831,
      -0.906179845938664,
      0.906179845938664
    ],
    [
      0.6612093864662645,
      -0.6612093864662645,
      -0.2386191860831969,
      0.2386191860831969,
      -0.932469514203152,
      0.932469514203152
    ],
    [
      0,
      0.4058451513773972,
      -0.4058451513773972,
      -0.7415311855993945,
      0.7415311855993945,
      -0.9491079123427585,
      0.9491079123427585
    ],
    [
      -0.1834346424956498,
      0.1834346424956498,
      -0.525532409916329,
      0.525532409916329,
      -0.7966664774136267,
      0.7966664774136267,
      -0.9602898564975363,
      0.9602898564975363
    ],
    [
      0,
      -0.8360311073266358,
      0.8360311073266358,
      -0.9681602395076261,
      0.9681602395076261,
      -0.3242534234038089,
      0.3242534234038089,
      -0.6133714327005904,
      0.6133714327005904
    ],
    [
      -0.14887433898163122,
      0.14887433898163122,
      -0.4333953941292472,
      0.4333953941292472,
      -0.6794095682990244,
      0.6794095682990244,
      -0.8650633666889845,
      0.8650633666889845,
      -0.9739065285171717,
      0.9739065285171717
    ],
    [
      0,
      -0.26954315595234496,
      0.26954315595234496,
      -0.5190961292068118,
      0.5190961292068118,
      -0.7301520055740494,
      0.7301520055740494,
      -0.8870625997680953,
      0.8870625997680953,
      -0.978228658146057,
      0.978228658146057
    ],
    [
      -0.1252334085114689,
      0.1252334085114689,
      -0.3678314989981802,
      0.3678314989981802,
      -0.5873179542866175,
      0.5873179542866175,
      -0.7699026741943047,
      0.7699026741943047,
      -0.9041172563704749,
      0.9041172563704749,
      -0.9815606342467192,
      0.9815606342467192
    ],
    [
      0,
      -0.2304583159551348,
      0.2304583159551348,
      -0.44849275103644687,
      0.44849275103644687,
      -0.6423493394403402,
      0.6423493394403402,
      -0.8015780907333099,
      0.8015780907333099,
      -0.9175983992229779,
      0.9175983992229779,
      -0.9841830547185881,
      0.9841830547185881
    ],
    [
      -0.10805494870734367,
      0.10805494870734367,
      -0.31911236892788974,
      0.31911236892788974,
      -0.5152486363581541,
      0.5152486363581541,
      -0.6872929048116855,
      0.6872929048116855,
      -0.827201315069765,
      0.827201315069765,
      -0.9284348836635735,
      0.9284348836635735,
      -0.9862838086968123,
      0.9862838086968123
    ],
    [
      0,
      -0.20119409399743451,
      0.20119409399743451,
      -0.3941513470775634,
      0.3941513470775634,
      -0.5709721726085388,
      0.5709721726085388,
      -0.7244177313601701,
      0.7244177313601701,
      -0.8482065834104272,
      0.8482065834104272,
      -0.937273392400706,
      0.937273392400706,
      -0.9879925180204854,
      0.9879925180204854
    ],
    [
      -0.09501250983763744,
      0.09501250983763744,
      -0.2816035507792589,
      0.2816035507792589,
      -0.45801677765722737,
      0.45801677765722737,
      -0.6178762444026438,
      0.6178762444026438,
      -0.755404408355003,
      0.755404408355003,
      -0.8656312023878318,
      0.8656312023878318,
      -0.9445750230732326,
      0.9445750230732326,
      -0.9894009349916499,
      0.9894009349916499
    ],
    [
      0,
      -0.17848418149584785,
      0.17848418149584785,
      -0.3512317634538763,
      0.3512317634538763,
      -0.5126905370864769,
      0.5126905370864769,
      -0.6576711592166907,
      0.6576711592166907,
      -0.7815140038968014,
      0.7815140038968014,
      -0.8802391537269859,
      0.8802391537269859,
      -0.9506755217687678,
      0.9506755217687678,
      -0.9905754753144174,
      0.9905754753144174
    ],
    [
      -0.0847750130417353,
      0.0847750130417353,
      -0.2518862256915055,
      0.2518862256915055,
      -0.41175116146284263,
      0.41175116146284263,
      -0.5597708310739475,
      0.5597708310739475,
      -0.6916870430603532,
      0.6916870430603532,
      -0.8037049589725231,
      0.8037049589725231,
      -0.8926024664975557,
      0.8926024664975557,
      -0.9558239495713977,
      0.9558239495713977,
      -0.9915651684209309,
      0.9915651684209309
    ],
    [
      0,
      -0.16035864564022537,
      0.16035864564022537,
      -0.31656409996362983,
      0.31656409996362983,
      -0.46457074137596094,
      0.46457074137596094,
      -0.600545304661681,
      0.600545304661681,
      -0.7209661773352294,
      0.7209661773352294,
      -0.8227146565371428,
      0.8227146565371428,
      -0.9031559036148179,
      0.9031559036148179,
      -0.96020815213483,
      0.96020815213483,
      -0.9924068438435844,
      0.9924068438435844
    ],
    [
      -0.07652652113349734,
      0.07652652113349734,
      -0.22778585114164507,
      0.22778585114164507,
      -0.37370608871541955,
      0.37370608871541955,
      -0.5108670019508271,
      0.5108670019508271,
      -0.636053680726515,
      0.636053680726515,
      -0.7463319064601508,
      0.7463319064601508,
      -0.8391169718222188,
      0.8391169718222188,
      -0.912234428251326,
      0.912234428251326,
      -0.9639719272779138,
      0.9639719272779138,
      -0.9931285991850949,
      0.9931285991850949
    ],
    [
      0,
      -0.1455618541608951,
      0.1455618541608951,
      -0.2880213168024011,
      0.2880213168024011,
      -0.4243421202074388,
      0.4243421202074388,
      -0.5516188358872198,
      0.5516188358872198,
      -0.6671388041974123,
      0.6671388041974123,
      -0.7684399634756779,
      0.7684399634756779,
      -0.8533633645833173,
      0.8533633645833173,
      -0.9200993341504008,
      0.9200993341504008,
      -0.9672268385663063,
      0.9672268385663063,
      -0.9937521706203895,
      0.9937521706203895
    ],
    [
      -0.06973927331972223,
      0.06973927331972223,
      -0.20786042668822127,
      0.20786042668822127,
      -0.34193582089208424,
      0.34193582089208424,
      -0.469355837986757,
      0.469355837986757,
      -0.5876404035069116,
      0.5876404035069116,
      -0.6944872631866827,
      0.6944872631866827,
      -0.7878168059792081,
      0.7878168059792081,
      -0.8658125777203002,
      0.8658125777203002,
      -0.926956772187174,
      0.926956772187174,
      -0.9700604978354287,
      0.9700604978354287,
      -0.9942945854823992,
      0.9942945854823992
    ],
    [
      0,
      -0.1332568242984661,
      0.1332568242984661,
      -0.26413568097034495,
      0.26413568097034495,
      -0.3903010380302908,
      0.3903010380302908,
      -0.5095014778460075,
      0.5095014778460075,
      -0.6196098757636461,
      0.6196098757636461,
      -0.7186613631319502,
      0.7186613631319502,
      -0.8048884016188399,
      0.8048884016188399,
      -0.8767523582704416,
      0.8767523582704416,
      -0.9329710868260161,
      0.9329710868260161,
      -0.9725424712181152,
      0.9725424712181152,
      -0.9947693349975522,
      0.9947693349975522
    ],
    [
      -0.06405689286260563,
      0.06405689286260563,
      -0.1911188674736163,
      0.1911188674736163,
      -0.3150426796961634,
      0.3150426796961634,
      -0.4337935076260451,
      0.4337935076260451,
      -0.5454214713888396,
      0.5454214713888396,
      -0.6480936519369755,
      0.6480936519369755,
      -0.7401241915785544,
      0.7401241915785544,
      -0.820001985973903,
      0.820001985973903,
      -0.8864155270044011,
      0.8864155270044011,
      -0.9382745520027328,
      0.9382745520027328,
      -0.9747285559713095,
      0.9747285559713095,
      -0.9951872199970213,
      0.9951872199970213
    ]
  ];
  exports.cValues = [
    [],
    [],
    [1, 1],
    [
      0.8888888888888888,
      0.5555555555555556,
      0.5555555555555556
    ],
    [
      0.6521451548625461,
      0.6521451548625461,
      0.34785484513745385,
      0.34785484513745385
    ],
    [
      0.5688888888888889,
      0.47862867049936647,
      0.47862867049936647,
      0.23692688505618908,
      0.23692688505618908
    ],
    [
      0.3607615730481386,
      0.3607615730481386,
      0.46791393457269104,
      0.46791393457269104,
      0.17132449237917036,
      0.17132449237917036
    ],
    [
      0.4179591836734694,
      0.3818300505051189,
      0.3818300505051189,
      0.27970539148927664,
      0.27970539148927664,
      0.1294849661688697,
      0.1294849661688697
    ],
    [
      0.362683783378362,
      0.362683783378362,
      0.31370664587788727,
      0.31370664587788727,
      0.22238103445337448,
      0.22238103445337448,
      0.10122853629037626,
      0.10122853629037626
    ],
    [
      0.3302393550012598,
      0.1806481606948574,
      0.1806481606948574,
      0.08127438836157441,
      0.08127438836157441,
      0.31234707704000286,
      0.31234707704000286,
      0.26061069640293544,
      0.26061069640293544
    ],
    [
      0.29552422471475287,
      0.29552422471475287,
      0.26926671930999635,
      0.26926671930999635,
      0.21908636251598204,
      0.21908636251598204,
      0.1494513491505806,
      0.1494513491505806,
      0.06667134430868814,
      0.06667134430868814
    ],
    [
      0.2729250867779006,
      0.26280454451024665,
      0.26280454451024665,
      0.23319376459199048,
      0.23319376459199048,
      0.18629021092773426,
      0.18629021092773426,
      0.1255803694649046,
      0.1255803694649046,
      0.05566856711617366,
      0.05566856711617366
    ],
    [
      0.24914704581340277,
      0.24914704581340277,
      0.2334925365383548,
      0.2334925365383548,
      0.20316742672306592,
      0.20316742672306592,
      0.16007832854334622,
      0.16007832854334622,
      0.10693932599531843,
      0.10693932599531843,
      0.04717533638651183,
      0.04717533638651183
    ],
    [
      0.2325515532308739,
      0.22628318026289723,
      0.22628318026289723,
      0.2078160475368885,
      0.2078160475368885,
      0.17814598076194574,
      0.17814598076194574,
      0.13887351021978725,
      0.13887351021978725,
      0.09212149983772845,
      0.09212149983772845,
      0.04048400476531588,
      0.04048400476531588
    ],
    [
      0.2152638534631578,
      0.2152638534631578,
      0.2051984637212956,
      0.2051984637212956,
      0.18553839747793782,
      0.18553839747793782,
      0.15720316715819355,
      0.15720316715819355,
      0.12151857068790319,
      0.12151857068790319,
      0.08015808715976021,
      0.08015808715976021,
      0.03511946033175186,
      0.03511946033175186
    ],
    [
      0.2025782419255613,
      0.19843148532711158,
      0.19843148532711158,
      0.1861610000155622,
      0.1861610000155622,
      0.16626920581699392,
      0.16626920581699392,
      0.13957067792615432,
      0.13957067792615432,
      0.10715922046717194,
      0.10715922046717194,
      0.07036604748810812,
      0.07036604748810812,
      0.03075324199611727,
      0.03075324199611727
    ],
    [
      0.1894506104550685,
      0.1894506104550685,
      0.18260341504492358,
      0.18260341504492358,
      0.16915651939500254,
      0.16915651939500254,
      0.14959598881657674,
      0.14959598881657674,
      0.12462897125553388,
      0.12462897125553388,
      0.09515851168249279,
      0.09515851168249279,
      0.062253523938647894,
      0.062253523938647894,
      0.027152459411754096,
      0.027152459411754096
    ],
    [
      0.17944647035620653,
      0.17656270536699264,
      0.17656270536699264,
      0.16800410215645004,
      0.16800410215645004,
      0.15404576107681028,
      0.15404576107681028,
      0.13513636846852548,
      0.13513636846852548,
      0.11188384719340397,
      0.11188384719340397,
      0.08503614831717918,
      0.08503614831717918,
      0.0554595293739872,
      0.0554595293739872,
      0.02414830286854793,
      0.02414830286854793
    ],
    [
      0.1691423829631436,
      0.1691423829631436,
      0.16427648374583273,
      0.16427648374583273,
      0.15468467512626524,
      0.15468467512626524,
      0.14064291467065065,
      0.14064291467065065,
      0.12255520671147846,
      0.12255520671147846,
      0.10094204410628717,
      0.10094204410628717,
      0.07642573025488905,
      0.07642573025488905,
      0.0497145488949698,
      0.0497145488949698,
      0.02161601352648331,
      0.02161601352648331
    ],
    [
      0.1610544498487837,
      0.15896884339395434,
      0.15896884339395434,
      0.15276604206585967,
      0.15276604206585967,
      0.1426067021736066,
      0.1426067021736066,
      0.12875396253933621,
      0.12875396253933621,
      0.11156664554733399,
      0.11156664554733399,
      0.09149002162245,
      0.09149002162245,
      0.06904454273764123,
      0.06904454273764123,
      0.0448142267656996,
      0.0448142267656996,
      0.019461788229726478,
      0.019461788229726478
    ],
    [
      0.15275338713072584,
      0.15275338713072584,
      0.14917298647260374,
      0.14917298647260374,
      0.14209610931838204,
      0.14209610931838204,
      0.13168863844917664,
      0.13168863844917664,
      0.11819453196151841,
      0.11819453196151841,
      0.10193011981724044,
      0.10193011981724044,
      0.08327674157670475,
      0.08327674157670475,
      0.06267204833410907,
      0.06267204833410907,
      0.04060142980038694,
      0.04060142980038694,
      0.017614007139152118,
      0.017614007139152118
    ],
    [
      0.14608113364969041,
      0.14452440398997005,
      0.14452440398997005,
      0.13988739479107315,
      0.13988739479107315,
      0.13226893863333747,
      0.13226893863333747,
      0.12183141605372853,
      0.12183141605372853,
      0.10879729916714838,
      0.10879729916714838,
      0.09344442345603386,
      0.09344442345603386,
      0.0761001136283793,
      0.0761001136283793,
      0.057134425426857205,
      0.057134425426857205,
      0.036953789770852494,
      0.036953789770852494,
      0.016017228257774335,
      0.016017228257774335
    ],
    [
      0.13925187285563198,
      0.13925187285563198,
      0.13654149834601517,
      0.13654149834601517,
      0.13117350478706238,
      0.13117350478706238,
      0.12325237681051242,
      0.12325237681051242,
      0.11293229608053922,
      0.11293229608053922,
      0.10041414444288096,
      0.10041414444288096,
      0.08594160621706773,
      0.08594160621706773,
      0.06979646842452049,
      0.06979646842452049,
      0.052293335152683286,
      0.052293335152683286,
      0.03377490158481415,
      0.03377490158481415,
      0.0146279952982722,
      0.0146279952982722
    ],
    [
      0.13365457218610619,
      0.1324620394046966,
      0.1324620394046966,
      0.12890572218808216,
      0.12890572218808216,
      0.12304908430672953,
      0.12304908430672953,
      0.11499664022241136,
      0.11499664022241136,
      0.10489209146454141,
      0.10489209146454141,
      0.09291576606003515,
      0.09291576606003515,
      0.07928141177671895,
      0.07928141177671895,
      0.06423242140852585,
      0.06423242140852585,
      0.04803767173108467,
      0.04803767173108467,
      0.030988005856979445,
      0.030988005856979445,
      0.013411859487141771,
      0.013411859487141771
    ],
    [
      0.12793819534675216,
      0.12793819534675216,
      0.1258374563468283,
      0.1258374563468283,
      0.12167047292780339,
      0.12167047292780339,
      0.1155056680537256,
      0.1155056680537256,
      0.10744427011596563,
      0.10744427011596563,
      0.09761865210411388,
      0.09761865210411388,
      0.08619016153195327,
      0.08619016153195327,
      0.0733464814110803,
      0.0733464814110803,
      0.05929858491543678,
      0.05929858491543678,
      0.04427743881741981,
      0.04427743881741981,
      0.028531388628933663,
      0.028531388628933663,
      0.0123412297999872,
      0.0123412297999872
    ]
  ];
  exports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
  const getCubicArcLength = (xs, ys, t2) => {
    let z2;
    let sum;
    let correctedT;
    const n2 = 20;
    z2 = t2 / 2;
    sum = 0;
    for (let i = 0; i < n2; i++) {
      correctedT = z2 * exports.tValues[n2][i] + z2;
      sum += exports.cValues[n2][i] * BFunc(xs, ys, correctedT);
    }
    return z2 * sum;
  };
  exports.getCubicArcLength = getCubicArcLength;
  const getQuadraticArcLength = (xs, ys, t2) => {
    if (t2 === void 0) {
      t2 = 1;
    }
    const ax = xs[0] - 2 * xs[1] + xs[2];
    const ay = ys[0] - 2 * ys[1] + ys[2];
    const bx = 2 * xs[1] - 2 * xs[0];
    const by = 2 * ys[1] - 2 * ys[0];
    const A2 = 4 * (ax * ax + ay * ay);
    const B2 = 4 * (ax * bx + ay * by);
    const C2 = bx * bx + by * by;
    if (A2 === 0) {
      return t2 * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2));
    }
    const b2 = B2 / (2 * A2);
    const c2 = C2 / A2;
    const u2 = t2 + b2;
    const k2 = c2 - b2 * b2;
    const uuk = u2 * u2 + k2 > 0 ? Math.sqrt(u2 * u2 + k2) : 0;
    const bbk = b2 * b2 + k2 > 0 ? Math.sqrt(b2 * b2 + k2) : 0;
    const term = b2 + Math.sqrt(b2 * b2 + k2) !== 0 ? k2 * Math.log(Math.abs((u2 + uuk) / (b2 + bbk))) : 0;
    return Math.sqrt(A2) / 2 * (u2 * uuk - b2 * bbk + term);
  };
  exports.getQuadraticArcLength = getQuadraticArcLength;
  function BFunc(xs, ys, t2) {
    const xbase = getDerivative(1, t2, xs);
    const ybase = getDerivative(1, t2, ys);
    const combined = xbase * xbase + ybase * ybase;
    return Math.sqrt(combined);
  }
  const getDerivative = (derivative, t2, vs) => {
    const n2 = vs.length - 1;
    let _vs;
    let value;
    if (n2 === 0) {
      return 0;
    }
    if (derivative === 0) {
      value = 0;
      for (let k2 = 0; k2 <= n2; k2++) {
        value += exports.binomialCoefficients[n2][k2] * Math.pow(1 - t2, n2 - k2) * Math.pow(t2, k2) * vs[k2];
      }
      return value;
    } else {
      _vs = new Array(n2);
      for (let k2 = 0; k2 < n2; k2++) {
        _vs[k2] = n2 * (vs[k2 + 1] - vs[k2]);
      }
      return getDerivative(derivative - 1, t2, _vs);
    }
  };
  const t2length = (length, totalLength, func) => {
    let error2 = 1;
    let t2 = length / totalLength;
    let step = (length - func(t2)) / totalLength;
    let numIterations = 0;
    while (error2 > 1e-3) {
      const increasedTLength = func(t2 + step);
      const increasedTError = Math.abs(length - increasedTLength) / totalLength;
      if (increasedTError < error2) {
        error2 = increasedTError;
        t2 += step;
      } else {
        const decreasedTLength = func(t2 - step);
        const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;
        if (decreasedTError < error2) {
          error2 = decreasedTError;
          t2 -= step;
        } else {
          step /= 2;
        }
      }
      numIterations++;
      if (numIterations > 500) {
        break;
      }
    }
    return t2;
  };
  exports.t2length = t2length;
})(BezierFunctions$1);
Object.defineProperty(Path$3, "__esModule", { value: true });
Path$3.Path = void 0;
const Factory_1$11 = Factory$1;
const Shape_1$u = Shape$1;
const Global_1$E = Global$1;
const BezierFunctions_1$1 = BezierFunctions$1;
let Path$2 = class Path extends Shape_1$u.Shape {
  constructor(config) {
    super(config);
    this.dataArray = [];
    this.pathLength = 0;
    this._readDataAttribute();
    this.on("dataChange.konva", function() {
      this._readDataAttribute();
    });
  }
  _readDataAttribute() {
    this.dataArray = Path.parsePathData(this.data());
    this.pathLength = Path.getPathLength(this.dataArray);
  }
  _sceneFunc(context) {
    var ca2 = this.dataArray;
    context.beginPath();
    var isClosed = false;
    for (var n2 = 0; n2 < ca2.length; n2++) {
      var c2 = ca2[n2].command;
      var p2 = ca2[n2].points;
      switch (c2) {
        case "L":
          context.lineTo(p2[0], p2[1]);
          break;
        case "M":
          context.moveTo(p2[0], p2[1]);
          break;
        case "C":
          context.bezierCurveTo(p2[0], p2[1], p2[2], p2[3], p2[4], p2[5]);
          break;
        case "Q":
          context.quadraticCurveTo(p2[0], p2[1], p2[2], p2[3]);
          break;
        case "A":
          var cx = p2[0], cy = p2[1], rx = p2[2], ry = p2[3], theta = p2[4], dTheta = p2[5], psi = p2[6], fs = p2[7];
          var r2 = rx > ry ? rx : ry;
          var scaleX = rx > ry ? 1 : rx / ry;
          var scaleY = rx > ry ? ry / rx : 1;
          context.translate(cx, cy);
          context.rotate(psi);
          context.scale(scaleX, scaleY);
          context.arc(0, 0, r2, theta, theta + dTheta, 1 - fs);
          context.scale(1 / scaleX, 1 / scaleY);
          context.rotate(-psi);
          context.translate(-cx, -cy);
          break;
        case "z":
          isClosed = true;
          context.closePath();
          break;
      }
    }
    if (!isClosed && !this.hasFill()) {
      context.strokeShape(this);
    } else {
      context.fillStrokeShape(this);
    }
  }
  getSelfRect() {
    var points = [];
    this.dataArray.forEach(function(data) {
      if (data.command === "A") {
        var start2 = data.points[4];
        var dTheta = data.points[5];
        var end2 = data.points[4] + dTheta;
        var inc = Math.PI / 180;
        if (Math.abs(start2 - end2) < inc) {
          inc = Math.abs(start2 - end2);
        }
        if (dTheta < 0) {
          for (let t2 = start2 - inc; t2 > end2; t2 -= inc) {
            const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t2, 0);
            points.push(point.x, point.y);
          }
        } else {
          for (let t2 = start2 + inc; t2 < end2; t2 += inc) {
            const point = Path.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t2, 0);
            points.push(point.x, point.y);
          }
        }
      } else if (data.command === "C") {
        for (let t2 = 0; t2 <= 1; t2 += 0.01) {
          const point = Path.getPointOnCubicBezier(t2, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);
          points.push(point.x, point.y);
        }
      } else {
        points = points.concat(data.points);
      }
    });
    var minX = points[0];
    var maxX = points[0];
    var minY = points[1];
    var maxY = points[1];
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      if (!isNaN(x2)) {
        minX = Math.min(minX, x2);
        maxX = Math.max(maxX, x2);
      }
      if (!isNaN(y2)) {
        minY = Math.min(minY, y2);
        maxY = Math.max(maxY, y2);
      }
    }
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  getLength() {
    return this.pathLength;
  }
  getPointAtLength(length) {
    return Path.getPointAtLengthOfDataArray(length, this.dataArray);
  }
  static getLineLength(x1, y1, x2, y2) {
    return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  }
  static getPathLength(dataArray) {
    let pathLength = 0;
    for (var i = 0; i < dataArray.length; ++i) {
      pathLength += dataArray[i].pathLength;
    }
    return pathLength;
  }
  static getPointAtLengthOfDataArray(length, dataArray) {
    var point, i = 0, ii2 = dataArray.length;
    if (!ii2) {
      return null;
    }
    while (i < ii2 && length > dataArray[i].pathLength) {
      length -= dataArray[i].pathLength;
      ++i;
    }
    if (i === ii2) {
      point = dataArray[i - 1].points.slice(-2);
      return {
        x: point[0],
        y: point[1]
      };
    }
    if (length < 0.01) {
      point = dataArray[i].points.slice(0, 2);
      return {
        x: point[0],
        y: point[1]
      };
    }
    var cp = dataArray[i];
    var p2 = cp.points;
    switch (cp.command) {
      case "L":
        return Path.getPointOnLine(length, cp.start.x, cp.start.y, p2[0], p2[1]);
      case "C":
        return Path.getPointOnCubicBezier((0, BezierFunctions_1$1.t2length)(length, Path.getPathLength(dataArray), (i2) => {
          return (0, BezierFunctions_1$1.getCubicArcLength)([cp.start.x, p2[0], p2[2], p2[4]], [cp.start.y, p2[1], p2[3], p2[5]], i2);
        }), cp.start.x, cp.start.y, p2[0], p2[1], p2[2], p2[3], p2[4], p2[5]);
      case "Q":
        return Path.getPointOnQuadraticBezier((0, BezierFunctions_1$1.t2length)(length, Path.getPathLength(dataArray), (i2) => {
          return (0, BezierFunctions_1$1.getQuadraticArcLength)([cp.start.x, p2[0], p2[2]], [cp.start.y, p2[1], p2[3]], i2);
        }), cp.start.x, cp.start.y, p2[0], p2[1], p2[2], p2[3]);
      case "A":
        var cx = p2[0], cy = p2[1], rx = p2[2], ry = p2[3], theta = p2[4], dTheta = p2[5], psi = p2[6];
        theta += dTheta * length / cp.pathLength;
        return Path.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);
    }
    return null;
  }
  static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
    fromX = fromX !== null && fromX !== void 0 ? fromX : P1x;
    fromY = fromY !== null && fromY !== void 0 ? fromY : P1y;
    const len = this.getLineLength(P1x, P1y, P2x, P2y);
    if (len < 1e-10) {
      return { x: P1x, y: P1y };
    }
    if (P2x === P1x) {
      return { x: fromX, y: fromY + (P2y > P1y ? dist : -dist) };
    }
    const m2 = (P2y - P1y) / (P2x - P1x);
    const run = Math.sqrt(dist * dist / (1 + m2 * m2)) * (P2x < P1x ? -1 : 1);
    const rise = m2 * run;
    if (Math.abs(fromY - P1y - m2 * (fromX - P1x)) < 1e-10) {
      return { x: fromX + run, y: fromY + rise };
    }
    const u2 = ((fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y)) / (len * len);
    const ix = P1x + u2 * (P2x - P1x);
    const iy = P1y + u2 * (P2y - P1y);
    const pRise = this.getLineLength(fromX, fromY, ix, iy);
    const pRun = Math.sqrt(dist * dist - pRise * pRise);
    const adjustedRun = Math.sqrt(pRun * pRun / (1 + m2 * m2)) * (P2x < P1x ? -1 : 1);
    const adjustedRise = m2 * adjustedRun;
    return { x: ix + adjustedRun, y: iy + adjustedRise };
  }
  static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
    function CB1(t2) {
      return t2 * t2 * t2;
    }
    function CB2(t2) {
      return 3 * t2 * t2 * (1 - t2);
    }
    function CB3(t2) {
      return 3 * t2 * (1 - t2) * (1 - t2);
    }
    function CB4(t2) {
      return (1 - t2) * (1 - t2) * (1 - t2);
    }
    var x2 = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);
    var y2 = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);
    return {
      x: x2,
      y: y2
    };
  }
  static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
    function QB1(t2) {
      return t2 * t2;
    }
    function QB2(t2) {
      return 2 * t2 * (1 - t2);
    }
    function QB3(t2) {
      return (1 - t2) * (1 - t2);
    }
    var x2 = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);
    var y2 = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);
    return {
      x: x2,
      y: y2
    };
  }
  static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
    var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);
    var pt = {
      x: rx * Math.cos(theta),
      y: ry * Math.sin(theta)
    };
    return {
      x: cx + (pt.x * cosPsi - pt.y * sinPsi),
      y: cy + (pt.x * sinPsi + pt.y * cosPsi)
    };
  }
  static parsePathData(data) {
    if (!data) {
      return [];
    }
    var cs = data;
    var cc2 = [
      "m",
      "M",
      "l",
      "L",
      "v",
      "V",
      "h",
      "H",
      "z",
      "Z",
      "c",
      "C",
      "q",
      "Q",
      "t",
      "T",
      "s",
      "S",
      "a",
      "A"
    ];
    cs = cs.replace(new RegExp(" ", "g"), ",");
    for (var n2 = 0; n2 < cc2.length; n2++) {
      cs = cs.replace(new RegExp(cc2[n2], "g"), "|" + cc2[n2]);
    }
    var arr = cs.split("|");
    var ca2 = [];
    var coords = [];
    var cpx = 0;
    var cpy = 0;
    var re2 = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;
    var match;
    for (n2 = 1; n2 < arr.length; n2++) {
      var str = arr[n2];
      var c2 = str.charAt(0);
      str = str.slice(1);
      coords.length = 0;
      while (match = re2.exec(str)) {
        coords.push(match[0]);
      }
      var p2 = [];
      for (var j2 = 0, jlen = coords.length; j2 < jlen; j2++) {
        if (coords[j2] === "00") {
          p2.push(0, 0);
          continue;
        }
        var parsed = parseFloat(coords[j2]);
        if (!isNaN(parsed)) {
          p2.push(parsed);
        } else {
          p2.push(0);
        }
      }
      while (p2.length > 0) {
        if (isNaN(p2[0])) {
          break;
        }
        var cmd = "";
        var points = [];
        var startX = cpx, startY = cpy;
        var prevCmd, ctlPtx, ctlPty;
        var rx, ry, psi, fa2, fs, x1, y1;
        switch (c2) {
          case "l":
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "L":
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "m":
            var dx = p2.shift();
            var dy = p2.shift();
            cpx += dx;
            cpy += dy;
            cmd = "M";
            if (ca2.length > 2 && ca2[ca2.length - 1].command === "z") {
              for (var idx = ca2.length - 2; idx >= 0; idx--) {
                if (ca2[idx].command === "M") {
                  cpx = ca2[idx].points[0] + dx;
                  cpy = ca2[idx].points[1] + dy;
                  break;
                }
              }
            }
            points.push(cpx, cpy);
            c2 = "l";
            break;
          case "M":
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "M";
            points.push(cpx, cpy);
            c2 = "L";
            break;
          case "h":
            cpx += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "H":
            cpx = p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "v":
            cpy += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "V":
            cpy = p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "C":
            points.push(p2.shift(), p2.shift(), p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "c":
            points.push(cpx + p2.shift(), cpy + p2.shift(), cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "S":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "C") {
              ctlPtx = cpx + (cpx - prevCmd.points[2]);
              ctlPty = cpy + (cpy - prevCmd.points[3]);
            }
            points.push(ctlPtx, ctlPty, p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "s":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "C") {
              ctlPtx = cpx + (cpx - prevCmd.points[2]);
              ctlPty = cpy + (cpy - prevCmd.points[3]);
            }
            points.push(ctlPtx, ctlPty, cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "Q":
            points.push(p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "q":
            points.push(cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "Q";
            points.push(cpx, cpy);
            break;
          case "T":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "Q") {
              ctlPtx = cpx + (cpx - prevCmd.points[0]);
              ctlPty = cpy + (cpy - prevCmd.points[1]);
            }
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "Q";
            points.push(ctlPtx, ctlPty, cpx, cpy);
            break;
          case "t":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "Q") {
              ctlPtx = cpx + (cpx - prevCmd.points[0]);
              ctlPty = cpy + (cpy - prevCmd.points[1]);
            }
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "Q";
            points.push(ctlPtx, ctlPty, cpx, cpy);
            break;
          case "A":
            rx = p2.shift();
            ry = p2.shift();
            psi = p2.shift();
            fa2 = p2.shift();
            fs = p2.shift();
            x1 = cpx;
            y1 = cpy;
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "A";
            points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa2, fs, rx, ry, psi);
            break;
          case "a":
            rx = p2.shift();
            ry = p2.shift();
            psi = p2.shift();
            fa2 = p2.shift();
            fs = p2.shift();
            x1 = cpx;
            y1 = cpy;
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "A";
            points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa2, fs, rx, ry, psi);
            break;
        }
        ca2.push({
          command: cmd || c2,
          points,
          start: {
            x: startX,
            y: startY
          },
          pathLength: this.calcLength(startX, startY, cmd || c2, points)
        });
      }
      if (c2 === "z" || c2 === "Z") {
        ca2.push({
          command: "z",
          points: [],
          start: void 0,
          pathLength: 0
        });
      }
    }
    return ca2;
  }
  static calcLength(x2, y2, cmd, points) {
    var len, p1, p2, t2;
    var path = Path;
    switch (cmd) {
      case "L":
        return path.getLineLength(x2, y2, points[0], points[1]);
      case "C":
        return (0, BezierFunctions_1$1.getCubicArcLength)([x2, points[0], points[2], points[4]], [y2, points[1], points[3], points[5]], 1);
      case "Q":
        return (0, BezierFunctions_1$1.getQuadraticArcLength)([x2, points[0], points[2]], [y2, points[1], points[3]], 1);
      case "A":
        len = 0;
        var start2 = points[4];
        var dTheta = points[5];
        var end2 = points[4] + dTheta;
        var inc = Math.PI / 180;
        if (Math.abs(start2 - end2) < inc) {
          inc = Math.abs(start2 - end2);
        }
        p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start2, 0);
        if (dTheta < 0) {
          for (t2 = start2 - inc; t2 > end2; t2 -= inc) {
            p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t2, 0);
            len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
            p1 = p2;
          }
        } else {
          for (t2 = start2 + inc; t2 < end2; t2 += inc) {
            p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t2, 0);
            len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
            p1 = p2;
          }
        }
        p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end2, 0);
        len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
        return len;
    }
    return 0;
  }
  static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa2, fs, rx, ry, psiDeg) {
    var psi = psiDeg * (Math.PI / 180);
    var xp = Math.cos(psi) * (x1 - x2) / 2 + Math.sin(psi) * (y1 - y2) / 2;
    var yp = -1 * Math.sin(psi) * (x1 - x2) / 2 + Math.cos(psi) * (y1 - y2) / 2;
    var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
    if (lambda > 1) {
      rx *= Math.sqrt(lambda);
      ry *= Math.sqrt(lambda);
    }
    var f2 = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp)));
    if (fa2 === fs) {
      f2 *= -1;
    }
    if (isNaN(f2)) {
      f2 = 0;
    }
    var cxp = f2 * rx * yp / ry;
    var cyp = f2 * -ry * xp / rx;
    var cx = (x1 + x2) / 2 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;
    var cy = (y1 + y2) / 2 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;
    var vMag = function(v3) {
      return Math.sqrt(v3[0] * v3[0] + v3[1] * v3[1]);
    };
    var vRatio = function(u3, v3) {
      return (u3[0] * v3[0] + u3[1] * v3[1]) / (vMag(u3) * vMag(v3));
    };
    var vAngle = function(u3, v3) {
      return (u3[0] * v3[1] < u3[1] * v3[0] ? -1 : 1) * Math.acos(vRatio(u3, v3));
    };
    var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);
    var u2 = [(xp - cxp) / rx, (yp - cyp) / ry];
    var v2 = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];
    var dTheta = vAngle(u2, v2);
    if (vRatio(u2, v2) <= -1) {
      dTheta = Math.PI;
    }
    if (vRatio(u2, v2) >= 1) {
      dTheta = 0;
    }
    if (fs === 0 && dTheta > 0) {
      dTheta = dTheta - 2 * Math.PI;
    }
    if (fs === 1 && dTheta < 0) {
      dTheta = dTheta + 2 * Math.PI;
    }
    return [cx, cy, rx, ry, theta, dTheta, psi, fs];
  }
};
Path$3.Path = Path$2;
Path$2.prototype.className = "Path";
Path$2.prototype._attrsAffectingSize = ["data"];
(0, Global_1$E._registerNode)(Path$2);
Factory_1$11.Factory.addGetterSetter(Path$2, "data");
Object.defineProperty(Arrow$6, "__esModule", { value: true });
Arrow$6.Arrow = void 0;
const Factory_1$10 = Factory$1;
const Line_1$3 = Line$5;
const Validators_1$$ = Validators$1;
const Global_1$D = Global$1;
const Path_1$5 = Path$3;
let Arrow$5 = class Arrow extends Line_1$3.Line {
  _sceneFunc(ctx) {
    super._sceneFunc(ctx);
    var PI2 = Math.PI * 2;
    var points = this.points();
    var tp = points;
    var fromTension = this.tension() !== 0 && points.length > 4;
    if (fromTension) {
      tp = this.getTensionPoints();
    }
    var length = this.pointerLength();
    var n2 = points.length;
    var dx, dy;
    if (fromTension) {
      const lp = [
        tp[tp.length - 4],
        tp[tp.length - 3],
        tp[tp.length - 2],
        tp[tp.length - 1],
        points[n2 - 2],
        points[n2 - 1]
      ];
      const lastLength = Path_1$5.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], "C", lp);
      const previous = Path_1$5.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);
      dx = points[n2 - 2] - previous.x;
      dy = points[n2 - 1] - previous.y;
    } else {
      dx = points[n2 - 2] - points[n2 - 4];
      dy = points[n2 - 1] - points[n2 - 3];
    }
    var radians = (Math.atan2(dy, dx) + PI2) % PI2;
    var width = this.pointerWidth();
    if (this.pointerAtEnding()) {
      ctx.save();
      ctx.beginPath();
      ctx.translate(points[n2 - 2], points[n2 - 1]);
      ctx.rotate(radians);
      ctx.moveTo(0, 0);
      ctx.lineTo(-length, width / 2);
      ctx.lineTo(-length, -width / 2);
      ctx.closePath();
      ctx.restore();
      this.__fillStroke(ctx);
    }
    if (this.pointerAtBeginning()) {
      ctx.save();
      ctx.beginPath();
      ctx.translate(points[0], points[1]);
      if (fromTension) {
        dx = (tp[0] + tp[2]) / 2 - points[0];
        dy = (tp[1] + tp[3]) / 2 - points[1];
      } else {
        dx = points[2] - points[0];
        dy = points[3] - points[1];
      }
      ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);
      ctx.moveTo(0, 0);
      ctx.lineTo(-length, width / 2);
      ctx.lineTo(-length, -width / 2);
      ctx.closePath();
      ctx.restore();
      this.__fillStroke(ctx);
    }
  }
  __fillStroke(ctx) {
    var isDashEnabled = this.dashEnabled();
    if (isDashEnabled) {
      this.attrs.dashEnabled = false;
      ctx.setLineDash([]);
    }
    ctx.fillStrokeShape(this);
    if (isDashEnabled) {
      this.attrs.dashEnabled = true;
    }
  }
  getSelfRect() {
    const lineRect = super.getSelfRect();
    const offset5 = this.pointerWidth() / 2;
    return {
      x: lineRect.x - offset5,
      y: lineRect.y - offset5,
      width: lineRect.width + offset5 * 2,
      height: lineRect.height + offset5 * 2
    };
  }
};
Arrow$6.Arrow = Arrow$5;
Arrow$5.prototype.className = "Arrow";
(0, Global_1$D._registerNode)(Arrow$5);
Factory_1$10.Factory.addGetterSetter(Arrow$5, "pointerLength", 10, (0, Validators_1$$.getNumberValidator)());
Factory_1$10.Factory.addGetterSetter(Arrow$5, "pointerWidth", 10, (0, Validators_1$$.getNumberValidator)());
Factory_1$10.Factory.addGetterSetter(Arrow$5, "pointerAtBeginning", false);
Factory_1$10.Factory.addGetterSetter(Arrow$5, "pointerAtEnding", true);
var Circle$3 = {};
Object.defineProperty(Circle$3, "__esModule", { value: true });
Circle$3.Circle = void 0;
const Factory_1$$ = Factory$1;
const Shape_1$t = Shape$1;
const Validators_1$_ = Validators$1;
const Global_1$C = Global$1;
let Circle$2 = class Circle extends Shape_1$t.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    if (this.radius() !== width / 2) {
      this.radius(width / 2);
    }
  }
  setHeight(height) {
    if (this.radius() !== height / 2) {
      this.radius(height / 2);
    }
  }
};
Circle$3.Circle = Circle$2;
Circle$2.prototype._centroid = true;
Circle$2.prototype.className = "Circle";
Circle$2.prototype._attrsAffectingSize = ["radius"];
(0, Global_1$C._registerNode)(Circle$2);
Factory_1$$.Factory.addGetterSetter(Circle$2, "radius", 0, (0, Validators_1$_.getNumberValidator)());
var Ellipse$5 = {};
Object.defineProperty(Ellipse$5, "__esModule", { value: true });
Ellipse$5.Ellipse = void 0;
const Factory_1$_ = Factory$1;
const Shape_1$s = Shape$1;
const Validators_1$Z = Validators$1;
const Global_1$B = Global$1;
let Ellipse$4 = class Ellipse extends Shape_1$s.Shape {
  _sceneFunc(context) {
    var rx = this.radiusX(), ry = this.radiusY();
    context.beginPath();
    context.save();
    if (rx !== ry) {
      context.scale(1, ry / rx);
    }
    context.arc(0, 0, rx, 0, Math.PI * 2, false);
    context.restore();
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radiusX() * 2;
  }
  getHeight() {
    return this.radiusY() * 2;
  }
  setWidth(width) {
    this.radiusX(width / 2);
  }
  setHeight(height) {
    this.radiusY(height / 2);
  }
};
Ellipse$5.Ellipse = Ellipse$4;
Ellipse$4.prototype.className = "Ellipse";
Ellipse$4.prototype._centroid = true;
Ellipse$4.prototype._attrsAffectingSize = ["radiusX", "radiusY"];
(0, Global_1$B._registerNode)(Ellipse$4);
Factory_1$_.Factory.addComponentsGetterSetter(Ellipse$4, "radius", ["x", "y"]);
Factory_1$_.Factory.addGetterSetter(Ellipse$4, "radiusX", 0, (0, Validators_1$Z.getNumberValidator)());
Factory_1$_.Factory.addGetterSetter(Ellipse$4, "radiusY", 0, (0, Validators_1$Z.getNumberValidator)());
var Image$5 = {};
Object.defineProperty(Image$5, "__esModule", { value: true });
Image$5.Image = void 0;
const Util_1$n = Util$1;
const Factory_1$Z = Factory$1;
const Shape_1$r = Shape$1;
const Global_1$A = Global$1;
const Validators_1$Y = Validators$1;
let Image$4 = class Image2 extends Shape_1$r.Shape {
  constructor(attrs) {
    super(attrs);
    this.on("imageChange.konva", () => {
      this._setImageLoad();
    });
    this._setImageLoad();
  }
  _setImageLoad() {
    const image = this.image();
    if (image && image.complete) {
      return;
    }
    if (image && image.readyState === 4) {
      return;
    }
    if (image && image["addEventListener"]) {
      image["addEventListener"]("load", () => {
        this._requestDraw();
      });
    }
  }
  _useBufferCanvas() {
    const hasCornerRadius = !!this.cornerRadius();
    const hasShadow = this.hasShadow();
    if (hasCornerRadius && hasShadow) {
      return true;
    }
    return super._useBufferCanvas(true);
  }
  _sceneFunc(context) {
    const width = this.getWidth();
    const height = this.getHeight();
    const cornerRadius = this.cornerRadius();
    const image = this.attrs.image;
    let params;
    if (image) {
      const cropWidth = this.attrs.cropWidth;
      const cropHeight = this.attrs.cropHeight;
      if (cropWidth && cropHeight) {
        params = [
          image,
          this.cropX(),
          this.cropY(),
          cropWidth,
          cropHeight,
          0,
          0,
          width,
          height
        ];
      } else {
        params = [image, 0, 0, width, height];
      }
    }
    if (this.hasFill() || this.hasStroke() || cornerRadius) {
      context.beginPath();
      cornerRadius ? Util_1$n.Util.drawRoundedRectPath(context, width, height, cornerRadius) : context.rect(0, 0, width, height);
      context.closePath();
      context.fillStrokeShape(this);
    }
    if (image) {
      if (cornerRadius) {
        context.clip();
      }
      context.drawImage.apply(context, params);
    }
  }
  _hitFunc(context) {
    var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();
    context.beginPath();
    if (!cornerRadius) {
      context.rect(0, 0, width, height);
    } else {
      Util_1$n.Util.drawRoundedRectPath(context, width, height, cornerRadius);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    var _a2, _b2;
    return (_a2 = this.attrs.width) !== null && _a2 !== void 0 ? _a2 : (_b2 = this.image()) === null || _b2 === void 0 ? void 0 : _b2.width;
  }
  getHeight() {
    var _a2, _b2;
    return (_a2 = this.attrs.height) !== null && _a2 !== void 0 ? _a2 : (_b2 = this.image()) === null || _b2 === void 0 ? void 0 : _b2.height;
  }
  static fromURL(url, callback, onError = null) {
    var img = Util_1$n.Util.createImageElement();
    img.onload = function() {
      var image = new Image2({
        image: img
      });
      callback(image);
    };
    img.onerror = onError;
    img.crossOrigin = "Anonymous";
    img.src = url;
  }
};
Image$5.Image = Image$4;
Image$4.prototype.className = "Image";
(0, Global_1$A._registerNode)(Image$4);
Factory_1$Z.Factory.addGetterSetter(Image$4, "cornerRadius", 0, (0, Validators_1$Y.getNumberOrArrayOfNumbersValidator)(4));
Factory_1$Z.Factory.addGetterSetter(Image$4, "image");
Factory_1$Z.Factory.addComponentsGetterSetter(Image$4, "crop", ["x", "y", "width", "height"]);
Factory_1$Z.Factory.addGetterSetter(Image$4, "cropX", 0, (0, Validators_1$Y.getNumberValidator)());
Factory_1$Z.Factory.addGetterSetter(Image$4, "cropY", 0, (0, Validators_1$Y.getNumberValidator)());
Factory_1$Z.Factory.addGetterSetter(Image$4, "cropWidth", 0, (0, Validators_1$Y.getNumberValidator)());
Factory_1$Z.Factory.addGetterSetter(Image$4, "cropHeight", 0, (0, Validators_1$Y.getNumberValidator)());
var Label$a = {};
Object.defineProperty(Label$a, "__esModule", { value: true });
Label$a.Tag = Label$a.Label = void 0;
const Factory_1$Y = Factory$1;
const Shape_1$q = Shape$1;
const Group_1$3 = Group$4;
const Validators_1$X = Validators$1;
const Global_1$z = Global$1;
var ATTR_CHANGE_LIST$5 = [
  "fontFamily",
  "fontSize",
  "fontStyle",
  "padding",
  "lineHeight",
  "text",
  "width",
  "height",
  "pointerDirection",
  "pointerWidth",
  "pointerHeight"
], CHANGE_KONVA$3 = "Change.konva", NONE$3 = "none", UP$1 = "up", RIGHT$3 = "right", DOWN$1 = "down", LEFT$3 = "left", attrChangeListLen$3 = ATTR_CHANGE_LIST$5.length;
let Label$9 = class Label extends Group_1$3.Group {
  constructor(config) {
    super(config);
    this.on("add.konva", function(evt) {
      this._addListeners(evt.child);
      this._sync();
    });
  }
  getText() {
    return this.find("Text")[0];
  }
  getTag() {
    return this.find("Tag")[0];
  }
  _addListeners(text) {
    var that = this, n2;
    var func = function() {
      that._sync();
    };
    for (n2 = 0; n2 < attrChangeListLen$3; n2++) {
      text.on(ATTR_CHANGE_LIST$5[n2] + CHANGE_KONVA$3, func);
    }
  }
  getWidth() {
    return this.getText().width();
  }
  getHeight() {
    return this.getText().height();
  }
  _sync() {
    var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x2, y2, pointerHeight;
    if (text && tag) {
      width = text.width();
      height = text.height();
      pointerDirection = tag.pointerDirection();
      pointerWidth = tag.pointerWidth();
      pointerHeight = tag.pointerHeight();
      x2 = 0;
      y2 = 0;
      switch (pointerDirection) {
        case UP$1:
          x2 = width / 2;
          y2 = -1 * pointerHeight;
          break;
        case RIGHT$3:
          x2 = width + pointerWidth;
          y2 = height / 2;
          break;
        case DOWN$1:
          x2 = width / 2;
          y2 = height + pointerHeight;
          break;
        case LEFT$3:
          x2 = -1 * pointerWidth;
          y2 = height / 2;
          break;
      }
      tag.setAttrs({
        x: -1 * x2,
        y: -1 * y2,
        width,
        height
      });
      text.setAttrs({
        x: -1 * x2,
        y: -1 * y2
      });
    }
  }
};
Label$a.Label = Label$9;
Label$9.prototype.className = "Label";
(0, Global_1$z._registerNode)(Label$9);
let Tag$1 = class Tag extends Shape_1$q.Shape {
  _sceneFunc(context) {
    var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();
    let topLeft = 0;
    let topRight = 0;
    let bottomLeft = 0;
    let bottomRight = 0;
    if (typeof cornerRadius === "number") {
      topLeft = topRight = bottomLeft = bottomRight = Math.min(cornerRadius, width / 2, height / 2);
    } else {
      topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);
      topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);
      bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);
      bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);
    }
    context.beginPath();
    context.moveTo(topLeft, 0);
    if (pointerDirection === UP$1) {
      context.lineTo((width - pointerWidth) / 2, 0);
      context.lineTo(width / 2, -1 * pointerHeight);
      context.lineTo((width + pointerWidth) / 2, 0);
    }
    context.lineTo(width - topRight, 0);
    context.arc(width - topRight, topRight, topRight, Math.PI * 3 / 2, 0, false);
    if (pointerDirection === RIGHT$3) {
      context.lineTo(width, (height - pointerHeight) / 2);
      context.lineTo(width + pointerWidth, height / 2);
      context.lineTo(width, (height + pointerHeight) / 2);
    }
    context.lineTo(width, height - bottomRight);
    context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);
    if (pointerDirection === DOWN$1) {
      context.lineTo((width + pointerWidth) / 2, height);
      context.lineTo(width / 2, height + pointerHeight);
      context.lineTo((width - pointerWidth) / 2, height);
    }
    context.lineTo(bottomLeft, height);
    context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);
    if (pointerDirection === LEFT$3) {
      context.lineTo(0, (height + pointerHeight) / 2);
      context.lineTo(-1 * pointerWidth, height / 2);
      context.lineTo(0, (height - pointerHeight) / 2);
    }
    context.lineTo(0, topLeft);
    context.arc(topLeft, topLeft, topLeft, Math.PI, Math.PI * 3 / 2, false);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getSelfRect() {
    var x2 = 0, y2 = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();
    if (direction === UP$1) {
      y2 -= pointerHeight;
      height += pointerHeight;
    } else if (direction === DOWN$1) {
      height += pointerHeight;
    } else if (direction === LEFT$3) {
      x2 -= pointerWidth * 1.5;
      width += pointerWidth;
    } else if (direction === RIGHT$3) {
      width += pointerWidth * 1.5;
    }
    return {
      x: x2,
      y: y2,
      width,
      height
    };
  }
};
Label$a.Tag = Tag$1;
Tag$1.prototype.className = "Tag";
(0, Global_1$z._registerNode)(Tag$1);
Factory_1$Y.Factory.addGetterSetter(Tag$1, "pointerDirection", NONE$3);
Factory_1$Y.Factory.addGetterSetter(Tag$1, "pointerWidth", 0, (0, Validators_1$X.getNumberValidator)());
Factory_1$Y.Factory.addGetterSetter(Tag$1, "pointerHeight", 0, (0, Validators_1$X.getNumberValidator)());
Factory_1$Y.Factory.addGetterSetter(Tag$1, "cornerRadius", 0, (0, Validators_1$X.getNumberOrArrayOfNumbersValidator)(4));
var Rect$4 = {};
Object.defineProperty(Rect$4, "__esModule", { value: true });
Rect$4.Rect = void 0;
const Factory_1$X = Factory$1;
const Shape_1$p = Shape$1;
const Global_1$y = Global$1;
const Util_1$m = Util$1;
const Validators_1$W = Validators$1;
let Rect$3 = class Rect extends Shape_1$p.Shape {
  _sceneFunc(context) {
    var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();
    context.beginPath();
    if (!cornerRadius) {
      context.rect(0, 0, width, height);
    } else {
      Util_1$m.Util.drawRoundedRectPath(context, width, height, cornerRadius);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
};
Rect$4.Rect = Rect$3;
Rect$3.prototype.className = "Rect";
(0, Global_1$y._registerNode)(Rect$3);
Factory_1$X.Factory.addGetterSetter(Rect$3, "cornerRadius", 0, (0, Validators_1$W.getNumberOrArrayOfNumbersValidator)(4));
var RegularPolygon$4 = {};
Object.defineProperty(RegularPolygon$4, "__esModule", { value: true });
RegularPolygon$4.RegularPolygon = void 0;
const Factory_1$W = Factory$1;
const Shape_1$o = Shape$1;
const Validators_1$V = Validators$1;
const Global_1$x = Global$1;
let RegularPolygon$3 = class RegularPolygon extends Shape_1$o.Shape {
  _sceneFunc(context) {
    const points = this._getPoints();
    context.beginPath();
    context.moveTo(points[0].x, points[0].y);
    for (var n2 = 1; n2 < points.length; n2++) {
      context.lineTo(points[n2].x, points[n2].y);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  _getPoints() {
    const sides = this.attrs.sides;
    const radius = this.attrs.radius || 0;
    const points = [];
    for (var n2 = 0; n2 < sides; n2++) {
      points.push({
        x: radius * Math.sin(n2 * 2 * Math.PI / sides),
        y: -1 * radius * Math.cos(n2 * 2 * Math.PI / sides)
      });
    }
    return points;
  }
  getSelfRect() {
    const points = this._getPoints();
    var minX = points[0].x;
    var maxX = points[0].y;
    var minY = points[0].x;
    var maxY = points[0].y;
    points.forEach((point) => {
      minX = Math.min(minX, point.x);
      maxX = Math.max(maxX, point.x);
      minY = Math.min(minY, point.y);
      maxY = Math.max(maxY, point.y);
    });
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    this.radius(width / 2);
  }
  setHeight(height) {
    this.radius(height / 2);
  }
};
RegularPolygon$4.RegularPolygon = RegularPolygon$3;
RegularPolygon$3.prototype.className = "RegularPolygon";
RegularPolygon$3.prototype._centroid = true;
RegularPolygon$3.prototype._attrsAffectingSize = ["radius"];
(0, Global_1$x._registerNode)(RegularPolygon$3);
Factory_1$W.Factory.addGetterSetter(RegularPolygon$3, "radius", 0, (0, Validators_1$V.getNumberValidator)());
Factory_1$W.Factory.addGetterSetter(RegularPolygon$3, "sides", 0, (0, Validators_1$V.getNumberValidator)());
var Ring$3 = {};
Object.defineProperty(Ring$3, "__esModule", { value: true });
Ring$3.Ring = void 0;
const Factory_1$V = Factory$1;
const Shape_1$n = Shape$1;
const Validators_1$U = Validators$1;
const Global_1$w = Global$1;
var PIx2$1 = Math.PI * 2;
let Ring$2 = class Ring extends Shape_1$n.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.innerRadius(), 0, PIx2$1, false);
    context.moveTo(this.outerRadius(), 0);
    context.arc(0, 0, this.outerRadius(), PIx2$1, 0, true);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
};
Ring$3.Ring = Ring$2;
Ring$2.prototype.className = "Ring";
Ring$2.prototype._centroid = true;
Ring$2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_1$w._registerNode)(Ring$2);
Factory_1$V.Factory.addGetterSetter(Ring$2, "innerRadius", 0, (0, Validators_1$U.getNumberValidator)());
Factory_1$V.Factory.addGetterSetter(Ring$2, "outerRadius", 0, (0, Validators_1$U.getNumberValidator)());
var Sprite$3 = {};
Object.defineProperty(Sprite$3, "__esModule", { value: true });
Sprite$3.Sprite = void 0;
const Factory_1$U = Factory$1;
const Shape_1$m = Shape$1;
const Animation_1$1 = Animation$3;
const Validators_1$T = Validators$1;
const Global_1$v = Global$1;
let Sprite$2 = class Sprite extends Shape_1$m.Shape {
  constructor(config) {
    super(config);
    this._updated = true;
    this.anim = new Animation_1$1.Animation(() => {
      var updated = this._updated;
      this._updated = false;
      return updated;
    });
    this.on("animationChange.konva", function() {
      this.frameIndex(0);
    });
    this.on("frameIndexChange.konva", function() {
      this._updated = true;
    });
    this.on("frameRateChange.konva", function() {
      if (!this.anim.isRunning()) {
        return;
      }
      clearInterval(this.interval);
      this._setInterval();
    });
  }
  _sceneFunc(context) {
    var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x2 = set[ix4 + 0], y2 = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();
    if (this.hasFill() || this.hasStroke()) {
      context.beginPath();
      context.rect(0, 0, width, height);
      context.closePath();
      context.fillStrokeShape(this);
    }
    if (image) {
      if (offsets) {
        var offset5 = offsets[anim], ix2 = index * 2;
        context.drawImage(image, x2, y2, width, height, offset5[ix2 + 0], offset5[ix2 + 1], width, height);
      } else {
        context.drawImage(image, x2, y2, width, height, 0, 0, width, height);
      }
    }
  }
  _hitFunc(context) {
    var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];
    context.beginPath();
    if (offsets) {
      var offset5 = offsets[anim];
      var ix2 = index * 2;
      context.rect(offset5[ix2 + 0], offset5[ix2 + 1], width, height);
    } else {
      context.rect(0, 0, width, height);
    }
    context.closePath();
    context.fillShape(this);
  }
  _useBufferCanvas() {
    return super._useBufferCanvas(true);
  }
  _setInterval() {
    var that = this;
    this.interval = setInterval(function() {
      that._updateIndex();
    }, 1e3 / this.frameRate());
  }
  start() {
    if (this.isRunning()) {
      return;
    }
    var layer = this.getLayer();
    this.anim.setLayers(layer);
    this._setInterval();
    this.anim.start();
  }
  stop() {
    this.anim.stop();
    clearInterval(this.interval);
  }
  isRunning() {
    return this.anim.isRunning();
  }
  _updateIndex() {
    var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;
    if (index < len - 1) {
      this.frameIndex(index + 1);
    } else {
      this.frameIndex(0);
    }
  }
};
Sprite$3.Sprite = Sprite$2;
Sprite$2.prototype.className = "Sprite";
(0, Global_1$v._registerNode)(Sprite$2);
Factory_1$U.Factory.addGetterSetter(Sprite$2, "animation");
Factory_1$U.Factory.addGetterSetter(Sprite$2, "animations");
Factory_1$U.Factory.addGetterSetter(Sprite$2, "frameOffsets");
Factory_1$U.Factory.addGetterSetter(Sprite$2, "image");
Factory_1$U.Factory.addGetterSetter(Sprite$2, "frameIndex", 0, (0, Validators_1$T.getNumberValidator)());
Factory_1$U.Factory.addGetterSetter(Sprite$2, "frameRate", 17, (0, Validators_1$T.getNumberValidator)());
Factory_1$U.Factory.backCompat(Sprite$2, {
  index: "frameIndex",
  getIndex: "getFrameIndex",
  setIndex: "setFrameIndex"
});
var Star$3 = {};
Object.defineProperty(Star$3, "__esModule", { value: true });
Star$3.Star = void 0;
const Factory_1$T = Factory$1;
const Shape_1$l = Shape$1;
const Validators_1$S = Validators$1;
const Global_1$u = Global$1;
let Star$2 = class Star extends Shape_1$l.Shape {
  _sceneFunc(context) {
    var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();
    context.beginPath();
    context.moveTo(0, 0 - outerRadius);
    for (var n2 = 1; n2 < numPoints * 2; n2++) {
      var radius = n2 % 2 === 0 ? outerRadius : innerRadius;
      var x2 = radius * Math.sin(n2 * Math.PI / numPoints);
      var y2 = -1 * radius * Math.cos(n2 * Math.PI / numPoints);
      context.lineTo(x2, y2);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
};
Star$3.Star = Star$2;
Star$2.prototype.className = "Star";
Star$2.prototype._centroid = true;
Star$2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_1$u._registerNode)(Star$2);
Factory_1$T.Factory.addGetterSetter(Star$2, "numPoints", 5, (0, Validators_1$S.getNumberValidator)());
Factory_1$T.Factory.addGetterSetter(Star$2, "innerRadius", 0, (0, Validators_1$S.getNumberValidator)());
Factory_1$T.Factory.addGetterSetter(Star$2, "outerRadius", 0, (0, Validators_1$S.getNumberValidator)());
var Text$7 = {};
Object.defineProperty(Text$7, "__esModule", { value: true });
Text$7.Text = Text$7.stringToArray = void 0;
const Util_1$l = Util$1;
const Factory_1$S = Factory$1;
const Shape_1$k = Shape$1;
const Global_1$t = Global$1;
const Validators_1$R = Validators$1;
const Global_2$5 = Global$1;
function stringToArray$1(string) {
  return Array.from(string);
}
Text$7.stringToArray = stringToArray$1;
var AUTO$1 = "auto", CENTER$1 = "center", INHERIT$1 = "inherit", JUSTIFY$1 = "justify", CHANGE_KONVA$2 = "Change.konva", CONTEXT_2D$1 = "2d", DASH$1 = "-", LEFT$2 = "left", TEXT$1 = "text", TEXT_UPPER$1 = "Text", TOP$1 = "top", BOTTOM$1 = "bottom", MIDDLE$1 = "middle", NORMAL$3 = "normal", PX_SPACE$1 = "px ", SPACE$2 = " ", RIGHT$2 = "right", RTL$1 = "rtl", WORD$1 = "word", CHAR$1 = "char", NONE$2 = "none", ELLIPSIS$1 = "…", ATTR_CHANGE_LIST$4 = [
  "direction",
  "fontFamily",
  "fontSize",
  "fontStyle",
  "fontVariant",
  "padding",
  "align",
  "verticalAlign",
  "lineHeight",
  "text",
  "width",
  "height",
  "wrap",
  "ellipsis",
  "letterSpacing"
], attrChangeListLen$2 = ATTR_CHANGE_LIST$4.length;
function normalizeFontFamily$1(fontFamily) {
  return fontFamily.split(",").map((family) => {
    family = family.trim();
    const hasSpace = family.indexOf(" ") >= 0;
    const hasQuotes = family.indexOf('"') >= 0 || family.indexOf("'") >= 0;
    if (hasSpace && !hasQuotes) {
      family = `"${family}"`;
    }
    return family;
  }).join(", ");
}
var dummyContext$1;
function getDummyContext$1() {
  if (dummyContext$1) {
    return dummyContext$1;
  }
  dummyContext$1 = Util_1$l.Util.createCanvasElement().getContext(CONTEXT_2D$1);
  return dummyContext$1;
}
function _fillFunc$3(context) {
  context.fillText(this._partialText, this._partialTextX, this._partialTextY);
}
function _strokeFunc$3(context) {
  context.setAttr("miterLimit", 2);
  context.strokeText(this._partialText, this._partialTextX, this._partialTextY);
}
function checkDefaultFill$1(config) {
  config = config || {};
  if (!config.fillLinearGradientColorStops && !config.fillRadialGradientColorStops && !config.fillPatternImage) {
    config.fill = config.fill || "black";
  }
  return config;
}
let Text$6 = class Text extends Shape_1$k.Shape {
  constructor(config) {
    super(checkDefaultFill$1(config));
    this._partialTextX = 0;
    this._partialTextY = 0;
    for (var n2 = 0; n2 < attrChangeListLen$2; n2++) {
      this.on(ATTR_CHANGE_LIST$4[n2] + CHANGE_KONVA$2, this._setTextData);
    }
    this._setTextData();
  }
  _sceneFunc(context) {
    var textArr = this.textArr, textArrLen = textArr.length;
    if (!this.text()) {
      return;
    }
    var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf("underline") !== -1, shouldLineThrough = textDecoration.indexOf("line-through") !== -1, n2;
    direction = direction === INHERIT$1 ? context.direction : direction;
    var translateY = lineHeightPx / 2;
    var baseline = MIDDLE$1;
    if (Global_1$t.Konva._fixTextRendering) {
      var metrics = this.measureSize("M");
      baseline = "alphabetic";
      translateY = (metrics.fontBoundingBoxAscent - metrics.fontBoundingBoxDescent) / 2 + lineHeightPx / 2;
    }
    var lineTranslateX = 0;
    var lineTranslateY = 0;
    if (direction === RTL$1) {
      context.setAttr("direction", direction);
    }
    context.setAttr("font", this._getContextFont());
    context.setAttr("textBaseline", baseline);
    context.setAttr("textAlign", LEFT$2);
    if (verticalAlign === MIDDLE$1) {
      alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;
    } else if (verticalAlign === BOTTOM$1) {
      alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;
    }
    context.translate(padding, alignY + padding);
    for (n2 = 0; n2 < textArrLen; n2++) {
      var lineTranslateX = 0;
      var lineTranslateY = 0;
      var obj = textArr[n2], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;
      context.save();
      if (align === RIGHT$2) {
        lineTranslateX += totalWidth - width - padding * 2;
      } else if (align === CENTER$1) {
        lineTranslateX += (totalWidth - width - padding * 2) / 2;
      }
      if (shouldUnderline) {
        context.save();
        context.beginPath();
        let yOffset = Global_1$t.Konva._fixTextRendering ? Math.round(fontSize / 4) : Math.round(fontSize / 2);
        const x2 = lineTranslateX;
        const y2 = translateY + lineTranslateY + yOffset;
        context.moveTo(x2, y2);
        spacesNumber = text.split(" ").length - 1;
        oneWord = spacesNumber === 0;
        lineWidth = align === JUSTIFY$1 && !lastLine ? totalWidth - padding * 2 : width;
        context.lineTo(x2 + Math.round(lineWidth), y2);
        context.lineWidth = fontSize / 15;
        const gradient = this._getLinearGradient();
        context.strokeStyle = gradient || fill;
        context.stroke();
        context.restore();
      }
      if (shouldLineThrough) {
        context.save();
        context.beginPath();
        let yOffset = Global_1$t.Konva._fixTextRendering ? -Math.round(fontSize / 4) : 0;
        context.moveTo(lineTranslateX, translateY + lineTranslateY + yOffset);
        spacesNumber = text.split(" ").length - 1;
        oneWord = spacesNumber === 0;
        lineWidth = align === JUSTIFY$1 && lastLine && !oneWord ? totalWidth - padding * 2 : width;
        context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + yOffset);
        context.lineWidth = fontSize / 15;
        const gradient = this._getLinearGradient();
        context.strokeStyle = gradient || fill;
        context.stroke();
        context.restore();
      }
      if (direction !== RTL$1 && (letterSpacing !== 0 || align === JUSTIFY$1)) {
        spacesNumber = text.split(" ").length - 1;
        var array = stringToArray$1(text);
        for (var li2 = 0; li2 < array.length; li2++) {
          var letter = array[li2];
          if (letter === " " && !lastLine && align === JUSTIFY$1) {
            lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;
          }
          this._partialTextX = lineTranslateX;
          this._partialTextY = translateY + lineTranslateY;
          this._partialText = letter;
          context.fillStrokeShape(this);
          lineTranslateX += this.measureSize(letter).width + letterSpacing;
        }
      } else {
        if (letterSpacing !== 0) {
          context.setAttr("letterSpacing", `${letterSpacing}px`);
        }
        this._partialTextX = lineTranslateX;
        this._partialTextY = translateY + lineTranslateY;
        this._partialText = text;
        context.fillStrokeShape(this);
      }
      context.restore();
      if (textArrLen > 1) {
        translateY += lineHeightPx;
      }
    }
  }
  _hitFunc(context) {
    var width = this.getWidth(), height = this.getHeight();
    context.beginPath();
    context.rect(0, 0, width, height);
    context.closePath();
    context.fillStrokeShape(this);
  }
  setText(text) {
    var str = Util_1$l.Util._isString(text) ? text : text === null || text === void 0 ? "" : text + "";
    this._setAttr(TEXT$1, str);
    return this;
  }
  getWidth() {
    var isAuto = this.attrs.width === AUTO$1 || this.attrs.width === void 0;
    return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;
  }
  getHeight() {
    var isAuto = this.attrs.height === AUTO$1 || this.attrs.height === void 0;
    return isAuto ? this.fontSize() * this.textArr.length * this.lineHeight() + this.padding() * 2 : this.attrs.height;
  }
  getTextWidth() {
    return this.textWidth;
  }
  getTextHeight() {
    Util_1$l.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.");
    return this.textHeight;
  }
  measureSize(text) {
    var _a2, _b2, _c, _d, _e2, _f, _g, _h, _j, _k, _l;
    var _context = getDummyContext$1(), fontSize = this.fontSize(), metrics;
    _context.save();
    _context.font = this._getContextFont();
    metrics = _context.measureText(text);
    _context.restore();
    const scaleFactor = fontSize / 100;
    return {
      actualBoundingBoxAscent: (_a2 = metrics.actualBoundingBoxAscent) !== null && _a2 !== void 0 ? _a2 : 71.58203125 * scaleFactor,
      actualBoundingBoxDescent: (_b2 = metrics.actualBoundingBoxDescent) !== null && _b2 !== void 0 ? _b2 : 0,
      actualBoundingBoxLeft: (_c = metrics.actualBoundingBoxLeft) !== null && _c !== void 0 ? _c : -7.421875 * scaleFactor,
      actualBoundingBoxRight: (_d = metrics.actualBoundingBoxRight) !== null && _d !== void 0 ? _d : 75.732421875 * scaleFactor,
      alphabeticBaseline: (_e2 = metrics.alphabeticBaseline) !== null && _e2 !== void 0 ? _e2 : 0,
      emHeightAscent: (_f = metrics.emHeightAscent) !== null && _f !== void 0 ? _f : 100 * scaleFactor,
      emHeightDescent: (_g = metrics.emHeightDescent) !== null && _g !== void 0 ? _g : -20 * scaleFactor,
      fontBoundingBoxAscent: (_h = metrics.fontBoundingBoxAscent) !== null && _h !== void 0 ? _h : 91 * scaleFactor,
      fontBoundingBoxDescent: (_j = metrics.fontBoundingBoxDescent) !== null && _j !== void 0 ? _j : 21 * scaleFactor,
      hangingBaseline: (_k = metrics.hangingBaseline) !== null && _k !== void 0 ? _k : 72.80000305175781 * scaleFactor,
      ideographicBaseline: (_l = metrics.ideographicBaseline) !== null && _l !== void 0 ? _l : -21 * scaleFactor,
      width: metrics.width,
      height: fontSize
    };
  }
  _getContextFont() {
    return this.fontStyle() + SPACE$2 + this.fontVariant() + SPACE$2 + (this.fontSize() + PX_SPACE$1) + normalizeFontFamily$1(this.fontFamily());
  }
  _addTextLine(line) {
    const align = this.align();
    if (align === JUSTIFY$1) {
      line = line.trim();
    }
    var width = this._getTextWidth(line);
    return this.textArr.push({
      text: line,
      width,
      lastInParagraph: false
    });
  }
  _getTextWidth(text) {
    var letterSpacing = this.letterSpacing();
    var length = text.length;
    return getDummyContext$1().measureText(text).width + (length ? letterSpacing * (length - 1) : 0);
  }
  _setTextData() {
    var lines = this.text().split("\n"), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO$1 && width !== void 0, fixedHeight = height !== AUTO$1 && height !== void 0, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE$2, wrapAtWord = wrap !== CHAR$1 && shouldWrap, shouldAddEllipsis = this.ellipsis();
    this.textArr = [];
    getDummyContext$1().font = this._getContextFont();
    var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS$1) : 0;
    for (var i = 0, max2 = lines.length; i < max2; ++i) {
      var line = lines[i];
      var lineWidth = this._getTextWidth(line);
      if (fixedWidth && lineWidth > maxWidth) {
        while (line.length > 0) {
          var low = 0, high = line.length, match = "", matchWidth = 0;
          while (low < high) {
            var mid = low + high >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
            if (substrWidth <= maxWidth) {
              low = mid + 1;
              match = substr;
              matchWidth = substrWidth;
            } else {
              high = mid;
            }
          }
          if (match) {
            if (wrapAtWord) {
              var wrapIndex;
              var nextChar = line[match.length];
              var nextIsSpaceOrDash = nextChar === SPACE$2 || nextChar === DASH$1;
              if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
                wrapIndex = match.length;
              } else {
                wrapIndex = Math.max(match.lastIndexOf(SPACE$2), match.lastIndexOf(DASH$1)) + 1;
              }
              if (wrapIndex > 0) {
                low = wrapIndex;
                match = match.slice(0, low);
                matchWidth = this._getTextWidth(match);
              }
            }
            match = match.trimRight();
            this._addTextLine(match);
            textWidth = Math.max(textWidth, matchWidth);
            currentHeightPx += lineHeightPx;
            var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);
            if (shouldHandleEllipsis) {
              this._tryToAddEllipsisToLastLine();
              break;
            }
            line = line.slice(low);
            line = line.trimLeft();
            if (line.length > 0) {
              lineWidth = this._getTextWidth(line);
              if (lineWidth <= maxWidth) {
                this._addTextLine(line);
                currentHeightPx += lineHeightPx;
                textWidth = Math.max(textWidth, lineWidth);
                break;
              }
            }
          } else {
            break;
          }
        }
      } else {
        this._addTextLine(line);
        currentHeightPx += lineHeightPx;
        textWidth = Math.max(textWidth, lineWidth);
        if (this._shouldHandleEllipsis(currentHeightPx) && i < max2 - 1) {
          this._tryToAddEllipsisToLastLine();
        }
      }
      if (this.textArr[this.textArr.length - 1]) {
        this.textArr[this.textArr.length - 1].lastInParagraph = true;
      }
      if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {
        break;
      }
    }
    this.textHeight = fontSize;
    this.textWidth = textWidth;
  }
  _shouldHandleEllipsis(currentHeightPx) {
    var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO$1 && height !== void 0, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE$2;
    return !shouldWrap || fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx;
  }
  _tryToAddEllipsisToLastLine() {
    var width = this.attrs.width, fixedWidth = width !== AUTO$1 && width !== void 0, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();
    var lastLine = this.textArr[this.textArr.length - 1];
    if (!lastLine || !shouldAddEllipsis) {
      return;
    }
    if (fixedWidth) {
      var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS$1) < maxWidth;
      if (!haveSpace) {
        lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);
      }
    }
    this.textArr.splice(this.textArr.length - 1, 1);
    this._addTextLine(lastLine.text + ELLIPSIS$1);
  }
  getStrokeScaleEnabled() {
    return true;
  }
  _useBufferCanvas() {
    const hasLine = this.textDecoration().indexOf("underline") !== -1 || this.textDecoration().indexOf("line-through") !== -1;
    const hasShadow = this.hasShadow();
    if (hasLine && hasShadow) {
      return true;
    }
    return super._useBufferCanvas();
  }
};
Text$7.Text = Text$6;
Text$6.prototype._fillFunc = _fillFunc$3;
Text$6.prototype._strokeFunc = _strokeFunc$3;
Text$6.prototype.className = TEXT_UPPER$1;
Text$6.prototype._attrsAffectingSize = [
  "text",
  "fontSize",
  "padding",
  "wrap",
  "lineHeight",
  "letterSpacing"
];
(0, Global_2$5._registerNode)(Text$6);
Factory_1$S.Factory.overWriteSetter(Text$6, "width", (0, Validators_1$R.getNumberOrAutoValidator)());
Factory_1$S.Factory.overWriteSetter(Text$6, "height", (0, Validators_1$R.getNumberOrAutoValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "direction", INHERIT$1);
Factory_1$S.Factory.addGetterSetter(Text$6, "fontFamily", "Arial");
Factory_1$S.Factory.addGetterSetter(Text$6, "fontSize", 12, (0, Validators_1$R.getNumberValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "fontStyle", NORMAL$3);
Factory_1$S.Factory.addGetterSetter(Text$6, "fontVariant", NORMAL$3);
Factory_1$S.Factory.addGetterSetter(Text$6, "padding", 0, (0, Validators_1$R.getNumberValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "align", LEFT$2);
Factory_1$S.Factory.addGetterSetter(Text$6, "verticalAlign", TOP$1);
Factory_1$S.Factory.addGetterSetter(Text$6, "lineHeight", 1, (0, Validators_1$R.getNumberValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "wrap", WORD$1);
Factory_1$S.Factory.addGetterSetter(Text$6, "ellipsis", false, (0, Validators_1$R.getBooleanValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "letterSpacing", 0, (0, Validators_1$R.getNumberValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "text", "", (0, Validators_1$R.getStringValidator)());
Factory_1$S.Factory.addGetterSetter(Text$6, "textDecoration", "");
var TextPath$3 = {};
Object.defineProperty(TextPath$3, "__esModule", { value: true });
TextPath$3.TextPath = void 0;
const Util_1$k = Util$1;
const Factory_1$R = Factory$1;
const Shape_1$j = Shape$1;
const Path_1$4 = Path$3;
const Text_1$3 = Text$7;
const Validators_1$Q = Validators$1;
const Global_1$s = Global$1;
var EMPTY_STRING$1 = "", NORMAL$2 = "normal";
function _fillFunc$2(context) {
  context.fillText(this.partialText, 0, 0);
}
function _strokeFunc$2(context) {
  context.strokeText(this.partialText, 0, 0);
}
let TextPath$2 = class TextPath extends Shape_1$j.Shape {
  constructor(config) {
    super(config);
    this.dummyCanvas = Util_1$k.Util.createCanvasElement();
    this.dataArray = [];
    this._readDataAttribute();
    this.on("dataChange.konva", function() {
      this._readDataAttribute();
      this._setTextData();
    });
    this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva", this._setTextData);
    this._setTextData();
  }
  _getTextPathLength() {
    return Path_1$4.Path.getPathLength(this.dataArray);
  }
  _getPointAtLength(length) {
    if (!this.attrs.data) {
      return null;
    }
    const totalLength = this.pathLength;
    if (length - 1 > totalLength) {
      return null;
    }
    return Path_1$4.Path.getPointAtLengthOfDataArray(length, this.dataArray);
  }
  _readDataAttribute() {
    this.dataArray = Path_1$4.Path.parsePathData(this.attrs.data);
    this.pathLength = this._getTextPathLength();
  }
  _sceneFunc(context) {
    context.setAttr("font", this._getContextFont());
    context.setAttr("textBaseline", this.textBaseline());
    context.setAttr("textAlign", "left");
    context.save();
    var textDecoration = this.textDecoration();
    var fill = this.fill();
    var fontSize = this.fontSize();
    var glyphInfo = this.glyphInfo;
    if (textDecoration === "underline") {
      context.beginPath();
    }
    for (var i = 0; i < glyphInfo.length; i++) {
      context.save();
      var p0 = glyphInfo[i].p0;
      context.translate(p0.x, p0.y);
      context.rotate(glyphInfo[i].rotation);
      this.partialText = glyphInfo[i].text;
      context.fillStrokeShape(this);
      if (textDecoration === "underline") {
        if (i === 0) {
          context.moveTo(0, fontSize / 2 + 1);
        }
        context.lineTo(fontSize, fontSize / 2 + 1);
      }
      context.restore();
    }
    if (textDecoration === "underline") {
      context.strokeStyle = fill;
      context.lineWidth = fontSize / 20;
      context.stroke();
    }
    context.restore();
  }
  _hitFunc(context) {
    context.beginPath();
    var glyphInfo = this.glyphInfo;
    if (glyphInfo.length >= 1) {
      var p0 = glyphInfo[0].p0;
      context.moveTo(p0.x, p0.y);
    }
    for (var i = 0; i < glyphInfo.length; i++) {
      var p1 = glyphInfo[i].p1;
      context.lineTo(p1.x, p1.y);
    }
    context.setAttr("lineWidth", this.fontSize());
    context.setAttr("strokeStyle", this.colorKey);
    context.stroke();
  }
  getTextWidth() {
    return this.textWidth;
  }
  getTextHeight() {
    Util_1$k.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.");
    return this.textHeight;
  }
  setText(text) {
    return Text_1$3.Text.prototype.setText.call(this, text);
  }
  _getContextFont() {
    return Text_1$3.Text.prototype._getContextFont.call(this);
  }
  _getTextSize(text) {
    var dummyCanvas = this.dummyCanvas;
    var _context = dummyCanvas.getContext("2d");
    _context.save();
    _context.font = this._getContextFont();
    var metrics = _context.measureText(text);
    _context.restore();
    return {
      width: metrics.width,
      height: parseInt(`${this.fontSize()}`, 10)
    };
  }
  _setTextData() {
    const { width, height } = this._getTextSize(this.attrs.text);
    this.textWidth = width;
    this.textHeight = height;
    this.glyphInfo = [];
    if (!this.attrs.data) {
      return null;
    }
    const letterSpacing = this.letterSpacing();
    const align = this.align();
    const kerningFunc = this.kerningFunc();
    const textWidth = Math.max(this.textWidth + ((this.attrs.text || "").length - 1) * letterSpacing, 0);
    let offset5 = 0;
    if (align === "center") {
      offset5 = Math.max(0, this.pathLength / 2 - textWidth / 2);
    }
    if (align === "right") {
      offset5 = Math.max(0, this.pathLength - textWidth);
    }
    const charArr = (0, Text_1$3.stringToArray)(this.text());
    let offsetToGlyph = offset5;
    for (var i = 0; i < charArr.length; i++) {
      const charStartPoint = this._getPointAtLength(offsetToGlyph);
      if (!charStartPoint)
        return;
      let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;
      if (charArr[i] === " " && align === "justify") {
        const numberOfSpaces = this.text().split(" ").length - 1;
        glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;
      }
      const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);
      if (!charEndPoint)
        return;
      const width2 = Path_1$4.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);
      let kern = 0;
      if (kerningFunc) {
        try {
          kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();
        } catch (e2) {
          kern = 0;
        }
      }
      charStartPoint.x += kern;
      charEndPoint.x += kern;
      this.textWidth += kern;
      const midpoint = Path_1$4.Path.getPointOnLine(kern + width2 / 2, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);
      const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);
      this.glyphInfo.push({
        transposeX: midpoint.x,
        transposeY: midpoint.y,
        text: charArr[i],
        rotation,
        p0: charStartPoint,
        p1: charEndPoint
      });
      offsetToGlyph += glyphWidth;
    }
  }
  getSelfRect() {
    if (!this.glyphInfo.length) {
      return {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      };
    }
    var points = [];
    this.glyphInfo.forEach(function(info) {
      points.push(info.p0.x);
      points.push(info.p0.y);
      points.push(info.p1.x);
      points.push(info.p1.y);
    });
    var minX = points[0] || 0;
    var maxX = points[0] || 0;
    var minY = points[1] || 0;
    var maxY = points[1] || 0;
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      minX = Math.min(minX, x2);
      maxX = Math.max(maxX, x2);
      minY = Math.min(minY, y2);
      maxY = Math.max(maxY, y2);
    }
    var fontSize = this.fontSize();
    return {
      x: minX - fontSize / 2,
      y: minY - fontSize / 2,
      width: maxX - minX + fontSize,
      height: maxY - minY + fontSize
    };
  }
  destroy() {
    Util_1$k.Util.releaseCanvas(this.dummyCanvas);
    return super.destroy();
  }
};
TextPath$3.TextPath = TextPath$2;
TextPath$2.prototype._fillFunc = _fillFunc$2;
TextPath$2.prototype._strokeFunc = _strokeFunc$2;
TextPath$2.prototype._fillFuncHit = _fillFunc$2;
TextPath$2.prototype._strokeFuncHit = _strokeFunc$2;
TextPath$2.prototype.className = "TextPath";
TextPath$2.prototype._attrsAffectingSize = ["text", "fontSize", "data"];
(0, Global_1$s._registerNode)(TextPath$2);
Factory_1$R.Factory.addGetterSetter(TextPath$2, "data");
Factory_1$R.Factory.addGetterSetter(TextPath$2, "fontFamily", "Arial");
Factory_1$R.Factory.addGetterSetter(TextPath$2, "fontSize", 12, (0, Validators_1$Q.getNumberValidator)());
Factory_1$R.Factory.addGetterSetter(TextPath$2, "fontStyle", NORMAL$2);
Factory_1$R.Factory.addGetterSetter(TextPath$2, "align", "left");
Factory_1$R.Factory.addGetterSetter(TextPath$2, "letterSpacing", 0, (0, Validators_1$Q.getNumberValidator)());
Factory_1$R.Factory.addGetterSetter(TextPath$2, "textBaseline", "middle");
Factory_1$R.Factory.addGetterSetter(TextPath$2, "fontVariant", NORMAL$2);
Factory_1$R.Factory.addGetterSetter(TextPath$2, "text", EMPTY_STRING$1);
Factory_1$R.Factory.addGetterSetter(TextPath$2, "textDecoration", null);
Factory_1$R.Factory.addGetterSetter(TextPath$2, "kerningFunc", null);
var Transformer$4 = {};
Object.defineProperty(Transformer$4, "__esModule", { value: true });
Transformer$4.Transformer = void 0;
const Util_1$j = Util$1;
const Factory_1$Q = Factory$1;
const Node_1$x = Node$3;
const Shape_1$i = Shape$1;
const Rect_1$3 = Rect$4;
const Group_1$2 = Group$4;
const Global_1$r = Global$1;
const Validators_1$P = Validators$1;
const Global_2$4 = Global$1;
var EVENTS_NAME$1 = "tr-konva";
var ATTR_CHANGE_LIST$3 = [
  "resizeEnabledChange",
  "rotateAnchorOffsetChange",
  "rotateEnabledChange",
  "enabledAnchorsChange",
  "anchorSizeChange",
  "borderEnabledChange",
  "borderStrokeChange",
  "borderStrokeWidthChange",
  "borderDashChange",
  "anchorStrokeChange",
  "anchorStrokeWidthChange",
  "anchorFillChange",
  "anchorCornerRadiusChange",
  "ignoreStrokeChange",
  "anchorStyleFuncChange"
].map((e2) => e2 + `.${EVENTS_NAME$1}`).join(" ");
var NODES_RECT$1 = "nodesRect";
var TRANSFORM_CHANGE_STR$2 = [
  "widthChange",
  "heightChange",
  "scaleXChange",
  "scaleYChange",
  "skewXChange",
  "skewYChange",
  "rotationChange",
  "offsetXChange",
  "offsetYChange",
  "transformsEnabledChange",
  "strokeWidthChange"
];
var ANGLES$1 = {
  "top-left": -45,
  "top-center": 0,
  "top-right": 45,
  "middle-right": -90,
  "middle-left": 90,
  "bottom-left": -135,
  "bottom-center": 180,
  "bottom-right": 135
};
const TOUCH_DEVICE$1 = "ontouchstart" in Global_1$r.Konva._global;
function getCursor$1(anchorName, rad, rotateCursor) {
  if (anchorName === "rotater") {
    return rotateCursor;
  }
  rad += Util_1$j.Util.degToRad(ANGLES$1[anchorName] || 0);
  var angle = (Util_1$j.Util.radToDeg(rad) % 360 + 360) % 360;
  if (Util_1$j.Util._inRange(angle, 315 + 22.5, 360) || Util_1$j.Util._inRange(angle, 0, 22.5)) {
    return "ns-resize";
  } else if (Util_1$j.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {
    return "nesw-resize";
  } else if (Util_1$j.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {
    return "ew-resize";
  } else if (Util_1$j.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {
    return "nwse-resize";
  } else if (Util_1$j.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {
    return "ns-resize";
  } else if (Util_1$j.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {
    return "nesw-resize";
  } else if (Util_1$j.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {
    return "ew-resize";
  } else if (Util_1$j.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {
    return "nwse-resize";
  } else {
    Util_1$j.Util.error("Transformer has unknown angle for cursor detection: " + angle);
    return "pointer";
  }
}
var ANCHORS_NAMES$1 = [
  "top-left",
  "top-center",
  "top-right",
  "middle-right",
  "middle-left",
  "bottom-left",
  "bottom-center",
  "bottom-right"
];
var MAX_SAFE_INTEGER$1 = 1e8;
function getCenter$2(shape) {
  return {
    x: shape.x + shape.width / 2 * Math.cos(shape.rotation) + shape.height / 2 * Math.sin(-shape.rotation),
    y: shape.y + shape.height / 2 * Math.cos(shape.rotation) + shape.width / 2 * Math.sin(shape.rotation)
  };
}
function rotateAroundPoint$1(shape, angleRad, point) {
  const x2 = point.x + (shape.x - point.x) * Math.cos(angleRad) - (shape.y - point.y) * Math.sin(angleRad);
  const y2 = point.y + (shape.x - point.x) * Math.sin(angleRad) + (shape.y - point.y) * Math.cos(angleRad);
  return {
    ...shape,
    rotation: shape.rotation + angleRad,
    x: x2,
    y: y2
  };
}
function rotateAroundCenter$1(shape, deltaRad) {
  const center = getCenter$2(shape);
  return rotateAroundPoint$1(shape, deltaRad, center);
}
function getSnap$1(snaps, newRotationRad, tol) {
  let snapped = newRotationRad;
  for (let i = 0; i < snaps.length; i++) {
    const angle = Global_1$r.Konva.getAngle(snaps[i]);
    const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);
    const dif = Math.min(absDiff, Math.PI * 2 - absDiff);
    if (dif < tol) {
      snapped = angle;
    }
  }
  return snapped;
}
let activeTransformersCount$1 = 0;
let Transformer$3 = class Transformer extends Group_1$2.Group {
  constructor(config) {
    super(config);
    this._movingAnchorName = null;
    this._transforming = false;
    this._createElements();
    this._handleMouseMove = this._handleMouseMove.bind(this);
    this._handleMouseUp = this._handleMouseUp.bind(this);
    this.update = this.update.bind(this);
    this.on(ATTR_CHANGE_LIST$3, this.update);
    if (this.getNode()) {
      this.update();
    }
  }
  attachTo(node) {
    this.setNode(node);
    return this;
  }
  setNode(node) {
    Util_1$j.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.");
    return this.setNodes([node]);
  }
  getNode() {
    return this._nodes && this._nodes[0];
  }
  _getEventNamespace() {
    return EVENTS_NAME$1 + this._id;
  }
  setNodes(nodes = []) {
    if (this._nodes && this._nodes.length) {
      this.detach();
    }
    const filteredNodes = nodes.filter((node) => {
      if (node.isAncestorOf(this)) {
        Util_1$j.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach");
        return false;
      }
      return true;
    });
    this._nodes = nodes = filteredNodes;
    if (nodes.length === 1 && this.useSingleNodeRotation()) {
      this.rotation(nodes[0].getAbsoluteRotation());
    } else {
      this.rotation(0);
    }
    this._nodes.forEach((node) => {
      const onChange2 = () => {
        if (this.nodes().length === 1 && this.useSingleNodeRotation()) {
          this.rotation(this.nodes()[0].getAbsoluteRotation());
        }
        this._resetTransformCache();
        if (!this._transforming && !this.isDragging()) {
          this.update();
        }
      };
      const additionalEvents = node._attrsAffectingSize.map((prop) => prop + "Change." + this._getEventNamespace()).join(" ");
      node.on(additionalEvents, onChange2);
      node.on(TRANSFORM_CHANGE_STR$2.map((e2) => e2 + `.${this._getEventNamespace()}`).join(" "), onChange2);
      node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange2);
      this._proxyDrag(node);
    });
    this._resetTransformCache();
    var elementsCreated = !!this.findOne(".top-left");
    if (elementsCreated) {
      this.update();
    }
    return this;
  }
  _proxyDrag(node) {
    let lastPos;
    node.on(`dragstart.${this._getEventNamespace()}`, (e2) => {
      lastPos = node.getAbsolutePosition();
      if (!this.isDragging() && node !== this.findOne(".back")) {
        this.startDrag(e2, false);
      }
    });
    node.on(`dragmove.${this._getEventNamespace()}`, (e2) => {
      if (!lastPos) {
        return;
      }
      const abs = node.getAbsolutePosition();
      const dx = abs.x - lastPos.x;
      const dy = abs.y - lastPos.y;
      this.nodes().forEach((otherNode) => {
        if (otherNode === node) {
          return;
        }
        if (otherNode.isDragging()) {
          return;
        }
        const otherAbs = otherNode.getAbsolutePosition();
        otherNode.setAbsolutePosition({
          x: otherAbs.x + dx,
          y: otherAbs.y + dy
        });
        otherNode.startDrag(e2);
      });
      lastPos = null;
    });
  }
  getNodes() {
    return this._nodes || [];
  }
  getActiveAnchor() {
    return this._movingAnchorName;
  }
  detach() {
    if (this._nodes) {
      this._nodes.forEach((node) => {
        node.off("." + this._getEventNamespace());
      });
    }
    this._nodes = [];
    this._resetTransformCache();
  }
  _resetTransformCache() {
    this._clearCache(NODES_RECT$1);
    this._clearCache("transform");
    this._clearSelfAndDescendantCache("absoluteTransform");
  }
  _getNodeRect() {
    return this._getCache(NODES_RECT$1, this.__getNodeRect);
  }
  __getNodeShape(node, rot = this.rotation(), relative) {
    var rect = node.getClientRect({
      skipTransform: true,
      skipShadow: true,
      skipStroke: this.ignoreStroke()
    });
    var absScale = node.getAbsoluteScale(relative);
    var absPos = node.getAbsolutePosition(relative);
    var dx = rect.x * absScale.x - node.offsetX() * absScale.x;
    var dy = rect.y * absScale.y - node.offsetY() * absScale.y;
    const rotation = (Global_1$r.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) % (Math.PI * 2);
    const box = {
      x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),
      y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),
      width: rect.width * absScale.x,
      height: rect.height * absScale.y,
      rotation
    };
    return rotateAroundPoint$1(box, -Global_1$r.Konva.getAngle(rot), {
      x: 0,
      y: 0
    });
  }
  __getNodeRect() {
    var node = this.getNode();
    if (!node) {
      return {
        x: -MAX_SAFE_INTEGER$1,
        y: -MAX_SAFE_INTEGER$1,
        width: 0,
        height: 0,
        rotation: 0
      };
    }
    const totalPoints = [];
    this.nodes().map((node2) => {
      const box = node2.getClientRect({
        skipTransform: true,
        skipShadow: true,
        skipStroke: this.ignoreStroke()
      });
      var points = [
        { x: box.x, y: box.y },
        { x: box.x + box.width, y: box.y },
        { x: box.x + box.width, y: box.y + box.height },
        { x: box.x, y: box.y + box.height }
      ];
      var trans = node2.getAbsoluteTransform();
      points.forEach(function(point) {
        var transformed = trans.point(point);
        totalPoints.push(transformed);
      });
    });
    const tr = new Util_1$j.Transform();
    tr.rotate(-Global_1$r.Konva.getAngle(this.rotation()));
    var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
    totalPoints.forEach(function(point) {
      var transformed = tr.point(point);
      if (minX === void 0) {
        minX = maxX = transformed.x;
        minY = maxY = transformed.y;
      }
      minX = Math.min(minX, transformed.x);
      minY = Math.min(minY, transformed.y);
      maxX = Math.max(maxX, transformed.x);
      maxY = Math.max(maxY, transformed.y);
    });
    tr.invert();
    const p2 = tr.point({ x: minX, y: minY });
    return {
      x: p2.x,
      y: p2.y,
      width: maxX - minX,
      height: maxY - minY,
      rotation: Global_1$r.Konva.getAngle(this.rotation())
    };
  }
  getX() {
    return this._getNodeRect().x;
  }
  getY() {
    return this._getNodeRect().y;
  }
  getWidth() {
    return this._getNodeRect().width;
  }
  getHeight() {
    return this._getNodeRect().height;
  }
  _createElements() {
    this._createBack();
    ANCHORS_NAMES$1.forEach((name) => {
      this._createAnchor(name);
    });
    this._createAnchor("rotater");
  }
  _createAnchor(name) {
    var anchor = new Rect_1$3.Rect({
      stroke: "rgb(0, 161, 255)",
      fill: "white",
      strokeWidth: 1,
      name: name + " _anchor",
      dragDistance: 0,
      draggable: true,
      hitStrokeWidth: TOUCH_DEVICE$1 ? 10 : "auto"
    });
    var self2 = this;
    anchor.on("mousedown touchstart", function(e2) {
      self2._handleMouseDown(e2);
    });
    anchor.on("dragstart", (e2) => {
      anchor.stopDrag();
      e2.cancelBubble = true;
    });
    anchor.on("dragend", (e2) => {
      e2.cancelBubble = true;
    });
    anchor.on("mouseenter", () => {
      var rad = Global_1$r.Konva.getAngle(this.rotation());
      var rotateCursor = this.rotateAnchorCursor();
      var cursor = getCursor$1(name, rad, rotateCursor);
      anchor.getStage().content && (anchor.getStage().content.style.cursor = cursor);
      this._cursorChange = true;
    });
    anchor.on("mouseout", () => {
      anchor.getStage().content && (anchor.getStage().content.style.cursor = "");
      this._cursorChange = false;
    });
    this.add(anchor);
  }
  _createBack() {
    var back = new Shape_1$i.Shape({
      name: "back",
      width: 0,
      height: 0,
      draggable: true,
      sceneFunc(ctx, shape) {
        var tr = shape.getParent();
        var padding = tr.padding();
        ctx.beginPath();
        ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);
        ctx.moveTo(shape.width() / 2, -padding);
        if (tr.rotateEnabled() && tr.rotateLineVisible()) {
          ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1$j.Util._sign(shape.height()) - padding);
        }
        ctx.fillStrokeShape(shape);
      },
      hitFunc: (ctx, shape) => {
        if (!this.shouldOverdrawWholeArea()) {
          return;
        }
        var padding = this.padding();
        ctx.beginPath();
        ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);
        ctx.fillStrokeShape(shape);
      }
    });
    this.add(back);
    this._proxyDrag(back);
    back.on("dragstart", (e2) => {
      e2.cancelBubble = true;
    });
    back.on("dragmove", (e2) => {
      e2.cancelBubble = true;
    });
    back.on("dragend", (e2) => {
      e2.cancelBubble = true;
    });
    this.on("dragmove", (e2) => {
      this.update();
    });
  }
  _handleMouseDown(e2) {
    if (this._transforming) {
      return;
    }
    this._movingAnchorName = e2.target.name().split(" ")[0];
    var attrs = this._getNodeRect();
    var width = attrs.width;
    var height = attrs.height;
    var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
    this.sin = Math.abs(height / hypotenuse);
    this.cos = Math.abs(width / hypotenuse);
    if (typeof window !== "undefined") {
      window.addEventListener("mousemove", this._handleMouseMove);
      window.addEventListener("touchmove", this._handleMouseMove);
      window.addEventListener("mouseup", this._handleMouseUp, true);
      window.addEventListener("touchend", this._handleMouseUp, true);
    }
    this._transforming = true;
    var ap = e2.target.getAbsolutePosition();
    var pos = e2.target.getStage().getPointerPosition();
    this._anchorDragOffset = {
      x: pos.x - ap.x,
      y: pos.y - ap.y
    };
    activeTransformersCount$1++;
    this._fire("transformstart", { evt: e2.evt, target: this.getNode() });
    this._nodes.forEach((target) => {
      target._fire("transformstart", { evt: e2.evt, target });
    });
  }
  _handleMouseMove(e2) {
    var x2, y2, newHypotenuse;
    var anchorNode = this.findOne("." + this._movingAnchorName);
    var stage = anchorNode.getStage();
    stage.setPointersPositions(e2);
    const pp = stage.getPointerPosition();
    let newNodePos = {
      x: pp.x - this._anchorDragOffset.x,
      y: pp.y - this._anchorDragOffset.y
    };
    const oldAbs = anchorNode.getAbsolutePosition();
    if (this.anchorDragBoundFunc()) {
      newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e2);
    }
    anchorNode.setAbsolutePosition(newNodePos);
    const newAbs = anchorNode.getAbsolutePosition();
    if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {
      return;
    }
    if (this._movingAnchorName === "rotater") {
      var attrs = this._getNodeRect();
      x2 = anchorNode.x() - attrs.width / 2;
      y2 = -anchorNode.y() + attrs.height / 2;
      let delta = Math.atan2(-y2, x2) + Math.PI / 2;
      if (attrs.height < 0) {
        delta -= Math.PI;
      }
      var oldRotation = Global_1$r.Konva.getAngle(this.rotation());
      const newRotation = oldRotation + delta;
      const tol = Global_1$r.Konva.getAngle(this.rotationSnapTolerance());
      const snappedRot = getSnap$1(this.rotationSnaps(), newRotation, tol);
      const diff = snappedRot - attrs.rotation;
      const shape = rotateAroundCenter$1(attrs, diff);
      this._fitNodesInto(shape, e2);
      return;
    }
    var shiftBehavior = this.shiftBehavior();
    var keepProportion;
    if (shiftBehavior === "inverted") {
      keepProportion = this.keepRatio() && !e2.shiftKey;
    } else if (shiftBehavior === "none") {
      keepProportion = this.keepRatio();
    } else {
      keepProportion = this.keepRatio() || e2.shiftKey;
    }
    var centeredScaling = this.centeredScaling() || e2.altKey;
    if (this._movingAnchorName === "top-left") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".bottom-right").x(),
          y: this.findOne(".bottom-right").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) + Math.pow(comparePoint.y - anchorNode.y(), 2));
        var reverseX = this.findOne(".top-left").x() > comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".top-left").y() > comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".top-left").x(comparePoint.x - x2);
        this.findOne(".top-left").y(comparePoint.y - y2);
      }
    } else if (this._movingAnchorName === "top-center") {
      this.findOne(".top-left").y(anchorNode.y());
    } else if (this._movingAnchorName === "top-right") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".bottom-left").x(),
          y: this.findOne(".bottom-left").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) + Math.pow(comparePoint.y - anchorNode.y(), 2));
        var reverseX = this.findOne(".top-right").x() < comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".top-right").y() > comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".top-right").x(comparePoint.x + x2);
        this.findOne(".top-right").y(comparePoint.y - y2);
      }
      var pos = anchorNode.position();
      this.findOne(".top-left").y(pos.y);
      this.findOne(".bottom-right").x(pos.x);
    } else if (this._movingAnchorName === "middle-left") {
      this.findOne(".top-left").x(anchorNode.x());
    } else if (this._movingAnchorName === "middle-right") {
      this.findOne(".bottom-right").x(anchorNode.x());
    } else if (this._movingAnchorName === "bottom-left") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".top-right").x(),
          y: this.findOne(".top-right").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) + Math.pow(anchorNode.y() - comparePoint.y, 2));
        var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;
        var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        anchorNode.x(comparePoint.x - x2);
        anchorNode.y(comparePoint.y + y2);
      }
      pos = anchorNode.position();
      this.findOne(".top-left").x(pos.x);
      this.findOne(".bottom-right").y(pos.y);
    } else if (this._movingAnchorName === "bottom-center") {
      this.findOne(".bottom-right").y(anchorNode.y());
    } else if (this._movingAnchorName === "bottom-right") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".top-left").x(),
          y: this.findOne(".top-left").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) + Math.pow(anchorNode.y() - comparePoint.y, 2));
        var reverseX = this.findOne(".bottom-right").x() < comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".bottom-right").y() < comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".bottom-right").x(comparePoint.x + x2);
        this.findOne(".bottom-right").y(comparePoint.y + y2);
      }
    } else {
      console.error(new Error("Wrong position argument of selection resizer: " + this._movingAnchorName));
    }
    var centeredScaling = this.centeredScaling() || e2.altKey;
    if (centeredScaling) {
      var topLeft = this.findOne(".top-left");
      var bottomRight = this.findOne(".bottom-right");
      var topOffsetX = topLeft.x();
      var topOffsetY = topLeft.y();
      var bottomOffsetX = this.getWidth() - bottomRight.x();
      var bottomOffsetY = this.getHeight() - bottomRight.y();
      bottomRight.move({
        x: -topOffsetX,
        y: -topOffsetY
      });
      topLeft.move({
        x: bottomOffsetX,
        y: bottomOffsetY
      });
    }
    var absPos = this.findOne(".top-left").getAbsolutePosition();
    x2 = absPos.x;
    y2 = absPos.y;
    var width = this.findOne(".bottom-right").x() - this.findOne(".top-left").x();
    var height = this.findOne(".bottom-right").y() - this.findOne(".top-left").y();
    this._fitNodesInto({
      x: x2,
      y: y2,
      width,
      height,
      rotation: Global_1$r.Konva.getAngle(this.rotation())
    }, e2);
  }
  _handleMouseUp(e2) {
    this._removeEvents(e2);
  }
  getAbsoluteTransform() {
    return this.getTransform();
  }
  _removeEvents(e2) {
    var _a2;
    if (this._transforming) {
      this._transforming = false;
      if (typeof window !== "undefined") {
        window.removeEventListener("mousemove", this._handleMouseMove);
        window.removeEventListener("touchmove", this._handleMouseMove);
        window.removeEventListener("mouseup", this._handleMouseUp, true);
        window.removeEventListener("touchend", this._handleMouseUp, true);
      }
      var node = this.getNode();
      activeTransformersCount$1--;
      this._fire("transformend", { evt: e2, target: node });
      (_a2 = this.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
      if (node) {
        this._nodes.forEach((target) => {
          var _a3;
          target._fire("transformend", { evt: e2, target });
          (_a3 = target.getLayer()) === null || _a3 === void 0 ? void 0 : _a3.batchDraw();
        });
      }
      this._movingAnchorName = null;
    }
  }
  _fitNodesInto(newAttrs, evt) {
    var oldAttrs = this._getNodeRect();
    const minSize = 1;
    if (Util_1$j.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {
      this.update();
      return;
    }
    if (Util_1$j.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {
      this.update();
      return;
    }
    var t2 = new Util_1$j.Transform();
    t2.rotate(Global_1$r.Konva.getAngle(this.rotation()));
    if (this._movingAnchorName && newAttrs.width < 0 && this._movingAnchorName.indexOf("left") >= 0) {
      const offset5 = t2.point({
        x: -this.padding() * 2,
        y: 0
      });
      newAttrs.x += offset5.x;
      newAttrs.y += offset5.y;
      newAttrs.width += this.padding() * 2;
      this._movingAnchorName = this._movingAnchorName.replace("left", "right");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
    } else if (this._movingAnchorName && newAttrs.width < 0 && this._movingAnchorName.indexOf("right") >= 0) {
      const offset5 = t2.point({
        x: this.padding() * 2,
        y: 0
      });
      this._movingAnchorName = this._movingAnchorName.replace("right", "left");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.width += this.padding() * 2;
    }
    if (this._movingAnchorName && newAttrs.height < 0 && this._movingAnchorName.indexOf("top") >= 0) {
      const offset5 = t2.point({
        x: 0,
        y: -this.padding() * 2
      });
      newAttrs.x += offset5.x;
      newAttrs.y += offset5.y;
      this._movingAnchorName = this._movingAnchorName.replace("top", "bottom");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.height += this.padding() * 2;
    } else if (this._movingAnchorName && newAttrs.height < 0 && this._movingAnchorName.indexOf("bottom") >= 0) {
      const offset5 = t2.point({
        x: 0,
        y: this.padding() * 2
      });
      this._movingAnchorName = this._movingAnchorName.replace("bottom", "top");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.height += this.padding() * 2;
    }
    if (this.boundBoxFunc()) {
      const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);
      if (bounded) {
        newAttrs = bounded;
      } else {
        Util_1$j.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!");
      }
    }
    const baseSize = 1e7;
    const oldTr = new Util_1$j.Transform();
    oldTr.translate(oldAttrs.x, oldAttrs.y);
    oldTr.rotate(oldAttrs.rotation);
    oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);
    const newTr = new Util_1$j.Transform();
    const newScaleX = newAttrs.width / baseSize;
    const newScaleY = newAttrs.height / baseSize;
    if (this.flipEnabled() === false) {
      newTr.translate(newAttrs.x, newAttrs.y);
      newTr.rotate(newAttrs.rotation);
      newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);
      newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));
    } else {
      newTr.translate(newAttrs.x, newAttrs.y);
      newTr.rotate(newAttrs.rotation);
      newTr.scale(newScaleX, newScaleY);
    }
    const delta = newTr.multiply(oldTr.invert());
    this._nodes.forEach((node) => {
      var _a2;
      const parentTransform = node.getParent().getAbsoluteTransform();
      const localTransform = node.getTransform().copy();
      localTransform.translate(node.offsetX(), node.offsetY());
      const newLocalTransform = new Util_1$j.Transform();
      newLocalTransform.multiply(parentTransform.copy().invert()).multiply(delta).multiply(parentTransform).multiply(localTransform);
      const attrs = newLocalTransform.decompose();
      node.setAttrs(attrs);
      (_a2 = node.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
    });
    this.rotation(Util_1$j.Util._getRotation(newAttrs.rotation));
    this._nodes.forEach((node) => {
      this._fire("transform", { evt, target: node });
      node._fire("transform", { evt, target: node });
    });
    this._resetTransformCache();
    this.update();
    this.getLayer().batchDraw();
  }
  forceUpdate() {
    this._resetTransformCache();
    this.update();
  }
  _batchChangeChild(selector, attrs) {
    const anchor = this.findOne(selector);
    anchor.setAttrs(attrs);
  }
  update() {
    var _a2;
    var attrs = this._getNodeRect();
    this.rotation(Util_1$j.Util._getRotation(attrs.rotation));
    var width = attrs.width;
    var height = attrs.height;
    var enabledAnchors = this.enabledAnchors();
    var resizeEnabled = this.resizeEnabled();
    var padding = this.padding();
    var anchorSize = this.anchorSize();
    const anchors = this.find("._anchor");
    anchors.forEach((node) => {
      node.setAttrs({
        width: anchorSize,
        height: anchorSize,
        offsetX: anchorSize / 2,
        offsetY: anchorSize / 2,
        stroke: this.anchorStroke(),
        strokeWidth: this.anchorStrokeWidth(),
        fill: this.anchorFill(),
        cornerRadius: this.anchorCornerRadius()
      });
    });
    this._batchChangeChild(".top-left", {
      x: 0,
      y: 0,
      offsetX: anchorSize / 2 + padding,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-left") >= 0
    });
    this._batchChangeChild(".top-center", {
      x: width / 2,
      y: 0,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-center") >= 0
    });
    this._batchChangeChild(".top-right", {
      x: width,
      y: 0,
      offsetX: anchorSize / 2 - padding,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-right") >= 0
    });
    this._batchChangeChild(".middle-left", {
      x: 0,
      y: height / 2,
      offsetX: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("middle-left") >= 0
    });
    this._batchChangeChild(".middle-right", {
      x: width,
      y: height / 2,
      offsetX: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("middle-right") >= 0
    });
    this._batchChangeChild(".bottom-left", {
      x: 0,
      y: height,
      offsetX: anchorSize / 2 + padding,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-left") >= 0
    });
    this._batchChangeChild(".bottom-center", {
      x: width / 2,
      y: height,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-center") >= 0
    });
    this._batchChangeChild(".bottom-right", {
      x: width,
      y: height,
      offsetX: anchorSize / 2 - padding,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-right") >= 0
    });
    this._batchChangeChild(".rotater", {
      x: width / 2,
      y: -this.rotateAnchorOffset() * Util_1$j.Util._sign(height) - padding,
      visible: this.rotateEnabled()
    });
    this._batchChangeChild(".back", {
      width,
      height,
      visible: this.borderEnabled(),
      stroke: this.borderStroke(),
      strokeWidth: this.borderStrokeWidth(),
      dash: this.borderDash(),
      x: 0,
      y: 0
    });
    const styleFunc = this.anchorStyleFunc();
    if (styleFunc) {
      anchors.forEach((node) => {
        styleFunc(node);
      });
    }
    (_a2 = this.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
  }
  isTransforming() {
    return this._transforming;
  }
  stopTransform() {
    if (this._transforming) {
      this._removeEvents();
      var anchorNode = this.findOne("." + this._movingAnchorName);
      if (anchorNode) {
        anchorNode.stopDrag();
      }
    }
  }
  destroy() {
    if (this.getStage() && this._cursorChange) {
      this.getStage().content && (this.getStage().content.style.cursor = "");
    }
    Group_1$2.Group.prototype.destroy.call(this);
    this.detach();
    this._removeEvents();
    return this;
  }
  toObject() {
    return Node_1$x.Node.prototype.toObject.call(this);
  }
  clone(obj) {
    var node = Node_1$x.Node.prototype.clone.call(this, obj);
    return node;
  }
  getClientRect() {
    if (this.nodes().length > 0) {
      return super.getClientRect();
    } else {
      return { x: 0, y: 0, width: 0, height: 0 };
    }
  }
};
Transformer$4.Transformer = Transformer$3;
Transformer$3.isTransforming = () => {
  return activeTransformersCount$1 > 0;
};
function validateAnchors$1(val) {
  if (!(val instanceof Array)) {
    Util_1$j.Util.warn("enabledAnchors value should be an array");
  }
  if (val instanceof Array) {
    val.forEach(function(name) {
      if (ANCHORS_NAMES$1.indexOf(name) === -1) {
        Util_1$j.Util.warn("Unknown anchor name: " + name + ". Available names are: " + ANCHORS_NAMES$1.join(", "));
      }
    });
  }
  return val || [];
}
Transformer$3.prototype.className = "Transformer";
(0, Global_2$4._registerNode)(Transformer$3);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "enabledAnchors", ANCHORS_NAMES$1, validateAnchors$1);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "flipEnabled", true, (0, Validators_1$P.getBooleanValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "resizeEnabled", true);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorSize", 10, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotateEnabled", true);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotateLineVisible", true);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotationSnaps", []);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotateAnchorOffset", 50, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotateAnchorCursor", "crosshair");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "rotationSnapTolerance", 5, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "borderEnabled", true);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorStroke", "rgb(0, 161, 255)");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorStrokeWidth", 1, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorFill", "white");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorCornerRadius", 0, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "borderStroke", "rgb(0, 161, 255)");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "borderStrokeWidth", 1, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "borderDash");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "keepRatio", true);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "shiftBehavior", "default");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "centeredScaling", false);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "ignoreStroke", false);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "padding", 0, (0, Validators_1$P.getNumberValidator)());
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "node");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "nodes");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "boundBoxFunc");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorDragBoundFunc");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "anchorStyleFunc");
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "shouldOverdrawWholeArea", false);
Factory_1$Q.Factory.addGetterSetter(Transformer$3, "useSingleNodeRotation", true);
Factory_1$Q.Factory.backCompat(Transformer$3, {
  lineEnabled: "borderEnabled",
  rotateHandlerOffset: "rotateAnchorOffset",
  enabledHandlers: "enabledAnchors"
});
var Wedge$3 = {};
Object.defineProperty(Wedge$3, "__esModule", { value: true });
Wedge$3.Wedge = void 0;
const Factory_1$P = Factory$1;
const Shape_1$h = Shape$1;
const Global_1$q = Global$1;
const Validators_1$O = Validators$1;
const Global_2$3 = Global$1;
let Wedge$2 = class Wedge extends Shape_1$h.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.radius(), 0, Global_1$q.Konva.getAngle(this.angle()), this.clockwise());
    context.lineTo(0, 0);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    this.radius(width / 2);
  }
  setHeight(height) {
    this.radius(height / 2);
  }
};
Wedge$3.Wedge = Wedge$2;
Wedge$2.prototype.className = "Wedge";
Wedge$2.prototype._centroid = true;
Wedge$2.prototype._attrsAffectingSize = ["radius"];
(0, Global_2$3._registerNode)(Wedge$2);
Factory_1$P.Factory.addGetterSetter(Wedge$2, "radius", 0, (0, Validators_1$O.getNumberValidator)());
Factory_1$P.Factory.addGetterSetter(Wedge$2, "angle", 0, (0, Validators_1$O.getNumberValidator)());
Factory_1$P.Factory.addGetterSetter(Wedge$2, "clockwise", false);
Factory_1$P.Factory.backCompat(Wedge$2, {
  angleDeg: "angle",
  getAngleDeg: "getAngle",
  setAngleDeg: "setAngle"
});
var Blur$5 = {};
Object.defineProperty(Blur$5, "__esModule", { value: true });
Blur$5.Blur = void 0;
const Factory_1$O = Factory$1;
const Node_1$w = Node$3;
const Validators_1$N = Validators$1;
function BlurStack$1() {
  this.r = 0;
  this.g = 0;
  this.b = 0;
  this.a = 0;
  this.next = null;
}
var mul_table$1 = [
  512,
  512,
  456,
  512,
  328,
  456,
  335,
  512,
  405,
  328,
  271,
  456,
  388,
  335,
  292,
  512,
  454,
  405,
  364,
  328,
  298,
  271,
  496,
  456,
  420,
  388,
  360,
  335,
  312,
  292,
  273,
  512,
  482,
  454,
  428,
  405,
  383,
  364,
  345,
  328,
  312,
  298,
  284,
  271,
  259,
  496,
  475,
  456,
  437,
  420,
  404,
  388,
  374,
  360,
  347,
  335,
  323,
  312,
  302,
  292,
  282,
  273,
  265,
  512,
  497,
  482,
  468,
  454,
  441,
  428,
  417,
  405,
  394,
  383,
  373,
  364,
  354,
  345,
  337,
  328,
  320,
  312,
  305,
  298,
  291,
  284,
  278,
  271,
  265,
  259,
  507,
  496,
  485,
  475,
  465,
  456,
  446,
  437,
  428,
  420,
  412,
  404,
  396,
  388,
  381,
  374,
  367,
  360,
  354,
  347,
  341,
  335,
  329,
  323,
  318,
  312,
  307,
  302,
  297,
  292,
  287,
  282,
  278,
  273,
  269,
  265,
  261,
  512,
  505,
  497,
  489,
  482,
  475,
  468,
  461,
  454,
  447,
  441,
  435,
  428,
  422,
  417,
  411,
  405,
  399,
  394,
  389,
  383,
  378,
  373,
  368,
  364,
  359,
  354,
  350,
  345,
  341,
  337,
  332,
  328,
  324,
  320,
  316,
  312,
  309,
  305,
  301,
  298,
  294,
  291,
  287,
  284,
  281,
  278,
  274,
  271,
  268,
  265,
  262,
  259,
  257,
  507,
  501,
  496,
  491,
  485,
  480,
  475,
  470,
  465,
  460,
  456,
  451,
  446,
  442,
  437,
  433,
  428,
  424,
  420,
  416,
  412,
  408,
  404,
  400,
  396,
  392,
  388,
  385,
  381,
  377,
  374,
  370,
  367,
  363,
  360,
  357,
  354,
  350,
  347,
  344,
  341,
  338,
  335,
  332,
  329,
  326,
  323,
  320,
  318,
  315,
  312,
  310,
  307,
  304,
  302,
  299,
  297,
  294,
  292,
  289,
  287,
  285,
  282,
  280,
  278,
  275,
  273,
  271,
  269,
  267,
  265,
  263,
  261,
  259
];
var shg_table$1 = [
  9,
  11,
  12,
  13,
  13,
  14,
  14,
  15,
  15,
  15,
  15,
  16,
  16,
  16,
  16,
  17,
  17,
  17,
  17,
  17,
  17,
  17,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24
];
function filterGaussBlurRGBA$1(imageData, radius) {
  var pixels = imageData.data, width = imageData.width, height = imageData.height;
  var x2, y2, i, p2, yp, yi2, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg2, pb2, pa2, rbs;
  var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2, stackStart = new BlurStack$1(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table$1[radius], shg_sum = shg_table$1[radius];
  for (i = 1; i < div; i++) {
    stack = stack.next = new BlurStack$1();
    if (i === radiusPlus1) {
      stackEnd = stack;
    }
  }
  stack.next = stackStart;
  yw = yi2 = 0;
  for (y2 = 0; y2 < height; y2++) {
    r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0;
    r_out_sum = radiusPlus1 * (pr = pixels[yi2]);
    g_out_sum = radiusPlus1 * (pg2 = pixels[yi2 + 1]);
    b_out_sum = radiusPlus1 * (pb2 = pixels[yi2 + 2]);
    a_out_sum = radiusPlus1 * (pa2 = pixels[yi2 + 3]);
    r_sum += sumFactor * pr;
    g_sum += sumFactor * pg2;
    b_sum += sumFactor * pb2;
    a_sum += sumFactor * pa2;
    stack = stackStart;
    for (i = 0; i < radiusPlus1; i++) {
      stack.r = pr;
      stack.g = pg2;
      stack.b = pb2;
      stack.a = pa2;
      stack = stack.next;
    }
    for (i = 1; i < radiusPlus1; i++) {
      p2 = yi2 + ((widthMinus1 < i ? widthMinus1 : i) << 2);
      r_sum += (stack.r = pr = pixels[p2]) * (rbs = radiusPlus1 - i);
      g_sum += (stack.g = pg2 = pixels[p2 + 1]) * rbs;
      b_sum += (stack.b = pb2 = pixels[p2 + 2]) * rbs;
      a_sum += (stack.a = pa2 = pixels[p2 + 3]) * rbs;
      r_in_sum += pr;
      g_in_sum += pg2;
      b_in_sum += pb2;
      a_in_sum += pa2;
      stack = stack.next;
    }
    stackIn = stackStart;
    stackOut = stackEnd;
    for (x2 = 0; x2 < width; x2++) {
      pixels[yi2 + 3] = pa2 = a_sum * mul_sum >> shg_sum;
      if (pa2 !== 0) {
        pa2 = 255 / pa2;
        pixels[yi2] = (r_sum * mul_sum >> shg_sum) * pa2;
        pixels[yi2 + 1] = (g_sum * mul_sum >> shg_sum) * pa2;
        pixels[yi2 + 2] = (b_sum * mul_sum >> shg_sum) * pa2;
      } else {
        pixels[yi2] = pixels[yi2 + 1] = pixels[yi2 + 2] = 0;
      }
      r_sum -= r_out_sum;
      g_sum -= g_out_sum;
      b_sum -= b_out_sum;
      a_sum -= a_out_sum;
      r_out_sum -= stackIn.r;
      g_out_sum -= stackIn.g;
      b_out_sum -= stackIn.b;
      a_out_sum -= stackIn.a;
      p2 = yw + ((p2 = x2 + radius + 1) < widthMinus1 ? p2 : widthMinus1) << 2;
      r_in_sum += stackIn.r = pixels[p2];
      g_in_sum += stackIn.g = pixels[p2 + 1];
      b_in_sum += stackIn.b = pixels[p2 + 2];
      a_in_sum += stackIn.a = pixels[p2 + 3];
      r_sum += r_in_sum;
      g_sum += g_in_sum;
      b_sum += b_in_sum;
      a_sum += a_in_sum;
      stackIn = stackIn.next;
      r_out_sum += pr = stackOut.r;
      g_out_sum += pg2 = stackOut.g;
      b_out_sum += pb2 = stackOut.b;
      a_out_sum += pa2 = stackOut.a;
      r_in_sum -= pr;
      g_in_sum -= pg2;
      b_in_sum -= pb2;
      a_in_sum -= pa2;
      stackOut = stackOut.next;
      yi2 += 4;
    }
    yw += width;
  }
  for (x2 = 0; x2 < width; x2++) {
    g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0;
    yi2 = x2 << 2;
    r_out_sum = radiusPlus1 * (pr = pixels[yi2]);
    g_out_sum = radiusPlus1 * (pg2 = pixels[yi2 + 1]);
    b_out_sum = radiusPlus1 * (pb2 = pixels[yi2 + 2]);
    a_out_sum = radiusPlus1 * (pa2 = pixels[yi2 + 3]);
    r_sum += sumFactor * pr;
    g_sum += sumFactor * pg2;
    b_sum += sumFactor * pb2;
    a_sum += sumFactor * pa2;
    stack = stackStart;
    for (i = 0; i < radiusPlus1; i++) {
      stack.r = pr;
      stack.g = pg2;
      stack.b = pb2;
      stack.a = pa2;
      stack = stack.next;
    }
    yp = width;
    for (i = 1; i <= radius; i++) {
      yi2 = yp + x2 << 2;
      r_sum += (stack.r = pr = pixels[yi2]) * (rbs = radiusPlus1 - i);
      g_sum += (stack.g = pg2 = pixels[yi2 + 1]) * rbs;
      b_sum += (stack.b = pb2 = pixels[yi2 + 2]) * rbs;
      a_sum += (stack.a = pa2 = pixels[yi2 + 3]) * rbs;
      r_in_sum += pr;
      g_in_sum += pg2;
      b_in_sum += pb2;
      a_in_sum += pa2;
      stack = stack.next;
      if (i < heightMinus1) {
        yp += width;
      }
    }
    yi2 = x2;
    stackIn = stackStart;
    stackOut = stackEnd;
    for (y2 = 0; y2 < height; y2++) {
      p2 = yi2 << 2;
      pixels[p2 + 3] = pa2 = a_sum * mul_sum >> shg_sum;
      if (pa2 > 0) {
        pa2 = 255 / pa2;
        pixels[p2] = (r_sum * mul_sum >> shg_sum) * pa2;
        pixels[p2 + 1] = (g_sum * mul_sum >> shg_sum) * pa2;
        pixels[p2 + 2] = (b_sum * mul_sum >> shg_sum) * pa2;
      } else {
        pixels[p2] = pixels[p2 + 1] = pixels[p2 + 2] = 0;
      }
      r_sum -= r_out_sum;
      g_sum -= g_out_sum;
      b_sum -= b_out_sum;
      a_sum -= a_out_sum;
      r_out_sum -= stackIn.r;
      g_out_sum -= stackIn.g;
      b_out_sum -= stackIn.b;
      a_out_sum -= stackIn.a;
      p2 = x2 + ((p2 = y2 + radiusPlus1) < heightMinus1 ? p2 : heightMinus1) * width << 2;
      r_sum += r_in_sum += stackIn.r = pixels[p2];
      g_sum += g_in_sum += stackIn.g = pixels[p2 + 1];
      b_sum += b_in_sum += stackIn.b = pixels[p2 + 2];
      a_sum += a_in_sum += stackIn.a = pixels[p2 + 3];
      stackIn = stackIn.next;
      r_out_sum += pr = stackOut.r;
      g_out_sum += pg2 = stackOut.g;
      b_out_sum += pb2 = stackOut.b;
      a_out_sum += pa2 = stackOut.a;
      r_in_sum -= pr;
      g_in_sum -= pg2;
      b_in_sum -= pb2;
      a_in_sum -= pa2;
      stackOut = stackOut.next;
      yi2 += width;
    }
  }
}
const Blur$4 = function Blur(imageData) {
  var radius = Math.round(this.blurRadius());
  if (radius > 0) {
    filterGaussBlurRGBA$1(imageData, radius);
  }
};
Blur$5.Blur = Blur$4;
Factory_1$O.Factory.addGetterSetter(Node_1$w.Node, "blurRadius", 0, (0, Validators_1$N.getNumberValidator)(), Factory_1$O.Factory.afterSetFilter);
var Brighten$3 = {};
Object.defineProperty(Brighten$3, "__esModule", { value: true });
Brighten$3.Brighten = void 0;
const Factory_1$N = Factory$1;
const Node_1$v = Node$3;
const Validators_1$M = Validators$1;
const Brighten$2 = function(imageData) {
  var brightness2 = this.brightness() * 255, data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 4) {
    data[i] += brightness2;
    data[i + 1] += brightness2;
    data[i + 2] += brightness2;
  }
};
Brighten$3.Brighten = Brighten$2;
Factory_1$N.Factory.addGetterSetter(Node_1$v.Node, "brightness", 0, (0, Validators_1$M.getNumberValidator)(), Factory_1$N.Factory.afterSetFilter);
var Contrast$5 = {};
Object.defineProperty(Contrast$5, "__esModule", { value: true });
Contrast$5.Contrast = void 0;
const Factory_1$M = Factory$1;
const Node_1$u = Node$3;
const Validators_1$L = Validators$1;
const Contrast$4 = function(imageData) {
  var adjust = Math.pow((this.contrast() + 100) / 100, 2);
  var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
  for (i = 0; i < nPixels; i += 4) {
    red = data[i];
    green = data[i + 1];
    blue = data[i + 2];
    red /= 255;
    red -= 0.5;
    red *= adjust;
    red += 0.5;
    red *= 255;
    green /= 255;
    green -= 0.5;
    green *= adjust;
    green += 0.5;
    green *= 255;
    blue /= 255;
    blue -= 0.5;
    blue *= adjust;
    blue += 0.5;
    blue *= 255;
    red = red < 0 ? 0 : red > 255 ? 255 : red;
    green = green < 0 ? 0 : green > 255 ? 255 : green;
    blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;
    data[i] = red;
    data[i + 1] = green;
    data[i + 2] = blue;
  }
};
Contrast$5.Contrast = Contrast$4;
Factory_1$M.Factory.addGetterSetter(Node_1$u.Node, "contrast", 0, (0, Validators_1$L.getNumberValidator)(), Factory_1$M.Factory.afterSetFilter);
var Emboss$3 = {};
Object.defineProperty(Emboss$3, "__esModule", { value: true });
Emboss$3.Emboss = void 0;
const Factory_1$L = Factory$1;
const Node_1$t = Node$3;
const Util_1$i = Util$1;
const Validators_1$K = Validators$1;
const Emboss$2 = function(imageData) {
  var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w2 = imageData.width, h2 = imageData.height, w4 = w2 * 4, y2 = h2;
  switch (direction) {
    case "top-left":
      dirY = -1;
      dirX = -1;
      break;
    case "top":
      dirY = -1;
      dirX = 0;
      break;
    case "top-right":
      dirY = -1;
      dirX = 1;
      break;
    case "right":
      dirY = 0;
      dirX = 1;
      break;
    case "bottom-right":
      dirY = 1;
      dirX = 1;
      break;
    case "bottom":
      dirY = 1;
      dirX = 0;
      break;
    case "bottom-left":
      dirY = 1;
      dirX = -1;
      break;
    case "left":
      dirY = 0;
      dirX = -1;
      break;
    default:
      Util_1$i.Util.error("Unknown emboss direction: " + direction);
  }
  do {
    var offsetY = (y2 - 1) * w4;
    var otherY = dirY;
    if (y2 + otherY < 1) {
      otherY = 0;
    }
    if (y2 + otherY > h2) {
      otherY = 0;
    }
    var offsetYOther = (y2 - 1 + otherY) * w2 * 4;
    var x2 = w2;
    do {
      var offset5 = offsetY + (x2 - 1) * 4;
      var otherX = dirX;
      if (x2 + otherX < 1) {
        otherX = 0;
      }
      if (x2 + otherX > w2) {
        otherX = 0;
      }
      var offsetOther = offsetYOther + (x2 - 1 + otherX) * 4;
      var dR = data[offset5] - data[offsetOther];
      var dG = data[offset5 + 1] - data[offsetOther + 1];
      var dB = data[offset5 + 2] - data[offsetOther + 2];
      var dif = dR;
      var absDif = dif > 0 ? dif : -dif;
      var absG = dG > 0 ? dG : -dG;
      var absB = dB > 0 ? dB : -dB;
      if (absG > absDif) {
        dif = dG;
      }
      if (absB > absDif) {
        dif = dB;
      }
      dif *= strength;
      if (blend) {
        var r2 = data[offset5] + dif;
        var g2 = data[offset5 + 1] + dif;
        var b2 = data[offset5 + 2] + dif;
        data[offset5] = r2 > 255 ? 255 : r2 < 0 ? 0 : r2;
        data[offset5 + 1] = g2 > 255 ? 255 : g2 < 0 ? 0 : g2;
        data[offset5 + 2] = b2 > 255 ? 255 : b2 < 0 ? 0 : b2;
      } else {
        var grey = greyLevel - dif;
        if (grey < 0) {
          grey = 0;
        } else if (grey > 255) {
          grey = 255;
        }
        data[offset5] = data[offset5 + 1] = data[offset5 + 2] = grey;
      }
    } while (--x2);
  } while (--y2);
};
Emboss$3.Emboss = Emboss$2;
Factory_1$L.Factory.addGetterSetter(Node_1$t.Node, "embossStrength", 0.5, (0, Validators_1$K.getNumberValidator)(), Factory_1$L.Factory.afterSetFilter);
Factory_1$L.Factory.addGetterSetter(Node_1$t.Node, "embossWhiteLevel", 0.5, (0, Validators_1$K.getNumberValidator)(), Factory_1$L.Factory.afterSetFilter);
Factory_1$L.Factory.addGetterSetter(Node_1$t.Node, "embossDirection", "top-left", null, Factory_1$L.Factory.afterSetFilter);
Factory_1$L.Factory.addGetterSetter(Node_1$t.Node, "embossBlend", false, null, Factory_1$L.Factory.afterSetFilter);
var Enhance$3 = {};
Object.defineProperty(Enhance$3, "__esModule", { value: true });
Enhance$3.Enhance = void 0;
const Factory_1$K = Factory$1;
const Node_1$s = Node$3;
const Validators_1$J = Validators$1;
function remap$1(fromValue, fromMin, fromMax, toMin, toMax) {
  var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
  if (fromRange === 0) {
    return toMin + toRange / 2;
  }
  if (toRange === 0) {
    return toMin;
  }
  toValue = (fromValue - fromMin) / fromRange;
  toValue = toRange * toValue + toMin;
  return toValue;
}
const Enhance$2 = function(imageData) {
  var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r2, gMin = data[1], gMax = gMin, g2, bMin = data[2], bMax = bMin, b2, i;
  var enhanceAmount = this.enhance();
  if (enhanceAmount === 0) {
    return;
  }
  for (i = 0; i < nSubPixels; i += 4) {
    r2 = data[i + 0];
    if (r2 < rMin) {
      rMin = r2;
    } else if (r2 > rMax) {
      rMax = r2;
    }
    g2 = data[i + 1];
    if (g2 < gMin) {
      gMin = g2;
    } else if (g2 > gMax) {
      gMax = g2;
    }
    b2 = data[i + 2];
    if (b2 < bMin) {
      bMin = b2;
    } else if (b2 > bMax) {
      bMax = b2;
    }
  }
  if (rMax === rMin) {
    rMax = 255;
    rMin = 0;
  }
  if (gMax === gMin) {
    gMax = 255;
    gMin = 0;
  }
  if (bMax === bMin) {
    bMax = 255;
    bMin = 0;
  }
  var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;
  if (enhanceAmount > 0) {
    rGoalMax = rMax + enhanceAmount * (255 - rMax);
    rGoalMin = rMin - enhanceAmount * (rMin - 0);
    gGoalMax = gMax + enhanceAmount * (255 - gMax);
    gGoalMin = gMin - enhanceAmount * (gMin - 0);
    bGoalMax = bMax + enhanceAmount * (255 - bMax);
    bGoalMin = bMin - enhanceAmount * (bMin - 0);
  } else {
    rMid = (rMax + rMin) * 0.5;
    rGoalMax = rMax + enhanceAmount * (rMax - rMid);
    rGoalMin = rMin + enhanceAmount * (rMin - rMid);
    gMid = (gMax + gMin) * 0.5;
    gGoalMax = gMax + enhanceAmount * (gMax - gMid);
    gGoalMin = gMin + enhanceAmount * (gMin - gMid);
    bMid = (bMax + bMin) * 0.5;
    bGoalMax = bMax + enhanceAmount * (bMax - bMid);
    bGoalMin = bMin + enhanceAmount * (bMin - bMid);
  }
  for (i = 0; i < nSubPixels; i += 4) {
    data[i + 0] = remap$1(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);
    data[i + 1] = remap$1(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);
    data[i + 2] = remap$1(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
  }
};
Enhance$3.Enhance = Enhance$2;
Factory_1$K.Factory.addGetterSetter(Node_1$s.Node, "enhance", 0, (0, Validators_1$J.getNumberValidator)(), Factory_1$K.Factory.afterSetFilter);
var Grayscale$3 = {};
Object.defineProperty(Grayscale$3, "__esModule", { value: true });
Grayscale$3.Grayscale = void 0;
const Grayscale$2 = function(imageData) {
  var data = imageData.data, len = data.length, i, brightness2;
  for (i = 0; i < len; i += 4) {
    brightness2 = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
    data[i] = brightness2;
    data[i + 1] = brightness2;
    data[i + 2] = brightness2;
  }
};
Grayscale$3.Grayscale = Grayscale$2;
var HSL$3 = {};
Object.defineProperty(HSL$3, "__esModule", { value: true });
HSL$3.HSL = void 0;
const Factory_1$J = Factory$1;
const Node_1$r = Node$3;
const Validators_1$I = Validators$1;
Factory_1$J.Factory.addGetterSetter(Node_1$r.Node, "hue", 0, (0, Validators_1$I.getNumberValidator)(), Factory_1$J.Factory.afterSetFilter);
Factory_1$J.Factory.addGetterSetter(Node_1$r.Node, "saturation", 0, (0, Validators_1$I.getNumberValidator)(), Factory_1$J.Factory.afterSetFilter);
Factory_1$J.Factory.addGetterSetter(Node_1$r.Node, "luminance", 0, (0, Validators_1$I.getNumberValidator)(), Factory_1$J.Factory.afterSetFilter);
const HSL$2 = function(imageData) {
  var data = imageData.data, nPixels = data.length, v2 = 1, s = Math.pow(2, this.saturation()), h2 = Math.abs(this.hue() + 360) % 360, l2 = this.luminance() * 127, i;
  var vsu = v2 * s * Math.cos(h2 * Math.PI / 180), vsw = v2 * s * Math.sin(h2 * Math.PI / 180);
  var rr = 0.299 * v2 + 0.701 * vsu + 0.167 * vsw, rg2 = 0.587 * v2 - 0.587 * vsu + 0.33 * vsw, rb2 = 0.114 * v2 - 0.114 * vsu - 0.497 * vsw;
  var gr = 0.299 * v2 - 0.299 * vsu - 0.328 * vsw, gg2 = 0.587 * v2 + 0.413 * vsu + 0.035 * vsw, gb2 = 0.114 * v2 - 0.114 * vsu + 0.293 * vsw;
  var br = 0.299 * v2 - 0.3 * vsu + 1.25 * vsw, bg2 = 0.587 * v2 - 0.586 * vsu - 1.05 * vsw, bb2 = 0.114 * v2 + 0.886 * vsu - 0.2 * vsw;
  var r2, g2, b2, a;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    a = data[i + 3];
    data[i + 0] = rr * r2 + rg2 * g2 + rb2 * b2 + l2;
    data[i + 1] = gr * r2 + gg2 * g2 + gb2 * b2 + l2;
    data[i + 2] = br * r2 + bg2 * g2 + bb2 * b2 + l2;
    data[i + 3] = a;
  }
};
HSL$3.HSL = HSL$2;
var HSV$4 = {};
Object.defineProperty(HSV$4, "__esModule", { value: true });
HSV$4.HSV = void 0;
const Factory_1$I = Factory$1;
const Node_1$q = Node$3;
const Validators_1$H = Validators$1;
const HSV$3 = function(imageData) {
  var data = imageData.data, nPixels = data.length, v2 = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h2 = Math.abs(this.hue() + 360) % 360, i;
  var vsu = v2 * s * Math.cos(h2 * Math.PI / 180), vsw = v2 * s * Math.sin(h2 * Math.PI / 180);
  var rr = 0.299 * v2 + 0.701 * vsu + 0.167 * vsw, rg2 = 0.587 * v2 - 0.587 * vsu + 0.33 * vsw, rb2 = 0.114 * v2 - 0.114 * vsu - 0.497 * vsw;
  var gr = 0.299 * v2 - 0.299 * vsu - 0.328 * vsw, gg2 = 0.587 * v2 + 0.413 * vsu + 0.035 * vsw, gb2 = 0.114 * v2 - 0.114 * vsu + 0.293 * vsw;
  var br = 0.299 * v2 - 0.3 * vsu + 1.25 * vsw, bg2 = 0.587 * v2 - 0.586 * vsu - 1.05 * vsw, bb2 = 0.114 * v2 + 0.886 * vsu - 0.2 * vsw;
  var r2, g2, b2, a;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    a = data[i + 3];
    data[i + 0] = rr * r2 + rg2 * g2 + rb2 * b2;
    data[i + 1] = gr * r2 + gg2 * g2 + gb2 * b2;
    data[i + 2] = br * r2 + bg2 * g2 + bb2 * b2;
    data[i + 3] = a;
  }
};
HSV$4.HSV = HSV$3;
Factory_1$I.Factory.addGetterSetter(Node_1$q.Node, "hue", 0, (0, Validators_1$H.getNumberValidator)(), Factory_1$I.Factory.afterSetFilter);
Factory_1$I.Factory.addGetterSetter(Node_1$q.Node, "saturation", 0, (0, Validators_1$H.getNumberValidator)(), Factory_1$I.Factory.afterSetFilter);
Factory_1$I.Factory.addGetterSetter(Node_1$q.Node, "value", 0, (0, Validators_1$H.getNumberValidator)(), Factory_1$I.Factory.afterSetFilter);
var Invert$3 = {};
Object.defineProperty(Invert$3, "__esModule", { value: true });
Invert$3.Invert = void 0;
const Invert$2 = function(imageData) {
  var data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 4) {
    data[i] = 255 - data[i];
    data[i + 1] = 255 - data[i + 1];
    data[i + 2] = 255 - data[i + 2];
  }
};
Invert$3.Invert = Invert$2;
var Kaleidoscope$3 = {};
Object.defineProperty(Kaleidoscope$3, "__esModule", { value: true });
Kaleidoscope$3.Kaleidoscope = void 0;
const Factory_1$H = Factory$1;
const Node_1$p = Node$3;
const Util_1$h = Util$1;
const Validators_1$G = Validators$1;
var ToPolar$1 = function(src, dst, opt) {
  var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x2, y2, r2 = 0, g2 = 0, b2 = 0, a = 0;
  var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
  x2 = xSize - xMid;
  y2 = ySize - yMid;
  rad = Math.sqrt(x2 * x2 + y2 * y2);
  rMax = rad > rMax ? rad : rMax;
  var rSize = ySize, tSize = xSize, radius, theta;
  var conversion = 360 / tSize * Math.PI / 180, sin, cos;
  for (theta = 0; theta < tSize; theta += 1) {
    sin = Math.sin(theta * conversion);
    cos = Math.cos(theta * conversion);
    for (radius = 0; radius < rSize; radius += 1) {
      x2 = Math.floor(xMid + rMax * radius / rSize * cos);
      y2 = Math.floor(yMid + rMax * radius / rSize * sin);
      i = (y2 * xSize + x2) * 4;
      r2 = srcPixels[i + 0];
      g2 = srcPixels[i + 1];
      b2 = srcPixels[i + 2];
      a = srcPixels[i + 3];
      i = (theta + radius * xSize) * 4;
      dstPixels[i + 0] = r2;
      dstPixels[i + 1] = g2;
      dstPixels[i + 2] = b2;
      dstPixels[i + 3] = a;
    }
  }
};
var FromPolar$1 = function(src, dst, opt) {
  var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x2, y2, dx, dy, r2 = 0, g2 = 0, b2 = 0, a = 0;
  var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
  x2 = xSize - xMid;
  y2 = ySize - yMid;
  rad = Math.sqrt(x2 * x2 + y2 * y2);
  rMax = rad > rMax ? rad : rMax;
  var rSize = ySize, tSize = xSize, radius, theta, phaseShift = 0;
  var x1, y1;
  for (x2 = 0; x2 < xSize; x2 += 1) {
    for (y2 = 0; y2 < ySize; y2 += 1) {
      dx = x2 - xMid;
      dy = y2 - yMid;
      radius = Math.sqrt(dx * dx + dy * dy) * rSize / rMax;
      theta = (Math.atan2(dy, dx) * 180 / Math.PI + 360 + phaseShift) % 360;
      theta = theta * tSize / 360;
      x1 = Math.floor(theta);
      y1 = Math.floor(radius);
      i = (y1 * xSize + x1) * 4;
      r2 = srcPixels[i + 0];
      g2 = srcPixels[i + 1];
      b2 = srcPixels[i + 2];
      a = srcPixels[i + 3];
      i = (y2 * xSize + x2) * 4;
      dstPixels[i + 0] = r2;
      dstPixels[i + 1] = g2;
      dstPixels[i + 2] = b2;
      dstPixels[i + 3] = a;
    }
  }
};
const Kaleidoscope$2 = function(imageData) {
  var xSize = imageData.width, ySize = imageData.height;
  var x2, y2, xoff, i, r2, g2, b2, a, srcPos, dstPos;
  var power = Math.round(this.kaleidoscopePower());
  var angle = Math.round(this.kaleidoscopeAngle());
  var offset5 = Math.floor(xSize * (angle % 360) / 360);
  if (power < 1) {
    return;
  }
  var tempCanvas = Util_1$h.Util.createCanvasElement();
  tempCanvas.width = xSize;
  tempCanvas.height = ySize;
  var scratchData = tempCanvas.getContext("2d").getImageData(0, 0, xSize, ySize);
  Util_1$h.Util.releaseCanvas(tempCanvas);
  ToPolar$1(imageData, scratchData, {
    polarCenterX: xSize / 2,
    polarCenterY: ySize / 2
  });
  var minSectionSize = xSize / Math.pow(2, power);
  while (minSectionSize <= 8) {
    minSectionSize = minSectionSize * 2;
    power -= 1;
  }
  minSectionSize = Math.ceil(minSectionSize);
  var sectionSize = minSectionSize;
  var xStart = 0, xEnd = sectionSize, xDelta = 1;
  if (offset5 + minSectionSize > xSize) {
    xStart = sectionSize;
    xEnd = 0;
    xDelta = -1;
  }
  for (y2 = 0; y2 < ySize; y2 += 1) {
    for (x2 = xStart; x2 !== xEnd; x2 += xDelta) {
      xoff = Math.round(x2 + offset5) % xSize;
      srcPos = (xSize * y2 + xoff) * 4;
      r2 = scratchData.data[srcPos + 0];
      g2 = scratchData.data[srcPos + 1];
      b2 = scratchData.data[srcPos + 2];
      a = scratchData.data[srcPos + 3];
      dstPos = (xSize * y2 + x2) * 4;
      scratchData.data[dstPos + 0] = r2;
      scratchData.data[dstPos + 1] = g2;
      scratchData.data[dstPos + 2] = b2;
      scratchData.data[dstPos + 3] = a;
    }
  }
  for (y2 = 0; y2 < ySize; y2 += 1) {
    sectionSize = Math.floor(minSectionSize);
    for (i = 0; i < power; i += 1) {
      for (x2 = 0; x2 < sectionSize + 1; x2 += 1) {
        srcPos = (xSize * y2 + x2) * 4;
        r2 = scratchData.data[srcPos + 0];
        g2 = scratchData.data[srcPos + 1];
        b2 = scratchData.data[srcPos + 2];
        a = scratchData.data[srcPos + 3];
        dstPos = (xSize * y2 + sectionSize * 2 - x2 - 1) * 4;
        scratchData.data[dstPos + 0] = r2;
        scratchData.data[dstPos + 1] = g2;
        scratchData.data[dstPos + 2] = b2;
        scratchData.data[dstPos + 3] = a;
      }
      sectionSize *= 2;
    }
  }
  FromPolar$1(scratchData, imageData, { polarRotation: 0 });
};
Kaleidoscope$3.Kaleidoscope = Kaleidoscope$2;
Factory_1$H.Factory.addGetterSetter(Node_1$p.Node, "kaleidoscopePower", 2, (0, Validators_1$G.getNumberValidator)(), Factory_1$H.Factory.afterSetFilter);
Factory_1$H.Factory.addGetterSetter(Node_1$p.Node, "kaleidoscopeAngle", 0, (0, Validators_1$G.getNumberValidator)(), Factory_1$H.Factory.afterSetFilter);
var Mask$3 = {};
Object.defineProperty(Mask$3, "__esModule", { value: true });
Mask$3.Mask = void 0;
const Factory_1$G = Factory$1;
const Node_1$o = Node$3;
const Validators_1$F = Validators$1;
function pixelAt$1(idata, x2, y2) {
  var idx = (y2 * idata.width + x2) * 4;
  var d2 = [];
  d2.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);
  return d2;
}
function rgbDistance$1(p1, p2) {
  return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2) + Math.pow(p1[2] - p2[2], 2));
}
function rgbMean$1(pTab) {
  var m2 = [0, 0, 0];
  for (var i = 0; i < pTab.length; i++) {
    m2[0] += pTab[i][0];
    m2[1] += pTab[i][1];
    m2[2] += pTab[i][2];
  }
  m2[0] /= pTab.length;
  m2[1] /= pTab.length;
  m2[2] /= pTab.length;
  return m2;
}
function backgroundMask$1(idata, threshold) {
  var rgbv_no = pixelAt$1(idata, 0, 0);
  var rgbv_ne = pixelAt$1(idata, idata.width - 1, 0);
  var rgbv_so = pixelAt$1(idata, 0, idata.height - 1);
  var rgbv_se = pixelAt$1(idata, idata.width - 1, idata.height - 1);
  var thres = threshold || 10;
  if (rgbDistance$1(rgbv_no, rgbv_ne) < thres && rgbDistance$1(rgbv_ne, rgbv_se) < thres && rgbDistance$1(rgbv_se, rgbv_so) < thres && rgbDistance$1(rgbv_so, rgbv_no) < thres) {
    var mean = rgbMean$1([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);
    var mask = [];
    for (var i = 0; i < idata.width * idata.height; i++) {
      var d2 = rgbDistance$1(mean, [
        idata.data[i * 4],
        idata.data[i * 4 + 1],
        idata.data[i * 4 + 2]
      ]);
      mask[i] = d2 < thres ? 0 : 255;
    }
    return mask;
  }
}
function applyMask$1(idata, mask) {
  for (var i = 0; i < idata.width * idata.height; i++) {
    idata.data[4 * i + 3] = mask[i];
  }
}
function erodeMask$1(mask, sw, sh2) {
  var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a === 255 * 8 ? 255 : 0;
    }
  }
  return maskResult;
}
function dilateMask$1(mask, sw, sh2) {
  var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a >= 255 * 4 ? 255 : 0;
    }
  }
  return maskResult;
}
function smoothEdgeMask$1(mask, sw, sh2) {
  var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a;
    }
  }
  return maskResult;
}
const Mask$2 = function(imageData) {
  var threshold = this.threshold(), mask = backgroundMask$1(imageData, threshold);
  if (mask) {
    mask = erodeMask$1(mask, imageData.width, imageData.height);
    mask = dilateMask$1(mask, imageData.width, imageData.height);
    mask = smoothEdgeMask$1(mask, imageData.width, imageData.height);
    applyMask$1(imageData, mask);
  }
  return imageData;
};
Mask$3.Mask = Mask$2;
Factory_1$G.Factory.addGetterSetter(Node_1$o.Node, "threshold", 0, (0, Validators_1$F.getNumberValidator)(), Factory_1$G.Factory.afterSetFilter);
var Noise$3 = {};
Object.defineProperty(Noise$3, "__esModule", { value: true });
Noise$3.Noise = void 0;
const Factory_1$F = Factory$1;
const Node_1$n = Node$3;
const Validators_1$E = Validators$1;
const Noise$2 = function(imageData) {
  var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;
  for (i = 0; i < nPixels; i += 4) {
    data[i + 0] += half - 2 * half * Math.random();
    data[i + 1] += half - 2 * half * Math.random();
    data[i + 2] += half - 2 * half * Math.random();
  }
};
Noise$3.Noise = Noise$2;
Factory_1$F.Factory.addGetterSetter(Node_1$n.Node, "noise", 0.2, (0, Validators_1$E.getNumberValidator)(), Factory_1$F.Factory.afterSetFilter);
var Pixelate$3 = {};
Object.defineProperty(Pixelate$3, "__esModule", { value: true });
Pixelate$3.Pixelate = void 0;
const Factory_1$E = Factory$1;
const Util_1$g = Util$1;
const Node_1$m = Node$3;
const Validators_1$D = Validators$1;
const Pixelate$2 = function(imageData) {
  var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x2, y2, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;
  if (pixelSize <= 0) {
    Util_1$g.Util.error("pixelSize value can not be <= 0");
    return;
  }
  for (xBin = 0; xBin < nBinsX; xBin += 1) {
    for (yBin = 0; yBin < nBinsY; yBin += 1) {
      red = 0;
      green = 0;
      blue = 0;
      alpha = 0;
      xBinStart = xBin * pixelSize;
      xBinEnd = xBinStart + pixelSize;
      yBinStart = yBin * pixelSize;
      yBinEnd = yBinStart + pixelSize;
      pixelsInBin = 0;
      for (x2 = xBinStart; x2 < xBinEnd; x2 += 1) {
        if (x2 >= width) {
          continue;
        }
        for (y2 = yBinStart; y2 < yBinEnd; y2 += 1) {
          if (y2 >= height) {
            continue;
          }
          i = (width * y2 + x2) * 4;
          red += data[i + 0];
          green += data[i + 1];
          blue += data[i + 2];
          alpha += data[i + 3];
          pixelsInBin += 1;
        }
      }
      red = red / pixelsInBin;
      green = green / pixelsInBin;
      blue = blue / pixelsInBin;
      alpha = alpha / pixelsInBin;
      for (x2 = xBinStart; x2 < xBinEnd; x2 += 1) {
        if (x2 >= width) {
          continue;
        }
        for (y2 = yBinStart; y2 < yBinEnd; y2 += 1) {
          if (y2 >= height) {
            continue;
          }
          i = (width * y2 + x2) * 4;
          data[i + 0] = red;
          data[i + 1] = green;
          data[i + 2] = blue;
          data[i + 3] = alpha;
        }
      }
    }
  }
};
Pixelate$3.Pixelate = Pixelate$2;
Factory_1$E.Factory.addGetterSetter(Node_1$m.Node, "pixelSize", 8, (0, Validators_1$D.getNumberValidator)(), Factory_1$E.Factory.afterSetFilter);
var Posterize$3 = {};
Object.defineProperty(Posterize$3, "__esModule", { value: true });
Posterize$3.Posterize = void 0;
const Factory_1$D = Factory$1;
const Node_1$l = Node$3;
const Validators_1$C = Validators$1;
const Posterize$2 = function(imageData) {
  var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;
  for (i = 0; i < len; i += 1) {
    data[i] = Math.floor(data[i] / scale) * scale;
  }
};
Posterize$3.Posterize = Posterize$2;
Factory_1$D.Factory.addGetterSetter(Node_1$l.Node, "levels", 0.5, (0, Validators_1$C.getNumberValidator)(), Factory_1$D.Factory.afterSetFilter);
var RGB$3 = {};
Object.defineProperty(RGB$3, "__esModule", { value: true });
RGB$3.RGB = void 0;
const Factory_1$C = Factory$1;
const Node_1$k = Node$3;
const Validators_1$B = Validators$1;
const RGB$2 = function(imageData) {
  var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness2;
  for (i = 0; i < nPixels; i += 4) {
    brightness2 = (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
    data[i] = brightness2 * red;
    data[i + 1] = brightness2 * green;
    data[i + 2] = brightness2 * blue;
    data[i + 3] = data[i + 3];
  }
};
RGB$3.RGB = RGB$2;
Factory_1$C.Factory.addGetterSetter(Node_1$k.Node, "red", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$C.Factory.addGetterSetter(Node_1$k.Node, "green", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$C.Factory.addGetterSetter(Node_1$k.Node, "blue", 0, Validators_1$B.RGBComponent, Factory_1$C.Factory.afterSetFilter);
var RGBA$3 = {};
Object.defineProperty(RGBA$3, "__esModule", { value: true });
RGBA$3.RGBA = void 0;
const Factory_1$B = Factory$1;
const Node_1$j = Node$3;
const Validators_1$A = Validators$1;
const RGBA$2 = function(imageData) {
  var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia2;
  for (i = 0; i < nPixels; i += 4) {
    ia2 = 1 - alpha;
    data[i] = red * alpha + data[i] * ia2;
    data[i + 1] = green * alpha + data[i + 1] * ia2;
    data[i + 2] = blue * alpha + data[i + 2] * ia2;
  }
};
RGBA$3.RGBA = RGBA$2;
Factory_1$B.Factory.addGetterSetter(Node_1$j.Node, "red", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$B.Factory.addGetterSetter(Node_1$j.Node, "green", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$B.Factory.addGetterSetter(Node_1$j.Node, "blue", 0, Validators_1$A.RGBComponent, Factory_1$B.Factory.afterSetFilter);
Factory_1$B.Factory.addGetterSetter(Node_1$j.Node, "alpha", 1, function(val) {
  this._filterUpToDate = false;
  if (val > 1) {
    return 1;
  } else if (val < 0) {
    return 0;
  } else {
    return val;
  }
});
var Sepia$3 = {};
Object.defineProperty(Sepia$3, "__esModule", { value: true });
Sepia$3.Sepia = void 0;
const Sepia$2 = function(imageData) {
  var data = imageData.data, nPixels = data.length, i, r2, g2, b2;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    data[i + 0] = Math.min(255, r2 * 0.393 + g2 * 0.769 + b2 * 0.189);
    data[i + 1] = Math.min(255, r2 * 0.349 + g2 * 0.686 + b2 * 0.168);
    data[i + 2] = Math.min(255, r2 * 0.272 + g2 * 0.534 + b2 * 0.131);
  }
};
Sepia$3.Sepia = Sepia$2;
var Solarize$3 = {};
Object.defineProperty(Solarize$3, "__esModule", { value: true });
Solarize$3.Solarize = void 0;
const Solarize$2 = function(imageData) {
  var data = imageData.data, w2 = imageData.width, h2 = imageData.height, w4 = w2 * 4, y2 = h2;
  do {
    var offsetY = (y2 - 1) * w4;
    var x2 = w2;
    do {
      var offset5 = offsetY + (x2 - 1) * 4;
      var r2 = data[offset5];
      var g2 = data[offset5 + 1];
      var b2 = data[offset5 + 2];
      if (r2 > 127) {
        r2 = 255 - r2;
      }
      if (g2 > 127) {
        g2 = 255 - g2;
      }
      if (b2 > 127) {
        b2 = 255 - b2;
      }
      data[offset5] = r2;
      data[offset5 + 1] = g2;
      data[offset5 + 2] = b2;
    } while (--x2);
  } while (--y2);
};
Solarize$3.Solarize = Solarize$2;
var Threshold$3 = {};
Object.defineProperty(Threshold$3, "__esModule", { value: true });
Threshold$3.Threshold = void 0;
const Factory_1$A = Factory$1;
const Node_1$i = Node$3;
const Validators_1$z = Validators$1;
const Threshold$2 = function(imageData) {
  var level = this.threshold() * 255, data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 1) {
    data[i] = data[i] < level ? 0 : 255;
  }
};
Threshold$3.Threshold = Threshold$2;
Factory_1$A.Factory.addGetterSetter(Node_1$i.Node, "threshold", 0.5, (0, Validators_1$z.getNumberValidator)(), Factory_1$A.Factory.afterSetFilter);
Object.defineProperty(_FullInternals$1, "__esModule", { value: true });
_FullInternals$1.Konva = void 0;
const _CoreInternals_1$1 = _CoreInternals$1;
const Arc_1$1 = Arc$3;
const Arrow_1$1 = Arrow$6;
const Circle_1$1 = Circle$3;
const Ellipse_1$1 = Ellipse$5;
const Image_1$1 = Image$5;
const Label_1$1 = Label$a;
const Line_1$2 = Line$5;
const Path_1$3 = Path$3;
const Rect_1$2 = Rect$4;
const RegularPolygon_1$1 = RegularPolygon$4;
const Ring_1$1 = Ring$3;
const Sprite_1$1 = Sprite$3;
const Star_1$1 = Star$3;
const Text_1$2 = Text$7;
const TextPath_1$1 = TextPath$3;
const Transformer_1$1 = Transformer$4;
const Wedge_1$1 = Wedge$3;
const Blur_1$1 = Blur$5;
const Brighten_1$1 = Brighten$3;
const Contrast_1$1 = Contrast$5;
const Emboss_1$1 = Emboss$3;
const Enhance_1$1 = Enhance$3;
const Grayscale_1$1 = Grayscale$3;
const HSL_1$1 = HSL$3;
const HSV_1$1 = HSV$4;
const Invert_1$1 = Invert$3;
const Kaleidoscope_1$1 = Kaleidoscope$3;
const Mask_1$1 = Mask$3;
const Noise_1$1 = Noise$3;
const Pixelate_1$1 = Pixelate$3;
const Posterize_1$1 = Posterize$3;
const RGB_1$1 = RGB$3;
const RGBA_1$1 = RGBA$3;
const Sepia_1$1 = Sepia$3;
const Solarize_1$1 = Solarize$3;
const Threshold_1$1 = Threshold$3;
_FullInternals$1.Konva = _CoreInternals_1$1.Konva.Util._assign(_CoreInternals_1$1.Konva, {
  Arc: Arc_1$1.Arc,
  Arrow: Arrow_1$1.Arrow,
  Circle: Circle_1$1.Circle,
  Ellipse: Ellipse_1$1.Ellipse,
  Image: Image_1$1.Image,
  Label: Label_1$1.Label,
  Tag: Label_1$1.Tag,
  Line: Line_1$2.Line,
  Path: Path_1$3.Path,
  Rect: Rect_1$2.Rect,
  RegularPolygon: RegularPolygon_1$1.RegularPolygon,
  Ring: Ring_1$1.Ring,
  Sprite: Sprite_1$1.Sprite,
  Star: Star_1$1.Star,
  Text: Text_1$2.Text,
  TextPath: TextPath_1$1.TextPath,
  Transformer: Transformer_1$1.Transformer,
  Wedge: Wedge_1$1.Wedge,
  Filters: {
    Blur: Blur_1$1.Blur,
    Brighten: Brighten_1$1.Brighten,
    Contrast: Contrast_1$1.Contrast,
    Emboss: Emboss_1$1.Emboss,
    Enhance: Enhance_1$1.Enhance,
    Grayscale: Grayscale_1$1.Grayscale,
    HSL: HSL_1$1.HSL,
    HSV: HSV_1$1.HSV,
    Invert: Invert_1$1.Invert,
    Kaleidoscope: Kaleidoscope_1$1.Kaleidoscope,
    Mask: Mask_1$1.Mask,
    Noise: Noise_1$1.Noise,
    Pixelate: Pixelate_1$1.Pixelate,
    Posterize: Posterize_1$1.Posterize,
    RGB: RGB_1$1.RGB,
    RGBA: RGBA_1$1.RGBA,
    Sepia: Sepia_1$1.Sepia,
    Solarize: Solarize_1$1.Solarize,
    Threshold: Threshold_1$1.Threshold
  }
});
var lib$2 = lib$3.exports;
Object.defineProperty(lib$2, "__esModule", { value: true });
const _FullInternals_1$1 = _FullInternals$1;
lib$3.exports = _FullInternals_1$1.Konva;
var Core = { exports: {} };
(function(module, exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Konva = void 0;
  var _CoreInternals_12 = _CoreInternals$1;
  Object.defineProperty(exports, "Konva", { enumerable: true, get: function() {
    return _CoreInternals_12.Konva;
  } });
  const _CoreInternals_2 = _CoreInternals$1;
  module.exports = _CoreInternals_2.Konva;
})(Core, Core.exports);
var CoreExports = Core.exports;
const Konva$2 = /* @__PURE__ */ getDefaultExportFromCjs(CoreExports);
var reactReconciler = { exports: {} };
/**
 * @license React
 * react-reconciler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var reactReconciler_production_min = function $$$reconciler($$$hostConfig) {
  var exports = {};
  var aa2 = reactExports, ba = schedulerExports, ca2 = Object.assign;
  function n2(a) {
    for (var b2 = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c2 = 1; c2 < arguments.length; c2++) b2 += "&args[]=" + encodeURIComponent(arguments[c2]);
    return "Minified React error #" + a + "; visit " + b2 + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var da2 = aa2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ea2 = Symbol.for("react.element"), fa2 = Symbol.for("react.portal"), ha2 = Symbol.for("react.fragment"), ia2 = Symbol.for("react.strict_mode"), ja2 = Symbol.for("react.profiler"), ka2 = Symbol.for("react.provider"), la2 = Symbol.for("react.context"), ma2 = Symbol.for("react.forward_ref"), na = Symbol.for("react.suspense"), oa2 = Symbol.for("react.suspense_list"), pa2 = Symbol.for("react.memo"), qa2 = Symbol.for("react.lazy");
  var ra2 = Symbol.for("react.offscreen");
  var sa2 = Symbol.iterator;
  function ta2(a) {
    if (null === a || "object" !== typeof a) return null;
    a = sa2 && a[sa2] || a["@@iterator"];
    return "function" === typeof a ? a : null;
  }
  function ua2(a) {
    if (null == a) return null;
    if ("function" === typeof a) return a.displayName || a.name || null;
    if ("string" === typeof a) return a;
    switch (a) {
      case ha2:
        return "Fragment";
      case fa2:
        return "Portal";
      case ja2:
        return "Profiler";
      case ia2:
        return "StrictMode";
      case na:
        return "Suspense";
      case oa2:
        return "SuspenseList";
    }
    if ("object" === typeof a) switch (a.$$typeof) {
      case la2:
        return (a.displayName || "Context") + ".Consumer";
      case ka2:
        return (a._context.displayName || "Context") + ".Provider";
      case ma2:
        var b2 = a.render;
        a = a.displayName;
        a || (a = b2.displayName || b2.name || "", a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef");
        return a;
      case pa2:
        return b2 = a.displayName || null, null !== b2 ? b2 : ua2(a.type) || "Memo";
      case qa2:
        b2 = a._payload;
        a = a._init;
        try {
          return ua2(a(b2));
        } catch (c2) {
        }
    }
    return null;
  }
  function va2(a) {
    var b2 = a.type;
    switch (a.tag) {
      case 24:
        return "Cache";
      case 9:
        return (b2.displayName || "Context") + ".Consumer";
      case 10:
        return (b2._context.displayName || "Context") + ".Provider";
      case 18:
        return "DehydratedFragment";
      case 11:
        return a = b2.render, a = a.displayName || a.name || "", b2.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef");
      case 7:
        return "Fragment";
      case 5:
        return b2;
      case 4:
        return "Portal";
      case 3:
        return "Root";
      case 6:
        return "Text";
      case 16:
        return ua2(b2);
      case 8:
        return b2 === ia2 ? "StrictMode" : "Mode";
      case 22:
        return "Offscreen";
      case 12:
        return "Profiler";
      case 21:
        return "Scope";
      case 13:
        return "Suspense";
      case 19:
        return "SuspenseList";
      case 25:
        return "TracingMarker";
      case 1:
      case 0:
      case 17:
      case 2:
      case 14:
      case 15:
        if ("function" === typeof b2) return b2.displayName || b2.name || null;
        if ("string" === typeof b2) return b2;
    }
    return null;
  }
  function wa2(a) {
    var b2 = a, c2 = a;
    if (a.alternate) for (; b2.return; ) b2 = b2.return;
    else {
      a = b2;
      do
        b2 = a, 0 !== (b2.flags & 4098) && (c2 = b2.return), a = b2.return;
      while (a);
    }
    return 3 === b2.tag ? c2 : null;
  }
  function xa(a) {
    if (wa2(a) !== a) throw Error(n2(188));
  }
  function za2(a) {
    var b2 = a.alternate;
    if (!b2) {
      b2 = wa2(a);
      if (null === b2) throw Error(n2(188));
      return b2 !== a ? null : a;
    }
    for (var c2 = a, d2 = b2; ; ) {
      var e2 = c2.return;
      if (null === e2) break;
      var f2 = e2.alternate;
      if (null === f2) {
        d2 = e2.return;
        if (null !== d2) {
          c2 = d2;
          continue;
        }
        break;
      }
      if (e2.child === f2.child) {
        for (f2 = e2.child; f2; ) {
          if (f2 === c2) return xa(e2), a;
          if (f2 === d2) return xa(e2), b2;
          f2 = f2.sibling;
        }
        throw Error(n2(188));
      }
      if (c2.return !== d2.return) c2 = e2, d2 = f2;
      else {
        for (var g2 = false, h2 = e2.child; h2; ) {
          if (h2 === c2) {
            g2 = true;
            c2 = e2;
            d2 = f2;
            break;
          }
          if (h2 === d2) {
            g2 = true;
            d2 = e2;
            c2 = f2;
            break;
          }
          h2 = h2.sibling;
        }
        if (!g2) {
          for (h2 = f2.child; h2; ) {
            if (h2 === c2) {
              g2 = true;
              c2 = f2;
              d2 = e2;
              break;
            }
            if (h2 === d2) {
              g2 = true;
              d2 = f2;
              c2 = e2;
              break;
            }
            h2 = h2.sibling;
          }
          if (!g2) throw Error(n2(189));
        }
      }
      if (c2.alternate !== d2) throw Error(n2(190));
    }
    if (3 !== c2.tag) throw Error(n2(188));
    return c2.stateNode.current === c2 ? a : b2;
  }
  function Aa2(a) {
    a = za2(a);
    return null !== a ? Ba2(a) : null;
  }
  function Ba2(a) {
    if (5 === a.tag || 6 === a.tag) return a;
    for (a = a.child; null !== a; ) {
      var b2 = Ba2(a);
      if (null !== b2) return b2;
      a = a.sibling;
    }
    return null;
  }
  function Ca2(a) {
    if (5 === a.tag || 6 === a.tag) return a;
    for (a = a.child; null !== a; ) {
      if (4 !== a.tag) {
        var b2 = Ca2(a);
        if (null !== b2) return b2;
      }
      a = a.sibling;
    }
    return null;
  }
  var Da2 = Array.isArray, Ea2 = $$$hostConfig.getPublicInstance, Fa2 = $$$hostConfig.getRootHostContext, Ga2 = $$$hostConfig.getChildHostContext, Ha2 = $$$hostConfig.prepareForCommit, Ia2 = $$$hostConfig.resetAfterCommit, Ja2 = $$$hostConfig.createInstance, Ka2 = $$$hostConfig.appendInitialChild, La2 = $$$hostConfig.finalizeInitialChildren, Ma2 = $$$hostConfig.prepareUpdate, Na2 = $$$hostConfig.shouldSetTextContent, Oa2 = $$$hostConfig.createTextInstance, Pa2 = $$$hostConfig.scheduleTimeout, Qa2 = $$$hostConfig.cancelTimeout, Ra2 = $$$hostConfig.noTimeout, Sa2 = $$$hostConfig.isPrimaryRenderer, Ta2 = $$$hostConfig.supportsMutation, Ua2 = $$$hostConfig.supportsPersistence, Va2 = $$$hostConfig.supportsHydration, Wa2 = $$$hostConfig.getInstanceFromNode, Xa2 = $$$hostConfig.preparePortalMount, Ya2 = $$$hostConfig.getCurrentEventPriority, Za2 = $$$hostConfig.detachDeletedInstance, $a = $$$hostConfig.supportsMicrotasks, ab2 = $$$hostConfig.scheduleMicrotask, bb2 = $$$hostConfig.supportsTestSelectors, cb2 = $$$hostConfig.findFiberRoot, db2 = $$$hostConfig.getBoundingRect, eb2 = $$$hostConfig.getTextContent, fb2 = $$$hostConfig.isHiddenSubtree, gb2 = $$$hostConfig.matchAccessibilityRole, hb2 = $$$hostConfig.setFocusIfFocusable, ib2 = $$$hostConfig.setupIntersectionObserver, jb2 = $$$hostConfig.appendChild, kb2 = $$$hostConfig.appendChildToContainer, lb2 = $$$hostConfig.commitTextUpdate, mb2 = $$$hostConfig.commitMount, nb2 = $$$hostConfig.commitUpdate, ob2 = $$$hostConfig.insertBefore, pb2 = $$$hostConfig.insertInContainerBefore, qb2 = $$$hostConfig.removeChild, rb2 = $$$hostConfig.removeChildFromContainer, sb2 = $$$hostConfig.resetTextContent, tb2 = $$$hostConfig.hideInstance, ub2 = $$$hostConfig.hideTextInstance, vb2 = $$$hostConfig.unhideInstance, wb2 = $$$hostConfig.unhideTextInstance, xb2 = $$$hostConfig.clearContainer, yb2 = $$$hostConfig.cloneInstance, zb2 = $$$hostConfig.createContainerChildSet, Ab2 = $$$hostConfig.appendChildToContainerChildSet, Bb2 = $$$hostConfig.finalizeContainerChildren, Cb2 = $$$hostConfig.replaceContainerChildren, Eb2 = $$$hostConfig.cloneHiddenInstance, Fb2 = $$$hostConfig.cloneHiddenTextInstance, Gb2 = $$$hostConfig.canHydrateInstance, Hb2 = $$$hostConfig.canHydrateTextInstance, Ib2 = $$$hostConfig.canHydrateSuspenseInstance, Jb2 = $$$hostConfig.isSuspenseInstancePending, Kb2 = $$$hostConfig.isSuspenseInstanceFallback, Lb2 = $$$hostConfig.getSuspenseInstanceFallbackErrorDetails, Mb = $$$hostConfig.registerSuspenseInstanceRetry, Nb2 = $$$hostConfig.getNextHydratableSibling, Ob2 = $$$hostConfig.getFirstHydratableChild, Pb2 = $$$hostConfig.getFirstHydratableChildWithinContainer, Qb2 = $$$hostConfig.getFirstHydratableChildWithinSuspenseInstance, Rb2 = $$$hostConfig.hydrateInstance, Sb2 = $$$hostConfig.hydrateTextInstance, Tb2 = $$$hostConfig.hydrateSuspenseInstance, Ub2 = $$$hostConfig.getNextHydratableInstanceAfterSuspenseInstance, Vb2 = $$$hostConfig.commitHydratedContainer, Wb2 = $$$hostConfig.commitHydratedSuspenseInstance, Xb2 = $$$hostConfig.clearSuspenseBoundary, Yb2 = $$$hostConfig.clearSuspenseBoundaryFromContainer, Zb2 = $$$hostConfig.shouldDeleteUnhydratedTailInstances, $b2 = $$$hostConfig.didNotMatchHydratedContainerTextInstance, ac2 = $$$hostConfig.didNotMatchHydratedTextInstance, bc2;
  function cc2(a) {
    if (void 0 === bc2) try {
      throw Error();
    } catch (c2) {
      var b2 = c2.stack.trim().match(/\n( *(at )?)/);
      bc2 = b2 && b2[1] || "";
    }
    return "\n" + bc2 + a;
  }
  var dc2 = false;
  function ec2(a, b2) {
    if (!a || dc2) return "";
    dc2 = true;
    var c2 = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      if (b2) if (b2 = function() {
        throw Error();
      }, Object.defineProperty(b2.prototype, "props", { set: function() {
        throw Error();
      } }), "object" === typeof Reflect && Reflect.construct) {
        try {
          Reflect.construct(b2, []);
        } catch (l2) {
          var d2 = l2;
        }
        Reflect.construct(a, [], b2);
      } else {
        try {
          b2.call();
        } catch (l2) {
          d2 = l2;
        }
        a.call(b2.prototype);
      }
      else {
        try {
          throw Error();
        } catch (l2) {
          d2 = l2;
        }
        a();
      }
    } catch (l2) {
      if (l2 && d2 && "string" === typeof l2.stack) {
        for (var e2 = l2.stack.split("\n"), f2 = d2.stack.split("\n"), g2 = e2.length - 1, h2 = f2.length - 1; 1 <= g2 && 0 <= h2 && e2[g2] !== f2[h2]; ) h2--;
        for (; 1 <= g2 && 0 <= h2; g2--, h2--) if (e2[g2] !== f2[h2]) {
          if (1 !== g2 || 1 !== h2) {
            do
              if (g2--, h2--, 0 > h2 || e2[g2] !== f2[h2]) {
                var k2 = "\n" + e2[g2].replace(" at new ", " at ");
                a.displayName && k2.includes("<anonymous>") && (k2 = k2.replace("<anonymous>", a.displayName));
                return k2;
              }
            while (1 <= g2 && 0 <= h2);
          }
          break;
        }
      }
    } finally {
      dc2 = false, Error.prepareStackTrace = c2;
    }
    return (a = a ? a.displayName || a.name : "") ? cc2(a) : "";
  }
  var fc2 = Object.prototype.hasOwnProperty, gc2 = [], hc2 = -1;
  function ic2(a) {
    return { current: a };
  }
  function q2(a) {
    0 > hc2 || (a.current = gc2[hc2], gc2[hc2] = null, hc2--);
  }
  function v2(a, b2) {
    hc2++;
    gc2[hc2] = a.current;
    a.current = b2;
  }
  var jc2 = {}, x2 = ic2(jc2), z2 = ic2(false), kc2 = jc2;
  function mc2(a, b2) {
    var c2 = a.type.contextTypes;
    if (!c2) return jc2;
    var d2 = a.stateNode;
    if (d2 && d2.__reactInternalMemoizedUnmaskedChildContext === b2) return d2.__reactInternalMemoizedMaskedChildContext;
    var e2 = {}, f2;
    for (f2 in c2) e2[f2] = b2[f2];
    d2 && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b2, a.__reactInternalMemoizedMaskedChildContext = e2);
    return e2;
  }
  function A2(a) {
    a = a.childContextTypes;
    return null !== a && void 0 !== a;
  }
  function nc2() {
    q2(z2);
    q2(x2);
  }
  function oc2(a, b2, c2) {
    if (x2.current !== jc2) throw Error(n2(168));
    v2(x2, b2);
    v2(z2, c2);
  }
  function pc2(a, b2, c2) {
    var d2 = a.stateNode;
    b2 = b2.childContextTypes;
    if ("function" !== typeof d2.getChildContext) return c2;
    d2 = d2.getChildContext();
    for (var e2 in d2) if (!(e2 in b2)) throw Error(n2(108, va2(a) || "Unknown", e2));
    return ca2({}, c2, d2);
  }
  function qc2(a) {
    a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || jc2;
    kc2 = x2.current;
    v2(x2, a);
    v2(z2, z2.current);
    return true;
  }
  function rc2(a, b2, c2) {
    var d2 = a.stateNode;
    if (!d2) throw Error(n2(169));
    c2 ? (a = pc2(a, b2, kc2), d2.__reactInternalMemoizedMergedChildContext = a, q2(z2), q2(x2), v2(x2, a)) : q2(z2);
    v2(z2, c2);
  }
  var tc2 = Math.clz32 ? Math.clz32 : sc2, uc2 = Math.log, vc2 = Math.LN2;
  function sc2(a) {
    a >>>= 0;
    return 0 === a ? 32 : 31 - (uc2(a) / vc2 | 0) | 0;
  }
  var wc2 = 64, xc2 = 4194304;
  function yc2(a) {
    switch (a & -a) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return a & 4194240;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return a & 130023424;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 1073741824;
      default:
        return a;
    }
  }
  function zc2(a, b2) {
    var c2 = a.pendingLanes;
    if (0 === c2) return 0;
    var d2 = 0, e2 = a.suspendedLanes, f2 = a.pingedLanes, g2 = c2 & 268435455;
    if (0 !== g2) {
      var h2 = g2 & ~e2;
      0 !== h2 ? d2 = yc2(h2) : (f2 &= g2, 0 !== f2 && (d2 = yc2(f2)));
    } else g2 = c2 & ~e2, 0 !== g2 ? d2 = yc2(g2) : 0 !== f2 && (d2 = yc2(f2));
    if (0 === d2) return 0;
    if (0 !== b2 && b2 !== d2 && 0 === (b2 & e2) && (e2 = d2 & -d2, f2 = b2 & -b2, e2 >= f2 || 16 === e2 && 0 !== (f2 & 4194240))) return b2;
    0 !== (d2 & 4) && (d2 |= c2 & 16);
    b2 = a.entangledLanes;
    if (0 !== b2) for (a = a.entanglements, b2 &= d2; 0 < b2; ) c2 = 31 - tc2(b2), e2 = 1 << c2, d2 |= a[c2], b2 &= ~e2;
    return d2;
  }
  function Ac2(a, b2) {
    switch (a) {
      case 1:
      case 2:
      case 4:
        return b2 + 250;
      case 8:
      case 16:
      case 32:
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return b2 + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return -1;
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function Bc2(a, b2) {
    for (var c2 = a.suspendedLanes, d2 = a.pingedLanes, e2 = a.expirationTimes, f2 = a.pendingLanes; 0 < f2; ) {
      var g2 = 31 - tc2(f2), h2 = 1 << g2, k2 = e2[g2];
      if (-1 === k2) {
        if (0 === (h2 & c2) || 0 !== (h2 & d2)) e2[g2] = Ac2(h2, b2);
      } else k2 <= b2 && (a.expiredLanes |= h2);
      f2 &= ~h2;
    }
  }
  function Cc2(a) {
    a = a.pendingLanes & -1073741825;
    return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0;
  }
  function Dc2() {
    var a = wc2;
    wc2 <<= 1;
    0 === (wc2 & 4194240) && (wc2 = 64);
    return a;
  }
  function Ec2(a) {
    for (var b2 = [], c2 = 0; 31 > c2; c2++) b2.push(a);
    return b2;
  }
  function Fc2(a, b2, c2) {
    a.pendingLanes |= b2;
    536870912 !== b2 && (a.suspendedLanes = 0, a.pingedLanes = 0);
    a = a.eventTimes;
    b2 = 31 - tc2(b2);
    a[b2] = c2;
  }
  function Gc2(a, b2) {
    var c2 = a.pendingLanes & ~b2;
    a.pendingLanes = b2;
    a.suspendedLanes = 0;
    a.pingedLanes = 0;
    a.expiredLanes &= b2;
    a.mutableReadLanes &= b2;
    a.entangledLanes &= b2;
    b2 = a.entanglements;
    var d2 = a.eventTimes;
    for (a = a.expirationTimes; 0 < c2; ) {
      var e2 = 31 - tc2(c2), f2 = 1 << e2;
      b2[e2] = 0;
      d2[e2] = -1;
      a[e2] = -1;
      c2 &= ~f2;
    }
  }
  function Hc2(a, b2) {
    var c2 = a.entangledLanes |= b2;
    for (a = a.entanglements; c2; ) {
      var d2 = 31 - tc2(c2), e2 = 1 << d2;
      e2 & b2 | a[d2] & b2 && (a[d2] |= b2);
      c2 &= ~e2;
    }
  }
  var C2 = 0;
  function Ic2(a) {
    a &= -a;
    return 1 < a ? 4 < a ? 0 !== (a & 268435455) ? 16 : 536870912 : 4 : 1;
  }
  var Jc2 = ba.unstable_scheduleCallback, Kc2 = ba.unstable_cancelCallback, Lc2 = ba.unstable_shouldYield, Mc2 = ba.unstable_requestPaint, D2 = ba.unstable_now, Nc2 = ba.unstable_ImmediatePriority, Oc2 = ba.unstable_UserBlockingPriority, Pc2 = ba.unstable_NormalPriority, Qc2 = ba.unstable_IdlePriority, Rc2 = null, Sc2 = null;
  function Tc2(a) {
    if (Sc2 && "function" === typeof Sc2.onCommitFiberRoot) try {
      Sc2.onCommitFiberRoot(Rc2, a, void 0, 128 === (a.current.flags & 128));
    } catch (b2) {
    }
  }
  function Uc2(a, b2) {
    return a === b2 && (0 !== a || 1 / a === 1 / b2) || a !== a && b2 !== b2;
  }
  var Vc2 = "function" === typeof Object.is ? Object.is : Uc2, Wc2 = null, Xc2 = false, Yc2 = false;
  function Zc2(a) {
    null === Wc2 ? Wc2 = [a] : Wc2.push(a);
  }
  function $c2(a) {
    Xc2 = true;
    Zc2(a);
  }
  function ad2() {
    if (!Yc2 && null !== Wc2) {
      Yc2 = true;
      var a = 0, b2 = C2;
      try {
        var c2 = Wc2;
        for (C2 = 1; a < c2.length; a++) {
          var d2 = c2[a];
          do
            d2 = d2(true);
          while (null !== d2);
        }
        Wc2 = null;
        Xc2 = false;
      } catch (e2) {
        throw null !== Wc2 && (Wc2 = Wc2.slice(a + 1)), Jc2(Nc2, ad2), e2;
      } finally {
        C2 = b2, Yc2 = false;
      }
    }
    return null;
  }
  var bd2 = [], cd2 = 0, dd2 = null, ed2 = 0, fd2 = [], gd2 = 0, hd2 = null, id2 = 1, jd2 = "";
  function kd2(a, b2) {
    bd2[cd2++] = ed2;
    bd2[cd2++] = dd2;
    dd2 = a;
    ed2 = b2;
  }
  function ld2(a, b2, c2) {
    fd2[gd2++] = id2;
    fd2[gd2++] = jd2;
    fd2[gd2++] = hd2;
    hd2 = a;
    var d2 = id2;
    a = jd2;
    var e2 = 32 - tc2(d2) - 1;
    d2 &= ~(1 << e2);
    c2 += 1;
    var f2 = 32 - tc2(b2) + e2;
    if (30 < f2) {
      var g2 = e2 - e2 % 5;
      f2 = (d2 & (1 << g2) - 1).toString(32);
      d2 >>= g2;
      e2 -= g2;
      id2 = 1 << 32 - tc2(b2) + e2 | c2 << e2 | d2;
      jd2 = f2 + a;
    } else id2 = 1 << f2 | c2 << e2 | d2, jd2 = a;
  }
  function md2(a) {
    null !== a.return && (kd2(a, 1), ld2(a, 1, 0));
  }
  function nd2(a) {
    for (; a === dd2; ) dd2 = bd2[--cd2], bd2[cd2] = null, ed2 = bd2[--cd2], bd2[cd2] = null;
    for (; a === hd2; ) hd2 = fd2[--gd2], fd2[gd2] = null, jd2 = fd2[--gd2], fd2[gd2] = null, id2 = fd2[--gd2], fd2[gd2] = null;
  }
  var od2 = null, pd2 = null, F2 = false, qd2 = false, rd2 = null;
  function sd2(a, b2) {
    var c2 = td2(5, null, null, 0);
    c2.elementType = "DELETED";
    c2.stateNode = b2;
    c2.return = a;
    b2 = a.deletions;
    null === b2 ? (a.deletions = [c2], a.flags |= 16) : b2.push(c2);
  }
  function ud2(a, b2) {
    switch (a.tag) {
      case 5:
        return b2 = Gb2(b2, a.type, a.pendingProps), null !== b2 ? (a.stateNode = b2, od2 = a, pd2 = Ob2(b2), true) : false;
      case 6:
        return b2 = Hb2(b2, a.pendingProps), null !== b2 ? (a.stateNode = b2, od2 = a, pd2 = null, true) : false;
      case 13:
        b2 = Ib2(b2);
        if (null !== b2) {
          var c2 = null !== hd2 ? { id: id2, overflow: jd2 } : null;
          a.memoizedState = { dehydrated: b2, treeContext: c2, retryLane: 1073741824 };
          c2 = td2(18, null, null, 0);
          c2.stateNode = b2;
          c2.return = a;
          a.child = c2;
          od2 = a;
          pd2 = null;
          return true;
        }
        return false;
      default:
        return false;
    }
  }
  function vd2(a) {
    return 0 !== (a.mode & 1) && 0 === (a.flags & 128);
  }
  function wd2(a) {
    if (F2) {
      var b2 = pd2;
      if (b2) {
        var c2 = b2;
        if (!ud2(a, b2)) {
          if (vd2(a)) throw Error(n2(418));
          b2 = Nb2(c2);
          var d2 = od2;
          b2 && ud2(a, b2) ? sd2(d2, c2) : (a.flags = a.flags & -4097 | 2, F2 = false, od2 = a);
        }
      } else {
        if (vd2(a)) throw Error(n2(418));
        a.flags = a.flags & -4097 | 2;
        F2 = false;
        od2 = a;
      }
    }
  }
  function xd2(a) {
    for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return;
    od2 = a;
  }
  function yd2(a) {
    if (!Va2 || a !== od2) return false;
    if (!F2) return xd2(a), F2 = true, false;
    if (3 !== a.tag && (5 !== a.tag || Zb2(a.type) && !Na2(a.type, a.memoizedProps))) {
      var b2 = pd2;
      if (b2) {
        if (vd2(a)) throw zd2(), Error(n2(418));
        for (; b2; ) sd2(a, b2), b2 = Nb2(b2);
      }
    }
    xd2(a);
    if (13 === a.tag) {
      if (!Va2) throw Error(n2(316));
      a = a.memoizedState;
      a = null !== a ? a.dehydrated : null;
      if (!a) throw Error(n2(317));
      pd2 = Ub2(a);
    } else pd2 = od2 ? Nb2(a.stateNode) : null;
    return true;
  }
  function zd2() {
    for (var a = pd2; a; ) a = Nb2(a);
  }
  function Ad2() {
    Va2 && (pd2 = od2 = null, qd2 = F2 = false);
  }
  function Bd2(a) {
    null === rd2 ? rd2 = [a] : rd2.push(a);
  }
  var Cd2 = da2.ReactCurrentBatchConfig;
  function Dd2(a, b2) {
    if (Vc2(a, b2)) return true;
    if ("object" !== typeof a || null === a || "object" !== typeof b2 || null === b2) return false;
    var c2 = Object.keys(a), d2 = Object.keys(b2);
    if (c2.length !== d2.length) return false;
    for (d2 = 0; d2 < c2.length; d2++) {
      var e2 = c2[d2];
      if (!fc2.call(b2, e2) || !Vc2(a[e2], b2[e2])) return false;
    }
    return true;
  }
  function Ed2(a) {
    switch (a.tag) {
      case 5:
        return cc2(a.type);
      case 16:
        return cc2("Lazy");
      case 13:
        return cc2("Suspense");
      case 19:
        return cc2("SuspenseList");
      case 0:
      case 2:
      case 15:
        return a = ec2(a.type, false), a;
      case 11:
        return a = ec2(a.type.render, false), a;
      case 1:
        return a = ec2(a.type, true), a;
      default:
        return "";
    }
  }
  function Fd2(a, b2, c2) {
    a = c2.ref;
    if (null !== a && "function" !== typeof a && "object" !== typeof a) {
      if (c2._owner) {
        c2 = c2._owner;
        if (c2) {
          if (1 !== c2.tag) throw Error(n2(309));
          var d2 = c2.stateNode;
        }
        if (!d2) throw Error(n2(147, a));
        var e2 = d2, f2 = "" + a;
        if (null !== b2 && null !== b2.ref && "function" === typeof b2.ref && b2.ref._stringRef === f2) return b2.ref;
        b2 = function(a2) {
          var b3 = e2.refs;
          null === a2 ? delete b3[f2] : b3[f2] = a2;
        };
        b2._stringRef = f2;
        return b2;
      }
      if ("string" !== typeof a) throw Error(n2(284));
      if (!c2._owner) throw Error(n2(290, a));
    }
    return a;
  }
  function Gd2(a, b2) {
    a = Object.prototype.toString.call(b2);
    throw Error(n2(31, "[object Object]" === a ? "object with keys {" + Object.keys(b2).join(", ") + "}" : a));
  }
  function Hd2(a) {
    var b2 = a._init;
    return b2(a._payload);
  }
  function Id2(a) {
    function b2(b3, c3) {
      if (a) {
        var d3 = b3.deletions;
        null === d3 ? (b3.deletions = [c3], b3.flags |= 16) : d3.push(c3);
      }
    }
    function c2(c3, d3) {
      if (!a) return null;
      for (; null !== d3; ) b2(c3, d3), d3 = d3.sibling;
      return null;
    }
    function d2(a2, b3) {
      for (a2 = /* @__PURE__ */ new Map(); null !== b3; ) null !== b3.key ? a2.set(b3.key, b3) : a2.set(b3.index, b3), b3 = b3.sibling;
      return a2;
    }
    function e2(a2, b3) {
      a2 = Jd2(a2, b3);
      a2.index = 0;
      a2.sibling = null;
      return a2;
    }
    function f2(b3, c3, d3) {
      b3.index = d3;
      if (!a) return b3.flags |= 1048576, c3;
      d3 = b3.alternate;
      if (null !== d3) return d3 = d3.index, d3 < c3 ? (b3.flags |= 2, c3) : d3;
      b3.flags |= 2;
      return c3;
    }
    function g2(b3) {
      a && null === b3.alternate && (b3.flags |= 2);
      return b3;
    }
    function h2(a2, b3, c3, d3) {
      if (null === b3 || 6 !== b3.tag) return b3 = Kd2(c3, a2.mode, d3), b3.return = a2, b3;
      b3 = e2(b3, c3);
      b3.return = a2;
      return b3;
    }
    function k2(a2, b3, c3, d3) {
      var f3 = c3.type;
      if (f3 === ha2) return m2(a2, b3, c3.props.children, d3, c3.key);
      if (null !== b3 && (b3.elementType === f3 || "object" === typeof f3 && null !== f3 && f3.$$typeof === qa2 && Hd2(f3) === b3.type)) return d3 = e2(b3, c3.props), d3.ref = Fd2(a2, b3, c3), d3.return = a2, d3;
      d3 = Ld2(c3.type, c3.key, c3.props, null, a2.mode, d3);
      d3.ref = Fd2(a2, b3, c3);
      d3.return = a2;
      return d3;
    }
    function l2(a2, b3, c3, d3) {
      if (null === b3 || 4 !== b3.tag || b3.stateNode.containerInfo !== c3.containerInfo || b3.stateNode.implementation !== c3.implementation) return b3 = Md2(c3, a2.mode, d3), b3.return = a2, b3;
      b3 = e2(b3, c3.children || []);
      b3.return = a2;
      return b3;
    }
    function m2(a2, b3, c3, d3, f3) {
      if (null === b3 || 7 !== b3.tag) return b3 = Nd2(c3, a2.mode, d3, f3), b3.return = a2, b3;
      b3 = e2(b3, c3);
      b3.return = a2;
      return b3;
    }
    function r2(a2, b3, c3) {
      if ("string" === typeof b3 && "" !== b3 || "number" === typeof b3) return b3 = Kd2("" + b3, a2.mode, c3), b3.return = a2, b3;
      if ("object" === typeof b3 && null !== b3) {
        switch (b3.$$typeof) {
          case ea2:
            return c3 = Ld2(b3.type, b3.key, b3.props, null, a2.mode, c3), c3.ref = Fd2(a2, null, b3), c3.return = a2, c3;
          case fa2:
            return b3 = Md2(b3, a2.mode, c3), b3.return = a2, b3;
          case qa2:
            var d3 = b3._init;
            return r2(a2, d3(b3._payload), c3);
        }
        if (Da2(b3) || ta2(b3)) return b3 = Nd2(b3, a2.mode, c3, null), b3.return = a2, b3;
        Gd2(a2, b3);
      }
      return null;
    }
    function p2(a2, b3, c3, d3) {
      var e3 = null !== b3 ? b3.key : null;
      if ("string" === typeof c3 && "" !== c3 || "number" === typeof c3) return null !== e3 ? null : h2(a2, b3, "" + c3, d3);
      if ("object" === typeof c3 && null !== c3) {
        switch (c3.$$typeof) {
          case ea2:
            return c3.key === e3 ? k2(a2, b3, c3, d3) : null;
          case fa2:
            return c3.key === e3 ? l2(a2, b3, c3, d3) : null;
          case qa2:
            return e3 = c3._init, p2(
              a2,
              b3,
              e3(c3._payload),
              d3
            );
        }
        if (Da2(c3) || ta2(c3)) return null !== e3 ? null : m2(a2, b3, c3, d3, null);
        Gd2(a2, c3);
      }
      return null;
    }
    function B2(a2, b3, c3, d3, e3) {
      if ("string" === typeof d3 && "" !== d3 || "number" === typeof d3) return a2 = a2.get(c3) || null, h2(b3, a2, "" + d3, e3);
      if ("object" === typeof d3 && null !== d3) {
        switch (d3.$$typeof) {
          case ea2:
            return a2 = a2.get(null === d3.key ? c3 : d3.key) || null, k2(b3, a2, d3, e3);
          case fa2:
            return a2 = a2.get(null === d3.key ? c3 : d3.key) || null, l2(b3, a2, d3, e3);
          case qa2:
            var f3 = d3._init;
            return B2(a2, b3, c3, f3(d3._payload), e3);
        }
        if (Da2(d3) || ta2(d3)) return a2 = a2.get(c3) || null, m2(b3, a2, d3, e3, null);
        Gd2(b3, d3);
      }
      return null;
    }
    function w2(e3, g3, h3, k3) {
      for (var l3 = null, m3 = null, u2 = g3, t2 = g3 = 0, E2 = null; null !== u2 && t2 < h3.length; t2++) {
        u2.index > t2 ? (E2 = u2, u2 = null) : E2 = u2.sibling;
        var y2 = p2(e3, u2, h3[t2], k3);
        if (null === y2) {
          null === u2 && (u2 = E2);
          break;
        }
        a && u2 && null === y2.alternate && b2(e3, u2);
        g3 = f2(y2, g3, t2);
        null === m3 ? l3 = y2 : m3.sibling = y2;
        m3 = y2;
        u2 = E2;
      }
      if (t2 === h3.length) return c2(e3, u2), F2 && kd2(e3, t2), l3;
      if (null === u2) {
        for (; t2 < h3.length; t2++) u2 = r2(e3, h3[t2], k3), null !== u2 && (g3 = f2(u2, g3, t2), null === m3 ? l3 = u2 : m3.sibling = u2, m3 = u2);
        F2 && kd2(e3, t2);
        return l3;
      }
      for (u2 = d2(e3, u2); t2 < h3.length; t2++) E2 = B2(u2, e3, t2, h3[t2], k3), null !== E2 && (a && null !== E2.alternate && u2.delete(null === E2.key ? t2 : E2.key), g3 = f2(E2, g3, t2), null === m3 ? l3 = E2 : m3.sibling = E2, m3 = E2);
      a && u2.forEach(function(a2) {
        return b2(e3, a2);
      });
      F2 && kd2(e3, t2);
      return l3;
    }
    function Y2(e3, g3, h3, k3) {
      var l3 = ta2(h3);
      if ("function" !== typeof l3) throw Error(n2(150));
      h3 = l3.call(h3);
      if (null == h3) throw Error(n2(151));
      for (var u2 = l3 = null, m3 = g3, t2 = g3 = 0, E2 = null, y2 = h3.next(); null !== m3 && !y2.done; t2++, y2 = h3.next()) {
        m3.index > t2 ? (E2 = m3, m3 = null) : E2 = m3.sibling;
        var w3 = p2(e3, m3, y2.value, k3);
        if (null === w3) {
          null === m3 && (m3 = E2);
          break;
        }
        a && m3 && null === w3.alternate && b2(e3, m3);
        g3 = f2(w3, g3, t2);
        null === u2 ? l3 = w3 : u2.sibling = w3;
        u2 = w3;
        m3 = E2;
      }
      if (y2.done) return c2(
        e3,
        m3
      ), F2 && kd2(e3, t2), l3;
      if (null === m3) {
        for (; !y2.done; t2++, y2 = h3.next()) y2 = r2(e3, y2.value, k3), null !== y2 && (g3 = f2(y2, g3, t2), null === u2 ? l3 = y2 : u2.sibling = y2, u2 = y2);
        F2 && kd2(e3, t2);
        return l3;
      }
      for (m3 = d2(e3, m3); !y2.done; t2++, y2 = h3.next()) y2 = B2(m3, e3, t2, y2.value, k3), null !== y2 && (a && null !== y2.alternate && m3.delete(null === y2.key ? t2 : y2.key), g3 = f2(y2, g3, t2), null === u2 ? l3 = y2 : u2.sibling = y2, u2 = y2);
      a && m3.forEach(function(a2) {
        return b2(e3, a2);
      });
      F2 && kd2(e3, t2);
      return l3;
    }
    function ya2(a2, d3, f3, h3) {
      "object" === typeof f3 && null !== f3 && f3.type === ha2 && null === f3.key && (f3 = f3.props.children);
      if ("object" === typeof f3 && null !== f3) {
        switch (f3.$$typeof) {
          case ea2:
            a: {
              for (var k3 = f3.key, l3 = d3; null !== l3; ) {
                if (l3.key === k3) {
                  k3 = f3.type;
                  if (k3 === ha2) {
                    if (7 === l3.tag) {
                      c2(a2, l3.sibling);
                      d3 = e2(l3, f3.props.children);
                      d3.return = a2;
                      a2 = d3;
                      break a;
                    }
                  } else if (l3.elementType === k3 || "object" === typeof k3 && null !== k3 && k3.$$typeof === qa2 && Hd2(k3) === l3.type) {
                    c2(a2, l3.sibling);
                    d3 = e2(l3, f3.props);
                    d3.ref = Fd2(a2, l3, f3);
                    d3.return = a2;
                    a2 = d3;
                    break a;
                  }
                  c2(a2, l3);
                  break;
                } else b2(a2, l3);
                l3 = l3.sibling;
              }
              f3.type === ha2 ? (d3 = Nd2(f3.props.children, a2.mode, h3, f3.key), d3.return = a2, a2 = d3) : (h3 = Ld2(f3.type, f3.key, f3.props, null, a2.mode, h3), h3.ref = Fd2(a2, d3, f3), h3.return = a2, a2 = h3);
            }
            return g2(a2);
          case fa2:
            a: {
              for (l3 = f3.key; null !== d3; ) {
                if (d3.key === l3) if (4 === d3.tag && d3.stateNode.containerInfo === f3.containerInfo && d3.stateNode.implementation === f3.implementation) {
                  c2(a2, d3.sibling);
                  d3 = e2(d3, f3.children || []);
                  d3.return = a2;
                  a2 = d3;
                  break a;
                } else {
                  c2(a2, d3);
                  break;
                }
                else b2(a2, d3);
                d3 = d3.sibling;
              }
              d3 = Md2(f3, a2.mode, h3);
              d3.return = a2;
              a2 = d3;
            }
            return g2(a2);
          case qa2:
            return l3 = f3._init, ya2(a2, d3, l3(f3._payload), h3);
        }
        if (Da2(f3)) return w2(a2, d3, f3, h3);
        if (ta2(f3)) return Y2(a2, d3, f3, h3);
        Gd2(a2, f3);
      }
      return "string" === typeof f3 && "" !== f3 || "number" === typeof f3 ? (f3 = "" + f3, null !== d3 && 6 === d3.tag ? (c2(a2, d3.sibling), d3 = e2(d3, f3), d3.return = a2, a2 = d3) : (c2(a2, d3), d3 = Kd2(f3, a2.mode, h3), d3.return = a2, a2 = d3), g2(a2)) : c2(a2, d3);
    }
    return ya2;
  }
  var Od2 = Id2(true), Pd2 = Id2(false), Qd2 = ic2(null), Rd2 = null, Sd2 = null, Td2 = null;
  function Ud2() {
    Td2 = Sd2 = Rd2 = null;
  }
  function Vd2(a, b2, c2) {
    Sa2 ? (v2(Qd2, b2._currentValue), b2._currentValue = c2) : (v2(Qd2, b2._currentValue2), b2._currentValue2 = c2);
  }
  function Wd2(a) {
    var b2 = Qd2.current;
    q2(Qd2);
    Sa2 ? a._currentValue = b2 : a._currentValue2 = b2;
  }
  function Xd2(a, b2, c2) {
    for (; null !== a; ) {
      var d2 = a.alternate;
      (a.childLanes & b2) !== b2 ? (a.childLanes |= b2, null !== d2 && (d2.childLanes |= b2)) : null !== d2 && (d2.childLanes & b2) !== b2 && (d2.childLanes |= b2);
      if (a === c2) break;
      a = a.return;
    }
  }
  function Yd2(a, b2) {
    Rd2 = a;
    Td2 = Sd2 = null;
    a = a.dependencies;
    null !== a && null !== a.firstContext && (0 !== (a.lanes & b2) && (G2 = true), a.firstContext = null);
  }
  function Zd2(a) {
    var b2 = Sa2 ? a._currentValue : a._currentValue2;
    if (Td2 !== a) if (a = { context: a, memoizedValue: b2, next: null }, null === Sd2) {
      if (null === Rd2) throw Error(n2(308));
      Sd2 = a;
      Rd2.dependencies = { lanes: 0, firstContext: a };
    } else Sd2 = Sd2.next = a;
    return b2;
  }
  var $d2 = null;
  function ae2(a) {
    null === $d2 ? $d2 = [a] : $d2.push(a);
  }
  function be2(a, b2, c2, d2) {
    var e2 = b2.interleaved;
    null === e2 ? (c2.next = c2, ae2(b2)) : (c2.next = e2.next, e2.next = c2);
    b2.interleaved = c2;
    return ce2(a, d2);
  }
  function ce2(a, b2) {
    a.lanes |= b2;
    var c2 = a.alternate;
    null !== c2 && (c2.lanes |= b2);
    c2 = a;
    for (a = a.return; null !== a; ) a.childLanes |= b2, c2 = a.alternate, null !== c2 && (c2.childLanes |= b2), c2 = a, a = a.return;
    return 3 === c2.tag ? c2.stateNode : null;
  }
  var de2 = false;
  function ee2(a) {
    a.updateQueue = { baseState: a.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
  }
  function fe2(a, b2) {
    a = a.updateQueue;
    b2.updateQueue === a && (b2.updateQueue = { baseState: a.baseState, firstBaseUpdate: a.firstBaseUpdate, lastBaseUpdate: a.lastBaseUpdate, shared: a.shared, effects: a.effects });
  }
  function ge2(a, b2) {
    return { eventTime: a, lane: b2, tag: 0, payload: null, callback: null, next: null };
  }
  function he2(a, b2, c2) {
    var d2 = a.updateQueue;
    if (null === d2) return null;
    d2 = d2.shared;
    if (0 !== (H2 & 2)) {
      var e2 = d2.pending;
      null === e2 ? b2.next = b2 : (b2.next = e2.next, e2.next = b2);
      d2.pending = b2;
      return ce2(a, c2);
    }
    e2 = d2.interleaved;
    null === e2 ? (b2.next = b2, ae2(d2)) : (b2.next = e2.next, e2.next = b2);
    d2.interleaved = b2;
    return ce2(a, c2);
  }
  function ie2(a, b2, c2) {
    b2 = b2.updateQueue;
    if (null !== b2 && (b2 = b2.shared, 0 !== (c2 & 4194240))) {
      var d2 = b2.lanes;
      d2 &= a.pendingLanes;
      c2 |= d2;
      b2.lanes = c2;
      Hc2(a, c2);
    }
  }
  function je2(a, b2) {
    var c2 = a.updateQueue, d2 = a.alternate;
    if (null !== d2 && (d2 = d2.updateQueue, c2 === d2)) {
      var e2 = null, f2 = null;
      c2 = c2.firstBaseUpdate;
      if (null !== c2) {
        do {
          var g2 = { eventTime: c2.eventTime, lane: c2.lane, tag: c2.tag, payload: c2.payload, callback: c2.callback, next: null };
          null === f2 ? e2 = f2 = g2 : f2 = f2.next = g2;
          c2 = c2.next;
        } while (null !== c2);
        null === f2 ? e2 = f2 = b2 : f2 = f2.next = b2;
      } else e2 = f2 = b2;
      c2 = { baseState: d2.baseState, firstBaseUpdate: e2, lastBaseUpdate: f2, shared: d2.shared, effects: d2.effects };
      a.updateQueue = c2;
      return;
    }
    a = c2.lastBaseUpdate;
    null === a ? c2.firstBaseUpdate = b2 : a.next = b2;
    c2.lastBaseUpdate = b2;
  }
  function ke2(a, b2, c2, d2) {
    var e2 = a.updateQueue;
    de2 = false;
    var f2 = e2.firstBaseUpdate, g2 = e2.lastBaseUpdate, h2 = e2.shared.pending;
    if (null !== h2) {
      e2.shared.pending = null;
      var k2 = h2, l2 = k2.next;
      k2.next = null;
      null === g2 ? f2 = l2 : g2.next = l2;
      g2 = k2;
      var m2 = a.alternate;
      null !== m2 && (m2 = m2.updateQueue, h2 = m2.lastBaseUpdate, h2 !== g2 && (null === h2 ? m2.firstBaseUpdate = l2 : h2.next = l2, m2.lastBaseUpdate = k2));
    }
    if (null !== f2) {
      var r2 = e2.baseState;
      g2 = 0;
      m2 = l2 = k2 = null;
      h2 = f2;
      do {
        var p2 = h2.lane, B2 = h2.eventTime;
        if ((d2 & p2) === p2) {
          null !== m2 && (m2 = m2.next = {
            eventTime: B2,
            lane: 0,
            tag: h2.tag,
            payload: h2.payload,
            callback: h2.callback,
            next: null
          });
          a: {
            var w2 = a, Y2 = h2;
            p2 = b2;
            B2 = c2;
            switch (Y2.tag) {
              case 1:
                w2 = Y2.payload;
                if ("function" === typeof w2) {
                  r2 = w2.call(B2, r2, p2);
                  break a;
                }
                r2 = w2;
                break a;
              case 3:
                w2.flags = w2.flags & -65537 | 128;
              case 0:
                w2 = Y2.payload;
                p2 = "function" === typeof w2 ? w2.call(B2, r2, p2) : w2;
                if (null === p2 || void 0 === p2) break a;
                r2 = ca2({}, r2, p2);
                break a;
              case 2:
                de2 = true;
            }
          }
          null !== h2.callback && 0 !== h2.lane && (a.flags |= 64, p2 = e2.effects, null === p2 ? e2.effects = [h2] : p2.push(h2));
        } else B2 = { eventTime: B2, lane: p2, tag: h2.tag, payload: h2.payload, callback: h2.callback, next: null }, null === m2 ? (l2 = m2 = B2, k2 = r2) : m2 = m2.next = B2, g2 |= p2;
        h2 = h2.next;
        if (null === h2) if (h2 = e2.shared.pending, null === h2) break;
        else p2 = h2, h2 = p2.next, p2.next = null, e2.lastBaseUpdate = p2, e2.shared.pending = null;
      } while (1);
      null === m2 && (k2 = r2);
      e2.baseState = k2;
      e2.firstBaseUpdate = l2;
      e2.lastBaseUpdate = m2;
      b2 = e2.shared.interleaved;
      if (null !== b2) {
        e2 = b2;
        do
          g2 |= e2.lane, e2 = e2.next;
        while (e2 !== b2);
      } else null === f2 && (e2.shared.lanes = 0);
      le2 |= g2;
      a.lanes = g2;
      a.memoizedState = r2;
    }
  }
  function me2(a, b2, c2) {
    a = b2.effects;
    b2.effects = null;
    if (null !== a) for (b2 = 0; b2 < a.length; b2++) {
      var d2 = a[b2], e2 = d2.callback;
      if (null !== e2) {
        d2.callback = null;
        d2 = c2;
        if ("function" !== typeof e2) throw Error(n2(191, e2));
        e2.call(d2);
      }
    }
  }
  var ne2 = {}, oe2 = ic2(ne2), pe2 = ic2(ne2), qe2 = ic2(ne2);
  function re2(a) {
    if (a === ne2) throw Error(n2(174));
    return a;
  }
  function se2(a, b2) {
    v2(qe2, b2);
    v2(pe2, a);
    v2(oe2, ne2);
    a = Fa2(b2);
    q2(oe2);
    v2(oe2, a);
  }
  function te2() {
    q2(oe2);
    q2(pe2);
    q2(qe2);
  }
  function ue2(a) {
    var b2 = re2(qe2.current), c2 = re2(oe2.current);
    b2 = Ga2(c2, a.type, b2);
    c2 !== b2 && (v2(pe2, a), v2(oe2, b2));
  }
  function ve2(a) {
    pe2.current === a && (q2(oe2), q2(pe2));
  }
  var I2 = ic2(0);
  function we2(a) {
    for (var b2 = a; null !== b2; ) {
      if (13 === b2.tag) {
        var c2 = b2.memoizedState;
        if (null !== c2 && (c2 = c2.dehydrated, null === c2 || Jb2(c2) || Kb2(c2))) return b2;
      } else if (19 === b2.tag && void 0 !== b2.memoizedProps.revealOrder) {
        if (0 !== (b2.flags & 128)) return b2;
      } else if (null !== b2.child) {
        b2.child.return = b2;
        b2 = b2.child;
        continue;
      }
      if (b2 === a) break;
      for (; null === b2.sibling; ) {
        if (null === b2.return || b2.return === a) return null;
        b2 = b2.return;
      }
      b2.sibling.return = b2.return;
      b2 = b2.sibling;
    }
    return null;
  }
  var xe2 = [];
  function ye2() {
    for (var a = 0; a < xe2.length; a++) {
      var b2 = xe2[a];
      Sa2 ? b2._workInProgressVersionPrimary = null : b2._workInProgressVersionSecondary = null;
    }
    xe2.length = 0;
  }
  var ze2 = da2.ReactCurrentDispatcher, Ae2 = da2.ReactCurrentBatchConfig, Be2 = 0, J2 = null, K2 = null, L2 = null, Ce2 = false, De2 = false, Ee2 = 0, Fe2 = 0;
  function M2() {
    throw Error(n2(321));
  }
  function Ge2(a, b2) {
    if (null === b2) return false;
    for (var c2 = 0; c2 < b2.length && c2 < a.length; c2++) if (!Vc2(a[c2], b2[c2])) return false;
    return true;
  }
  function He2(a, b2, c2, d2, e2, f2) {
    Be2 = f2;
    J2 = b2;
    b2.memoizedState = null;
    b2.updateQueue = null;
    b2.lanes = 0;
    ze2.current = null === a || null === a.memoizedState ? Ie2 : Je2;
    a = c2(d2, e2);
    if (De2) {
      f2 = 0;
      do {
        De2 = false;
        Ee2 = 0;
        if (25 <= f2) throw Error(n2(301));
        f2 += 1;
        L2 = K2 = null;
        b2.updateQueue = null;
        ze2.current = Ke2;
        a = c2(d2, e2);
      } while (De2);
    }
    ze2.current = Le2;
    b2 = null !== K2 && null !== K2.next;
    Be2 = 0;
    L2 = K2 = J2 = null;
    Ce2 = false;
    if (b2) throw Error(n2(300));
    return a;
  }
  function Me2() {
    var a = 0 !== Ee2;
    Ee2 = 0;
    return a;
  }
  function Ne2() {
    var a = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
    null === L2 ? J2.memoizedState = L2 = a : L2 = L2.next = a;
    return L2;
  }
  function Oe2() {
    if (null === K2) {
      var a = J2.alternate;
      a = null !== a ? a.memoizedState : null;
    } else a = K2.next;
    var b2 = null === L2 ? J2.memoizedState : L2.next;
    if (null !== b2) L2 = b2, K2 = a;
    else {
      if (null === a) throw Error(n2(310));
      K2 = a;
      a = { memoizedState: K2.memoizedState, baseState: K2.baseState, baseQueue: K2.baseQueue, queue: K2.queue, next: null };
      null === L2 ? J2.memoizedState = L2 = a : L2 = L2.next = a;
    }
    return L2;
  }
  function Pe2(a, b2) {
    return "function" === typeof b2 ? b2(a) : b2;
  }
  function Qe2(a) {
    var b2 = Oe2(), c2 = b2.queue;
    if (null === c2) throw Error(n2(311));
    c2.lastRenderedReducer = a;
    var d2 = K2, e2 = d2.baseQueue, f2 = c2.pending;
    if (null !== f2) {
      if (null !== e2) {
        var g2 = e2.next;
        e2.next = f2.next;
        f2.next = g2;
      }
      d2.baseQueue = e2 = f2;
      c2.pending = null;
    }
    if (null !== e2) {
      f2 = e2.next;
      d2 = d2.baseState;
      var h2 = g2 = null, k2 = null, l2 = f2;
      do {
        var m2 = l2.lane;
        if ((Be2 & m2) === m2) null !== k2 && (k2 = k2.next = { lane: 0, action: l2.action, hasEagerState: l2.hasEagerState, eagerState: l2.eagerState, next: null }), d2 = l2.hasEagerState ? l2.eagerState : a(d2, l2.action);
        else {
          var r2 = {
            lane: m2,
            action: l2.action,
            hasEagerState: l2.hasEagerState,
            eagerState: l2.eagerState,
            next: null
          };
          null === k2 ? (h2 = k2 = r2, g2 = d2) : k2 = k2.next = r2;
          J2.lanes |= m2;
          le2 |= m2;
        }
        l2 = l2.next;
      } while (null !== l2 && l2 !== f2);
      null === k2 ? g2 = d2 : k2.next = h2;
      Vc2(d2, b2.memoizedState) || (G2 = true);
      b2.memoizedState = d2;
      b2.baseState = g2;
      b2.baseQueue = k2;
      c2.lastRenderedState = d2;
    }
    a = c2.interleaved;
    if (null !== a) {
      e2 = a;
      do
        f2 = e2.lane, J2.lanes |= f2, le2 |= f2, e2 = e2.next;
      while (e2 !== a);
    } else null === e2 && (c2.lanes = 0);
    return [b2.memoizedState, c2.dispatch];
  }
  function Re2(a) {
    var b2 = Oe2(), c2 = b2.queue;
    if (null === c2) throw Error(n2(311));
    c2.lastRenderedReducer = a;
    var d2 = c2.dispatch, e2 = c2.pending, f2 = b2.memoizedState;
    if (null !== e2) {
      c2.pending = null;
      var g2 = e2 = e2.next;
      do
        f2 = a(f2, g2.action), g2 = g2.next;
      while (g2 !== e2);
      Vc2(f2, b2.memoizedState) || (G2 = true);
      b2.memoizedState = f2;
      null === b2.baseQueue && (b2.baseState = f2);
      c2.lastRenderedState = f2;
    }
    return [f2, d2];
  }
  function Se2() {
  }
  function Te2(a, b2) {
    var c2 = J2, d2 = Oe2(), e2 = b2(), f2 = !Vc2(d2.memoizedState, e2);
    f2 && (d2.memoizedState = e2, G2 = true);
    d2 = d2.queue;
    Ue2(Ve2.bind(null, c2, d2, a), [a]);
    if (d2.getSnapshot !== b2 || f2 || null !== L2 && L2.memoizedState.tag & 1) {
      c2.flags |= 2048;
      We2(9, Xe2.bind(null, c2, d2, e2, b2), void 0, null);
      if (null === N2) throw Error(n2(349));
      0 !== (Be2 & 30) || Ye2(c2, b2, e2);
    }
    return e2;
  }
  function Ye2(a, b2, c2) {
    a.flags |= 16384;
    a = { getSnapshot: b2, value: c2 };
    b2 = J2.updateQueue;
    null === b2 ? (b2 = { lastEffect: null, stores: null }, J2.updateQueue = b2, b2.stores = [a]) : (c2 = b2.stores, null === c2 ? b2.stores = [a] : c2.push(a));
  }
  function Xe2(a, b2, c2, d2) {
    b2.value = c2;
    b2.getSnapshot = d2;
    Ze2(b2) && $e2(a);
  }
  function Ve2(a, b2, c2) {
    return c2(function() {
      Ze2(b2) && $e2(a);
    });
  }
  function Ze2(a) {
    var b2 = a.getSnapshot;
    a = a.value;
    try {
      var c2 = b2();
      return !Vc2(a, c2);
    } catch (d2) {
      return true;
    }
  }
  function $e2(a) {
    var b2 = ce2(a, 1);
    null !== b2 && af2(b2, a, 1, -1);
  }
  function bf2(a) {
    var b2 = Ne2();
    "function" === typeof a && (a = a());
    b2.memoizedState = b2.baseState = a;
    a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Pe2, lastRenderedState: a };
    b2.queue = a;
    a = a.dispatch = cf2.bind(null, J2, a);
    return [b2.memoizedState, a];
  }
  function We2(a, b2, c2, d2) {
    a = { tag: a, create: b2, destroy: c2, deps: d2, next: null };
    b2 = J2.updateQueue;
    null === b2 ? (b2 = { lastEffect: null, stores: null }, J2.updateQueue = b2, b2.lastEffect = a.next = a) : (c2 = b2.lastEffect, null === c2 ? b2.lastEffect = a.next = a : (d2 = c2.next, c2.next = a, a.next = d2, b2.lastEffect = a));
    return a;
  }
  function df2() {
    return Oe2().memoizedState;
  }
  function ef2(a, b2, c2, d2) {
    var e2 = Ne2();
    J2.flags |= a;
    e2.memoizedState = We2(1 | b2, c2, void 0, void 0 === d2 ? null : d2);
  }
  function ff2(a, b2, c2, d2) {
    var e2 = Oe2();
    d2 = void 0 === d2 ? null : d2;
    var f2 = void 0;
    if (null !== K2) {
      var g2 = K2.memoizedState;
      f2 = g2.destroy;
      if (null !== d2 && Ge2(d2, g2.deps)) {
        e2.memoizedState = We2(b2, c2, f2, d2);
        return;
      }
    }
    J2.flags |= a;
    e2.memoizedState = We2(1 | b2, c2, f2, d2);
  }
  function gf(a, b2) {
    return ef2(8390656, 8, a, b2);
  }
  function Ue2(a, b2) {
    return ff2(2048, 8, a, b2);
  }
  function hf(a, b2) {
    return ff2(4, 2, a, b2);
  }
  function jf(a, b2) {
    return ff2(4, 4, a, b2);
  }
  function kf(a, b2) {
    if ("function" === typeof b2) return a = a(), b2(a), function() {
      b2(null);
    };
    if (null !== b2 && void 0 !== b2) return a = a(), b2.current = a, function() {
      b2.current = null;
    };
  }
  function lf2(a, b2, c2) {
    c2 = null !== c2 && void 0 !== c2 ? c2.concat([a]) : null;
    return ff2(4, 4, kf.bind(null, b2, a), c2);
  }
  function mf2() {
  }
  function nf2(a, b2) {
    var c2 = Oe2();
    b2 = void 0 === b2 ? null : b2;
    var d2 = c2.memoizedState;
    if (null !== d2 && null !== b2 && Ge2(b2, d2[1])) return d2[0];
    c2.memoizedState = [a, b2];
    return a;
  }
  function of2(a, b2) {
    var c2 = Oe2();
    b2 = void 0 === b2 ? null : b2;
    var d2 = c2.memoizedState;
    if (null !== d2 && null !== b2 && Ge2(b2, d2[1])) return d2[0];
    a = a();
    c2.memoizedState = [a, b2];
    return a;
  }
  function pf2(a, b2, c2) {
    if (0 === (Be2 & 21)) return a.baseState && (a.baseState = false, G2 = true), a.memoizedState = c2;
    Vc2(c2, b2) || (c2 = Dc2(), J2.lanes |= c2, le2 |= c2, a.baseState = true);
    return b2;
  }
  function qf2(a, b2) {
    var c2 = C2;
    C2 = 0 !== c2 && 4 > c2 ? c2 : 4;
    a(true);
    var d2 = Ae2.transition;
    Ae2.transition = {};
    try {
      a(false), b2();
    } finally {
      C2 = c2, Ae2.transition = d2;
    }
  }
  function rf2() {
    return Oe2().memoizedState;
  }
  function sf2(a, b2, c2) {
    var d2 = tf2(a);
    c2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null };
    if (uf2(a)) vf2(b2, c2);
    else if (c2 = be2(a, b2, c2, d2), null !== c2) {
      var e2 = O2();
      af2(c2, a, d2, e2);
      wf2(c2, b2, d2);
    }
  }
  function cf2(a, b2, c2) {
    var d2 = tf2(a), e2 = { lane: d2, action: c2, hasEagerState: false, eagerState: null, next: null };
    if (uf2(a)) vf2(b2, e2);
    else {
      var f2 = a.alternate;
      if (0 === a.lanes && (null === f2 || 0 === f2.lanes) && (f2 = b2.lastRenderedReducer, null !== f2)) try {
        var g2 = b2.lastRenderedState, h2 = f2(g2, c2);
        e2.hasEagerState = true;
        e2.eagerState = h2;
        if (Vc2(h2, g2)) {
          var k2 = b2.interleaved;
          null === k2 ? (e2.next = e2, ae2(b2)) : (e2.next = k2.next, k2.next = e2);
          b2.interleaved = e2;
          return;
        }
      } catch (l2) {
      } finally {
      }
      c2 = be2(a, b2, e2, d2);
      null !== c2 && (e2 = O2(), af2(c2, a, d2, e2), wf2(c2, b2, d2));
    }
  }
  function uf2(a) {
    var b2 = a.alternate;
    return a === J2 || null !== b2 && b2 === J2;
  }
  function vf2(a, b2) {
    De2 = Ce2 = true;
    var c2 = a.pending;
    null === c2 ? b2.next = b2 : (b2.next = c2.next, c2.next = b2);
    a.pending = b2;
  }
  function wf2(a, b2, c2) {
    if (0 !== (c2 & 4194240)) {
      var d2 = b2.lanes;
      d2 &= a.pendingLanes;
      c2 |= d2;
      b2.lanes = c2;
      Hc2(a, c2);
    }
  }
  var Le2 = { readContext: Zd2, useCallback: M2, useContext: M2, useEffect: M2, useImperativeHandle: M2, useInsertionEffect: M2, useLayoutEffect: M2, useMemo: M2, useReducer: M2, useRef: M2, useState: M2, useDebugValue: M2, useDeferredValue: M2, useTransition: M2, useMutableSource: M2, useSyncExternalStore: M2, useId: M2, unstable_isNewReconciler: false }, Ie2 = { readContext: Zd2, useCallback: function(a, b2) {
    Ne2().memoizedState = [a, void 0 === b2 ? null : b2];
    return a;
  }, useContext: Zd2, useEffect: gf, useImperativeHandle: function(a, b2, c2) {
    c2 = null !== c2 && void 0 !== c2 ? c2.concat([a]) : null;
    return ef2(
      4194308,
      4,
      kf.bind(null, b2, a),
      c2
    );
  }, useLayoutEffect: function(a, b2) {
    return ef2(4194308, 4, a, b2);
  }, useInsertionEffect: function(a, b2) {
    return ef2(4, 2, a, b2);
  }, useMemo: function(a, b2) {
    var c2 = Ne2();
    b2 = void 0 === b2 ? null : b2;
    a = a();
    c2.memoizedState = [a, b2];
    return a;
  }, useReducer: function(a, b2, c2) {
    var d2 = Ne2();
    b2 = void 0 !== c2 ? c2(b2) : b2;
    d2.memoizedState = d2.baseState = b2;
    a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a, lastRenderedState: b2 };
    d2.queue = a;
    a = a.dispatch = sf2.bind(null, J2, a);
    return [d2.memoizedState, a];
  }, useRef: function(a) {
    var b2 = Ne2();
    a = { current: a };
    return b2.memoizedState = a;
  }, useState: bf2, useDebugValue: mf2, useDeferredValue: function(a) {
    return Ne2().memoizedState = a;
  }, useTransition: function() {
    var a = bf2(false), b2 = a[0];
    a = qf2.bind(null, a[1]);
    Ne2().memoizedState = a;
    return [b2, a];
  }, useMutableSource: function() {
  }, useSyncExternalStore: function(a, b2, c2) {
    var d2 = J2, e2 = Ne2();
    if (F2) {
      if (void 0 === c2) throw Error(n2(407));
      c2 = c2();
    } else {
      c2 = b2();
      if (null === N2) throw Error(n2(349));
      0 !== (Be2 & 30) || Ye2(d2, b2, c2);
    }
    e2.memoizedState = c2;
    var f2 = { value: c2, getSnapshot: b2 };
    e2.queue = f2;
    gf(Ve2.bind(
      null,
      d2,
      f2,
      a
    ), [a]);
    d2.flags |= 2048;
    We2(9, Xe2.bind(null, d2, f2, c2, b2), void 0, null);
    return c2;
  }, useId: function() {
    var a = Ne2(), b2 = N2.identifierPrefix;
    if (F2) {
      var c2 = jd2;
      var d2 = id2;
      c2 = (d2 & ~(1 << 32 - tc2(d2) - 1)).toString(32) + c2;
      b2 = ":" + b2 + "R" + c2;
      c2 = Ee2++;
      0 < c2 && (b2 += "H" + c2.toString(32));
      b2 += ":";
    } else c2 = Fe2++, b2 = ":" + b2 + "r" + c2.toString(32) + ":";
    return a.memoizedState = b2;
  }, unstable_isNewReconciler: false }, Je2 = {
    readContext: Zd2,
    useCallback: nf2,
    useContext: Zd2,
    useEffect: Ue2,
    useImperativeHandle: lf2,
    useInsertionEffect: hf,
    useLayoutEffect: jf,
    useMemo: of2,
    useReducer: Qe2,
    useRef: df2,
    useState: function() {
      return Qe2(Pe2);
    },
    useDebugValue: mf2,
    useDeferredValue: function(a) {
      var b2 = Oe2();
      return pf2(b2, K2.memoizedState, a);
    },
    useTransition: function() {
      var a = Qe2(Pe2)[0], b2 = Oe2().memoizedState;
      return [a, b2];
    },
    useMutableSource: Se2,
    useSyncExternalStore: Te2,
    useId: rf2,
    unstable_isNewReconciler: false
  }, Ke2 = { readContext: Zd2, useCallback: nf2, useContext: Zd2, useEffect: Ue2, useImperativeHandle: lf2, useInsertionEffect: hf, useLayoutEffect: jf, useMemo: of2, useReducer: Re2, useRef: df2, useState: function() {
    return Re2(Pe2);
  }, useDebugValue: mf2, useDeferredValue: function(a) {
    var b2 = Oe2();
    return null === K2 ? b2.memoizedState = a : pf2(b2, K2.memoizedState, a);
  }, useTransition: function() {
    var a = Re2(Pe2)[0], b2 = Oe2().memoizedState;
    return [a, b2];
  }, useMutableSource: Se2, useSyncExternalStore: Te2, useId: rf2, unstable_isNewReconciler: false };
  function xf2(a, b2) {
    if (a && a.defaultProps) {
      b2 = ca2({}, b2);
      a = a.defaultProps;
      for (var c2 in a) void 0 === b2[c2] && (b2[c2] = a[c2]);
      return b2;
    }
    return b2;
  }
  function yf2(a, b2, c2, d2) {
    b2 = a.memoizedState;
    c2 = c2(d2, b2);
    c2 = null === c2 || void 0 === c2 ? b2 : ca2({}, b2, c2);
    a.memoizedState = c2;
    0 === a.lanes && (a.updateQueue.baseState = c2);
  }
  var zf2 = { isMounted: function(a) {
    return (a = a._reactInternals) ? wa2(a) === a : false;
  }, enqueueSetState: function(a, b2, c2) {
    a = a._reactInternals;
    var d2 = O2(), e2 = tf2(a), f2 = ge2(d2, e2);
    f2.payload = b2;
    void 0 !== c2 && null !== c2 && (f2.callback = c2);
    b2 = he2(a, f2, e2);
    null !== b2 && (af2(b2, a, e2, d2), ie2(b2, a, e2));
  }, enqueueReplaceState: function(a, b2, c2) {
    a = a._reactInternals;
    var d2 = O2(), e2 = tf2(a), f2 = ge2(d2, e2);
    f2.tag = 1;
    f2.payload = b2;
    void 0 !== c2 && null !== c2 && (f2.callback = c2);
    b2 = he2(a, f2, e2);
    null !== b2 && (af2(b2, a, e2, d2), ie2(b2, a, e2));
  }, enqueueForceUpdate: function(a, b2) {
    a = a._reactInternals;
    var c2 = O2(), d2 = tf2(a), e2 = ge2(c2, d2);
    e2.tag = 2;
    void 0 !== b2 && null !== b2 && (e2.callback = b2);
    b2 = he2(a, e2, d2);
    null !== b2 && (af2(b2, a, d2, c2), ie2(b2, a, d2));
  } };
  function Af2(a, b2, c2, d2, e2, f2, g2) {
    a = a.stateNode;
    return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d2, f2, g2) : b2.prototype && b2.prototype.isPureReactComponent ? !Dd2(c2, d2) || !Dd2(e2, f2) : true;
  }
  function Bf2(a, b2, c2) {
    var d2 = false, e2 = jc2;
    var f2 = b2.contextType;
    "object" === typeof f2 && null !== f2 ? f2 = Zd2(f2) : (e2 = A2(b2) ? kc2 : x2.current, d2 = b2.contextTypes, f2 = (d2 = null !== d2 && void 0 !== d2) ? mc2(a, e2) : jc2);
    b2 = new b2(c2, f2);
    a.memoizedState = null !== b2.state && void 0 !== b2.state ? b2.state : null;
    b2.updater = zf2;
    a.stateNode = b2;
    b2._reactInternals = a;
    d2 && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e2, a.__reactInternalMemoizedMaskedChildContext = f2);
    return b2;
  }
  function Cf2(a, b2, c2, d2) {
    a = b2.state;
    "function" === typeof b2.componentWillReceiveProps && b2.componentWillReceiveProps(c2, d2);
    "function" === typeof b2.UNSAFE_componentWillReceiveProps && b2.UNSAFE_componentWillReceiveProps(c2, d2);
    b2.state !== a && zf2.enqueueReplaceState(b2, b2.state, null);
  }
  function Df2(a, b2, c2, d2) {
    var e2 = a.stateNode;
    e2.props = c2;
    e2.state = a.memoizedState;
    e2.refs = {};
    ee2(a);
    var f2 = b2.contextType;
    "object" === typeof f2 && null !== f2 ? e2.context = Zd2(f2) : (f2 = A2(b2) ? kc2 : x2.current, e2.context = mc2(a, f2));
    e2.state = a.memoizedState;
    f2 = b2.getDerivedStateFromProps;
    "function" === typeof f2 && (yf2(a, b2, f2, c2), e2.state = a.memoizedState);
    "function" === typeof b2.getDerivedStateFromProps || "function" === typeof e2.getSnapshotBeforeUpdate || "function" !== typeof e2.UNSAFE_componentWillMount && "function" !== typeof e2.componentWillMount || (b2 = e2.state, "function" === typeof e2.componentWillMount && e2.componentWillMount(), "function" === typeof e2.UNSAFE_componentWillMount && e2.UNSAFE_componentWillMount(), b2 !== e2.state && zf2.enqueueReplaceState(e2, e2.state, null), ke2(a, c2, e2, d2), e2.state = a.memoizedState);
    "function" === typeof e2.componentDidMount && (a.flags |= 4194308);
  }
  function Ef2(a, b2) {
    try {
      var c2 = "", d2 = b2;
      do
        c2 += Ed2(d2), d2 = d2.return;
      while (d2);
      var e2 = c2;
    } catch (f2) {
      e2 = "\nError generating stack: " + f2.message + "\n" + f2.stack;
    }
    return { value: a, source: b2, stack: e2, digest: null };
  }
  function Ff2(a, b2, c2) {
    return { value: a, source: null, stack: null != c2 ? c2 : null, digest: null != b2 ? b2 : null };
  }
  function Gf2(a, b2) {
    try {
      console.error(b2.value);
    } catch (c2) {
      setTimeout(function() {
        throw c2;
      });
    }
  }
  var Hf2 = "function" === typeof WeakMap ? WeakMap : Map;
  function If2(a, b2, c2) {
    c2 = ge2(-1, c2);
    c2.tag = 3;
    c2.payload = { element: null };
    var d2 = b2.value;
    c2.callback = function() {
      Jf2 || (Jf2 = true, Kf2 = d2);
      Gf2(a, b2);
    };
    return c2;
  }
  function Lf2(a, b2, c2) {
    c2 = ge2(-1, c2);
    c2.tag = 3;
    var d2 = a.type.getDerivedStateFromError;
    if ("function" === typeof d2) {
      var e2 = b2.value;
      c2.payload = function() {
        return d2(e2);
      };
      c2.callback = function() {
        Gf2(a, b2);
      };
    }
    var f2 = a.stateNode;
    null !== f2 && "function" === typeof f2.componentDidCatch && (c2.callback = function() {
      Gf2(a, b2);
      "function" !== typeof d2 && (null === Mf2 ? Mf2 = /* @__PURE__ */ new Set([this]) : Mf2.add(this));
      var c3 = b2.stack;
      this.componentDidCatch(b2.value, { componentStack: null !== c3 ? c3 : "" });
    });
    return c2;
  }
  function Nf2(a, b2, c2) {
    var d2 = a.pingCache;
    if (null === d2) {
      d2 = a.pingCache = new Hf2();
      var e2 = /* @__PURE__ */ new Set();
      d2.set(b2, e2);
    } else e2 = d2.get(b2), void 0 === e2 && (e2 = /* @__PURE__ */ new Set(), d2.set(b2, e2));
    e2.has(c2) || (e2.add(c2), a = Of2.bind(null, a, b2, c2), b2.then(a, a));
  }
  function Pf2(a) {
    do {
      var b2;
      if (b2 = 13 === a.tag) b2 = a.memoizedState, b2 = null !== b2 ? null !== b2.dehydrated ? true : false : true;
      if (b2) return a;
      a = a.return;
    } while (null !== a);
    return null;
  }
  function Qf2(a, b2, c2, d2, e2) {
    if (0 === (a.mode & 1)) return a === b2 ? a.flags |= 65536 : (a.flags |= 128, c2.flags |= 131072, c2.flags &= -52805, 1 === c2.tag && (null === c2.alternate ? c2.tag = 17 : (b2 = ge2(-1, 1), b2.tag = 2, he2(c2, b2, 1))), c2.lanes |= 1), a;
    a.flags |= 65536;
    a.lanes = e2;
    return a;
  }
  var Rf2 = da2.ReactCurrentOwner, G2 = false;
  function P2(a, b2, c2, d2) {
    b2.child = null === a ? Pd2(b2, null, c2, d2) : Od2(b2, a.child, c2, d2);
  }
  function Sf2(a, b2, c2, d2, e2) {
    c2 = c2.render;
    var f2 = b2.ref;
    Yd2(b2, e2);
    d2 = He2(a, b2, c2, d2, f2, e2);
    c2 = Me2();
    if (null !== a && !G2) return b2.updateQueue = a.updateQueue, b2.flags &= -2053, a.lanes &= ~e2, Tf2(a, b2, e2);
    F2 && c2 && md2(b2);
    b2.flags |= 1;
    P2(a, b2, d2, e2);
    return b2.child;
  }
  function Uf2(a, b2, c2, d2, e2) {
    if (null === a) {
      var f2 = c2.type;
      if ("function" === typeof f2 && !Vf2(f2) && void 0 === f2.defaultProps && null === c2.compare && void 0 === c2.defaultProps) return b2.tag = 15, b2.type = f2, Wf2(a, b2, f2, d2, e2);
      a = Ld2(c2.type, null, d2, b2, b2.mode, e2);
      a.ref = b2.ref;
      a.return = b2;
      return b2.child = a;
    }
    f2 = a.child;
    if (0 === (a.lanes & e2)) {
      var g2 = f2.memoizedProps;
      c2 = c2.compare;
      c2 = null !== c2 ? c2 : Dd2;
      if (c2(g2, d2) && a.ref === b2.ref) return Tf2(a, b2, e2);
    }
    b2.flags |= 1;
    a = Jd2(f2, d2);
    a.ref = b2.ref;
    a.return = b2;
    return b2.child = a;
  }
  function Wf2(a, b2, c2, d2, e2) {
    if (null !== a) {
      var f2 = a.memoizedProps;
      if (Dd2(f2, d2) && a.ref === b2.ref) if (G2 = false, b2.pendingProps = d2 = f2, 0 !== (a.lanes & e2)) 0 !== (a.flags & 131072) && (G2 = true);
      else return b2.lanes = a.lanes, Tf2(a, b2, e2);
    }
    return Xf2(a, b2, c2, d2, e2);
  }
  function Yf2(a, b2, c2) {
    var d2 = b2.pendingProps, e2 = d2.children, f2 = null !== a ? a.memoizedState : null;
    if ("hidden" === d2.mode) if (0 === (b2.mode & 1)) b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, v2(Zf2, $f2), $f2 |= c2;
    else {
      if (0 === (c2 & 1073741824)) return a = null !== f2 ? f2.baseLanes | c2 : c2, b2.lanes = b2.childLanes = 1073741824, b2.memoizedState = { baseLanes: a, cachePool: null, transitions: null }, b2.updateQueue = null, v2(Zf2, $f2), $f2 |= a, null;
      b2.memoizedState = { baseLanes: 0, cachePool: null, transitions: null };
      d2 = null !== f2 ? f2.baseLanes : c2;
      v2(Zf2, $f2);
      $f2 |= d2;
    }
    else null !== f2 ? (d2 = f2.baseLanes | c2, b2.memoizedState = null) : d2 = c2, v2(Zf2, $f2), $f2 |= d2;
    P2(a, b2, e2, c2);
    return b2.child;
  }
  function ag2(a, b2) {
    var c2 = b2.ref;
    if (null === a && null !== c2 || null !== a && a.ref !== c2) b2.flags |= 512, b2.flags |= 2097152;
  }
  function Xf2(a, b2, c2, d2, e2) {
    var f2 = A2(c2) ? kc2 : x2.current;
    f2 = mc2(b2, f2);
    Yd2(b2, e2);
    c2 = He2(a, b2, c2, d2, f2, e2);
    d2 = Me2();
    if (null !== a && !G2) return b2.updateQueue = a.updateQueue, b2.flags &= -2053, a.lanes &= ~e2, Tf2(a, b2, e2);
    F2 && d2 && md2(b2);
    b2.flags |= 1;
    P2(a, b2, c2, e2);
    return b2.child;
  }
  function bg2(a, b2, c2, d2, e2) {
    if (A2(c2)) {
      var f2 = true;
      qc2(b2);
    } else f2 = false;
    Yd2(b2, e2);
    if (null === b2.stateNode) cg2(a, b2), Bf2(b2, c2, d2), Df2(b2, c2, d2, e2), d2 = true;
    else if (null === a) {
      var g2 = b2.stateNode, h2 = b2.memoizedProps;
      g2.props = h2;
      var k2 = g2.context, l2 = c2.contextType;
      "object" === typeof l2 && null !== l2 ? l2 = Zd2(l2) : (l2 = A2(c2) ? kc2 : x2.current, l2 = mc2(b2, l2));
      var m2 = c2.getDerivedStateFromProps, r2 = "function" === typeof m2 || "function" === typeof g2.getSnapshotBeforeUpdate;
      r2 || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== d2 || k2 !== l2) && Cf2(b2, g2, d2, l2);
      de2 = false;
      var p2 = b2.memoizedState;
      g2.state = p2;
      ke2(b2, d2, g2, e2);
      k2 = b2.memoizedState;
      h2 !== d2 || p2 !== k2 || z2.current || de2 ? ("function" === typeof m2 && (yf2(b2, c2, m2, d2), k2 = b2.memoizedState), (h2 = de2 || Af2(b2, c2, h2, d2, p2, k2, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b2.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), b2.memoizedProps = d2, b2.memoizedState = k2), g2.props = d2, g2.state = k2, g2.context = l2, d2 = h2) : ("function" === typeof g2.componentDidMount && (b2.flags |= 4194308), d2 = false);
    } else {
      g2 = b2.stateNode;
      fe2(a, b2);
      h2 = b2.memoizedProps;
      l2 = b2.type === b2.elementType ? h2 : xf2(b2.type, h2);
      g2.props = l2;
      r2 = b2.pendingProps;
      p2 = g2.context;
      k2 = c2.contextType;
      "object" === typeof k2 && null !== k2 ? k2 = Zd2(k2) : (k2 = A2(c2) ? kc2 : x2.current, k2 = mc2(b2, k2));
      var B2 = c2.getDerivedStateFromProps;
      (m2 = "function" === typeof B2 || "function" === typeof g2.getSnapshotBeforeUpdate) || "function" !== typeof g2.UNSAFE_componentWillReceiveProps && "function" !== typeof g2.componentWillReceiveProps || (h2 !== r2 || p2 !== k2) && Cf2(b2, g2, d2, k2);
      de2 = false;
      p2 = b2.memoizedState;
      g2.state = p2;
      ke2(b2, d2, g2, e2);
      var w2 = b2.memoizedState;
      h2 !== r2 || p2 !== w2 || z2.current || de2 ? ("function" === typeof B2 && (yf2(b2, c2, B2, d2), w2 = b2.memoizedState), (l2 = de2 || Af2(b2, c2, l2, d2, p2, w2, k2) || false) ? (m2 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, w2, k2), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, w2, k2)), "function" === typeof g2.componentDidUpdate && (b2.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b2.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h2 === a.memoizedProps && p2 === a.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a.memoizedProps && p2 === a.memoizedState || (b2.flags |= 1024), b2.memoizedProps = d2, b2.memoizedState = w2), g2.props = d2, g2.state = w2, g2.context = k2, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h2 === a.memoizedProps && p2 === a.memoizedState || (b2.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h2 === a.memoizedProps && p2 === a.memoizedState || (b2.flags |= 1024), d2 = false);
    }
    return dg2(a, b2, c2, d2, f2, e2);
  }
  function dg2(a, b2, c2, d2, e2, f2) {
    ag2(a, b2);
    var g2 = 0 !== (b2.flags & 128);
    if (!d2 && !g2) return e2 && rc2(b2, c2, false), Tf2(a, b2, f2);
    d2 = b2.stateNode;
    Rf2.current = b2;
    var h2 = g2 && "function" !== typeof c2.getDerivedStateFromError ? null : d2.render();
    b2.flags |= 1;
    null !== a && g2 ? (b2.child = Od2(b2, a.child, null, f2), b2.child = Od2(b2, null, h2, f2)) : P2(a, b2, h2, f2);
    b2.memoizedState = d2.state;
    e2 && rc2(b2, c2, true);
    return b2.child;
  }
  function eg2(a) {
    var b2 = a.stateNode;
    b2.pendingContext ? oc2(a, b2.pendingContext, b2.pendingContext !== b2.context) : b2.context && oc2(a, b2.context, false);
    se2(a, b2.containerInfo);
  }
  function fg2(a, b2, c2, d2, e2) {
    Ad2();
    Bd2(e2);
    b2.flags |= 256;
    P2(a, b2, c2, d2);
    return b2.child;
  }
  var gg2 = { dehydrated: null, treeContext: null, retryLane: 0 };
  function hg2(a) {
    return { baseLanes: a, cachePool: null, transitions: null };
  }
  function ig2(a, b2, c2) {
    var d2 = b2.pendingProps, e2 = I2.current, f2 = false, g2 = 0 !== (b2.flags & 128), h2;
    (h2 = g2) || (h2 = null !== a && null === a.memoizedState ? false : 0 !== (e2 & 2));
    if (h2) f2 = true, b2.flags &= -129;
    else if (null === a || null !== a.memoizedState) e2 |= 1;
    v2(I2, e2 & 1);
    if (null === a) {
      wd2(b2);
      a = b2.memoizedState;
      if (null !== a && (a = a.dehydrated, null !== a)) return 0 === (b2.mode & 1) ? b2.lanes = 1 : Kb2(a) ? b2.lanes = 8 : b2.lanes = 1073741824, null;
      g2 = d2.children;
      a = d2.fallback;
      return f2 ? (d2 = b2.mode, f2 = b2.child, g2 = { mode: "hidden", children: g2 }, 0 === (d2 & 1) && null !== f2 ? (f2.childLanes = 0, f2.pendingProps = g2) : f2 = jg2(g2, d2, 0, null), a = Nd2(a, d2, c2, null), f2.return = b2, a.return = b2, f2.sibling = a, b2.child = f2, b2.child.memoizedState = hg2(c2), b2.memoizedState = gg2, a) : kg2(b2, g2);
    }
    e2 = a.memoizedState;
    if (null !== e2 && (h2 = e2.dehydrated, null !== h2)) return lg2(a, b2, g2, d2, h2, e2, c2);
    if (f2) {
      f2 = d2.fallback;
      g2 = b2.mode;
      e2 = a.child;
      h2 = e2.sibling;
      var k2 = { mode: "hidden", children: d2.children };
      0 === (g2 & 1) && b2.child !== e2 ? (d2 = b2.child, d2.childLanes = 0, d2.pendingProps = k2, b2.deletions = null) : (d2 = Jd2(e2, k2), d2.subtreeFlags = e2.subtreeFlags & 14680064);
      null !== h2 ? f2 = Jd2(h2, f2) : (f2 = Nd2(f2, g2, c2, null), f2.flags |= 2);
      f2.return = b2;
      d2.return = b2;
      d2.sibling = f2;
      b2.child = d2;
      d2 = f2;
      f2 = b2.child;
      g2 = a.child.memoizedState;
      g2 = null === g2 ? hg2(c2) : { baseLanes: g2.baseLanes | c2, cachePool: null, transitions: g2.transitions };
      f2.memoizedState = g2;
      f2.childLanes = a.childLanes & ~c2;
      b2.memoizedState = gg2;
      return d2;
    }
    f2 = a.child;
    a = f2.sibling;
    d2 = Jd2(f2, { mode: "visible", children: d2.children });
    0 === (b2.mode & 1) && (d2.lanes = c2);
    d2.return = b2;
    d2.sibling = null;
    null !== a && (c2 = b2.deletions, null === c2 ? (b2.deletions = [a], b2.flags |= 16) : c2.push(a));
    b2.child = d2;
    b2.memoizedState = null;
    return d2;
  }
  function kg2(a, b2) {
    b2 = jg2({ mode: "visible", children: b2 }, a.mode, 0, null);
    b2.return = a;
    return a.child = b2;
  }
  function mg2(a, b2, c2, d2) {
    null !== d2 && Bd2(d2);
    Od2(b2, a.child, null, c2);
    a = kg2(b2, b2.pendingProps.children);
    a.flags |= 2;
    b2.memoizedState = null;
    return a;
  }
  function lg2(a, b2, c2, d2, e2, f2, g2) {
    if (c2) {
      if (b2.flags & 256) return b2.flags &= -257, d2 = Ff2(Error(n2(422))), mg2(a, b2, g2, d2);
      if (null !== b2.memoizedState) return b2.child = a.child, b2.flags |= 128, null;
      f2 = d2.fallback;
      e2 = b2.mode;
      d2 = jg2({ mode: "visible", children: d2.children }, e2, 0, null);
      f2 = Nd2(f2, e2, g2, null);
      f2.flags |= 2;
      d2.return = b2;
      f2.return = b2;
      d2.sibling = f2;
      b2.child = d2;
      0 !== (b2.mode & 1) && Od2(b2, a.child, null, g2);
      b2.child.memoizedState = hg2(g2);
      b2.memoizedState = gg2;
      return f2;
    }
    if (0 === (b2.mode & 1)) return mg2(a, b2, g2, null);
    if (Kb2(e2)) return d2 = Lb2(e2).digest, f2 = Error(n2(419)), d2 = Ff2(
      f2,
      d2,
      void 0
    ), mg2(a, b2, g2, d2);
    c2 = 0 !== (g2 & a.childLanes);
    if (G2 || c2) {
      d2 = N2;
      if (null !== d2) {
        switch (g2 & -g2) {
          case 4:
            e2 = 2;
            break;
          case 16:
            e2 = 8;
            break;
          case 64:
          case 128:
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
          case 67108864:
            e2 = 32;
            break;
          case 536870912:
            e2 = 268435456;
            break;
          default:
            e2 = 0;
        }
        e2 = 0 !== (e2 & (d2.suspendedLanes | g2)) ? 0 : e2;
        0 !== e2 && e2 !== f2.retryLane && (f2.retryLane = e2, ce2(a, e2), af2(
          d2,
          a,
          e2,
          -1
        ));
      }
      ng2();
      d2 = Ff2(Error(n2(421)));
      return mg2(a, b2, g2, d2);
    }
    if (Jb2(e2)) return b2.flags |= 128, b2.child = a.child, b2 = og2.bind(null, a), Mb(e2, b2), null;
    a = f2.treeContext;
    Va2 && (pd2 = Qb2(e2), od2 = b2, F2 = true, rd2 = null, qd2 = false, null !== a && (fd2[gd2++] = id2, fd2[gd2++] = jd2, fd2[gd2++] = hd2, id2 = a.id, jd2 = a.overflow, hd2 = b2));
    b2 = kg2(b2, d2.children);
    b2.flags |= 4096;
    return b2;
  }
  function pg2(a, b2, c2) {
    a.lanes |= b2;
    var d2 = a.alternate;
    null !== d2 && (d2.lanes |= b2);
    Xd2(a.return, b2, c2);
  }
  function qg2(a, b2, c2, d2, e2) {
    var f2 = a.memoizedState;
    null === f2 ? a.memoizedState = { isBackwards: b2, rendering: null, renderingStartTime: 0, last: d2, tail: c2, tailMode: e2 } : (f2.isBackwards = b2, f2.rendering = null, f2.renderingStartTime = 0, f2.last = d2, f2.tail = c2, f2.tailMode = e2);
  }
  function rg2(a, b2, c2) {
    var d2 = b2.pendingProps, e2 = d2.revealOrder, f2 = d2.tail;
    P2(a, b2, d2.children, c2);
    d2 = I2.current;
    if (0 !== (d2 & 2)) d2 = d2 & 1 | 2, b2.flags |= 128;
    else {
      if (null !== a && 0 !== (a.flags & 128)) a: for (a = b2.child; null !== a; ) {
        if (13 === a.tag) null !== a.memoizedState && pg2(a, c2, b2);
        else if (19 === a.tag) pg2(a, c2, b2);
        else if (null !== a.child) {
          a.child.return = a;
          a = a.child;
          continue;
        }
        if (a === b2) break a;
        for (; null === a.sibling; ) {
          if (null === a.return || a.return === b2) break a;
          a = a.return;
        }
        a.sibling.return = a.return;
        a = a.sibling;
      }
      d2 &= 1;
    }
    v2(I2, d2);
    if (0 === (b2.mode & 1)) b2.memoizedState = null;
    else switch (e2) {
      case "forwards":
        c2 = b2.child;
        for (e2 = null; null !== c2; ) a = c2.alternate, null !== a && null === we2(a) && (e2 = c2), c2 = c2.sibling;
        c2 = e2;
        null === c2 ? (e2 = b2.child, b2.child = null) : (e2 = c2.sibling, c2.sibling = null);
        qg2(b2, false, e2, c2, f2);
        break;
      case "backwards":
        c2 = null;
        e2 = b2.child;
        for (b2.child = null; null !== e2; ) {
          a = e2.alternate;
          if (null !== a && null === we2(a)) {
            b2.child = e2;
            break;
          }
          a = e2.sibling;
          e2.sibling = c2;
          c2 = e2;
          e2 = a;
        }
        qg2(b2, true, c2, null, f2);
        break;
      case "together":
        qg2(b2, false, null, null, void 0);
        break;
      default:
        b2.memoizedState = null;
    }
    return b2.child;
  }
  function cg2(a, b2) {
    0 === (b2.mode & 1) && null !== a && (a.alternate = null, b2.alternate = null, b2.flags |= 2);
  }
  function Tf2(a, b2, c2) {
    null !== a && (b2.dependencies = a.dependencies);
    le2 |= b2.lanes;
    if (0 === (c2 & b2.childLanes)) return null;
    if (null !== a && b2.child !== a.child) throw Error(n2(153));
    if (null !== b2.child) {
      a = b2.child;
      c2 = Jd2(a, a.pendingProps);
      b2.child = c2;
      for (c2.return = b2; null !== a.sibling; ) a = a.sibling, c2 = c2.sibling = Jd2(a, a.pendingProps), c2.return = b2;
      c2.sibling = null;
    }
    return b2.child;
  }
  function sg2(a, b2, c2) {
    switch (b2.tag) {
      case 3:
        eg2(b2);
        Ad2();
        break;
      case 5:
        ue2(b2);
        break;
      case 1:
        A2(b2.type) && qc2(b2);
        break;
      case 4:
        se2(b2, b2.stateNode.containerInfo);
        break;
      case 10:
        Vd2(b2, b2.type._context, b2.memoizedProps.value);
        break;
      case 13:
        var d2 = b2.memoizedState;
        if (null !== d2) {
          if (null !== d2.dehydrated) return v2(I2, I2.current & 1), b2.flags |= 128, null;
          if (0 !== (c2 & b2.child.childLanes)) return ig2(a, b2, c2);
          v2(I2, I2.current & 1);
          a = Tf2(a, b2, c2);
          return null !== a ? a.sibling : null;
        }
        v2(I2, I2.current & 1);
        break;
      case 19:
        d2 = 0 !== (c2 & b2.childLanes);
        if (0 !== (a.flags & 128)) {
          if (d2) return rg2(
            a,
            b2,
            c2
          );
          b2.flags |= 128;
        }
        var e2 = b2.memoizedState;
        null !== e2 && (e2.rendering = null, e2.tail = null, e2.lastEffect = null);
        v2(I2, I2.current);
        if (d2) break;
        else return null;
      case 22:
      case 23:
        return b2.lanes = 0, Yf2(a, b2, c2);
    }
    return Tf2(a, b2, c2);
  }
  function tg2(a) {
    a.flags |= 4;
  }
  function ug2(a, b2) {
    if (null !== a && a.child === b2.child) return true;
    if (0 !== (b2.flags & 16)) return false;
    for (a = b2.child; null !== a; ) {
      if (0 !== (a.flags & 12854) || 0 !== (a.subtreeFlags & 12854)) return false;
      a = a.sibling;
    }
    return true;
  }
  var vg2, wg2, xg2, yg2;
  if (Ta2) vg2 = function(a, b2) {
    for (var c2 = b2.child; null !== c2; ) {
      if (5 === c2.tag || 6 === c2.tag) Ka2(a, c2.stateNode);
      else if (4 !== c2.tag && null !== c2.child) {
        c2.child.return = c2;
        c2 = c2.child;
        continue;
      }
      if (c2 === b2) break;
      for (; null === c2.sibling; ) {
        if (null === c2.return || c2.return === b2) return;
        c2 = c2.return;
      }
      c2.sibling.return = c2.return;
      c2 = c2.sibling;
    }
  }, wg2 = function() {
  }, xg2 = function(a, b2, c2, d2, e2) {
    a = a.memoizedProps;
    if (a !== d2) {
      var f2 = b2.stateNode, g2 = re2(oe2.current);
      c2 = Ma2(f2, c2, a, d2, e2, g2);
      (b2.updateQueue = c2) && tg2(b2);
    }
  }, yg2 = function(a, b2, c2, d2) {
    c2 !== d2 && tg2(b2);
  };
  else if (Ua2) {
    vg2 = function(a, b2, c2, d2) {
      for (var e2 = b2.child; null !== e2; ) {
        if (5 === e2.tag) {
          var f2 = e2.stateNode;
          c2 && d2 && (f2 = Eb2(f2, e2.type, e2.memoizedProps, e2));
          Ka2(a, f2);
        } else if (6 === e2.tag) f2 = e2.stateNode, c2 && d2 && (f2 = Fb2(f2, e2.memoizedProps, e2)), Ka2(a, f2);
        else if (4 !== e2.tag) {
          if (22 === e2.tag && null !== e2.memoizedState) f2 = e2.child, null !== f2 && (f2.return = e2), vg2(a, e2, true, true);
          else if (null !== e2.child) {
            e2.child.return = e2;
            e2 = e2.child;
            continue;
          }
        }
        if (e2 === b2) break;
        for (; null === e2.sibling; ) {
          if (null === e2.return || e2.return === b2) return;
          e2 = e2.return;
        }
        e2.sibling.return = e2.return;
        e2 = e2.sibling;
      }
    };
    var zg2 = function(a, b2, c2, d2) {
      for (var e2 = b2.child; null !== e2; ) {
        if (5 === e2.tag) {
          var f2 = e2.stateNode;
          c2 && d2 && (f2 = Eb2(f2, e2.type, e2.memoizedProps, e2));
          Ab2(a, f2);
        } else if (6 === e2.tag) f2 = e2.stateNode, c2 && d2 && (f2 = Fb2(f2, e2.memoizedProps, e2)), Ab2(a, f2);
        else if (4 !== e2.tag) {
          if (22 === e2.tag && null !== e2.memoizedState) f2 = e2.child, null !== f2 && (f2.return = e2), zg2(a, e2, true, true);
          else if (null !== e2.child) {
            e2.child.return = e2;
            e2 = e2.child;
            continue;
          }
        }
        if (e2 === b2) break;
        for (; null === e2.sibling; ) {
          if (null === e2.return || e2.return === b2) return;
          e2 = e2.return;
        }
        e2.sibling.return = e2.return;
        e2 = e2.sibling;
      }
    };
    wg2 = function(a, b2) {
      var c2 = b2.stateNode;
      if (!ug2(a, b2)) {
        a = c2.containerInfo;
        var d2 = zb2(a);
        zg2(d2, b2, false, false);
        c2.pendingChildren = d2;
        tg2(b2);
        Bb2(a, d2);
      }
    };
    xg2 = function(a, b2, c2, d2, e2) {
      var f2 = a.stateNode, g2 = a.memoizedProps;
      if ((a = ug2(a, b2)) && g2 === d2) b2.stateNode = f2;
      else {
        var h2 = b2.stateNode, k2 = re2(oe2.current), l2 = null;
        g2 !== d2 && (l2 = Ma2(h2, c2, g2, d2, e2, k2));
        a && null === l2 ? b2.stateNode = f2 : (f2 = yb2(f2, l2, c2, g2, d2, b2, a, h2), La2(f2, c2, d2, e2, k2) && tg2(b2), b2.stateNode = f2, a ? tg2(b2) : vg2(f2, b2, false, false));
      }
    };
    yg2 = function(a, b2, c2, d2) {
      c2 !== d2 ? (a = re2(qe2.current), c2 = re2(oe2.current), b2.stateNode = Oa2(d2, a, c2, b2), tg2(b2)) : b2.stateNode = a.stateNode;
    };
  } else wg2 = function() {
  }, xg2 = function() {
  }, yg2 = function() {
  };
  function Ag2(a, b2) {
    if (!F2) switch (a.tailMode) {
      case "hidden":
        b2 = a.tail;
        for (var c2 = null; null !== b2; ) null !== b2.alternate && (c2 = b2), b2 = b2.sibling;
        null === c2 ? a.tail = null : c2.sibling = null;
        break;
      case "collapsed":
        c2 = a.tail;
        for (var d2 = null; null !== c2; ) null !== c2.alternate && (d2 = c2), c2 = c2.sibling;
        null === d2 ? b2 || null === a.tail ? a.tail = null : a.tail.sibling = null : d2.sibling = null;
    }
  }
  function Q2(a) {
    var b2 = null !== a.alternate && a.alternate.child === a.child, c2 = 0, d2 = 0;
    if (b2) for (var e2 = a.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags & 14680064, d2 |= e2.flags & 14680064, e2.return = a, e2 = e2.sibling;
    else for (e2 = a.child; null !== e2; ) c2 |= e2.lanes | e2.childLanes, d2 |= e2.subtreeFlags, d2 |= e2.flags, e2.return = a, e2 = e2.sibling;
    a.subtreeFlags |= d2;
    a.childLanes = c2;
    return b2;
  }
  function Bg2(a, b2, c2) {
    var d2 = b2.pendingProps;
    nd2(b2);
    switch (b2.tag) {
      case 2:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return Q2(b2), null;
      case 1:
        return A2(b2.type) && nc2(), Q2(b2), null;
      case 3:
        c2 = b2.stateNode;
        te2();
        q2(z2);
        q2(x2);
        ye2();
        c2.pendingContext && (c2.context = c2.pendingContext, c2.pendingContext = null);
        if (null === a || null === a.child) yd2(b2) ? tg2(b2) : null === a || a.memoizedState.isDehydrated && 0 === (b2.flags & 256) || (b2.flags |= 1024, null !== rd2 && (Cg2(rd2), rd2 = null));
        wg2(a, b2);
        Q2(b2);
        return null;
      case 5:
        ve2(b2);
        c2 = re2(qe2.current);
        var e2 = b2.type;
        if (null !== a && null != b2.stateNode) xg2(a, b2, e2, d2, c2), a.ref !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152);
        else {
          if (!d2) {
            if (null === b2.stateNode) throw Error(n2(166));
            Q2(b2);
            return null;
          }
          a = re2(oe2.current);
          if (yd2(b2)) {
            if (!Va2) throw Error(n2(175));
            a = Rb2(b2.stateNode, b2.type, b2.memoizedProps, c2, a, b2, !qd2);
            b2.updateQueue = a;
            null !== a && tg2(b2);
          } else {
            var f2 = Ja2(e2, d2, c2, a, b2);
            vg2(f2, b2, false, false);
            b2.stateNode = f2;
            La2(f2, e2, d2, c2, a) && tg2(b2);
          }
          null !== b2.ref && (b2.flags |= 512, b2.flags |= 2097152);
        }
        Q2(b2);
        return null;
      case 6:
        if (a && null != b2.stateNode) yg2(a, b2, a.memoizedProps, d2);
        else {
          if ("string" !== typeof d2 && null === b2.stateNode) throw Error(n2(166));
          a = re2(qe2.current);
          c2 = re2(oe2.current);
          if (yd2(b2)) {
            if (!Va2) throw Error(n2(176));
            a = b2.stateNode;
            c2 = b2.memoizedProps;
            if (d2 = Sb2(a, c2, b2, !qd2)) {
              if (e2 = od2, null !== e2) switch (e2.tag) {
                case 3:
                  $b2(e2.stateNode.containerInfo, a, c2, 0 !== (e2.mode & 1));
                  break;
                case 5:
                  ac2(e2.type, e2.memoizedProps, e2.stateNode, a, c2, 0 !== (e2.mode & 1));
              }
            }
            d2 && tg2(b2);
          } else b2.stateNode = Oa2(d2, a, c2, b2);
        }
        Q2(b2);
        return null;
      case 13:
        q2(I2);
        d2 = b2.memoizedState;
        if (null === a || null !== a.memoizedState && null !== a.memoizedState.dehydrated) {
          if (F2 && null !== pd2 && 0 !== (b2.mode & 1) && 0 === (b2.flags & 128)) zd2(), Ad2(), b2.flags |= 98560, e2 = false;
          else if (e2 = yd2(b2), null !== d2 && null !== d2.dehydrated) {
            if (null === a) {
              if (!e2) throw Error(n2(318));
              if (!Va2) throw Error(n2(344));
              e2 = b2.memoizedState;
              e2 = null !== e2 ? e2.dehydrated : null;
              if (!e2) throw Error(n2(317));
              Tb2(e2, b2);
            } else Ad2(), 0 === (b2.flags & 128) && (b2.memoizedState = null), b2.flags |= 4;
            Q2(b2);
            e2 = false;
          } else null !== rd2 && (Cg2(rd2), rd2 = null), e2 = true;
          if (!e2) return b2.flags & 65536 ? b2 : null;
        }
        if (0 !== (b2.flags & 128)) return b2.lanes = c2, b2;
        c2 = null !== d2;
        c2 !== (null !== a && null !== a.memoizedState) && c2 && (b2.child.flags |= 8192, 0 !== (b2.mode & 1) && (null === a || 0 !== (I2.current & 1) ? 0 === R2 && (R2 = 3) : ng2()));
        null !== b2.updateQueue && (b2.flags |= 4);
        Q2(b2);
        return null;
      case 4:
        return te2(), wg2(a, b2), null === a && Xa2(b2.stateNode.containerInfo), Q2(b2), null;
      case 10:
        return Wd2(b2.type._context), Q2(b2), null;
      case 17:
        return A2(b2.type) && nc2(), Q2(b2), null;
      case 19:
        q2(I2);
        e2 = b2.memoizedState;
        if (null === e2) return Q2(b2), null;
        d2 = 0 !== (b2.flags & 128);
        f2 = e2.rendering;
        if (null === f2) if (d2) Ag2(e2, false);
        else {
          if (0 !== R2 || null !== a && 0 !== (a.flags & 128)) for (a = b2.child; null !== a; ) {
            f2 = we2(a);
            if (null !== f2) {
              b2.flags |= 128;
              Ag2(e2, false);
              a = f2.updateQueue;
              null !== a && (b2.updateQueue = a, b2.flags |= 4);
              b2.subtreeFlags = 0;
              a = c2;
              for (c2 = b2.child; null !== c2; ) d2 = c2, e2 = a, d2.flags &= 14680066, f2 = d2.alternate, null === f2 ? (d2.childLanes = 0, d2.lanes = e2, d2.child = null, d2.subtreeFlags = 0, d2.memoizedProps = null, d2.memoizedState = null, d2.updateQueue = null, d2.dependencies = null, d2.stateNode = null) : (d2.childLanes = f2.childLanes, d2.lanes = f2.lanes, d2.child = f2.child, d2.subtreeFlags = 0, d2.deletions = null, d2.memoizedProps = f2.memoizedProps, d2.memoizedState = f2.memoizedState, d2.updateQueue = f2.updateQueue, d2.type = f2.type, e2 = f2.dependencies, d2.dependencies = null === e2 ? null : { lanes: e2.lanes, firstContext: e2.firstContext }), c2 = c2.sibling;
              v2(I2, I2.current & 1 | 2);
              return b2.child;
            }
            a = a.sibling;
          }
          null !== e2.tail && D2() > Dg2 && (b2.flags |= 128, d2 = true, Ag2(e2, false), b2.lanes = 4194304);
        }
        else {
          if (!d2) if (a = we2(f2), null !== a) {
            if (b2.flags |= 128, d2 = true, a = a.updateQueue, null !== a && (b2.updateQueue = a, b2.flags |= 4), Ag2(e2, true), null === e2.tail && "hidden" === e2.tailMode && !f2.alternate && !F2) return Q2(b2), null;
          } else 2 * D2() - e2.renderingStartTime > Dg2 && 1073741824 !== c2 && (b2.flags |= 128, d2 = true, Ag2(e2, false), b2.lanes = 4194304);
          e2.isBackwards ? (f2.sibling = b2.child, b2.child = f2) : (a = e2.last, null !== a ? a.sibling = f2 : b2.child = f2, e2.last = f2);
        }
        if (null !== e2.tail) return b2 = e2.tail, e2.rendering = b2, e2.tail = b2.sibling, e2.renderingStartTime = D2(), b2.sibling = null, a = I2.current, v2(I2, d2 ? a & 1 | 2 : a & 1), b2;
        Q2(b2);
        return null;
      case 22:
      case 23:
        return Eg2(), c2 = null !== b2.memoizedState, null !== a && null !== a.memoizedState !== c2 && (b2.flags |= 8192), c2 && 0 !== (b2.mode & 1) ? 0 !== ($f2 & 1073741824) && (Q2(b2), Ta2 && b2.subtreeFlags & 6 && (b2.flags |= 8192)) : Q2(b2), null;
      case 24:
        return null;
      case 25:
        return null;
    }
    throw Error(n2(
      156,
      b2.tag
    ));
  }
  function Fg2(a, b2) {
    nd2(b2);
    switch (b2.tag) {
      case 1:
        return A2(b2.type) && nc2(), a = b2.flags, a & 65536 ? (b2.flags = a & -65537 | 128, b2) : null;
      case 3:
        return te2(), q2(z2), q2(x2), ye2(), a = b2.flags, 0 !== (a & 65536) && 0 === (a & 128) ? (b2.flags = a & -65537 | 128, b2) : null;
      case 5:
        return ve2(b2), null;
      case 13:
        q2(I2);
        a = b2.memoizedState;
        if (null !== a && null !== a.dehydrated) {
          if (null === b2.alternate) throw Error(n2(340));
          Ad2();
        }
        a = b2.flags;
        return a & 65536 ? (b2.flags = a & -65537 | 128, b2) : null;
      case 19:
        return q2(I2), null;
      case 4:
        return te2(), null;
      case 10:
        return Wd2(b2.type._context), null;
      case 22:
      case 23:
        return Eg2(), null;
      case 24:
        return null;
      default:
        return null;
    }
  }
  var Gg2 = false, S2 = false, Hg2 = "function" === typeof WeakSet ? WeakSet : Set, T2 = null;
  function Ig2(a, b2) {
    var c2 = a.ref;
    if (null !== c2) if ("function" === typeof c2) try {
      c2(null);
    } catch (d2) {
      U2(a, b2, d2);
    }
    else c2.current = null;
  }
  function Jg2(a, b2, c2) {
    try {
      c2();
    } catch (d2) {
      U2(a, b2, d2);
    }
  }
  var Kg2 = false;
  function Lg2(a, b2) {
    Ha2(a.containerInfo);
    for (T2 = b2; null !== T2; ) if (a = T2, b2 = a.child, 0 !== (a.subtreeFlags & 1028) && null !== b2) b2.return = a, T2 = b2;
    else for (; null !== T2; ) {
      a = T2;
      try {
        var c2 = a.alternate;
        if (0 !== (a.flags & 1024)) switch (a.tag) {
          case 0:
          case 11:
          case 15:
            break;
          case 1:
            if (null !== c2) {
              var d2 = c2.memoizedProps, e2 = c2.memoizedState, f2 = a.stateNode, g2 = f2.getSnapshotBeforeUpdate(a.elementType === a.type ? d2 : xf2(a.type, d2), e2);
              f2.__reactInternalSnapshotBeforeUpdate = g2;
            }
            break;
          case 3:
            Ta2 && xb2(a.stateNode.containerInfo);
            break;
          case 5:
          case 6:
          case 4:
          case 17:
            break;
          default:
            throw Error(n2(163));
        }
      } catch (h2) {
        U2(a, a.return, h2);
      }
      b2 = a.sibling;
      if (null !== b2) {
        b2.return = a.return;
        T2 = b2;
        break;
      }
      T2 = a.return;
    }
    c2 = Kg2;
    Kg2 = false;
    return c2;
  }
  function Mg2(a, b2, c2) {
    var d2 = b2.updateQueue;
    d2 = null !== d2 ? d2.lastEffect : null;
    if (null !== d2) {
      var e2 = d2 = d2.next;
      do {
        if ((e2.tag & a) === a) {
          var f2 = e2.destroy;
          e2.destroy = void 0;
          void 0 !== f2 && Jg2(b2, c2, f2);
        }
        e2 = e2.next;
      } while (e2 !== d2);
    }
  }
  function Ng2(a, b2) {
    b2 = b2.updateQueue;
    b2 = null !== b2 ? b2.lastEffect : null;
    if (null !== b2) {
      var c2 = b2 = b2.next;
      do {
        if ((c2.tag & a) === a) {
          var d2 = c2.create;
          c2.destroy = d2();
        }
        c2 = c2.next;
      } while (c2 !== b2);
    }
  }
  function Og2(a) {
    var b2 = a.ref;
    if (null !== b2) {
      var c2 = a.stateNode;
      switch (a.tag) {
        case 5:
          a = Ea2(c2);
          break;
        default:
          a = c2;
      }
      "function" === typeof b2 ? b2(a) : b2.current = a;
    }
  }
  function Pg2(a) {
    var b2 = a.alternate;
    null !== b2 && (a.alternate = null, Pg2(b2));
    a.child = null;
    a.deletions = null;
    a.sibling = null;
    5 === a.tag && (b2 = a.stateNode, null !== b2 && Za2(b2));
    a.stateNode = null;
    a.return = null;
    a.dependencies = null;
    a.memoizedProps = null;
    a.memoizedState = null;
    a.pendingProps = null;
    a.stateNode = null;
    a.updateQueue = null;
  }
  function Qg2(a) {
    return 5 === a.tag || 3 === a.tag || 4 === a.tag;
  }
  function Rg2(a) {
    a: for (; ; ) {
      for (; null === a.sibling; ) {
        if (null === a.return || Qg2(a.return)) return null;
        a = a.return;
      }
      a.sibling.return = a.return;
      for (a = a.sibling; 5 !== a.tag && 6 !== a.tag && 18 !== a.tag; ) {
        if (a.flags & 2) continue a;
        if (null === a.child || 4 === a.tag) continue a;
        else a.child.return = a, a = a.child;
      }
      if (!(a.flags & 2)) return a.stateNode;
    }
  }
  function Sg2(a, b2, c2) {
    var d2 = a.tag;
    if (5 === d2 || 6 === d2) a = a.stateNode, b2 ? pb2(c2, a, b2) : kb2(c2, a);
    else if (4 !== d2 && (a = a.child, null !== a)) for (Sg2(a, b2, c2), a = a.sibling; null !== a; ) Sg2(a, b2, c2), a = a.sibling;
  }
  function Tg2(a, b2, c2) {
    var d2 = a.tag;
    if (5 === d2 || 6 === d2) a = a.stateNode, b2 ? ob2(c2, a, b2) : jb2(c2, a);
    else if (4 !== d2 && (a = a.child, null !== a)) for (Tg2(a, b2, c2), a = a.sibling; null !== a; ) Tg2(a, b2, c2), a = a.sibling;
  }
  var V2 = null, Ug2 = false;
  function Vg2(a, b2, c2) {
    for (c2 = c2.child; null !== c2; ) Wg2(a, b2, c2), c2 = c2.sibling;
  }
  function Wg2(a, b2, c2) {
    if (Sc2 && "function" === typeof Sc2.onCommitFiberUnmount) try {
      Sc2.onCommitFiberUnmount(Rc2, c2);
    } catch (h2) {
    }
    switch (c2.tag) {
      case 5:
        S2 || Ig2(c2, b2);
      case 6:
        if (Ta2) {
          var d2 = V2, e2 = Ug2;
          V2 = null;
          Vg2(a, b2, c2);
          V2 = d2;
          Ug2 = e2;
          null !== V2 && (Ug2 ? rb2(V2, c2.stateNode) : qb2(V2, c2.stateNode));
        } else Vg2(a, b2, c2);
        break;
      case 18:
        Ta2 && null !== V2 && (Ug2 ? Yb2(V2, c2.stateNode) : Xb2(V2, c2.stateNode));
        break;
      case 4:
        Ta2 ? (d2 = V2, e2 = Ug2, V2 = c2.stateNode.containerInfo, Ug2 = true, Vg2(a, b2, c2), V2 = d2, Ug2 = e2) : (Ua2 && (d2 = c2.stateNode.containerInfo, e2 = zb2(d2), Cb2(d2, e2)), Vg2(a, b2, c2));
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        if (!S2 && (d2 = c2.updateQueue, null !== d2 && (d2 = d2.lastEffect, null !== d2))) {
          e2 = d2 = d2.next;
          do {
            var f2 = e2, g2 = f2.destroy;
            f2 = f2.tag;
            void 0 !== g2 && (0 !== (f2 & 2) ? Jg2(c2, b2, g2) : 0 !== (f2 & 4) && Jg2(c2, b2, g2));
            e2 = e2.next;
          } while (e2 !== d2);
        }
        Vg2(a, b2, c2);
        break;
      case 1:
        if (!S2 && (Ig2(c2, b2), d2 = c2.stateNode, "function" === typeof d2.componentWillUnmount)) try {
          d2.props = c2.memoizedProps, d2.state = c2.memoizedState, d2.componentWillUnmount();
        } catch (h2) {
          U2(c2, b2, h2);
        }
        Vg2(a, b2, c2);
        break;
      case 21:
        Vg2(a, b2, c2);
        break;
      case 22:
        c2.mode & 1 ? (S2 = (d2 = S2) || null !== c2.memoizedState, Vg2(a, b2, c2), S2 = d2) : Vg2(a, b2, c2);
        break;
      default:
        Vg2(
          a,
          b2,
          c2
        );
    }
  }
  function Xg2(a) {
    var b2 = a.updateQueue;
    if (null !== b2) {
      a.updateQueue = null;
      var c2 = a.stateNode;
      null === c2 && (c2 = a.stateNode = new Hg2());
      b2.forEach(function(b3) {
        var d2 = Yg2.bind(null, a, b3);
        c2.has(b3) || (c2.add(b3), b3.then(d2, d2));
      });
    }
  }
  function Zg2(a, b2) {
    var c2 = b2.deletions;
    if (null !== c2) for (var d2 = 0; d2 < c2.length; d2++) {
      var e2 = c2[d2];
      try {
        var f2 = a, g2 = b2;
        if (Ta2) {
          var h2 = g2;
          a: for (; null !== h2; ) {
            switch (h2.tag) {
              case 5:
                V2 = h2.stateNode;
                Ug2 = false;
                break a;
              case 3:
                V2 = h2.stateNode.containerInfo;
                Ug2 = true;
                break a;
              case 4:
                V2 = h2.stateNode.containerInfo;
                Ug2 = true;
                break a;
            }
            h2 = h2.return;
          }
          if (null === V2) throw Error(n2(160));
          Wg2(f2, g2, e2);
          V2 = null;
          Ug2 = false;
        } else Wg2(f2, g2, e2);
        var k2 = e2.alternate;
        null !== k2 && (k2.return = null);
        e2.return = null;
      } catch (l2) {
        U2(e2, b2, l2);
      }
    }
    if (b2.subtreeFlags & 12854) for (b2 = b2.child; null !== b2; ) $g2(b2, a), b2 = b2.sibling;
  }
  function $g2(a, b2) {
    var c2 = a.alternate, d2 = a.flags;
    switch (a.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        Zg2(b2, a);
        ah2(a);
        if (d2 & 4) {
          try {
            Mg2(3, a, a.return), Ng2(3, a);
          } catch (p2) {
            U2(a, a.return, p2);
          }
          try {
            Mg2(5, a, a.return);
          } catch (p2) {
            U2(a, a.return, p2);
          }
        }
        break;
      case 1:
        Zg2(b2, a);
        ah2(a);
        d2 & 512 && null !== c2 && Ig2(c2, c2.return);
        break;
      case 5:
        Zg2(b2, a);
        ah2(a);
        d2 & 512 && null !== c2 && Ig2(c2, c2.return);
        if (Ta2) {
          if (a.flags & 32) {
            var e2 = a.stateNode;
            try {
              sb2(e2);
            } catch (p2) {
              U2(a, a.return, p2);
            }
          }
          if (d2 & 4 && (e2 = a.stateNode, null != e2)) {
            var f2 = a.memoizedProps;
            c2 = null !== c2 ? c2.memoizedProps : f2;
            d2 = a.type;
            b2 = a.updateQueue;
            a.updateQueue = null;
            if (null !== b2) try {
              nb2(e2, b2, d2, c2, f2, a);
            } catch (p2) {
              U2(a, a.return, p2);
            }
          }
        }
        break;
      case 6:
        Zg2(b2, a);
        ah2(a);
        if (d2 & 4 && Ta2) {
          if (null === a.stateNode) throw Error(n2(162));
          e2 = a.stateNode;
          f2 = a.memoizedProps;
          c2 = null !== c2 ? c2.memoizedProps : f2;
          try {
            lb2(e2, c2, f2);
          } catch (p2) {
            U2(a, a.return, p2);
          }
        }
        break;
      case 3:
        Zg2(b2, a);
        ah2(a);
        if (d2 & 4) {
          if (Ta2 && Va2 && null !== c2 && c2.memoizedState.isDehydrated) try {
            Vb2(b2.containerInfo);
          } catch (p2) {
            U2(a, a.return, p2);
          }
          if (Ua2) {
            e2 = b2.containerInfo;
            f2 = b2.pendingChildren;
            try {
              Cb2(e2, f2);
            } catch (p2) {
              U2(a, a.return, p2);
            }
          }
        }
        break;
      case 4:
        Zg2(
          b2,
          a
        );
        ah2(a);
        if (d2 & 4 && Ua2) {
          f2 = a.stateNode;
          e2 = f2.containerInfo;
          f2 = f2.pendingChildren;
          try {
            Cb2(e2, f2);
          } catch (p2) {
            U2(a, a.return, p2);
          }
        }
        break;
      case 13:
        Zg2(b2, a);
        ah2(a);
        e2 = a.child;
        e2.flags & 8192 && (f2 = null !== e2.memoizedState, e2.stateNode.isHidden = f2, !f2 || null !== e2.alternate && null !== e2.alternate.memoizedState || (bh2 = D2()));
        d2 & 4 && Xg2(a);
        break;
      case 22:
        var g2 = null !== c2 && null !== c2.memoizedState;
        a.mode & 1 ? (S2 = (c2 = S2) || g2, Zg2(b2, a), S2 = c2) : Zg2(b2, a);
        ah2(a);
        if (d2 & 8192) {
          c2 = null !== a.memoizedState;
          if ((a.stateNode.isHidden = c2) && !g2 && 0 !== (a.mode & 1)) for (T2 = a, d2 = a.child; null !== d2; ) {
            for (b2 = T2 = d2; null !== T2; ) {
              g2 = T2;
              var h2 = g2.child;
              switch (g2.tag) {
                case 0:
                case 11:
                case 14:
                case 15:
                  Mg2(4, g2, g2.return);
                  break;
                case 1:
                  Ig2(g2, g2.return);
                  var k2 = g2.stateNode;
                  if ("function" === typeof k2.componentWillUnmount) {
                    var l2 = g2, m2 = g2.return;
                    try {
                      var r2 = l2;
                      k2.props = r2.memoizedProps;
                      k2.state = r2.memoizedState;
                      k2.componentWillUnmount();
                    } catch (p2) {
                      U2(l2, m2, p2);
                    }
                  }
                  break;
                case 5:
                  Ig2(g2, g2.return);
                  break;
                case 22:
                  if (null !== g2.memoizedState) {
                    ch2(b2);
                    continue;
                  }
              }
              null !== h2 ? (h2.return = g2, T2 = h2) : ch2(b2);
            }
            d2 = d2.sibling;
          }
          if (Ta2) {
            a: if (d2 = null, Ta2) for (b2 = a; ; ) {
              if (5 === b2.tag) {
                if (null === d2) {
                  d2 = b2;
                  try {
                    e2 = b2.stateNode, c2 ? tb2(e2) : vb2(b2.stateNode, b2.memoizedProps);
                  } catch (p2) {
                    U2(a, a.return, p2);
                  }
                }
              } else if (6 === b2.tag) {
                if (null === d2) try {
                  f2 = b2.stateNode, c2 ? ub2(f2) : wb2(f2, b2.memoizedProps);
                } catch (p2) {
                  U2(a, a.return, p2);
                }
              } else if ((22 !== b2.tag && 23 !== b2.tag || null === b2.memoizedState || b2 === a) && null !== b2.child) {
                b2.child.return = b2;
                b2 = b2.child;
                continue;
              }
              if (b2 === a) break a;
              for (; null === b2.sibling; ) {
                if (null === b2.return || b2.return === a) break a;
                d2 === b2 && (d2 = null);
                b2 = b2.return;
              }
              d2 === b2 && (d2 = null);
              b2.sibling.return = b2.return;
              b2 = b2.sibling;
            }
          }
        }
        break;
      case 19:
        Zg2(b2, a);
        ah2(a);
        d2 & 4 && Xg2(a);
        break;
      case 21:
        break;
      default:
        Zg2(b2, a), ah2(a);
    }
  }
  function ah2(a) {
    var b2 = a.flags;
    if (b2 & 2) {
      try {
        if (Ta2) {
          b: {
            for (var c2 = a.return; null !== c2; ) {
              if (Qg2(c2)) {
                var d2 = c2;
                break b;
              }
              c2 = c2.return;
            }
            throw Error(n2(160));
          }
          switch (d2.tag) {
            case 5:
              var e2 = d2.stateNode;
              d2.flags & 32 && (sb2(e2), d2.flags &= -33);
              var f2 = Rg2(a);
              Tg2(a, f2, e2);
              break;
            case 3:
            case 4:
              var g2 = d2.stateNode.containerInfo, h2 = Rg2(a);
              Sg2(a, h2, g2);
              break;
            default:
              throw Error(n2(161));
          }
        }
      } catch (k2) {
        U2(a, a.return, k2);
      }
      a.flags &= -3;
    }
    b2 & 4096 && (a.flags &= -4097);
  }
  function dh2(a, b2, c2) {
    T2 = a;
    eh2(a);
  }
  function eh2(a, b2, c2) {
    for (var d2 = 0 !== (a.mode & 1); null !== T2; ) {
      var e2 = T2, f2 = e2.child;
      if (22 === e2.tag && d2) {
        var g2 = null !== e2.memoizedState || Gg2;
        if (!g2) {
          var h2 = e2.alternate, k2 = null !== h2 && null !== h2.memoizedState || S2;
          h2 = Gg2;
          var l2 = S2;
          Gg2 = g2;
          if ((S2 = k2) && !l2) for (T2 = e2; null !== T2; ) g2 = T2, k2 = g2.child, 22 === g2.tag && null !== g2.memoizedState ? fh2(e2) : null !== k2 ? (k2.return = g2, T2 = k2) : fh2(e2);
          for (; null !== f2; ) T2 = f2, eh2(f2), f2 = f2.sibling;
          T2 = e2;
          Gg2 = h2;
          S2 = l2;
        }
        gh2(a);
      } else 0 !== (e2.subtreeFlags & 8772) && null !== f2 ? (f2.return = e2, T2 = f2) : gh2(a);
    }
  }
  function gh2(a) {
    for (; null !== T2; ) {
      var b2 = T2;
      if (0 !== (b2.flags & 8772)) {
        var c2 = b2.alternate;
        try {
          if (0 !== (b2.flags & 8772)) switch (b2.tag) {
            case 0:
            case 11:
            case 15:
              S2 || Ng2(5, b2);
              break;
            case 1:
              var d2 = b2.stateNode;
              if (b2.flags & 4 && !S2) if (null === c2) d2.componentDidMount();
              else {
                var e2 = b2.elementType === b2.type ? c2.memoizedProps : xf2(b2.type, c2.memoizedProps);
                d2.componentDidUpdate(e2, c2.memoizedState, d2.__reactInternalSnapshotBeforeUpdate);
              }
              var f2 = b2.updateQueue;
              null !== f2 && me2(b2, f2, d2);
              break;
            case 3:
              var g2 = b2.updateQueue;
              if (null !== g2) {
                c2 = null;
                if (null !== b2.child) switch (b2.child.tag) {
                  case 5:
                    c2 = Ea2(b2.child.stateNode);
                    break;
                  case 1:
                    c2 = b2.child.stateNode;
                }
                me2(b2, g2, c2);
              }
              break;
            case 5:
              var h2 = b2.stateNode;
              null === c2 && b2.flags & 4 && mb2(h2, b2.type, b2.memoizedProps, b2);
              break;
            case 6:
              break;
            case 4:
              break;
            case 12:
              break;
            case 13:
              if (Va2 && null === b2.memoizedState) {
                var k2 = b2.alternate;
                if (null !== k2) {
                  var l2 = k2.memoizedState;
                  if (null !== l2) {
                    var m2 = l2.dehydrated;
                    null !== m2 && Wb2(m2);
                  }
                }
              }
              break;
            case 19:
            case 17:
            case 21:
            case 22:
            case 23:
            case 25:
              break;
            default:
              throw Error(n2(163));
          }
          S2 || b2.flags & 512 && Og2(b2);
        } catch (r2) {
          U2(b2, b2.return, r2);
        }
      }
      if (b2 === a) {
        T2 = null;
        break;
      }
      c2 = b2.sibling;
      if (null !== c2) {
        c2.return = b2.return;
        T2 = c2;
        break;
      }
      T2 = b2.return;
    }
  }
  function ch2(a) {
    for (; null !== T2; ) {
      var b2 = T2;
      if (b2 === a) {
        T2 = null;
        break;
      }
      var c2 = b2.sibling;
      if (null !== c2) {
        c2.return = b2.return;
        T2 = c2;
        break;
      }
      T2 = b2.return;
    }
  }
  function fh2(a) {
    for (; null !== T2; ) {
      var b2 = T2;
      try {
        switch (b2.tag) {
          case 0:
          case 11:
          case 15:
            var c2 = b2.return;
            try {
              Ng2(4, b2);
            } catch (k2) {
              U2(b2, c2, k2);
            }
            break;
          case 1:
            var d2 = b2.stateNode;
            if ("function" === typeof d2.componentDidMount) {
              var e2 = b2.return;
              try {
                d2.componentDidMount();
              } catch (k2) {
                U2(b2, e2, k2);
              }
            }
            var f2 = b2.return;
            try {
              Og2(b2);
            } catch (k2) {
              U2(b2, f2, k2);
            }
            break;
          case 5:
            var g2 = b2.return;
            try {
              Og2(b2);
            } catch (k2) {
              U2(b2, g2, k2);
            }
        }
      } catch (k2) {
        U2(b2, b2.return, k2);
      }
      if (b2 === a) {
        T2 = null;
        break;
      }
      var h2 = b2.sibling;
      if (null !== h2) {
        h2.return = b2.return;
        T2 = h2;
        break;
      }
      T2 = b2.return;
    }
  }
  var hh2 = 0, ih2 = 1, jh2 = 2, kh2 = 3, lh2 = 4;
  if ("function" === typeof Symbol && Symbol.for) {
    var mh2 = Symbol.for;
    hh2 = mh2("selector.component");
    ih2 = mh2("selector.has_pseudo_class");
    jh2 = mh2("selector.role");
    kh2 = mh2("selector.test_id");
    lh2 = mh2("selector.text");
  }
  function nh2(a) {
    var b2 = Wa2(a);
    if (null != b2) {
      if ("string" !== typeof b2.memoizedProps["data-testname"]) throw Error(n2(364));
      return b2;
    }
    a = cb2(a);
    if (null === a) throw Error(n2(362));
    return a.stateNode.current;
  }
  function oh2(a, b2) {
    switch (b2.$$typeof) {
      case hh2:
        if (a.type === b2.value) return true;
        break;
      case ih2:
        a: {
          b2 = b2.value;
          a = [a, 0];
          for (var c2 = 0; c2 < a.length; ) {
            var d2 = a[c2++], e2 = a[c2++], f2 = b2[e2];
            if (5 !== d2.tag || !fb2(d2)) {
              for (; null != f2 && oh2(d2, f2); ) e2++, f2 = b2[e2];
              if (e2 === b2.length) {
                b2 = true;
                break a;
              } else for (d2 = d2.child; null !== d2; ) a.push(d2, e2), d2 = d2.sibling;
            }
          }
          b2 = false;
        }
        return b2;
      case jh2:
        if (5 === a.tag && gb2(a.stateNode, b2.value)) return true;
        break;
      case lh2:
        if (5 === a.tag || 6 === a.tag) {
          if (a = eb2(a), null !== a && 0 <= a.indexOf(b2.value)) return true;
        }
        break;
      case kh2:
        if (5 === a.tag && (a = a.memoizedProps["data-testname"], "string" === typeof a && a.toLowerCase() === b2.value.toLowerCase())) return true;
        break;
      default:
        throw Error(n2(365));
    }
    return false;
  }
  function ph2(a) {
    switch (a.$$typeof) {
      case hh2:
        return "<" + (ua2(a.value) || "Unknown") + ">";
      case ih2:
        return ":has(" + (ph2(a) || "") + ")";
      case jh2:
        return '[role="' + a.value + '"]';
      case lh2:
        return '"' + a.value + '"';
      case kh2:
        return '[data-testname="' + a.value + '"]';
      default:
        throw Error(n2(365));
    }
  }
  function qh2(a, b2) {
    var c2 = [];
    a = [a, 0];
    for (var d2 = 0; d2 < a.length; ) {
      var e2 = a[d2++], f2 = a[d2++], g2 = b2[f2];
      if (5 !== e2.tag || !fb2(e2)) {
        for (; null != g2 && oh2(e2, g2); ) f2++, g2 = b2[f2];
        if (f2 === b2.length) c2.push(e2);
        else for (e2 = e2.child; null !== e2; ) a.push(e2, f2), e2 = e2.sibling;
      }
    }
    return c2;
  }
  function rh2(a, b2) {
    if (!bb2) throw Error(n2(363));
    a = nh2(a);
    a = qh2(a, b2);
    b2 = [];
    a = Array.from(a);
    for (var c2 = 0; c2 < a.length; ) {
      var d2 = a[c2++];
      if (5 === d2.tag) fb2(d2) || b2.push(d2.stateNode);
      else for (d2 = d2.child; null !== d2; ) a.push(d2), d2 = d2.sibling;
    }
    return b2;
  }
  var sh2 = Math.ceil, th2 = da2.ReactCurrentDispatcher, uh2 = da2.ReactCurrentOwner, W2 = da2.ReactCurrentBatchConfig, H2 = 0, N2 = null, X2 = null, Z2 = 0, $f2 = 0, Zf2 = ic2(0), R2 = 0, vh2 = null, le2 = 0, wh2 = 0, xh2 = 0, yh2 = null, zh2 = null, bh2 = 0, Dg2 = Infinity, Ah2 = null;
  function Bh2() {
    Dg2 = D2() + 500;
  }
  var Jf2 = false, Kf2 = null, Mf2 = null, Ch2 = false, Dh2 = null, Eh2 = 0, Fh2 = 0, Gh2 = null, Hh2 = -1, Ih2 = 0;
  function O2() {
    return 0 !== (H2 & 6) ? D2() : -1 !== Hh2 ? Hh2 : Hh2 = D2();
  }
  function tf2(a) {
    if (0 === (a.mode & 1)) return 1;
    if (0 !== (H2 & 2) && 0 !== Z2) return Z2 & -Z2;
    if (null !== Cd2.transition) return 0 === Ih2 && (Ih2 = Dc2()), Ih2;
    a = C2;
    return 0 !== a ? a : Ya2();
  }
  function af2(a, b2, c2, d2) {
    if (50 < Fh2) throw Fh2 = 0, Gh2 = null, Error(n2(185));
    Fc2(a, c2, d2);
    if (0 === (H2 & 2) || a !== N2) a === N2 && (0 === (H2 & 2) && (wh2 |= c2), 4 === R2 && Jh2(a, Z2)), Kh2(a, d2), 1 === c2 && 0 === H2 && 0 === (b2.mode & 1) && (Bh2(), Xc2 && ad2());
  }
  function Kh2(a, b2) {
    var c2 = a.callbackNode;
    Bc2(a, b2);
    var d2 = zc2(a, a === N2 ? Z2 : 0);
    if (0 === d2) null !== c2 && Kc2(c2), a.callbackNode = null, a.callbackPriority = 0;
    else if (b2 = d2 & -d2, a.callbackPriority !== b2) {
      null != c2 && Kc2(c2);
      if (1 === b2) 0 === a.tag ? $c2(Lh2.bind(null, a)) : Zc2(Lh2.bind(null, a)), $a ? ab2(function() {
        0 === (H2 & 6) && ad2();
      }) : Jc2(Nc2, ad2), c2 = null;
      else {
        switch (Ic2(d2)) {
          case 1:
            c2 = Nc2;
            break;
          case 4:
            c2 = Oc2;
            break;
          case 16:
            c2 = Pc2;
            break;
          case 536870912:
            c2 = Qc2;
            break;
          default:
            c2 = Pc2;
        }
        c2 = Mh2(c2, Nh2.bind(null, a));
      }
      a.callbackPriority = b2;
      a.callbackNode = c2;
    }
  }
  function Nh2(a, b2) {
    Hh2 = -1;
    Ih2 = 0;
    if (0 !== (H2 & 6)) throw Error(n2(327));
    var c2 = a.callbackNode;
    if (Oh2() && a.callbackNode !== c2) return null;
    var d2 = zc2(a, a === N2 ? Z2 : 0);
    if (0 === d2) return null;
    if (0 !== (d2 & 30) || 0 !== (d2 & a.expiredLanes) || b2) b2 = Ph2(a, d2);
    else {
      b2 = d2;
      var e2 = H2;
      H2 |= 2;
      var f2 = Qh2();
      if (N2 !== a || Z2 !== b2) Ah2 = null, Bh2(), Rh2(a, b2);
      do
        try {
          Sh2();
          break;
        } catch (h2) {
          Th2(a, h2);
        }
      while (1);
      Ud2();
      th2.current = f2;
      H2 = e2;
      null !== X2 ? b2 = 0 : (N2 = null, Z2 = 0, b2 = R2);
    }
    if (0 !== b2) {
      2 === b2 && (e2 = Cc2(a), 0 !== e2 && (d2 = e2, b2 = Uh2(a, e2)));
      if (1 === b2) throw c2 = vh2, Rh2(a, 0), Jh2(a, d2), Kh2(a, D2()), c2;
      if (6 === b2) Jh2(a, d2);
      else {
        e2 = a.current.alternate;
        if (0 === (d2 & 30) && !Vh2(e2) && (b2 = Ph2(a, d2), 2 === b2 && (f2 = Cc2(a), 0 !== f2 && (d2 = f2, b2 = Uh2(a, f2))), 1 === b2)) throw c2 = vh2, Rh2(a, 0), Jh2(a, d2), Kh2(a, D2()), c2;
        a.finishedWork = e2;
        a.finishedLanes = d2;
        switch (b2) {
          case 0:
          case 1:
            throw Error(n2(345));
          case 2:
            Wh2(a, zh2, Ah2);
            break;
          case 3:
            Jh2(a, d2);
            if ((d2 & 130023424) === d2 && (b2 = bh2 + 500 - D2(), 10 < b2)) {
              if (0 !== zc2(a, 0)) break;
              e2 = a.suspendedLanes;
              if ((e2 & d2) !== d2) {
                O2();
                a.pingedLanes |= a.suspendedLanes & e2;
                break;
              }
              a.timeoutHandle = Pa2(Wh2.bind(null, a, zh2, Ah2), b2);
              break;
            }
            Wh2(a, zh2, Ah2);
            break;
          case 4:
            Jh2(a, d2);
            if ((d2 & 4194240) === d2) break;
            b2 = a.eventTimes;
            for (e2 = -1; 0 < d2; ) {
              var g2 = 31 - tc2(d2);
              f2 = 1 << g2;
              g2 = b2[g2];
              g2 > e2 && (e2 = g2);
              d2 &= ~f2;
            }
            d2 = e2;
            d2 = D2() - d2;
            d2 = (120 > d2 ? 120 : 480 > d2 ? 480 : 1080 > d2 ? 1080 : 1920 > d2 ? 1920 : 3e3 > d2 ? 3e3 : 4320 > d2 ? 4320 : 1960 * sh2(d2 / 1960)) - d2;
            if (10 < d2) {
              a.timeoutHandle = Pa2(Wh2.bind(null, a, zh2, Ah2), d2);
              break;
            }
            Wh2(a, zh2, Ah2);
            break;
          case 5:
            Wh2(a, zh2, Ah2);
            break;
          default:
            throw Error(n2(329));
        }
      }
    }
    Kh2(a, D2());
    return a.callbackNode === c2 ? Nh2.bind(null, a) : null;
  }
  function Uh2(a, b2) {
    var c2 = yh2;
    a.current.memoizedState.isDehydrated && (Rh2(a, b2).flags |= 256);
    a = Ph2(a, b2);
    2 !== a && (b2 = zh2, zh2 = c2, null !== b2 && Cg2(b2));
    return a;
  }
  function Cg2(a) {
    null === zh2 ? zh2 = a : zh2.push.apply(zh2, a);
  }
  function Vh2(a) {
    for (var b2 = a; ; ) {
      if (b2.flags & 16384) {
        var c2 = b2.updateQueue;
        if (null !== c2 && (c2 = c2.stores, null !== c2)) for (var d2 = 0; d2 < c2.length; d2++) {
          var e2 = c2[d2], f2 = e2.getSnapshot;
          e2 = e2.value;
          try {
            if (!Vc2(f2(), e2)) return false;
          } catch (g2) {
            return false;
          }
        }
      }
      c2 = b2.child;
      if (b2.subtreeFlags & 16384 && null !== c2) c2.return = b2, b2 = c2;
      else {
        if (b2 === a) break;
        for (; null === b2.sibling; ) {
          if (null === b2.return || b2.return === a) return true;
          b2 = b2.return;
        }
        b2.sibling.return = b2.return;
        b2 = b2.sibling;
      }
    }
    return true;
  }
  function Jh2(a, b2) {
    b2 &= ~xh2;
    b2 &= ~wh2;
    a.suspendedLanes |= b2;
    a.pingedLanes &= ~b2;
    for (a = a.expirationTimes; 0 < b2; ) {
      var c2 = 31 - tc2(b2), d2 = 1 << c2;
      a[c2] = -1;
      b2 &= ~d2;
    }
  }
  function Lh2(a) {
    if (0 !== (H2 & 6)) throw Error(n2(327));
    Oh2();
    var b2 = zc2(a, 0);
    if (0 === (b2 & 1)) return Kh2(a, D2()), null;
    var c2 = Ph2(a, b2);
    if (0 !== a.tag && 2 === c2) {
      var d2 = Cc2(a);
      0 !== d2 && (b2 = d2, c2 = Uh2(a, d2));
    }
    if (1 === c2) throw c2 = vh2, Rh2(a, 0), Jh2(a, b2), Kh2(a, D2()), c2;
    if (6 === c2) throw Error(n2(345));
    a.finishedWork = a.current.alternate;
    a.finishedLanes = b2;
    Wh2(a, zh2, Ah2);
    Kh2(a, D2());
    return null;
  }
  function Xh2(a) {
    null !== Dh2 && 0 === Dh2.tag && 0 === (H2 & 6) && Oh2();
    var b2 = H2;
    H2 |= 1;
    var c2 = W2.transition, d2 = C2;
    try {
      if (W2.transition = null, C2 = 1, a) return a();
    } finally {
      C2 = d2, W2.transition = c2, H2 = b2, 0 === (H2 & 6) && ad2();
    }
  }
  function Eg2() {
    $f2 = Zf2.current;
    q2(Zf2);
  }
  function Rh2(a, b2) {
    a.finishedWork = null;
    a.finishedLanes = 0;
    var c2 = a.timeoutHandle;
    c2 !== Ra2 && (a.timeoutHandle = Ra2, Qa2(c2));
    if (null !== X2) for (c2 = X2.return; null !== c2; ) {
      var d2 = c2;
      nd2(d2);
      switch (d2.tag) {
        case 1:
          d2 = d2.type.childContextTypes;
          null !== d2 && void 0 !== d2 && nc2();
          break;
        case 3:
          te2();
          q2(z2);
          q2(x2);
          ye2();
          break;
        case 5:
          ve2(d2);
          break;
        case 4:
          te2();
          break;
        case 13:
          q2(I2);
          break;
        case 19:
          q2(I2);
          break;
        case 10:
          Wd2(d2.type._context);
          break;
        case 22:
        case 23:
          Eg2();
      }
      c2 = c2.return;
    }
    N2 = a;
    X2 = a = Jd2(a.current, null);
    Z2 = $f2 = b2;
    R2 = 0;
    vh2 = null;
    xh2 = wh2 = le2 = 0;
    zh2 = yh2 = null;
    if (null !== $d2) {
      for (b2 = 0; b2 < $d2.length; b2++) if (c2 = $d2[b2], d2 = c2.interleaved, null !== d2) {
        c2.interleaved = null;
        var e2 = d2.next, f2 = c2.pending;
        if (null !== f2) {
          var g2 = f2.next;
          f2.next = e2;
          d2.next = g2;
        }
        c2.pending = d2;
      }
      $d2 = null;
    }
    return a;
  }
  function Th2(a, b2) {
    do {
      var c2 = X2;
      try {
        Ud2();
        ze2.current = Le2;
        if (Ce2) {
          for (var d2 = J2.memoizedState; null !== d2; ) {
            var e2 = d2.queue;
            null !== e2 && (e2.pending = null);
            d2 = d2.next;
          }
          Ce2 = false;
        }
        Be2 = 0;
        L2 = K2 = J2 = null;
        De2 = false;
        Ee2 = 0;
        uh2.current = null;
        if (null === c2 || null === c2.return) {
          R2 = 1;
          vh2 = b2;
          X2 = null;
          break;
        }
        a: {
          var f2 = a, g2 = c2.return, h2 = c2, k2 = b2;
          b2 = Z2;
          h2.flags |= 32768;
          if (null !== k2 && "object" === typeof k2 && "function" === typeof k2.then) {
            var l2 = k2, m2 = h2, r2 = m2.tag;
            if (0 === (m2.mode & 1) && (0 === r2 || 11 === r2 || 15 === r2)) {
              var p2 = m2.alternate;
              p2 ? (m2.updateQueue = p2.updateQueue, m2.memoizedState = p2.memoizedState, m2.lanes = p2.lanes) : (m2.updateQueue = null, m2.memoizedState = null);
            }
            var B2 = Pf2(g2);
            if (null !== B2) {
              B2.flags &= -257;
              Qf2(B2, g2, h2, f2, b2);
              B2.mode & 1 && Nf2(f2, l2, b2);
              b2 = B2;
              k2 = l2;
              var w2 = b2.updateQueue;
              if (null === w2) {
                var Y2 = /* @__PURE__ */ new Set();
                Y2.add(k2);
                b2.updateQueue = Y2;
              } else w2.add(k2);
              break a;
            } else {
              if (0 === (b2 & 1)) {
                Nf2(f2, l2, b2);
                ng2();
                break a;
              }
              k2 = Error(n2(426));
            }
          } else if (F2 && h2.mode & 1) {
            var ya2 = Pf2(g2);
            if (null !== ya2) {
              0 === (ya2.flags & 65536) && (ya2.flags |= 256);
              Qf2(ya2, g2, h2, f2, b2);
              Bd2(Ef2(k2, h2));
              break a;
            }
          }
          f2 = k2 = Ef2(k2, h2);
          4 !== R2 && (R2 = 2);
          null === yh2 ? yh2 = [f2] : yh2.push(f2);
          f2 = g2;
          do {
            switch (f2.tag) {
              case 3:
                f2.flags |= 65536;
                b2 &= -b2;
                f2.lanes |= b2;
                var E2 = If2(f2, k2, b2);
                je2(f2, E2);
                break a;
              case 1:
                h2 = k2;
                var u2 = f2.type, t2 = f2.stateNode;
                if (0 === (f2.flags & 128) && ("function" === typeof u2.getDerivedStateFromError || null !== t2 && "function" === typeof t2.componentDidCatch && (null === Mf2 || !Mf2.has(t2)))) {
                  f2.flags |= 65536;
                  b2 &= -b2;
                  f2.lanes |= b2;
                  var Db2 = Lf2(f2, h2, b2);
                  je2(f2, Db2);
                  break a;
                }
            }
            f2 = f2.return;
          } while (null !== f2);
        }
        Yh2(c2);
      } catch (lc2) {
        b2 = lc2;
        X2 === c2 && null !== c2 && (X2 = c2 = c2.return);
        continue;
      }
      break;
    } while (1);
  }
  function Qh2() {
    var a = th2.current;
    th2.current = Le2;
    return null === a ? Le2 : a;
  }
  function ng2() {
    if (0 === R2 || 3 === R2 || 2 === R2) R2 = 4;
    null === N2 || 0 === (le2 & 268435455) && 0 === (wh2 & 268435455) || Jh2(N2, Z2);
  }
  function Ph2(a, b2) {
    var c2 = H2;
    H2 |= 2;
    var d2 = Qh2();
    if (N2 !== a || Z2 !== b2) Ah2 = null, Rh2(a, b2);
    do
      try {
        Zh2();
        break;
      } catch (e2) {
        Th2(a, e2);
      }
    while (1);
    Ud2();
    H2 = c2;
    th2.current = d2;
    if (null !== X2) throw Error(n2(261));
    N2 = null;
    Z2 = 0;
    return R2;
  }
  function Zh2() {
    for (; null !== X2; ) $h2(X2);
  }
  function Sh2() {
    for (; null !== X2 && !Lc2(); ) $h2(X2);
  }
  function $h2(a) {
    var b2 = ai2(a.alternate, a, $f2);
    a.memoizedProps = a.pendingProps;
    null === b2 ? Yh2(a) : X2 = b2;
    uh2.current = null;
  }
  function Yh2(a) {
    var b2 = a;
    do {
      var c2 = b2.alternate;
      a = b2.return;
      if (0 === (b2.flags & 32768)) {
        if (c2 = Bg2(c2, b2, $f2), null !== c2) {
          X2 = c2;
          return;
        }
      } else {
        c2 = Fg2(c2, b2);
        if (null !== c2) {
          c2.flags &= 32767;
          X2 = c2;
          return;
        }
        if (null !== a) a.flags |= 32768, a.subtreeFlags = 0, a.deletions = null;
        else {
          R2 = 6;
          X2 = null;
          return;
        }
      }
      b2 = b2.sibling;
      if (null !== b2) {
        X2 = b2;
        return;
      }
      X2 = b2 = a;
    } while (null !== b2);
    0 === R2 && (R2 = 5);
  }
  function Wh2(a, b2, c2) {
    var d2 = C2, e2 = W2.transition;
    try {
      W2.transition = null, C2 = 1, bi2(a, b2, c2, d2);
    } finally {
      W2.transition = e2, C2 = d2;
    }
    return null;
  }
  function bi2(a, b2, c2, d2) {
    do
      Oh2();
    while (null !== Dh2);
    if (0 !== (H2 & 6)) throw Error(n2(327));
    c2 = a.finishedWork;
    var e2 = a.finishedLanes;
    if (null === c2) return null;
    a.finishedWork = null;
    a.finishedLanes = 0;
    if (c2 === a.current) throw Error(n2(177));
    a.callbackNode = null;
    a.callbackPriority = 0;
    var f2 = c2.lanes | c2.childLanes;
    Gc2(a, f2);
    a === N2 && (X2 = N2 = null, Z2 = 0);
    0 === (c2.subtreeFlags & 2064) && 0 === (c2.flags & 2064) || Ch2 || (Ch2 = true, Mh2(Pc2, function() {
      Oh2();
      return null;
    }));
    f2 = 0 !== (c2.flags & 15990);
    if (0 !== (c2.subtreeFlags & 15990) || f2) {
      f2 = W2.transition;
      W2.transition = null;
      var g2 = C2;
      C2 = 1;
      var h2 = H2;
      H2 |= 4;
      uh2.current = null;
      Lg2(a, c2);
      $g2(c2, a);
      Ia2(a.containerInfo);
      a.current = c2;
      dh2(c2);
      Mc2();
      H2 = h2;
      C2 = g2;
      W2.transition = f2;
    } else a.current = c2;
    Ch2 && (Ch2 = false, Dh2 = a, Eh2 = e2);
    f2 = a.pendingLanes;
    0 === f2 && (Mf2 = null);
    Tc2(c2.stateNode);
    Kh2(a, D2());
    if (null !== b2) for (d2 = a.onRecoverableError, c2 = 0; c2 < b2.length; c2++) e2 = b2[c2], d2(e2.value, { componentStack: e2.stack, digest: e2.digest });
    if (Jf2) throw Jf2 = false, a = Kf2, Kf2 = null, a;
    0 !== (Eh2 & 1) && 0 !== a.tag && Oh2();
    f2 = a.pendingLanes;
    0 !== (f2 & 1) ? a === Gh2 ? Fh2++ : (Fh2 = 0, Gh2 = a) : Fh2 = 0;
    ad2();
    return null;
  }
  function Oh2() {
    if (null !== Dh2) {
      var a = Ic2(Eh2), b2 = W2.transition, c2 = C2;
      try {
        W2.transition = null;
        C2 = 16 > a ? 16 : a;
        if (null === Dh2) var d2 = false;
        else {
          a = Dh2;
          Dh2 = null;
          Eh2 = 0;
          if (0 !== (H2 & 6)) throw Error(n2(331));
          var e2 = H2;
          H2 |= 4;
          for (T2 = a.current; null !== T2; ) {
            var f2 = T2, g2 = f2.child;
            if (0 !== (T2.flags & 16)) {
              var h2 = f2.deletions;
              if (null !== h2) {
                for (var k2 = 0; k2 < h2.length; k2++) {
                  var l2 = h2[k2];
                  for (T2 = l2; null !== T2; ) {
                    var m2 = T2;
                    switch (m2.tag) {
                      case 0:
                      case 11:
                      case 15:
                        Mg2(8, m2, f2);
                    }
                    var r2 = m2.child;
                    if (null !== r2) r2.return = m2, T2 = r2;
                    else for (; null !== T2; ) {
                      m2 = T2;
                      var p2 = m2.sibling, B2 = m2.return;
                      Pg2(m2);
                      if (m2 === l2) {
                        T2 = null;
                        break;
                      }
                      if (null !== p2) {
                        p2.return = B2;
                        T2 = p2;
                        break;
                      }
                      T2 = B2;
                    }
                  }
                }
                var w2 = f2.alternate;
                if (null !== w2) {
                  var Y2 = w2.child;
                  if (null !== Y2) {
                    w2.child = null;
                    do {
                      var ya2 = Y2.sibling;
                      Y2.sibling = null;
                      Y2 = ya2;
                    } while (null !== Y2);
                  }
                }
                T2 = f2;
              }
            }
            if (0 !== (f2.subtreeFlags & 2064) && null !== g2) g2.return = f2, T2 = g2;
            else b: for (; null !== T2; ) {
              f2 = T2;
              if (0 !== (f2.flags & 2048)) switch (f2.tag) {
                case 0:
                case 11:
                case 15:
                  Mg2(9, f2, f2.return);
              }
              var E2 = f2.sibling;
              if (null !== E2) {
                E2.return = f2.return;
                T2 = E2;
                break b;
              }
              T2 = f2.return;
            }
          }
          var u2 = a.current;
          for (T2 = u2; null !== T2; ) {
            g2 = T2;
            var t2 = g2.child;
            if (0 !== (g2.subtreeFlags & 2064) && null !== t2) t2.return = g2, T2 = t2;
            else b: for (g2 = u2; null !== T2; ) {
              h2 = T2;
              if (0 !== (h2.flags & 2048)) try {
                switch (h2.tag) {
                  case 0:
                  case 11:
                  case 15:
                    Ng2(9, h2);
                }
              } catch (lc2) {
                U2(h2, h2.return, lc2);
              }
              if (h2 === g2) {
                T2 = null;
                break b;
              }
              var Db2 = h2.sibling;
              if (null !== Db2) {
                Db2.return = h2.return;
                T2 = Db2;
                break b;
              }
              T2 = h2.return;
            }
          }
          H2 = e2;
          ad2();
          if (Sc2 && "function" === typeof Sc2.onPostCommitFiberRoot) try {
            Sc2.onPostCommitFiberRoot(Rc2, a);
          } catch (lc2) {
          }
          d2 = true;
        }
        return d2;
      } finally {
        C2 = c2, W2.transition = b2;
      }
    }
    return false;
  }
  function ci2(a, b2, c2) {
    b2 = Ef2(c2, b2);
    b2 = If2(a, b2, 1);
    a = he2(a, b2, 1);
    b2 = O2();
    null !== a && (Fc2(a, 1, b2), Kh2(a, b2));
  }
  function U2(a, b2, c2) {
    if (3 === a.tag) ci2(a, a, c2);
    else for (; null !== b2; ) {
      if (3 === b2.tag) {
        ci2(b2, a, c2);
        break;
      } else if (1 === b2.tag) {
        var d2 = b2.stateNode;
        if ("function" === typeof b2.type.getDerivedStateFromError || "function" === typeof d2.componentDidCatch && (null === Mf2 || !Mf2.has(d2))) {
          a = Ef2(c2, a);
          a = Lf2(b2, a, 1);
          b2 = he2(b2, a, 1);
          a = O2();
          null !== b2 && (Fc2(b2, 1, a), Kh2(b2, a));
          break;
        }
      }
      b2 = b2.return;
    }
  }
  function Of2(a, b2, c2) {
    var d2 = a.pingCache;
    null !== d2 && d2.delete(b2);
    b2 = O2();
    a.pingedLanes |= a.suspendedLanes & c2;
    N2 === a && (Z2 & c2) === c2 && (4 === R2 || 3 === R2 && (Z2 & 130023424) === Z2 && 500 > D2() - bh2 ? Rh2(a, 0) : xh2 |= c2);
    Kh2(a, b2);
  }
  function di2(a, b2) {
    0 === b2 && (0 === (a.mode & 1) ? b2 = 1 : (b2 = xc2, xc2 <<= 1, 0 === (xc2 & 130023424) && (xc2 = 4194304)));
    var c2 = O2();
    a = ce2(a, b2);
    null !== a && (Fc2(a, b2, c2), Kh2(a, c2));
  }
  function og2(a) {
    var b2 = a.memoizedState, c2 = 0;
    null !== b2 && (c2 = b2.retryLane);
    di2(a, c2);
  }
  function Yg2(a, b2) {
    var c2 = 0;
    switch (a.tag) {
      case 13:
        var d2 = a.stateNode;
        var e2 = a.memoizedState;
        null !== e2 && (c2 = e2.retryLane);
        break;
      case 19:
        d2 = a.stateNode;
        break;
      default:
        throw Error(n2(314));
    }
    null !== d2 && d2.delete(b2);
    di2(a, c2);
  }
  var ai2;
  ai2 = function(a, b2, c2) {
    if (null !== a) if (a.memoizedProps !== b2.pendingProps || z2.current) G2 = true;
    else {
      if (0 === (a.lanes & c2) && 0 === (b2.flags & 128)) return G2 = false, sg2(a, b2, c2);
      G2 = 0 !== (a.flags & 131072) ? true : false;
    }
    else G2 = false, F2 && 0 !== (b2.flags & 1048576) && ld2(b2, ed2, b2.index);
    b2.lanes = 0;
    switch (b2.tag) {
      case 2:
        var d2 = b2.type;
        cg2(a, b2);
        a = b2.pendingProps;
        var e2 = mc2(b2, x2.current);
        Yd2(b2, c2);
        e2 = He2(null, b2, d2, a, e2, c2);
        var f2 = Me2();
        b2.flags |= 1;
        "object" === typeof e2 && null !== e2 && "function" === typeof e2.render && void 0 === e2.$$typeof ? (b2.tag = 1, b2.memoizedState = null, b2.updateQueue = null, A2(d2) ? (f2 = true, qc2(b2)) : f2 = false, b2.memoizedState = null !== e2.state && void 0 !== e2.state ? e2.state : null, ee2(b2), e2.updater = zf2, b2.stateNode = e2, e2._reactInternals = b2, Df2(b2, d2, a, c2), b2 = dg2(null, b2, d2, true, f2, c2)) : (b2.tag = 0, F2 && f2 && md2(b2), P2(null, b2, e2, c2), b2 = b2.child);
        return b2;
      case 16:
        d2 = b2.elementType;
        a: {
          cg2(a, b2);
          a = b2.pendingProps;
          e2 = d2._init;
          d2 = e2(d2._payload);
          b2.type = d2;
          e2 = b2.tag = ei2(d2);
          a = xf2(d2, a);
          switch (e2) {
            case 0:
              b2 = Xf2(null, b2, d2, a, c2);
              break a;
            case 1:
              b2 = bg2(null, b2, d2, a, c2);
              break a;
            case 11:
              b2 = Sf2(null, b2, d2, a, c2);
              break a;
            case 14:
              b2 = Uf2(null, b2, d2, xf2(d2.type, a), c2);
              break a;
          }
          throw Error(n2(
            306,
            d2,
            ""
          ));
        }
        return b2;
      case 0:
        return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : xf2(d2, e2), Xf2(a, b2, d2, e2, c2);
      case 1:
        return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : xf2(d2, e2), bg2(a, b2, d2, e2, c2);
      case 3:
        a: {
          eg2(b2);
          if (null === a) throw Error(n2(387));
          d2 = b2.pendingProps;
          f2 = b2.memoizedState;
          e2 = f2.element;
          fe2(a, b2);
          ke2(b2, d2, null, c2);
          var g2 = b2.memoizedState;
          d2 = g2.element;
          if (Va2 && f2.isDehydrated) if (f2 = { element: d2, isDehydrated: false, cache: g2.cache, pendingSuspenseBoundaries: g2.pendingSuspenseBoundaries, transitions: g2.transitions }, b2.updateQueue.baseState = f2, b2.memoizedState = f2, b2.flags & 256) {
            e2 = Ef2(Error(n2(423)), b2);
            b2 = fg2(a, b2, d2, c2, e2);
            break a;
          } else if (d2 !== e2) {
            e2 = Ef2(Error(n2(424)), b2);
            b2 = fg2(a, b2, d2, c2, e2);
            break a;
          } else for (Va2 && (pd2 = Pb2(b2.stateNode.containerInfo), od2 = b2, F2 = true, rd2 = null, qd2 = false), c2 = Pd2(b2, null, d2, c2), b2.child = c2; c2; ) c2.flags = c2.flags & -3 | 4096, c2 = c2.sibling;
          else {
            Ad2();
            if (d2 === e2) {
              b2 = Tf2(a, b2, c2);
              break a;
            }
            P2(a, b2, d2, c2);
          }
          b2 = b2.child;
        }
        return b2;
      case 5:
        return ue2(b2), null === a && wd2(b2), d2 = b2.type, e2 = b2.pendingProps, f2 = null !== a ? a.memoizedProps : null, g2 = e2.children, Na2(d2, e2) ? g2 = null : null !== f2 && Na2(d2, f2) && (b2.flags |= 32), ag2(a, b2), P2(a, b2, g2, c2), b2.child;
      case 6:
        return null === a && wd2(b2), null;
      case 13:
        return ig2(a, b2, c2);
      case 4:
        return se2(b2, b2.stateNode.containerInfo), d2 = b2.pendingProps, null === a ? b2.child = Od2(b2, null, d2, c2) : P2(a, b2, d2, c2), b2.child;
      case 11:
        return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : xf2(d2, e2), Sf2(a, b2, d2, e2, c2);
      case 7:
        return P2(a, b2, b2.pendingProps, c2), b2.child;
      case 8:
        return P2(a, b2, b2.pendingProps.children, c2), b2.child;
      case 12:
        return P2(a, b2, b2.pendingProps.children, c2), b2.child;
      case 10:
        a: {
          d2 = b2.type._context;
          e2 = b2.pendingProps;
          f2 = b2.memoizedProps;
          g2 = e2.value;
          Vd2(b2, d2, g2);
          if (null !== f2) if (Vc2(f2.value, g2)) {
            if (f2.children === e2.children && !z2.current) {
              b2 = Tf2(a, b2, c2);
              break a;
            }
          } else for (f2 = b2.child, null !== f2 && (f2.return = b2); null !== f2; ) {
            var h2 = f2.dependencies;
            if (null !== h2) {
              g2 = f2.child;
              for (var k2 = h2.firstContext; null !== k2; ) {
                if (k2.context === d2) {
                  if (1 === f2.tag) {
                    k2 = ge2(-1, c2 & -c2);
                    k2.tag = 2;
                    var l2 = f2.updateQueue;
                    if (null !== l2) {
                      l2 = l2.shared;
                      var m2 = l2.pending;
                      null === m2 ? k2.next = k2 : (k2.next = m2.next, m2.next = k2);
                      l2.pending = k2;
                    }
                  }
                  f2.lanes |= c2;
                  k2 = f2.alternate;
                  null !== k2 && (k2.lanes |= c2);
                  Xd2(f2.return, c2, b2);
                  h2.lanes |= c2;
                  break;
                }
                k2 = k2.next;
              }
            } else if (10 === f2.tag) g2 = f2.type === b2.type ? null : f2.child;
            else if (18 === f2.tag) {
              g2 = f2.return;
              if (null === g2) throw Error(n2(341));
              g2.lanes |= c2;
              h2 = g2.alternate;
              null !== h2 && (h2.lanes |= c2);
              Xd2(g2, c2, b2);
              g2 = f2.sibling;
            } else g2 = f2.child;
            if (null !== g2) g2.return = f2;
            else for (g2 = f2; null !== g2; ) {
              if (g2 === b2) {
                g2 = null;
                break;
              }
              f2 = g2.sibling;
              if (null !== f2) {
                f2.return = g2.return;
                g2 = f2;
                break;
              }
              g2 = g2.return;
            }
            f2 = g2;
          }
          P2(a, b2, e2.children, c2);
          b2 = b2.child;
        }
        return b2;
      case 9:
        return e2 = b2.type, d2 = b2.pendingProps.children, Yd2(b2, c2), e2 = Zd2(e2), d2 = d2(e2), b2.flags |= 1, P2(a, b2, d2, c2), b2.child;
      case 14:
        return d2 = b2.type, e2 = xf2(d2, b2.pendingProps), e2 = xf2(d2.type, e2), Uf2(a, b2, d2, e2, c2);
      case 15:
        return Wf2(a, b2, b2.type, b2.pendingProps, c2);
      case 17:
        return d2 = b2.type, e2 = b2.pendingProps, e2 = b2.elementType === d2 ? e2 : xf2(d2, e2), cg2(a, b2), b2.tag = 1, A2(d2) ? (a = true, qc2(b2)) : a = false, Yd2(b2, c2), Bf2(b2, d2, e2), Df2(b2, d2, e2, c2), dg2(null, b2, d2, true, a, c2);
      case 19:
        return rg2(a, b2, c2);
      case 22:
        return Yf2(a, b2, c2);
    }
    throw Error(n2(156, b2.tag));
  };
  function Mh2(a, b2) {
    return Jc2(a, b2);
  }
  function fi2(a, b2, c2, d2) {
    this.tag = a;
    this.key = c2;
    this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
    this.index = 0;
    this.ref = null;
    this.pendingProps = b2;
    this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
    this.mode = d2;
    this.subtreeFlags = this.flags = 0;
    this.deletions = null;
    this.childLanes = this.lanes = 0;
    this.alternate = null;
  }
  function td2(a, b2, c2, d2) {
    return new fi2(a, b2, c2, d2);
  }
  function Vf2(a) {
    a = a.prototype;
    return !(!a || !a.isReactComponent);
  }
  function ei2(a) {
    if ("function" === typeof a) return Vf2(a) ? 1 : 0;
    if (void 0 !== a && null !== a) {
      a = a.$$typeof;
      if (a === ma2) return 11;
      if (a === pa2) return 14;
    }
    return 2;
  }
  function Jd2(a, b2) {
    var c2 = a.alternate;
    null === c2 ? (c2 = td2(a.tag, b2, a.key, a.mode), c2.elementType = a.elementType, c2.type = a.type, c2.stateNode = a.stateNode, c2.alternate = a, a.alternate = c2) : (c2.pendingProps = b2, c2.type = a.type, c2.flags = 0, c2.subtreeFlags = 0, c2.deletions = null);
    c2.flags = a.flags & 14680064;
    c2.childLanes = a.childLanes;
    c2.lanes = a.lanes;
    c2.child = a.child;
    c2.memoizedProps = a.memoizedProps;
    c2.memoizedState = a.memoizedState;
    c2.updateQueue = a.updateQueue;
    b2 = a.dependencies;
    c2.dependencies = null === b2 ? null : { lanes: b2.lanes, firstContext: b2.firstContext };
    c2.sibling = a.sibling;
    c2.index = a.index;
    c2.ref = a.ref;
    return c2;
  }
  function Ld2(a, b2, c2, d2, e2, f2) {
    var g2 = 2;
    d2 = a;
    if ("function" === typeof a) Vf2(a) && (g2 = 1);
    else if ("string" === typeof a) g2 = 5;
    else a: switch (a) {
      case ha2:
        return Nd2(c2.children, e2, f2, b2);
      case ia2:
        g2 = 8;
        e2 |= 8;
        break;
      case ja2:
        return a = td2(12, c2, b2, e2 | 2), a.elementType = ja2, a.lanes = f2, a;
      case na:
        return a = td2(13, c2, b2, e2), a.elementType = na, a.lanes = f2, a;
      case oa2:
        return a = td2(19, c2, b2, e2), a.elementType = oa2, a.lanes = f2, a;
      case ra2:
        return jg2(c2, e2, f2, b2);
      default:
        if ("object" === typeof a && null !== a) switch (a.$$typeof) {
          case ka2:
            g2 = 10;
            break a;
          case la2:
            g2 = 9;
            break a;
          case ma2:
            g2 = 11;
            break a;
          case pa2:
            g2 = 14;
            break a;
          case qa2:
            g2 = 16;
            d2 = null;
            break a;
        }
        throw Error(n2(130, null == a ? a : typeof a, ""));
    }
    b2 = td2(g2, c2, b2, e2);
    b2.elementType = a;
    b2.type = d2;
    b2.lanes = f2;
    return b2;
  }
  function Nd2(a, b2, c2, d2) {
    a = td2(7, a, d2, b2);
    a.lanes = c2;
    return a;
  }
  function jg2(a, b2, c2, d2) {
    a = td2(22, a, d2, b2);
    a.elementType = ra2;
    a.lanes = c2;
    a.stateNode = { isHidden: false };
    return a;
  }
  function Kd2(a, b2, c2) {
    a = td2(6, a, null, b2);
    a.lanes = c2;
    return a;
  }
  function Md2(a, b2, c2) {
    b2 = td2(4, null !== a.children ? a.children : [], a.key, b2);
    b2.lanes = c2;
    b2.stateNode = { containerInfo: a.containerInfo, pendingChildren: null, implementation: a.implementation };
    return b2;
  }
  function gi2(a, b2, c2, d2, e2) {
    this.tag = b2;
    this.containerInfo = a;
    this.finishedWork = this.pingCache = this.current = this.pendingChildren = null;
    this.timeoutHandle = Ra2;
    this.callbackNode = this.pendingContext = this.context = null;
    this.callbackPriority = 0;
    this.eventTimes = Ec2(0);
    this.expirationTimes = Ec2(-1);
    this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
    this.entanglements = Ec2(0);
    this.identifierPrefix = d2;
    this.onRecoverableError = e2;
    Va2 && (this.mutableSourceEagerHydrationData = null);
  }
  function hi2(a, b2, c2, d2, e2, f2, g2, h2, k2) {
    a = new gi2(a, b2, c2, h2, k2);
    1 === b2 ? (b2 = 1, true === f2 && (b2 |= 8)) : b2 = 0;
    f2 = td2(3, null, null, b2);
    a.current = f2;
    f2.stateNode = a;
    f2.memoizedState = { element: d2, isDehydrated: c2, cache: null, transitions: null, pendingSuspenseBoundaries: null };
    ee2(f2);
    return a;
  }
  function ii2(a) {
    if (!a) return jc2;
    a = a._reactInternals;
    a: {
      if (wa2(a) !== a || 1 !== a.tag) throw Error(n2(170));
      var b2 = a;
      do {
        switch (b2.tag) {
          case 3:
            b2 = b2.stateNode.context;
            break a;
          case 1:
            if (A2(b2.type)) {
              b2 = b2.stateNode.__reactInternalMemoizedMergedChildContext;
              break a;
            }
        }
        b2 = b2.return;
      } while (null !== b2);
      throw Error(n2(171));
    }
    if (1 === a.tag) {
      var c2 = a.type;
      if (A2(c2)) return pc2(a, c2, b2);
    }
    return b2;
  }
  function ji2(a) {
    var b2 = a._reactInternals;
    if (void 0 === b2) {
      if ("function" === typeof a.render) throw Error(n2(188));
      a = Object.keys(a).join(",");
      throw Error(n2(268, a));
    }
    a = Aa2(b2);
    return null === a ? null : a.stateNode;
  }
  function ki2(a, b2) {
    a = a.memoizedState;
    if (null !== a && null !== a.dehydrated) {
      var c2 = a.retryLane;
      a.retryLane = 0 !== c2 && c2 < b2 ? c2 : b2;
    }
  }
  function li2(a, b2) {
    ki2(a, b2);
    (a = a.alternate) && ki2(a, b2);
  }
  function mi2(a) {
    a = Aa2(a);
    return null === a ? null : a.stateNode;
  }
  function ni2() {
    return null;
  }
  exports.attemptContinuousHydration = function(a) {
    if (13 === a.tag) {
      var b2 = ce2(a, 134217728);
      if (null !== b2) {
        var c2 = O2();
        af2(b2, a, 134217728, c2);
      }
      li2(a, 134217728);
    }
  };
  exports.attemptDiscreteHydration = function(a) {
    if (13 === a.tag) {
      var b2 = ce2(a, 1);
      if (null !== b2) {
        var c2 = O2();
        af2(b2, a, 1, c2);
      }
      li2(a, 1);
    }
  };
  exports.attemptHydrationAtCurrentPriority = function(a) {
    if (13 === a.tag) {
      var b2 = tf2(a), c2 = ce2(a, b2);
      if (null !== c2) {
        var d2 = O2();
        af2(c2, a, b2, d2);
      }
      li2(a, b2);
    }
  };
  exports.attemptSynchronousHydration = function(a) {
    switch (a.tag) {
      case 3:
        var b2 = a.stateNode;
        if (b2.current.memoizedState.isDehydrated) {
          var c2 = yc2(b2.pendingLanes);
          0 !== c2 && (Hc2(b2, c2 | 1), Kh2(b2, D2()), 0 === (H2 & 6) && (Bh2(), ad2()));
        }
        break;
      case 13:
        Xh2(function() {
          var b3 = ce2(a, 1);
          if (null !== b3) {
            var c3 = O2();
            af2(b3, a, 1, c3);
          }
        }), li2(a, 1);
    }
  };
  exports.batchedUpdates = function(a, b2) {
    var c2 = H2;
    H2 |= 1;
    try {
      return a(b2);
    } finally {
      H2 = c2, 0 === H2 && (Bh2(), Xc2 && ad2());
    }
  };
  exports.createComponentSelector = function(a) {
    return { $$typeof: hh2, value: a };
  };
  exports.createContainer = function(a, b2, c2, d2, e2, f2, g2) {
    return hi2(a, b2, false, null, c2, d2, e2, f2, g2);
  };
  exports.createHasPseudoClassSelector = function(a) {
    return { $$typeof: ih2, value: a };
  };
  exports.createHydrationContainer = function(a, b2, c2, d2, e2, f2, g2, h2, k2) {
    a = hi2(c2, d2, true, a, e2, f2, g2, h2, k2);
    a.context = ii2(null);
    c2 = a.current;
    d2 = O2();
    e2 = tf2(c2);
    f2 = ge2(d2, e2);
    f2.callback = void 0 !== b2 && null !== b2 ? b2 : null;
    he2(c2, f2, e2);
    a.current.lanes = e2;
    Fc2(a, e2, d2);
    Kh2(a, d2);
    return a;
  };
  exports.createPortal = function(a, b2, c2) {
    var d2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
    return { $$typeof: fa2, key: null == d2 ? null : "" + d2, children: a, containerInfo: b2, implementation: c2 };
  };
  exports.createRoleSelector = function(a) {
    return { $$typeof: jh2, value: a };
  };
  exports.createTestNameSelector = function(a) {
    return { $$typeof: kh2, value: a };
  };
  exports.createTextSelector = function(a) {
    return { $$typeof: lh2, value: a };
  };
  exports.deferredUpdates = function(a) {
    var b2 = C2, c2 = W2.transition;
    try {
      return W2.transition = null, C2 = 16, a();
    } finally {
      C2 = b2, W2.transition = c2;
    }
  };
  exports.discreteUpdates = function(a, b2, c2, d2, e2) {
    var f2 = C2, g2 = W2.transition;
    try {
      return W2.transition = null, C2 = 1, a(b2, c2, d2, e2);
    } finally {
      C2 = f2, W2.transition = g2, 0 === H2 && Bh2();
    }
  };
  exports.findAllNodes = rh2;
  exports.findBoundingRects = function(a, b2) {
    if (!bb2) throw Error(n2(363));
    b2 = rh2(a, b2);
    a = [];
    for (var c2 = 0; c2 < b2.length; c2++) a.push(db2(b2[c2]));
    for (b2 = a.length - 1; 0 < b2; b2--) {
      c2 = a[b2];
      for (var d2 = c2.x, e2 = d2 + c2.width, f2 = c2.y, g2 = f2 + c2.height, h2 = b2 - 1; 0 <= h2; h2--) if (b2 !== h2) {
        var k2 = a[h2], l2 = k2.x, m2 = l2 + k2.width, r2 = k2.y, p2 = r2 + k2.height;
        if (d2 >= l2 && f2 >= r2 && e2 <= m2 && g2 <= p2) {
          a.splice(b2, 1);
          break;
        } else if (!(d2 !== l2 || c2.width !== k2.width || p2 < f2 || r2 > g2)) {
          r2 > f2 && (k2.height += r2 - f2, k2.y = f2);
          p2 < g2 && (k2.height = g2 - r2);
          a.splice(b2, 1);
          break;
        } else if (!(f2 !== r2 || c2.height !== k2.height || m2 < d2 || l2 > e2)) {
          l2 > d2 && (k2.width += l2 - d2, k2.x = d2);
          m2 < e2 && (k2.width = e2 - l2);
          a.splice(b2, 1);
          break;
        }
      }
    }
    return a;
  };
  exports.findHostInstance = ji2;
  exports.findHostInstanceWithNoPortals = function(a) {
    a = za2(a);
    a = null !== a ? Ca2(a) : null;
    return null === a ? null : a.stateNode;
  };
  exports.findHostInstanceWithWarning = function(a) {
    return ji2(a);
  };
  exports.flushControlled = function(a) {
    var b2 = H2;
    H2 |= 1;
    var c2 = W2.transition, d2 = C2;
    try {
      W2.transition = null, C2 = 1, a();
    } finally {
      C2 = d2, W2.transition = c2, H2 = b2, 0 === H2 && (Bh2(), ad2());
    }
  };
  exports.flushPassiveEffects = Oh2;
  exports.flushSync = Xh2;
  exports.focusWithin = function(a, b2) {
    if (!bb2) throw Error(n2(363));
    a = nh2(a);
    b2 = qh2(a, b2);
    b2 = Array.from(b2);
    for (a = 0; a < b2.length; ) {
      var c2 = b2[a++];
      if (!fb2(c2)) {
        if (5 === c2.tag && hb2(c2.stateNode)) return true;
        for (c2 = c2.child; null !== c2; ) b2.push(c2), c2 = c2.sibling;
      }
    }
    return false;
  };
  exports.getCurrentUpdatePriority = function() {
    return C2;
  };
  exports.getFindAllNodesFailureDescription = function(a, b2) {
    if (!bb2) throw Error(n2(363));
    var c2 = 0, d2 = [];
    a = [nh2(a), 0];
    for (var e2 = 0; e2 < a.length; ) {
      var f2 = a[e2++], g2 = a[e2++], h2 = b2[g2];
      if (5 !== f2.tag || !fb2(f2)) {
        if (oh2(f2, h2) && (d2.push(ph2(h2)), g2++, g2 > c2 && (c2 = g2)), g2 < b2.length) for (f2 = f2.child; null !== f2; ) a.push(f2, g2), f2 = f2.sibling;
      }
    }
    if (c2 < b2.length) {
      for (a = []; c2 < b2.length; c2++) a.push(ph2(b2[c2]));
      return "findAllNodes was able to match part of the selector:\n  " + (d2.join(" > ") + "\n\nNo matching component was found for:\n  ") + a.join(" > ");
    }
    return null;
  };
  exports.getPublicRootInstance = function(a) {
    a = a.current;
    if (!a.child) return null;
    switch (a.child.tag) {
      case 5:
        return Ea2(a.child.stateNode);
      default:
        return a.child.stateNode;
    }
  };
  exports.injectIntoDevTools = function(a) {
    a = { bundleType: a.bundleType, version: a.version, rendererPackageName: a.rendererPackageName, rendererConfig: a.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: da2.ReactCurrentDispatcher, findHostInstanceByFiber: mi2, findFiberByHostInstance: a.findFiberByHostInstance || ni2, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1" };
    if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) a = false;
    else {
      var b2 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (b2.isDisabled || !b2.supportsFiber) a = true;
      else {
        try {
          Rc2 = b2.inject(a), Sc2 = b2;
        } catch (c2) {
        }
        a = b2.checkDCE ? true : false;
      }
    }
    return a;
  };
  exports.isAlreadyRendering = function() {
    return false;
  };
  exports.observeVisibleRects = function(a, b2, c2, d2) {
    if (!bb2) throw Error(n2(363));
    a = rh2(a, b2);
    var e2 = ib2(a, c2, d2).disconnect;
    return { disconnect: function() {
      e2();
    } };
  };
  exports.registerMutableSourceForHydration = function(a, b2) {
    var c2 = b2._getVersion;
    c2 = c2(b2._source);
    null == a.mutableSourceEagerHydrationData ? a.mutableSourceEagerHydrationData = [b2, c2] : a.mutableSourceEagerHydrationData.push(b2, c2);
  };
  exports.runWithPriority = function(a, b2) {
    var c2 = C2;
    try {
      return C2 = a, b2();
    } finally {
      C2 = c2;
    }
  };
  exports.shouldError = function() {
    return null;
  };
  exports.shouldSuspend = function() {
    return false;
  };
  exports.updateContainer = function(a, b2, c2, d2) {
    var e2 = b2.current, f2 = O2(), g2 = tf2(e2);
    c2 = ii2(c2);
    null === b2.context ? b2.context = c2 : b2.pendingContext = c2;
    b2 = ge2(f2, g2);
    b2.payload = { element: a };
    d2 = void 0 === d2 ? null : d2;
    null !== d2 && (b2.callback = d2);
    a = he2(e2, b2, g2);
    null !== a && (af2(a, e2, g2, f2), ie2(a, e2, g2));
    return g2;
  };
  return exports;
};
{
  reactReconciler.exports = reactReconciler_production_min;
}
var reactReconcilerExports = reactReconciler.exports;
const ReactFiberReconciler = /* @__PURE__ */ getDefaultExportFromCjs(reactReconcilerExports);
var constants = { exports: {} };
var reactReconcilerConstants_production_min = {};
/**
 * @license React
 * react-reconciler-constants.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
reactReconcilerConstants_production_min.ConcurrentRoot = 1;
reactReconcilerConstants_production_min.ContinuousEventPriority = 4;
reactReconcilerConstants_production_min.DefaultEventPriority = 16;
reactReconcilerConstants_production_min.DiscreteEventPriority = 1;
reactReconcilerConstants_production_min.IdleEventPriority = 536870912;
reactReconcilerConstants_production_min.LegacyRoot = 0;
{
  constants.exports = reactReconcilerConstants_production_min;
}
var constantsExports = constants.exports;
const propsToSkip = {
  children: true,
  ref: true,
  key: true,
  style: true,
  forwardedRef: true,
  unstable_applyCache: true,
  unstable_applyDrawHitFromCache: true
};
let zIndexWarningShowed = false;
let dragWarningShowed = false;
const EVENTS_NAMESPACE = ".react-konva-event";
let useStrictMode$1 = false;
function toggleStrictMode(value) {
  useStrictMode$1 = value;
}
const DRAGGABLE_WARNING = `ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
Consider to add onDragMove or onDragEnd events.
For more info see: https://github.com/konvajs/react-konva/issues/256
`;
const Z_INDEX_WARNING = `ReactKonva: You are using "zIndex" attribute for a Konva node.
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
For more info see: https://github.com/konvajs/react-konva/issues/194
`;
const EMPTY_PROPS = {};
function applyNodeProps(instance, props, oldProps = EMPTY_PROPS) {
  if (!zIndexWarningShowed && "zIndex" in props) {
    console.warn(Z_INDEX_WARNING);
    zIndexWarningShowed = true;
  }
  if (!dragWarningShowed && props.draggable) {
    var hasPosition = props.x !== void 0 || props.y !== void 0;
    var hasEvents = props.onDragEnd || props.onDragMove;
    if (hasPosition && !hasEvents) {
      console.warn(DRAGGABLE_WARNING);
      dragWarningShowed = true;
    }
  }
  for (var key in oldProps) {
    if (propsToSkip[key]) {
      continue;
    }
    var isEvent = key.slice(0, 2) === "on";
    var propChanged = oldProps[key] !== props[key];
    if (isEvent && propChanged) {
      var eventName = key.substr(2).toLowerCase();
      if (eventName.substr(0, 7) === "content") {
        eventName = "content" + eventName.substr(7, 1).toUpperCase() + eventName.substr(8);
      }
      instance.off(eventName, oldProps[key]);
    }
    var toRemove = !props.hasOwnProperty(key);
    if (toRemove) {
      instance.setAttr(key, void 0);
    }
  }
  var strictUpdate = useStrictMode$1 || props._useStrictMode;
  var updatedProps = {};
  var hasUpdates = false;
  const newEvents = {};
  for (var key in props) {
    if (propsToSkip[key]) {
      continue;
    }
    var isEvent = key.slice(0, 2) === "on";
    var toAdd = oldProps[key] !== props[key];
    if (isEvent && toAdd) {
      var eventName = key.substr(2).toLowerCase();
      if (eventName.substr(0, 7) === "content") {
        eventName = "content" + eventName.substr(7, 1).toUpperCase() + eventName.substr(8);
      }
      if (props[key]) {
        newEvents[eventName] = props[key];
      }
    }
    if (!isEvent && (props[key] !== oldProps[key] || strictUpdate && props[key] !== instance.getAttr(key))) {
      hasUpdates = true;
      updatedProps[key] = props[key];
    }
  }
  if (hasUpdates) {
    instance.setAttrs(updatedProps);
    updatePicture(instance);
  }
  for (var eventName in newEvents) {
    instance.on(eventName + EVENTS_NAMESPACE, newEvents[eventName]);
  }
}
function updatePicture(node) {
  if (!Global$1.Konva.autoDrawEnabled) {
    var drawingNode = node.getLayer() || node.getStage();
    drawingNode && drawingNode.batchDraw();
  }
}
const NO_CONTEXT = {};
const UPDATE_SIGNAL = {};
Konva$2.Node.prototype._applyProps = applyNodeProps;
function appendInitialChild(parentInstance, child) {
  if (typeof child === "string") {
    console.error(`Do not use plain text as child of Konva.Node. You are using text: ${child}`);
    return;
  }
  parentInstance.add(child);
  updatePicture(parentInstance);
}
function createInstance(type, props, internalInstanceHandle) {
  let NodeClass = Konva$2[type];
  if (!NodeClass) {
    console.error(`Konva has no node with the type ${type}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${type}"  If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`);
    NodeClass = Konva$2.Group;
  }
  const propsWithoutEvents = {};
  const propsWithOnlyEvents = {};
  for (var key in props) {
    var isEvent = key.slice(0, 2) === "on";
    if (isEvent) {
      propsWithOnlyEvents[key] = props[key];
    } else {
      propsWithoutEvents[key] = props[key];
    }
  }
  const instance = new NodeClass(propsWithoutEvents);
  applyNodeProps(instance, propsWithOnlyEvents);
  return instance;
}
function createTextInstance(text, rootContainerInstance, internalInstanceHandle) {
  console.error(`Text components are not supported for now in ReactKonva. Your text is: "${text}"`);
}
function finalizeInitialChildren(domElement, type, props) {
  return false;
}
function getPublicInstance(instance) {
  return instance;
}
function prepareForCommit() {
  return null;
}
function preparePortalMount() {
  return null;
}
function prepareUpdate(domElement, type, oldProps, newProps) {
  return UPDATE_SIGNAL;
}
function resetAfterCommit() {
}
function resetTextContent(domElement) {
}
function shouldDeprioritizeSubtree(type, props) {
  return false;
}
function getRootHostContext() {
  return NO_CONTEXT;
}
function getChildHostContext() {
  return NO_CONTEXT;
}
const scheduleTimeout = setTimeout;
const cancelTimeout = clearTimeout;
const noTimeout = -1;
function shouldSetTextContent(type, props) {
  return false;
}
const isPrimaryRenderer = false;
const warnsIfNotActing = true;
const supportsMutation = true;
function appendChild(parentInstance, child) {
  if (child.parent === parentInstance) {
    child.moveToTop();
  } else {
    parentInstance.add(child);
  }
  updatePicture(parentInstance);
}
function appendChildToContainer(parentInstance, child) {
  if (child.parent === parentInstance) {
    child.moveToTop();
  } else {
    parentInstance.add(child);
  }
  updatePicture(parentInstance);
}
function insertBefore(parentInstance, child, beforeChild) {
  child._remove();
  parentInstance.add(child);
  child.setZIndex(beforeChild.getZIndex());
  updatePicture(parentInstance);
}
function insertInContainerBefore(parentInstance, child, beforeChild) {
  insertBefore(parentInstance, child, beforeChild);
}
function removeChild(parentInstance, child) {
  child.destroy();
  child.off(EVENTS_NAMESPACE);
  updatePicture(parentInstance);
}
function removeChildFromContainer(parentInstance, child) {
  child.destroy();
  child.off(EVENTS_NAMESPACE);
  updatePicture(parentInstance);
}
function commitTextUpdate(textInstance, oldText, newText) {
  console.error(`Text components are not yet supported in ReactKonva. You text is: "${newText}"`);
}
function commitMount(instance, type, newProps) {
}
function commitUpdate(instance, updatePayload, type, oldProps, newProps) {
  applyNodeProps(instance, newProps, oldProps);
}
function hideInstance(instance) {
  instance.hide();
  updatePicture(instance);
}
function hideTextInstance(textInstance) {
}
function unhideInstance(instance, props) {
  if (props.visible == null || props.visible) {
    instance.show();
  }
}
function unhideTextInstance(textInstance, text) {
}
function clearContainer(container) {
}
function detachDeletedInstance() {
}
const getCurrentEventPriority = () => constantsExports.DefaultEventPriority;
const HostConfig = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  appendChild,
  appendChildToContainer,
  appendInitialChild,
  cancelTimeout,
  clearContainer,
  commitMount,
  commitTextUpdate,
  commitUpdate,
  createInstance,
  createTextInstance,
  detachDeletedInstance,
  finalizeInitialChildren,
  getChildHostContext,
  getCurrentEventPriority,
  getPublicInstance,
  getRootHostContext,
  hideInstance,
  hideTextInstance,
  idlePriority: schedulerExports.unstable_IdlePriority,
  insertBefore,
  insertInContainerBefore,
  isPrimaryRenderer,
  noTimeout,
  now: schedulerExports.unstable_now,
  prepareForCommit,
  preparePortalMount,
  prepareUpdate,
  removeChild,
  removeChildFromContainer,
  resetAfterCommit,
  resetTextContent,
  run: schedulerExports.unstable_runWithPriority,
  scheduleTimeout,
  shouldDeprioritizeSubtree,
  shouldSetTextContent,
  supportsMutation,
  unhideInstance,
  unhideTextInstance,
  warnsIfNotActing
}, Symbol.toStringTag, { value: "Module" }));
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b2) => {
  for (var prop in b2 || (b2 = {}))
    if (__hasOwnProp.call(b2, prop))
      __defNormalProp(a, prop, b2[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b2)) {
      if (__propIsEnum.call(b2, prop))
        __defNormalProp(a, prop, b2[prop]);
    }
  return a;
};
var __spreadProps = (a, b2) => __defProps(a, __getOwnPropDescs(b2));
var _a, _b;
typeof window !== "undefined" && (((_a = window.document) == null ? void 0 : _a.createElement) || ((_b = window.navigator) == null ? void 0 : _b.product) === "ReactNative") ? reactExports.useLayoutEffect : reactExports.useEffect;
function traverseFiber(fiber, ascending, selector) {
  if (!fiber)
    return;
  if (selector(fiber) === true)
    return fiber;
  let child = fiber.child;
  while (child) {
    const match = traverseFiber(child, ascending, selector);
    if (match)
      return match;
    child = child.sibling;
  }
}
function wrapContext(context) {
  try {
    return Object.defineProperties(context, {
      _currentRenderer: {
        get() {
          return null;
        },
        set() {
        }
      },
      _currentRenderer2: {
        get() {
          return null;
        },
        set() {
        }
      }
    });
  } catch (_2) {
    return context;
  }
}
const error = console.error;
console.error = function() {
  const message = [...arguments].join("");
  if ((message == null ? void 0 : message.startsWith("Warning:")) && message.includes("useContext")) {
    console.error = error;
    return;
  }
  return error.apply(this, arguments);
};
const FiberContext = wrapContext(reactExports.createContext(null));
class FiberProvider extends reactExports.Component {
  render() {
    return /* @__PURE__ */ reactExports.createElement(FiberContext.Provider, {
      value: this._reactInternals
    }, this.props.children);
  }
}
function useFiber() {
  const root = reactExports.useContext(FiberContext);
  if (root === null)
    throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");
  const id2 = reactExports.useId();
  const fiber = reactExports.useMemo(() => {
    for (const maybeFiber of [root, root == null ? void 0 : root.alternate]) {
      if (!maybeFiber)
        continue;
      const fiber2 = traverseFiber(maybeFiber, false, (node) => {
        let state = node.memoizedState;
        while (state) {
          if (state.memoizedState === id2)
            return true;
          state = state.next;
        }
      });
      if (fiber2)
        return fiber2;
    }
  }, [root, id2]);
  return fiber;
}
function useContextMap() {
  const fiber = useFiber();
  const [contextMap] = reactExports.useState(() => /* @__PURE__ */ new Map());
  contextMap.clear();
  let node = fiber;
  while (node) {
    if (node.type && typeof node.type === "object") {
      const enableRenderableContext = node.type._context === void 0 && node.type.Provider === node.type;
      const context = enableRenderableContext ? node.type : node.type._context;
      if (context && context !== FiberContext && !contextMap.has(context)) {
        contextMap.set(context, reactExports.useContext(wrapContext(context)));
      }
    }
    node = node.return;
  }
  return contextMap;
}
function useContextBridge() {
  const contextMap = useContextMap();
  return reactExports.useMemo(
    () => Array.from(contextMap.keys()).reduce(
      (Prev, context) => (props) => /* @__PURE__ */ reactExports.createElement(Prev, null, /* @__PURE__ */ reactExports.createElement(context.Provider, __spreadProps(__spreadValues({}, props), {
        value: contextMap.get(context)
      }))),
      (props) => /* @__PURE__ */ reactExports.createElement(FiberProvider, __spreadValues({}, props))
    ),
    [contextMap]
  );
}
function usePrevious(value) {
  const ref = React.useRef({});
  React.useLayoutEffect(() => {
    ref.current = value;
  });
  React.useLayoutEffect(() => {
    return () => {
      ref.current = {};
    };
  }, []);
  return ref.current;
}
const StageWrap = (props) => {
  const container = React.useRef();
  const stage = React.useRef();
  const fiberRef = React.useRef();
  const oldProps = usePrevious(props);
  const Bridge = useContextBridge();
  const _setRef = (stage2) => {
    const { forwardedRef } = props;
    if (!forwardedRef) {
      return;
    }
    if (typeof forwardedRef === "function") {
      forwardedRef(stage2);
    } else {
      forwardedRef.current = stage2;
    }
  };
  React.useLayoutEffect(() => {
    stage.current = new Konva$2.Stage({
      width: props.width,
      height: props.height,
      container: container.current
    });
    _setRef(stage.current);
    fiberRef.current = KonvaRenderer.createContainer(stage.current, constantsExports.LegacyRoot, false, null);
    KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current);
    return () => {
      if (!Konva$2.isBrowser) {
        return;
      }
      _setRef(null);
      KonvaRenderer.updateContainer(null, fiberRef.current, null);
      stage.current.destroy();
    };
  }, []);
  React.useLayoutEffect(() => {
    _setRef(stage.current);
    applyNodeProps(stage.current, props, oldProps);
    KonvaRenderer.updateContainer(React.createElement(Bridge, {}, props.children), fiberRef.current, null);
  });
  return React.createElement("div", {
    ref: container,
    id: props.id,
    accessKey: props.accessKey,
    className: props.className,
    role: props.role,
    style: props.style,
    tabIndex: props.tabIndex,
    title: props.title
  });
};
const Layer$2 = "Layer";
const Group$2 = "Group";
const Rect$2 = "Rect";
const Ellipse$3 = "Ellipse";
const Line$3 = "Line";
const Image$3 = "Image";
const Text$5 = "Text";
const RegularPolygon$2 = "RegularPolygon";
const Arrow$4 = "Arrow";
const Transformer$2 = "Transformer";
const KonvaRenderer = ReactFiberReconciler(HostConfig);
KonvaRenderer.injectIntoDevTools({
  // @ts-ignore
  findHostInstanceByFiber: () => null,
  bundleType: 0,
  version: React.version,
  rendererPackageName: "react-konva"
});
const Stage$1 = React.forwardRef((props, ref) => {
  return React.createElement(FiberProvider, {}, React.createElement(StageWrap, { ...props, forwardedRef: ref }));
});
const useStrictMode = toggleStrictMode;
var getDimensionsMinimalRatio = function(a, b2, c2, d2) {
  return Math.min(a / c2, b2 / d2) || 1;
};
var ROOT_CONTAINER_CLASS_NAME = "FIE_root";
var DESIGN_LAYER_ID = "FIE_design-layer";
var TRANSFORMERS_LAYER_ID = "FIE_transformers-layer";
var IMAGE_NODE_ID = "FIE_original-image";
var NODES_TRANSFORMER_ID = "FIE_nodes-transformer";
var WATERMARK_ANNOTATION_ID$1 = "watermark";
var TRANSLATIONS_GRID_UUID = "353297d2-40b4-4684-a875-45a2178a8157";
var DEFAULT_SAVE_QUALITY = 0.92;
var TABS_IDS = { FINETUNE: "Finetune", FILTERS: "Filters", ADJUST: "Adjust", WATERMARK: "Watermark", ANNOTATE: "Annotate", RESIZE: "Resize" };
var TOOLS_IDS = { CROP: "Crop", ROTATE: "Rotate", FLIP_X: "Flip_X", FLIP_Y: "Flip_Y", BRIGHTNESS: "Brightness", CONTRAST: "Contrast", HSV: "HueSaturationValue", WARMTH: "Warmth", BLUR: "Blur", THRESHOLD: "Threshold", POSTERIZE: "Posterize", PIXELATE: "Pixelate", NOISE: "Noise", FILTERS: "Filters", RECT: "Rect", ELLIPSE: "Ellipse", POLYGON: "Polygon", TEXT: "Text", LINE: "Line", IMAGE: "Image", ARROW: "Arrow", WATERMARK: "Watermark", PEN: "Pen", RESIZE: "Resize" };
var FLIP_DIRECTIONS = { X: "X", Y: "Y" };
var DEFAULT_ZOOM_FACTOR = 1;
var SUPPORTED_IMAGE_TYPES = ["png", "jpeg", "jpg", "webp"];
var POSSIBLE_IMAGE_TYPES = [].concat(SUPPORTED_IMAGE_TYPES, ["svg", "gif", "avif", "apng"]);
var DEFAULT_IMAGE_TYPE = SUPPORTED_IMAGE_TYPES[0];
var POINTER_ICONS = { DEFAULT: "default", DRAW: "crosshair", SELECT: "pointer", MOVE: "move", DRAG: "GRAB" };
var ORIGINAL_CROP = "Crop";
var CUSTOM_CROP = "custom";
var ELLIPSE_CROP = "ellipse";
var POSITIONS = { TOP_LEFT: "top-left", TOP_CENTER: "top-center", TOP_RIGHT: "top-right", MIDDLE_LEFT: "middle-left", MIDDLE_CENTER: "middle-center", MIDDLE_RIGHT: "middle-right", BOTTOM_LEFT: "bottom-left", BOTTOM_CENTER: "bottom-center", BOTTOM_RIGHT: "bottom-right" };
var MIN_CROP = { WIDTH: 14, HEIGHT: 14 };
var CLOSING_REASONS = { AFTER_SAVE: "after-saving", CLOSE_BUTTON: "close-button-clicked", BACK_BUTTON: "back-button-clicked" };
var FEEDBACK_STATUSES = { WARNING: "warning", ERROR: "error" };
var EDITOR_TO_CLOUDIMG_POSITIONS = { top: "north", bottom: "south", left: "west", center: "center", right: "east" };
var CLOUDIMG_TO_EDITOR_POSITIONS = { northwest: "top-left", northcenter: "top-center", northeast: "top-right", centerwest: "center-left", centercenter: "center-center", centereast: "center-right", southwest: "bottom-left", southcenter: "bottom-center", southeast: "bottom-right" };
var cropImage = function(a, b2) {
  var c2 = !!(2 < arguments.length && arguments[2] !== void 0) && arguments[2];
  b2.ratio !== ELLIPSE_CROP || c2 ? a.rect(b2.x, b2.y, b2.width, b2.height) : a.ellipse(b2.x + b2.width / 2, b2.y + b2.height / 2, b2.width / 2, b2.height / 2, 0, 0, 2 * Math.PI);
};
function ownKeys$1h(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1h(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1h(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1h(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ADD_FILTER = "ADD_FILTER";
var addFilter = function(a, b2) {
  return _objectSpread$1h(_objectSpread$1h({}, a), {}, { isDesignState: !b2.dismissHistory, filter: b2.filter || null });
};
function ownKeys$1g(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1g(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1g(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1g(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var HIDE_LOADER = "HIDE_LOADER";
var hideLoader = function(a) {
  return _objectSpread$1g(_objectSpread$1g({}, a), {}, { isLoadingGlobally: false });
};
function _toArray(r2) {
  return _arrayWithHoles(r2) || _iterableToArray(r2) || _unsupportedIterableToArray$1(r2) || _nonIterableRest();
}
var _theme$annotationsCom;
const defaultConfig = (_theme$annotationsCom = { theme: { palette: { "bg-primary-active": "#ECF3FF" }, typography: { fontFamily: "Roboto, Arial" } }, annotationsCommon: { fill: "#000000", stroke: "#000000", strokeWidth: 0, shadowOffsetX: 0, shadowOffsetY: 0, shadowBlur: 0, shadowColor: "#000000", shadowOpacity: 1, opacity: 1 } }, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_theme$annotationsCom, TOOLS_IDS.TEXT, { text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", fontFamily: "Arial", fonts: [{ label: "Arial", value: "Arial" }, "Tahoma", "Sans-serif", { label: "Comic Sans", value: "Comic-sans" }], fontSize: 14, letterSpacing: 0, lineHeight: 1, align: "left", fontStyle: "normal", onFontChange: void 0 }), TOOLS_IDS.IMAGE, { fill: void 0, disableUpload: false, gallery: [] }), TOOLS_IDS.RECT, { cornerRadius: 0 }), TOOLS_IDS.ELLIPSE, {}), TOOLS_IDS.POLYGON, { sides: 3 }), TOOLS_IDS.PEN, { strokeWidth: 1, tension: 0.5, lineCap: "round", selectAnnotationAfterDrawing: true }), TOOLS_IDS.LINE, { lineCap: "butt", strokeWidth: 1 }), TOOLS_IDS.ARROW, { strokeWidth: 6, lineCap: "butt", pointerLength: void 0, pointerWidth: void 0 }), TOOLS_IDS.WATERMARK, { gallery: [], textScalingRatio: 0.5, imageScalingRatio: 0.5, hideTextWatermark: false, onUploadWatermarkImgClick: void 0 }), TOOLS_IDS.CROP, { minWidth: MIN_CROP.WIDTH, minHeight: MIN_CROP.HEIGHT, width: null, height: null, maxWidth: null, maxHeight: null, ratio: null, ratioTitleKey: void 0, noPresets: false, autoResize: false, presetsItems: [], presetsFolders: [], lockCropAreaAt: null }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_theme$annotationsCom, TOOLS_IDS.ROTATE, { angle: 60, componentType: "slider" }), "tabsIds", []), "defaultTabId", TABS_IDS.ADJUST), "defaultToolId", TOOLS_IDS.CROP), "onClose", void 0), "onSave", void 0), "onBeforeSave", void 0), "closeAfterSave", false), "defaultSavedImageName", void 0), "defaultSavedImageType", null), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_theme$annotationsCom, "defaultSavedImageQuality", 0.92), "forceToPngInEllipticalCrop", false), "useBackendTranslations", true), "translations", null), "language", "en"), "avoidChangesNotSavedAlertOnLeave", false), "loadableDesignState", null), "moreSaveOptions", []), "savingPixelRatio", 4), "previewPixelRatio", window ? window.devicePixelRatio || 1 : 1), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_theme$annotationsCom, "showBackButton", false), "useCloudimage", false), "cloudimage", { token: "", dontPrefixUrl: false, domain: "cloudimg.io", version: "", loadableQuery: "", secureProtocol: true, imageSealing: { enable: false, salt: "", charCount: 10, includeParams: [] } }), "observePluginContainerSize", false), "showCanvasOnly", false), "getCurrentImgDataFnRef", void 0), "onModify", void 0), "useZoomPresetsMenu", true), "disableZooming", false), "noCrossOrigin", false), _defineProperty(_defineProperty(_defineProperty(_theme$annotationsCom, "disableSaveIfNoChanges", false), "removeSaveButton", false), "resetOnImageSourceChange", false));
var lib$1 = { exports: {} };
var _FullInternals = {};
var _CoreInternals = {};
var Global = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports._registerNode = exports.Konva = exports.glob = void 0;
  const PI_OVER_180 = Math.PI / 180;
  function detectBrowser() {
    return typeof window !== "undefined" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
  }
  exports.glob = typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" ? self : {};
  exports.Konva = {
    _global: exports.glob,
    version: "9.3.6",
    isBrowser: detectBrowser(),
    isUnminified: /param/.test(function(param) {
    }.toString()),
    dblClickWindow: 400,
    getAngle(angle) {
      return exports.Konva.angleDeg ? angle * PI_OVER_180 : angle;
    },
    enableTrace: false,
    pointerEventsEnabled: true,
    autoDrawEnabled: true,
    hitOnDragEnabled: false,
    capturePointerEventsEnabled: false,
    _mouseListenClick: false,
    _touchListenClick: false,
    _pointerListenClick: false,
    _mouseInDblClickWindow: false,
    _touchInDblClickWindow: false,
    _pointerInDblClickWindow: false,
    _mouseDblClickPointerId: null,
    _touchDblClickPointerId: null,
    _pointerDblClickPointerId: null,
    pixelRatio: typeof window !== "undefined" && window.devicePixelRatio || 1,
    dragDistance: 3,
    angleDeg: true,
    showWarnings: true,
    dragButtons: [0, 1],
    isDragging() {
      return exports.Konva["DD"].isDragging;
    },
    isTransforming() {
      var _a2;
      return (_a2 = exports.Konva["Transformer"]) === null || _a2 === void 0 ? void 0 : _a2.isTransforming();
    },
    isDragReady() {
      return !!exports.Konva["DD"].node;
    },
    releaseCanvasOnDestroy: true,
    document: exports.glob.document,
    _injectGlobal(Konva2) {
      exports.glob.Konva = Konva2;
    }
  };
  const _registerNode = (NodeClass) => {
    exports.Konva[NodeClass.prototype.getClassName()] = NodeClass;
  };
  exports._registerNode = _registerNode;
  exports.Konva._injectGlobal(exports.Konva);
})(Global);
var Util = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Util = exports.Transform = void 0;
  const Global_12 = Global;
  class Transform {
    constructor(m2 = [1, 0, 0, 1, 0, 0]) {
      this.dirty = false;
      this.m = m2 && m2.slice() || [1, 0, 0, 1, 0, 0];
    }
    reset() {
      this.m[0] = 1;
      this.m[1] = 0;
      this.m[2] = 0;
      this.m[3] = 1;
      this.m[4] = 0;
      this.m[5] = 0;
    }
    copy() {
      return new Transform(this.m);
    }
    copyInto(tr) {
      tr.m[0] = this.m[0];
      tr.m[1] = this.m[1];
      tr.m[2] = this.m[2];
      tr.m[3] = this.m[3];
      tr.m[4] = this.m[4];
      tr.m[5] = this.m[5];
    }
    point(point) {
      var m2 = this.m;
      return {
        x: m2[0] * point.x + m2[2] * point.y + m2[4],
        y: m2[1] * point.x + m2[3] * point.y + m2[5]
      };
    }
    translate(x2, y2) {
      this.m[4] += this.m[0] * x2 + this.m[2] * y2;
      this.m[5] += this.m[1] * x2 + this.m[3] * y2;
      return this;
    }
    scale(sx, sy) {
      this.m[0] *= sx;
      this.m[1] *= sx;
      this.m[2] *= sy;
      this.m[3] *= sy;
      return this;
    }
    rotate(rad) {
      var c2 = Math.cos(rad);
      var s = Math.sin(rad);
      var m11 = this.m[0] * c2 + this.m[2] * s;
      var m12 = this.m[1] * c2 + this.m[3] * s;
      var m21 = this.m[0] * -s + this.m[2] * c2;
      var m22 = this.m[1] * -s + this.m[3] * c2;
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      return this;
    }
    getTranslation() {
      return {
        x: this.m[4],
        y: this.m[5]
      };
    }
    skew(sx, sy) {
      var m11 = this.m[0] + this.m[2] * sy;
      var m12 = this.m[1] + this.m[3] * sy;
      var m21 = this.m[2] + this.m[0] * sx;
      var m22 = this.m[3] + this.m[1] * sx;
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      return this;
    }
    multiply(matrix) {
      var m11 = this.m[0] * matrix.m[0] + this.m[2] * matrix.m[1];
      var m12 = this.m[1] * matrix.m[0] + this.m[3] * matrix.m[1];
      var m21 = this.m[0] * matrix.m[2] + this.m[2] * matrix.m[3];
      var m22 = this.m[1] * matrix.m[2] + this.m[3] * matrix.m[3];
      var dx = this.m[0] * matrix.m[4] + this.m[2] * matrix.m[5] + this.m[4];
      var dy = this.m[1] * matrix.m[4] + this.m[3] * matrix.m[5] + this.m[5];
      this.m[0] = m11;
      this.m[1] = m12;
      this.m[2] = m21;
      this.m[3] = m22;
      this.m[4] = dx;
      this.m[5] = dy;
      return this;
    }
    invert() {
      var d2 = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]);
      var m0 = this.m[3] * d2;
      var m1 = -this.m[1] * d2;
      var m2 = -this.m[2] * d2;
      var m3 = this.m[0] * d2;
      var m4 = d2 * (this.m[2] * this.m[5] - this.m[3] * this.m[4]);
      var m5 = d2 * (this.m[1] * this.m[4] - this.m[0] * this.m[5]);
      this.m[0] = m0;
      this.m[1] = m1;
      this.m[2] = m2;
      this.m[3] = m3;
      this.m[4] = m4;
      this.m[5] = m5;
      return this;
    }
    getMatrix() {
      return this.m;
    }
    decompose() {
      var a = this.m[0];
      var b2 = this.m[1];
      var c2 = this.m[2];
      var d2 = this.m[3];
      var e2 = this.m[4];
      var f2 = this.m[5];
      var delta = a * d2 - b2 * c2;
      let result = {
        x: e2,
        y: f2,
        rotation: 0,
        scaleX: 0,
        scaleY: 0,
        skewX: 0,
        skewY: 0
      };
      if (a != 0 || b2 != 0) {
        var r2 = Math.sqrt(a * a + b2 * b2);
        result.rotation = b2 > 0 ? Math.acos(a / r2) : -Math.acos(a / r2);
        result.scaleX = r2;
        result.scaleY = delta / r2;
        result.skewX = (a * c2 + b2 * d2) / delta;
        result.skewY = 0;
      } else if (c2 != 0 || d2 != 0) {
        var s = Math.sqrt(c2 * c2 + d2 * d2);
        result.rotation = Math.PI / 2 - (d2 > 0 ? Math.acos(-c2 / s) : -Math.acos(c2 / s));
        result.scaleX = delta / s;
        result.scaleY = s;
        result.skewX = 0;
        result.skewY = (a * c2 + b2 * d2) / delta;
      } else ;
      result.rotation = exports.Util._getRotation(result.rotation);
      return result;
    }
  }
  exports.Transform = Transform;
  var OBJECT_ARRAY = "[object Array]", OBJECT_NUMBER = "[object Number]", OBJECT_STRING = "[object String]", OBJECT_BOOLEAN = "[object Boolean]", PI_OVER_DEG180 = Math.PI / 180, DEG180_OVER_PI = 180 / Math.PI, HASH2 = "#", EMPTY_STRING2 = "", ZERO = "0", KONVA_WARNING = "Konva warning: ", KONVA_ERROR = "Konva error: ", RGB_PAREN = "rgb(", COLORS = {
    aliceblue: [240, 248, 255],
    antiquewhite: [250, 235, 215],
    aqua: [0, 255, 255],
    aquamarine: [127, 255, 212],
    azure: [240, 255, 255],
    beige: [245, 245, 220],
    bisque: [255, 228, 196],
    black: [0, 0, 0],
    blanchedalmond: [255, 235, 205],
    blue: [0, 0, 255],
    blueviolet: [138, 43, 226],
    brown: [165, 42, 42],
    burlywood: [222, 184, 135],
    cadetblue: [95, 158, 160],
    chartreuse: [127, 255, 0],
    chocolate: [210, 105, 30],
    coral: [255, 127, 80],
    cornflowerblue: [100, 149, 237],
    cornsilk: [255, 248, 220],
    crimson: [220, 20, 60],
    cyan: [0, 255, 255],
    darkblue: [0, 0, 139],
    darkcyan: [0, 139, 139],
    darkgoldenrod: [184, 132, 11],
    darkgray: [169, 169, 169],
    darkgreen: [0, 100, 0],
    darkgrey: [169, 169, 169],
    darkkhaki: [189, 183, 107],
    darkmagenta: [139, 0, 139],
    darkolivegreen: [85, 107, 47],
    darkorange: [255, 140, 0],
    darkorchid: [153, 50, 204],
    darkred: [139, 0, 0],
    darksalmon: [233, 150, 122],
    darkseagreen: [143, 188, 143],
    darkslateblue: [72, 61, 139],
    darkslategray: [47, 79, 79],
    darkslategrey: [47, 79, 79],
    darkturquoise: [0, 206, 209],
    darkviolet: [148, 0, 211],
    deeppink: [255, 20, 147],
    deepskyblue: [0, 191, 255],
    dimgray: [105, 105, 105],
    dimgrey: [105, 105, 105],
    dodgerblue: [30, 144, 255],
    firebrick: [178, 34, 34],
    floralwhite: [255, 255, 240],
    forestgreen: [34, 139, 34],
    fuchsia: [255, 0, 255],
    gainsboro: [220, 220, 220],
    ghostwhite: [248, 248, 255],
    gold: [255, 215, 0],
    goldenrod: [218, 165, 32],
    gray: [128, 128, 128],
    green: [0, 128, 0],
    greenyellow: [173, 255, 47],
    grey: [128, 128, 128],
    honeydew: [240, 255, 240],
    hotpink: [255, 105, 180],
    indianred: [205, 92, 92],
    indigo: [75, 0, 130],
    ivory: [255, 255, 240],
    khaki: [240, 230, 140],
    lavender: [230, 230, 250],
    lavenderblush: [255, 240, 245],
    lawngreen: [124, 252, 0],
    lemonchiffon: [255, 250, 205],
    lightblue: [173, 216, 230],
    lightcoral: [240, 128, 128],
    lightcyan: [224, 255, 255],
    lightgoldenrodyellow: [250, 250, 210],
    lightgray: [211, 211, 211],
    lightgreen: [144, 238, 144],
    lightgrey: [211, 211, 211],
    lightpink: [255, 182, 193],
    lightsalmon: [255, 160, 122],
    lightseagreen: [32, 178, 170],
    lightskyblue: [135, 206, 250],
    lightslategray: [119, 136, 153],
    lightslategrey: [119, 136, 153],
    lightsteelblue: [176, 196, 222],
    lightyellow: [255, 255, 224],
    lime: [0, 255, 0],
    limegreen: [50, 205, 50],
    linen: [250, 240, 230],
    magenta: [255, 0, 255],
    maroon: [128, 0, 0],
    mediumaquamarine: [102, 205, 170],
    mediumblue: [0, 0, 205],
    mediumorchid: [186, 85, 211],
    mediumpurple: [147, 112, 219],
    mediumseagreen: [60, 179, 113],
    mediumslateblue: [123, 104, 238],
    mediumspringgreen: [0, 250, 154],
    mediumturquoise: [72, 209, 204],
    mediumvioletred: [199, 21, 133],
    midnightblue: [25, 25, 112],
    mintcream: [245, 255, 250],
    mistyrose: [255, 228, 225],
    moccasin: [255, 228, 181],
    navajowhite: [255, 222, 173],
    navy: [0, 0, 128],
    oldlace: [253, 245, 230],
    olive: [128, 128, 0],
    olivedrab: [107, 142, 35],
    orange: [255, 165, 0],
    orangered: [255, 69, 0],
    orchid: [218, 112, 214],
    palegoldenrod: [238, 232, 170],
    palegreen: [152, 251, 152],
    paleturquoise: [175, 238, 238],
    palevioletred: [219, 112, 147],
    papayawhip: [255, 239, 213],
    peachpuff: [255, 218, 185],
    peru: [205, 133, 63],
    pink: [255, 192, 203],
    plum: [221, 160, 203],
    powderblue: [176, 224, 230],
    purple: [128, 0, 128],
    rebeccapurple: [102, 51, 153],
    red: [255, 0, 0],
    rosybrown: [188, 143, 143],
    royalblue: [65, 105, 225],
    saddlebrown: [139, 69, 19],
    salmon: [250, 128, 114],
    sandybrown: [244, 164, 96],
    seagreen: [46, 139, 87],
    seashell: [255, 245, 238],
    sienna: [160, 82, 45],
    silver: [192, 192, 192],
    skyblue: [135, 206, 235],
    slateblue: [106, 90, 205],
    slategray: [119, 128, 144],
    slategrey: [119, 128, 144],
    snow: [255, 255, 250],
    springgreen: [0, 255, 127],
    steelblue: [70, 130, 180],
    tan: [210, 180, 140],
    teal: [0, 128, 128],
    thistle: [216, 191, 216],
    transparent: [255, 255, 255, 0],
    tomato: [255, 99, 71],
    turquoise: [64, 224, 208],
    violet: [238, 130, 238],
    wheat: [245, 222, 179],
    white: [255, 255, 255],
    whitesmoke: [245, 245, 245],
    yellow: [255, 255, 0],
    yellowgreen: [154, 205, 5]
  }, RGB_REGEX = /rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/, animQueue = [];
  const req = typeof requestAnimationFrame !== "undefined" && requestAnimationFrame || function(f2) {
    setTimeout(f2, 60);
  };
  exports.Util = {
    _isElement(obj) {
      return !!(obj && obj.nodeType == 1);
    },
    _isFunction(obj) {
      return !!(obj && obj.constructor && obj.call && obj.apply);
    },
    _isPlainObject(obj) {
      return !!obj && obj.constructor === Object;
    },
    _isArray(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_ARRAY;
    },
    _isNumber(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_NUMBER && !isNaN(obj) && isFinite(obj);
    },
    _isString(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_STRING;
    },
    _isBoolean(obj) {
      return Object.prototype.toString.call(obj) === OBJECT_BOOLEAN;
    },
    isObject(val) {
      return val instanceof Object;
    },
    isValidSelector(selector) {
      if (typeof selector !== "string") {
        return false;
      }
      var firstChar = selector[0];
      return firstChar === "#" || firstChar === "." || firstChar === firstChar.toUpperCase();
    },
    _sign(number) {
      if (number === 0) {
        return 1;
      }
      if (number > 0) {
        return 1;
      } else {
        return -1;
      }
    },
    requestAnimFrame(callback) {
      animQueue.push(callback);
      if (animQueue.length === 1) {
        req(function() {
          const queue = animQueue;
          animQueue = [];
          queue.forEach(function(cb2) {
            cb2();
          });
        });
      }
    },
    createCanvasElement() {
      var canvas = document.createElement("canvas");
      try {
        canvas.style = canvas.style || {};
      } catch (e2) {
      }
      return canvas;
    },
    createImageElement() {
      return document.createElement("img");
    },
    _isInDocument(el2) {
      while (el2 = el2.parentNode) {
        if (el2 == document) {
          return true;
        }
      }
      return false;
    },
    _urlToImage(url, callback) {
      var imageObj = exports.Util.createImageElement();
      imageObj.onload = function() {
        callback(imageObj);
      };
      imageObj.src = url;
    },
    _rgbToHex(r2, g2, b2) {
      return ((1 << 24) + (r2 << 16) + (g2 << 8) + b2).toString(16).slice(1);
    },
    _hexToRgb(hex) {
      hex = hex.replace(HASH2, EMPTY_STRING2);
      var bigint = parseInt(hex, 16);
      return {
        r: bigint >> 16 & 255,
        g: bigint >> 8 & 255,
        b: bigint & 255
      };
    },
    getRandomColor() {
      var randColor = (Math.random() * 16777215 << 0).toString(16);
      while (randColor.length < 6) {
        randColor = ZERO + randColor;
      }
      return HASH2 + randColor;
    },
    getRGB(color) {
      var rgb;
      if (color in COLORS) {
        rgb = COLORS[color];
        return {
          r: rgb[0],
          g: rgb[1],
          b: rgb[2]
        };
      } else if (color[0] === HASH2) {
        return this._hexToRgb(color.substring(1));
      } else if (color.substr(0, 4) === RGB_PAREN) {
        rgb = RGB_REGEX.exec(color.replace(/ /g, ""));
        return {
          r: parseInt(rgb[1], 10),
          g: parseInt(rgb[2], 10),
          b: parseInt(rgb[3], 10)
        };
      } else {
        return {
          r: 0,
          g: 0,
          b: 0
        };
      }
    },
    colorToRGBA(str) {
      str = str || "black";
      return exports.Util._namedColorToRBA(str) || exports.Util._hex3ColorToRGBA(str) || exports.Util._hex4ColorToRGBA(str) || exports.Util._hex6ColorToRGBA(str) || exports.Util._hex8ColorToRGBA(str) || exports.Util._rgbColorToRGBA(str) || exports.Util._rgbaColorToRGBA(str) || exports.Util._hslColorToRGBA(str);
    },
    _namedColorToRBA(str) {
      var c2 = COLORS[str.toLowerCase()];
      if (!c2) {
        return null;
      }
      return {
        r: c2[0],
        g: c2[1],
        b: c2[2],
        a: 1
      };
    },
    _rgbColorToRGBA(str) {
      if (str.indexOf("rgb(") === 0) {
        str = str.match(/rgb\(([^)]+)\)/)[1];
        var parts = str.split(/ *, */).map(Number);
        return {
          r: parts[0],
          g: parts[1],
          b: parts[2],
          a: 1
        };
      }
    },
    _rgbaColorToRGBA(str) {
      if (str.indexOf("rgba(") === 0) {
        str = str.match(/rgba\(([^)]+)\)/)[1];
        var parts = str.split(/ *, */).map((n2, index) => {
          if (n2.slice(-1) === "%") {
            return index === 3 ? parseInt(n2) / 100 : parseInt(n2) / 100 * 255;
          }
          return Number(n2);
        });
        return {
          r: parts[0],
          g: parts[1],
          b: parts[2],
          a: parts[3]
        };
      }
    },
    _hex8ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 9) {
        return {
          r: parseInt(str.slice(1, 3), 16),
          g: parseInt(str.slice(3, 5), 16),
          b: parseInt(str.slice(5, 7), 16),
          a: parseInt(str.slice(7, 9), 16) / 255
        };
      }
    },
    _hex6ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 7) {
        return {
          r: parseInt(str.slice(1, 3), 16),
          g: parseInt(str.slice(3, 5), 16),
          b: parseInt(str.slice(5, 7), 16),
          a: 1
        };
      }
    },
    _hex4ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 5) {
        return {
          r: parseInt(str[1] + str[1], 16),
          g: parseInt(str[2] + str[2], 16),
          b: parseInt(str[3] + str[3], 16),
          a: parseInt(str[4] + str[4], 16) / 255
        };
      }
    },
    _hex3ColorToRGBA(str) {
      if (str[0] === "#" && str.length === 4) {
        return {
          r: parseInt(str[1] + str[1], 16),
          g: parseInt(str[2] + str[2], 16),
          b: parseInt(str[3] + str[3], 16),
          a: 1
        };
      }
    },
    _hslColorToRGBA(str) {
      if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
        const [_2, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str);
        const h2 = Number(hsl[0]) / 360;
        const s = Number(hsl[1]) / 100;
        const l2 = Number(hsl[2]) / 100;
        let t2;
        let t3;
        let val;
        if (s === 0) {
          val = l2 * 255;
          return {
            r: Math.round(val),
            g: Math.round(val),
            b: Math.round(val),
            a: 1
          };
        }
        if (l2 < 0.5) {
          t2 = l2 * (1 + s);
        } else {
          t2 = l2 + s - l2 * s;
        }
        const t1 = 2 * l2 - t2;
        const rgb = [0, 0, 0];
        for (let i = 0; i < 3; i++) {
          t3 = h2 + 1 / 3 * -(i - 1);
          if (t3 < 0) {
            t3++;
          }
          if (t3 > 1) {
            t3--;
          }
          if (6 * t3 < 1) {
            val = t1 + (t2 - t1) * 6 * t3;
          } else if (2 * t3 < 1) {
            val = t2;
          } else if (3 * t3 < 2) {
            val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
          } else {
            val = t1;
          }
          rgb[i] = val * 255;
        }
        return {
          r: Math.round(rgb[0]),
          g: Math.round(rgb[1]),
          b: Math.round(rgb[2]),
          a: 1
        };
      }
    },
    haveIntersection(r1, r2) {
      return !(r2.x > r1.x + r1.width || r2.x + r2.width < r1.x || r2.y > r1.y + r1.height || r2.y + r2.height < r1.y);
    },
    cloneObject(obj) {
      var retObj = {};
      for (var key in obj) {
        if (this._isPlainObject(obj[key])) {
          retObj[key] = this.cloneObject(obj[key]);
        } else if (this._isArray(obj[key])) {
          retObj[key] = this.cloneArray(obj[key]);
        } else {
          retObj[key] = obj[key];
        }
      }
      return retObj;
    },
    cloneArray(arr) {
      return arr.slice(0);
    },
    degToRad(deg) {
      return deg * PI_OVER_DEG180;
    },
    radToDeg(rad) {
      return rad * DEG180_OVER_PI;
    },
    _degToRad(deg) {
      exports.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead.");
      return exports.Util.degToRad(deg);
    },
    _radToDeg(rad) {
      exports.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead.");
      return exports.Util.radToDeg(rad);
    },
    _getRotation(radians) {
      return Global_12.Konva.angleDeg ? exports.Util.radToDeg(radians) : radians;
    },
    _capitalize(str) {
      return str.charAt(0).toUpperCase() + str.slice(1);
    },
    throw(str) {
      throw new Error(KONVA_ERROR + str);
    },
    error(str) {
      console.error(KONVA_ERROR + str);
    },
    warn(str) {
      if (!Global_12.Konva.showWarnings) {
        return;
      }
      console.warn(KONVA_WARNING + str);
    },
    each(obj, func) {
      for (var key in obj) {
        func(key, obj[key]);
      }
    },
    _inRange(val, left2, right2) {
      return left2 <= val && val < right2;
    },
    _getProjectionToSegment(x1, y1, x2, y2, x3, y3) {
      var x4, y4, dist;
      var pd2 = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
      if (pd2 == 0) {
        x4 = x1;
        y4 = y1;
        dist = (x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2);
      } else {
        var u2 = ((x3 - x1) * (x2 - x1) + (y3 - y1) * (y2 - y1)) / pd2;
        if (u2 < 0) {
          x4 = x1;
          y4 = y1;
          dist = (x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3);
        } else if (u2 > 1) {
          x4 = x2;
          y4 = y2;
          dist = (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3);
        } else {
          x4 = x1 + u2 * (x2 - x1);
          y4 = y1 + u2 * (y2 - y1);
          dist = (x4 - x3) * (x4 - x3) + (y4 - y3) * (y4 - y3);
        }
      }
      return [x4, y4, dist];
    },
    _getProjectionToLine(pt, line, isClosed) {
      var pc2 = exports.Util.cloneObject(pt);
      var dist = Number.MAX_VALUE;
      line.forEach(function(p1, i) {
        if (!isClosed && i === line.length - 1) {
          return;
        }
        var p2 = line[(i + 1) % line.length];
        var proj = exports.Util._getProjectionToSegment(p1.x, p1.y, p2.x, p2.y, pt.x, pt.y);
        var px = proj[0], py = proj[1], pdist = proj[2];
        if (pdist < dist) {
          pc2.x = px;
          pc2.y = py;
          dist = pdist;
        }
      });
      return pc2;
    },
    _prepareArrayForTween(startArray, endArray, isClosed) {
      var n2, start2 = [], end2 = [];
      if (startArray.length > endArray.length) {
        var temp = endArray;
        endArray = startArray;
        startArray = temp;
      }
      for (n2 = 0; n2 < startArray.length; n2 += 2) {
        start2.push({
          x: startArray[n2],
          y: startArray[n2 + 1]
        });
      }
      for (n2 = 0; n2 < endArray.length; n2 += 2) {
        end2.push({
          x: endArray[n2],
          y: endArray[n2 + 1]
        });
      }
      var newStart = [];
      end2.forEach(function(point) {
        var pr = exports.Util._getProjectionToLine(point, start2, isClosed);
        newStart.push(pr.x);
        newStart.push(pr.y);
      });
      return newStart;
    },
    _prepareToStringify(obj) {
      var desc;
      obj.visitedByCircularReferenceRemoval = true;
      for (var key in obj) {
        if (!(obj.hasOwnProperty(key) && obj[key] && typeof obj[key] == "object")) {
          continue;
        }
        desc = Object.getOwnPropertyDescriptor(obj, key);
        if (obj[key].visitedByCircularReferenceRemoval || exports.Util._isElement(obj[key])) {
          if (desc.configurable) {
            delete obj[key];
          } else {
            return null;
          }
        } else if (exports.Util._prepareToStringify(obj[key]) === null) {
          if (desc.configurable) {
            delete obj[key];
          } else {
            return null;
          }
        }
      }
      delete obj.visitedByCircularReferenceRemoval;
      return obj;
    },
    _assign(target, source) {
      for (var key in source) {
        target[key] = source[key];
      }
      return target;
    },
    _getFirstPointerId(evt) {
      if (!evt.touches) {
        return evt.pointerId || 999;
      } else {
        return evt.changedTouches[0].identifier;
      }
    },
    releaseCanvas(...canvases) {
      if (!Global_12.Konva.releaseCanvasOnDestroy)
        return;
      canvases.forEach((c2) => {
        c2.width = 0;
        c2.height = 0;
      });
    },
    drawRoundedRectPath(context, width, height, cornerRadius) {
      let topLeft = 0;
      let topRight = 0;
      let bottomLeft = 0;
      let bottomRight = 0;
      if (typeof cornerRadius === "number") {
        topLeft = topRight = bottomLeft = bottomRight = Math.min(cornerRadius, width / 2, height / 2);
      } else {
        topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);
        topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);
        bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);
        bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);
      }
      context.moveTo(topLeft, 0);
      context.lineTo(width - topRight, 0);
      context.arc(width - topRight, topRight, topRight, Math.PI * 3 / 2, 0, false);
      context.lineTo(width, height - bottomRight);
      context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);
      context.lineTo(bottomLeft, height);
      context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);
      context.lineTo(0, topLeft);
      context.arc(topLeft, topLeft, topLeft, Math.PI, Math.PI * 3 / 2, false);
    }
  };
})(Util);
var Node$1 = {};
var Factory = {};
var Validators = {};
Object.defineProperty(Validators, "__esModule", { value: true });
Validators.getComponentValidator = Validators.getBooleanValidator = Validators.getNumberArrayValidator = Validators.getFunctionValidator = Validators.getStringOrGradientValidator = Validators.getStringValidator = Validators.getNumberOrAutoValidator = Validators.getNumberOrArrayOfNumbersValidator = getNumberValidator_1 = Validators.getNumberValidator = Validators.alphaComponent = Validators.RGBComponent = void 0;
const Global_1$p = Global;
const Util_1$f = Util;
function _formatValue(val) {
  if (Util_1$f.Util._isString(val)) {
    return '"' + val + '"';
  }
  if (Object.prototype.toString.call(val) === "[object Number]") {
    return val;
  }
  if (Util_1$f.Util._isBoolean(val)) {
    return val;
  }
  return Object.prototype.toString.call(val);
}
function RGBComponent(val) {
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  }
  return Math.round(val);
}
Validators.RGBComponent = RGBComponent;
function alphaComponent(val) {
  if (val > 1) {
    return 1;
  } else if (val < 1e-4) {
    return 1e-4;
  }
  return val;
}
Validators.alphaComponent = alphaComponent;
function getNumberValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$f.Util._isNumber(val)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number.');
      }
      return val;
    };
  }
}
var getNumberValidator_1 = Validators.getNumberValidator = getNumberValidator;
function getNumberOrArrayOfNumbersValidator(noOfElements) {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      let isNumber = Util_1$f.Util._isNumber(val);
      let isValidArray = Util_1$f.Util._isArray(val) && val.length == noOfElements;
      if (!isNumber && !isValidArray) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number or Array<number>(' + noOfElements + ")");
      }
      return val;
    };
  }
}
Validators.getNumberOrArrayOfNumbersValidator = getNumberOrArrayOfNumbersValidator;
function getNumberOrAutoValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      var isNumber = Util_1$f.Util._isNumber(val);
      var isAuto = val === "auto";
      if (!(isNumber || isAuto)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a number or "auto".');
      }
      return val;
    };
  }
}
Validators.getNumberOrAutoValidator = getNumberOrAutoValidator;
function getStringValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$f.Util._isString(val)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a string.');
      }
      return val;
    };
  }
}
Validators.getStringValidator = getStringValidator;
function getStringOrGradientValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      const isString = Util_1$f.Util._isString(val);
      const isGradient = Object.prototype.toString.call(val) === "[object CanvasGradient]" || val && val.addColorStop;
      if (!(isString || isGradient)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a string or a native gradient.');
      }
      return val;
    };
  }
}
Validators.getStringOrGradientValidator = getStringOrGradientValidator;
function getFunctionValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      if (!Util_1$f.Util._isFunction(val)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a function.');
      }
      return val;
    };
  }
}
Validators.getFunctionValidator = getFunctionValidator;
function getNumberArrayValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      const TypedArray = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
      if (TypedArray && val instanceof TypedArray) {
        return val;
      }
      if (!Util_1$f.Util._isArray(val)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a array of numbers.');
      } else {
        val.forEach(function(item) {
          if (!Util_1$f.Util._isNumber(item)) {
            Util_1$f.Util.warn('"' + attr + '" attribute has non numeric element ' + item + ". Make sure that all elements are numbers.");
          }
        });
      }
      return val;
    };
  }
}
Validators.getNumberArrayValidator = getNumberArrayValidator;
function getBooleanValidator() {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      var isBool = val === true || val === false;
      if (!isBool) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be a boolean.');
      }
      return val;
    };
  }
}
Validators.getBooleanValidator = getBooleanValidator;
function getComponentValidator(components) {
  if (Global_1$p.Konva.isUnminified) {
    return function(val, attr) {
      if (val === void 0 || val === null) {
        return val;
      }
      if (!Util_1$f.Util.isObject(val)) {
        Util_1$f.Util.warn(_formatValue(val) + ' is a not valid value for "' + attr + '" attribute. The value should be an object with properties ' + components);
      }
      return val;
    };
  }
}
Validators.getComponentValidator = getComponentValidator;
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Factory = void 0;
  const Util_12 = Util;
  const Validators_12 = Validators;
  var GET = "get", SET2 = "set";
  exports.Factory = {
    addGetterSetter(constructor, attr, def, validator, after) {
      exports.Factory.addGetter(constructor, attr, def);
      exports.Factory.addSetter(constructor, attr, validator, after);
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    addGetter(constructor, attr, def) {
      var method = GET + Util_12.Util._capitalize(attr);
      constructor.prototype[method] = constructor.prototype[method] || function() {
        var val = this.attrs[attr];
        return val === void 0 ? def : val;
      };
    },
    addSetter(constructor, attr, validator, after) {
      var method = SET2 + Util_12.Util._capitalize(attr);
      if (!constructor.prototype[method]) {
        exports.Factory.overWriteSetter(constructor, attr, validator, after);
      }
    },
    overWriteSetter(constructor, attr, validator, after) {
      var method = SET2 + Util_12.Util._capitalize(attr);
      constructor.prototype[method] = function(val) {
        if (validator && val !== void 0 && val !== null) {
          val = validator.call(this, val, attr);
        }
        this._setAttr(attr, val);
        if (after) {
          after.call(this);
        }
        return this;
      };
    },
    addComponentsGetterSetter(constructor, attr, components, validator, after) {
      var len = components.length, capitalize = Util_12.Util._capitalize, getter = GET + capitalize(attr), setter = SET2 + capitalize(attr), n2, component;
      constructor.prototype[getter] = function() {
        var ret = {};
        for (n2 = 0; n2 < len; n2++) {
          component = components[n2];
          ret[component] = this.getAttr(attr + capitalize(component));
        }
        return ret;
      };
      var basicValidator = (0, Validators_12.getComponentValidator)(components);
      constructor.prototype[setter] = function(val) {
        var oldVal = this.attrs[attr], key;
        if (validator) {
          val = validator.call(this, val);
        }
        if (basicValidator) {
          basicValidator.call(this, val, attr);
        }
        for (key in val) {
          if (!val.hasOwnProperty(key)) {
            continue;
          }
          this._setAttr(attr + capitalize(key), val[key]);
        }
        if (!val) {
          components.forEach((component2) => {
            this._setAttr(attr + capitalize(component2), void 0);
          });
        }
        this._fireChangeEvent(attr, oldVal, val);
        if (after) {
          after.call(this);
        }
        return this;
      };
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    addOverloadedGetterSetter(constructor, attr) {
      var capitalizedAttr = Util_12.Util._capitalize(attr), setter = SET2 + capitalizedAttr, getter = GET + capitalizedAttr;
      constructor.prototype[attr] = function() {
        if (arguments.length) {
          this[setter](arguments[0]);
          return this;
        }
        return this[getter]();
      };
    },
    addDeprecatedGetterSetter(constructor, attr, def, validator) {
      Util_12.Util.error("Adding deprecated " + attr);
      var method = GET + Util_12.Util._capitalize(attr);
      var message = attr + " property is deprecated and will be removed soon. Look at Konva change log for more information.";
      constructor.prototype[method] = function() {
        Util_12.Util.error(message);
        var val = this.attrs[attr];
        return val === void 0 ? def : val;
      };
      exports.Factory.addSetter(constructor, attr, validator, function() {
        Util_12.Util.error(message);
      });
      exports.Factory.addOverloadedGetterSetter(constructor, attr);
    },
    backCompat(constructor, methods) {
      Util_12.Util.each(methods, function(oldMethodName, newMethodName) {
        var method = constructor.prototype[newMethodName];
        var oldGetter = GET + Util_12.Util._capitalize(oldMethodName);
        var oldSetter = SET2 + Util_12.Util._capitalize(oldMethodName);
        function deprecated() {
          method.apply(this, arguments);
          Util_12.Util.error('"' + oldMethodName + '" method is deprecated and will be removed soon. Use ""' + newMethodName + '" instead.');
        }
        constructor.prototype[oldMethodName] = deprecated;
        constructor.prototype[oldGetter] = deprecated;
        constructor.prototype[oldSetter] = deprecated;
      });
    },
    afterSetFilter() {
      this._filterUpToDate = false;
    }
  };
})(Factory);
var Canvas$1 = {};
var Context$1 = {};
Object.defineProperty(Context$1, "__esModule", { value: true });
Context$1.HitContext = Context$1.SceneContext = Context$1.Context = void 0;
const Util_1$e = Util;
const Global_1$o = Global;
function simplifyArray(arr) {
  var retArr = [], len = arr.length, util = Util_1$e.Util, n2, val;
  for (n2 = 0; n2 < len; n2++) {
    val = arr[n2];
    if (util._isNumber(val)) {
      val = Math.round(val * 1e3) / 1e3;
    } else if (!util._isString(val)) {
      val = val + "";
    }
    retArr.push(val);
  }
  return retArr;
}
var COMMA = ",", OPEN_PAREN = "(", CLOSE_PAREN = ")", OPEN_PAREN_BRACKET = "([", CLOSE_BRACKET_PAREN = "])", SEMICOLON = ";", DOUBLE_PAREN = "()", EQUALS = "=", CONTEXT_METHODS = [
  "arc",
  "arcTo",
  "beginPath",
  "bezierCurveTo",
  "clearRect",
  "clip",
  "closePath",
  "createLinearGradient",
  "createPattern",
  "createRadialGradient",
  "drawImage",
  "ellipse",
  "fill",
  "fillText",
  "getImageData",
  "createImageData",
  "lineTo",
  "moveTo",
  "putImageData",
  "quadraticCurveTo",
  "rect",
  "roundRect",
  "restore",
  "rotate",
  "save",
  "scale",
  "setLineDash",
  "setTransform",
  "stroke",
  "strokeText",
  "transform",
  "translate"
];
var CONTEXT_PROPERTIES = [
  "fillStyle",
  "strokeStyle",
  "shadowColor",
  "shadowBlur",
  "shadowOffsetX",
  "shadowOffsetY",
  "letterSpacing",
  "lineCap",
  "lineDashOffset",
  "lineJoin",
  "lineWidth",
  "miterLimit",
  "direction",
  "font",
  "textAlign",
  "textBaseline",
  "globalAlpha",
  "globalCompositeOperation",
  "imageSmoothingEnabled"
];
const traceArrMax = 100;
class Context2 {
  constructor(canvas) {
    this.canvas = canvas;
    if (Global_1$o.Konva.enableTrace) {
      this.traceArr = [];
      this._enableTrace();
    }
  }
  fillShape(shape) {
    if (shape.fillEnabled()) {
      this._fill(shape);
    }
  }
  _fill(shape) {
  }
  strokeShape(shape) {
    if (shape.hasStroke()) {
      this._stroke(shape);
    }
  }
  _stroke(shape) {
  }
  fillStrokeShape(shape) {
    if (shape.attrs.fillAfterStrokeEnabled) {
      this.strokeShape(shape);
      this.fillShape(shape);
    } else {
      this.fillShape(shape);
      this.strokeShape(shape);
    }
  }
  getTrace(relaxed, rounded) {
    var traceArr = this.traceArr, len = traceArr.length, str = "", n2, trace, method, args;
    for (n2 = 0; n2 < len; n2++) {
      trace = traceArr[n2];
      method = trace.method;
      if (method) {
        args = trace.args;
        str += method;
        if (relaxed) {
          str += DOUBLE_PAREN;
        } else {
          if (Util_1$e.Util._isArray(args[0])) {
            str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN;
          } else {
            if (rounded) {
              args = args.map((a) => typeof a === "number" ? Math.floor(a) : a);
            }
            str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN;
          }
        }
      } else {
        str += trace.property;
        if (!relaxed) {
          str += EQUALS + trace.val;
        }
      }
      str += SEMICOLON;
    }
    return str;
  }
  clearTrace() {
    this.traceArr = [];
  }
  _trace(str) {
    var traceArr = this.traceArr, len;
    traceArr.push(str);
    len = traceArr.length;
    if (len >= traceArrMax) {
      traceArr.shift();
    }
  }
  reset() {
    var pixelRatio = this.getCanvas().getPixelRatio();
    this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);
  }
  getCanvas() {
    return this.canvas;
  }
  clear(bounds) {
    var canvas = this.getCanvas();
    if (bounds) {
      this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);
    } else {
      this.clearRect(0, 0, canvas.getWidth() / canvas.pixelRatio, canvas.getHeight() / canvas.pixelRatio);
    }
  }
  _applyLineCap(shape) {
    const lineCap = shape.attrs.lineCap;
    if (lineCap) {
      this.setAttr("lineCap", lineCap);
    }
  }
  _applyOpacity(shape) {
    var absOpacity = shape.getAbsoluteOpacity();
    if (absOpacity !== 1) {
      this.setAttr("globalAlpha", absOpacity);
    }
  }
  _applyLineJoin(shape) {
    const lineJoin = shape.attrs.lineJoin;
    if (lineJoin) {
      this.setAttr("lineJoin", lineJoin);
    }
  }
  setAttr(attr, val) {
    this._context[attr] = val;
  }
  arc(x2, y2, radius, startAngle, endAngle, counterClockwise) {
    this._context.arc(x2, y2, radius, startAngle, endAngle, counterClockwise);
  }
  arcTo(x1, y1, x2, y2, radius) {
    this._context.arcTo(x1, y1, x2, y2, radius);
  }
  beginPath() {
    this._context.beginPath();
  }
  bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x2, y2) {
    this._context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x2, y2);
  }
  clearRect(x2, y2, width, height) {
    this._context.clearRect(x2, y2, width, height);
  }
  clip(...args) {
    this._context.clip.apply(this._context, args);
  }
  closePath() {
    this._context.closePath();
  }
  createImageData(width, height) {
    var a = arguments;
    if (a.length === 2) {
      return this._context.createImageData(width, height);
    } else if (a.length === 1) {
      return this._context.createImageData(width);
    }
  }
  createLinearGradient(x0, y0, x1, y1) {
    return this._context.createLinearGradient(x0, y0, x1, y1);
  }
  createPattern(image, repetition) {
    return this._context.createPattern(image, repetition);
  }
  createRadialGradient(x0, y0, r0, x1, y1, r1) {
    return this._context.createRadialGradient(x0, y0, r0, x1, y1, r1);
  }
  drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {
    var a = arguments, _context = this._context;
    if (a.length === 3) {
      _context.drawImage(image, sx, sy);
    } else if (a.length === 5) {
      _context.drawImage(image, sx, sy, sWidth, sHeight);
    } else if (a.length === 9) {
      _context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);
    }
  }
  ellipse(x2, y2, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise) {
    this._context.ellipse(x2, y2, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise);
  }
  isPointInPath(x2, y2, path, fillRule) {
    if (path) {
      return this._context.isPointInPath(path, x2, y2, fillRule);
    }
    return this._context.isPointInPath(x2, y2, fillRule);
  }
  fill(...args) {
    this._context.fill.apply(this._context, args);
  }
  fillRect(x2, y2, width, height) {
    this._context.fillRect(x2, y2, width, height);
  }
  strokeRect(x2, y2, width, height) {
    this._context.strokeRect(x2, y2, width, height);
  }
  fillText(text, x2, y2, maxWidth) {
    if (maxWidth) {
      this._context.fillText(text, x2, y2, maxWidth);
    } else {
      this._context.fillText(text, x2, y2);
    }
  }
  measureText(text) {
    return this._context.measureText(text);
  }
  getImageData(sx, sy, sw, sh2) {
    return this._context.getImageData(sx, sy, sw, sh2);
  }
  lineTo(x2, y2) {
    this._context.lineTo(x2, y2);
  }
  moveTo(x2, y2) {
    this._context.moveTo(x2, y2);
  }
  rect(x2, y2, width, height) {
    this._context.rect(x2, y2, width, height);
  }
  roundRect(x2, y2, width, height, radii) {
    this._context.roundRect(x2, y2, width, height, radii);
  }
  putImageData(imageData, dx, dy) {
    this._context.putImageData(imageData, dx, dy);
  }
  quadraticCurveTo(cpx, cpy, x2, y2) {
    this._context.quadraticCurveTo(cpx, cpy, x2, y2);
  }
  restore() {
    this._context.restore();
  }
  rotate(angle) {
    this._context.rotate(angle);
  }
  save() {
    this._context.save();
  }
  scale(x2, y2) {
    this._context.scale(x2, y2);
  }
  setLineDash(segments) {
    if (this._context.setLineDash) {
      this._context.setLineDash(segments);
    } else if ("mozDash" in this._context) {
      this._context["mozDash"] = segments;
    } else if ("webkitLineDash" in this._context) {
      this._context["webkitLineDash"] = segments;
    }
  }
  getLineDash() {
    return this._context.getLineDash();
  }
  setTransform(a, b2, c2, d2, e2, f2) {
    this._context.setTransform(a, b2, c2, d2, e2, f2);
  }
  stroke(path2d) {
    if (path2d) {
      this._context.stroke(path2d);
    } else {
      this._context.stroke();
    }
  }
  strokeText(text, x2, y2, maxWidth) {
    this._context.strokeText(text, x2, y2, maxWidth);
  }
  transform(a, b2, c2, d2, e2, f2) {
    this._context.transform(a, b2, c2, d2, e2, f2);
  }
  translate(x2, y2) {
    this._context.translate(x2, y2);
  }
  _enableTrace() {
    var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n2, args;
    var func = function(methodName) {
      var origMethod = that[methodName], ret;
      that[methodName] = function() {
        args = simplifyArray(Array.prototype.slice.call(arguments, 0));
        ret = origMethod.apply(that, arguments);
        that._trace({
          method: methodName,
          args
        });
        return ret;
      };
    };
    for (n2 = 0; n2 < len; n2++) {
      func(CONTEXT_METHODS[n2]);
    }
    that.setAttr = function() {
      origSetter.apply(that, arguments);
      var prop = arguments[0];
      var val = arguments[1];
      if (prop === "shadowOffsetX" || prop === "shadowOffsetY" || prop === "shadowBlur") {
        val = val / this.canvas.getPixelRatio();
      }
      that._trace({
        property: prop,
        val
      });
    };
  }
  _applyGlobalCompositeOperation(node) {
    const op = node.attrs.globalCompositeOperation;
    var def = !op || op === "source-over";
    if (!def) {
      this.setAttr("globalCompositeOperation", op);
    }
  }
}
Context$1.Context = Context2;
CONTEXT_PROPERTIES.forEach(function(prop) {
  Object.defineProperty(Context2.prototype, prop, {
    get() {
      return this._context[prop];
    },
    set(val) {
      this._context[prop] = val;
    }
  });
});
class SceneContext2 extends Context2 {
  constructor(canvas, { willReadFrequently = false } = {}) {
    super(canvas);
    this._context = canvas._canvas.getContext("2d", {
      willReadFrequently
    });
  }
  _fillColor(shape) {
    var fill = shape.fill();
    this.setAttr("fillStyle", fill);
    shape._fillFunc(this);
  }
  _fillPattern(shape) {
    this.setAttr("fillStyle", shape._getFillPattern());
    shape._fillFunc(this);
  }
  _fillLinearGradient(shape) {
    var grd = shape._getLinearGradient();
    if (grd) {
      this.setAttr("fillStyle", grd);
      shape._fillFunc(this);
    }
  }
  _fillRadialGradient(shape) {
    const grd = shape._getRadialGradient();
    if (grd) {
      this.setAttr("fillStyle", grd);
      shape._fillFunc(this);
    }
  }
  _fill(shape) {
    const hasColor = shape.fill(), fillPriority = shape.getFillPriority();
    if (hasColor && fillPriority === "color") {
      this._fillColor(shape);
      return;
    }
    const hasPattern = shape.getFillPatternImage();
    if (hasPattern && fillPriority === "pattern") {
      this._fillPattern(shape);
      return;
    }
    const hasLinearGradient = shape.getFillLinearGradientColorStops();
    if (hasLinearGradient && fillPriority === "linear-gradient") {
      this._fillLinearGradient(shape);
      return;
    }
    const hasRadialGradient = shape.getFillRadialGradientColorStops();
    if (hasRadialGradient && fillPriority === "radial-gradient") {
      this._fillRadialGradient(shape);
      return;
    }
    if (hasColor) {
      this._fillColor(shape);
    } else if (hasPattern) {
      this._fillPattern(shape);
    } else if (hasLinearGradient) {
      this._fillLinearGradient(shape);
    } else if (hasRadialGradient) {
      this._fillRadialGradient(shape);
    }
  }
  _strokeLinearGradient(shape) {
    const start2 = shape.getStrokeLinearGradientStartPoint(), end2 = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start2.x, start2.y, end2.x, end2.y);
    if (colorStops) {
      for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
        grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
      }
      this.setAttr("strokeStyle", grd);
    }
  }
  _stroke(shape) {
    var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();
    if (shape.hasStroke()) {
      if (!strokeScaleEnabled) {
        this.save();
        var pixelRatio = this.getCanvas().getPixelRatio();
        this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
      }
      this._applyLineCap(shape);
      if (dash && shape.dashEnabled()) {
        this.setLineDash(dash);
        this.setAttr("lineDashOffset", shape.dashOffset());
      }
      this.setAttr("lineWidth", shape.strokeWidth());
      if (!shape.getShadowForStrokeEnabled()) {
        this.setAttr("shadowColor", "rgba(0,0,0,0)");
      }
      var hasLinearGradient = shape.getStrokeLinearGradientColorStops();
      if (hasLinearGradient) {
        this._strokeLinearGradient(shape);
      } else {
        this.setAttr("strokeStyle", shape.stroke());
      }
      shape._strokeFunc(this);
      if (!strokeScaleEnabled) {
        this.restore();
      }
    }
  }
  _applyShadow(shape) {
    var _a2, _b2, _c;
    var color = (_a2 = shape.getShadowRGBA()) !== null && _a2 !== void 0 ? _a2 : "black", blur = (_b2 = shape.getShadowBlur()) !== null && _b2 !== void 0 ? _b2 : 5, offset5 = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
      x: 0,
      y: 0
    }, scale = shape.getAbsoluteScale(), ratio = this.canvas.getPixelRatio(), scaleX = scale.x * ratio, scaleY = scale.y * ratio;
    this.setAttr("shadowColor", color);
    this.setAttr("shadowBlur", blur * Math.min(Math.abs(scaleX), Math.abs(scaleY)));
    this.setAttr("shadowOffsetX", offset5.x * scaleX);
    this.setAttr("shadowOffsetY", offset5.y * scaleY);
  }
}
Context$1.SceneContext = SceneContext2;
class HitContext2 extends Context2 {
  constructor(canvas) {
    super(canvas);
    this._context = canvas._canvas.getContext("2d", {
      willReadFrequently: true
    });
  }
  _fill(shape) {
    this.save();
    this.setAttr("fillStyle", shape.colorKey);
    shape._fillFuncHit(this);
    this.restore();
  }
  strokeShape(shape) {
    if (shape.hasHitStroke()) {
      this._stroke(shape);
    }
  }
  _stroke(shape) {
    if (shape.hasHitStroke()) {
      const strokeScaleEnabled = shape.getStrokeScaleEnabled();
      if (!strokeScaleEnabled) {
        this.save();
        var pixelRatio = this.getCanvas().getPixelRatio();
        this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
      }
      this._applyLineCap(shape);
      var hitStrokeWidth = shape.hitStrokeWidth();
      var strokeWidth = hitStrokeWidth === "auto" ? shape.strokeWidth() : hitStrokeWidth;
      this.setAttr("lineWidth", strokeWidth);
      this.setAttr("strokeStyle", shape.colorKey);
      shape._strokeFuncHit(this);
      if (!strokeScaleEnabled) {
        this.restore();
      }
    }
  }
}
Context$1.HitContext = HitContext2;
Object.defineProperty(Canvas$1, "__esModule", { value: true });
Canvas$1.HitCanvas = Canvas$1.SceneCanvas = Canvas$1.Canvas = void 0;
const Util_1$d = Util;
const Context_1 = Context$1;
const Global_1$n = Global;
const Factory_1$z = Factory;
const Validators_1$y = Validators;
var _pixelRatio;
function getDevicePixelRatio() {
  if (_pixelRatio) {
    return _pixelRatio;
  }
  var canvas = Util_1$d.Util.createCanvasElement();
  var context = canvas.getContext("2d");
  _pixelRatio = function() {
    var devicePixelRatio = Global_1$n.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
    return devicePixelRatio / backingStoreRatio;
  }();
  Util_1$d.Util.releaseCanvas(canvas);
  return _pixelRatio;
}
class Canvas2 {
  constructor(config) {
    this.pixelRatio = 1;
    this.width = 0;
    this.height = 0;
    this.isCache = false;
    var conf = config || {};
    var pixelRatio = conf.pixelRatio || Global_1$n.Konva.pixelRatio || getDevicePixelRatio();
    this.pixelRatio = pixelRatio;
    this._canvas = Util_1$d.Util.createCanvasElement();
    this._canvas.style.padding = "0";
    this._canvas.style.margin = "0";
    this._canvas.style.border = "0";
    this._canvas.style.background = "transparent";
    this._canvas.style.position = "absolute";
    this._canvas.style.top = "0";
    this._canvas.style.left = "0";
  }
  getContext() {
    return this.context;
  }
  getPixelRatio() {
    return this.pixelRatio;
  }
  setPixelRatio(pixelRatio) {
    var previousRatio = this.pixelRatio;
    this.pixelRatio = pixelRatio;
    this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);
  }
  setWidth(width) {
    this.width = this._canvas.width = width * this.pixelRatio;
    this._canvas.style.width = width + "px";
    var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    _context.scale(pixelRatio, pixelRatio);
  }
  setHeight(height) {
    this.height = this._canvas.height = height * this.pixelRatio;
    this._canvas.style.height = height + "px";
    var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    _context.scale(pixelRatio, pixelRatio);
  }
  getWidth() {
    return this.width;
  }
  getHeight() {
    return this.height;
  }
  setSize(width, height) {
    this.setWidth(width || 0);
    this.setHeight(height || 0);
  }
  toDataURL(mimeType, quality) {
    try {
      return this._canvas.toDataURL(mimeType, quality);
    } catch (e2) {
      try {
        return this._canvas.toDataURL();
      } catch (err) {
        Util_1$d.Util.error("Unable to get data URL. " + err.message + " For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html.");
        return "";
      }
    }
  }
}
Canvas$1.Canvas = Canvas2;
Factory_1$z.Factory.addGetterSetter(Canvas2, "pixelRatio", void 0, (0, Validators_1$y.getNumberValidator)());
class SceneCanvas2 extends Canvas2 {
  constructor(config = { width: 0, height: 0, willReadFrequently: false }) {
    super(config);
    this.context = new Context_1.SceneContext(this, {
      willReadFrequently: config.willReadFrequently
    });
    this.setSize(config.width, config.height);
  }
}
Canvas$1.SceneCanvas = SceneCanvas2;
class HitCanvas2 extends Canvas2 {
  constructor(config = { width: 0, height: 0 }) {
    super(config);
    this.hitCanvas = true;
    this.context = new Context_1.HitContext(this);
    this.setSize(config.width, config.height);
  }
}
Canvas$1.HitCanvas = HitCanvas2;
var DragAndDrop = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.DD = void 0;
  const Global_12 = Global;
  const Util_12 = Util;
  exports.DD = {
    get isDragging() {
      var flag = false;
      exports.DD._dragElements.forEach((elem) => {
        if (elem.dragStatus === "dragging") {
          flag = true;
        }
      });
      return flag;
    },
    justDragged: false,
    get node() {
      var node;
      exports.DD._dragElements.forEach((elem) => {
        node = elem.node;
      });
      return node;
    },
    _dragElements: /* @__PURE__ */ new Map(),
    _drag(evt) {
      const nodesToFireEvents = [];
      exports.DD._dragElements.forEach((elem, key) => {
        const { node } = elem;
        const stage = node.getStage();
        stage.setPointersPositions(evt);
        if (elem.pointerId === void 0) {
          elem.pointerId = Util_12.Util._getFirstPointerId(evt);
        }
        const pos = stage._changedPointerPositions.find((pos2) => pos2.id === elem.pointerId);
        if (!pos) {
          return;
        }
        if (elem.dragStatus !== "dragging") {
          var dragDistance = node.dragDistance();
          var distance = Math.max(Math.abs(pos.x - elem.startPointerPos.x), Math.abs(pos.y - elem.startPointerPos.y));
          if (distance < dragDistance) {
            return;
          }
          node.startDrag({ evt });
          if (!node.isDragging()) {
            return;
          }
        }
        node._setDragPosition(evt, elem);
        nodesToFireEvents.push(node);
      });
      nodesToFireEvents.forEach((node) => {
        node.fire("dragmove", {
          type: "dragmove",
          target: node,
          evt
        }, true);
      });
    },
    _endDragBefore(evt) {
      const drawNodes = [];
      exports.DD._dragElements.forEach((elem) => {
        const { node } = elem;
        const stage = node.getStage();
        if (evt) {
          stage.setPointersPositions(evt);
        }
        const pos = stage._changedPointerPositions.find((pos2) => pos2.id === elem.pointerId);
        if (!pos) {
          return;
        }
        if (elem.dragStatus === "dragging" || elem.dragStatus === "stopped") {
          exports.DD.justDragged = true;
          Global_12.Konva._mouseListenClick = false;
          Global_12.Konva._touchListenClick = false;
          Global_12.Konva._pointerListenClick = false;
          elem.dragStatus = "stopped";
        }
        const drawNode = elem.node.getLayer() || elem.node instanceof Global_12.Konva["Stage"] && elem.node;
        if (drawNode && drawNodes.indexOf(drawNode) === -1) {
          drawNodes.push(drawNode);
        }
      });
      drawNodes.forEach((drawNode) => {
        drawNode.draw();
      });
    },
    _endDragAfter(evt) {
      exports.DD._dragElements.forEach((elem, key) => {
        if (elem.dragStatus === "stopped") {
          elem.node.fire("dragend", {
            type: "dragend",
            target: elem.node,
            evt
          }, true);
        }
        if (elem.dragStatus !== "dragging") {
          exports.DD._dragElements.delete(key);
        }
      });
    }
  };
  if (Global_12.Konva.isBrowser) {
    window.addEventListener("mouseup", exports.DD._endDragBefore, true);
    window.addEventListener("touchend", exports.DD._endDragBefore, true);
    window.addEventListener("mousemove", exports.DD._drag);
    window.addEventListener("touchmove", exports.DD._drag);
    window.addEventListener("mouseup", exports.DD._endDragAfter, false);
    window.addEventListener("touchend", exports.DD._endDragAfter, false);
  }
})(DragAndDrop);
Object.defineProperty(Node$1, "__esModule", { value: true });
Node$1.Node = void 0;
const Util_1$c = Util;
const Factory_1$y = Factory;
const Canvas_1$1 = Canvas$1;
const Global_1$m = Global;
const DragAndDrop_1 = DragAndDrop;
const Validators_1$x = Validators;
var ABSOLUTE_OPACITY = "absoluteOpacity", ALL_LISTENERS = "allEventListeners", ABSOLUTE_TRANSFORM = "absoluteTransform", ABSOLUTE_SCALE = "absoluteScale", CANVAS = "canvas", CHANGE = "Change", CHILDREN = "children", KONVA = "konva", LISTENING = "listening", MOUSEENTER = "mouseenter", MOUSELEAVE = "mouseleave", SET = "set", SHAPE = "Shape", SPACE$1 = " ", STAGE = "stage", TRANSFORM = "transform", UPPER_STAGE = "Stage", VISIBLE = "visible", TRANSFORM_CHANGE_STR$1 = [
  "xChange.konva",
  "yChange.konva",
  "scaleXChange.konva",
  "scaleYChange.konva",
  "skewXChange.konva",
  "skewYChange.konva",
  "rotationChange.konva",
  "offsetXChange.konva",
  "offsetYChange.konva",
  "transformsEnabledChange.konva"
].join(SPACE$1);
let idCounter = 1;
class Node2 {
  constructor(config) {
    this._id = idCounter++;
    this.eventListeners = {};
    this.attrs = {};
    this.index = 0;
    this._allEventListeners = null;
    this.parent = null;
    this._cache = /* @__PURE__ */ new Map();
    this._attachedDepsListeners = /* @__PURE__ */ new Map();
    this._lastPos = null;
    this._batchingTransformChange = false;
    this._needClearTransformCache = false;
    this._filterUpToDate = false;
    this._isUnderCache = false;
    this._dragEventId = null;
    this._shouldFireChangeEvents = false;
    this.setAttrs(config);
    this._shouldFireChangeEvents = true;
  }
  hasChildren() {
    return false;
  }
  _clearCache(attr) {
    if ((attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM) && this._cache.get(attr)) {
      this._cache.get(attr).dirty = true;
    } else if (attr) {
      this._cache.delete(attr);
    } else {
      this._cache.clear();
    }
  }
  _getCache(attr, privateGetter) {
    var cache = this._cache.get(attr);
    var isTransform = attr === TRANSFORM || attr === ABSOLUTE_TRANSFORM;
    var invalid = cache === void 0 || isTransform && cache.dirty === true;
    if (invalid) {
      cache = privateGetter.call(this);
      this._cache.set(attr, cache);
    }
    return cache;
  }
  _calculate(name, deps, getter) {
    if (!this._attachedDepsListeners.get(name)) {
      const depsString = deps.map((dep) => dep + "Change.konva").join(SPACE$1);
      this.on(depsString, () => {
        this._clearCache(name);
      });
      this._attachedDepsListeners.set(name, true);
    }
    return this._getCache(name, getter);
  }
  _getCanvasCache() {
    return this._cache.get(CANVAS);
  }
  _clearSelfAndDescendantCache(attr) {
    this._clearCache(attr);
    if (attr === ABSOLUTE_TRANSFORM) {
      this.fire("absoluteTransformChange");
    }
  }
  clearCache() {
    if (this._cache.has(CANVAS)) {
      const { scene, filter, hit } = this._cache.get(CANVAS);
      Util_1$c.Util.releaseCanvas(scene, filter, hit);
      this._cache.delete(CANVAS);
    }
    this._clearSelfAndDescendantCache();
    this._requestDraw();
    return this;
  }
  cache(config) {
    var conf = config || {};
    var rect = {};
    if (conf.x === void 0 || conf.y === void 0 || conf.width === void 0 || conf.height === void 0) {
      rect = this.getClientRect({
        skipTransform: true,
        relativeTo: this.getParent() || void 0
      });
    }
    var width = Math.ceil(conf.width || rect.width), height = Math.ceil(conf.height || rect.height), pixelRatio = conf.pixelRatio, x2 = conf.x === void 0 ? Math.floor(rect.x) : conf.x, y2 = conf.y === void 0 ? Math.floor(rect.y) : conf.y, offset5 = conf.offset || 0, drawBorder = conf.drawBorder || false, hitCanvasPixelRatio = conf.hitCanvasPixelRatio || 1;
    if (!width || !height) {
      Util_1$c.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");
      return;
    }
    const extraPaddingX = Math.abs(Math.round(rect.x) - x2) > 0.5 ? 1 : 0;
    const extraPaddingY = Math.abs(Math.round(rect.y) - y2) > 0.5 ? 1 : 0;
    width += offset5 * 2 + extraPaddingX;
    height += offset5 * 2 + extraPaddingY;
    x2 -= offset5;
    y2 -= offset5;
    var cachedSceneCanvas = new Canvas_1$1.SceneCanvas({
      pixelRatio,
      width,
      height
    }), cachedFilterCanvas = new Canvas_1$1.SceneCanvas({
      pixelRatio,
      width: 0,
      height: 0,
      willReadFrequently: true
    }), cachedHitCanvas = new Canvas_1$1.HitCanvas({
      pixelRatio: hitCanvasPixelRatio,
      width,
      height
    }), sceneContext = cachedSceneCanvas.getContext(), hitContext = cachedHitCanvas.getContext();
    cachedHitCanvas.isCache = true;
    cachedSceneCanvas.isCache = true;
    this._cache.delete(CANVAS);
    this._filterUpToDate = false;
    if (conf.imageSmoothingEnabled === false) {
      cachedSceneCanvas.getContext()._context.imageSmoothingEnabled = false;
      cachedFilterCanvas.getContext()._context.imageSmoothingEnabled = false;
    }
    sceneContext.save();
    hitContext.save();
    sceneContext.translate(-x2, -y2);
    hitContext.translate(-x2, -y2);
    this._isUnderCache = true;
    this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);
    this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);
    this.drawScene(cachedSceneCanvas, this);
    this.drawHit(cachedHitCanvas, this);
    this._isUnderCache = false;
    sceneContext.restore();
    hitContext.restore();
    if (drawBorder) {
      sceneContext.save();
      sceneContext.beginPath();
      sceneContext.rect(0, 0, width, height);
      sceneContext.closePath();
      sceneContext.setAttr("strokeStyle", "red");
      sceneContext.setAttr("lineWidth", 5);
      sceneContext.stroke();
      sceneContext.restore();
    }
    this._cache.set(CANVAS, {
      scene: cachedSceneCanvas,
      filter: cachedFilterCanvas,
      hit: cachedHitCanvas,
      x: x2,
      y: y2
    });
    this._requestDraw();
    return this;
  }
  isCached() {
    return this._cache.has(CANVAS);
  }
  getClientRect(config) {
    throw new Error('abstract "getClientRect" method call');
  }
  _transformedRect(rect, top2) {
    var points = [
      { x: rect.x, y: rect.y },
      { x: rect.x + rect.width, y: rect.y },
      { x: rect.x + rect.width, y: rect.y + rect.height },
      { x: rect.x, y: rect.y + rect.height }
    ];
    var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
    var trans = this.getAbsoluteTransform(top2);
    points.forEach(function(point) {
      var transformed = trans.point(point);
      if (minX === void 0) {
        minX = maxX = transformed.x;
        minY = maxY = transformed.y;
      }
      minX = Math.min(minX, transformed.x);
      minY = Math.min(minY, transformed.y);
      maxX = Math.max(maxX, transformed.x);
      maxY = Math.max(maxY, transformed.y);
    });
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  _drawCachedSceneCanvas(context) {
    context.save();
    context._applyOpacity(this);
    context._applyGlobalCompositeOperation(this);
    const canvasCache = this._getCanvasCache();
    context.translate(canvasCache.x, canvasCache.y);
    var cacheCanvas = this._getCachedSceneCanvas();
    var ratio = cacheCanvas.pixelRatio;
    context.drawImage(cacheCanvas._canvas, 0, 0, cacheCanvas.width / ratio, cacheCanvas.height / ratio);
    context.restore();
  }
  _drawCachedHitCanvas(context) {
    var canvasCache = this._getCanvasCache(), hitCanvas = canvasCache.hit;
    context.save();
    context.translate(canvasCache.x, canvasCache.y);
    context.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / hitCanvas.pixelRatio, hitCanvas.height / hitCanvas.pixelRatio);
    context.restore();
  }
  _getCachedSceneCanvas() {
    var filters = this.filters(), cachedCanvas = this._getCanvasCache(), sceneCanvas = cachedCanvas.scene, filterCanvas = cachedCanvas.filter, filterContext = filterCanvas.getContext(), len, imageData, n2, filter;
    if (filters) {
      if (!this._filterUpToDate) {
        var ratio = sceneCanvas.pixelRatio;
        filterCanvas.setSize(sceneCanvas.width / sceneCanvas.pixelRatio, sceneCanvas.height / sceneCanvas.pixelRatio);
        try {
          len = filters.length;
          filterContext.clear();
          filterContext.drawImage(sceneCanvas._canvas, 0, 0, sceneCanvas.getWidth() / ratio, sceneCanvas.getHeight() / ratio);
          imageData = filterContext.getImageData(0, 0, filterCanvas.getWidth(), filterCanvas.getHeight());
          for (n2 = 0; n2 < len; n2++) {
            filter = filters[n2];
            if (typeof filter !== "function") {
              Util_1$c.Util.error("Filter should be type of function, but got " + typeof filter + " instead. Please check correct filters");
              continue;
            }
            filter.call(this, imageData);
            filterContext.putImageData(imageData, 0, 0);
          }
        } catch (e2) {
          Util_1$c.Util.error("Unable to apply filter. " + e2.message + " This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.");
        }
        this._filterUpToDate = true;
      }
      return filterCanvas;
    }
    return sceneCanvas;
  }
  on(evtStr, handler) {
    this._cache && this._cache.delete(ALL_LISTENERS);
    if (arguments.length === 3) {
      return this._delegate.apply(this, arguments);
    }
    var events = evtStr.split(SPACE$1), len = events.length, n2, event, parts, baseEvent, name;
    for (n2 = 0; n2 < len; n2++) {
      event = events[n2];
      parts = event.split(".");
      baseEvent = parts[0];
      name = parts[1] || "";
      if (!this.eventListeners[baseEvent]) {
        this.eventListeners[baseEvent] = [];
      }
      this.eventListeners[baseEvent].push({
        name,
        handler
      });
    }
    return this;
  }
  off(evtStr, callback) {
    var events = (evtStr || "").split(SPACE$1), len = events.length, n2, t2, event, parts, baseEvent, name;
    this._cache && this._cache.delete(ALL_LISTENERS);
    if (!evtStr) {
      for (t2 in this.eventListeners) {
        this._off(t2);
      }
    }
    for (n2 = 0; n2 < len; n2++) {
      event = events[n2];
      parts = event.split(".");
      baseEvent = parts[0];
      name = parts[1];
      if (baseEvent) {
        if (this.eventListeners[baseEvent]) {
          this._off(baseEvent, name, callback);
        }
      } else {
        for (t2 in this.eventListeners) {
          this._off(t2, name, callback);
        }
      }
    }
    return this;
  }
  dispatchEvent(evt) {
    var e2 = {
      target: this,
      type: evt.type,
      evt
    };
    this.fire(evt.type, e2);
    return this;
  }
  addEventListener(type, handler) {
    this.on(type, function(evt) {
      handler.call(this, evt.evt);
    });
    return this;
  }
  removeEventListener(type) {
    this.off(type);
    return this;
  }
  _delegate(event, selector, handler) {
    var stopNode = this;
    this.on(event, function(evt) {
      var targets = evt.target.findAncestors(selector, true, stopNode);
      for (var i = 0; i < targets.length; i++) {
        evt = Util_1$c.Util.cloneObject(evt);
        evt.currentTarget = targets[i];
        handler.call(targets[i], evt);
      }
    });
  }
  remove() {
    if (this.isDragging()) {
      this.stopDrag();
    }
    DragAndDrop_1.DD._dragElements.delete(this._id);
    this._remove();
    return this;
  }
  _clearCaches() {
    this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
    this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);
    this._clearSelfAndDescendantCache(ABSOLUTE_SCALE);
    this._clearSelfAndDescendantCache(STAGE);
    this._clearSelfAndDescendantCache(VISIBLE);
    this._clearSelfAndDescendantCache(LISTENING);
  }
  _remove() {
    this._clearCaches();
    var parent = this.getParent();
    if (parent && parent.children) {
      parent.children.splice(this.index, 1);
      parent._setChildrenIndices();
      this.parent = null;
    }
  }
  destroy() {
    this.remove();
    this.clearCache();
    return this;
  }
  getAttr(attr) {
    var method = "get" + Util_1$c.Util._capitalize(attr);
    if (Util_1$c.Util._isFunction(this[method])) {
      return this[method]();
    }
    return this.attrs[attr];
  }
  getAncestors() {
    var parent = this.getParent(), ancestors = [];
    while (parent) {
      ancestors.push(parent);
      parent = parent.getParent();
    }
    return ancestors;
  }
  getAttrs() {
    return this.attrs || {};
  }
  setAttrs(config) {
    this._batchTransformChanges(() => {
      var key, method;
      if (!config) {
        return this;
      }
      for (key in config) {
        if (key === CHILDREN) {
          continue;
        }
        method = SET + Util_1$c.Util._capitalize(key);
        if (Util_1$c.Util._isFunction(this[method])) {
          this[method](config[key]);
        } else {
          this._setAttr(key, config[key]);
        }
      }
    });
    return this;
  }
  isListening() {
    return this._getCache(LISTENING, this._isListening);
  }
  _isListening(relativeTo) {
    const listening = this.listening();
    if (!listening) {
      return false;
    }
    const parent = this.getParent();
    if (parent && parent !== relativeTo && this !== relativeTo) {
      return parent._isListening(relativeTo);
    } else {
      return true;
    }
  }
  isVisible() {
    return this._getCache(VISIBLE, this._isVisible);
  }
  _isVisible(relativeTo) {
    const visible = this.visible();
    if (!visible) {
      return false;
    }
    const parent = this.getParent();
    if (parent && parent !== relativeTo && this !== relativeTo) {
      return parent._isVisible(relativeTo);
    } else {
      return true;
    }
  }
  shouldDrawHit(top2, skipDragCheck = false) {
    if (top2) {
      return this._isVisible(top2) && this._isListening(top2);
    }
    var layer = this.getLayer();
    var layerUnderDrag = false;
    DragAndDrop_1.DD._dragElements.forEach((elem) => {
      if (elem.dragStatus !== "dragging") {
        return;
      } else if (elem.node.nodeType === "Stage") {
        layerUnderDrag = true;
      } else if (elem.node.getLayer() === layer) {
        layerUnderDrag = true;
      }
    });
    var dragSkip = !skipDragCheck && !Global_1$m.Konva.hitOnDragEnabled && (layerUnderDrag || Global_1$m.Konva.isTransforming());
    return this.isListening() && this.isVisible() && !dragSkip;
  }
  show() {
    this.visible(true);
    return this;
  }
  hide() {
    this.visible(false);
    return this;
  }
  getZIndex() {
    return this.index || 0;
  }
  getAbsoluteZIndex() {
    var depth = this.getDepth(), that = this, index = 0, nodes, len, n2, child;
    function addChildren(children) {
      nodes = [];
      len = children.length;
      for (n2 = 0; n2 < len; n2++) {
        child = children[n2];
        index++;
        if (child.nodeType !== SHAPE) {
          nodes = nodes.concat(child.getChildren().slice());
        }
        if (child._id === that._id) {
          n2 = len;
        }
      }
      if (nodes.length > 0 && nodes[0].getDepth() <= depth) {
        addChildren(nodes);
      }
    }
    const stage = this.getStage();
    if (that.nodeType !== UPPER_STAGE && stage) {
      addChildren(stage.getChildren());
    }
    return index;
  }
  getDepth() {
    var depth = 0, parent = this.parent;
    while (parent) {
      depth++;
      parent = parent.parent;
    }
    return depth;
  }
  _batchTransformChanges(func) {
    this._batchingTransformChange = true;
    func();
    this._batchingTransformChange = false;
    if (this._needClearTransformCache) {
      this._clearCache(TRANSFORM);
      this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
    }
    this._needClearTransformCache = false;
  }
  setPosition(pos) {
    this._batchTransformChanges(() => {
      this.x(pos.x);
      this.y(pos.y);
    });
    return this;
  }
  getPosition() {
    return {
      x: this.x(),
      y: this.y()
    };
  }
  getRelativePointerPosition() {
    const stage = this.getStage();
    if (!stage) {
      return null;
    }
    var pos = stage.getPointerPosition();
    if (!pos) {
      return null;
    }
    var transform = this.getAbsoluteTransform().copy();
    transform.invert();
    return transform.point(pos);
  }
  getAbsolutePosition(top2) {
    let haveCachedParent = false;
    let parent = this.parent;
    while (parent) {
      if (parent.isCached()) {
        haveCachedParent = true;
        break;
      }
      parent = parent.parent;
    }
    if (haveCachedParent && !top2) {
      top2 = true;
    }
    var absoluteMatrix = this.getAbsoluteTransform(top2).getMatrix(), absoluteTransform = new Util_1$c.Transform(), offset5 = this.offset();
    absoluteTransform.m = absoluteMatrix.slice();
    absoluteTransform.translate(offset5.x, offset5.y);
    return absoluteTransform.getTranslation();
  }
  setAbsolutePosition(pos) {
    const { x: x2, y: y2, ...origTrans } = this._clearTransform();
    this.attrs.x = x2;
    this.attrs.y = y2;
    this._clearCache(TRANSFORM);
    var it = this._getAbsoluteTransform().copy();
    it.invert();
    it.translate(pos.x, pos.y);
    pos = {
      x: this.attrs.x + it.getTranslation().x,
      y: this.attrs.y + it.getTranslation().y
    };
    this._setTransform(origTrans);
    this.setPosition({ x: pos.x, y: pos.y });
    this._clearCache(TRANSFORM);
    this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
    return this;
  }
  _setTransform(trans) {
    var key;
    for (key in trans) {
      this.attrs[key] = trans[key];
    }
  }
  _clearTransform() {
    var trans = {
      x: this.x(),
      y: this.y(),
      rotation: this.rotation(),
      scaleX: this.scaleX(),
      scaleY: this.scaleY(),
      offsetX: this.offsetX(),
      offsetY: this.offsetY(),
      skewX: this.skewX(),
      skewY: this.skewY()
    };
    this.attrs.x = 0;
    this.attrs.y = 0;
    this.attrs.rotation = 0;
    this.attrs.scaleX = 1;
    this.attrs.scaleY = 1;
    this.attrs.offsetX = 0;
    this.attrs.offsetY = 0;
    this.attrs.skewX = 0;
    this.attrs.skewY = 0;
    return trans;
  }
  move(change) {
    var changeX = change.x, changeY = change.y, x2 = this.x(), y2 = this.y();
    if (changeX !== void 0) {
      x2 += changeX;
    }
    if (changeY !== void 0) {
      y2 += changeY;
    }
    this.setPosition({ x: x2, y: y2 });
    return this;
  }
  _eachAncestorReverse(func, top2) {
    var family = [], parent = this.getParent(), len, n2;
    if (top2 && top2._id === this._id) {
      return;
    }
    family.unshift(this);
    while (parent && (!top2 || parent._id !== top2._id)) {
      family.unshift(parent);
      parent = parent.parent;
    }
    len = family.length;
    for (n2 = 0; n2 < len; n2++) {
      func(family[n2]);
    }
  }
  rotate(theta) {
    this.rotation(this.rotation() + theta);
    return this;
  }
  moveToTop() {
    if (!this.parent) {
      Util_1$c.Util.warn("Node has no parent. moveToTop function is ignored.");
      return false;
    }
    var index = this.index, len = this.parent.getChildren().length;
    if (index < len - 1) {
      this.parent.children.splice(index, 1);
      this.parent.children.push(this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveUp() {
    if (!this.parent) {
      Util_1$c.Util.warn("Node has no parent. moveUp function is ignored.");
      return false;
    }
    var index = this.index, len = this.parent.getChildren().length;
    if (index < len - 1) {
      this.parent.children.splice(index, 1);
      this.parent.children.splice(index + 1, 0, this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveDown() {
    if (!this.parent) {
      Util_1$c.Util.warn("Node has no parent. moveDown function is ignored.");
      return false;
    }
    var index = this.index;
    if (index > 0) {
      this.parent.children.splice(index, 1);
      this.parent.children.splice(index - 1, 0, this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  moveToBottom() {
    if (!this.parent) {
      Util_1$c.Util.warn("Node has no parent. moveToBottom function is ignored.");
      return false;
    }
    var index = this.index;
    if (index > 0) {
      this.parent.children.splice(index, 1);
      this.parent.children.unshift(this);
      this.parent._setChildrenIndices();
      return true;
    }
    return false;
  }
  setZIndex(zIndex) {
    if (!this.parent) {
      Util_1$c.Util.warn("Node has no parent. zIndex parameter is ignored.");
      return this;
    }
    if (zIndex < 0 || zIndex >= this.parent.children.length) {
      Util_1$c.Util.warn("Unexpected value " + zIndex + " for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to " + (this.parent.children.length - 1) + ".");
    }
    var index = this.index;
    this.parent.children.splice(index, 1);
    this.parent.children.splice(zIndex, 0, this);
    this.parent._setChildrenIndices();
    return this;
  }
  getAbsoluteOpacity() {
    return this._getCache(ABSOLUTE_OPACITY, this._getAbsoluteOpacity);
  }
  _getAbsoluteOpacity() {
    var absOpacity = this.opacity();
    var parent = this.getParent();
    if (parent && !parent._isUnderCache) {
      absOpacity *= parent.getAbsoluteOpacity();
    }
    return absOpacity;
  }
  moveTo(newContainer) {
    if (this.getParent() !== newContainer) {
      this._remove();
      newContainer.add(this);
    }
    return this;
  }
  toObject() {
    var attrs = this.getAttrs(), key, val, getter, defaultValue, nonPlainObject;
    const obj = {
      attrs: {},
      className: this.getClassName()
    };
    for (key in attrs) {
      val = attrs[key];
      nonPlainObject = Util_1$c.Util.isObject(val) && !Util_1$c.Util._isPlainObject(val) && !Util_1$c.Util._isArray(val);
      if (nonPlainObject) {
        continue;
      }
      getter = typeof this[key] === "function" && this[key];
      delete attrs[key];
      defaultValue = getter ? getter.call(this) : null;
      attrs[key] = val;
      if (defaultValue !== val) {
        obj.attrs[key] = val;
      }
    }
    return Util_1$c.Util._prepareToStringify(obj);
  }
  toJSON() {
    return JSON.stringify(this.toObject());
  }
  getParent() {
    return this.parent;
  }
  findAncestors(selector, includeSelf, stopNode) {
    var res = [];
    if (includeSelf && this._isMatch(selector)) {
      res.push(this);
    }
    var ancestor = this.parent;
    while (ancestor) {
      if (ancestor === stopNode) {
        return res;
      }
      if (ancestor._isMatch(selector)) {
        res.push(ancestor);
      }
      ancestor = ancestor.parent;
    }
    return res;
  }
  isAncestorOf(node) {
    return false;
  }
  findAncestor(selector, includeSelf, stopNode) {
    return this.findAncestors(selector, includeSelf, stopNode)[0];
  }
  _isMatch(selector) {
    if (!selector) {
      return false;
    }
    if (typeof selector === "function") {
      return selector(this);
    }
    var selectorArr = selector.replace(/ /g, "").split(","), len = selectorArr.length, n2, sel;
    for (n2 = 0; n2 < len; n2++) {
      sel = selectorArr[n2];
      if (!Util_1$c.Util.isValidSelector(sel)) {
        Util_1$c.Util.warn('Selector "' + sel + '" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".');
        Util_1$c.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".');
        Util_1$c.Util.warn("Konva is awesome, right?");
      }
      if (sel.charAt(0) === "#") {
        if (this.id() === sel.slice(1)) {
          return true;
        }
      } else if (sel.charAt(0) === ".") {
        if (this.hasName(sel.slice(1))) {
          return true;
        }
      } else if (this.className === sel || this.nodeType === sel) {
        return true;
      }
    }
    return false;
  }
  getLayer() {
    var parent = this.getParent();
    return parent ? parent.getLayer() : null;
  }
  getStage() {
    return this._getCache(STAGE, this._getStage);
  }
  _getStage() {
    var parent = this.getParent();
    if (parent) {
      return parent.getStage();
    } else {
      return null;
    }
  }
  fire(eventType, evt = {}, bubble) {
    evt.target = evt.target || this;
    if (bubble) {
      this._fireAndBubble(eventType, evt);
    } else {
      this._fire(eventType, evt);
    }
    return this;
  }
  getAbsoluteTransform(top2) {
    if (top2) {
      return this._getAbsoluteTransform(top2);
    } else {
      return this._getCache(ABSOLUTE_TRANSFORM, this._getAbsoluteTransform);
    }
  }
  _getAbsoluteTransform(top2) {
    var at;
    if (top2) {
      at = new Util_1$c.Transform();
      this._eachAncestorReverse(function(node) {
        var transformsEnabled2 = node.transformsEnabled();
        if (transformsEnabled2 === "all") {
          at.multiply(node.getTransform());
        } else if (transformsEnabled2 === "position") {
          at.translate(node.x() - node.offsetX(), node.y() - node.offsetY());
        }
      }, top2);
      return at;
    } else {
      at = this._cache.get(ABSOLUTE_TRANSFORM) || new Util_1$c.Transform();
      if (this.parent) {
        this.parent.getAbsoluteTransform().copyInto(at);
      } else {
        at.reset();
      }
      var transformsEnabled = this.transformsEnabled();
      if (transformsEnabled === "all") {
        at.multiply(this.getTransform());
      } else if (transformsEnabled === "position") {
        const x2 = this.attrs.x || 0;
        const y2 = this.attrs.y || 0;
        const offsetX = this.attrs.offsetX || 0;
        const offsetY = this.attrs.offsetY || 0;
        at.translate(x2 - offsetX, y2 - offsetY);
      }
      at.dirty = false;
      return at;
    }
  }
  getAbsoluteScale(top2) {
    var parent = this;
    while (parent) {
      if (parent._isUnderCache) {
        top2 = parent;
      }
      parent = parent.getParent();
    }
    const transform = this.getAbsoluteTransform(top2);
    const attrs = transform.decompose();
    return {
      x: attrs.scaleX,
      y: attrs.scaleY
    };
  }
  getAbsoluteRotation() {
    return this.getAbsoluteTransform().decompose().rotation;
  }
  getTransform() {
    return this._getCache(TRANSFORM, this._getTransform);
  }
  _getTransform() {
    var _a2, _b2;
    var m2 = this._cache.get(TRANSFORM) || new Util_1$c.Transform();
    m2.reset();
    var x2 = this.x(), y2 = this.y(), rotation = Global_1$m.Konva.getAngle(this.rotation()), scaleX = (_a2 = this.attrs.scaleX) !== null && _a2 !== void 0 ? _a2 : 1, scaleY = (_b2 = this.attrs.scaleY) !== null && _b2 !== void 0 ? _b2 : 1, skewX = this.attrs.skewX || 0, skewY = this.attrs.skewY || 0, offsetX = this.attrs.offsetX || 0, offsetY = this.attrs.offsetY || 0;
    if (x2 !== 0 || y2 !== 0) {
      m2.translate(x2, y2);
    }
    if (rotation !== 0) {
      m2.rotate(rotation);
    }
    if (skewX !== 0 || skewY !== 0) {
      m2.skew(skewX, skewY);
    }
    if (scaleX !== 1 || scaleY !== 1) {
      m2.scale(scaleX, scaleY);
    }
    if (offsetX !== 0 || offsetY !== 0) {
      m2.translate(-1 * offsetX, -1 * offsetY);
    }
    m2.dirty = false;
    return m2;
  }
  clone(obj) {
    var attrs = Util_1$c.Util.cloneObject(this.attrs), key, allListeners, len, n2, listener;
    for (key in obj) {
      attrs[key] = obj[key];
    }
    var node = new this.constructor(attrs);
    for (key in this.eventListeners) {
      allListeners = this.eventListeners[key];
      len = allListeners.length;
      for (n2 = 0; n2 < len; n2++) {
        listener = allListeners[n2];
        if (listener.name.indexOf(KONVA) < 0) {
          if (!node.eventListeners[key]) {
            node.eventListeners[key] = [];
          }
          node.eventListeners[key].push(listener);
        }
      }
    }
    return node;
  }
  _toKonvaCanvas(config) {
    config = config || {};
    var box = this.getClientRect();
    var stage = this.getStage(), x2 = config.x !== void 0 ? config.x : Math.floor(box.x), y2 = config.y !== void 0 ? config.y : Math.floor(box.y), pixelRatio = config.pixelRatio || 1, canvas = new Canvas_1$1.SceneCanvas({
      width: config.width || Math.ceil(box.width) || (stage ? stage.width() : 0),
      height: config.height || Math.ceil(box.height) || (stage ? stage.height() : 0),
      pixelRatio
    }), context = canvas.getContext();
    const bufferCanvas = new Canvas_1$1.SceneCanvas({
      width: canvas.width / canvas.pixelRatio + Math.abs(x2),
      height: canvas.height / canvas.pixelRatio + Math.abs(y2),
      pixelRatio: canvas.pixelRatio
    });
    if (config.imageSmoothingEnabled === false) {
      context._context.imageSmoothingEnabled = false;
    }
    context.save();
    if (x2 || y2) {
      context.translate(-1 * x2, -1 * y2);
    }
    this.drawScene(canvas, void 0, bufferCanvas);
    context.restore();
    return canvas;
  }
  toCanvas(config) {
    return this._toKonvaCanvas(config)._canvas;
  }
  toDataURL(config) {
    config = config || {};
    var mimeType = config.mimeType || null, quality = config.quality || null;
    var url = this._toKonvaCanvas(config).toDataURL(mimeType, quality);
    if (config.callback) {
      config.callback(url);
    }
    return url;
  }
  toImage(config) {
    return new Promise((resolve, reject) => {
      try {
        const callback = config === null || config === void 0 ? void 0 : config.callback;
        if (callback)
          delete config.callback;
        Util_1$c.Util._urlToImage(this.toDataURL(config), function(img) {
          resolve(img);
          callback === null || callback === void 0 ? void 0 : callback(img);
        });
      } catch (err) {
        reject(err);
      }
    });
  }
  toBlob(config) {
    return new Promise((resolve, reject) => {
      try {
        const callback = config === null || config === void 0 ? void 0 : config.callback;
        if (callback)
          delete config.callback;
        this.toCanvas(config).toBlob((blob) => {
          resolve(blob);
          callback === null || callback === void 0 ? void 0 : callback(blob);
        }, config === null || config === void 0 ? void 0 : config.mimeType, config === null || config === void 0 ? void 0 : config.quality);
      } catch (err) {
        reject(err);
      }
    });
  }
  setSize(size) {
    this.width(size.width);
    this.height(size.height);
    return this;
  }
  getSize() {
    return {
      width: this.width(),
      height: this.height()
    };
  }
  getClassName() {
    return this.className || this.nodeType;
  }
  getType() {
    return this.nodeType;
  }
  getDragDistance() {
    if (this.attrs.dragDistance !== void 0) {
      return this.attrs.dragDistance;
    } else if (this.parent) {
      return this.parent.getDragDistance();
    } else {
      return Global_1$m.Konva.dragDistance;
    }
  }
  _off(type, name, callback) {
    var evtListeners = this.eventListeners[type], i, evtName, handler;
    for (i = 0; i < evtListeners.length; i++) {
      evtName = evtListeners[i].name;
      handler = evtListeners[i].handler;
      if ((evtName !== "konva" || name === "konva") && (!name || evtName === name) && (!callback || callback === handler)) {
        evtListeners.splice(i, 1);
        if (evtListeners.length === 0) {
          delete this.eventListeners[type];
          break;
        }
        i--;
      }
    }
  }
  _fireChangeEvent(attr, oldVal, newVal) {
    this._fire(attr + CHANGE, {
      oldVal,
      newVal
    });
  }
  addName(name) {
    if (!this.hasName(name)) {
      var oldName = this.name();
      var newName = oldName ? oldName + " " + name : name;
      this.name(newName);
    }
    return this;
  }
  hasName(name) {
    if (!name) {
      return false;
    }
    const fullName = this.name();
    if (!fullName) {
      return false;
    }
    var names = (fullName || "").split(/\s/g);
    return names.indexOf(name) !== -1;
  }
  removeName(name) {
    var names = (this.name() || "").split(/\s/g);
    var index = names.indexOf(name);
    if (index !== -1) {
      names.splice(index, 1);
      this.name(names.join(" "));
    }
    return this;
  }
  setAttr(attr, val) {
    var func = this[SET + Util_1$c.Util._capitalize(attr)];
    if (Util_1$c.Util._isFunction(func)) {
      func.call(this, val);
    } else {
      this._setAttr(attr, val);
    }
    return this;
  }
  _requestDraw() {
    if (Global_1$m.Konva.autoDrawEnabled) {
      const drawNode = this.getLayer() || this.getStage();
      drawNode === null || drawNode === void 0 ? void 0 : drawNode.batchDraw();
    }
  }
  _setAttr(key, val) {
    var oldVal = this.attrs[key];
    if (oldVal === val && !Util_1$c.Util.isObject(val)) {
      return;
    }
    if (val === void 0 || val === null) {
      delete this.attrs[key];
    } else {
      this.attrs[key] = val;
    }
    if (this._shouldFireChangeEvents) {
      this._fireChangeEvent(key, oldVal, val);
    }
    this._requestDraw();
  }
  _setComponentAttr(key, component, val) {
    var oldVal;
    if (val !== void 0) {
      oldVal = this.attrs[key];
      if (!oldVal) {
        this.attrs[key] = this.getAttr(key);
      }
      this.attrs[key][component] = val;
      this._fireChangeEvent(key, oldVal, val);
    }
  }
  _fireAndBubble(eventType, evt, compareShape) {
    if (evt && this.nodeType === SHAPE) {
      evt.target = this;
    }
    var shouldStop = (eventType === MOUSEENTER || eventType === MOUSELEAVE) && (compareShape && (this === compareShape || this.isAncestorOf && this.isAncestorOf(compareShape)) || this.nodeType === "Stage" && !compareShape);
    if (!shouldStop) {
      this._fire(eventType, evt);
      var stopBubble = (eventType === MOUSEENTER || eventType === MOUSELEAVE) && compareShape && compareShape.isAncestorOf && compareShape.isAncestorOf(this) && !compareShape.isAncestorOf(this.parent);
      if ((evt && !evt.cancelBubble || !evt) && this.parent && this.parent.isListening() && !stopBubble) {
        if (compareShape && compareShape.parent) {
          this._fireAndBubble.call(this.parent, eventType, evt, compareShape);
        } else {
          this._fireAndBubble.call(this.parent, eventType, evt);
        }
      }
    }
  }
  _getProtoListeners(eventType) {
    var _a2, _b2, _c;
    const allListeners = (_a2 = this._cache.get(ALL_LISTENERS)) !== null && _a2 !== void 0 ? _a2 : {};
    let events = allListeners === null || allListeners === void 0 ? void 0 : allListeners[eventType];
    if (events === void 0) {
      events = [];
      let obj = Object.getPrototypeOf(this);
      while (obj) {
        const hierarchyEvents = (_c = (_b2 = obj.eventListeners) === null || _b2 === void 0 ? void 0 : _b2[eventType]) !== null && _c !== void 0 ? _c : [];
        events.push(...hierarchyEvents);
        obj = Object.getPrototypeOf(obj);
      }
      allListeners[eventType] = events;
      this._cache.set(ALL_LISTENERS, allListeners);
    }
    return events;
  }
  _fire(eventType, evt) {
    evt = evt || {};
    evt.currentTarget = this;
    evt.type = eventType;
    const topListeners = this._getProtoListeners(eventType);
    if (topListeners) {
      for (var i = 0; i < topListeners.length; i++) {
        topListeners[i].handler.call(this, evt);
      }
    }
    const selfListeners = this.eventListeners[eventType];
    if (selfListeners) {
      for (var i = 0; i < selfListeners.length; i++) {
        selfListeners[i].handler.call(this, evt);
      }
    }
  }
  draw() {
    this.drawScene();
    this.drawHit();
    return this;
  }
  _createDragElement(evt) {
    var pointerId = evt ? evt.pointerId : void 0;
    var stage = this.getStage();
    var ap = this.getAbsolutePosition();
    if (!stage) {
      return;
    }
    var pos = stage._getPointerById(pointerId) || stage._changedPointerPositions[0] || ap;
    DragAndDrop_1.DD._dragElements.set(this._id, {
      node: this,
      startPointerPos: pos,
      offset: {
        x: pos.x - ap.x,
        y: pos.y - ap.y
      },
      dragStatus: "ready",
      pointerId
    });
  }
  startDrag(evt, bubbleEvent = true) {
    if (!DragAndDrop_1.DD._dragElements.has(this._id)) {
      this._createDragElement(evt);
    }
    const elem = DragAndDrop_1.DD._dragElements.get(this._id);
    elem.dragStatus = "dragging";
    this.fire("dragstart", {
      type: "dragstart",
      target: this,
      evt: evt && evt.evt
    }, bubbleEvent);
  }
  _setDragPosition(evt, elem) {
    const pos = this.getStage()._getPointerById(elem.pointerId);
    if (!pos) {
      return;
    }
    var newNodePos = {
      x: pos.x - elem.offset.x,
      y: pos.y - elem.offset.y
    };
    var dbf = this.dragBoundFunc();
    if (dbf !== void 0) {
      const bounded = dbf.call(this, newNodePos, evt);
      if (!bounded) {
        Util_1$c.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.");
      } else {
        newNodePos = bounded;
      }
    }
    if (!this._lastPos || this._lastPos.x !== newNodePos.x || this._lastPos.y !== newNodePos.y) {
      this.setAbsolutePosition(newNodePos);
      this._requestDraw();
    }
    this._lastPos = newNodePos;
  }
  stopDrag(evt) {
    const elem = DragAndDrop_1.DD._dragElements.get(this._id);
    if (elem) {
      elem.dragStatus = "stopped";
    }
    DragAndDrop_1.DD._endDragBefore(evt);
    DragAndDrop_1.DD._endDragAfter(evt);
  }
  setDraggable(draggable) {
    this._setAttr("draggable", draggable);
    this._dragChange();
  }
  isDragging() {
    const elem = DragAndDrop_1.DD._dragElements.get(this._id);
    return elem ? elem.dragStatus === "dragging" : false;
  }
  _listenDrag() {
    this._dragCleanup();
    this.on("mousedown.konva touchstart.konva", function(evt) {
      var shouldCheckButton = evt.evt["button"] !== void 0;
      var canDrag = !shouldCheckButton || Global_1$m.Konva.dragButtons.indexOf(evt.evt["button"]) >= 0;
      if (!canDrag) {
        return;
      }
      if (this.isDragging()) {
        return;
      }
      var hasDraggingChild = false;
      DragAndDrop_1.DD._dragElements.forEach((elem) => {
        if (this.isAncestorOf(elem.node)) {
          hasDraggingChild = true;
        }
      });
      if (!hasDraggingChild) {
        this._createDragElement(evt);
      }
    });
  }
  _dragChange() {
    if (this.attrs.draggable) {
      this._listenDrag();
    } else {
      this._dragCleanup();
      var stage = this.getStage();
      if (!stage) {
        return;
      }
      const dragElement = DragAndDrop_1.DD._dragElements.get(this._id);
      const isDragging = dragElement && dragElement.dragStatus === "dragging";
      const isReady = dragElement && dragElement.dragStatus === "ready";
      if (isDragging) {
        this.stopDrag();
      } else if (isReady) {
        DragAndDrop_1.DD._dragElements.delete(this._id);
      }
    }
  }
  _dragCleanup() {
    this.off("mousedown.konva");
    this.off("touchstart.konva");
  }
  isClientRectOnScreen(margin = { x: 0, y: 0 }) {
    const stage = this.getStage();
    if (!stage) {
      return false;
    }
    const screenRect = {
      x: -margin.x,
      y: -margin.y,
      width: stage.width() + 2 * margin.x,
      height: stage.height() + 2 * margin.y
    };
    return Util_1$c.Util.haveIntersection(screenRect, this.getClientRect());
  }
  static create(data, container) {
    if (Util_1$c.Util._isString(data)) {
      data = JSON.parse(data);
    }
    return this._createNode(data, container);
  }
  static _createNode(obj, container) {
    var className = Node2.prototype.getClassName.call(obj), children = obj.children, no, len, n2;
    if (container) {
      obj.attrs.container = container;
    }
    if (!Global_1$m.Konva[className]) {
      Util_1$c.Util.warn('Can not find a node with class name "' + className + '". Fallback to "Shape".');
      className = "Shape";
    }
    const Class = Global_1$m.Konva[className];
    no = new Class(obj.attrs);
    if (children) {
      len = children.length;
      for (n2 = 0; n2 < len; n2++) {
        no.add(Node2._createNode(children[n2]));
      }
    }
    return no;
  }
}
Node$1.Node = Node2;
Node2.prototype.nodeType = "Node";
Node2.prototype._attrsAffectingSize = [];
Node2.prototype.eventListeners = {};
Node2.prototype.on.call(Node2.prototype, TRANSFORM_CHANGE_STR$1, function() {
  if (this._batchingTransformChange) {
    this._needClearTransformCache = true;
    return;
  }
  this._clearCache(TRANSFORM);
  this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
});
Node2.prototype.on.call(Node2.prototype, "visibleChange.konva", function() {
  this._clearSelfAndDescendantCache(VISIBLE);
});
Node2.prototype.on.call(Node2.prototype, "listeningChange.konva", function() {
  this._clearSelfAndDescendantCache(LISTENING);
});
Node2.prototype.on.call(Node2.prototype, "opacityChange.konva", function() {
  this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);
});
const addGetterSetter = Factory_1$y.Factory.addGetterSetter;
addGetterSetter(Node2, "zIndex");
addGetterSetter(Node2, "absolutePosition");
addGetterSetter(Node2, "position");
addGetterSetter(Node2, "x", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "y", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "globalCompositeOperation", "source-over", (0, Validators_1$x.getStringValidator)());
addGetterSetter(Node2, "opacity", 1, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "name", "", (0, Validators_1$x.getStringValidator)());
addGetterSetter(Node2, "id", "", (0, Validators_1$x.getStringValidator)());
addGetterSetter(Node2, "rotation", 0, (0, Validators_1$x.getNumberValidator)());
Factory_1$y.Factory.addComponentsGetterSetter(Node2, "scale", ["x", "y"]);
addGetterSetter(Node2, "scaleX", 1, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "scaleY", 1, (0, Validators_1$x.getNumberValidator)());
Factory_1$y.Factory.addComponentsGetterSetter(Node2, "skew", ["x", "y"]);
addGetterSetter(Node2, "skewX", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "skewY", 0, (0, Validators_1$x.getNumberValidator)());
Factory_1$y.Factory.addComponentsGetterSetter(Node2, "offset", ["x", "y"]);
addGetterSetter(Node2, "offsetX", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "offsetY", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "dragDistance", null, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "width", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "height", 0, (0, Validators_1$x.getNumberValidator)());
addGetterSetter(Node2, "listening", true, (0, Validators_1$x.getBooleanValidator)());
addGetterSetter(Node2, "preventDefault", true, (0, Validators_1$x.getBooleanValidator)());
addGetterSetter(Node2, "filters", null, function(val) {
  this._filterUpToDate = false;
  return val;
});
addGetterSetter(Node2, "visible", true, (0, Validators_1$x.getBooleanValidator)());
addGetterSetter(Node2, "transformsEnabled", "all", (0, Validators_1$x.getStringValidator)());
addGetterSetter(Node2, "size");
addGetterSetter(Node2, "dragBoundFunc");
addGetterSetter(Node2, "draggable", false, (0, Validators_1$x.getBooleanValidator)());
Factory_1$y.Factory.backCompat(Node2, {
  rotateDeg: "rotate",
  setRotationDeg: "setRotation",
  getRotationDeg: "getRotation"
});
var Container$4 = {};
Object.defineProperty(Container$4, "__esModule", { value: true });
Container$4.Container = void 0;
const Factory_1$x = Factory;
const Node_1$h = Node$1;
const Validators_1$w = Validators;
let Container$3 = class Container2 extends Node_1$h.Node {
  constructor() {
    super(...arguments);
    this.children = [];
  }
  getChildren(filterFunc) {
    if (!filterFunc) {
      return this.children || [];
    }
    const children = this.children || [];
    var results = [];
    children.forEach(function(child) {
      if (filterFunc(child)) {
        results.push(child);
      }
    });
    return results;
  }
  hasChildren() {
    return this.getChildren().length > 0;
  }
  removeChildren() {
    this.getChildren().forEach((child) => {
      child.parent = null;
      child.index = 0;
      child.remove();
    });
    this.children = [];
    this._requestDraw();
    return this;
  }
  destroyChildren() {
    this.getChildren().forEach((child) => {
      child.parent = null;
      child.index = 0;
      child.destroy();
    });
    this.children = [];
    this._requestDraw();
    return this;
  }
  add(...children) {
    if (children.length === 0) {
      return this;
    }
    if (children.length > 1) {
      for (var i = 0; i < children.length; i++) {
        this.add(children[i]);
      }
      return this;
    }
    const child = children[0];
    if (child.getParent()) {
      child.moveTo(this);
      return this;
    }
    this._validateAdd(child);
    child.index = this.getChildren().length;
    child.parent = this;
    child._clearCaches();
    this.getChildren().push(child);
    this._fire("add", {
      child
    });
    this._requestDraw();
    return this;
  }
  destroy() {
    if (this.hasChildren()) {
      this.destroyChildren();
    }
    super.destroy();
    return this;
  }
  find(selector) {
    return this._generalFind(selector, false);
  }
  findOne(selector) {
    var result = this._generalFind(selector, true);
    return result.length > 0 ? result[0] : void 0;
  }
  _generalFind(selector, findOne) {
    var retArr = [];
    this._descendants((node) => {
      const valid = node._isMatch(selector);
      if (valid) {
        retArr.push(node);
      }
      if (valid && findOne) {
        return true;
      }
      return false;
    });
    return retArr;
  }
  _descendants(fn2) {
    let shouldStop = false;
    const children = this.getChildren();
    for (const child of children) {
      shouldStop = fn2(child);
      if (shouldStop) {
        return true;
      }
      if (!child.hasChildren()) {
        continue;
      }
      shouldStop = child._descendants(fn2);
      if (shouldStop) {
        return true;
      }
    }
    return false;
  }
  toObject() {
    var obj = Node_1$h.Node.prototype.toObject.call(this);
    obj.children = [];
    this.getChildren().forEach((child) => {
      obj.children.push(child.toObject());
    });
    return obj;
  }
  isAncestorOf(node) {
    var parent = node.getParent();
    while (parent) {
      if (parent._id === this._id) {
        return true;
      }
      parent = parent.getParent();
    }
    return false;
  }
  clone(obj) {
    var node = Node_1$h.Node.prototype.clone.call(this, obj);
    this.getChildren().forEach(function(no) {
      node.add(no.clone());
    });
    return node;
  }
  getAllIntersections(pos) {
    var arr = [];
    this.find("Shape").forEach((shape) => {
      if (shape.isVisible() && shape.intersects(pos)) {
        arr.push(shape);
      }
    });
    return arr;
  }
  _clearSelfAndDescendantCache(attr) {
    var _a2;
    super._clearSelfAndDescendantCache(attr);
    if (this.isCached()) {
      return;
    }
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(node) {
      node._clearSelfAndDescendantCache(attr);
    });
  }
  _setChildrenIndices() {
    var _a2;
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child, n2) {
      child.index = n2;
    });
    this._requestDraw();
  }
  drawScene(can, top2, bufferCanvas) {
    var layer = this.getLayer(), canvas = can || layer && layer.getCanvas(), context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedSceneCanvas = cachedCanvas && cachedCanvas.scene;
    var caching = canvas && canvas.isCache;
    if (!this.isVisible() && !caching) {
      return this;
    }
    if (cachedSceneCanvas) {
      context.save();
      var m2 = this.getAbsoluteTransform(top2).getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      this._drawCachedSceneCanvas(context);
      context.restore();
    } else {
      this._drawChildren("drawScene", canvas, top2, bufferCanvas);
    }
    return this;
  }
  drawHit(can, top2) {
    if (!this.shouldDrawHit(top2)) {
      return this;
    }
    var layer = this.getLayer(), canvas = can || layer && layer.hitCanvas, context = canvas && canvas.getContext(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
    if (cachedHitCanvas) {
      context.save();
      var m2 = this.getAbsoluteTransform(top2).getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      this._drawCachedHitCanvas(context);
      context.restore();
    } else {
      this._drawChildren("drawHit", canvas, top2);
    }
    return this;
  }
  _drawChildren(drawMethod, canvas, top2, bufferCanvas) {
    var _a2;
    var context = canvas && canvas.getContext(), clipWidth = this.clipWidth(), clipHeight = this.clipHeight(), clipFunc = this.clipFunc(), hasClip = typeof clipWidth === "number" && typeof clipHeight === "number" || clipFunc;
    const selfCache = top2 === this;
    if (hasClip) {
      context.save();
      var transform = this.getAbsoluteTransform(top2);
      var m2 = transform.getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
      context.beginPath();
      let clipArgs;
      if (clipFunc) {
        clipArgs = clipFunc.call(this, context, this);
      } else {
        var clipX = this.clipX();
        var clipY = this.clipY();
        context.rect(clipX || 0, clipY || 0, clipWidth, clipHeight);
      }
      context.clip.apply(context, clipArgs);
      m2 = transform.copy().invert().getMatrix();
      context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
    }
    var hasComposition = !selfCache && this.globalCompositeOperation() !== "source-over" && drawMethod === "drawScene";
    if (hasComposition) {
      context.save();
      context._applyGlobalCompositeOperation(this);
    }
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child) {
      child[drawMethod](canvas, top2, bufferCanvas);
    });
    if (hasComposition) {
      context.restore();
    }
    if (hasClip) {
      context.restore();
    }
  }
  getClientRect(config = {}) {
    var _a2;
    var skipTransform = config.skipTransform;
    var relativeTo = config.relativeTo;
    var minX, minY, maxX, maxY;
    var selfRect = {
      x: Infinity,
      y: Infinity,
      width: 0,
      height: 0
    };
    var that = this;
    (_a2 = this.children) === null || _a2 === void 0 ? void 0 : _a2.forEach(function(child) {
      if (!child.visible()) {
        return;
      }
      var rect = child.getClientRect({
        relativeTo: that,
        skipShadow: config.skipShadow,
        skipStroke: config.skipStroke
      });
      if (rect.width === 0 && rect.height === 0) {
        return;
      }
      if (minX === void 0) {
        minX = rect.x;
        minY = rect.y;
        maxX = rect.x + rect.width;
        maxY = rect.y + rect.height;
      } else {
        minX = Math.min(minX, rect.x);
        minY = Math.min(minY, rect.y);
        maxX = Math.max(maxX, rect.x + rect.width);
        maxY = Math.max(maxY, rect.y + rect.height);
      }
    });
    var shapes = this.find("Shape");
    var hasVisible = false;
    for (var i = 0; i < shapes.length; i++) {
      var shape = shapes[i];
      if (shape._isVisible(this)) {
        hasVisible = true;
        break;
      }
    }
    if (hasVisible && minX !== void 0) {
      selfRect = {
        x: minX,
        y: minY,
        width: maxX - minX,
        height: maxY - minY
      };
    } else {
      selfRect = {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      };
    }
    if (!skipTransform) {
      return this._transformedRect(selfRect, relativeTo);
    }
    return selfRect;
  }
};
Container$4.Container = Container$3;
Factory_1$x.Factory.addComponentsGetterSetter(Container$3, "clip", [
  "x",
  "y",
  "width",
  "height"
]);
Factory_1$x.Factory.addGetterSetter(Container$3, "clipX", void 0, (0, Validators_1$w.getNumberValidator)());
Factory_1$x.Factory.addGetterSetter(Container$3, "clipY", void 0, (0, Validators_1$w.getNumberValidator)());
Factory_1$x.Factory.addGetterSetter(Container$3, "clipWidth", void 0, (0, Validators_1$w.getNumberValidator)());
Factory_1$x.Factory.addGetterSetter(Container$3, "clipHeight", void 0, (0, Validators_1$w.getNumberValidator)());
Factory_1$x.Factory.addGetterSetter(Container$3, "clipFunc");
var Stage = {};
var PointerEvents = {};
Object.defineProperty(PointerEvents, "__esModule", { value: true });
PointerEvents.releaseCapture = PointerEvents.setPointerCapture = PointerEvents.hasPointerCapture = PointerEvents.createEvent = PointerEvents.getCapturedShape = void 0;
const Global_1$l = Global;
const Captures = /* @__PURE__ */ new Map();
const SUPPORT_POINTER_EVENTS = Global_1$l.Konva._global["PointerEvent"] !== void 0;
function getCapturedShape(pointerId) {
  return Captures.get(pointerId);
}
PointerEvents.getCapturedShape = getCapturedShape;
function createEvent(evt) {
  return {
    evt,
    pointerId: evt.pointerId
  };
}
PointerEvents.createEvent = createEvent;
function hasPointerCapture(pointerId, shape) {
  return Captures.get(pointerId) === shape;
}
PointerEvents.hasPointerCapture = hasPointerCapture;
function setPointerCapture(pointerId, shape) {
  releaseCapture(pointerId);
  const stage = shape.getStage();
  if (!stage)
    return;
  Captures.set(pointerId, shape);
  if (SUPPORT_POINTER_EVENTS) {
    shape._fire("gotpointercapture", createEvent(new PointerEvent("gotpointercapture")));
  }
}
PointerEvents.setPointerCapture = setPointerCapture;
function releaseCapture(pointerId, target) {
  const shape = Captures.get(pointerId);
  if (!shape)
    return;
  const stage = shape.getStage();
  if (stage && stage.content) ;
  Captures.delete(pointerId);
  if (SUPPORT_POINTER_EVENTS) {
    shape._fire("lostpointercapture", createEvent(new PointerEvent("lostpointercapture")));
  }
}
PointerEvents.releaseCapture = releaseCapture;
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Stage = exports.stages = void 0;
  const Util_12 = Util;
  const Factory_12 = Factory;
  const Container_12 = Container$4;
  const Global_12 = Global;
  const Canvas_12 = Canvas$1;
  const DragAndDrop_12 = DragAndDrop;
  const Global_22 = Global;
  const PointerEvents$12 = PointerEvents;
  var STAGE2 = "Stage", STRING = "string", PX = "px", MOUSEOUT = "mouseout", MOUSELEAVE2 = "mouseleave", MOUSEOVER = "mouseover", MOUSEENTER2 = "mouseenter", MOUSEMOVE = "mousemove", MOUSEDOWN = "mousedown", MOUSEUP = "mouseup", POINTERMOVE = "pointermove", POINTERDOWN = "pointerdown", POINTERUP = "pointerup", POINTERCANCEL = "pointercancel", LOSTPOINTERCAPTURE = "lostpointercapture", POINTEROUT = "pointerout", POINTERLEAVE = "pointerleave", POINTEROVER = "pointerover", POINTERENTER = "pointerenter", CONTEXTMENU = "contextmenu", TOUCHSTART = "touchstart", TOUCHEND = "touchend", TOUCHMOVE = "touchmove", TOUCHCANCEL = "touchcancel", WHEEL = "wheel", MAX_LAYERS_NUMBER = 5, EVENTS = [
    [MOUSEENTER2, "_pointerenter"],
    [MOUSEDOWN, "_pointerdown"],
    [MOUSEMOVE, "_pointermove"],
    [MOUSEUP, "_pointerup"],
    [MOUSELEAVE2, "_pointerleave"],
    [TOUCHSTART, "_pointerdown"],
    [TOUCHMOVE, "_pointermove"],
    [TOUCHEND, "_pointerup"],
    [TOUCHCANCEL, "_pointercancel"],
    [MOUSEOVER, "_pointerover"],
    [WHEEL, "_wheel"],
    [CONTEXTMENU, "_contextmenu"],
    [POINTERDOWN, "_pointerdown"],
    [POINTERMOVE, "_pointermove"],
    [POINTERUP, "_pointerup"],
    [POINTERCANCEL, "_pointercancel"],
    [LOSTPOINTERCAPTURE, "_lostpointercapture"]
  ];
  const EVENTS_MAP = {
    mouse: {
      [POINTEROUT]: MOUSEOUT,
      [POINTERLEAVE]: MOUSELEAVE2,
      [POINTEROVER]: MOUSEOVER,
      [POINTERENTER]: MOUSEENTER2,
      [POINTERMOVE]: MOUSEMOVE,
      [POINTERDOWN]: MOUSEDOWN,
      [POINTERUP]: MOUSEUP,
      [POINTERCANCEL]: "mousecancel",
      pointerclick: "click",
      pointerdblclick: "dblclick"
    },
    touch: {
      [POINTEROUT]: "touchout",
      [POINTERLEAVE]: "touchleave",
      [POINTEROVER]: "touchover",
      [POINTERENTER]: "touchenter",
      [POINTERMOVE]: TOUCHMOVE,
      [POINTERDOWN]: TOUCHSTART,
      [POINTERUP]: TOUCHEND,
      [POINTERCANCEL]: TOUCHCANCEL,
      pointerclick: "tap",
      pointerdblclick: "dbltap"
    },
    pointer: {
      [POINTEROUT]: POINTEROUT,
      [POINTERLEAVE]: POINTERLEAVE,
      [POINTEROVER]: POINTEROVER,
      [POINTERENTER]: POINTERENTER,
      [POINTERMOVE]: POINTERMOVE,
      [POINTERDOWN]: POINTERDOWN,
      [POINTERUP]: POINTERUP,
      [POINTERCANCEL]: POINTERCANCEL,
      pointerclick: "pointerclick",
      pointerdblclick: "pointerdblclick"
    }
  };
  const getEventType = (type) => {
    if (type.indexOf("pointer") >= 0) {
      return "pointer";
    }
    if (type.indexOf("touch") >= 0) {
      return "touch";
    }
    return "mouse";
  };
  const getEventsMap = (eventType) => {
    const type = getEventType(eventType);
    if (type === "pointer") {
      return Global_12.Konva.pointerEventsEnabled && EVENTS_MAP.pointer;
    }
    if (type === "touch") {
      return EVENTS_MAP.touch;
    }
    if (type === "mouse") {
      return EVENTS_MAP.mouse;
    }
  };
  function checkNoClip(attrs = {}) {
    if (attrs.clipFunc || attrs.clipWidth || attrs.clipHeight) {
      Util_12.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups.");
    }
    return attrs;
  }
  const NO_POINTERS_MESSAGE = `Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);`;
  exports.stages = [];
  class Stage2 extends Container_12.Container {
    constructor(config) {
      super(checkNoClip(config));
      this._pointerPositions = [];
      this._changedPointerPositions = [];
      this._buildDOM();
      this._bindContentEvents();
      exports.stages.push(this);
      this.on("widthChange.konva heightChange.konva", this._resizeDOM);
      this.on("visibleChange.konva", this._checkVisibility);
      this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva", () => {
        checkNoClip(this.attrs);
      });
      this._checkVisibility();
    }
    _validateAdd(child) {
      const isLayer = child.getType() === "Layer";
      const isFastLayer = child.getType() === "FastLayer";
      const valid = isLayer || isFastLayer;
      if (!valid) {
        Util_12.Util.throw("You may only add layers to the stage.");
      }
    }
    _checkVisibility() {
      if (!this.content) {
        return;
      }
      const style2 = this.visible() ? "" : "none";
      this.content.style.display = style2;
    }
    setContainer(container) {
      if (typeof container === STRING) {
        if (container.charAt(0) === ".") {
          var className = container.slice(1);
          container = document.getElementsByClassName(className)[0];
        } else {
          var id2;
          if (container.charAt(0) !== "#") {
            id2 = container;
          } else {
            id2 = container.slice(1);
          }
          container = document.getElementById(id2);
        }
        if (!container) {
          throw "Can not find container in document with id " + id2;
        }
      }
      this._setAttr("container", container);
      if (this.content) {
        if (this.content.parentElement) {
          this.content.parentElement.removeChild(this.content);
        }
        container.appendChild(this.content);
      }
      return this;
    }
    shouldDrawHit() {
      return true;
    }
    clear() {
      var layers = this.children, len = layers.length, n2;
      for (n2 = 0; n2 < len; n2++) {
        layers[n2].clear();
      }
      return this;
    }
    clone(obj) {
      if (!obj) {
        obj = {};
      }
      obj.container = typeof document !== "undefined" && document.createElement("div");
      return Container_12.Container.prototype.clone.call(this, obj);
    }
    destroy() {
      super.destroy();
      var content = this.content;
      if (content && Util_12.Util._isInDocument(content)) {
        this.container().removeChild(content);
      }
      var index = exports.stages.indexOf(this);
      if (index > -1) {
        exports.stages.splice(index, 1);
      }
      Util_12.Util.releaseCanvas(this.bufferCanvas._canvas, this.bufferHitCanvas._canvas);
      return this;
    }
    getPointerPosition() {
      const pos = this._pointerPositions[0] || this._changedPointerPositions[0];
      if (!pos) {
        Util_12.Util.warn(NO_POINTERS_MESSAGE);
        return null;
      }
      return {
        x: pos.x,
        y: pos.y
      };
    }
    _getPointerById(id2) {
      return this._pointerPositions.find((p2) => p2.id === id2);
    }
    getPointersPositions() {
      return this._pointerPositions;
    }
    getStage() {
      return this;
    }
    getContent() {
      return this.content;
    }
    _toKonvaCanvas(config) {
      config = config || {};
      config.x = config.x || 0;
      config.y = config.y || 0;
      config.width = config.width || this.width();
      config.height = config.height || this.height();
      var canvas = new Canvas_12.SceneCanvas({
        width: config.width,
        height: config.height,
        pixelRatio: config.pixelRatio || 1
      });
      var _context = canvas.getContext()._context;
      var layers = this.children;
      if (config.x || config.y) {
        _context.translate(-1 * config.x, -1 * config.y);
      }
      layers.forEach(function(layer) {
        if (!layer.isVisible()) {
          return;
        }
        var layerCanvas = layer._toKonvaCanvas(config);
        _context.drawImage(layerCanvas._canvas, config.x, config.y, layerCanvas.getWidth() / layerCanvas.getPixelRatio(), layerCanvas.getHeight() / layerCanvas.getPixelRatio());
      });
      return canvas;
    }
    getIntersection(pos) {
      if (!pos) {
        return null;
      }
      var layers = this.children, len = layers.length, end2 = len - 1, n2;
      for (n2 = end2; n2 >= 0; n2--) {
        const shape = layers[n2].getIntersection(pos);
        if (shape) {
          return shape;
        }
      }
      return null;
    }
    _resizeDOM() {
      var width = this.width();
      var height = this.height();
      if (this.content) {
        this.content.style.width = width + PX;
        this.content.style.height = height + PX;
      }
      this.bufferCanvas.setSize(width, height);
      this.bufferHitCanvas.setSize(width, height);
      this.children.forEach((layer) => {
        layer.setSize({ width, height });
        layer.draw();
      });
    }
    add(layer, ...rest) {
      if (arguments.length > 1) {
        for (var i = 0; i < arguments.length; i++) {
          this.add(arguments[i]);
        }
        return this;
      }
      super.add(layer);
      var length = this.children.length;
      if (length > MAX_LAYERS_NUMBER) {
        Util_12.Util.warn("The stage has " + length + " layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group.");
      }
      layer.setSize({ width: this.width(), height: this.height() });
      layer.draw();
      if (Global_12.Konva.isBrowser) {
        this.content.appendChild(layer.canvas._canvas);
      }
      return this;
    }
    getParent() {
      return null;
    }
    getLayer() {
      return null;
    }
    hasPointerCapture(pointerId) {
      return PointerEvents$12.hasPointerCapture(pointerId, this);
    }
    setPointerCapture(pointerId) {
      PointerEvents$12.setPointerCapture(pointerId, this);
    }
    releaseCapture(pointerId) {
      PointerEvents$12.releaseCapture(pointerId, this);
    }
    getLayers() {
      return this.children;
    }
    _bindContentEvents() {
      if (!Global_12.Konva.isBrowser) {
        return;
      }
      EVENTS.forEach(([event, methodName]) => {
        this.content.addEventListener(event, (evt) => {
          this[methodName](evt);
        }, { passive: false });
      });
    }
    _pointerenter(evt) {
      this.setPointersPositions(evt);
      const events = getEventsMap(evt.type);
      if (events) {
        this._fire(events.pointerenter, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _pointerover(evt) {
      this.setPointersPositions(evt);
      const events = getEventsMap(evt.type);
      if (events) {
        this._fire(events.pointerover, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _getTargetShape(evenType) {
      let shape = this[evenType + "targetShape"];
      if (shape && !shape.getStage()) {
        shape = null;
      }
      return shape;
    }
    _pointerleave(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      var targetShape = this._getTargetShape(eventType);
      var eventsEnabled = !(Global_12.Konva.isDragging() || Global_12.Konva.isTransforming()) || Global_12.Konva.hitOnDragEnabled;
      if (targetShape && eventsEnabled) {
        targetShape._fireAndBubble(events.pointerout, { evt });
        targetShape._fireAndBubble(events.pointerleave, { evt });
        this._fire(events.pointerleave, {
          evt,
          target: this,
          currentTarget: this
        });
        this[eventType + "targetShape"] = null;
      } else if (eventsEnabled) {
        this._fire(events.pointerleave, {
          evt,
          target: this,
          currentTarget: this
        });
        this._fire(events.pointerout, {
          evt,
          target: this,
          currentTarget: this
        });
      }
      this.pointerPos = null;
      this._pointerPositions = [];
    }
    _pointerdown(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      var triggeredOnShape = false;
      this._changedPointerPositions.forEach((pos) => {
        var shape = this.getIntersection(pos);
        DragAndDrop_12.DD.justDragged = false;
        Global_12.Konva["_" + eventType + "ListenClick"] = true;
        if (!shape || !shape.isListening()) {
          return;
        }
        if (Global_12.Konva.capturePointerEventsEnabled) {
          shape.setPointerCapture(pos.id);
        }
        this[eventType + "ClickStartShape"] = shape;
        shape._fireAndBubble(events.pointerdown, {
          evt,
          pointerId: pos.id
        });
        triggeredOnShape = true;
        const isTouch = evt.type.indexOf("touch") >= 0;
        if (shape.preventDefault() && evt.cancelable && isTouch) {
          evt.preventDefault();
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointerdown, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._pointerPositions[0].id
        });
      }
    }
    _pointermove(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      if (Global_12.Konva.isDragging() && DragAndDrop_12.DD.node.preventDefault() && evt.cancelable) {
        evt.preventDefault();
      }
      this.setPointersPositions(evt);
      var eventsEnabled = !(Global_12.Konva.isDragging() || Global_12.Konva.isTransforming()) || Global_12.Konva.hitOnDragEnabled;
      if (!eventsEnabled) {
        return;
      }
      var processedShapesIds = {};
      let triggeredOnShape = false;
      var targetShape = this._getTargetShape(eventType);
      this._changedPointerPositions.forEach((pos) => {
        const shape = PointerEvents$12.getCapturedShape(pos.id) || this.getIntersection(pos);
        const pointerId = pos.id;
        const event = { evt, pointerId };
        var differentTarget = targetShape !== shape;
        if (differentTarget && targetShape) {
          targetShape._fireAndBubble(events.pointerout, { ...event }, shape);
          targetShape._fireAndBubble(events.pointerleave, { ...event }, shape);
        }
        if (shape) {
          if (processedShapesIds[shape._id]) {
            return;
          }
          processedShapesIds[shape._id] = true;
        }
        if (shape && shape.isListening()) {
          triggeredOnShape = true;
          if (differentTarget) {
            shape._fireAndBubble(events.pointerover, { ...event }, targetShape);
            shape._fireAndBubble(events.pointerenter, { ...event }, targetShape);
            this[eventType + "targetShape"] = shape;
          }
          shape._fireAndBubble(events.pointermove, { ...event });
        } else {
          if (targetShape) {
            this._fire(events.pointerover, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
            this[eventType + "targetShape"] = null;
          }
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointermove, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._changedPointerPositions[0].id
        });
      }
    }
    _pointerup(evt) {
      const events = getEventsMap(evt.type);
      const eventType = getEventType(evt.type);
      if (!events) {
        return;
      }
      this.setPointersPositions(evt);
      const clickStartShape = this[eventType + "ClickStartShape"];
      const clickEndShape = this[eventType + "ClickEndShape"];
      var processedShapesIds = {};
      let triggeredOnShape = false;
      this._changedPointerPositions.forEach((pos) => {
        const shape = PointerEvents$12.getCapturedShape(pos.id) || this.getIntersection(pos);
        if (shape) {
          shape.releaseCapture(pos.id);
          if (processedShapesIds[shape._id]) {
            return;
          }
          processedShapesIds[shape._id] = true;
        }
        const pointerId = pos.id;
        const event = { evt, pointerId };
        let fireDblClick = false;
        if (Global_12.Konva["_" + eventType + "InDblClickWindow"]) {
          fireDblClick = true;
          clearTimeout(this[eventType + "DblTimeout"]);
        } else if (!DragAndDrop_12.DD.justDragged) {
          Global_12.Konva["_" + eventType + "InDblClickWindow"] = true;
          clearTimeout(this[eventType + "DblTimeout"]);
        }
        this[eventType + "DblTimeout"] = setTimeout(function() {
          Global_12.Konva["_" + eventType + "InDblClickWindow"] = false;
        }, Global_12.Konva.dblClickWindow);
        if (shape && shape.isListening()) {
          triggeredOnShape = true;
          this[eventType + "ClickEndShape"] = shape;
          shape._fireAndBubble(events.pointerup, { ...event });
          if (Global_12.Konva["_" + eventType + "ListenClick"] && clickStartShape && clickStartShape === shape) {
            shape._fireAndBubble(events.pointerclick, { ...event });
            if (fireDblClick && clickEndShape && clickEndShape === shape) {
              shape._fireAndBubble(events.pointerdblclick, { ...event });
            }
          }
        } else {
          this[eventType + "ClickEndShape"] = null;
          if (Global_12.Konva["_" + eventType + "ListenClick"]) {
            this._fire(events.pointerclick, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
          }
          if (fireDblClick) {
            this._fire(events.pointerdblclick, {
              evt,
              target: this,
              currentTarget: this,
              pointerId
            });
          }
        }
      });
      if (!triggeredOnShape) {
        this._fire(events.pointerup, {
          evt,
          target: this,
          currentTarget: this,
          pointerId: this._changedPointerPositions[0].id
        });
      }
      Global_12.Konva["_" + eventType + "ListenClick"] = false;
      if (evt.cancelable && eventType !== "touch") {
        evt.preventDefault();
      }
    }
    _contextmenu(evt) {
      this.setPointersPositions(evt);
      var shape = this.getIntersection(this.getPointerPosition());
      if (shape && shape.isListening()) {
        shape._fireAndBubble(CONTEXTMENU, { evt });
      } else {
        this._fire(CONTEXTMENU, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _wheel(evt) {
      this.setPointersPositions(evt);
      var shape = this.getIntersection(this.getPointerPosition());
      if (shape && shape.isListening()) {
        shape._fireAndBubble(WHEEL, { evt });
      } else {
        this._fire(WHEEL, {
          evt,
          target: this,
          currentTarget: this
        });
      }
    }
    _pointercancel(evt) {
      this.setPointersPositions(evt);
      const shape = PointerEvents$12.getCapturedShape(evt.pointerId) || this.getIntersection(this.getPointerPosition());
      if (shape) {
        shape._fireAndBubble(POINTERUP, PointerEvents$12.createEvent(evt));
      }
      PointerEvents$12.releaseCapture(evt.pointerId);
    }
    _lostpointercapture(evt) {
      PointerEvents$12.releaseCapture(evt.pointerId);
    }
    setPointersPositions(evt) {
      var contentPosition = this._getContentPosition(), x2 = null, y2 = null;
      evt = evt ? evt : window.event;
      if (evt.touches !== void 0) {
        this._pointerPositions = [];
        this._changedPointerPositions = [];
        Array.prototype.forEach.call(evt.touches, (touch) => {
          this._pointerPositions.push({
            id: touch.identifier,
            x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,
            y: (touch.clientY - contentPosition.top) / contentPosition.scaleY
          });
        });
        Array.prototype.forEach.call(evt.changedTouches || evt.touches, (touch) => {
          this._changedPointerPositions.push({
            id: touch.identifier,
            x: (touch.clientX - contentPosition.left) / contentPosition.scaleX,
            y: (touch.clientY - contentPosition.top) / contentPosition.scaleY
          });
        });
      } else {
        x2 = (evt.clientX - contentPosition.left) / contentPosition.scaleX;
        y2 = (evt.clientY - contentPosition.top) / contentPosition.scaleY;
        this.pointerPos = {
          x: x2,
          y: y2
        };
        this._pointerPositions = [{ x: x2, y: y2, id: Util_12.Util._getFirstPointerId(evt) }];
        this._changedPointerPositions = [
          { x: x2, y: y2, id: Util_12.Util._getFirstPointerId(evt) }
        ];
      }
    }
    _setPointerPosition(evt) {
      Util_12.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.');
      this.setPointersPositions(evt);
    }
    _getContentPosition() {
      if (!this.content || !this.content.getBoundingClientRect) {
        return {
          top: 0,
          left: 0,
          scaleX: 1,
          scaleY: 1
        };
      }
      var rect = this.content.getBoundingClientRect();
      return {
        top: rect.top,
        left: rect.left,
        scaleX: rect.width / this.content.clientWidth || 1,
        scaleY: rect.height / this.content.clientHeight || 1
      };
    }
    _buildDOM() {
      this.bufferCanvas = new Canvas_12.SceneCanvas({
        width: this.width(),
        height: this.height()
      });
      this.bufferHitCanvas = new Canvas_12.HitCanvas({
        pixelRatio: 1,
        width: this.width(),
        height: this.height()
      });
      if (!Global_12.Konva.isBrowser) {
        return;
      }
      var container = this.container();
      if (!container) {
        throw "Stage has no container. A container is required.";
      }
      container.innerHTML = "";
      this.content = document.createElement("div");
      this.content.style.position = "relative";
      this.content.style.userSelect = "none";
      this.content.className = "konvajs-content";
      this.content.setAttribute("role", "presentation");
      container.appendChild(this.content);
      this._resizeDOM();
    }
    cache() {
      Util_12.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes.");
      return this;
    }
    clearCache() {
      return this;
    }
    batchDraw() {
      this.getChildren().forEach(function(layer) {
        layer.batchDraw();
      });
      return this;
    }
  }
  exports.Stage = Stage2;
  Stage2.prototype.nodeType = STAGE2;
  (0, Global_22._registerNode)(Stage2);
  Factory_12.Factory.addGetterSetter(Stage2, "container");
})(Stage);
var Layer$1 = {};
var Shape = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Shape = exports.shapes = void 0;
  const Global_12 = Global;
  const Util_12 = Util;
  const Factory_12 = Factory;
  const Node_12 = Node$1;
  const Validators_12 = Validators;
  const Global_22 = Global;
  const PointerEvents$12 = PointerEvents;
  var HAS_SHADOW = "hasShadow";
  var SHADOW_RGBA = "shadowRGBA";
  var patternImage = "patternImage";
  var linearGradient = "linearGradient";
  var radialGradient = "radialGradient";
  let dummyContext2;
  function getDummyContext2() {
    if (dummyContext2) {
      return dummyContext2;
    }
    dummyContext2 = Util_12.Util.createCanvasElement().getContext("2d");
    return dummyContext2;
  }
  exports.shapes = {};
  function _fillFunc2(context) {
    const fillRule = this.attrs.fillRule;
    if (fillRule) {
      context.fill(fillRule);
    } else {
      context.fill();
    }
  }
  function _strokeFunc2(context) {
    context.stroke();
  }
  function _fillFuncHit(context) {
    context.fill();
  }
  function _strokeFuncHit(context) {
    context.stroke();
  }
  function _clearHasShadowCache() {
    this._clearCache(HAS_SHADOW);
  }
  function _clearGetShadowRGBACache() {
    this._clearCache(SHADOW_RGBA);
  }
  function _clearFillPatternCache() {
    this._clearCache(patternImage);
  }
  function _clearLinearGradientCache() {
    this._clearCache(linearGradient);
  }
  function _clearRadialGradientCache() {
    this._clearCache(radialGradient);
  }
  class Shape2 extends Node_12.Node {
    constructor(config) {
      super(config);
      let key;
      while (true) {
        key = Util_12.Util.getRandomColor();
        if (key && !(key in exports.shapes)) {
          break;
        }
      }
      this.colorKey = key;
      exports.shapes[key] = this;
    }
    getContext() {
      Util_12.Util.warn("shape.getContext() method is deprecated. Please do not use it.");
      return this.getLayer().getContext();
    }
    getCanvas() {
      Util_12.Util.warn("shape.getCanvas() method is deprecated. Please do not use it.");
      return this.getLayer().getCanvas();
    }
    getSceneFunc() {
      return this.attrs.sceneFunc || this["_sceneFunc"];
    }
    getHitFunc() {
      return this.attrs.hitFunc || this["_hitFunc"];
    }
    hasShadow() {
      return this._getCache(HAS_SHADOW, this._hasShadow);
    }
    _hasShadow() {
      return this.shadowEnabled() && this.shadowOpacity() !== 0 && !!(this.shadowColor() || this.shadowBlur() || this.shadowOffsetX() || this.shadowOffsetY());
    }
    _getFillPattern() {
      return this._getCache(patternImage, this.__getFillPattern);
    }
    __getFillPattern() {
      if (this.fillPatternImage()) {
        var ctx = getDummyContext2();
        const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || "repeat");
        if (pattern && pattern.setTransform) {
          const tr = new Util_12.Transform();
          tr.translate(this.fillPatternX(), this.fillPatternY());
          tr.rotate(Global_12.Konva.getAngle(this.fillPatternRotation()));
          tr.scale(this.fillPatternScaleX(), this.fillPatternScaleY());
          tr.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());
          const m2 = tr.getMatrix();
          const matrix = typeof DOMMatrix === "undefined" ? {
            a: m2[0],
            b: m2[1],
            c: m2[2],
            d: m2[3],
            e: m2[4],
            f: m2[5]
          } : new DOMMatrix(m2);
          pattern.setTransform(matrix);
        }
        return pattern;
      }
    }
    _getLinearGradient() {
      return this._getCache(linearGradient, this.__getLinearGradient);
    }
    __getLinearGradient() {
      var colorStops = this.fillLinearGradientColorStops();
      if (colorStops) {
        var ctx = getDummyContext2();
        var start2 = this.fillLinearGradientStartPoint();
        var end2 = this.fillLinearGradientEndPoint();
        var grd = ctx.createLinearGradient(start2.x, start2.y, end2.x, end2.y);
        for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
          grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
        }
        return grd;
      }
    }
    _getRadialGradient() {
      return this._getCache(radialGradient, this.__getRadialGradient);
    }
    __getRadialGradient() {
      var colorStops = this.fillRadialGradientColorStops();
      if (colorStops) {
        var ctx = getDummyContext2();
        var start2 = this.fillRadialGradientStartPoint();
        var end2 = this.fillRadialGradientEndPoint();
        var grd = ctx.createRadialGradient(start2.x, start2.y, this.fillRadialGradientStartRadius(), end2.x, end2.y, this.fillRadialGradientEndRadius());
        for (var n2 = 0; n2 < colorStops.length; n2 += 2) {
          grd.addColorStop(colorStops[n2], colorStops[n2 + 1]);
        }
        return grd;
      }
    }
    getShadowRGBA() {
      return this._getCache(SHADOW_RGBA, this._getShadowRGBA);
    }
    _getShadowRGBA() {
      if (!this.hasShadow()) {
        return;
      }
      var rgba = Util_12.Util.colorToRGBA(this.shadowColor());
      if (rgba) {
        return "rgba(" + rgba.r + "," + rgba.g + "," + rgba.b + "," + rgba.a * (this.shadowOpacity() || 1) + ")";
      }
    }
    hasFill() {
      return this._calculate("hasFill", [
        "fillEnabled",
        "fill",
        "fillPatternImage",
        "fillLinearGradientColorStops",
        "fillRadialGradientColorStops"
      ], () => {
        return this.fillEnabled() && !!(this.fill() || this.fillPatternImage() || this.fillLinearGradientColorStops() || this.fillRadialGradientColorStops());
      });
    }
    hasStroke() {
      return this._calculate("hasStroke", [
        "strokeEnabled",
        "strokeWidth",
        "stroke",
        "strokeLinearGradientColorStops"
      ], () => {
        return this.strokeEnabled() && this.strokeWidth() && !!(this.stroke() || this.strokeLinearGradientColorStops());
      });
    }
    hasHitStroke() {
      const width = this.hitStrokeWidth();
      if (width === "auto") {
        return this.hasStroke();
      }
      return this.strokeEnabled() && !!width;
    }
    intersects(point) {
      var stage = this.getStage();
      if (!stage) {
        return false;
      }
      const bufferHitCanvas = stage.bufferHitCanvas;
      bufferHitCanvas.getContext().clear();
      this.drawHit(bufferHitCanvas, void 0, true);
      const p2 = bufferHitCanvas.context.getImageData(Math.round(point.x), Math.round(point.y), 1, 1).data;
      return p2[3] > 0;
    }
    destroy() {
      Node_12.Node.prototype.destroy.call(this);
      delete exports.shapes[this.colorKey];
      delete this.colorKey;
      return this;
    }
    _useBufferCanvas(forceFill) {
      var _a2;
      const perfectDrawEnabled = (_a2 = this.attrs.perfectDrawEnabled) !== null && _a2 !== void 0 ? _a2 : true;
      if (!perfectDrawEnabled) {
        return false;
      }
      const hasFill = forceFill || this.hasFill();
      const hasStroke = this.hasStroke();
      const isTransparent = this.getAbsoluteOpacity() !== 1;
      if (hasFill && hasStroke && isTransparent) {
        return true;
      }
      const hasShadow = this.hasShadow();
      const strokeForShadow = this.shadowForStrokeEnabled();
      if (hasFill && hasStroke && hasShadow && strokeForShadow) {
        return true;
      }
      return false;
    }
    setStrokeHitEnabled(val) {
      Util_12.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead.");
      if (val) {
        this.hitStrokeWidth("auto");
      } else {
        this.hitStrokeWidth(0);
      }
    }
    getStrokeHitEnabled() {
      if (this.hitStrokeWidth() === 0) {
        return false;
      } else {
        return true;
      }
    }
    getSelfRect() {
      var size = this.size();
      return {
        x: this._centroid ? -size.width / 2 : 0,
        y: this._centroid ? -size.height / 2 : 0,
        width: size.width,
        height: size.height
      };
    }
    getClientRect(config = {}) {
      const skipTransform = config.skipTransform;
      const relativeTo = config.relativeTo;
      const fillRect = this.getSelfRect();
      const applyStroke = !config.skipStroke && this.hasStroke();
      const strokeWidth = applyStroke && this.strokeWidth() || 0;
      const fillAndStrokeWidth = fillRect.width + strokeWidth;
      const fillAndStrokeHeight = fillRect.height + strokeWidth;
      const applyShadow = !config.skipShadow && this.hasShadow();
      const shadowOffsetX = applyShadow ? this.shadowOffsetX() : 0;
      const shadowOffsetY = applyShadow ? this.shadowOffsetY() : 0;
      const preWidth = fillAndStrokeWidth + Math.abs(shadowOffsetX);
      const preHeight = fillAndStrokeHeight + Math.abs(shadowOffsetY);
      const blurRadius = applyShadow && this.shadowBlur() || 0;
      const width = preWidth + blurRadius * 2;
      const height = preHeight + blurRadius * 2;
      const rect = {
        width,
        height,
        x: -(strokeWidth / 2 + blurRadius) + Math.min(shadowOffsetX, 0) + fillRect.x,
        y: -(strokeWidth / 2 + blurRadius) + Math.min(shadowOffsetY, 0) + fillRect.y
      };
      if (!skipTransform) {
        return this._transformedRect(rect, relativeTo);
      }
      return rect;
    }
    drawScene(can, top2, bufferCanvas) {
      var layer = this.getLayer();
      var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;
      var skipBuffer = canvas.isCache;
      var cachingSelf = top2 === this;
      if (!this.isVisible() && !cachingSelf) {
        return this;
      }
      if (cachedCanvas) {
        context.save();
        var m2 = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
        this._drawCachedSceneCanvas(context);
        context.restore();
        return this;
      }
      if (!drawFunc) {
        return this;
      }
      context.save();
      if (this._useBufferCanvas() && !skipBuffer) {
        stage = this.getStage();
        const bc2 = bufferCanvas || stage.bufferCanvas;
        bufferContext = bc2.getContext();
        bufferContext.clear();
        bufferContext.save();
        bufferContext._applyLineJoin(this);
        var o = this.getAbsoluteTransform(top2).getMatrix();
        bufferContext.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
        drawFunc.call(this, bufferContext, this);
        bufferContext.restore();
        var ratio = bc2.pixelRatio;
        if (hasShadow) {
          context._applyShadow(this);
        }
        context._applyOpacity(this);
        context._applyGlobalCompositeOperation(this);
        context.drawImage(bc2._canvas, 0, 0, bc2.width / ratio, bc2.height / ratio);
      } else {
        context._applyLineJoin(this);
        if (!cachingSelf) {
          var o = this.getAbsoluteTransform(top2).getMatrix();
          context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
          context._applyOpacity(this);
          context._applyGlobalCompositeOperation(this);
        }
        if (hasShadow) {
          context._applyShadow(this);
        }
        drawFunc.call(this, context, this);
      }
      context.restore();
      return this;
    }
    drawHit(can, top2, skipDragCheck = false) {
      if (!this.shouldDrawHit(top2, skipDragCheck)) {
        return this;
      }
      var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
      if (!this.colorKey) {
        Util_12.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()");
      }
      if (cachedHitCanvas) {
        context.save();
        var m2 = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(m2[0], m2[1], m2[2], m2[3], m2[4], m2[5]);
        this._drawCachedHitCanvas(context);
        context.restore();
        return this;
      }
      if (!drawFunc) {
        return this;
      }
      context.save();
      context._applyLineJoin(this);
      const selfCache = this === top2;
      if (!selfCache) {
        var o = this.getAbsoluteTransform(top2).getMatrix();
        context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
      }
      drawFunc.call(this, context, this);
      context.restore();
      return this;
    }
    drawHitFromCache(alphaThreshold = 0) {
      var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
      hitContext.clear();
      hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
      try {
        hitImageData = hitContext.getImageData(0, 0, hitWidth, hitHeight);
        hitData = hitImageData.data;
        len = hitData.length;
        rgbColorKey = Util_12.Util._hexToRgb(this.colorKey);
        for (i = 0; i < len; i += 4) {
          alpha = hitData[i + 3];
          if (alpha > alphaThreshold) {
            hitData[i] = rgbColorKey.r;
            hitData[i + 1] = rgbColorKey.g;
            hitData[i + 2] = rgbColorKey.b;
            hitData[i + 3] = 255;
          } else {
            hitData[i + 3] = 0;
          }
        }
        hitContext.putImageData(hitImageData, 0, 0);
      } catch (e2) {
        Util_12.Util.error("Unable to draw hit graph from cached scene canvas. " + e2.message);
      }
      return this;
    }
    hasPointerCapture(pointerId) {
      return PointerEvents$12.hasPointerCapture(pointerId, this);
    }
    setPointerCapture(pointerId) {
      PointerEvents$12.setPointerCapture(pointerId, this);
    }
    releaseCapture(pointerId) {
      PointerEvents$12.releaseCapture(pointerId, this);
    }
  }
  exports.Shape = Shape2;
  Shape2.prototype._fillFunc = _fillFunc2;
  Shape2.prototype._strokeFunc = _strokeFunc2;
  Shape2.prototype._fillFuncHit = _fillFuncHit;
  Shape2.prototype._strokeFuncHit = _strokeFuncHit;
  Shape2.prototype._centroid = false;
  Shape2.prototype.nodeType = "Shape";
  (0, Global_22._registerNode)(Shape2);
  Shape2.prototype.eventListeners = {};
  Shape2.prototype.on.call(Shape2.prototype, "shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", _clearHasShadowCache);
  Shape2.prototype.on.call(Shape2.prototype, "shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", _clearGetShadowRGBACache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva", _clearFillPatternCache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva", _clearLinearGradientCache);
  Shape2.prototype.on.call(Shape2.prototype, "fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva", _clearRadialGradientCache);
  Factory_12.Factory.addGetterSetter(Shape2, "stroke", void 0, (0, Validators_12.getStringOrGradientValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "strokeWidth", 2, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillAfterStrokeEnabled", false);
  Factory_12.Factory.addGetterSetter(Shape2, "hitStrokeWidth", "auto", (0, Validators_12.getNumberOrAutoValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "strokeHitEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "perfectDrawEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowForStrokeEnabled", true, (0, Validators_12.getBooleanValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "lineJoin");
  Factory_12.Factory.addGetterSetter(Shape2, "lineCap");
  Factory_12.Factory.addGetterSetter(Shape2, "sceneFunc");
  Factory_12.Factory.addGetterSetter(Shape2, "hitFunc");
  Factory_12.Factory.addGetterSetter(Shape2, "dash");
  Factory_12.Factory.addGetterSetter(Shape2, "dashOffset", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowColor", void 0, (0, Validators_12.getStringValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowBlur", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOpacity", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "shadowOffset", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOffsetX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "shadowOffsetY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternImage");
  Factory_12.Factory.addGetterSetter(Shape2, "fill", void 0, (0, Validators_12.getStringOrGradientValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartRadius", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndRadius", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientColorStops");
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternRepeat", "repeat");
  Factory_12.Factory.addGetterSetter(Shape2, "fillEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "shadowEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "dashEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeScaleEnabled", true);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPriority", "color");
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillPatternOffset", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternOffsetX", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternOffsetY", 0, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillPatternScale", ["x", "y"]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternScaleX", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternScaleY", 1, (0, Validators_12.getNumberValidator)());
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillLinearGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "strokeLinearGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientStartPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientStartPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillLinearGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "strokeLinearGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillLinearGradientEndPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "strokeLinearGradientEndPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillRadialGradientStartPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientStartPointY", 0);
  Factory_12.Factory.addComponentsGetterSetter(Shape2, "fillRadialGradientEndPoint", [
    "x",
    "y"
  ]);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndPointX", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRadialGradientEndPointY", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillPatternRotation", 0);
  Factory_12.Factory.addGetterSetter(Shape2, "fillRule", void 0, (0, Validators_12.getStringValidator)());
  Factory_12.Factory.backCompat(Shape2, {
    dashArray: "dash",
    getDashArray: "getDash",
    setDashArray: "getDash",
    drawFunc: "sceneFunc",
    getDrawFunc: "getSceneFunc",
    setDrawFunc: "setSceneFunc",
    drawHitFunc: "hitFunc",
    getDrawHitFunc: "getHitFunc",
    setDrawHitFunc: "setHitFunc"
  });
})(Shape);
Object.defineProperty(Layer$1, "__esModule", { value: true });
Layer$1.Layer = void 0;
const Util_1$b = Util;
const Container_1$1 = Container$4;
const Node_1$g = Node$1;
const Factory_1$w = Factory;
const Canvas_1 = Canvas$1;
const Validators_1$v = Validators;
const Shape_1$g = Shape;
const Global_1$k = Global;
var HASH = "#", BEFORE_DRAW = "beforeDraw", DRAW = "draw", INTERSECTION_OFFSETS = [
  { x: 0, y: 0 },
  { x: -1, y: -1 },
  { x: 1, y: -1 },
  { x: 1, y: 1 },
  { x: -1, y: 1 }
], INTERSECTION_OFFSETS_LEN = INTERSECTION_OFFSETS.length;
class Layer2 extends Container_1$1.Container {
  constructor(config) {
    super(config);
    this.canvas = new Canvas_1.SceneCanvas();
    this.hitCanvas = new Canvas_1.HitCanvas({
      pixelRatio: 1
    });
    this._waitingForDraw = false;
    this.on("visibleChange.konva", this._checkVisibility);
    this._checkVisibility();
    this.on("imageSmoothingEnabledChange.konva", this._setSmoothEnabled);
    this._setSmoothEnabled();
  }
  createPNGStream() {
    const c2 = this.canvas._canvas;
    return c2.createPNGStream();
  }
  getCanvas() {
    return this.canvas;
  }
  getNativeCanvasElement() {
    return this.canvas._canvas;
  }
  getHitCanvas() {
    return this.hitCanvas;
  }
  getContext() {
    return this.getCanvas().getContext();
  }
  clear(bounds) {
    this.getContext().clear(bounds);
    this.getHitCanvas().getContext().clear(bounds);
    return this;
  }
  setZIndex(index) {
    super.setZIndex(index);
    var stage = this.getStage();
    if (stage && stage.content) {
      stage.content.removeChild(this.getNativeCanvasElement());
      if (index < stage.children.length - 1) {
        stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[index + 1].getCanvas()._canvas);
      } else {
        stage.content.appendChild(this.getNativeCanvasElement());
      }
    }
    return this;
  }
  moveToTop() {
    Node_1$g.Node.prototype.moveToTop.call(this);
    var stage = this.getStage();
    if (stage && stage.content) {
      stage.content.removeChild(this.getNativeCanvasElement());
      stage.content.appendChild(this.getNativeCanvasElement());
    }
    return true;
  }
  moveUp() {
    var moved = Node_1$g.Node.prototype.moveUp.call(this);
    if (!moved) {
      return false;
    }
    var stage = this.getStage();
    if (!stage || !stage.content) {
      return false;
    }
    stage.content.removeChild(this.getNativeCanvasElement());
    if (this.index < stage.children.length - 1) {
      stage.content.insertBefore(this.getNativeCanvasElement(), stage.children[this.index + 1].getCanvas()._canvas);
    } else {
      stage.content.appendChild(this.getNativeCanvasElement());
    }
    return true;
  }
  moveDown() {
    if (Node_1$g.Node.prototype.moveDown.call(this)) {
      var stage = this.getStage();
      if (stage) {
        var children = stage.children;
        if (stage.content) {
          stage.content.removeChild(this.getNativeCanvasElement());
          stage.content.insertBefore(this.getNativeCanvasElement(), children[this.index + 1].getCanvas()._canvas);
        }
      }
      return true;
    }
    return false;
  }
  moveToBottom() {
    if (Node_1$g.Node.prototype.moveToBottom.call(this)) {
      var stage = this.getStage();
      if (stage) {
        var children = stage.children;
        if (stage.content) {
          stage.content.removeChild(this.getNativeCanvasElement());
          stage.content.insertBefore(this.getNativeCanvasElement(), children[1].getCanvas()._canvas);
        }
      }
      return true;
    }
    return false;
  }
  getLayer() {
    return this;
  }
  remove() {
    var _canvas = this.getNativeCanvasElement();
    Node_1$g.Node.prototype.remove.call(this);
    if (_canvas && _canvas.parentNode && Util_1$b.Util._isInDocument(_canvas)) {
      _canvas.parentNode.removeChild(_canvas);
    }
    return this;
  }
  getStage() {
    return this.parent;
  }
  setSize({ width, height }) {
    this.canvas.setSize(width, height);
    this.hitCanvas.setSize(width, height);
    this._setSmoothEnabled();
    return this;
  }
  _validateAdd(child) {
    var type = child.getType();
    if (type !== "Group" && type !== "Shape") {
      Util_1$b.Util.throw("You may only add groups and shapes to a layer.");
    }
  }
  _toKonvaCanvas(config) {
    config = config || {};
    config.width = config.width || this.getWidth();
    config.height = config.height || this.getHeight();
    config.x = config.x !== void 0 ? config.x : this.x();
    config.y = config.y !== void 0 ? config.y : this.y();
    return Node_1$g.Node.prototype._toKonvaCanvas.call(this, config);
  }
  _checkVisibility() {
    const visible = this.visible();
    if (visible) {
      this.canvas._canvas.style.display = "block";
    } else {
      this.canvas._canvas.style.display = "none";
    }
  }
  _setSmoothEnabled() {
    this.getContext()._context.imageSmoothingEnabled = this.imageSmoothingEnabled();
  }
  getWidth() {
    if (this.parent) {
      return this.parent.width();
    }
  }
  setWidth() {
    Util_1$b.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.');
  }
  getHeight() {
    if (this.parent) {
      return this.parent.height();
    }
  }
  setHeight() {
    Util_1$b.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.');
  }
  batchDraw() {
    if (!this._waitingForDraw) {
      this._waitingForDraw = true;
      Util_1$b.Util.requestAnimFrame(() => {
        this.draw();
        this._waitingForDraw = false;
      });
    }
    return this;
  }
  getIntersection(pos) {
    if (!this.isListening() || !this.isVisible()) {
      return null;
    }
    var spiralSearchDistance = 1;
    var continueSearch = false;
    while (true) {
      for (let i = 0; i < INTERSECTION_OFFSETS_LEN; i++) {
        const intersectionOffset = INTERSECTION_OFFSETS[i];
        const obj = this._getIntersection({
          x: pos.x + intersectionOffset.x * spiralSearchDistance,
          y: pos.y + intersectionOffset.y * spiralSearchDistance
        });
        const shape = obj.shape;
        if (shape) {
          return shape;
        }
        continueSearch = !!obj.antialiased;
        if (!obj.antialiased) {
          break;
        }
      }
      if (continueSearch) {
        spiralSearchDistance += 1;
      } else {
        return null;
      }
    }
  }
  _getIntersection(pos) {
    const ratio = this.hitCanvas.pixelRatio;
    const p2 = this.hitCanvas.context.getImageData(Math.round(pos.x * ratio), Math.round(pos.y * ratio), 1, 1).data;
    const p3 = p2[3];
    if (p3 === 255) {
      const colorKey = Util_1$b.Util._rgbToHex(p2[0], p2[1], p2[2]);
      const shape = Shape_1$g.shapes[HASH + colorKey];
      if (shape) {
        return {
          shape
        };
      }
      return {
        antialiased: true
      };
    } else if (p3 > 0) {
      return {
        antialiased: true
      };
    }
    return {};
  }
  drawScene(can, top2) {
    var layer = this.getLayer(), canvas = can || layer && layer.getCanvas();
    this._fire(BEFORE_DRAW, {
      node: this
    });
    if (this.clearBeforeDraw()) {
      canvas.getContext().clear();
    }
    Container_1$1.Container.prototype.drawScene.call(this, canvas, top2);
    this._fire(DRAW, {
      node: this
    });
    return this;
  }
  drawHit(can, top2) {
    var layer = this.getLayer(), canvas = can || layer && layer.hitCanvas;
    if (layer && layer.clearBeforeDraw()) {
      layer.getHitCanvas().getContext().clear();
    }
    Container_1$1.Container.prototype.drawHit.call(this, canvas, top2);
    return this;
  }
  enableHitGraph() {
    this.hitGraphEnabled(true);
    return this;
  }
  disableHitGraph() {
    this.hitGraphEnabled(false);
    return this;
  }
  setHitGraphEnabled(val) {
    Util_1$b.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead.");
    this.listening(val);
  }
  getHitGraphEnabled(val) {
    Util_1$b.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead.");
    return this.listening();
  }
  toggleHitCanvas() {
    if (!this.parent || !this.parent["content"]) {
      return;
    }
    var parent = this.parent;
    var added = !!this.hitCanvas._canvas.parentNode;
    if (added) {
      parent.content.removeChild(this.hitCanvas._canvas);
    } else {
      parent.content.appendChild(this.hitCanvas._canvas);
    }
  }
  destroy() {
    Util_1$b.Util.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas);
    return super.destroy();
  }
}
Layer$1.Layer = Layer2;
Layer2.prototype.nodeType = "Layer";
(0, Global_1$k._registerNode)(Layer2);
Factory_1$w.Factory.addGetterSetter(Layer2, "imageSmoothingEnabled", true);
Factory_1$w.Factory.addGetterSetter(Layer2, "clearBeforeDraw", true);
Factory_1$w.Factory.addGetterSetter(Layer2, "hitGraphEnabled", true, (0, Validators_1$v.getBooleanValidator)());
var FastLayer$1 = {};
Object.defineProperty(FastLayer$1, "__esModule", { value: true });
FastLayer$1.FastLayer = void 0;
const Util_1$a = Util;
const Layer_1 = Layer$1;
const Global_1$j = Global;
class FastLayer2 extends Layer_1.Layer {
  constructor(attrs) {
    super(attrs);
    this.listening(false);
    Util_1$a.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.');
  }
}
FastLayer$1.FastLayer = FastLayer2;
FastLayer2.prototype.nodeType = "FastLayer";
(0, Global_1$j._registerNode)(FastLayer2);
var Group$1 = {};
Object.defineProperty(Group$1, "__esModule", { value: true });
Group$1.Group = void 0;
const Util_1$9 = Util;
const Container_1 = Container$4;
const Global_1$i = Global;
class Group2 extends Container_1.Container {
  _validateAdd(child) {
    var type = child.getType();
    if (type !== "Group" && type !== "Shape") {
      Util_1$9.Util.throw("You may only add groups and shapes to groups.");
    }
  }
}
Group$1.Group = Group2;
Group2.prototype.nodeType = "Group";
(0, Global_1$i._registerNode)(Group2);
var Animation$1 = {};
Object.defineProperty(Animation$1, "__esModule", { value: true });
Animation$1.Animation = void 0;
const Global_1$h = Global;
const Util_1$8 = Util;
const now = function() {
  if (Global_1$h.glob.performance && Global_1$h.glob.performance.now) {
    return function() {
      return Global_1$h.glob.performance.now();
    };
  }
  return function() {
    return (/* @__PURE__ */ new Date()).getTime();
  };
}();
class Animation2 {
  constructor(func, layers) {
    this.id = Animation2.animIdCounter++;
    this.frame = {
      time: 0,
      timeDiff: 0,
      lastTime: now(),
      frameRate: 0
    };
    this.func = func;
    this.setLayers(layers);
  }
  setLayers(layers) {
    let lays = [];
    if (layers) {
      lays = Array.isArray(layers) ? layers : [layers];
    }
    this.layers = lays;
    return this;
  }
  getLayers() {
    return this.layers;
  }
  addLayer(layer) {
    const layers = this.layers;
    const len = layers.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (layers[n2]._id === layer._id) {
        return false;
      }
    }
    this.layers.push(layer);
    return true;
  }
  isRunning() {
    const a = Animation2;
    const animations = a.animations;
    const len = animations.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (animations[n2].id === this.id) {
        return true;
      }
    }
    return false;
  }
  start() {
    this.stop();
    this.frame.timeDiff = 0;
    this.frame.lastTime = now();
    Animation2._addAnimation(this);
    return this;
  }
  stop() {
    Animation2._removeAnimation(this);
    return this;
  }
  _updateFrameObject(time) {
    this.frame.timeDiff = time - this.frame.lastTime;
    this.frame.lastTime = time;
    this.frame.time += this.frame.timeDiff;
    this.frame.frameRate = 1e3 / this.frame.timeDiff;
  }
  static _addAnimation(anim) {
    this.animations.push(anim);
    this._handleAnimation();
  }
  static _removeAnimation(anim) {
    const id2 = anim.id;
    const animations = this.animations;
    const len = animations.length;
    for (let n2 = 0; n2 < len; n2++) {
      if (animations[n2].id === id2) {
        this.animations.splice(n2, 1);
        break;
      }
    }
  }
  static _runFrames() {
    const layerHash = {};
    const animations = this.animations;
    for (let n2 = 0; n2 < animations.length; n2++) {
      const anim = animations[n2];
      const layers = anim.layers;
      const func = anim.func;
      anim._updateFrameObject(now());
      const layersLen = layers.length;
      let needRedraw;
      if (func) {
        needRedraw = func.call(anim, anim.frame) !== false;
      } else {
        needRedraw = true;
      }
      if (!needRedraw) {
        continue;
      }
      for (let i = 0; i < layersLen; i++) {
        const layer = layers[i];
        if (layer._id !== void 0) {
          layerHash[layer._id] = layer;
        }
      }
    }
    for (let key in layerHash) {
      if (!layerHash.hasOwnProperty(key)) {
        continue;
      }
      layerHash[key].batchDraw();
    }
  }
  static _animationLoop() {
    const Anim = Animation2;
    if (Anim.animations.length) {
      Anim._runFrames();
      Util_1$8.Util.requestAnimFrame(Anim._animationLoop);
    } else {
      Anim.animRunning = false;
    }
  }
  static _handleAnimation() {
    if (!this.animRunning) {
      this.animRunning = true;
      Util_1$8.Util.requestAnimFrame(this._animationLoop);
    }
  }
}
Animation$1.Animation = Animation2;
Animation2.animations = [];
Animation2.animIdCounter = 0;
Animation2.animRunning = false;
var Tween = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Easings = exports.Tween = void 0;
  const Util_12 = Util;
  const Animation_12 = Animation$1;
  const Node_12 = Node$1;
  const Global_12 = Global;
  var blacklist = {
    node: 1,
    duration: 1,
    easing: 1,
    onFinish: 1,
    yoyo: 1
  }, PAUSED = 1, PLAYING = 2, REVERSING = 3, idCounter2 = 0, colorAttrs = ["fill", "stroke", "shadowColor"];
  class TweenEngine {
    constructor(prop, propFunc, func, begin, finish, duration, yoyo) {
      this.prop = prop;
      this.propFunc = propFunc;
      this.begin = begin;
      this._pos = begin;
      this.duration = duration;
      this._change = 0;
      this.prevPos = 0;
      this.yoyo = yoyo;
      this._time = 0;
      this._position = 0;
      this._startTime = 0;
      this._finish = 0;
      this.func = func;
      this._change = finish - this.begin;
      this.pause();
    }
    fire(str) {
      var handler = this[str];
      if (handler) {
        handler();
      }
    }
    setTime(t2) {
      if (t2 > this.duration) {
        if (this.yoyo) {
          this._time = this.duration;
          this.reverse();
        } else {
          this.finish();
        }
      } else if (t2 < 0) {
        if (this.yoyo) {
          this._time = 0;
          this.play();
        } else {
          this.reset();
        }
      } else {
        this._time = t2;
        this.update();
      }
    }
    getTime() {
      return this._time;
    }
    setPosition(p2) {
      this.prevPos = this._pos;
      this.propFunc(p2);
      this._pos = p2;
    }
    getPosition(t2) {
      if (t2 === void 0) {
        t2 = this._time;
      }
      return this.func(t2, this.begin, this._change, this.duration);
    }
    play() {
      this.state = PLAYING;
      this._startTime = this.getTimer() - this._time;
      this.onEnterFrame();
      this.fire("onPlay");
    }
    reverse() {
      this.state = REVERSING;
      this._time = this.duration - this._time;
      this._startTime = this.getTimer() - this._time;
      this.onEnterFrame();
      this.fire("onReverse");
    }
    seek(t2) {
      this.pause();
      this._time = t2;
      this.update();
      this.fire("onSeek");
    }
    reset() {
      this.pause();
      this._time = 0;
      this.update();
      this.fire("onReset");
    }
    finish() {
      this.pause();
      this._time = this.duration;
      this.update();
      this.fire("onFinish");
    }
    update() {
      this.setPosition(this.getPosition(this._time));
      this.fire("onUpdate");
    }
    onEnterFrame() {
      var t2 = this.getTimer() - this._startTime;
      if (this.state === PLAYING) {
        this.setTime(t2);
      } else if (this.state === REVERSING) {
        this.setTime(this.duration - t2);
      }
    }
    pause() {
      this.state = PAUSED;
      this.fire("onPause");
    }
    getTimer() {
      return (/* @__PURE__ */ new Date()).getTime();
    }
  }
  class Tween2 {
    constructor(config) {
      var that = this, node = config.node, nodeId = node._id, duration, easing = config.easing || exports.Easings.Linear, yoyo = !!config.yoyo, key;
      if (typeof config.duration === "undefined") {
        duration = 0.3;
      } else if (config.duration === 0) {
        duration = 1e-3;
      } else {
        duration = config.duration;
      }
      this.node = node;
      this._id = idCounter2++;
      var layers = node.getLayer() || (node instanceof Global_12.Konva["Stage"] ? node.getLayers() : null);
      if (!layers) {
        Util_12.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first.");
      }
      this.anim = new Animation_12.Animation(function() {
        that.tween.onEnterFrame();
      }, layers);
      this.tween = new TweenEngine(key, function(i) {
        that._tweenFunc(i);
      }, easing, 0, 1, duration * 1e3, yoyo);
      this._addListeners();
      if (!Tween2.attrs[nodeId]) {
        Tween2.attrs[nodeId] = {};
      }
      if (!Tween2.attrs[nodeId][this._id]) {
        Tween2.attrs[nodeId][this._id] = {};
      }
      if (!Tween2.tweens[nodeId]) {
        Tween2.tweens[nodeId] = {};
      }
      for (key in config) {
        if (blacklist[key] === void 0) {
          this._addAttr(key, config[key]);
        }
      }
      this.reset();
      this.onFinish = config.onFinish;
      this.onReset = config.onReset;
      this.onUpdate = config.onUpdate;
    }
    _addAttr(key, end2) {
      var node = this.node, nodeId = node._id, start2, diff, tweenId, n2, len, trueEnd, trueStart, endRGBA;
      tweenId = Tween2.tweens[nodeId][key];
      if (tweenId) {
        delete Tween2.attrs[nodeId][tweenId][key];
      }
      start2 = node.getAttr(key);
      if (Util_12.Util._isArray(end2)) {
        diff = [];
        len = Math.max(end2.length, start2.length);
        if (key === "points" && end2.length !== start2.length) {
          if (end2.length > start2.length) {
            trueStart = start2;
            start2 = Util_12.Util._prepareArrayForTween(start2, end2, node.closed());
          } else {
            trueEnd = end2;
            end2 = Util_12.Util._prepareArrayForTween(end2, start2, node.closed());
          }
        }
        if (key.indexOf("fill") === 0) {
          for (n2 = 0; n2 < len; n2++) {
            if (n2 % 2 === 0) {
              diff.push(end2[n2] - start2[n2]);
            } else {
              var startRGBA = Util_12.Util.colorToRGBA(start2[n2]);
              endRGBA = Util_12.Util.colorToRGBA(end2[n2]);
              start2[n2] = startRGBA;
              diff.push({
                r: endRGBA.r - startRGBA.r,
                g: endRGBA.g - startRGBA.g,
                b: endRGBA.b - startRGBA.b,
                a: endRGBA.a - startRGBA.a
              });
            }
          }
        } else {
          for (n2 = 0; n2 < len; n2++) {
            diff.push(end2[n2] - start2[n2]);
          }
        }
      } else if (colorAttrs.indexOf(key) !== -1) {
        start2 = Util_12.Util.colorToRGBA(start2);
        endRGBA = Util_12.Util.colorToRGBA(end2);
        diff = {
          r: endRGBA.r - start2.r,
          g: endRGBA.g - start2.g,
          b: endRGBA.b - start2.b,
          a: endRGBA.a - start2.a
        };
      } else {
        diff = end2 - start2;
      }
      Tween2.attrs[nodeId][this._id][key] = {
        start: start2,
        diff,
        end: end2,
        trueEnd,
        trueStart
      };
      Tween2.tweens[nodeId][key] = this._id;
    }
    _tweenFunc(i) {
      var node = this.node, attrs = Tween2.attrs[node._id][this._id], key, attr, start2, diff, newVal, n2, len, end2;
      for (key in attrs) {
        attr = attrs[key];
        start2 = attr.start;
        diff = attr.diff;
        end2 = attr.end;
        if (Util_12.Util._isArray(start2)) {
          newVal = [];
          len = Math.max(start2.length, end2.length);
          if (key.indexOf("fill") === 0) {
            for (n2 = 0; n2 < len; n2++) {
              if (n2 % 2 === 0) {
                newVal.push((start2[n2] || 0) + diff[n2] * i);
              } else {
                newVal.push("rgba(" + Math.round(start2[n2].r + diff[n2].r * i) + "," + Math.round(start2[n2].g + diff[n2].g * i) + "," + Math.round(start2[n2].b + diff[n2].b * i) + "," + (start2[n2].a + diff[n2].a * i) + ")");
              }
            }
          } else {
            for (n2 = 0; n2 < len; n2++) {
              newVal.push((start2[n2] || 0) + diff[n2] * i);
            }
          }
        } else if (colorAttrs.indexOf(key) !== -1) {
          newVal = "rgba(" + Math.round(start2.r + diff.r * i) + "," + Math.round(start2.g + diff.g * i) + "," + Math.round(start2.b + diff.b * i) + "," + (start2.a + diff.a * i) + ")";
        } else {
          newVal = start2 + diff * i;
        }
        node.setAttr(key, newVal);
      }
    }
    _addListeners() {
      this.tween.onPlay = () => {
        this.anim.start();
      };
      this.tween.onReverse = () => {
        this.anim.start();
      };
      this.tween.onPause = () => {
        this.anim.stop();
      };
      this.tween.onFinish = () => {
        var node = this.node;
        var attrs = Tween2.attrs[node._id][this._id];
        if (attrs.points && attrs.points.trueEnd) {
          node.setAttr("points", attrs.points.trueEnd);
        }
        if (this.onFinish) {
          this.onFinish.call(this);
        }
      };
      this.tween.onReset = () => {
        var node = this.node;
        var attrs = Tween2.attrs[node._id][this._id];
        if (attrs.points && attrs.points.trueStart) {
          node.points(attrs.points.trueStart);
        }
        if (this.onReset) {
          this.onReset();
        }
      };
      this.tween.onUpdate = () => {
        if (this.onUpdate) {
          this.onUpdate.call(this);
        }
      };
    }
    play() {
      this.tween.play();
      return this;
    }
    reverse() {
      this.tween.reverse();
      return this;
    }
    reset() {
      this.tween.reset();
      return this;
    }
    seek(t2) {
      this.tween.seek(t2 * 1e3);
      return this;
    }
    pause() {
      this.tween.pause();
      return this;
    }
    finish() {
      this.tween.finish();
      return this;
    }
    destroy() {
      var nodeId = this.node._id, thisId = this._id, attrs = Tween2.tweens[nodeId], key;
      this.pause();
      for (key in attrs) {
        delete Tween2.tweens[nodeId][key];
      }
      delete Tween2.attrs[nodeId][thisId];
    }
  }
  exports.Tween = Tween2;
  Tween2.attrs = {};
  Tween2.tweens = {};
  Node_12.Node.prototype.to = function(params) {
    var onFinish = params.onFinish;
    params.node = this;
    params.onFinish = function() {
      this.destroy();
      if (onFinish) {
        onFinish();
      }
    };
    var tween = new Tween2(params);
    tween.play();
  };
  exports.Easings = {
    BackEaseIn(t2, b2, c2, d2) {
      var s = 1.70158;
      return c2 * (t2 /= d2) * t2 * ((s + 1) * t2 - s) + b2;
    },
    BackEaseOut(t2, b2, c2, d2) {
      var s = 1.70158;
      return c2 * ((t2 = t2 / d2 - 1) * t2 * ((s + 1) * t2 + s) + 1) + b2;
    },
    BackEaseInOut(t2, b2, c2, d2) {
      var s = 1.70158;
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * (t2 * t2 * (((s *= 1.525) + 1) * t2 - s)) + b2;
      }
      return c2 / 2 * ((t2 -= 2) * t2 * (((s *= 1.525) + 1) * t2 + s) + 2) + b2;
    },
    ElasticEaseIn(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2) === 1) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * 0.3;
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      return -(a * Math.pow(2, 10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2)) + b2;
    },
    ElasticEaseOut(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2) === 1) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * 0.3;
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      return a * Math.pow(2, -10 * t2) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2) + c2 + b2;
    },
    ElasticEaseInOut(t2, b2, c2, d2, a, p2) {
      var s = 0;
      if (t2 === 0) {
        return b2;
      }
      if ((t2 /= d2 / 2) === 2) {
        return b2 + c2;
      }
      if (!p2) {
        p2 = d2 * (0.3 * 1.5);
      }
      if (!a || a < Math.abs(c2)) {
        a = c2;
        s = p2 / 4;
      } else {
        s = p2 / (2 * Math.PI) * Math.asin(c2 / a);
      }
      if (t2 < 1) {
        return -0.5 * (a * Math.pow(2, 10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2)) + b2;
      }
      return a * Math.pow(2, -10 * (t2 -= 1)) * Math.sin((t2 * d2 - s) * (2 * Math.PI) / p2) * 0.5 + c2 + b2;
    },
    BounceEaseOut(t2, b2, c2, d2) {
      if ((t2 /= d2) < 1 / 2.75) {
        return c2 * (7.5625 * t2 * t2) + b2;
      } else if (t2 < 2 / 2.75) {
        return c2 * (7.5625 * (t2 -= 1.5 / 2.75) * t2 + 0.75) + b2;
      } else if (t2 < 2.5 / 2.75) {
        return c2 * (7.5625 * (t2 -= 2.25 / 2.75) * t2 + 0.9375) + b2;
      } else {
        return c2 * (7.5625 * (t2 -= 2.625 / 2.75) * t2 + 0.984375) + b2;
      }
    },
    BounceEaseIn(t2, b2, c2, d2) {
      return c2 - exports.Easings.BounceEaseOut(d2 - t2, 0, c2, d2) + b2;
    },
    BounceEaseInOut(t2, b2, c2, d2) {
      if (t2 < d2 / 2) {
        return exports.Easings.BounceEaseIn(t2 * 2, 0, c2, d2) * 0.5 + b2;
      } else {
        return exports.Easings.BounceEaseOut(t2 * 2 - d2, 0, c2, d2) * 0.5 + c2 * 0.5 + b2;
      }
    },
    EaseIn(t2, b2, c2, d2) {
      return c2 * (t2 /= d2) * t2 + b2;
    },
    EaseOut(t2, b2, c2, d2) {
      return -c2 * (t2 /= d2) * (t2 - 2) + b2;
    },
    EaseInOut(t2, b2, c2, d2) {
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * t2 * t2 + b2;
      }
      return -c2 / 2 * (--t2 * (t2 - 2) - 1) + b2;
    },
    StrongEaseIn(t2, b2, c2, d2) {
      return c2 * (t2 /= d2) * t2 * t2 * t2 * t2 + b2;
    },
    StrongEaseOut(t2, b2, c2, d2) {
      return c2 * ((t2 = t2 / d2 - 1) * t2 * t2 * t2 * t2 + 1) + b2;
    },
    StrongEaseInOut(t2, b2, c2, d2) {
      if ((t2 /= d2 / 2) < 1) {
        return c2 / 2 * t2 * t2 * t2 * t2 * t2 + b2;
      }
      return c2 / 2 * ((t2 -= 2) * t2 * t2 * t2 * t2 + 2) + b2;
    },
    Linear(t2, b2, c2, d2) {
      return c2 * t2 / d2 + b2;
    }
  };
})(Tween);
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.Konva = void 0;
  const Global_12 = Global;
  const Util_12 = Util;
  const Node_12 = Node$1;
  const Container_12 = Container$4;
  const Stage_1 = Stage;
  const Layer_12 = Layer$1;
  const FastLayer_1 = FastLayer$1;
  const Group_12 = Group$1;
  const DragAndDrop_12 = DragAndDrop;
  const Shape_12 = Shape;
  const Animation_12 = Animation$1;
  const Tween_1 = Tween;
  const Context_12 = Context$1;
  const Canvas_12 = Canvas$1;
  exports.Konva = Util_12.Util._assign(Global_12.Konva, {
    Util: Util_12.Util,
    Transform: Util_12.Transform,
    Node: Node_12.Node,
    Container: Container_12.Container,
    Stage: Stage_1.Stage,
    stages: Stage_1.stages,
    Layer: Layer_12.Layer,
    FastLayer: FastLayer_1.FastLayer,
    Group: Group_12.Group,
    DD: DragAndDrop_12.DD,
    Shape: Shape_12.Shape,
    shapes: Shape_12.shapes,
    Animation: Animation_12.Animation,
    Tween: Tween_1.Tween,
    Easings: Tween_1.Easings,
    Context: Context_12.Context,
    Canvas: Canvas_12.Canvas
  });
  exports.default = exports.Konva;
})(_CoreInternals);
var Arc$1 = {};
Object.defineProperty(Arc$1, "__esModule", { value: true });
Arc$1.Arc = void 0;
const Factory_1$v = Factory;
const Shape_1$f = Shape;
const Global_1$g = Global;
const Validators_1$u = Validators;
const Global_2$2 = Global;
class Arc2 extends Shape_1$f.Shape {
  _sceneFunc(context) {
    var angle = Global_1$g.Konva.getAngle(this.angle()), clockwise = this.clockwise();
    context.beginPath();
    context.arc(0, 0, this.outerRadius(), 0, angle, clockwise);
    context.arc(0, 0, this.innerRadius(), angle, 0, !clockwise);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
  getSelfRect() {
    const innerRadius = this.innerRadius();
    const outerRadius = this.outerRadius();
    const clockwise = this.clockwise();
    const angle = Global_1$g.Konva.getAngle(clockwise ? 360 - this.angle() : this.angle());
    const boundLeftRatio = Math.cos(Math.min(angle, Math.PI));
    const boundRightRatio = 1;
    const boundTopRatio = Math.sin(Math.min(Math.max(Math.PI, angle), 3 * Math.PI / 2));
    const boundBottomRatio = Math.sin(Math.min(angle, Math.PI / 2));
    const boundLeft = boundLeftRatio * (boundLeftRatio > 0 ? innerRadius : outerRadius);
    const boundRight = boundRightRatio * outerRadius;
    const boundTop = boundTopRatio * (boundTopRatio > 0 ? innerRadius : outerRadius);
    const boundBottom = boundBottomRatio * (boundBottomRatio > 0 ? outerRadius : innerRadius);
    return {
      x: boundLeft,
      y: clockwise ? -1 * boundBottom : boundTop,
      width: boundRight - boundLeft,
      height: boundBottom - boundTop
    };
  }
}
Arc$1.Arc = Arc2;
Arc2.prototype._centroid = true;
Arc2.prototype.className = "Arc";
Arc2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_2$2._registerNode)(Arc2);
Factory_1$v.Factory.addGetterSetter(Arc2, "innerRadius", 0, (0, Validators_1$u.getNumberValidator)());
Factory_1$v.Factory.addGetterSetter(Arc2, "outerRadius", 0, (0, Validators_1$u.getNumberValidator)());
Factory_1$v.Factory.addGetterSetter(Arc2, "angle", 0, (0, Validators_1$u.getNumberValidator)());
Factory_1$v.Factory.addGetterSetter(Arc2, "clockwise", false, (0, Validators_1$u.getBooleanValidator)());
var Arrow$3 = {};
var Line$2 = {};
Object.defineProperty(Line$2, "__esModule", { value: true });
Line$2.Line = void 0;
const Factory_1$u = Factory;
const Shape_1$e = Shape;
const Validators_1$t = Validators;
const Global_1$f = Global;
function getControlPoints(x0, y0, x1, y1, x2, y2, t2) {
  var d01 = Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2)), d12 = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)), fa2 = t2 * d01 / (d01 + d12), fb2 = t2 * d12 / (d01 + d12), p1x = x1 - fa2 * (x2 - x0), p1y = y1 - fa2 * (y2 - y0), p2x = x1 + fb2 * (x2 - x0), p2y = y1 + fb2 * (y2 - y0);
  return [p1x, p1y, p2x, p2y];
}
function expandPoints(p2, tension) {
  var len = p2.length, allPoints = [], n2, cp;
  for (n2 = 2; n2 < len - 2; n2 += 2) {
    cp = getControlPoints(p2[n2 - 2], p2[n2 - 1], p2[n2], p2[n2 + 1], p2[n2 + 2], p2[n2 + 3], tension);
    if (isNaN(cp[0])) {
      continue;
    }
    allPoints.push(cp[0]);
    allPoints.push(cp[1]);
    allPoints.push(p2[n2]);
    allPoints.push(p2[n2 + 1]);
    allPoints.push(cp[2]);
    allPoints.push(cp[3]);
  }
  return allPoints;
}
let Line$1 = class Line2 extends Shape_1$e.Shape {
  constructor(config) {
    super(config);
    this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva", function() {
      this._clearCache("tensionPoints");
    });
  }
  _sceneFunc(context) {
    var points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), bezier = this.bezier(), tp, len, n2;
    if (!length) {
      return;
    }
    context.beginPath();
    context.moveTo(points[0], points[1]);
    if (tension !== 0 && length > 4) {
      tp = this.getTensionPoints();
      len = tp.length;
      n2 = closed ? 0 : 4;
      if (!closed) {
        context.quadraticCurveTo(tp[0], tp[1], tp[2], tp[3]);
      }
      while (n2 < len - 2) {
        context.bezierCurveTo(tp[n2++], tp[n2++], tp[n2++], tp[n2++], tp[n2++], tp[n2++]);
      }
      if (!closed) {
        context.quadraticCurveTo(tp[len - 2], tp[len - 1], points[length - 2], points[length - 1]);
      }
    } else if (bezier) {
      n2 = 2;
      while (n2 < length) {
        context.bezierCurveTo(points[n2++], points[n2++], points[n2++], points[n2++], points[n2++], points[n2++]);
      }
    } else {
      for (n2 = 2; n2 < length; n2 += 2) {
        context.lineTo(points[n2], points[n2 + 1]);
      }
    }
    if (closed) {
      context.closePath();
      context.fillStrokeShape(this);
    } else {
      context.strokeShape(this);
    }
  }
  getTensionPoints() {
    return this._getCache("tensionPoints", this._getTensionPoints);
  }
  _getTensionPoints() {
    if (this.closed()) {
      return this._getTensionPointsClosed();
    } else {
      return expandPoints(this.points(), this.tension());
    }
  }
  _getTensionPointsClosed() {
    var p2 = this.points(), len = p2.length, tension = this.tension(), firstControlPoints = getControlPoints(p2[len - 2], p2[len - 1], p2[0], p2[1], p2[2], p2[3], tension), lastControlPoints = getControlPoints(p2[len - 4], p2[len - 3], p2[len - 2], p2[len - 1], p2[0], p2[1], tension), middle = expandPoints(p2, tension), tp = [firstControlPoints[2], firstControlPoints[3]].concat(middle).concat([
      lastControlPoints[0],
      lastControlPoints[1],
      p2[len - 2],
      p2[len - 1],
      lastControlPoints[2],
      lastControlPoints[3],
      firstControlPoints[0],
      firstControlPoints[1],
      p2[0],
      p2[1]
    ]);
    return tp;
  }
  getWidth() {
    return this.getSelfRect().width;
  }
  getHeight() {
    return this.getSelfRect().height;
  }
  getSelfRect() {
    var points = this.points();
    if (points.length < 4) {
      return {
        x: points[0] || 0,
        y: points[1] || 0,
        width: 0,
        height: 0
      };
    }
    if (this.tension() !== 0) {
      points = [
        points[0],
        points[1],
        ...this._getTensionPoints(),
        points[points.length - 2],
        points[points.length - 1]
      ];
    } else {
      points = this.points();
    }
    var minX = points[0];
    var maxX = points[0];
    var minY = points[1];
    var maxY = points[1];
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      minX = Math.min(minX, x2);
      maxX = Math.max(maxX, x2);
      minY = Math.min(minY, y2);
      maxY = Math.max(maxY, y2);
    }
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
};
Line$2.Line = Line$1;
Line$1.prototype.className = "Line";
Line$1.prototype._attrsAffectingSize = ["points", "bezier", "tension"];
(0, Global_1$f._registerNode)(Line$1);
Factory_1$u.Factory.addGetterSetter(Line$1, "closed", false);
Factory_1$u.Factory.addGetterSetter(Line$1, "bezier", false);
Factory_1$u.Factory.addGetterSetter(Line$1, "tension", 0, (0, Validators_1$t.getNumberValidator)());
Factory_1$u.Factory.addGetterSetter(Line$1, "points", [], (0, Validators_1$t.getNumberArrayValidator)());
var Path$1 = {};
var BezierFunctions = {};
(function(exports) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.t2length = exports.getQuadraticArcLength = exports.getCubicArcLength = exports.binomialCoefficients = exports.cValues = exports.tValues = void 0;
  exports.tValues = [
    [],
    [],
    [
      -0.5773502691896257,
      0.5773502691896257
    ],
    [
      0,
      -0.7745966692414834,
      0.7745966692414834
    ],
    [
      -0.33998104358485626,
      0.33998104358485626,
      -0.8611363115940526,
      0.8611363115940526
    ],
    [
      0,
      -0.5384693101056831,
      0.5384693101056831,
      -0.906179845938664,
      0.906179845938664
    ],
    [
      0.6612093864662645,
      -0.6612093864662645,
      -0.2386191860831969,
      0.2386191860831969,
      -0.932469514203152,
      0.932469514203152
    ],
    [
      0,
      0.4058451513773972,
      -0.4058451513773972,
      -0.7415311855993945,
      0.7415311855993945,
      -0.9491079123427585,
      0.9491079123427585
    ],
    [
      -0.1834346424956498,
      0.1834346424956498,
      -0.525532409916329,
      0.525532409916329,
      -0.7966664774136267,
      0.7966664774136267,
      -0.9602898564975363,
      0.9602898564975363
    ],
    [
      0,
      -0.8360311073266358,
      0.8360311073266358,
      -0.9681602395076261,
      0.9681602395076261,
      -0.3242534234038089,
      0.3242534234038089,
      -0.6133714327005904,
      0.6133714327005904
    ],
    [
      -0.14887433898163122,
      0.14887433898163122,
      -0.4333953941292472,
      0.4333953941292472,
      -0.6794095682990244,
      0.6794095682990244,
      -0.8650633666889845,
      0.8650633666889845,
      -0.9739065285171717,
      0.9739065285171717
    ],
    [
      0,
      -0.26954315595234496,
      0.26954315595234496,
      -0.5190961292068118,
      0.5190961292068118,
      -0.7301520055740494,
      0.7301520055740494,
      -0.8870625997680953,
      0.8870625997680953,
      -0.978228658146057,
      0.978228658146057
    ],
    [
      -0.1252334085114689,
      0.1252334085114689,
      -0.3678314989981802,
      0.3678314989981802,
      -0.5873179542866175,
      0.5873179542866175,
      -0.7699026741943047,
      0.7699026741943047,
      -0.9041172563704749,
      0.9041172563704749,
      -0.9815606342467192,
      0.9815606342467192
    ],
    [
      0,
      -0.2304583159551348,
      0.2304583159551348,
      -0.44849275103644687,
      0.44849275103644687,
      -0.6423493394403402,
      0.6423493394403402,
      -0.8015780907333099,
      0.8015780907333099,
      -0.9175983992229779,
      0.9175983992229779,
      -0.9841830547185881,
      0.9841830547185881
    ],
    [
      -0.10805494870734367,
      0.10805494870734367,
      -0.31911236892788974,
      0.31911236892788974,
      -0.5152486363581541,
      0.5152486363581541,
      -0.6872929048116855,
      0.6872929048116855,
      -0.827201315069765,
      0.827201315069765,
      -0.9284348836635735,
      0.9284348836635735,
      -0.9862838086968123,
      0.9862838086968123
    ],
    [
      0,
      -0.20119409399743451,
      0.20119409399743451,
      -0.3941513470775634,
      0.3941513470775634,
      -0.5709721726085388,
      0.5709721726085388,
      -0.7244177313601701,
      0.7244177313601701,
      -0.8482065834104272,
      0.8482065834104272,
      -0.937273392400706,
      0.937273392400706,
      -0.9879925180204854,
      0.9879925180204854
    ],
    [
      -0.09501250983763744,
      0.09501250983763744,
      -0.2816035507792589,
      0.2816035507792589,
      -0.45801677765722737,
      0.45801677765722737,
      -0.6178762444026438,
      0.6178762444026438,
      -0.755404408355003,
      0.755404408355003,
      -0.8656312023878318,
      0.8656312023878318,
      -0.9445750230732326,
      0.9445750230732326,
      -0.9894009349916499,
      0.9894009349916499
    ],
    [
      0,
      -0.17848418149584785,
      0.17848418149584785,
      -0.3512317634538763,
      0.3512317634538763,
      -0.5126905370864769,
      0.5126905370864769,
      -0.6576711592166907,
      0.6576711592166907,
      -0.7815140038968014,
      0.7815140038968014,
      -0.8802391537269859,
      0.8802391537269859,
      -0.9506755217687678,
      0.9506755217687678,
      -0.9905754753144174,
      0.9905754753144174
    ],
    [
      -0.0847750130417353,
      0.0847750130417353,
      -0.2518862256915055,
      0.2518862256915055,
      -0.41175116146284263,
      0.41175116146284263,
      -0.5597708310739475,
      0.5597708310739475,
      -0.6916870430603532,
      0.6916870430603532,
      -0.8037049589725231,
      0.8037049589725231,
      -0.8926024664975557,
      0.8926024664975557,
      -0.9558239495713977,
      0.9558239495713977,
      -0.9915651684209309,
      0.9915651684209309
    ],
    [
      0,
      -0.16035864564022537,
      0.16035864564022537,
      -0.31656409996362983,
      0.31656409996362983,
      -0.46457074137596094,
      0.46457074137596094,
      -0.600545304661681,
      0.600545304661681,
      -0.7209661773352294,
      0.7209661773352294,
      -0.8227146565371428,
      0.8227146565371428,
      -0.9031559036148179,
      0.9031559036148179,
      -0.96020815213483,
      0.96020815213483,
      -0.9924068438435844,
      0.9924068438435844
    ],
    [
      -0.07652652113349734,
      0.07652652113349734,
      -0.22778585114164507,
      0.22778585114164507,
      -0.37370608871541955,
      0.37370608871541955,
      -0.5108670019508271,
      0.5108670019508271,
      -0.636053680726515,
      0.636053680726515,
      -0.7463319064601508,
      0.7463319064601508,
      -0.8391169718222188,
      0.8391169718222188,
      -0.912234428251326,
      0.912234428251326,
      -0.9639719272779138,
      0.9639719272779138,
      -0.9931285991850949,
      0.9931285991850949
    ],
    [
      0,
      -0.1455618541608951,
      0.1455618541608951,
      -0.2880213168024011,
      0.2880213168024011,
      -0.4243421202074388,
      0.4243421202074388,
      -0.5516188358872198,
      0.5516188358872198,
      -0.6671388041974123,
      0.6671388041974123,
      -0.7684399634756779,
      0.7684399634756779,
      -0.8533633645833173,
      0.8533633645833173,
      -0.9200993341504008,
      0.9200993341504008,
      -0.9672268385663063,
      0.9672268385663063,
      -0.9937521706203895,
      0.9937521706203895
    ],
    [
      -0.06973927331972223,
      0.06973927331972223,
      -0.20786042668822127,
      0.20786042668822127,
      -0.34193582089208424,
      0.34193582089208424,
      -0.469355837986757,
      0.469355837986757,
      -0.5876404035069116,
      0.5876404035069116,
      -0.6944872631866827,
      0.6944872631866827,
      -0.7878168059792081,
      0.7878168059792081,
      -0.8658125777203002,
      0.8658125777203002,
      -0.926956772187174,
      0.926956772187174,
      -0.9700604978354287,
      0.9700604978354287,
      -0.9942945854823992,
      0.9942945854823992
    ],
    [
      0,
      -0.1332568242984661,
      0.1332568242984661,
      -0.26413568097034495,
      0.26413568097034495,
      -0.3903010380302908,
      0.3903010380302908,
      -0.5095014778460075,
      0.5095014778460075,
      -0.6196098757636461,
      0.6196098757636461,
      -0.7186613631319502,
      0.7186613631319502,
      -0.8048884016188399,
      0.8048884016188399,
      -0.8767523582704416,
      0.8767523582704416,
      -0.9329710868260161,
      0.9329710868260161,
      -0.9725424712181152,
      0.9725424712181152,
      -0.9947693349975522,
      0.9947693349975522
    ],
    [
      -0.06405689286260563,
      0.06405689286260563,
      -0.1911188674736163,
      0.1911188674736163,
      -0.3150426796961634,
      0.3150426796961634,
      -0.4337935076260451,
      0.4337935076260451,
      -0.5454214713888396,
      0.5454214713888396,
      -0.6480936519369755,
      0.6480936519369755,
      -0.7401241915785544,
      0.7401241915785544,
      -0.820001985973903,
      0.820001985973903,
      -0.8864155270044011,
      0.8864155270044011,
      -0.9382745520027328,
      0.9382745520027328,
      -0.9747285559713095,
      0.9747285559713095,
      -0.9951872199970213,
      0.9951872199970213
    ]
  ];
  exports.cValues = [
    [],
    [],
    [1, 1],
    [
      0.8888888888888888,
      0.5555555555555556,
      0.5555555555555556
    ],
    [
      0.6521451548625461,
      0.6521451548625461,
      0.34785484513745385,
      0.34785484513745385
    ],
    [
      0.5688888888888889,
      0.47862867049936647,
      0.47862867049936647,
      0.23692688505618908,
      0.23692688505618908
    ],
    [
      0.3607615730481386,
      0.3607615730481386,
      0.46791393457269104,
      0.46791393457269104,
      0.17132449237917036,
      0.17132449237917036
    ],
    [
      0.4179591836734694,
      0.3818300505051189,
      0.3818300505051189,
      0.27970539148927664,
      0.27970539148927664,
      0.1294849661688697,
      0.1294849661688697
    ],
    [
      0.362683783378362,
      0.362683783378362,
      0.31370664587788727,
      0.31370664587788727,
      0.22238103445337448,
      0.22238103445337448,
      0.10122853629037626,
      0.10122853629037626
    ],
    [
      0.3302393550012598,
      0.1806481606948574,
      0.1806481606948574,
      0.08127438836157441,
      0.08127438836157441,
      0.31234707704000286,
      0.31234707704000286,
      0.26061069640293544,
      0.26061069640293544
    ],
    [
      0.29552422471475287,
      0.29552422471475287,
      0.26926671930999635,
      0.26926671930999635,
      0.21908636251598204,
      0.21908636251598204,
      0.1494513491505806,
      0.1494513491505806,
      0.06667134430868814,
      0.06667134430868814
    ],
    [
      0.2729250867779006,
      0.26280454451024665,
      0.26280454451024665,
      0.23319376459199048,
      0.23319376459199048,
      0.18629021092773426,
      0.18629021092773426,
      0.1255803694649046,
      0.1255803694649046,
      0.05566856711617366,
      0.05566856711617366
    ],
    [
      0.24914704581340277,
      0.24914704581340277,
      0.2334925365383548,
      0.2334925365383548,
      0.20316742672306592,
      0.20316742672306592,
      0.16007832854334622,
      0.16007832854334622,
      0.10693932599531843,
      0.10693932599531843,
      0.04717533638651183,
      0.04717533638651183
    ],
    [
      0.2325515532308739,
      0.22628318026289723,
      0.22628318026289723,
      0.2078160475368885,
      0.2078160475368885,
      0.17814598076194574,
      0.17814598076194574,
      0.13887351021978725,
      0.13887351021978725,
      0.09212149983772845,
      0.09212149983772845,
      0.04048400476531588,
      0.04048400476531588
    ],
    [
      0.2152638534631578,
      0.2152638534631578,
      0.2051984637212956,
      0.2051984637212956,
      0.18553839747793782,
      0.18553839747793782,
      0.15720316715819355,
      0.15720316715819355,
      0.12151857068790319,
      0.12151857068790319,
      0.08015808715976021,
      0.08015808715976021,
      0.03511946033175186,
      0.03511946033175186
    ],
    [
      0.2025782419255613,
      0.19843148532711158,
      0.19843148532711158,
      0.1861610000155622,
      0.1861610000155622,
      0.16626920581699392,
      0.16626920581699392,
      0.13957067792615432,
      0.13957067792615432,
      0.10715922046717194,
      0.10715922046717194,
      0.07036604748810812,
      0.07036604748810812,
      0.03075324199611727,
      0.03075324199611727
    ],
    [
      0.1894506104550685,
      0.1894506104550685,
      0.18260341504492358,
      0.18260341504492358,
      0.16915651939500254,
      0.16915651939500254,
      0.14959598881657674,
      0.14959598881657674,
      0.12462897125553388,
      0.12462897125553388,
      0.09515851168249279,
      0.09515851168249279,
      0.062253523938647894,
      0.062253523938647894,
      0.027152459411754096,
      0.027152459411754096
    ],
    [
      0.17944647035620653,
      0.17656270536699264,
      0.17656270536699264,
      0.16800410215645004,
      0.16800410215645004,
      0.15404576107681028,
      0.15404576107681028,
      0.13513636846852548,
      0.13513636846852548,
      0.11188384719340397,
      0.11188384719340397,
      0.08503614831717918,
      0.08503614831717918,
      0.0554595293739872,
      0.0554595293739872,
      0.02414830286854793,
      0.02414830286854793
    ],
    [
      0.1691423829631436,
      0.1691423829631436,
      0.16427648374583273,
      0.16427648374583273,
      0.15468467512626524,
      0.15468467512626524,
      0.14064291467065065,
      0.14064291467065065,
      0.12255520671147846,
      0.12255520671147846,
      0.10094204410628717,
      0.10094204410628717,
      0.07642573025488905,
      0.07642573025488905,
      0.0497145488949698,
      0.0497145488949698,
      0.02161601352648331,
      0.02161601352648331
    ],
    [
      0.1610544498487837,
      0.15896884339395434,
      0.15896884339395434,
      0.15276604206585967,
      0.15276604206585967,
      0.1426067021736066,
      0.1426067021736066,
      0.12875396253933621,
      0.12875396253933621,
      0.11156664554733399,
      0.11156664554733399,
      0.09149002162245,
      0.09149002162245,
      0.06904454273764123,
      0.06904454273764123,
      0.0448142267656996,
      0.0448142267656996,
      0.019461788229726478,
      0.019461788229726478
    ],
    [
      0.15275338713072584,
      0.15275338713072584,
      0.14917298647260374,
      0.14917298647260374,
      0.14209610931838204,
      0.14209610931838204,
      0.13168863844917664,
      0.13168863844917664,
      0.11819453196151841,
      0.11819453196151841,
      0.10193011981724044,
      0.10193011981724044,
      0.08327674157670475,
      0.08327674157670475,
      0.06267204833410907,
      0.06267204833410907,
      0.04060142980038694,
      0.04060142980038694,
      0.017614007139152118,
      0.017614007139152118
    ],
    [
      0.14608113364969041,
      0.14452440398997005,
      0.14452440398997005,
      0.13988739479107315,
      0.13988739479107315,
      0.13226893863333747,
      0.13226893863333747,
      0.12183141605372853,
      0.12183141605372853,
      0.10879729916714838,
      0.10879729916714838,
      0.09344442345603386,
      0.09344442345603386,
      0.0761001136283793,
      0.0761001136283793,
      0.057134425426857205,
      0.057134425426857205,
      0.036953789770852494,
      0.036953789770852494,
      0.016017228257774335,
      0.016017228257774335
    ],
    [
      0.13925187285563198,
      0.13925187285563198,
      0.13654149834601517,
      0.13654149834601517,
      0.13117350478706238,
      0.13117350478706238,
      0.12325237681051242,
      0.12325237681051242,
      0.11293229608053922,
      0.11293229608053922,
      0.10041414444288096,
      0.10041414444288096,
      0.08594160621706773,
      0.08594160621706773,
      0.06979646842452049,
      0.06979646842452049,
      0.052293335152683286,
      0.052293335152683286,
      0.03377490158481415,
      0.03377490158481415,
      0.0146279952982722,
      0.0146279952982722
    ],
    [
      0.13365457218610619,
      0.1324620394046966,
      0.1324620394046966,
      0.12890572218808216,
      0.12890572218808216,
      0.12304908430672953,
      0.12304908430672953,
      0.11499664022241136,
      0.11499664022241136,
      0.10489209146454141,
      0.10489209146454141,
      0.09291576606003515,
      0.09291576606003515,
      0.07928141177671895,
      0.07928141177671895,
      0.06423242140852585,
      0.06423242140852585,
      0.04803767173108467,
      0.04803767173108467,
      0.030988005856979445,
      0.030988005856979445,
      0.013411859487141771,
      0.013411859487141771
    ],
    [
      0.12793819534675216,
      0.12793819534675216,
      0.1258374563468283,
      0.1258374563468283,
      0.12167047292780339,
      0.12167047292780339,
      0.1155056680537256,
      0.1155056680537256,
      0.10744427011596563,
      0.10744427011596563,
      0.09761865210411388,
      0.09761865210411388,
      0.08619016153195327,
      0.08619016153195327,
      0.0733464814110803,
      0.0733464814110803,
      0.05929858491543678,
      0.05929858491543678,
      0.04427743881741981,
      0.04427743881741981,
      0.028531388628933663,
      0.028531388628933663,
      0.0123412297999872,
      0.0123412297999872
    ]
  ];
  exports.binomialCoefficients = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
  const getCubicArcLength = (xs, ys, t2) => {
    let z2;
    let sum;
    let correctedT;
    const n2 = 20;
    z2 = t2 / 2;
    sum = 0;
    for (let i = 0; i < n2; i++) {
      correctedT = z2 * exports.tValues[n2][i] + z2;
      sum += exports.cValues[n2][i] * BFunc(xs, ys, correctedT);
    }
    return z2 * sum;
  };
  exports.getCubicArcLength = getCubicArcLength;
  const getQuadraticArcLength = (xs, ys, t2) => {
    if (t2 === void 0) {
      t2 = 1;
    }
    const ax = xs[0] - 2 * xs[1] + xs[2];
    const ay = ys[0] - 2 * ys[1] + ys[2];
    const bx = 2 * xs[1] - 2 * xs[0];
    const by = 2 * ys[1] - 2 * ys[0];
    const A2 = 4 * (ax * ax + ay * ay);
    const B2 = 4 * (ax * bx + ay * by);
    const C2 = bx * bx + by * by;
    if (A2 === 0) {
      return t2 * Math.sqrt(Math.pow(xs[2] - xs[0], 2) + Math.pow(ys[2] - ys[0], 2));
    }
    const b2 = B2 / (2 * A2);
    const c2 = C2 / A2;
    const u2 = t2 + b2;
    const k2 = c2 - b2 * b2;
    const uuk = u2 * u2 + k2 > 0 ? Math.sqrt(u2 * u2 + k2) : 0;
    const bbk = b2 * b2 + k2 > 0 ? Math.sqrt(b2 * b2 + k2) : 0;
    const term = b2 + Math.sqrt(b2 * b2 + k2) !== 0 ? k2 * Math.log(Math.abs((u2 + uuk) / (b2 + bbk))) : 0;
    return Math.sqrt(A2) / 2 * (u2 * uuk - b2 * bbk + term);
  };
  exports.getQuadraticArcLength = getQuadraticArcLength;
  function BFunc(xs, ys, t2) {
    const xbase = getDerivative(1, t2, xs);
    const ybase = getDerivative(1, t2, ys);
    const combined = xbase * xbase + ybase * ybase;
    return Math.sqrt(combined);
  }
  const getDerivative = (derivative, t2, vs) => {
    const n2 = vs.length - 1;
    let _vs;
    let value;
    if (n2 === 0) {
      return 0;
    }
    if (derivative === 0) {
      value = 0;
      for (let k2 = 0; k2 <= n2; k2++) {
        value += exports.binomialCoefficients[n2][k2] * Math.pow(1 - t2, n2 - k2) * Math.pow(t2, k2) * vs[k2];
      }
      return value;
    } else {
      _vs = new Array(n2);
      for (let k2 = 0; k2 < n2; k2++) {
        _vs[k2] = n2 * (vs[k2 + 1] - vs[k2]);
      }
      return getDerivative(derivative - 1, t2, _vs);
    }
  };
  const t2length = (length, totalLength, func) => {
    let error2 = 1;
    let t2 = length / totalLength;
    let step = (length - func(t2)) / totalLength;
    let numIterations = 0;
    while (error2 > 1e-3) {
      const increasedTLength = func(t2 + step);
      const increasedTError = Math.abs(length - increasedTLength) / totalLength;
      if (increasedTError < error2) {
        error2 = increasedTError;
        t2 += step;
      } else {
        const decreasedTLength = func(t2 - step);
        const decreasedTError = Math.abs(length - decreasedTLength) / totalLength;
        if (decreasedTError < error2) {
          error2 = decreasedTError;
          t2 -= step;
        } else {
          step /= 2;
        }
      }
      numIterations++;
      if (numIterations > 500) {
        break;
      }
    }
    return t2;
  };
  exports.t2length = t2length;
})(BezierFunctions);
Object.defineProperty(Path$1, "__esModule", { value: true });
Path$1.Path = void 0;
const Factory_1$t = Factory;
const Shape_1$d = Shape;
const Global_1$e = Global;
const BezierFunctions_1 = BezierFunctions;
class Path2 extends Shape_1$d.Shape {
  constructor(config) {
    super(config);
    this.dataArray = [];
    this.pathLength = 0;
    this._readDataAttribute();
    this.on("dataChange.konva", function() {
      this._readDataAttribute();
    });
  }
  _readDataAttribute() {
    this.dataArray = Path2.parsePathData(this.data());
    this.pathLength = Path2.getPathLength(this.dataArray);
  }
  _sceneFunc(context) {
    var ca2 = this.dataArray;
    context.beginPath();
    var isClosed = false;
    for (var n2 = 0; n2 < ca2.length; n2++) {
      var c2 = ca2[n2].command;
      var p2 = ca2[n2].points;
      switch (c2) {
        case "L":
          context.lineTo(p2[0], p2[1]);
          break;
        case "M":
          context.moveTo(p2[0], p2[1]);
          break;
        case "C":
          context.bezierCurveTo(p2[0], p2[1], p2[2], p2[3], p2[4], p2[5]);
          break;
        case "Q":
          context.quadraticCurveTo(p2[0], p2[1], p2[2], p2[3]);
          break;
        case "A":
          var cx = p2[0], cy = p2[1], rx = p2[2], ry = p2[3], theta = p2[4], dTheta = p2[5], psi = p2[6], fs = p2[7];
          var r2 = rx > ry ? rx : ry;
          var scaleX = rx > ry ? 1 : rx / ry;
          var scaleY = rx > ry ? ry / rx : 1;
          context.translate(cx, cy);
          context.rotate(psi);
          context.scale(scaleX, scaleY);
          context.arc(0, 0, r2, theta, theta + dTheta, 1 - fs);
          context.scale(1 / scaleX, 1 / scaleY);
          context.rotate(-psi);
          context.translate(-cx, -cy);
          break;
        case "z":
          isClosed = true;
          context.closePath();
          break;
      }
    }
    if (!isClosed && !this.hasFill()) {
      context.strokeShape(this);
    } else {
      context.fillStrokeShape(this);
    }
  }
  getSelfRect() {
    var points = [];
    this.dataArray.forEach(function(data) {
      if (data.command === "A") {
        var start2 = data.points[4];
        var dTheta = data.points[5];
        var end2 = data.points[4] + dTheta;
        var inc = Math.PI / 180;
        if (Math.abs(start2 - end2) < inc) {
          inc = Math.abs(start2 - end2);
        }
        if (dTheta < 0) {
          for (let t2 = start2 - inc; t2 > end2; t2 -= inc) {
            const point = Path2.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t2, 0);
            points.push(point.x, point.y);
          }
        } else {
          for (let t2 = start2 + inc; t2 < end2; t2 += inc) {
            const point = Path2.getPointOnEllipticalArc(data.points[0], data.points[1], data.points[2], data.points[3], t2, 0);
            points.push(point.x, point.y);
          }
        }
      } else if (data.command === "C") {
        for (let t2 = 0; t2 <= 1; t2 += 0.01) {
          const point = Path2.getPointOnCubicBezier(t2, data.start.x, data.start.y, data.points[0], data.points[1], data.points[2], data.points[3], data.points[4], data.points[5]);
          points.push(point.x, point.y);
        }
      } else {
        points = points.concat(data.points);
      }
    });
    var minX = points[0];
    var maxX = points[0];
    var minY = points[1];
    var maxY = points[1];
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      if (!isNaN(x2)) {
        minX = Math.min(minX, x2);
        maxX = Math.max(maxX, x2);
      }
      if (!isNaN(y2)) {
        minY = Math.min(minY, y2);
        maxY = Math.max(maxY, y2);
      }
    }
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  getLength() {
    return this.pathLength;
  }
  getPointAtLength(length) {
    return Path2.getPointAtLengthOfDataArray(length, this.dataArray);
  }
  static getLineLength(x1, y1, x2, y2) {
    return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  }
  static getPathLength(dataArray) {
    let pathLength = 0;
    for (var i = 0; i < dataArray.length; ++i) {
      pathLength += dataArray[i].pathLength;
    }
    return pathLength;
  }
  static getPointAtLengthOfDataArray(length, dataArray) {
    var point, i = 0, ii2 = dataArray.length;
    if (!ii2) {
      return null;
    }
    while (i < ii2 && length > dataArray[i].pathLength) {
      length -= dataArray[i].pathLength;
      ++i;
    }
    if (i === ii2) {
      point = dataArray[i - 1].points.slice(-2);
      return {
        x: point[0],
        y: point[1]
      };
    }
    if (length < 0.01) {
      point = dataArray[i].points.slice(0, 2);
      return {
        x: point[0],
        y: point[1]
      };
    }
    var cp = dataArray[i];
    var p2 = cp.points;
    switch (cp.command) {
      case "L":
        return Path2.getPointOnLine(length, cp.start.x, cp.start.y, p2[0], p2[1]);
      case "C":
        return Path2.getPointOnCubicBezier((0, BezierFunctions_1.t2length)(length, Path2.getPathLength(dataArray), (i2) => {
          return (0, BezierFunctions_1.getCubicArcLength)([cp.start.x, p2[0], p2[2], p2[4]], [cp.start.y, p2[1], p2[3], p2[5]], i2);
        }), cp.start.x, cp.start.y, p2[0], p2[1], p2[2], p2[3], p2[4], p2[5]);
      case "Q":
        return Path2.getPointOnQuadraticBezier((0, BezierFunctions_1.t2length)(length, Path2.getPathLength(dataArray), (i2) => {
          return (0, BezierFunctions_1.getQuadraticArcLength)([cp.start.x, p2[0], p2[2]], [cp.start.y, p2[1], p2[3]], i2);
        }), cp.start.x, cp.start.y, p2[0], p2[1], p2[2], p2[3]);
      case "A":
        var cx = p2[0], cy = p2[1], rx = p2[2], ry = p2[3], theta = p2[4], dTheta = p2[5], psi = p2[6];
        theta += dTheta * length / cp.pathLength;
        return Path2.getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi);
    }
    return null;
  }
  static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX, fromY) {
    if (fromX === void 0) {
      fromX = P1x;
    }
    if (fromY === void 0) {
      fromY = P1y;
    }
    var m2 = (P2y - P1y) / (P2x - P1x + 1e-8);
    var run = Math.sqrt(dist * dist / (1 + m2 * m2));
    if (P2x < P1x) {
      run *= -1;
    }
    var rise = m2 * run;
    var pt;
    if (P2x === P1x) {
      pt = {
        x: fromX,
        y: fromY + rise
      };
    } else if ((fromY - P1y) / (fromX - P1x + 1e-8) === m2) {
      pt = {
        x: fromX + run,
        y: fromY + rise
      };
    } else {
      var ix, iy;
      var len = this.getLineLength(P1x, P1y, P2x, P2y);
      var u2 = (fromX - P1x) * (P2x - P1x) + (fromY - P1y) * (P2y - P1y);
      u2 = u2 / (len * len);
      ix = P1x + u2 * (P2x - P1x);
      iy = P1y + u2 * (P2y - P1y);
      var pRise = this.getLineLength(fromX, fromY, ix, iy);
      var pRun = Math.sqrt(dist * dist - pRise * pRise);
      run = Math.sqrt(pRun * pRun / (1 + m2 * m2));
      if (P2x < P1x) {
        run *= -1;
      }
      rise = m2 * run;
      pt = {
        x: ix + run,
        y: iy + rise
      };
    }
    return pt;
  }
  static getPointOnCubicBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y, P4x, P4y) {
    function CB1(t2) {
      return t2 * t2 * t2;
    }
    function CB2(t2) {
      return 3 * t2 * t2 * (1 - t2);
    }
    function CB3(t2) {
      return 3 * t2 * (1 - t2) * (1 - t2);
    }
    function CB4(t2) {
      return (1 - t2) * (1 - t2) * (1 - t2);
    }
    var x2 = P4x * CB1(pct) + P3x * CB2(pct) + P2x * CB3(pct) + P1x * CB4(pct);
    var y2 = P4y * CB1(pct) + P3y * CB2(pct) + P2y * CB3(pct) + P1y * CB4(pct);
    return {
      x: x2,
      y: y2
    };
  }
  static getPointOnQuadraticBezier(pct, P1x, P1y, P2x, P2y, P3x, P3y) {
    function QB1(t2) {
      return t2 * t2;
    }
    function QB2(t2) {
      return 2 * t2 * (1 - t2);
    }
    function QB3(t2) {
      return (1 - t2) * (1 - t2);
    }
    var x2 = P3x * QB1(pct) + P2x * QB2(pct) + P1x * QB3(pct);
    var y2 = P3y * QB1(pct) + P2y * QB2(pct) + P1y * QB3(pct);
    return {
      x: x2,
      y: y2
    };
  }
  static getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
    var cosPsi = Math.cos(psi), sinPsi = Math.sin(psi);
    var pt = {
      x: rx * Math.cos(theta),
      y: ry * Math.sin(theta)
    };
    return {
      x: cx + (pt.x * cosPsi - pt.y * sinPsi),
      y: cy + (pt.x * sinPsi + pt.y * cosPsi)
    };
  }
  static parsePathData(data) {
    if (!data) {
      return [];
    }
    var cs = data;
    var cc2 = [
      "m",
      "M",
      "l",
      "L",
      "v",
      "V",
      "h",
      "H",
      "z",
      "Z",
      "c",
      "C",
      "q",
      "Q",
      "t",
      "T",
      "s",
      "S",
      "a",
      "A"
    ];
    cs = cs.replace(new RegExp(" ", "g"), ",");
    for (var n2 = 0; n2 < cc2.length; n2++) {
      cs = cs.replace(new RegExp(cc2[n2], "g"), "|" + cc2[n2]);
    }
    var arr = cs.split("|");
    var ca2 = [];
    var coords = [];
    var cpx = 0;
    var cpy = 0;
    var re2 = /([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;
    var match;
    for (n2 = 1; n2 < arr.length; n2++) {
      var str = arr[n2];
      var c2 = str.charAt(0);
      str = str.slice(1);
      coords.length = 0;
      while (match = re2.exec(str)) {
        coords.push(match[0]);
      }
      var p2 = [];
      for (var j2 = 0, jlen = coords.length; j2 < jlen; j2++) {
        if (coords[j2] === "00") {
          p2.push(0, 0);
          continue;
        }
        var parsed = parseFloat(coords[j2]);
        if (!isNaN(parsed)) {
          p2.push(parsed);
        } else {
          p2.push(0);
        }
      }
      while (p2.length > 0) {
        if (isNaN(p2[0])) {
          break;
        }
        var cmd = "";
        var points = [];
        var startX = cpx, startY = cpy;
        var prevCmd, ctlPtx, ctlPty;
        var rx, ry, psi, fa2, fs, x1, y1;
        switch (c2) {
          case "l":
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "L":
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "m":
            var dx = p2.shift();
            var dy = p2.shift();
            cpx += dx;
            cpy += dy;
            cmd = "M";
            if (ca2.length > 2 && ca2[ca2.length - 1].command === "z") {
              for (var idx = ca2.length - 2; idx >= 0; idx--) {
                if (ca2[idx].command === "M") {
                  cpx = ca2[idx].points[0] + dx;
                  cpy = ca2[idx].points[1] + dy;
                  break;
                }
              }
            }
            points.push(cpx, cpy);
            c2 = "l";
            break;
          case "M":
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "M";
            points.push(cpx, cpy);
            c2 = "L";
            break;
          case "h":
            cpx += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "H":
            cpx = p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "v":
            cpy += p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "V":
            cpy = p2.shift();
            cmd = "L";
            points.push(cpx, cpy);
            break;
          case "C":
            points.push(p2.shift(), p2.shift(), p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "c":
            points.push(cpx + p2.shift(), cpy + p2.shift(), cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "S":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "C") {
              ctlPtx = cpx + (cpx - prevCmd.points[2]);
              ctlPty = cpy + (cpy - prevCmd.points[3]);
            }
            points.push(ctlPtx, ctlPty, p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "s":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "C") {
              ctlPtx = cpx + (cpx - prevCmd.points[2]);
              ctlPty = cpy + (cpy - prevCmd.points[3]);
            }
            points.push(ctlPtx, ctlPty, cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "C";
            points.push(cpx, cpy);
            break;
          case "Q":
            points.push(p2.shift(), p2.shift());
            cpx = p2.shift();
            cpy = p2.shift();
            points.push(cpx, cpy);
            break;
          case "q":
            points.push(cpx + p2.shift(), cpy + p2.shift());
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "Q";
            points.push(cpx, cpy);
            break;
          case "T":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "Q") {
              ctlPtx = cpx + (cpx - prevCmd.points[0]);
              ctlPty = cpy + (cpy - prevCmd.points[1]);
            }
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "Q";
            points.push(ctlPtx, ctlPty, cpx, cpy);
            break;
          case "t":
            ctlPtx = cpx;
            ctlPty = cpy;
            prevCmd = ca2[ca2.length - 1];
            if (prevCmd.command === "Q") {
              ctlPtx = cpx + (cpx - prevCmd.points[0]);
              ctlPty = cpy + (cpy - prevCmd.points[1]);
            }
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "Q";
            points.push(ctlPtx, ctlPty, cpx, cpy);
            break;
          case "A":
            rx = p2.shift();
            ry = p2.shift();
            psi = p2.shift();
            fa2 = p2.shift();
            fs = p2.shift();
            x1 = cpx;
            y1 = cpy;
            cpx = p2.shift();
            cpy = p2.shift();
            cmd = "A";
            points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa2, fs, rx, ry, psi);
            break;
          case "a":
            rx = p2.shift();
            ry = p2.shift();
            psi = p2.shift();
            fa2 = p2.shift();
            fs = p2.shift();
            x1 = cpx;
            y1 = cpy;
            cpx += p2.shift();
            cpy += p2.shift();
            cmd = "A";
            points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa2, fs, rx, ry, psi);
            break;
        }
        ca2.push({
          command: cmd || c2,
          points,
          start: {
            x: startX,
            y: startY
          },
          pathLength: this.calcLength(startX, startY, cmd || c2, points)
        });
      }
      if (c2 === "z" || c2 === "Z") {
        ca2.push({
          command: "z",
          points: [],
          start: void 0,
          pathLength: 0
        });
      }
    }
    return ca2;
  }
  static calcLength(x2, y2, cmd, points) {
    var len, p1, p2, t2;
    var path = Path2;
    switch (cmd) {
      case "L":
        return path.getLineLength(x2, y2, points[0], points[1]);
      case "C":
        return (0, BezierFunctions_1.getCubicArcLength)([x2, points[0], points[2], points[4]], [y2, points[1], points[3], points[5]], 1);
      case "Q":
        return (0, BezierFunctions_1.getQuadraticArcLength)([x2, points[0], points[2]], [y2, points[1], points[3]], 1);
      case "A":
        len = 0;
        var start2 = points[4];
        var dTheta = points[5];
        var end2 = points[4] + dTheta;
        var inc = Math.PI / 180;
        if (Math.abs(start2 - end2) < inc) {
          inc = Math.abs(start2 - end2);
        }
        p1 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start2, 0);
        if (dTheta < 0) {
          for (t2 = start2 - inc; t2 > end2; t2 -= inc) {
            p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t2, 0);
            len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
            p1 = p2;
          }
        } else {
          for (t2 = start2 + inc; t2 < end2; t2 += inc) {
            p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t2, 0);
            len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
            p1 = p2;
          }
        }
        p2 = path.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end2, 0);
        len += path.getLineLength(p1.x, p1.y, p2.x, p2.y);
        return len;
    }
    return 0;
  }
  static convertEndpointToCenterParameterization(x1, y1, x2, y2, fa2, fs, rx, ry, psiDeg) {
    var psi = psiDeg * (Math.PI / 180);
    var xp = Math.cos(psi) * (x1 - x2) / 2 + Math.sin(psi) * (y1 - y2) / 2;
    var yp = -1 * Math.sin(psi) * (x1 - x2) / 2 + Math.cos(psi) * (y1 - y2) / 2;
    var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
    if (lambda > 1) {
      rx *= Math.sqrt(lambda);
      ry *= Math.sqrt(lambda);
    }
    var f2 = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp)));
    if (fa2 === fs) {
      f2 *= -1;
    }
    if (isNaN(f2)) {
      f2 = 0;
    }
    var cxp = f2 * rx * yp / ry;
    var cyp = f2 * -ry * xp / rx;
    var cx = (x1 + x2) / 2 + Math.cos(psi) * cxp - Math.sin(psi) * cyp;
    var cy = (y1 + y2) / 2 + Math.sin(psi) * cxp + Math.cos(psi) * cyp;
    var vMag = function(v3) {
      return Math.sqrt(v3[0] * v3[0] + v3[1] * v3[1]);
    };
    var vRatio = function(u3, v3) {
      return (u3[0] * v3[0] + u3[1] * v3[1]) / (vMag(u3) * vMag(v3));
    };
    var vAngle = function(u3, v3) {
      return (u3[0] * v3[1] < u3[1] * v3[0] ? -1 : 1) * Math.acos(vRatio(u3, v3));
    };
    var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);
    var u2 = [(xp - cxp) / rx, (yp - cyp) / ry];
    var v2 = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];
    var dTheta = vAngle(u2, v2);
    if (vRatio(u2, v2) <= -1) {
      dTheta = Math.PI;
    }
    if (vRatio(u2, v2) >= 1) {
      dTheta = 0;
    }
    if (fs === 0 && dTheta > 0) {
      dTheta = dTheta - 2 * Math.PI;
    }
    if (fs === 1 && dTheta < 0) {
      dTheta = dTheta + 2 * Math.PI;
    }
    return [cx, cy, rx, ry, theta, dTheta, psi, fs];
  }
}
Path$1.Path = Path2;
Path2.prototype.className = "Path";
Path2.prototype._attrsAffectingSize = ["data"];
(0, Global_1$e._registerNode)(Path2);
Factory_1$t.Factory.addGetterSetter(Path2, "data");
Object.defineProperty(Arrow$3, "__esModule", { value: true });
Arrow$3.Arrow = void 0;
const Factory_1$s = Factory;
const Line_1$1 = Line$2;
const Validators_1$s = Validators;
const Global_1$d = Global;
const Path_1$2 = Path$1;
let Arrow$2 = class Arrow2 extends Line_1$1.Line {
  _sceneFunc(ctx) {
    super._sceneFunc(ctx);
    var PI2 = Math.PI * 2;
    var points = this.points();
    var tp = points;
    var fromTension = this.tension() !== 0 && points.length > 4;
    if (fromTension) {
      tp = this.getTensionPoints();
    }
    var length = this.pointerLength();
    var n2 = points.length;
    var dx, dy;
    if (fromTension) {
      const lp = [
        tp[tp.length - 4],
        tp[tp.length - 3],
        tp[tp.length - 2],
        tp[tp.length - 1],
        points[n2 - 2],
        points[n2 - 1]
      ];
      const lastLength = Path_1$2.Path.calcLength(tp[tp.length - 4], tp[tp.length - 3], "C", lp);
      const previous = Path_1$2.Path.getPointOnQuadraticBezier(Math.min(1, 1 - length / lastLength), lp[0], lp[1], lp[2], lp[3], lp[4], lp[5]);
      dx = points[n2 - 2] - previous.x;
      dy = points[n2 - 1] - previous.y;
    } else {
      dx = points[n2 - 2] - points[n2 - 4];
      dy = points[n2 - 1] - points[n2 - 3];
    }
    var radians = (Math.atan2(dy, dx) + PI2) % PI2;
    var width = this.pointerWidth();
    if (this.pointerAtEnding()) {
      ctx.save();
      ctx.beginPath();
      ctx.translate(points[n2 - 2], points[n2 - 1]);
      ctx.rotate(radians);
      ctx.moveTo(0, 0);
      ctx.lineTo(-length, width / 2);
      ctx.lineTo(-length, -width / 2);
      ctx.closePath();
      ctx.restore();
      this.__fillStroke(ctx);
    }
    if (this.pointerAtBeginning()) {
      ctx.save();
      ctx.beginPath();
      ctx.translate(points[0], points[1]);
      if (fromTension) {
        dx = (tp[0] + tp[2]) / 2 - points[0];
        dy = (tp[1] + tp[3]) / 2 - points[1];
      } else {
        dx = points[2] - points[0];
        dy = points[3] - points[1];
      }
      ctx.rotate((Math.atan2(-dy, -dx) + PI2) % PI2);
      ctx.moveTo(0, 0);
      ctx.lineTo(-length, width / 2);
      ctx.lineTo(-length, -width / 2);
      ctx.closePath();
      ctx.restore();
      this.__fillStroke(ctx);
    }
  }
  __fillStroke(ctx) {
    var isDashEnabled = this.dashEnabled();
    if (isDashEnabled) {
      this.attrs.dashEnabled = false;
      ctx.setLineDash([]);
    }
    ctx.fillStrokeShape(this);
    if (isDashEnabled) {
      this.attrs.dashEnabled = true;
    }
  }
  getSelfRect() {
    const lineRect = super.getSelfRect();
    const offset5 = this.pointerWidth() / 2;
    return {
      x: lineRect.x - offset5,
      y: lineRect.y - offset5,
      width: lineRect.width + offset5 * 2,
      height: lineRect.height + offset5 * 2
    };
  }
};
Arrow$3.Arrow = Arrow$2;
Arrow$2.prototype.className = "Arrow";
(0, Global_1$d._registerNode)(Arrow$2);
Factory_1$s.Factory.addGetterSetter(Arrow$2, "pointerLength", 10, (0, Validators_1$s.getNumberValidator)());
Factory_1$s.Factory.addGetterSetter(Arrow$2, "pointerWidth", 10, (0, Validators_1$s.getNumberValidator)());
Factory_1$s.Factory.addGetterSetter(Arrow$2, "pointerAtBeginning", false);
Factory_1$s.Factory.addGetterSetter(Arrow$2, "pointerAtEnding", true);
var Circle$1 = {};
Object.defineProperty(Circle$1, "__esModule", { value: true });
Circle$1.Circle = void 0;
const Factory_1$r = Factory;
const Shape_1$c = Shape;
const Validators_1$r = Validators;
const Global_1$c = Global;
class Circle2 extends Shape_1$c.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, false);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    if (this.radius() !== width / 2) {
      this.radius(width / 2);
    }
  }
  setHeight(height) {
    if (this.radius() !== height / 2) {
      this.radius(height / 2);
    }
  }
}
Circle$1.Circle = Circle2;
Circle2.prototype._centroid = true;
Circle2.prototype.className = "Circle";
Circle2.prototype._attrsAffectingSize = ["radius"];
(0, Global_1$c._registerNode)(Circle2);
Factory_1$r.Factory.addGetterSetter(Circle2, "radius", 0, (0, Validators_1$r.getNumberValidator)());
var Ellipse$2 = {};
Object.defineProperty(Ellipse$2, "__esModule", { value: true });
Ellipse$2.Ellipse = void 0;
const Factory_1$q = Factory;
const Shape_1$b = Shape;
const Validators_1$q = Validators;
const Global_1$b = Global;
let Ellipse$1 = class Ellipse2 extends Shape_1$b.Shape {
  _sceneFunc(context) {
    var rx = this.radiusX(), ry = this.radiusY();
    context.beginPath();
    context.save();
    if (rx !== ry) {
      context.scale(1, ry / rx);
    }
    context.arc(0, 0, rx, 0, Math.PI * 2, false);
    context.restore();
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radiusX() * 2;
  }
  getHeight() {
    return this.radiusY() * 2;
  }
  setWidth(width) {
    this.radiusX(width / 2);
  }
  setHeight(height) {
    this.radiusY(height / 2);
  }
};
Ellipse$2.Ellipse = Ellipse$1;
Ellipse$1.prototype.className = "Ellipse";
Ellipse$1.prototype._centroid = true;
Ellipse$1.prototype._attrsAffectingSize = ["radiusX", "radiusY"];
(0, Global_1$b._registerNode)(Ellipse$1);
Factory_1$q.Factory.addComponentsGetterSetter(Ellipse$1, "radius", ["x", "y"]);
Factory_1$q.Factory.addGetterSetter(Ellipse$1, "radiusX", 0, (0, Validators_1$q.getNumberValidator)());
Factory_1$q.Factory.addGetterSetter(Ellipse$1, "radiusY", 0, (0, Validators_1$q.getNumberValidator)());
var Image$2 = {};
Object.defineProperty(Image$2, "__esModule", { value: true });
Image$2.Image = void 0;
const Util_1$7 = Util;
const Factory_1$p = Factory;
const Shape_1$a = Shape;
const Global_1$a = Global;
const Validators_1$p = Validators;
let Image$1 = class Image3 extends Shape_1$a.Shape {
  constructor(attrs) {
    super(attrs);
    this.on("imageChange.konva", () => {
      this._setImageLoad();
    });
    this._setImageLoad();
  }
  _setImageLoad() {
    const image = this.image();
    if (image && image.complete) {
      return;
    }
    if (image && image.readyState === 4) {
      return;
    }
    if (image && image["addEventListener"]) {
      image["addEventListener"]("load", () => {
        this._requestDraw();
      });
    }
  }
  _useBufferCanvas() {
    return super._useBufferCanvas(true);
  }
  _sceneFunc(context) {
    const width = this.getWidth();
    const height = this.getHeight();
    const cornerRadius = this.cornerRadius();
    const image = this.attrs.image;
    let params;
    if (image) {
      const cropWidth = this.attrs.cropWidth;
      const cropHeight = this.attrs.cropHeight;
      if (cropWidth && cropHeight) {
        params = [
          image,
          this.cropX(),
          this.cropY(),
          cropWidth,
          cropHeight,
          0,
          0,
          width,
          height
        ];
      } else {
        params = [image, 0, 0, width, height];
      }
    }
    if (this.hasFill() || this.hasStroke() || cornerRadius) {
      context.beginPath();
      cornerRadius ? Util_1$7.Util.drawRoundedRectPath(context, width, height, cornerRadius) : context.rect(0, 0, width, height);
      context.closePath();
      context.fillStrokeShape(this);
    }
    if (image) {
      if (cornerRadius) {
        context.clip();
      }
      context.drawImage.apply(context, params);
    }
  }
  _hitFunc(context) {
    var width = this.width(), height = this.height(), cornerRadius = this.cornerRadius();
    context.beginPath();
    if (!cornerRadius) {
      context.rect(0, 0, width, height);
    } else {
      Util_1$7.Util.drawRoundedRectPath(context, width, height, cornerRadius);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    var _a2, _b2;
    return (_a2 = this.attrs.width) !== null && _a2 !== void 0 ? _a2 : (_b2 = this.image()) === null || _b2 === void 0 ? void 0 : _b2.width;
  }
  getHeight() {
    var _a2, _b2;
    return (_a2 = this.attrs.height) !== null && _a2 !== void 0 ? _a2 : (_b2 = this.image()) === null || _b2 === void 0 ? void 0 : _b2.height;
  }
  static fromURL(url, callback, onError = null) {
    var img = Util_1$7.Util.createImageElement();
    img.onload = function() {
      var image = new Image3({
        image: img
      });
      callback(image);
    };
    img.onerror = onError;
    img.crossOrigin = "Anonymous";
    img.src = url;
  }
};
Image$2.Image = Image$1;
Image$1.prototype.className = "Image";
(0, Global_1$a._registerNode)(Image$1);
Factory_1$p.Factory.addGetterSetter(Image$1, "cornerRadius", 0, (0, Validators_1$p.getNumberOrArrayOfNumbersValidator)(4));
Factory_1$p.Factory.addGetterSetter(Image$1, "image");
Factory_1$p.Factory.addComponentsGetterSetter(Image$1, "crop", ["x", "y", "width", "height"]);
Factory_1$p.Factory.addGetterSetter(Image$1, "cropX", 0, (0, Validators_1$p.getNumberValidator)());
Factory_1$p.Factory.addGetterSetter(Image$1, "cropY", 0, (0, Validators_1$p.getNumberValidator)());
Factory_1$p.Factory.addGetterSetter(Image$1, "cropWidth", 0, (0, Validators_1$p.getNumberValidator)());
Factory_1$p.Factory.addGetterSetter(Image$1, "cropHeight", 0, (0, Validators_1$p.getNumberValidator)());
var Label$8 = {};
Object.defineProperty(Label$8, "__esModule", { value: true });
Label$8.Tag = Label$8.Label = void 0;
const Factory_1$o = Factory;
const Shape_1$9 = Shape;
const Group_1$1 = Group$1;
const Validators_1$o = Validators;
const Global_1$9 = Global;
var ATTR_CHANGE_LIST$2 = [
  "fontFamily",
  "fontSize",
  "fontStyle",
  "padding",
  "lineHeight",
  "text",
  "width",
  "height",
  "pointerDirection",
  "pointerWidth",
  "pointerHeight"
], CHANGE_KONVA$1 = "Change.konva", NONE$1 = "none", UP = "up", RIGHT$1 = "right", DOWN = "down", LEFT$1 = "left", attrChangeListLen$1 = ATTR_CHANGE_LIST$2.length;
let Label$7 = class Label2 extends Group_1$1.Group {
  constructor(config) {
    super(config);
    this.on("add.konva", function(evt) {
      this._addListeners(evt.child);
      this._sync();
    });
  }
  getText() {
    return this.find("Text")[0];
  }
  getTag() {
    return this.find("Tag")[0];
  }
  _addListeners(text) {
    var that = this, n2;
    var func = function() {
      that._sync();
    };
    for (n2 = 0; n2 < attrChangeListLen$1; n2++) {
      text.on(ATTR_CHANGE_LIST$2[n2] + CHANGE_KONVA$1, func);
    }
  }
  getWidth() {
    return this.getText().width();
  }
  getHeight() {
    return this.getText().height();
  }
  _sync() {
    var text = this.getText(), tag = this.getTag(), width, height, pointerDirection, pointerWidth, x2, y2, pointerHeight;
    if (text && tag) {
      width = text.width();
      height = text.height();
      pointerDirection = tag.pointerDirection();
      pointerWidth = tag.pointerWidth();
      pointerHeight = tag.pointerHeight();
      x2 = 0;
      y2 = 0;
      switch (pointerDirection) {
        case UP:
          x2 = width / 2;
          y2 = -1 * pointerHeight;
          break;
        case RIGHT$1:
          x2 = width + pointerWidth;
          y2 = height / 2;
          break;
        case DOWN:
          x2 = width / 2;
          y2 = height + pointerHeight;
          break;
        case LEFT$1:
          x2 = -1 * pointerWidth;
          y2 = height / 2;
          break;
      }
      tag.setAttrs({
        x: -1 * x2,
        y: -1 * y2,
        width,
        height
      });
      text.setAttrs({
        x: -1 * x2,
        y: -1 * y2
      });
    }
  }
};
Label$8.Label = Label$7;
Label$7.prototype.className = "Label";
(0, Global_1$9._registerNode)(Label$7);
class Tag2 extends Shape_1$9.Shape {
  _sceneFunc(context) {
    var width = this.width(), height = this.height(), pointerDirection = this.pointerDirection(), pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), cornerRadius = this.cornerRadius();
    let topLeft = 0;
    let topRight = 0;
    let bottomLeft = 0;
    let bottomRight = 0;
    if (typeof cornerRadius === "number") {
      topLeft = topRight = bottomLeft = bottomRight = Math.min(cornerRadius, width / 2, height / 2);
    } else {
      topLeft = Math.min(cornerRadius[0] || 0, width / 2, height / 2);
      topRight = Math.min(cornerRadius[1] || 0, width / 2, height / 2);
      bottomRight = Math.min(cornerRadius[2] || 0, width / 2, height / 2);
      bottomLeft = Math.min(cornerRadius[3] || 0, width / 2, height / 2);
    }
    context.beginPath();
    context.moveTo(topLeft, 0);
    if (pointerDirection === UP) {
      context.lineTo((width - pointerWidth) / 2, 0);
      context.lineTo(width / 2, -1 * pointerHeight);
      context.lineTo((width + pointerWidth) / 2, 0);
    }
    context.lineTo(width - topRight, 0);
    context.arc(width - topRight, topRight, topRight, Math.PI * 3 / 2, 0, false);
    if (pointerDirection === RIGHT$1) {
      context.lineTo(width, (height - pointerHeight) / 2);
      context.lineTo(width + pointerWidth, height / 2);
      context.lineTo(width, (height + pointerHeight) / 2);
    }
    context.lineTo(width, height - bottomRight);
    context.arc(width - bottomRight, height - bottomRight, bottomRight, 0, Math.PI / 2, false);
    if (pointerDirection === DOWN) {
      context.lineTo((width + pointerWidth) / 2, height);
      context.lineTo(width / 2, height + pointerHeight);
      context.lineTo((width - pointerWidth) / 2, height);
    }
    context.lineTo(bottomLeft, height);
    context.arc(bottomLeft, height - bottomLeft, bottomLeft, Math.PI / 2, Math.PI, false);
    if (pointerDirection === LEFT$1) {
      context.lineTo(0, (height + pointerHeight) / 2);
      context.lineTo(-1 * pointerWidth, height / 2);
      context.lineTo(0, (height - pointerHeight) / 2);
    }
    context.lineTo(0, topLeft);
    context.arc(topLeft, topLeft, topLeft, Math.PI, Math.PI * 3 / 2, false);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getSelfRect() {
    var x2 = 0, y2 = 0, pointerWidth = this.pointerWidth(), pointerHeight = this.pointerHeight(), direction = this.pointerDirection(), width = this.width(), height = this.height();
    if (direction === UP) {
      y2 -= pointerHeight;
      height += pointerHeight;
    } else if (direction === DOWN) {
      height += pointerHeight;
    } else if (direction === LEFT$1) {
      x2 -= pointerWidth * 1.5;
      width += pointerWidth;
    } else if (direction === RIGHT$1) {
      width += pointerWidth * 1.5;
    }
    return {
      x: x2,
      y: y2,
      width,
      height
    };
  }
}
Label$8.Tag = Tag2;
Tag2.prototype.className = "Tag";
(0, Global_1$9._registerNode)(Tag2);
Factory_1$o.Factory.addGetterSetter(Tag2, "pointerDirection", NONE$1);
Factory_1$o.Factory.addGetterSetter(Tag2, "pointerWidth", 0, (0, Validators_1$o.getNumberValidator)());
Factory_1$o.Factory.addGetterSetter(Tag2, "pointerHeight", 0, (0, Validators_1$o.getNumberValidator)());
Factory_1$o.Factory.addGetterSetter(Tag2, "cornerRadius", 0, (0, Validators_1$o.getNumberOrArrayOfNumbersValidator)(4));
var Rect$1 = {};
Object.defineProperty(Rect$1, "__esModule", { value: true });
Rect$1.Rect = void 0;
const Factory_1$n = Factory;
const Shape_1$8 = Shape;
const Global_1$8 = Global;
const Util_1$6 = Util;
const Validators_1$n = Validators;
class Rect2 extends Shape_1$8.Shape {
  _sceneFunc(context) {
    var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();
    context.beginPath();
    if (!cornerRadius) {
      context.rect(0, 0, width, height);
    } else {
      Util_1$6.Util.drawRoundedRectPath(context, width, height, cornerRadius);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
}
Rect$1.Rect = Rect2;
Rect2.prototype.className = "Rect";
(0, Global_1$8._registerNode)(Rect2);
Factory_1$n.Factory.addGetterSetter(Rect2, "cornerRadius", 0, (0, Validators_1$n.getNumberOrArrayOfNumbersValidator)(4));
var RegularPolygon$1 = {};
Object.defineProperty(RegularPolygon$1, "__esModule", { value: true });
RegularPolygon$1.RegularPolygon = void 0;
const Factory_1$m = Factory;
const Shape_1$7 = Shape;
const Validators_1$m = Validators;
const Global_1$7 = Global;
class RegularPolygon2 extends Shape_1$7.Shape {
  _sceneFunc(context) {
    const points = this._getPoints();
    context.beginPath();
    context.moveTo(points[0].x, points[0].y);
    for (var n2 = 1; n2 < points.length; n2++) {
      context.lineTo(points[n2].x, points[n2].y);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  _getPoints() {
    const sides = this.attrs.sides;
    const radius = this.attrs.radius || 0;
    const points = [];
    for (var n2 = 0; n2 < sides; n2++) {
      points.push({
        x: radius * Math.sin(n2 * 2 * Math.PI / sides),
        y: -1 * radius * Math.cos(n2 * 2 * Math.PI / sides)
      });
    }
    return points;
  }
  getSelfRect() {
    const points = this._getPoints();
    var minX = points[0].x;
    var maxX = points[0].y;
    var minY = points[0].x;
    var maxY = points[0].y;
    points.forEach((point) => {
      minX = Math.min(minX, point.x);
      maxX = Math.max(maxX, point.x);
      minY = Math.min(minY, point.y);
      maxY = Math.max(maxY, point.y);
    });
    return {
      x: minX,
      y: minY,
      width: maxX - minX,
      height: maxY - minY
    };
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    this.radius(width / 2);
  }
  setHeight(height) {
    this.radius(height / 2);
  }
}
RegularPolygon$1.RegularPolygon = RegularPolygon2;
RegularPolygon2.prototype.className = "RegularPolygon";
RegularPolygon2.prototype._centroid = true;
RegularPolygon2.prototype._attrsAffectingSize = ["radius"];
(0, Global_1$7._registerNode)(RegularPolygon2);
Factory_1$m.Factory.addGetterSetter(RegularPolygon2, "radius", 0, (0, Validators_1$m.getNumberValidator)());
Factory_1$m.Factory.addGetterSetter(RegularPolygon2, "sides", 0, (0, Validators_1$m.getNumberValidator)());
var Ring$1 = {};
Object.defineProperty(Ring$1, "__esModule", { value: true });
Ring$1.Ring = void 0;
const Factory_1$l = Factory;
const Shape_1$6 = Shape;
const Validators_1$l = Validators;
const Global_1$6 = Global;
var PIx2 = Math.PI * 2;
class Ring2 extends Shape_1$6.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.innerRadius(), 0, PIx2, false);
    context.moveTo(this.outerRadius(), 0);
    context.arc(0, 0, this.outerRadius(), PIx2, 0, true);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
}
Ring$1.Ring = Ring2;
Ring2.prototype.className = "Ring";
Ring2.prototype._centroid = true;
Ring2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_1$6._registerNode)(Ring2);
Factory_1$l.Factory.addGetterSetter(Ring2, "innerRadius", 0, (0, Validators_1$l.getNumberValidator)());
Factory_1$l.Factory.addGetterSetter(Ring2, "outerRadius", 0, (0, Validators_1$l.getNumberValidator)());
var Sprite$1 = {};
Object.defineProperty(Sprite$1, "__esModule", { value: true });
Sprite$1.Sprite = void 0;
const Factory_1$k = Factory;
const Shape_1$5 = Shape;
const Animation_1 = Animation$1;
const Validators_1$k = Validators;
const Global_1$5 = Global;
class Sprite2 extends Shape_1$5.Shape {
  constructor(config) {
    super(config);
    this._updated = true;
    this.anim = new Animation_1.Animation(() => {
      var updated = this._updated;
      this._updated = false;
      return updated;
    });
    this.on("animationChange.konva", function() {
      this.frameIndex(0);
    });
    this.on("frameIndexChange.konva", function() {
      this._updated = true;
    });
    this.on("frameRateChange.konva", function() {
      if (!this.anim.isRunning()) {
        return;
      }
      clearInterval(this.interval);
      this._setInterval();
    });
  }
  _sceneFunc(context) {
    var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x2 = set[ix4 + 0], y2 = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();
    if (this.hasFill() || this.hasStroke()) {
      context.beginPath();
      context.rect(0, 0, width, height);
      context.closePath();
      context.fillStrokeShape(this);
    }
    if (image) {
      if (offsets) {
        var offset5 = offsets[anim], ix2 = index * 2;
        context.drawImage(image, x2, y2, width, height, offset5[ix2 + 0], offset5[ix2 + 1], width, height);
      } else {
        context.drawImage(image, x2, y2, width, height, 0, 0, width, height);
      }
    }
  }
  _hitFunc(context) {
    var anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];
    context.beginPath();
    if (offsets) {
      var offset5 = offsets[anim];
      var ix2 = index * 2;
      context.rect(offset5[ix2 + 0], offset5[ix2 + 1], width, height);
    } else {
      context.rect(0, 0, width, height);
    }
    context.closePath();
    context.fillShape(this);
  }
  _useBufferCanvas() {
    return super._useBufferCanvas(true);
  }
  _setInterval() {
    var that = this;
    this.interval = setInterval(function() {
      that._updateIndex();
    }, 1e3 / this.frameRate());
  }
  start() {
    if (this.isRunning()) {
      return;
    }
    var layer = this.getLayer();
    this.anim.setLayers(layer);
    this._setInterval();
    this.anim.start();
  }
  stop() {
    this.anim.stop();
    clearInterval(this.interval);
  }
  isRunning() {
    return this.anim.isRunning();
  }
  _updateIndex() {
    var index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;
    if (index < len - 1) {
      this.frameIndex(index + 1);
    } else {
      this.frameIndex(0);
    }
  }
}
Sprite$1.Sprite = Sprite2;
Sprite2.prototype.className = "Sprite";
(0, Global_1$5._registerNode)(Sprite2);
Factory_1$k.Factory.addGetterSetter(Sprite2, "animation");
Factory_1$k.Factory.addGetterSetter(Sprite2, "animations");
Factory_1$k.Factory.addGetterSetter(Sprite2, "frameOffsets");
Factory_1$k.Factory.addGetterSetter(Sprite2, "image");
Factory_1$k.Factory.addGetterSetter(Sprite2, "frameIndex", 0, (0, Validators_1$k.getNumberValidator)());
Factory_1$k.Factory.addGetterSetter(Sprite2, "frameRate", 17, (0, Validators_1$k.getNumberValidator)());
Factory_1$k.Factory.backCompat(Sprite2, {
  index: "frameIndex",
  getIndex: "getFrameIndex",
  setIndex: "setFrameIndex"
});
var Star$1 = {};
Object.defineProperty(Star$1, "__esModule", { value: true });
Star$1.Star = void 0;
const Factory_1$j = Factory;
const Shape_1$4 = Shape;
const Validators_1$j = Validators;
const Global_1$4 = Global;
class Star2 extends Shape_1$4.Shape {
  _sceneFunc(context) {
    var innerRadius = this.innerRadius(), outerRadius = this.outerRadius(), numPoints = this.numPoints();
    context.beginPath();
    context.moveTo(0, 0 - outerRadius);
    for (var n2 = 1; n2 < numPoints * 2; n2++) {
      var radius = n2 % 2 === 0 ? outerRadius : innerRadius;
      var x2 = radius * Math.sin(n2 * Math.PI / numPoints);
      var y2 = -1 * radius * Math.cos(n2 * Math.PI / numPoints);
      context.lineTo(x2, y2);
    }
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.outerRadius() * 2;
  }
  getHeight() {
    return this.outerRadius() * 2;
  }
  setWidth(width) {
    this.outerRadius(width / 2);
  }
  setHeight(height) {
    this.outerRadius(height / 2);
  }
}
Star$1.Star = Star2;
Star2.prototype.className = "Star";
Star2.prototype._centroid = true;
Star2.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
(0, Global_1$4._registerNode)(Star2);
Factory_1$j.Factory.addGetterSetter(Star2, "numPoints", 5, (0, Validators_1$j.getNumberValidator)());
Factory_1$j.Factory.addGetterSetter(Star2, "innerRadius", 0, (0, Validators_1$j.getNumberValidator)());
Factory_1$j.Factory.addGetterSetter(Star2, "outerRadius", 0, (0, Validators_1$j.getNumberValidator)());
var Text$4 = {};
Object.defineProperty(Text$4, "__esModule", { value: true });
Text$4.Text = Text$4.stringToArray = void 0;
const Util_1$5 = Util;
const Factory_1$i = Factory;
const Shape_1$3 = Shape;
const Validators_1$i = Validators;
const Global_1$3 = Global;
function stringToArray(string) {
  return Array.from(string);
}
Text$4.stringToArray = stringToArray;
var AUTO = "auto", CENTER = "center", INHERIT = "inherit", JUSTIFY = "justify", CHANGE_KONVA = "Change.konva", CONTEXT_2D = "2d", DASH = "-", LEFT = "left", TEXT = "text", TEXT_UPPER = "Text", TOP = "top", BOTTOM = "bottom", MIDDLE = "middle", NORMAL$1 = "normal", PX_SPACE = "px ", SPACE = " ", RIGHT = "right", RTL = "rtl", WORD = "word", CHAR = "char", NONE = "none", ELLIPSIS = "…", ATTR_CHANGE_LIST$1 = [
  "direction",
  "fontFamily",
  "fontSize",
  "fontStyle",
  "fontVariant",
  "padding",
  "align",
  "verticalAlign",
  "lineHeight",
  "text",
  "width",
  "height",
  "wrap",
  "ellipsis",
  "letterSpacing"
], attrChangeListLen = ATTR_CHANGE_LIST$1.length;
function normalizeFontFamily(fontFamily) {
  return fontFamily.split(",").map((family) => {
    family = family.trim();
    const hasSpace = family.indexOf(" ") >= 0;
    const hasQuotes = family.indexOf('"') >= 0 || family.indexOf("'") >= 0;
    if (hasSpace && !hasQuotes) {
      family = `"${family}"`;
    }
    return family;
  }).join(", ");
}
var dummyContext;
function getDummyContext() {
  if (dummyContext) {
    return dummyContext;
  }
  dummyContext = Util_1$5.Util.createCanvasElement().getContext(CONTEXT_2D);
  return dummyContext;
}
function _fillFunc$1(context) {
  context.fillText(this._partialText, this._partialTextX, this._partialTextY);
}
function _strokeFunc$1(context) {
  context.setAttr("miterLimit", 2);
  context.strokeText(this._partialText, this._partialTextX, this._partialTextY);
}
function checkDefaultFill(config) {
  config = config || {};
  if (!config.fillLinearGradientColorStops && !config.fillRadialGradientColorStops && !config.fillPatternImage) {
    config.fill = config.fill || "black";
  }
  return config;
}
let Text$3 = class Text2 extends Shape_1$3.Shape {
  constructor(config) {
    super(checkDefaultFill(config));
    this._partialTextX = 0;
    this._partialTextY = 0;
    for (var n2 = 0; n2 < attrChangeListLen; n2++) {
      this.on(ATTR_CHANGE_LIST$1[n2] + CHANGE_KONVA, this._setTextData);
    }
    this._setTextData();
  }
  _sceneFunc(context) {
    var textArr = this.textArr, textArrLen = textArr.length;
    if (!this.text()) {
      return;
    }
    var padding = this.padding(), fontSize = this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, verticalAlign = this.verticalAlign(), direction = this.direction(), alignY = 0, align = this.align(), totalWidth = this.getWidth(), letterSpacing = this.letterSpacing(), fill = this.fill(), textDecoration = this.textDecoration(), shouldUnderline = textDecoration.indexOf("underline") !== -1, shouldLineThrough = textDecoration.indexOf("line-through") !== -1, n2;
    direction = direction === INHERIT ? context.direction : direction;
    var translateY = 0;
    var translateY = lineHeightPx / 2;
    var lineTranslateX = 0;
    var lineTranslateY = 0;
    if (direction === RTL) {
      context.setAttr("direction", direction);
    }
    context.setAttr("font", this._getContextFont());
    context.setAttr("textBaseline", MIDDLE);
    context.setAttr("textAlign", LEFT);
    if (verticalAlign === MIDDLE) {
      alignY = (this.getHeight() - textArrLen * lineHeightPx - padding * 2) / 2;
    } else if (verticalAlign === BOTTOM) {
      alignY = this.getHeight() - textArrLen * lineHeightPx - padding * 2;
    }
    context.translate(padding, alignY + padding);
    for (n2 = 0; n2 < textArrLen; n2++) {
      var lineTranslateX = 0;
      var lineTranslateY = 0;
      var obj = textArr[n2], text = obj.text, width = obj.width, lastLine = obj.lastInParagraph, spacesNumber, oneWord, lineWidth;
      context.save();
      if (align === RIGHT) {
        lineTranslateX += totalWidth - width - padding * 2;
      } else if (align === CENTER) {
        lineTranslateX += (totalWidth - width - padding * 2) / 2;
      }
      if (shouldUnderline) {
        context.save();
        context.beginPath();
        context.moveTo(lineTranslateX, translateY + lineTranslateY + Math.round(fontSize / 2));
        spacesNumber = text.split(" ").length - 1;
        oneWord = spacesNumber === 0;
        lineWidth = align === JUSTIFY && !lastLine ? totalWidth - padding * 2 : width;
        context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY + Math.round(fontSize / 2));
        context.lineWidth = fontSize / 15;
        const gradient = this._getLinearGradient();
        context.strokeStyle = gradient || fill;
        context.stroke();
        context.restore();
      }
      if (shouldLineThrough) {
        context.save();
        context.beginPath();
        context.moveTo(lineTranslateX, translateY + lineTranslateY);
        spacesNumber = text.split(" ").length - 1;
        oneWord = spacesNumber === 0;
        lineWidth = align === JUSTIFY && lastLine && !oneWord ? totalWidth - padding * 2 : width;
        context.lineTo(lineTranslateX + Math.round(lineWidth), translateY + lineTranslateY);
        context.lineWidth = fontSize / 15;
        const gradient = this._getLinearGradient();
        context.strokeStyle = gradient || fill;
        context.stroke();
        context.restore();
      }
      if (direction !== RTL && (letterSpacing !== 0 || align === JUSTIFY)) {
        spacesNumber = text.split(" ").length - 1;
        var array = stringToArray(text);
        for (var li2 = 0; li2 < array.length; li2++) {
          var letter = array[li2];
          if (letter === " " && !lastLine && align === JUSTIFY) {
            lineTranslateX += (totalWidth - padding * 2 - width) / spacesNumber;
          }
          this._partialTextX = lineTranslateX;
          this._partialTextY = translateY + lineTranslateY;
          this._partialText = letter;
          context.fillStrokeShape(this);
          lineTranslateX += this.measureSize(letter).width + letterSpacing;
        }
      } else {
        if (letterSpacing !== 0) {
          context.setAttr("letterSpacing", `${letterSpacing}px`);
        }
        this._partialTextX = lineTranslateX;
        this._partialTextY = translateY + lineTranslateY;
        this._partialText = text;
        context.fillStrokeShape(this);
      }
      context.restore();
      if (textArrLen > 1) {
        translateY += lineHeightPx;
      }
    }
  }
  _hitFunc(context) {
    var width = this.getWidth(), height = this.getHeight();
    context.beginPath();
    context.rect(0, 0, width, height);
    context.closePath();
    context.fillStrokeShape(this);
  }
  setText(text) {
    var str = Util_1$5.Util._isString(text) ? text : text === null || text === void 0 ? "" : text + "";
    this._setAttr(TEXT, str);
    return this;
  }
  getWidth() {
    var isAuto = this.attrs.width === AUTO || this.attrs.width === void 0;
    return isAuto ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;
  }
  getHeight() {
    var isAuto = this.attrs.height === AUTO || this.attrs.height === void 0;
    return isAuto ? this.fontSize() * this.textArr.length * this.lineHeight() + this.padding() * 2 : this.attrs.height;
  }
  getTextWidth() {
    return this.textWidth;
  }
  getTextHeight() {
    Util_1$5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.");
    return this.textHeight;
  }
  measureSize(text) {
    var _context = getDummyContext(), fontSize = this.fontSize(), metrics;
    _context.save();
    _context.font = this._getContextFont();
    metrics = _context.measureText(text);
    _context.restore();
    return {
      width: metrics.width,
      height: fontSize
    };
  }
  _getContextFont() {
    return this.fontStyle() + SPACE + this.fontVariant() + SPACE + (this.fontSize() + PX_SPACE) + normalizeFontFamily(this.fontFamily());
  }
  _addTextLine(line) {
    const align = this.align();
    if (align === JUSTIFY) {
      line = line.trim();
    }
    var width = this._getTextWidth(line);
    return this.textArr.push({
      text: line,
      width,
      lastInParagraph: false
    });
  }
  _getTextWidth(text) {
    var letterSpacing = this.letterSpacing();
    var length = text.length;
    return getDummyContext().measureText(text).width + (length ? letterSpacing * (length - 1) : 0);
  }
  _setTextData() {
    var lines = this.text().split("\n"), fontSize = +this.fontSize(), textWidth = 0, lineHeightPx = this.lineHeight() * fontSize, width = this.attrs.width, height = this.attrs.height, fixedWidth = width !== AUTO && width !== void 0, fixedHeight = height !== AUTO && height !== void 0, padding = this.padding(), maxWidth = width - padding * 2, maxHeightPx = height - padding * 2, currentHeightPx = 0, wrap = this.wrap(), shouldWrap = wrap !== NONE, wrapAtWord = wrap !== CHAR && shouldWrap, shouldAddEllipsis = this.ellipsis();
    this.textArr = [];
    getDummyContext().font = this._getContextFont();
    var additionalWidth = shouldAddEllipsis ? this._getTextWidth(ELLIPSIS) : 0;
    for (var i = 0, max2 = lines.length; i < max2; ++i) {
      var line = lines[i];
      var lineWidth = this._getTextWidth(line);
      if (fixedWidth && lineWidth > maxWidth) {
        while (line.length > 0) {
          var low = 0, high = line.length, match = "", matchWidth = 0;
          while (low < high) {
            var mid = low + high >>> 1, substr = line.slice(0, mid + 1), substrWidth = this._getTextWidth(substr) + additionalWidth;
            if (substrWidth <= maxWidth) {
              low = mid + 1;
              match = substr;
              matchWidth = substrWidth;
            } else {
              high = mid;
            }
          }
          if (match) {
            if (wrapAtWord) {
              var wrapIndex;
              var nextChar = line[match.length];
              var nextIsSpaceOrDash = nextChar === SPACE || nextChar === DASH;
              if (nextIsSpaceOrDash && matchWidth <= maxWidth) {
                wrapIndex = match.length;
              } else {
                wrapIndex = Math.max(match.lastIndexOf(SPACE), match.lastIndexOf(DASH)) + 1;
              }
              if (wrapIndex > 0) {
                low = wrapIndex;
                match = match.slice(0, low);
                matchWidth = this._getTextWidth(match);
              }
            }
            match = match.trimRight();
            this._addTextLine(match);
            textWidth = Math.max(textWidth, matchWidth);
            currentHeightPx += lineHeightPx;
            var shouldHandleEllipsis = this._shouldHandleEllipsis(currentHeightPx);
            if (shouldHandleEllipsis) {
              this._tryToAddEllipsisToLastLine();
              break;
            }
            line = line.slice(low);
            line = line.trimLeft();
            if (line.length > 0) {
              lineWidth = this._getTextWidth(line);
              if (lineWidth <= maxWidth) {
                this._addTextLine(line);
                currentHeightPx += lineHeightPx;
                textWidth = Math.max(textWidth, lineWidth);
                break;
              }
            }
          } else {
            break;
          }
        }
      } else {
        this._addTextLine(line);
        currentHeightPx += lineHeightPx;
        textWidth = Math.max(textWidth, lineWidth);
        if (this._shouldHandleEllipsis(currentHeightPx) && i < max2 - 1) {
          this._tryToAddEllipsisToLastLine();
        }
      }
      if (this.textArr[this.textArr.length - 1]) {
        this.textArr[this.textArr.length - 1].lastInParagraph = true;
      }
      if (fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx) {
        break;
      }
    }
    this.textHeight = fontSize;
    this.textWidth = textWidth;
  }
  _shouldHandleEllipsis(currentHeightPx) {
    var fontSize = +this.fontSize(), lineHeightPx = this.lineHeight() * fontSize, height = this.attrs.height, fixedHeight = height !== AUTO && height !== void 0, padding = this.padding(), maxHeightPx = height - padding * 2, wrap = this.wrap(), shouldWrap = wrap !== NONE;
    return !shouldWrap || fixedHeight && currentHeightPx + lineHeightPx > maxHeightPx;
  }
  _tryToAddEllipsisToLastLine() {
    var width = this.attrs.width, fixedWidth = width !== AUTO && width !== void 0, padding = this.padding(), maxWidth = width - padding * 2, shouldAddEllipsis = this.ellipsis();
    var lastLine = this.textArr[this.textArr.length - 1];
    if (!lastLine || !shouldAddEllipsis) {
      return;
    }
    if (fixedWidth) {
      var haveSpace = this._getTextWidth(lastLine.text + ELLIPSIS) < maxWidth;
      if (!haveSpace) {
        lastLine.text = lastLine.text.slice(0, lastLine.text.length - 3);
      }
    }
    this.textArr.splice(this.textArr.length - 1, 1);
    this._addTextLine(lastLine.text + ELLIPSIS);
  }
  getStrokeScaleEnabled() {
    return true;
  }
  _useBufferCanvas() {
    const hasLine = this.textDecoration().indexOf("underline") !== -1 || this.textDecoration().indexOf("line-through") !== -1;
    const hasShadow = this.hasShadow();
    if (hasLine && hasShadow) {
      return true;
    }
    return super._useBufferCanvas();
  }
};
Text$4.Text = Text$3;
Text$3.prototype._fillFunc = _fillFunc$1;
Text$3.prototype._strokeFunc = _strokeFunc$1;
Text$3.prototype.className = TEXT_UPPER;
Text$3.prototype._attrsAffectingSize = [
  "text",
  "fontSize",
  "padding",
  "wrap",
  "lineHeight",
  "letterSpacing"
];
(0, Global_1$3._registerNode)(Text$3);
Factory_1$i.Factory.overWriteSetter(Text$3, "width", (0, Validators_1$i.getNumberOrAutoValidator)());
Factory_1$i.Factory.overWriteSetter(Text$3, "height", (0, Validators_1$i.getNumberOrAutoValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "direction", INHERIT);
Factory_1$i.Factory.addGetterSetter(Text$3, "fontFamily", "Arial");
Factory_1$i.Factory.addGetterSetter(Text$3, "fontSize", 12, (0, Validators_1$i.getNumberValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "fontStyle", NORMAL$1);
Factory_1$i.Factory.addGetterSetter(Text$3, "fontVariant", NORMAL$1);
Factory_1$i.Factory.addGetterSetter(Text$3, "padding", 0, (0, Validators_1$i.getNumberValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "align", LEFT);
Factory_1$i.Factory.addGetterSetter(Text$3, "verticalAlign", TOP);
Factory_1$i.Factory.addGetterSetter(Text$3, "lineHeight", 1, (0, Validators_1$i.getNumberValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "wrap", WORD);
Factory_1$i.Factory.addGetterSetter(Text$3, "ellipsis", false, (0, Validators_1$i.getBooleanValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "letterSpacing", 0, (0, Validators_1$i.getNumberValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "text", "", (0, Validators_1$i.getStringValidator)());
Factory_1$i.Factory.addGetterSetter(Text$3, "textDecoration", "");
var TextPath$1 = {};
Object.defineProperty(TextPath$1, "__esModule", { value: true });
TextPath$1.TextPath = void 0;
const Util_1$4 = Util;
const Factory_1$h = Factory;
const Shape_1$2 = Shape;
const Path_1$1 = Path$1;
const Text_1$1 = Text$4;
const Validators_1$h = Validators;
const Global_1$2 = Global;
var EMPTY_STRING = "", NORMAL = "normal";
function _fillFunc(context) {
  context.fillText(this.partialText, 0, 0);
}
function _strokeFunc(context) {
  context.strokeText(this.partialText, 0, 0);
}
class TextPath2 extends Shape_1$2.Shape {
  constructor(config) {
    super(config);
    this.dummyCanvas = Util_1$4.Util.createCanvasElement();
    this.dataArray = [];
    this._readDataAttribute();
    this.on("dataChange.konva", function() {
      this._readDataAttribute();
      this._setTextData();
    });
    this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva", this._setTextData);
    this._setTextData();
  }
  _getTextPathLength() {
    return Path_1$1.Path.getPathLength(this.dataArray);
  }
  _getPointAtLength(length) {
    if (!this.attrs.data) {
      return null;
    }
    const totalLength = this.pathLength;
    if (length - 1 > totalLength) {
      return null;
    }
    return Path_1$1.Path.getPointAtLengthOfDataArray(length, this.dataArray);
  }
  _readDataAttribute() {
    this.dataArray = Path_1$1.Path.parsePathData(this.attrs.data);
    this.pathLength = this._getTextPathLength();
  }
  _sceneFunc(context) {
    context.setAttr("font", this._getContextFont());
    context.setAttr("textBaseline", this.textBaseline());
    context.setAttr("textAlign", "left");
    context.save();
    var textDecoration = this.textDecoration();
    var fill = this.fill();
    var fontSize = this.fontSize();
    var glyphInfo = this.glyphInfo;
    if (textDecoration === "underline") {
      context.beginPath();
    }
    for (var i = 0; i < glyphInfo.length; i++) {
      context.save();
      var p0 = glyphInfo[i].p0;
      context.translate(p0.x, p0.y);
      context.rotate(glyphInfo[i].rotation);
      this.partialText = glyphInfo[i].text;
      context.fillStrokeShape(this);
      if (textDecoration === "underline") {
        if (i === 0) {
          context.moveTo(0, fontSize / 2 + 1);
        }
        context.lineTo(fontSize, fontSize / 2 + 1);
      }
      context.restore();
    }
    if (textDecoration === "underline") {
      context.strokeStyle = fill;
      context.lineWidth = fontSize / 20;
      context.stroke();
    }
    context.restore();
  }
  _hitFunc(context) {
    context.beginPath();
    var glyphInfo = this.glyphInfo;
    if (glyphInfo.length >= 1) {
      var p0 = glyphInfo[0].p0;
      context.moveTo(p0.x, p0.y);
    }
    for (var i = 0; i < glyphInfo.length; i++) {
      var p1 = glyphInfo[i].p1;
      context.lineTo(p1.x, p1.y);
    }
    context.setAttr("lineWidth", this.fontSize());
    context.setAttr("strokeStyle", this.colorKey);
    context.stroke();
  }
  getTextWidth() {
    return this.textWidth;
  }
  getTextHeight() {
    Util_1$4.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.");
    return this.textHeight;
  }
  setText(text) {
    return Text_1$1.Text.prototype.setText.call(this, text);
  }
  _getContextFont() {
    return Text_1$1.Text.prototype._getContextFont.call(this);
  }
  _getTextSize(text) {
    var dummyCanvas = this.dummyCanvas;
    var _context = dummyCanvas.getContext("2d");
    _context.save();
    _context.font = this._getContextFont();
    var metrics = _context.measureText(text);
    _context.restore();
    return {
      width: metrics.width,
      height: parseInt(`${this.fontSize()}`, 10)
    };
  }
  _setTextData() {
    const { width, height } = this._getTextSize(this.attrs.text);
    this.textWidth = width;
    this.textHeight = height;
    this.glyphInfo = [];
    if (!this.attrs.data) {
      return null;
    }
    const letterSpacing = this.letterSpacing();
    const align = this.align();
    const kerningFunc = this.kerningFunc();
    const textWidth = Math.max(this.textWidth + ((this.attrs.text || "").length - 1) * letterSpacing, 0);
    let offset5 = 0;
    if (align === "center") {
      offset5 = Math.max(0, this.pathLength / 2 - textWidth / 2);
    }
    if (align === "right") {
      offset5 = Math.max(0, this.pathLength - textWidth);
    }
    const charArr = (0, Text_1$1.stringToArray)(this.text());
    let offsetToGlyph = offset5;
    for (var i = 0; i < charArr.length; i++) {
      const charStartPoint = this._getPointAtLength(offsetToGlyph);
      if (!charStartPoint)
        return;
      let glyphWidth = this._getTextSize(charArr[i]).width + letterSpacing;
      if (charArr[i] === " " && align === "justify") {
        const numberOfSpaces = this.text().split(" ").length - 1;
        glyphWidth += (this.pathLength - textWidth) / numberOfSpaces;
      }
      const charEndPoint = this._getPointAtLength(offsetToGlyph + glyphWidth);
      if (!charEndPoint)
        return;
      const width2 = Path_1$1.Path.getLineLength(charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);
      let kern = 0;
      if (kerningFunc) {
        try {
          kern = kerningFunc(charArr[i - 1], charArr[i]) * this.fontSize();
        } catch (e2) {
          kern = 0;
        }
      }
      charStartPoint.x += kern;
      charEndPoint.x += kern;
      this.textWidth += kern;
      const midpoint = Path_1$1.Path.getPointOnLine(kern + width2 / 2, charStartPoint.x, charStartPoint.y, charEndPoint.x, charEndPoint.y);
      const rotation = Math.atan2(charEndPoint.y - charStartPoint.y, charEndPoint.x - charStartPoint.x);
      this.glyphInfo.push({
        transposeX: midpoint.x,
        transposeY: midpoint.y,
        text: charArr[i],
        rotation,
        p0: charStartPoint,
        p1: charEndPoint
      });
      offsetToGlyph += glyphWidth;
    }
  }
  getSelfRect() {
    if (!this.glyphInfo.length) {
      return {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      };
    }
    var points = [];
    this.glyphInfo.forEach(function(info) {
      points.push(info.p0.x);
      points.push(info.p0.y);
      points.push(info.p1.x);
      points.push(info.p1.y);
    });
    var minX = points[0] || 0;
    var maxX = points[0] || 0;
    var minY = points[1] || 0;
    var maxY = points[1] || 0;
    var x2, y2;
    for (var i = 0; i < points.length / 2; i++) {
      x2 = points[i * 2];
      y2 = points[i * 2 + 1];
      minX = Math.min(minX, x2);
      maxX = Math.max(maxX, x2);
      minY = Math.min(minY, y2);
      maxY = Math.max(maxY, y2);
    }
    var fontSize = this.fontSize();
    return {
      x: minX - fontSize / 2,
      y: minY - fontSize / 2,
      width: maxX - minX + fontSize,
      height: maxY - minY + fontSize
    };
  }
  destroy() {
    Util_1$4.Util.releaseCanvas(this.dummyCanvas);
    return super.destroy();
  }
}
TextPath$1.TextPath = TextPath2;
TextPath2.prototype._fillFunc = _fillFunc;
TextPath2.prototype._strokeFunc = _strokeFunc;
TextPath2.prototype._fillFuncHit = _fillFunc;
TextPath2.prototype._strokeFuncHit = _strokeFunc;
TextPath2.prototype.className = "TextPath";
TextPath2.prototype._attrsAffectingSize = ["text", "fontSize", "data"];
(0, Global_1$2._registerNode)(TextPath2);
Factory_1$h.Factory.addGetterSetter(TextPath2, "data");
Factory_1$h.Factory.addGetterSetter(TextPath2, "fontFamily", "Arial");
Factory_1$h.Factory.addGetterSetter(TextPath2, "fontSize", 12, (0, Validators_1$h.getNumberValidator)());
Factory_1$h.Factory.addGetterSetter(TextPath2, "fontStyle", NORMAL);
Factory_1$h.Factory.addGetterSetter(TextPath2, "align", "left");
Factory_1$h.Factory.addGetterSetter(TextPath2, "letterSpacing", 0, (0, Validators_1$h.getNumberValidator)());
Factory_1$h.Factory.addGetterSetter(TextPath2, "textBaseline", "middle");
Factory_1$h.Factory.addGetterSetter(TextPath2, "fontVariant", NORMAL);
Factory_1$h.Factory.addGetterSetter(TextPath2, "text", EMPTY_STRING);
Factory_1$h.Factory.addGetterSetter(TextPath2, "textDecoration", null);
Factory_1$h.Factory.addGetterSetter(TextPath2, "kerningFunc", null);
var Transformer$1 = {};
Object.defineProperty(Transformer$1, "__esModule", { value: true });
Transformer$1.Transformer = void 0;
const Util_1$3 = Util;
const Factory_1$g = Factory;
const Node_1$f = Node$1;
const Shape_1$1 = Shape;
const Rect_1$1 = Rect$1;
const Group_1 = Group$1;
const Global_1$1 = Global;
const Validators_1$g = Validators;
const Global_2$1 = Global;
var EVENTS_NAME = "tr-konva";
var ATTR_CHANGE_LIST = [
  "resizeEnabledChange",
  "rotateAnchorOffsetChange",
  "rotateEnabledChange",
  "enabledAnchorsChange",
  "anchorSizeChange",
  "borderEnabledChange",
  "borderStrokeChange",
  "borderStrokeWidthChange",
  "borderDashChange",
  "anchorStrokeChange",
  "anchorStrokeWidthChange",
  "anchorFillChange",
  "anchorCornerRadiusChange",
  "ignoreStrokeChange",
  "anchorStyleFuncChange"
].map((e2) => e2 + `.${EVENTS_NAME}`).join(" ");
var NODES_RECT = "nodesRect";
var TRANSFORM_CHANGE_STR = [
  "widthChange",
  "heightChange",
  "scaleXChange",
  "scaleYChange",
  "skewXChange",
  "skewYChange",
  "rotationChange",
  "offsetXChange",
  "offsetYChange",
  "transformsEnabledChange",
  "strokeWidthChange"
];
var ANGLES = {
  "top-left": -45,
  "top-center": 0,
  "top-right": 45,
  "middle-right": -90,
  "middle-left": 90,
  "bottom-left": -135,
  "bottom-center": 180,
  "bottom-right": 135
};
const TOUCH_DEVICE = "ontouchstart" in Global_1$1.Konva._global;
function getCursor(anchorName, rad, rotateCursor) {
  if (anchorName === "rotater") {
    return rotateCursor;
  }
  rad += Util_1$3.Util.degToRad(ANGLES[anchorName] || 0);
  var angle = (Util_1$3.Util.radToDeg(rad) % 360 + 360) % 360;
  if (Util_1$3.Util._inRange(angle, 315 + 22.5, 360) || Util_1$3.Util._inRange(angle, 0, 22.5)) {
    return "ns-resize";
  } else if (Util_1$3.Util._inRange(angle, 45 - 22.5, 45 + 22.5)) {
    return "nesw-resize";
  } else if (Util_1$3.Util._inRange(angle, 90 - 22.5, 90 + 22.5)) {
    return "ew-resize";
  } else if (Util_1$3.Util._inRange(angle, 135 - 22.5, 135 + 22.5)) {
    return "nwse-resize";
  } else if (Util_1$3.Util._inRange(angle, 180 - 22.5, 180 + 22.5)) {
    return "ns-resize";
  } else if (Util_1$3.Util._inRange(angle, 225 - 22.5, 225 + 22.5)) {
    return "nesw-resize";
  } else if (Util_1$3.Util._inRange(angle, 270 - 22.5, 270 + 22.5)) {
    return "ew-resize";
  } else if (Util_1$3.Util._inRange(angle, 315 - 22.5, 315 + 22.5)) {
    return "nwse-resize";
  } else {
    Util_1$3.Util.error("Transformer has unknown angle for cursor detection: " + angle);
    return "pointer";
  }
}
var ANCHORS_NAMES = [
  "top-left",
  "top-center",
  "top-right",
  "middle-right",
  "middle-left",
  "bottom-left",
  "bottom-center",
  "bottom-right"
];
var MAX_SAFE_INTEGER = 1e8;
function getCenter$1(shape) {
  return {
    x: shape.x + shape.width / 2 * Math.cos(shape.rotation) + shape.height / 2 * Math.sin(-shape.rotation),
    y: shape.y + shape.height / 2 * Math.cos(shape.rotation) + shape.width / 2 * Math.sin(shape.rotation)
  };
}
function rotateAroundPoint(shape, angleRad, point) {
  const x2 = point.x + (shape.x - point.x) * Math.cos(angleRad) - (shape.y - point.y) * Math.sin(angleRad);
  const y2 = point.y + (shape.x - point.x) * Math.sin(angleRad) + (shape.y - point.y) * Math.cos(angleRad);
  return {
    ...shape,
    rotation: shape.rotation + angleRad,
    x: x2,
    y: y2
  };
}
function rotateAroundCenter(shape, deltaRad) {
  const center = getCenter$1(shape);
  return rotateAroundPoint(shape, deltaRad, center);
}
function getSnap(snaps, newRotationRad, tol) {
  let snapped = newRotationRad;
  for (let i = 0; i < snaps.length; i++) {
    const angle = Global_1$1.Konva.getAngle(snaps[i]);
    const absDiff = Math.abs(angle - newRotationRad) % (Math.PI * 2);
    const dif = Math.min(absDiff, Math.PI * 2 - absDiff);
    if (dif < tol) {
      snapped = angle;
    }
  }
  return snapped;
}
let activeTransformersCount = 0;
class Transformer2 extends Group_1.Group {
  constructor(config) {
    super(config);
    this._movingAnchorName = null;
    this._transforming = false;
    this._createElements();
    this._handleMouseMove = this._handleMouseMove.bind(this);
    this._handleMouseUp = this._handleMouseUp.bind(this);
    this.update = this.update.bind(this);
    this.on(ATTR_CHANGE_LIST, this.update);
    if (this.getNode()) {
      this.update();
    }
  }
  attachTo(node) {
    this.setNode(node);
    return this;
  }
  setNode(node) {
    Util_1$3.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead.");
    return this.setNodes([node]);
  }
  getNode() {
    return this._nodes && this._nodes[0];
  }
  _getEventNamespace() {
    return EVENTS_NAME + this._id;
  }
  setNodes(nodes = []) {
    if (this._nodes && this._nodes.length) {
      this.detach();
    }
    const filteredNodes = nodes.filter((node) => {
      if (node.isAncestorOf(this)) {
        Util_1$3.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach");
        return false;
      }
      return true;
    });
    this._nodes = nodes = filteredNodes;
    if (nodes.length === 1 && this.useSingleNodeRotation()) {
      this.rotation(nodes[0].getAbsoluteRotation());
    } else {
      this.rotation(0);
    }
    this._nodes.forEach((node) => {
      const onChange2 = () => {
        if (this.nodes().length === 1 && this.useSingleNodeRotation()) {
          this.rotation(this.nodes()[0].getAbsoluteRotation());
        }
        this._resetTransformCache();
        if (!this._transforming && !this.isDragging()) {
          this.update();
        }
      };
      const additionalEvents = node._attrsAffectingSize.map((prop) => prop + "Change." + this._getEventNamespace()).join(" ");
      node.on(additionalEvents, onChange2);
      node.on(TRANSFORM_CHANGE_STR.map((e2) => e2 + `.${this._getEventNamespace()}`).join(" "), onChange2);
      node.on(`absoluteTransformChange.${this._getEventNamespace()}`, onChange2);
      this._proxyDrag(node);
    });
    this._resetTransformCache();
    var elementsCreated = !!this.findOne(".top-left");
    if (elementsCreated) {
      this.update();
    }
    return this;
  }
  _proxyDrag(node) {
    let lastPos;
    node.on(`dragstart.${this._getEventNamespace()}`, (e2) => {
      lastPos = node.getAbsolutePosition();
      if (!this.isDragging() && node !== this.findOne(".back")) {
        this.startDrag(e2, false);
      }
    });
    node.on(`dragmove.${this._getEventNamespace()}`, (e2) => {
      if (!lastPos) {
        return;
      }
      const abs = node.getAbsolutePosition();
      const dx = abs.x - lastPos.x;
      const dy = abs.y - lastPos.y;
      this.nodes().forEach((otherNode) => {
        if (otherNode === node) {
          return;
        }
        if (otherNode.isDragging()) {
          return;
        }
        const otherAbs = otherNode.getAbsolutePosition();
        otherNode.setAbsolutePosition({
          x: otherAbs.x + dx,
          y: otherAbs.y + dy
        });
        otherNode.startDrag(e2);
      });
      lastPos = null;
    });
  }
  getNodes() {
    return this._nodes || [];
  }
  getActiveAnchor() {
    return this._movingAnchorName;
  }
  detach() {
    if (this._nodes) {
      this._nodes.forEach((node) => {
        node.off("." + this._getEventNamespace());
      });
    }
    this._nodes = [];
    this._resetTransformCache();
  }
  _resetTransformCache() {
    this._clearCache(NODES_RECT);
    this._clearCache("transform");
    this._clearSelfAndDescendantCache("absoluteTransform");
  }
  _getNodeRect() {
    return this._getCache(NODES_RECT, this.__getNodeRect);
  }
  __getNodeShape(node, rot = this.rotation(), relative) {
    var rect = node.getClientRect({
      skipTransform: true,
      skipShadow: true,
      skipStroke: this.ignoreStroke()
    });
    var absScale = node.getAbsoluteScale(relative);
    var absPos = node.getAbsolutePosition(relative);
    var dx = rect.x * absScale.x - node.offsetX() * absScale.x;
    var dy = rect.y * absScale.y - node.offsetY() * absScale.y;
    const rotation = (Global_1$1.Konva.getAngle(node.getAbsoluteRotation()) + Math.PI * 2) % (Math.PI * 2);
    const box = {
      x: absPos.x + dx * Math.cos(rotation) + dy * Math.sin(-rotation),
      y: absPos.y + dy * Math.cos(rotation) + dx * Math.sin(rotation),
      width: rect.width * absScale.x,
      height: rect.height * absScale.y,
      rotation
    };
    return rotateAroundPoint(box, -Global_1$1.Konva.getAngle(rot), {
      x: 0,
      y: 0
    });
  }
  __getNodeRect() {
    var node = this.getNode();
    if (!node) {
      return {
        x: -MAX_SAFE_INTEGER,
        y: -MAX_SAFE_INTEGER,
        width: 0,
        height: 0,
        rotation: 0
      };
    }
    const totalPoints = [];
    this.nodes().map((node2) => {
      const box = node2.getClientRect({
        skipTransform: true,
        skipShadow: true,
        skipStroke: this.ignoreStroke()
      });
      var points = [
        { x: box.x, y: box.y },
        { x: box.x + box.width, y: box.y },
        { x: box.x + box.width, y: box.y + box.height },
        { x: box.x, y: box.y + box.height }
      ];
      var trans = node2.getAbsoluteTransform();
      points.forEach(function(point) {
        var transformed = trans.point(point);
        totalPoints.push(transformed);
      });
    });
    const tr = new Util_1$3.Transform();
    tr.rotate(-Global_1$1.Konva.getAngle(this.rotation()));
    var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
    totalPoints.forEach(function(point) {
      var transformed = tr.point(point);
      if (minX === void 0) {
        minX = maxX = transformed.x;
        minY = maxY = transformed.y;
      }
      minX = Math.min(minX, transformed.x);
      minY = Math.min(minY, transformed.y);
      maxX = Math.max(maxX, transformed.x);
      maxY = Math.max(maxY, transformed.y);
    });
    tr.invert();
    const p2 = tr.point({ x: minX, y: minY });
    return {
      x: p2.x,
      y: p2.y,
      width: maxX - minX,
      height: maxY - minY,
      rotation: Global_1$1.Konva.getAngle(this.rotation())
    };
  }
  getX() {
    return this._getNodeRect().x;
  }
  getY() {
    return this._getNodeRect().y;
  }
  getWidth() {
    return this._getNodeRect().width;
  }
  getHeight() {
    return this._getNodeRect().height;
  }
  _createElements() {
    this._createBack();
    ANCHORS_NAMES.forEach((name) => {
      this._createAnchor(name);
    });
    this._createAnchor("rotater");
  }
  _createAnchor(name) {
    var anchor = new Rect_1$1.Rect({
      stroke: "rgb(0, 161, 255)",
      fill: "white",
      strokeWidth: 1,
      name: name + " _anchor",
      dragDistance: 0,
      draggable: true,
      hitStrokeWidth: TOUCH_DEVICE ? 10 : "auto"
    });
    var self2 = this;
    anchor.on("mousedown touchstart", function(e2) {
      self2._handleMouseDown(e2);
    });
    anchor.on("dragstart", (e2) => {
      anchor.stopDrag();
      e2.cancelBubble = true;
    });
    anchor.on("dragend", (e2) => {
      e2.cancelBubble = true;
    });
    anchor.on("mouseenter", () => {
      var rad = Global_1$1.Konva.getAngle(this.rotation());
      var rotateCursor = this.rotateAnchorCursor();
      var cursor = getCursor(name, rad, rotateCursor);
      anchor.getStage().content && (anchor.getStage().content.style.cursor = cursor);
      this._cursorChange = true;
    });
    anchor.on("mouseout", () => {
      anchor.getStage().content && (anchor.getStage().content.style.cursor = "");
      this._cursorChange = false;
    });
    this.add(anchor);
  }
  _createBack() {
    var back = new Shape_1$1.Shape({
      name: "back",
      width: 0,
      height: 0,
      draggable: true,
      sceneFunc(ctx, shape) {
        var tr = shape.getParent();
        var padding = tr.padding();
        ctx.beginPath();
        ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);
        ctx.moveTo(shape.width() / 2, -padding);
        if (tr.rotateEnabled() && tr.rotateLineVisible()) {
          ctx.lineTo(shape.width() / 2, -tr.rotateAnchorOffset() * Util_1$3.Util._sign(shape.height()) - padding);
        }
        ctx.fillStrokeShape(shape);
      },
      hitFunc: (ctx, shape) => {
        if (!this.shouldOverdrawWholeArea()) {
          return;
        }
        var padding = this.padding();
        ctx.beginPath();
        ctx.rect(-padding, -padding, shape.width() + padding * 2, shape.height() + padding * 2);
        ctx.fillStrokeShape(shape);
      }
    });
    this.add(back);
    this._proxyDrag(back);
    back.on("dragstart", (e2) => {
      e2.cancelBubble = true;
    });
    back.on("dragmove", (e2) => {
      e2.cancelBubble = true;
    });
    back.on("dragend", (e2) => {
      e2.cancelBubble = true;
    });
    this.on("dragmove", (e2) => {
      this.update();
    });
  }
  _handleMouseDown(e2) {
    this._movingAnchorName = e2.target.name().split(" ")[0];
    var attrs = this._getNodeRect();
    var width = attrs.width;
    var height = attrs.height;
    var hypotenuse = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
    this.sin = Math.abs(height / hypotenuse);
    this.cos = Math.abs(width / hypotenuse);
    if (typeof window !== "undefined") {
      window.addEventListener("mousemove", this._handleMouseMove);
      window.addEventListener("touchmove", this._handleMouseMove);
      window.addEventListener("mouseup", this._handleMouseUp, true);
      window.addEventListener("touchend", this._handleMouseUp, true);
    }
    this._transforming = true;
    var ap = e2.target.getAbsolutePosition();
    var pos = e2.target.getStage().getPointerPosition();
    this._anchorDragOffset = {
      x: pos.x - ap.x,
      y: pos.y - ap.y
    };
    activeTransformersCount++;
    this._fire("transformstart", { evt: e2.evt, target: this.getNode() });
    this._nodes.forEach((target) => {
      target._fire("transformstart", { evt: e2.evt, target });
    });
  }
  _handleMouseMove(e2) {
    var x2, y2, newHypotenuse;
    var anchorNode = this.findOne("." + this._movingAnchorName);
    var stage = anchorNode.getStage();
    stage.setPointersPositions(e2);
    const pp = stage.getPointerPosition();
    let newNodePos = {
      x: pp.x - this._anchorDragOffset.x,
      y: pp.y - this._anchorDragOffset.y
    };
    const oldAbs = anchorNode.getAbsolutePosition();
    if (this.anchorDragBoundFunc()) {
      newNodePos = this.anchorDragBoundFunc()(oldAbs, newNodePos, e2);
    }
    anchorNode.setAbsolutePosition(newNodePos);
    const newAbs = anchorNode.getAbsolutePosition();
    if (oldAbs.x === newAbs.x && oldAbs.y === newAbs.y) {
      return;
    }
    if (this._movingAnchorName === "rotater") {
      var attrs = this._getNodeRect();
      x2 = anchorNode.x() - attrs.width / 2;
      y2 = -anchorNode.y() + attrs.height / 2;
      let delta = Math.atan2(-y2, x2) + Math.PI / 2;
      if (attrs.height < 0) {
        delta -= Math.PI;
      }
      var oldRotation = Global_1$1.Konva.getAngle(this.rotation());
      const newRotation = oldRotation + delta;
      const tol = Global_1$1.Konva.getAngle(this.rotationSnapTolerance());
      const snappedRot = getSnap(this.rotationSnaps(), newRotation, tol);
      const diff = snappedRot - attrs.rotation;
      const shape = rotateAroundCenter(attrs, diff);
      this._fitNodesInto(shape, e2);
      return;
    }
    var shiftBehavior = this.shiftBehavior();
    var keepProportion;
    if (shiftBehavior === "inverted") {
      keepProportion = this.keepRatio() && !e2.shiftKey;
    } else if (shiftBehavior === "none") {
      keepProportion = this.keepRatio();
    } else {
      keepProportion = this.keepRatio() || e2.shiftKey;
    }
    var centeredScaling = this.centeredScaling() || e2.altKey;
    if (this._movingAnchorName === "top-left") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".bottom-right").x(),
          y: this.findOne(".bottom-right").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) + Math.pow(comparePoint.y - anchorNode.y(), 2));
        var reverseX = this.findOne(".top-left").x() > comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".top-left").y() > comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".top-left").x(comparePoint.x - x2);
        this.findOne(".top-left").y(comparePoint.y - y2);
      }
    } else if (this._movingAnchorName === "top-center") {
      this.findOne(".top-left").y(anchorNode.y());
    } else if (this._movingAnchorName === "top-right") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".bottom-left").x(),
          y: this.findOne(".bottom-left").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) + Math.pow(comparePoint.y - anchorNode.y(), 2));
        var reverseX = this.findOne(".top-right").x() < comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".top-right").y() > comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".top-right").x(comparePoint.x + x2);
        this.findOne(".top-right").y(comparePoint.y - y2);
      }
      var pos = anchorNode.position();
      this.findOne(".top-left").y(pos.y);
      this.findOne(".bottom-right").x(pos.x);
    } else if (this._movingAnchorName === "middle-left") {
      this.findOne(".top-left").x(anchorNode.x());
    } else if (this._movingAnchorName === "middle-right") {
      this.findOne(".bottom-right").x(anchorNode.x());
    } else if (this._movingAnchorName === "bottom-left") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".top-right").x(),
          y: this.findOne(".top-right").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(comparePoint.x - anchorNode.x(), 2) + Math.pow(anchorNode.y() - comparePoint.y, 2));
        var reverseX = comparePoint.x < anchorNode.x() ? -1 : 1;
        var reverseY = anchorNode.y() < comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        anchorNode.x(comparePoint.x - x2);
        anchorNode.y(comparePoint.y + y2);
      }
      pos = anchorNode.position();
      this.findOne(".top-left").x(pos.x);
      this.findOne(".bottom-right").y(pos.y);
    } else if (this._movingAnchorName === "bottom-center") {
      this.findOne(".bottom-right").y(anchorNode.y());
    } else if (this._movingAnchorName === "bottom-right") {
      if (keepProportion) {
        var comparePoint = centeredScaling ? {
          x: this.width() / 2,
          y: this.height() / 2
        } : {
          x: this.findOne(".top-left").x(),
          y: this.findOne(".top-left").y()
        };
        newHypotenuse = Math.sqrt(Math.pow(anchorNode.x() - comparePoint.x, 2) + Math.pow(anchorNode.y() - comparePoint.y, 2));
        var reverseX = this.findOne(".bottom-right").x() < comparePoint.x ? -1 : 1;
        var reverseY = this.findOne(".bottom-right").y() < comparePoint.y ? -1 : 1;
        x2 = newHypotenuse * this.cos * reverseX;
        y2 = newHypotenuse * this.sin * reverseY;
        this.findOne(".bottom-right").x(comparePoint.x + x2);
        this.findOne(".bottom-right").y(comparePoint.y + y2);
      }
    } else {
      console.error(new Error("Wrong position argument of selection resizer: " + this._movingAnchorName));
    }
    var centeredScaling = this.centeredScaling() || e2.altKey;
    if (centeredScaling) {
      var topLeft = this.findOne(".top-left");
      var bottomRight = this.findOne(".bottom-right");
      var topOffsetX = topLeft.x();
      var topOffsetY = topLeft.y();
      var bottomOffsetX = this.getWidth() - bottomRight.x();
      var bottomOffsetY = this.getHeight() - bottomRight.y();
      bottomRight.move({
        x: -topOffsetX,
        y: -topOffsetY
      });
      topLeft.move({
        x: bottomOffsetX,
        y: bottomOffsetY
      });
    }
    var absPos = this.findOne(".top-left").getAbsolutePosition();
    x2 = absPos.x;
    y2 = absPos.y;
    var width = this.findOne(".bottom-right").x() - this.findOne(".top-left").x();
    var height = this.findOne(".bottom-right").y() - this.findOne(".top-left").y();
    this._fitNodesInto({
      x: x2,
      y: y2,
      width,
      height,
      rotation: Global_1$1.Konva.getAngle(this.rotation())
    }, e2);
  }
  _handleMouseUp(e2) {
    this._removeEvents(e2);
  }
  getAbsoluteTransform() {
    return this.getTransform();
  }
  _removeEvents(e2) {
    var _a2;
    if (this._transforming) {
      this._transforming = false;
      if (typeof window !== "undefined") {
        window.removeEventListener("mousemove", this._handleMouseMove);
        window.removeEventListener("touchmove", this._handleMouseMove);
        window.removeEventListener("mouseup", this._handleMouseUp, true);
        window.removeEventListener("touchend", this._handleMouseUp, true);
      }
      var node = this.getNode();
      activeTransformersCount--;
      this._fire("transformend", { evt: e2, target: node });
      (_a2 = this.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
      if (node) {
        this._nodes.forEach((target) => {
          var _a3;
          target._fire("transformend", { evt: e2, target });
          (_a3 = target.getLayer()) === null || _a3 === void 0 ? void 0 : _a3.batchDraw();
        });
      }
      this._movingAnchorName = null;
    }
  }
  _fitNodesInto(newAttrs, evt) {
    var oldAttrs = this._getNodeRect();
    const minSize = 1;
    if (Util_1$3.Util._inRange(newAttrs.width, -this.padding() * 2 - minSize, minSize)) {
      this.update();
      return;
    }
    if (Util_1$3.Util._inRange(newAttrs.height, -this.padding() * 2 - minSize, minSize)) {
      this.update();
      return;
    }
    var t2 = new Util_1$3.Transform();
    t2.rotate(Global_1$1.Konva.getAngle(this.rotation()));
    if (this._movingAnchorName && newAttrs.width < 0 && this._movingAnchorName.indexOf("left") >= 0) {
      const offset5 = t2.point({
        x: -this.padding() * 2,
        y: 0
      });
      newAttrs.x += offset5.x;
      newAttrs.y += offset5.y;
      newAttrs.width += this.padding() * 2;
      this._movingAnchorName = this._movingAnchorName.replace("left", "right");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
    } else if (this._movingAnchorName && newAttrs.width < 0 && this._movingAnchorName.indexOf("right") >= 0) {
      const offset5 = t2.point({
        x: this.padding() * 2,
        y: 0
      });
      this._movingAnchorName = this._movingAnchorName.replace("right", "left");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.width += this.padding() * 2;
    }
    if (this._movingAnchorName && newAttrs.height < 0 && this._movingAnchorName.indexOf("top") >= 0) {
      const offset5 = t2.point({
        x: 0,
        y: -this.padding() * 2
      });
      newAttrs.x += offset5.x;
      newAttrs.y += offset5.y;
      this._movingAnchorName = this._movingAnchorName.replace("top", "bottom");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.height += this.padding() * 2;
    } else if (this._movingAnchorName && newAttrs.height < 0 && this._movingAnchorName.indexOf("bottom") >= 0) {
      const offset5 = t2.point({
        x: 0,
        y: this.padding() * 2
      });
      this._movingAnchorName = this._movingAnchorName.replace("bottom", "top");
      this._anchorDragOffset.x -= offset5.x;
      this._anchorDragOffset.y -= offset5.y;
      newAttrs.height += this.padding() * 2;
    }
    if (this.boundBoxFunc()) {
      const bounded = this.boundBoxFunc()(oldAttrs, newAttrs);
      if (bounded) {
        newAttrs = bounded;
      } else {
        Util_1$3.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!");
      }
    }
    const baseSize = 1e7;
    const oldTr = new Util_1$3.Transform();
    oldTr.translate(oldAttrs.x, oldAttrs.y);
    oldTr.rotate(oldAttrs.rotation);
    oldTr.scale(oldAttrs.width / baseSize, oldAttrs.height / baseSize);
    const newTr = new Util_1$3.Transform();
    const newScaleX = newAttrs.width / baseSize;
    const newScaleY = newAttrs.height / baseSize;
    if (this.flipEnabled() === false) {
      newTr.translate(newAttrs.x, newAttrs.y);
      newTr.rotate(newAttrs.rotation);
      newTr.translate(newAttrs.width < 0 ? newAttrs.width : 0, newAttrs.height < 0 ? newAttrs.height : 0);
      newTr.scale(Math.abs(newScaleX), Math.abs(newScaleY));
    } else {
      newTr.translate(newAttrs.x, newAttrs.y);
      newTr.rotate(newAttrs.rotation);
      newTr.scale(newScaleX, newScaleY);
    }
    const delta = newTr.multiply(oldTr.invert());
    this._nodes.forEach((node) => {
      var _a2;
      const parentTransform = node.getParent().getAbsoluteTransform();
      const localTransform = node.getTransform().copy();
      localTransform.translate(node.offsetX(), node.offsetY());
      const newLocalTransform = new Util_1$3.Transform();
      newLocalTransform.multiply(parentTransform.copy().invert()).multiply(delta).multiply(parentTransform).multiply(localTransform);
      const attrs = newLocalTransform.decompose();
      node.setAttrs(attrs);
      (_a2 = node.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
    });
    this.rotation(Util_1$3.Util._getRotation(newAttrs.rotation));
    this._nodes.forEach((node) => {
      this._fire("transform", { evt, target: node });
      node._fire("transform", { evt, target: node });
    });
    this._resetTransformCache();
    this.update();
    this.getLayer().batchDraw();
  }
  forceUpdate() {
    this._resetTransformCache();
    this.update();
  }
  _batchChangeChild(selector, attrs) {
    const anchor = this.findOne(selector);
    anchor.setAttrs(attrs);
  }
  update() {
    var _a2;
    var attrs = this._getNodeRect();
    this.rotation(Util_1$3.Util._getRotation(attrs.rotation));
    var width = attrs.width;
    var height = attrs.height;
    var enabledAnchors = this.enabledAnchors();
    var resizeEnabled = this.resizeEnabled();
    var padding = this.padding();
    var anchorSize = this.anchorSize();
    const anchors = this.find("._anchor");
    anchors.forEach((node) => {
      node.setAttrs({
        width: anchorSize,
        height: anchorSize,
        offsetX: anchorSize / 2,
        offsetY: anchorSize / 2,
        stroke: this.anchorStroke(),
        strokeWidth: this.anchorStrokeWidth(),
        fill: this.anchorFill(),
        cornerRadius: this.anchorCornerRadius()
      });
    });
    this._batchChangeChild(".top-left", {
      x: 0,
      y: 0,
      offsetX: anchorSize / 2 + padding,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-left") >= 0
    });
    this._batchChangeChild(".top-center", {
      x: width / 2,
      y: 0,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-center") >= 0
    });
    this._batchChangeChild(".top-right", {
      x: width,
      y: 0,
      offsetX: anchorSize / 2 - padding,
      offsetY: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("top-right") >= 0
    });
    this._batchChangeChild(".middle-left", {
      x: 0,
      y: height / 2,
      offsetX: anchorSize / 2 + padding,
      visible: resizeEnabled && enabledAnchors.indexOf("middle-left") >= 0
    });
    this._batchChangeChild(".middle-right", {
      x: width,
      y: height / 2,
      offsetX: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("middle-right") >= 0
    });
    this._batchChangeChild(".bottom-left", {
      x: 0,
      y: height,
      offsetX: anchorSize / 2 + padding,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-left") >= 0
    });
    this._batchChangeChild(".bottom-center", {
      x: width / 2,
      y: height,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-center") >= 0
    });
    this._batchChangeChild(".bottom-right", {
      x: width,
      y: height,
      offsetX: anchorSize / 2 - padding,
      offsetY: anchorSize / 2 - padding,
      visible: resizeEnabled && enabledAnchors.indexOf("bottom-right") >= 0
    });
    this._batchChangeChild(".rotater", {
      x: width / 2,
      y: -this.rotateAnchorOffset() * Util_1$3.Util._sign(height) - padding,
      visible: this.rotateEnabled()
    });
    this._batchChangeChild(".back", {
      width,
      height,
      visible: this.borderEnabled(),
      stroke: this.borderStroke(),
      strokeWidth: this.borderStrokeWidth(),
      dash: this.borderDash(),
      x: 0,
      y: 0
    });
    const styleFunc = this.anchorStyleFunc();
    if (styleFunc) {
      anchors.forEach((node) => {
        styleFunc(node);
      });
    }
    (_a2 = this.getLayer()) === null || _a2 === void 0 ? void 0 : _a2.batchDraw();
  }
  isTransforming() {
    return this._transforming;
  }
  stopTransform() {
    if (this._transforming) {
      this._removeEvents();
      var anchorNode = this.findOne("." + this._movingAnchorName);
      if (anchorNode) {
        anchorNode.stopDrag();
      }
    }
  }
  destroy() {
    if (this.getStage() && this._cursorChange) {
      this.getStage().content && (this.getStage().content.style.cursor = "");
    }
    Group_1.Group.prototype.destroy.call(this);
    this.detach();
    this._removeEvents();
    return this;
  }
  toObject() {
    return Node_1$f.Node.prototype.toObject.call(this);
  }
  clone(obj) {
    var node = Node_1$f.Node.prototype.clone.call(this, obj);
    return node;
  }
  getClientRect() {
    if (this.nodes().length > 0) {
      return super.getClientRect();
    } else {
      return { x: 0, y: 0, width: 0, height: 0 };
    }
  }
}
Transformer$1.Transformer = Transformer2;
Transformer2.isTransforming = () => {
  return activeTransformersCount > 0;
};
function validateAnchors(val) {
  if (!(val instanceof Array)) {
    Util_1$3.Util.warn("enabledAnchors value should be an array");
  }
  if (val instanceof Array) {
    val.forEach(function(name) {
      if (ANCHORS_NAMES.indexOf(name) === -1) {
        Util_1$3.Util.warn("Unknown anchor name: " + name + ". Available names are: " + ANCHORS_NAMES.join(", "));
      }
    });
  }
  return val || [];
}
Transformer2.prototype.className = "Transformer";
(0, Global_2$1._registerNode)(Transformer2);
Factory_1$g.Factory.addGetterSetter(Transformer2, "enabledAnchors", ANCHORS_NAMES, validateAnchors);
Factory_1$g.Factory.addGetterSetter(Transformer2, "flipEnabled", true, (0, Validators_1$g.getBooleanValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "resizeEnabled", true);
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorSize", 10, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotateEnabled", true);
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotateLineVisible", true);
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotationSnaps", []);
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotateAnchorOffset", 50, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotateAnchorCursor", "crosshair");
Factory_1$g.Factory.addGetterSetter(Transformer2, "rotationSnapTolerance", 5, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "borderEnabled", true);
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorStroke", "rgb(0, 161, 255)");
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorStrokeWidth", 1, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorFill", "white");
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorCornerRadius", 0, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "borderStroke", "rgb(0, 161, 255)");
Factory_1$g.Factory.addGetterSetter(Transformer2, "borderStrokeWidth", 1, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "borderDash");
Factory_1$g.Factory.addGetterSetter(Transformer2, "keepRatio", true);
Factory_1$g.Factory.addGetterSetter(Transformer2, "shiftBehavior", "default");
Factory_1$g.Factory.addGetterSetter(Transformer2, "centeredScaling", false);
Factory_1$g.Factory.addGetterSetter(Transformer2, "ignoreStroke", false);
Factory_1$g.Factory.addGetterSetter(Transformer2, "padding", 0, (0, Validators_1$g.getNumberValidator)());
Factory_1$g.Factory.addGetterSetter(Transformer2, "node");
Factory_1$g.Factory.addGetterSetter(Transformer2, "nodes");
Factory_1$g.Factory.addGetterSetter(Transformer2, "boundBoxFunc");
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorDragBoundFunc");
Factory_1$g.Factory.addGetterSetter(Transformer2, "anchorStyleFunc");
Factory_1$g.Factory.addGetterSetter(Transformer2, "shouldOverdrawWholeArea", false);
Factory_1$g.Factory.addGetterSetter(Transformer2, "useSingleNodeRotation", true);
Factory_1$g.Factory.backCompat(Transformer2, {
  lineEnabled: "borderEnabled",
  rotateHandlerOffset: "rotateAnchorOffset",
  enabledHandlers: "enabledAnchors"
});
var Wedge$1 = {};
Object.defineProperty(Wedge$1, "__esModule", { value: true });
Wedge$1.Wedge = void 0;
const Factory_1$f = Factory;
const Shape_1 = Shape;
const Global_1 = Global;
const Validators_1$f = Validators;
const Global_2 = Global;
class Wedge2 extends Shape_1.Shape {
  _sceneFunc(context) {
    context.beginPath();
    context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());
    context.lineTo(0, 0);
    context.closePath();
    context.fillStrokeShape(this);
  }
  getWidth() {
    return this.radius() * 2;
  }
  getHeight() {
    return this.radius() * 2;
  }
  setWidth(width) {
    this.radius(width / 2);
  }
  setHeight(height) {
    this.radius(height / 2);
  }
}
Wedge$1.Wedge = Wedge2;
Wedge2.prototype.className = "Wedge";
Wedge2.prototype._centroid = true;
Wedge2.prototype._attrsAffectingSize = ["radius"];
(0, Global_2._registerNode)(Wedge2);
Factory_1$f.Factory.addGetterSetter(Wedge2, "radius", 0, (0, Validators_1$f.getNumberValidator)());
Factory_1$f.Factory.addGetterSetter(Wedge2, "angle", 0, (0, Validators_1$f.getNumberValidator)());
Factory_1$f.Factory.addGetterSetter(Wedge2, "clockwise", false);
Factory_1$f.Factory.backCompat(Wedge2, {
  angleDeg: "angle",
  getAngleDeg: "getAngle",
  setAngleDeg: "setAngle"
});
var Blur$3 = {};
Object.defineProperty(Blur$3, "__esModule", { value: true });
Blur$3.Blur = void 0;
const Factory_1$e = Factory;
const Node_1$e = Node$1;
const Validators_1$e = Validators;
function BlurStack() {
  this.r = 0;
  this.g = 0;
  this.b = 0;
  this.a = 0;
  this.next = null;
}
var mul_table = [
  512,
  512,
  456,
  512,
  328,
  456,
  335,
  512,
  405,
  328,
  271,
  456,
  388,
  335,
  292,
  512,
  454,
  405,
  364,
  328,
  298,
  271,
  496,
  456,
  420,
  388,
  360,
  335,
  312,
  292,
  273,
  512,
  482,
  454,
  428,
  405,
  383,
  364,
  345,
  328,
  312,
  298,
  284,
  271,
  259,
  496,
  475,
  456,
  437,
  420,
  404,
  388,
  374,
  360,
  347,
  335,
  323,
  312,
  302,
  292,
  282,
  273,
  265,
  512,
  497,
  482,
  468,
  454,
  441,
  428,
  417,
  405,
  394,
  383,
  373,
  364,
  354,
  345,
  337,
  328,
  320,
  312,
  305,
  298,
  291,
  284,
  278,
  271,
  265,
  259,
  507,
  496,
  485,
  475,
  465,
  456,
  446,
  437,
  428,
  420,
  412,
  404,
  396,
  388,
  381,
  374,
  367,
  360,
  354,
  347,
  341,
  335,
  329,
  323,
  318,
  312,
  307,
  302,
  297,
  292,
  287,
  282,
  278,
  273,
  269,
  265,
  261,
  512,
  505,
  497,
  489,
  482,
  475,
  468,
  461,
  454,
  447,
  441,
  435,
  428,
  422,
  417,
  411,
  405,
  399,
  394,
  389,
  383,
  378,
  373,
  368,
  364,
  359,
  354,
  350,
  345,
  341,
  337,
  332,
  328,
  324,
  320,
  316,
  312,
  309,
  305,
  301,
  298,
  294,
  291,
  287,
  284,
  281,
  278,
  274,
  271,
  268,
  265,
  262,
  259,
  257,
  507,
  501,
  496,
  491,
  485,
  480,
  475,
  470,
  465,
  460,
  456,
  451,
  446,
  442,
  437,
  433,
  428,
  424,
  420,
  416,
  412,
  408,
  404,
  400,
  396,
  392,
  388,
  385,
  381,
  377,
  374,
  370,
  367,
  363,
  360,
  357,
  354,
  350,
  347,
  344,
  341,
  338,
  335,
  332,
  329,
  326,
  323,
  320,
  318,
  315,
  312,
  310,
  307,
  304,
  302,
  299,
  297,
  294,
  292,
  289,
  287,
  285,
  282,
  280,
  278,
  275,
  273,
  271,
  269,
  267,
  265,
  263,
  261,
  259
];
var shg_table = [
  9,
  11,
  12,
  13,
  13,
  14,
  14,
  15,
  15,
  15,
  15,
  16,
  16,
  16,
  16,
  17,
  17,
  17,
  17,
  17,
  17,
  17,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  18,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  19,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  20,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  21,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  22,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  23,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24,
  24
];
function filterGaussBlurRGBA(imageData, radius) {
  var pixels = imageData.data, width = imageData.width, height = imageData.height;
  var x2, y2, i, p2, yp, yi2, yw, r_sum, g_sum, b_sum, a_sum, r_out_sum, g_out_sum, b_out_sum, a_out_sum, r_in_sum, g_in_sum, b_in_sum, a_in_sum, pr, pg2, pb2, pa2, rbs;
  var div = radius + radius + 1, widthMinus1 = width - 1, heightMinus1 = height - 1, radiusPlus1 = radius + 1, sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2, stackStart = new BlurStack(), stackEnd = null, stack = stackStart, stackIn = null, stackOut = null, mul_sum = mul_table[radius], shg_sum = shg_table[radius];
  for (i = 1; i < div; i++) {
    stack = stack.next = new BlurStack();
    if (i === radiusPlus1) {
      stackEnd = stack;
    }
  }
  stack.next = stackStart;
  yw = yi2 = 0;
  for (y2 = 0; y2 < height; y2++) {
    r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0;
    r_out_sum = radiusPlus1 * (pr = pixels[yi2]);
    g_out_sum = radiusPlus1 * (pg2 = pixels[yi2 + 1]);
    b_out_sum = radiusPlus1 * (pb2 = pixels[yi2 + 2]);
    a_out_sum = radiusPlus1 * (pa2 = pixels[yi2 + 3]);
    r_sum += sumFactor * pr;
    g_sum += sumFactor * pg2;
    b_sum += sumFactor * pb2;
    a_sum += sumFactor * pa2;
    stack = stackStart;
    for (i = 0; i < radiusPlus1; i++) {
      stack.r = pr;
      stack.g = pg2;
      stack.b = pb2;
      stack.a = pa2;
      stack = stack.next;
    }
    for (i = 1; i < radiusPlus1; i++) {
      p2 = yi2 + ((widthMinus1 < i ? widthMinus1 : i) << 2);
      r_sum += (stack.r = pr = pixels[p2]) * (rbs = radiusPlus1 - i);
      g_sum += (stack.g = pg2 = pixels[p2 + 1]) * rbs;
      b_sum += (stack.b = pb2 = pixels[p2 + 2]) * rbs;
      a_sum += (stack.a = pa2 = pixels[p2 + 3]) * rbs;
      r_in_sum += pr;
      g_in_sum += pg2;
      b_in_sum += pb2;
      a_in_sum += pa2;
      stack = stack.next;
    }
    stackIn = stackStart;
    stackOut = stackEnd;
    for (x2 = 0; x2 < width; x2++) {
      pixels[yi2 + 3] = pa2 = a_sum * mul_sum >> shg_sum;
      if (pa2 !== 0) {
        pa2 = 255 / pa2;
        pixels[yi2] = (r_sum * mul_sum >> shg_sum) * pa2;
        pixels[yi2 + 1] = (g_sum * mul_sum >> shg_sum) * pa2;
        pixels[yi2 + 2] = (b_sum * mul_sum >> shg_sum) * pa2;
      } else {
        pixels[yi2] = pixels[yi2 + 1] = pixels[yi2 + 2] = 0;
      }
      r_sum -= r_out_sum;
      g_sum -= g_out_sum;
      b_sum -= b_out_sum;
      a_sum -= a_out_sum;
      r_out_sum -= stackIn.r;
      g_out_sum -= stackIn.g;
      b_out_sum -= stackIn.b;
      a_out_sum -= stackIn.a;
      p2 = yw + ((p2 = x2 + radius + 1) < widthMinus1 ? p2 : widthMinus1) << 2;
      r_in_sum += stackIn.r = pixels[p2];
      g_in_sum += stackIn.g = pixels[p2 + 1];
      b_in_sum += stackIn.b = pixels[p2 + 2];
      a_in_sum += stackIn.a = pixels[p2 + 3];
      r_sum += r_in_sum;
      g_sum += g_in_sum;
      b_sum += b_in_sum;
      a_sum += a_in_sum;
      stackIn = stackIn.next;
      r_out_sum += pr = stackOut.r;
      g_out_sum += pg2 = stackOut.g;
      b_out_sum += pb2 = stackOut.b;
      a_out_sum += pa2 = stackOut.a;
      r_in_sum -= pr;
      g_in_sum -= pg2;
      b_in_sum -= pb2;
      a_in_sum -= pa2;
      stackOut = stackOut.next;
      yi2 += 4;
    }
    yw += width;
  }
  for (x2 = 0; x2 < width; x2++) {
    g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0;
    yi2 = x2 << 2;
    r_out_sum = radiusPlus1 * (pr = pixels[yi2]);
    g_out_sum = radiusPlus1 * (pg2 = pixels[yi2 + 1]);
    b_out_sum = radiusPlus1 * (pb2 = pixels[yi2 + 2]);
    a_out_sum = radiusPlus1 * (pa2 = pixels[yi2 + 3]);
    r_sum += sumFactor * pr;
    g_sum += sumFactor * pg2;
    b_sum += sumFactor * pb2;
    a_sum += sumFactor * pa2;
    stack = stackStart;
    for (i = 0; i < radiusPlus1; i++) {
      stack.r = pr;
      stack.g = pg2;
      stack.b = pb2;
      stack.a = pa2;
      stack = stack.next;
    }
    yp = width;
    for (i = 1; i <= radius; i++) {
      yi2 = yp + x2 << 2;
      r_sum += (stack.r = pr = pixels[yi2]) * (rbs = radiusPlus1 - i);
      g_sum += (stack.g = pg2 = pixels[yi2 + 1]) * rbs;
      b_sum += (stack.b = pb2 = pixels[yi2 + 2]) * rbs;
      a_sum += (stack.a = pa2 = pixels[yi2 + 3]) * rbs;
      r_in_sum += pr;
      g_in_sum += pg2;
      b_in_sum += pb2;
      a_in_sum += pa2;
      stack = stack.next;
      if (i < heightMinus1) {
        yp += width;
      }
    }
    yi2 = x2;
    stackIn = stackStart;
    stackOut = stackEnd;
    for (y2 = 0; y2 < height; y2++) {
      p2 = yi2 << 2;
      pixels[p2 + 3] = pa2 = a_sum * mul_sum >> shg_sum;
      if (pa2 > 0) {
        pa2 = 255 / pa2;
        pixels[p2] = (r_sum * mul_sum >> shg_sum) * pa2;
        pixels[p2 + 1] = (g_sum * mul_sum >> shg_sum) * pa2;
        pixels[p2 + 2] = (b_sum * mul_sum >> shg_sum) * pa2;
      } else {
        pixels[p2] = pixels[p2 + 1] = pixels[p2 + 2] = 0;
      }
      r_sum -= r_out_sum;
      g_sum -= g_out_sum;
      b_sum -= b_out_sum;
      a_sum -= a_out_sum;
      r_out_sum -= stackIn.r;
      g_out_sum -= stackIn.g;
      b_out_sum -= stackIn.b;
      a_out_sum -= stackIn.a;
      p2 = x2 + ((p2 = y2 + radiusPlus1) < heightMinus1 ? p2 : heightMinus1) * width << 2;
      r_sum += r_in_sum += stackIn.r = pixels[p2];
      g_sum += g_in_sum += stackIn.g = pixels[p2 + 1];
      b_sum += b_in_sum += stackIn.b = pixels[p2 + 2];
      a_sum += a_in_sum += stackIn.a = pixels[p2 + 3];
      stackIn = stackIn.next;
      r_out_sum += pr = stackOut.r;
      g_out_sum += pg2 = stackOut.g;
      b_out_sum += pb2 = stackOut.b;
      a_out_sum += pa2 = stackOut.a;
      r_in_sum -= pr;
      g_in_sum -= pg2;
      b_in_sum -= pb2;
      a_in_sum -= pa2;
      stackOut = stackOut.next;
      yi2 += width;
    }
  }
}
const Blur$2 = function Blur2(imageData) {
  var radius = Math.round(this.blurRadius());
  if (radius > 0) {
    filterGaussBlurRGBA(imageData, radius);
  }
};
Blur$3.Blur = Blur$2;
Factory_1$e.Factory.addGetterSetter(Node_1$e.Node, "blurRadius", 0, (0, Validators_1$e.getNumberValidator)(), Factory_1$e.Factory.afterSetFilter);
var Brighten$1 = {};
Object.defineProperty(Brighten$1, "__esModule", { value: true });
Brighten$1.Brighten = void 0;
const Factory_1$d = Factory;
const Node_1$d = Node$1;
const Validators_1$d = Validators;
const Brighten = function(imageData) {
  var brightness2 = this.brightness() * 255, data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 4) {
    data[i] += brightness2;
    data[i + 1] += brightness2;
    data[i + 2] += brightness2;
  }
};
Brighten$1.Brighten = Brighten;
Factory_1$d.Factory.addGetterSetter(Node_1$d.Node, "brightness", 0, (0, Validators_1$d.getNumberValidator)(), Factory_1$d.Factory.afterSetFilter);
var Contrast$3 = {};
Object.defineProperty(Contrast$3, "__esModule", { value: true });
Contrast$3.Contrast = void 0;
const Factory_1$c = Factory;
const Node_1$c = Node$1;
const Validators_1$c = Validators;
const Contrast$2 = function(imageData) {
  var adjust = Math.pow((this.contrast() + 100) / 100, 2);
  var data = imageData.data, nPixels = data.length, red = 150, green = 150, blue = 150, i;
  for (i = 0; i < nPixels; i += 4) {
    red = data[i];
    green = data[i + 1];
    blue = data[i + 2];
    red /= 255;
    red -= 0.5;
    red *= adjust;
    red += 0.5;
    red *= 255;
    green /= 255;
    green -= 0.5;
    green *= adjust;
    green += 0.5;
    green *= 255;
    blue /= 255;
    blue -= 0.5;
    blue *= adjust;
    blue += 0.5;
    blue *= 255;
    red = red < 0 ? 0 : red > 255 ? 255 : red;
    green = green < 0 ? 0 : green > 255 ? 255 : green;
    blue = blue < 0 ? 0 : blue > 255 ? 255 : blue;
    data[i] = red;
    data[i + 1] = green;
    data[i + 2] = blue;
  }
};
Contrast$3.Contrast = Contrast$2;
Factory_1$c.Factory.addGetterSetter(Node_1$c.Node, "contrast", 0, (0, Validators_1$c.getNumberValidator)(), Factory_1$c.Factory.afterSetFilter);
var Emboss$1 = {};
Object.defineProperty(Emboss$1, "__esModule", { value: true });
Emboss$1.Emboss = void 0;
const Factory_1$b = Factory;
const Node_1$b = Node$1;
const Util_1$2 = Util;
const Validators_1$b = Validators;
const Emboss = function(imageData) {
  var strength = this.embossStrength() * 10, greyLevel = this.embossWhiteLevel() * 255, direction = this.embossDirection(), blend = this.embossBlend(), dirY = 0, dirX = 0, data = imageData.data, w2 = imageData.width, h2 = imageData.height, w4 = w2 * 4, y2 = h2;
  switch (direction) {
    case "top-left":
      dirY = -1;
      dirX = -1;
      break;
    case "top":
      dirY = -1;
      dirX = 0;
      break;
    case "top-right":
      dirY = -1;
      dirX = 1;
      break;
    case "right":
      dirY = 0;
      dirX = 1;
      break;
    case "bottom-right":
      dirY = 1;
      dirX = 1;
      break;
    case "bottom":
      dirY = 1;
      dirX = 0;
      break;
    case "bottom-left":
      dirY = 1;
      dirX = -1;
      break;
    case "left":
      dirY = 0;
      dirX = -1;
      break;
    default:
      Util_1$2.Util.error("Unknown emboss direction: " + direction);
  }
  do {
    var offsetY = (y2 - 1) * w4;
    var otherY = dirY;
    if (y2 + otherY < 1) {
      otherY = 0;
    }
    if (y2 + otherY > h2) {
      otherY = 0;
    }
    var offsetYOther = (y2 - 1 + otherY) * w2 * 4;
    var x2 = w2;
    do {
      var offset5 = offsetY + (x2 - 1) * 4;
      var otherX = dirX;
      if (x2 + otherX < 1) {
        otherX = 0;
      }
      if (x2 + otherX > w2) {
        otherX = 0;
      }
      var offsetOther = offsetYOther + (x2 - 1 + otherX) * 4;
      var dR = data[offset5] - data[offsetOther];
      var dG = data[offset5 + 1] - data[offsetOther + 1];
      var dB = data[offset5 + 2] - data[offsetOther + 2];
      var dif = dR;
      var absDif = dif > 0 ? dif : -dif;
      var absG = dG > 0 ? dG : -dG;
      var absB = dB > 0 ? dB : -dB;
      if (absG > absDif) {
        dif = dG;
      }
      if (absB > absDif) {
        dif = dB;
      }
      dif *= strength;
      if (blend) {
        var r2 = data[offset5] + dif;
        var g2 = data[offset5 + 1] + dif;
        var b2 = data[offset5 + 2] + dif;
        data[offset5] = r2 > 255 ? 255 : r2 < 0 ? 0 : r2;
        data[offset5 + 1] = g2 > 255 ? 255 : g2 < 0 ? 0 : g2;
        data[offset5 + 2] = b2 > 255 ? 255 : b2 < 0 ? 0 : b2;
      } else {
        var grey = greyLevel - dif;
        if (grey < 0) {
          grey = 0;
        } else if (grey > 255) {
          grey = 255;
        }
        data[offset5] = data[offset5 + 1] = data[offset5 + 2] = grey;
      }
    } while (--x2);
  } while (--y2);
};
Emboss$1.Emboss = Emboss;
Factory_1$b.Factory.addGetterSetter(Node_1$b.Node, "embossStrength", 0.5, (0, Validators_1$b.getNumberValidator)(), Factory_1$b.Factory.afterSetFilter);
Factory_1$b.Factory.addGetterSetter(Node_1$b.Node, "embossWhiteLevel", 0.5, (0, Validators_1$b.getNumberValidator)(), Factory_1$b.Factory.afterSetFilter);
Factory_1$b.Factory.addGetterSetter(Node_1$b.Node, "embossDirection", "top-left", null, Factory_1$b.Factory.afterSetFilter);
Factory_1$b.Factory.addGetterSetter(Node_1$b.Node, "embossBlend", false, null, Factory_1$b.Factory.afterSetFilter);
var Enhance$1 = {};
Object.defineProperty(Enhance$1, "__esModule", { value: true });
Enhance$1.Enhance = void 0;
const Factory_1$a = Factory;
const Node_1$a = Node$1;
const Validators_1$a = Validators;
function remap(fromValue, fromMin, fromMax, toMin, toMax) {
  var fromRange = fromMax - fromMin, toRange = toMax - toMin, toValue;
  if (fromRange === 0) {
    return toMin + toRange / 2;
  }
  if (toRange === 0) {
    return toMin;
  }
  toValue = (fromValue - fromMin) / fromRange;
  toValue = toRange * toValue + toMin;
  return toValue;
}
const Enhance = function(imageData) {
  var data = imageData.data, nSubPixels = data.length, rMin = data[0], rMax = rMin, r2, gMin = data[1], gMax = gMin, g2, bMin = data[2], bMax = bMin, b2, i;
  var enhanceAmount = this.enhance();
  if (enhanceAmount === 0) {
    return;
  }
  for (i = 0; i < nSubPixels; i += 4) {
    r2 = data[i + 0];
    if (r2 < rMin) {
      rMin = r2;
    } else if (r2 > rMax) {
      rMax = r2;
    }
    g2 = data[i + 1];
    if (g2 < gMin) {
      gMin = g2;
    } else if (g2 > gMax) {
      gMax = g2;
    }
    b2 = data[i + 2];
    if (b2 < bMin) {
      bMin = b2;
    } else if (b2 > bMax) {
      bMax = b2;
    }
  }
  if (rMax === rMin) {
    rMax = 255;
    rMin = 0;
  }
  if (gMax === gMin) {
    gMax = 255;
    gMin = 0;
  }
  if (bMax === bMin) {
    bMax = 255;
    bMin = 0;
  }
  var rMid, rGoalMax, rGoalMin, gMid, gGoalMax, gGoalMin, bMid, bGoalMax, bGoalMin;
  if (enhanceAmount > 0) {
    rGoalMax = rMax + enhanceAmount * (255 - rMax);
    rGoalMin = rMin - enhanceAmount * (rMin - 0);
    gGoalMax = gMax + enhanceAmount * (255 - gMax);
    gGoalMin = gMin - enhanceAmount * (gMin - 0);
    bGoalMax = bMax + enhanceAmount * (255 - bMax);
    bGoalMin = bMin - enhanceAmount * (bMin - 0);
  } else {
    rMid = (rMax + rMin) * 0.5;
    rGoalMax = rMax + enhanceAmount * (rMax - rMid);
    rGoalMin = rMin + enhanceAmount * (rMin - rMid);
    gMid = (gMax + gMin) * 0.5;
    gGoalMax = gMax + enhanceAmount * (gMax - gMid);
    gGoalMin = gMin + enhanceAmount * (gMin - gMid);
    bMid = (bMax + bMin) * 0.5;
    bGoalMax = bMax + enhanceAmount * (bMax - bMid);
    bGoalMin = bMin + enhanceAmount * (bMin - bMid);
  }
  for (i = 0; i < nSubPixels; i += 4) {
    data[i + 0] = remap(data[i + 0], rMin, rMax, rGoalMin, rGoalMax);
    data[i + 1] = remap(data[i + 1], gMin, gMax, gGoalMin, gGoalMax);
    data[i + 2] = remap(data[i + 2], bMin, bMax, bGoalMin, bGoalMax);
  }
};
Enhance$1.Enhance = Enhance;
Factory_1$a.Factory.addGetterSetter(Node_1$a.Node, "enhance", 0, (0, Validators_1$a.getNumberValidator)(), Factory_1$a.Factory.afterSetFilter);
var Grayscale$1 = {};
Object.defineProperty(Grayscale$1, "__esModule", { value: true });
Grayscale$1.Grayscale = void 0;
const Grayscale = function(imageData) {
  var data = imageData.data, len = data.length, i, brightness2;
  for (i = 0; i < len; i += 4) {
    brightness2 = 0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2];
    data[i] = brightness2;
    data[i + 1] = brightness2;
    data[i + 2] = brightness2;
  }
};
Grayscale$1.Grayscale = Grayscale;
var HSL$1 = {};
Object.defineProperty(HSL$1, "__esModule", { value: true });
HSL$1.HSL = void 0;
const Factory_1$9 = Factory;
const Node_1$9 = Node$1;
const Validators_1$9 = Validators;
Factory_1$9.Factory.addGetterSetter(Node_1$9.Node, "hue", 0, (0, Validators_1$9.getNumberValidator)(), Factory_1$9.Factory.afterSetFilter);
Factory_1$9.Factory.addGetterSetter(Node_1$9.Node, "saturation", 0, (0, Validators_1$9.getNumberValidator)(), Factory_1$9.Factory.afterSetFilter);
Factory_1$9.Factory.addGetterSetter(Node_1$9.Node, "luminance", 0, (0, Validators_1$9.getNumberValidator)(), Factory_1$9.Factory.afterSetFilter);
const HSL = function(imageData) {
  var data = imageData.data, nPixels = data.length, v2 = 1, s = Math.pow(2, this.saturation()), h2 = Math.abs(this.hue() + 360) % 360, l2 = this.luminance() * 127, i;
  var vsu = v2 * s * Math.cos(h2 * Math.PI / 180), vsw = v2 * s * Math.sin(h2 * Math.PI / 180);
  var rr = 0.299 * v2 + 0.701 * vsu + 0.167 * vsw, rg2 = 0.587 * v2 - 0.587 * vsu + 0.33 * vsw, rb2 = 0.114 * v2 - 0.114 * vsu - 0.497 * vsw;
  var gr = 0.299 * v2 - 0.299 * vsu - 0.328 * vsw, gg2 = 0.587 * v2 + 0.413 * vsu + 0.035 * vsw, gb2 = 0.114 * v2 - 0.114 * vsu + 0.293 * vsw;
  var br = 0.299 * v2 - 0.3 * vsu + 1.25 * vsw, bg2 = 0.587 * v2 - 0.586 * vsu - 1.05 * vsw, bb2 = 0.114 * v2 + 0.886 * vsu - 0.2 * vsw;
  var r2, g2, b2, a;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    a = data[i + 3];
    data[i + 0] = rr * r2 + rg2 * g2 + rb2 * b2 + l2;
    data[i + 1] = gr * r2 + gg2 * g2 + gb2 * b2 + l2;
    data[i + 2] = br * r2 + bg2 * g2 + bb2 * b2 + l2;
    data[i + 3] = a;
  }
};
HSL$1.HSL = HSL;
var HSV$2 = {};
Object.defineProperty(HSV$2, "__esModule", { value: true });
HSV$2.HSV = void 0;
const Factory_1$8 = Factory;
const Node_1$8 = Node$1;
const Validators_1$8 = Validators;
const HSV$1 = function(imageData) {
  var data = imageData.data, nPixels = data.length, v2 = Math.pow(2, this.value()), s = Math.pow(2, this.saturation()), h2 = Math.abs(this.hue() + 360) % 360, i;
  var vsu = v2 * s * Math.cos(h2 * Math.PI / 180), vsw = v2 * s * Math.sin(h2 * Math.PI / 180);
  var rr = 0.299 * v2 + 0.701 * vsu + 0.167 * vsw, rg2 = 0.587 * v2 - 0.587 * vsu + 0.33 * vsw, rb2 = 0.114 * v2 - 0.114 * vsu - 0.497 * vsw;
  var gr = 0.299 * v2 - 0.299 * vsu - 0.328 * vsw, gg2 = 0.587 * v2 + 0.413 * vsu + 0.035 * vsw, gb2 = 0.114 * v2 - 0.114 * vsu + 0.293 * vsw;
  var br = 0.299 * v2 - 0.3 * vsu + 1.25 * vsw, bg2 = 0.587 * v2 - 0.586 * vsu - 1.05 * vsw, bb2 = 0.114 * v2 + 0.886 * vsu - 0.2 * vsw;
  var r2, g2, b2, a;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    a = data[i + 3];
    data[i + 0] = rr * r2 + rg2 * g2 + rb2 * b2;
    data[i + 1] = gr * r2 + gg2 * g2 + gb2 * b2;
    data[i + 2] = br * r2 + bg2 * g2 + bb2 * b2;
    data[i + 3] = a;
  }
};
HSV$2.HSV = HSV$1;
Factory_1$8.Factory.addGetterSetter(Node_1$8.Node, "hue", 0, (0, Validators_1$8.getNumberValidator)(), Factory_1$8.Factory.afterSetFilter);
Factory_1$8.Factory.addGetterSetter(Node_1$8.Node, "saturation", 0, (0, Validators_1$8.getNumberValidator)(), Factory_1$8.Factory.afterSetFilter);
Factory_1$8.Factory.addGetterSetter(Node_1$8.Node, "value", 0, (0, Validators_1$8.getNumberValidator)(), Factory_1$8.Factory.afterSetFilter);
var Invert$1 = {};
Object.defineProperty(Invert$1, "__esModule", { value: true });
Invert$1.Invert = void 0;
const Invert = function(imageData) {
  var data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 4) {
    data[i] = 255 - data[i];
    data[i + 1] = 255 - data[i + 1];
    data[i + 2] = 255 - data[i + 2];
  }
};
Invert$1.Invert = Invert;
var Kaleidoscope$1 = {};
Object.defineProperty(Kaleidoscope$1, "__esModule", { value: true });
Kaleidoscope$1.Kaleidoscope = void 0;
const Factory_1$7 = Factory;
const Node_1$7 = Node$1;
const Util_1$1 = Util;
const Validators_1$7 = Validators;
var ToPolar = function(src, dst, opt) {
  var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x2, y2, r2 = 0, g2 = 0, b2 = 0, a = 0;
  var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
  x2 = xSize - xMid;
  y2 = ySize - yMid;
  rad = Math.sqrt(x2 * x2 + y2 * y2);
  rMax = rad > rMax ? rad : rMax;
  var rSize = ySize, tSize = xSize, radius, theta;
  var conversion = 360 / tSize * Math.PI / 180, sin, cos;
  for (theta = 0; theta < tSize; theta += 1) {
    sin = Math.sin(theta * conversion);
    cos = Math.cos(theta * conversion);
    for (radius = 0; radius < rSize; radius += 1) {
      x2 = Math.floor(xMid + rMax * radius / rSize * cos);
      y2 = Math.floor(yMid + rMax * radius / rSize * sin);
      i = (y2 * xSize + x2) * 4;
      r2 = srcPixels[i + 0];
      g2 = srcPixels[i + 1];
      b2 = srcPixels[i + 2];
      a = srcPixels[i + 3];
      i = (theta + radius * xSize) * 4;
      dstPixels[i + 0] = r2;
      dstPixels[i + 1] = g2;
      dstPixels[i + 2] = b2;
      dstPixels[i + 3] = a;
    }
  }
};
var FromPolar = function(src, dst, opt) {
  var srcPixels = src.data, dstPixels = dst.data, xSize = src.width, ySize = src.height, xMid = opt.polarCenterX || xSize / 2, yMid = opt.polarCenterY || ySize / 2, i, x2, y2, dx, dy, r2 = 0, g2 = 0, b2 = 0, a = 0;
  var rad, rMax = Math.sqrt(xMid * xMid + yMid * yMid);
  x2 = xSize - xMid;
  y2 = ySize - yMid;
  rad = Math.sqrt(x2 * x2 + y2 * y2);
  rMax = rad > rMax ? rad : rMax;
  var rSize = ySize, tSize = xSize, radius, theta, phaseShift = 0;
  var x1, y1;
  for (x2 = 0; x2 < xSize; x2 += 1) {
    for (y2 = 0; y2 < ySize; y2 += 1) {
      dx = x2 - xMid;
      dy = y2 - yMid;
      radius = Math.sqrt(dx * dx + dy * dy) * rSize / rMax;
      theta = (Math.atan2(dy, dx) * 180 / Math.PI + 360 + phaseShift) % 360;
      theta = theta * tSize / 360;
      x1 = Math.floor(theta);
      y1 = Math.floor(radius);
      i = (y1 * xSize + x1) * 4;
      r2 = srcPixels[i + 0];
      g2 = srcPixels[i + 1];
      b2 = srcPixels[i + 2];
      a = srcPixels[i + 3];
      i = (y2 * xSize + x2) * 4;
      dstPixels[i + 0] = r2;
      dstPixels[i + 1] = g2;
      dstPixels[i + 2] = b2;
      dstPixels[i + 3] = a;
    }
  }
};
const Kaleidoscope = function(imageData) {
  var xSize = imageData.width, ySize = imageData.height;
  var x2, y2, xoff, i, r2, g2, b2, a, srcPos, dstPos;
  var power = Math.round(this.kaleidoscopePower());
  var angle = Math.round(this.kaleidoscopeAngle());
  var offset5 = Math.floor(xSize * (angle % 360) / 360);
  if (power < 1) {
    return;
  }
  var tempCanvas = Util_1$1.Util.createCanvasElement();
  tempCanvas.width = xSize;
  tempCanvas.height = ySize;
  var scratchData = tempCanvas.getContext("2d").getImageData(0, 0, xSize, ySize);
  Util_1$1.Util.releaseCanvas(tempCanvas);
  ToPolar(imageData, scratchData, {
    polarCenterX: xSize / 2,
    polarCenterY: ySize / 2
  });
  var minSectionSize = xSize / Math.pow(2, power);
  while (minSectionSize <= 8) {
    minSectionSize = minSectionSize * 2;
    power -= 1;
  }
  minSectionSize = Math.ceil(minSectionSize);
  var sectionSize = minSectionSize;
  var xStart = 0, xEnd = sectionSize, xDelta = 1;
  if (offset5 + minSectionSize > xSize) {
    xStart = sectionSize;
    xEnd = 0;
    xDelta = -1;
  }
  for (y2 = 0; y2 < ySize; y2 += 1) {
    for (x2 = xStart; x2 !== xEnd; x2 += xDelta) {
      xoff = Math.round(x2 + offset5) % xSize;
      srcPos = (xSize * y2 + xoff) * 4;
      r2 = scratchData.data[srcPos + 0];
      g2 = scratchData.data[srcPos + 1];
      b2 = scratchData.data[srcPos + 2];
      a = scratchData.data[srcPos + 3];
      dstPos = (xSize * y2 + x2) * 4;
      scratchData.data[dstPos + 0] = r2;
      scratchData.data[dstPos + 1] = g2;
      scratchData.data[dstPos + 2] = b2;
      scratchData.data[dstPos + 3] = a;
    }
  }
  for (y2 = 0; y2 < ySize; y2 += 1) {
    sectionSize = Math.floor(minSectionSize);
    for (i = 0; i < power; i += 1) {
      for (x2 = 0; x2 < sectionSize + 1; x2 += 1) {
        srcPos = (xSize * y2 + x2) * 4;
        r2 = scratchData.data[srcPos + 0];
        g2 = scratchData.data[srcPos + 1];
        b2 = scratchData.data[srcPos + 2];
        a = scratchData.data[srcPos + 3];
        dstPos = (xSize * y2 + sectionSize * 2 - x2 - 1) * 4;
        scratchData.data[dstPos + 0] = r2;
        scratchData.data[dstPos + 1] = g2;
        scratchData.data[dstPos + 2] = b2;
        scratchData.data[dstPos + 3] = a;
      }
      sectionSize *= 2;
    }
  }
  FromPolar(scratchData, imageData, { polarRotation: 0 });
};
Kaleidoscope$1.Kaleidoscope = Kaleidoscope;
Factory_1$7.Factory.addGetterSetter(Node_1$7.Node, "kaleidoscopePower", 2, (0, Validators_1$7.getNumberValidator)(), Factory_1$7.Factory.afterSetFilter);
Factory_1$7.Factory.addGetterSetter(Node_1$7.Node, "kaleidoscopeAngle", 0, (0, Validators_1$7.getNumberValidator)(), Factory_1$7.Factory.afterSetFilter);
var Mask$1 = {};
Object.defineProperty(Mask$1, "__esModule", { value: true });
Mask$1.Mask = void 0;
const Factory_1$6 = Factory;
const Node_1$6 = Node$1;
const Validators_1$6 = Validators;
function pixelAt(idata, x2, y2) {
  var idx = (y2 * idata.width + x2) * 4;
  var d2 = [];
  d2.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]);
  return d2;
}
function rgbDistance(p1, p2) {
  return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2) + Math.pow(p1[2] - p2[2], 2));
}
function rgbMean(pTab) {
  var m2 = [0, 0, 0];
  for (var i = 0; i < pTab.length; i++) {
    m2[0] += pTab[i][0];
    m2[1] += pTab[i][1];
    m2[2] += pTab[i][2];
  }
  m2[0] /= pTab.length;
  m2[1] /= pTab.length;
  m2[2] /= pTab.length;
  return m2;
}
function backgroundMask(idata, threshold) {
  var rgbv_no = pixelAt(idata, 0, 0);
  var rgbv_ne = pixelAt(idata, idata.width - 1, 0);
  var rgbv_so = pixelAt(idata, 0, idata.height - 1);
  var rgbv_se = pixelAt(idata, idata.width - 1, idata.height - 1);
  var thres = threshold || 10;
  if (rgbDistance(rgbv_no, rgbv_ne) < thres && rgbDistance(rgbv_ne, rgbv_se) < thres && rgbDistance(rgbv_se, rgbv_so) < thres && rgbDistance(rgbv_so, rgbv_no) < thres) {
    var mean = rgbMean([rgbv_ne, rgbv_no, rgbv_se, rgbv_so]);
    var mask = [];
    for (var i = 0; i < idata.width * idata.height; i++) {
      var d2 = rgbDistance(mean, [
        idata.data[i * 4],
        idata.data[i * 4 + 1],
        idata.data[i * 4 + 2]
      ]);
      mask[i] = d2 < thres ? 0 : 255;
    }
    return mask;
  }
}
function applyMask(idata, mask) {
  for (var i = 0; i < idata.width * idata.height; i++) {
    idata.data[4 * i + 3] = mask[i];
  }
}
function erodeMask(mask, sw, sh2) {
  var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a === 255 * 8 ? 255 : 0;
    }
  }
  return maskResult;
}
function dilateMask(mask, sw, sh2) {
  var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a >= 255 * 4 ? 255 : 0;
    }
  }
  return maskResult;
}
function smoothEdgeMask(mask, sw, sh2) {
  var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];
  var side = Math.round(Math.sqrt(weights.length));
  var halfSide = Math.floor(side / 2);
  var maskResult = [];
  for (var y2 = 0; y2 < sh2; y2++) {
    for (var x2 = 0; x2 < sw; x2++) {
      var so = y2 * sw + x2;
      var a = 0;
      for (var cy = 0; cy < side; cy++) {
        for (var cx = 0; cx < side; cx++) {
          var scy = y2 + cy - halfSide;
          var scx = x2 + cx - halfSide;
          if (scy >= 0 && scy < sh2 && scx >= 0 && scx < sw) {
            var srcOff = scy * sw + scx;
            var wt = weights[cy * side + cx];
            a += mask[srcOff] * wt;
          }
        }
      }
      maskResult[so] = a;
    }
  }
  return maskResult;
}
const Mask = function(imageData) {
  var threshold = this.threshold(), mask = backgroundMask(imageData, threshold);
  if (mask) {
    mask = erodeMask(mask, imageData.width, imageData.height);
    mask = dilateMask(mask, imageData.width, imageData.height);
    mask = smoothEdgeMask(mask, imageData.width, imageData.height);
    applyMask(imageData, mask);
  }
  return imageData;
};
Mask$1.Mask = Mask;
Factory_1$6.Factory.addGetterSetter(Node_1$6.Node, "threshold", 0, (0, Validators_1$6.getNumberValidator)(), Factory_1$6.Factory.afterSetFilter);
var Noise$1 = {};
Object.defineProperty(Noise$1, "__esModule", { value: true });
Noise$1.Noise = void 0;
const Factory_1$5 = Factory;
const Node_1$5 = Node$1;
const Validators_1$5 = Validators;
const Noise = function(imageData) {
  var amount = this.noise() * 255, data = imageData.data, nPixels = data.length, half = amount / 2, i;
  for (i = 0; i < nPixels; i += 4) {
    data[i + 0] += half - 2 * half * Math.random();
    data[i + 1] += half - 2 * half * Math.random();
    data[i + 2] += half - 2 * half * Math.random();
  }
};
Noise$1.Noise = Noise;
Factory_1$5.Factory.addGetterSetter(Node_1$5.Node, "noise", 0.2, (0, Validators_1$5.getNumberValidator)(), Factory_1$5.Factory.afterSetFilter);
var Pixelate$1 = {};
Object.defineProperty(Pixelate$1, "__esModule", { value: true });
Pixelate$1.Pixelate = void 0;
const Factory_1$4 = Factory;
const Util_1 = Util;
const Node_1$4 = Node$1;
const Validators_1$4 = Validators;
const Pixelate = function(imageData) {
  var pixelSize = Math.ceil(this.pixelSize()), width = imageData.width, height = imageData.height, x2, y2, i, red, green, blue, alpha, nBinsX = Math.ceil(width / pixelSize), nBinsY = Math.ceil(height / pixelSize), xBinStart, xBinEnd, yBinStart, yBinEnd, xBin, yBin, pixelsInBin, data = imageData.data;
  if (pixelSize <= 0) {
    Util_1.Util.error("pixelSize value can not be <= 0");
    return;
  }
  for (xBin = 0; xBin < nBinsX; xBin += 1) {
    for (yBin = 0; yBin < nBinsY; yBin += 1) {
      red = 0;
      green = 0;
      blue = 0;
      alpha = 0;
      xBinStart = xBin * pixelSize;
      xBinEnd = xBinStart + pixelSize;
      yBinStart = yBin * pixelSize;
      yBinEnd = yBinStart + pixelSize;
      pixelsInBin = 0;
      for (x2 = xBinStart; x2 < xBinEnd; x2 += 1) {
        if (x2 >= width) {
          continue;
        }
        for (y2 = yBinStart; y2 < yBinEnd; y2 += 1) {
          if (y2 >= height) {
            continue;
          }
          i = (width * y2 + x2) * 4;
          red += data[i + 0];
          green += data[i + 1];
          blue += data[i + 2];
          alpha += data[i + 3];
          pixelsInBin += 1;
        }
      }
      red = red / pixelsInBin;
      green = green / pixelsInBin;
      blue = blue / pixelsInBin;
      alpha = alpha / pixelsInBin;
      for (x2 = xBinStart; x2 < xBinEnd; x2 += 1) {
        if (x2 >= width) {
          continue;
        }
        for (y2 = yBinStart; y2 < yBinEnd; y2 += 1) {
          if (y2 >= height) {
            continue;
          }
          i = (width * y2 + x2) * 4;
          data[i + 0] = red;
          data[i + 1] = green;
          data[i + 2] = blue;
          data[i + 3] = alpha;
        }
      }
    }
  }
};
Pixelate$1.Pixelate = Pixelate;
Factory_1$4.Factory.addGetterSetter(Node_1$4.Node, "pixelSize", 8, (0, Validators_1$4.getNumberValidator)(), Factory_1$4.Factory.afterSetFilter);
var Posterize$1 = {};
Object.defineProperty(Posterize$1, "__esModule", { value: true });
Posterize$1.Posterize = void 0;
const Factory_1$3 = Factory;
const Node_1$3 = Node$1;
const Validators_1$3 = Validators;
const Posterize = function(imageData) {
  var levels = Math.round(this.levels() * 254) + 1, data = imageData.data, len = data.length, scale = 255 / levels, i;
  for (i = 0; i < len; i += 1) {
    data[i] = Math.floor(data[i] / scale) * scale;
  }
};
Posterize$1.Posterize = Posterize;
Factory_1$3.Factory.addGetterSetter(Node_1$3.Node, "levels", 0.5, (0, Validators_1$3.getNumberValidator)(), Factory_1$3.Factory.afterSetFilter);
var RGB$1 = {};
Object.defineProperty(RGB$1, "__esModule", { value: true });
RGB$1.RGB = void 0;
const Factory_1$2 = Factory;
const Node_1$2 = Node$1;
const Validators_1$2 = Validators;
const RGB = function(imageData) {
  var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), i, brightness2;
  for (i = 0; i < nPixels; i += 4) {
    brightness2 = (0.34 * data[i] + 0.5 * data[i + 1] + 0.16 * data[i + 2]) / 255;
    data[i] = brightness2 * red;
    data[i + 1] = brightness2 * green;
    data[i + 2] = brightness2 * blue;
    data[i + 3] = data[i + 3];
  }
};
RGB$1.RGB = RGB;
Factory_1$2.Factory.addGetterSetter(Node_1$2.Node, "red", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$2.Factory.addGetterSetter(Node_1$2.Node, "green", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$2.Factory.addGetterSetter(Node_1$2.Node, "blue", 0, Validators_1$2.RGBComponent, Factory_1$2.Factory.afterSetFilter);
var RGBA$1 = {};
Object.defineProperty(RGBA$1, "__esModule", { value: true });
RGBA$1.RGBA = void 0;
const Factory_1$1 = Factory;
const Node_1$1 = Node$1;
const Validators_1$1 = Validators;
const RGBA = function(imageData) {
  var data = imageData.data, nPixels = data.length, red = this.red(), green = this.green(), blue = this.blue(), alpha = this.alpha(), i, ia2;
  for (i = 0; i < nPixels; i += 4) {
    ia2 = 1 - alpha;
    data[i] = red * alpha + data[i] * ia2;
    data[i + 1] = green * alpha + data[i + 1] * ia2;
    data[i + 2] = blue * alpha + data[i + 2] * ia2;
  }
};
RGBA$1.RGBA = RGBA;
Factory_1$1.Factory.addGetterSetter(Node_1$1.Node, "red", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$1.Factory.addGetterSetter(Node_1$1.Node, "green", 0, function(val) {
  this._filterUpToDate = false;
  if (val > 255) {
    return 255;
  } else if (val < 0) {
    return 0;
  } else {
    return Math.round(val);
  }
});
Factory_1$1.Factory.addGetterSetter(Node_1$1.Node, "blue", 0, Validators_1$1.RGBComponent, Factory_1$1.Factory.afterSetFilter);
Factory_1$1.Factory.addGetterSetter(Node_1$1.Node, "alpha", 1, function(val) {
  this._filterUpToDate = false;
  if (val > 1) {
    return 1;
  } else if (val < 0) {
    return 0;
  } else {
    return val;
  }
});
var Sepia$1 = {};
Object.defineProperty(Sepia$1, "__esModule", { value: true });
Sepia$1.Sepia = void 0;
const Sepia = function(imageData) {
  var data = imageData.data, nPixels = data.length, i, r2, g2, b2;
  for (i = 0; i < nPixels; i += 4) {
    r2 = data[i + 0];
    g2 = data[i + 1];
    b2 = data[i + 2];
    data[i + 0] = Math.min(255, r2 * 0.393 + g2 * 0.769 + b2 * 0.189);
    data[i + 1] = Math.min(255, r2 * 0.349 + g2 * 0.686 + b2 * 0.168);
    data[i + 2] = Math.min(255, r2 * 0.272 + g2 * 0.534 + b2 * 0.131);
  }
};
Sepia$1.Sepia = Sepia;
var Solarize$1 = {};
Object.defineProperty(Solarize$1, "__esModule", { value: true });
Solarize$1.Solarize = void 0;
const Solarize = function(imageData) {
  var data = imageData.data, w2 = imageData.width, h2 = imageData.height, w4 = w2 * 4, y2 = h2;
  do {
    var offsetY = (y2 - 1) * w4;
    var x2 = w2;
    do {
      var offset5 = offsetY + (x2 - 1) * 4;
      var r2 = data[offset5];
      var g2 = data[offset5 + 1];
      var b2 = data[offset5 + 2];
      if (r2 > 127) {
        r2 = 255 - r2;
      }
      if (g2 > 127) {
        g2 = 255 - g2;
      }
      if (b2 > 127) {
        b2 = 255 - b2;
      }
      data[offset5] = r2;
      data[offset5 + 1] = g2;
      data[offset5 + 2] = b2;
    } while (--x2);
  } while (--y2);
};
Solarize$1.Solarize = Solarize;
var Threshold$1 = {};
Object.defineProperty(Threshold$1, "__esModule", { value: true });
Threshold$1.Threshold = void 0;
const Factory_1 = Factory;
const Node_1 = Node$1;
const Validators_1 = Validators;
const Threshold = function(imageData) {
  var level = this.threshold() * 255, data = imageData.data, len = data.length, i;
  for (i = 0; i < len; i += 1) {
    data[i] = data[i] < level ? 0 : 255;
  }
};
Threshold$1.Threshold = Threshold;
Factory_1.Factory.addGetterSetter(Node_1.Node, "threshold", 0.5, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
Object.defineProperty(_FullInternals, "__esModule", { value: true });
_FullInternals.Konva = void 0;
const _CoreInternals_1 = _CoreInternals;
const Arc_1 = Arc$1;
const Arrow_1 = Arrow$3;
const Circle_1 = Circle$1;
const Ellipse_1 = Ellipse$2;
const Image_1 = Image$2;
const Label_1 = Label$8;
const Line_1 = Line$2;
const Path_1 = Path$1;
const Rect_1 = Rect$1;
const RegularPolygon_1 = RegularPolygon$1;
const Ring_1 = Ring$1;
const Sprite_1 = Sprite$1;
const Star_1 = Star$1;
const Text_1 = Text$4;
const TextPath_1 = TextPath$1;
const Transformer_1 = Transformer$1;
const Wedge_1 = Wedge$1;
const Blur_1 = Blur$3;
const Brighten_1 = Brighten$1;
const Contrast_1 = Contrast$3;
const Emboss_1 = Emboss$1;
const Enhance_1 = Enhance$1;
const Grayscale_1 = Grayscale$1;
const HSL_1 = HSL$1;
const HSV_1 = HSV$2;
const Invert_1 = Invert$1;
const Kaleidoscope_1 = Kaleidoscope$1;
const Mask_1 = Mask$1;
const Noise_1 = Noise$1;
const Pixelate_1 = Pixelate$1;
const Posterize_1 = Posterize$1;
const RGB_1 = RGB$1;
const RGBA_1 = RGBA$1;
const Sepia_1 = Sepia$1;
const Solarize_1 = Solarize$1;
const Threshold_1 = Threshold$1;
_FullInternals.Konva = _CoreInternals_1.Konva.Util._assign(_CoreInternals_1.Konva, {
  Arc: Arc_1.Arc,
  Arrow: Arrow_1.Arrow,
  Circle: Circle_1.Circle,
  Ellipse: Ellipse_1.Ellipse,
  Image: Image_1.Image,
  Label: Label_1.Label,
  Tag: Label_1.Tag,
  Line: Line_1.Line,
  Path: Path_1.Path,
  Rect: Rect_1.Rect,
  RegularPolygon: RegularPolygon_1.RegularPolygon,
  Ring: Ring_1.Ring,
  Sprite: Sprite_1.Sprite,
  Star: Star_1.Star,
  Text: Text_1.Text,
  TextPath: TextPath_1.TextPath,
  Transformer: Transformer_1.Transformer,
  Wedge: Wedge_1.Wedge,
  Filters: {
    Blur: Blur_1.Blur,
    Brighten: Brighten_1.Brighten,
    Contrast: Contrast_1.Contrast,
    Emboss: Emboss_1.Emboss,
    Enhance: Enhance_1.Enhance,
    Grayscale: Grayscale_1.Grayscale,
    HSL: HSL_1.HSL,
    HSV: HSV_1.HSV,
    Invert: Invert_1.Invert,
    Kaleidoscope: Kaleidoscope_1.Kaleidoscope,
    Mask: Mask_1.Mask,
    Noise: Noise_1.Noise,
    Pixelate: Pixelate_1.Pixelate,
    Posterize: Posterize_1.Posterize,
    RGB: RGB_1.RGB,
    RGBA: RGBA_1.RGBA,
    Sepia: Sepia_1.Sepia,
    Solarize: Solarize_1.Solarize,
    Threshold: Threshold_1.Threshold
  }
});
var lib = lib$1.exports;
Object.defineProperty(lib, "__esModule", { value: true });
const _FullInternals_1 = _FullInternals;
lib$1.exports = _FullInternals_1.Konva;
var libExports = lib$1.exports;
const Konva$1 = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
function _createForOfIteratorHelper(a, b2) {
  var c2 = "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"];
  if (!c2) {
    if (Array.isArray(a) || (c2 = _unsupportedIterableToArray(a)) || b2) {
      c2 && (a = c2);
      var d2 = 0, e2 = function() {
      };
      return { s: e2, n: function n2() {
        return d2 >= a.length ? { done: true } : { done: false, value: a[d2++] };
      }, e: function e3(a2) {
        throw a2;
      }, f: e2 };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var g2 = true, h2 = false;
  return { s: function s() {
    c2 = c2.call(a);
  }, n: function n2() {
    var a2 = c2.next();
    return g2 = a2.done, a2;
  }, e: function e3(a2) {
    h2 = true;
  }, f: function f2() {
    try {
      g2 || null == c2["return"] || c2["return"]();
    } finally {
      if (h2) throw f2;
    }
  } };
}
function _unsupportedIterableToArray(a, b2) {
  if (a) {
    if ("string" == typeof a) return _arrayLikeToArray(a, b2);
    var c2 = Object.prototype.toString.call(a).slice(8, -1);
    return "Object" === c2 && a.constructor && (c2 = a.constructor.name), "Map" === c2 || "Set" === c2 ? Array.from(a) : "Arguments" === c2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c2) ? _arrayLikeToArray(a, b2) : void 0;
  }
}
function _arrayLikeToArray(a, b2) {
  (null == b2 || b2 > a.length) && (b2 = a.length);
  for (var c2 = 0, d2 = Array(b2); c2 < b2; c2++) d2[c2] = a[c2];
  return d2;
}
var BaseFilters = { apply: function apply(a) {
  for (var b2 = a.data, c2 = b2.length, d2 = arguments.length, e2 = Array(1 < d2 ? d2 - 1 : 0), f2 = 1; f2 < d2; f2++) e2[f2 - 1] = arguments[f2];
  for (var g2 = 0; g2 < c2; g2 += 4) {
    var h2, j2 = _createForOfIteratorHelper(e2);
    try {
      for (j2.s(); !(h2 = j2.n()).done; ) {
        var k2 = h2.value, l2 = k2([b2[g2], b2[g2 + 1], b2[g2 + 2]]), m2 = _slicedToArray(l2, 3);
        b2[g2] = m2[0], b2[g2 + 1] = m2[1], b2[g2 + 2] = m2[2];
      }
    } catch (a2) {
      j2.e(a2);
    } finally {
      j2.f();
    }
  }
}, brightness: function brightness(a) {
  return function(b2) {
    var c2 = a;
    return c2 = 1 < c2 ? 1 : c2, c2 = -1 > c2 ? -1 : c2, c2 = ~~(255 * c2), [b2[0] + c2, b2[1] + c2, b2[2] + c2];
  };
}, contrast: function contrast(a) {
  return function(b2) {
    var c2 = a;
    c2 *= 255;
    var d2 = 259 * (c2 + 255) / (255 * (259 - c2));
    return [d2 * (b2[0] - 128) + 128, d2 * (b2[1] - 128) + 128, d2 * (b2[2] - 128) + 128];
  };
}, saturation: function saturation(a) {
  return function(c2) {
    var d2 = a;
    d2 = -1 > d2 ? -1 : d2;
    var e2 = c2[0], f2 = c2[1], g2 = c2[2], b2 = 0.2989 * e2 + 0.587 * f2 + 0.114 * g2;
    return [-b2 * d2 + e2 * (1 + d2), -b2 * d2 + f2 * (1 + d2), -b2 * d2 + g2 * (1 + d2)];
  };
}, grayscale: function grayscale() {
  return function(a) {
    var c2 = a[0], d2 = a[1], e2 = a[2];
    return [, , ,].fill(0.2126 * c2 + 0.7152 * d2 + 0.0722 * e2);
  };
}, sepia: function sepia(a) {
  return function(c2) {
    var d2 = c2[0], e2 = c2[1], f2 = c2[2];
    return [d2 * (1 - 0.607 * a) + 0.769 * e2 * a + 0.189 * f2 * a, 0.349 * d2 * a + e2 * (1 - 0.314 * a) + 0.168 * f2 * a, 0.272 * d2 * a + 0.534 * e2 * a + f2 * (1 - 0.869 * a)];
  };
}, adjustRGB: function adjustRGB(a) {
  return function(b2) {
    return [b2[0] * a[0], b2[1] * a[1], b2[2] * a[2]];
  };
}, colorFilter: function colorFilter(a) {
  return function(c2) {
    var d2 = c2[0], e2 = c2[1], f2 = c2[2], b2 = a[3];
    return [d2 - (d2 - a[0]) * b2, e2 - (e2 - a[1]) * b2, f2 - (f2 - a[2]) * b2];
  };
} };
function BlackAndWhite(a) {
  BaseFilters.apply(a, function(a2) {
    var b2 = (a2[0] + a2[1] + a2[2]) / 3 > 100, c2 = b2 ? 255 : 0;
    return [c2, c2, c2];
  });
}
BlackAndWhite.filterName = "BlackAndWhite";
var BRIGHTNESS_CONST$i = 0.1, CONTRAST_CONST$f = 0.1, SATURATION_CONST$i = 0.15;
function Clarendon(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$i), BaseFilters.contrast(CONTRAST_CONST$f), BaseFilters.saturation(SATURATION_CONST$i));
}
Clarendon.filterName = "Clarendon";
var SEPIA_CONST$5 = 0.04, CONTRAST_CONST$e = -0.15;
function Gingham(a) {
  BaseFilters.apply(a, BaseFilters.sepia(SEPIA_CONST$5), BaseFilters.contrast(CONTRAST_CONST$e));
}
Gingham.filterName = "Gingham";
var BRIGHTNESS_CONST$h = 0.1;
function Moon(a) {
  BaseFilters.apply(a, BaseFilters.grayscale(), BaseFilters.brightness(BRIGHTNESS_CONST$h));
  var b2 = a.data;
  b2.length;
}
Moon.filterName = "Moon";
var BRIGHTNESS_CONST$g = 0.08, ADJUST_RGB_CONST$5 = [1, 1.03, 1.05], SATURATION_CONST$h = 0.12;
function Lark(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$g), BaseFilters.adjustRGB(ADJUST_RGB_CONST$5), BaseFilters.saturation(SATURATION_CONST$h));
}
Lark.filterName = "Lark";
var SEPIA_CONST$4 = 0.4, BRIGHTNESS_CONST$f = 0.13, CONTRAST_CONST$d = -0.05;
function Reyes(a) {
  BaseFilters.apply(a, BaseFilters.sepia(SEPIA_CONST$4), BaseFilters.brightness(BRIGHTNESS_CONST$f), BaseFilters.contrast(CONTRAST_CONST$d));
}
Reyes.filterName = "Reyes";
var ADJUST_RGB_CONST$4 = [1.01, 1.04, 1], SATURATION_CONST$g = 0.3;
function Juno(a) {
  BaseFilters.apply(a, BaseFilters.adjustRGB(ADJUST_RGB_CONST$4), BaseFilters.saturation(SATURATION_CONST$g));
}
Juno.filterName = "Juno";
var BRIGHTNESS_CONST$e = 0.1, SATURATION_CONST$f = -0.5;
function Slumber(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$e), BaseFilters.saturation(SATURATION_CONST$f));
}
Slumber.filterName = "Slumber";
var ADJUST_RGB_CONST$3 = [1.04, 1, 1.02], SATURATION_CONST$e = -0.05;
function Crema(a) {
  BaseFilters.apply(a, BaseFilters.adjustRGB(ADJUST_RGB_CONST$3), BaseFilters.saturation(SATURATION_CONST$e));
}
Crema.filterName = "Crema";
var BRIGHTNESS_CONST$d = 0.05, SATURATION_CONST$d = -0.03;
function Ludwig(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$d), BaseFilters.saturation(SATURATION_CONST$d));
}
Ludwig.filterName = "Ludwig";
var COLOR_FILTER_CONST$i = [228, 130, 225, 0.13], SATURATION_CONST$c = -0.2;
function Aden(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$i), BaseFilters.saturation(SATURATION_CONST$c));
}
Aden.filterName = "Aden";
var ADJUST_RGB_CONST$2 = [1.05, 1.1, 1];
function Perpetua(a) {
  BaseFilters.apply(a, BaseFilters.adjustRGB(ADJUST_RGB_CONST$2));
}
Perpetua.filterName = "Perpetua";
var SATURATION_CONST$b = 0.3, BRIGHTNESS_CONST$c = 0.15;
function Amaro(a) {
  BaseFilters.apply(a, BaseFilters.saturation(SATURATION_CONST$b), BaseFilters.brightness(BRIGHTNESS_CONST$c));
}
Amaro.filterName = "Amaro";
var COLOR_FILTER_CONST$h = [230, 115, 108, 0.05], SATURATION_CONST$a = 0.15;
function Mayfair(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$h), BaseFilters.saturation(SATURATION_CONST$a));
}
Mayfair.filterName = "Mayfair";
var COLOR_FILTER_CONST$g = [255, 170, 0, 0.1], BRIGHTNESS_CONST$b = 0.09, SATURATION_CONST$9 = 0.1;
function Rise(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$g), BaseFilters.brightness(BRIGHTNESS_CONST$b), BaseFilters.saturation(SATURATION_CONST$9));
}
Rise.filterName = "Rise";
var ADJUST_RGB_CONST$1 = [1, 1, 1.25], CONTRAST_CONST$c = 0.1, BRIGHTNESS_CONST$a = 0.15;
function Hudson(a) {
  BaseFilters.apply(a, BaseFilters.adjustRGB(ADJUST_RGB_CONST$1), BaseFilters.contrast(CONTRAST_CONST$c), BaseFilters.brightness(BRIGHTNESS_CONST$a));
}
Hudson.filterName = "Hudson";
var COLOR_FILTER_CONST$f = [255, 225, 80, 0.08], SATURATION_CONST$8 = 0.1, CONTRAST_CONST$b = 0.05;
function Valencia(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$f), BaseFilters.saturation(SATURATION_CONST$8), BaseFilters.contrast(CONTRAST_CONST$b));
}
Valencia.filterName = "Valencia";
var COLOR_FILTER_CONST$e = [255, 255, 0, 0.07], SATURATION_CONST$7 = 0.2, CONTRAST_CONST$a = 0.15;
function XPro2(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$e), BaseFilters.saturation(SATURATION_CONST$7), BaseFilters.contrast(CONTRAST_CONST$a));
}
XPro2.filterName = "XPro2";
var CONTRAST_CONST$9 = -0.15, SATURATION_CONST$6 = 0.1;
function Sierra(a) {
  BaseFilters.apply(a, BaseFilters.contrast(CONTRAST_CONST$9), BaseFilters.saturation(SATURATION_CONST$6));
}
Sierra.filterName = "Sierra";
var COLOR_FILTER_CONST$d = [100, 28, 210, 0.03], BRIGHTNESS_CONST$9 = 0.1;
function Willow(a) {
  BaseFilters.apply(a, BaseFilters.grayscale(), BaseFilters.colorFilter(COLOR_FILTER_CONST$d), BaseFilters.brightness(BRIGHTNESS_CONST$9));
}
Willow.filterName = "Willow";
var CONTRAST_CONST$8 = 0.15, SATURATION_CONST$5 = 0.2;
function LoFi(a) {
  BaseFilters.apply(a, BaseFilters.contrast(CONTRAST_CONST$8), BaseFilters.saturation(SATURATION_CONST$5));
}
LoFi.filterName = "LoFi";
var CONTRAST_CONST$7 = 0.1, SATURATION_CONST$4 = 0.15;
function Hefe(a) {
  BaseFilters.apply(a, BaseFilters.contrast(CONTRAST_CONST$7), BaseFilters.saturation(SATURATION_CONST$4));
}
Hefe.filterName = "Hefe";
var COLOR_FILTER_CONST$c = [220, 115, 188, 0.12], CONTRAST_CONST$6 = -0.05;
function Nashville(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$c), BaseFilters.contrast(CONTRAST_CONST$6));
}
Nashville.filterName = "Nashville";
var BRIGHTNESS_CONST$8 = 0.1, SEPIA_CONST$3 = 0.3;
function Stinson(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$8), BaseFilters.sepia(SEPIA_CONST$3));
}
Stinson.filterName = "Stinson";
var COLOR_FILTER_CONST$b = [255, 225, 0, 0.05], BRIGHTNESS_CONST$7 = 0.06, CONTRAST_CONST$5 = 0.06;
function Vesper(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$b), BaseFilters.brightness(BRIGHTNESS_CONST$7), BaseFilters.contrast(CONTRAST_CONST$5));
}
Vesper.filterName = "Vesper";
var COLOR_FILTER_CONST$a = [255, 165, 40, 0.2];
function Earlybird(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$a));
}
Earlybird.filterName = "Earlybird";
var CONTRAST_CONST$4 = 0.2, COLOR_FILTER_CONST$9 = [140, 10, 185, 0.1];
function Brannan(a) {
  BaseFilters.apply(a, BaseFilters.contrast(CONTRAST_CONST$4), BaseFilters.colorFilter(COLOR_FILTER_CONST$9));
}
Brannan.filterName = "Brannan";
var BRIGHTNESS_CONST$6 = -0.1, SATURATION_CONST$3 = -0.1;
function Sutro(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$6), BaseFilters.saturation(SATURATION_CONST$3));
}
Sutro.filterName = "Sutro";
var SEPIA_CONST$2 = 0.1, COLOR_FILTER_CONST$8 = [255, 145, 0, 0.2];
function Toaster(a) {
  BaseFilters.apply(a, BaseFilters.sepia(SEPIA_CONST$2), BaseFilters.colorFilter(COLOR_FILTER_CONST$8));
}
Toaster.filterName = "Toaster";
var BRIGHTNESS_CONST$5 = 0.1, COLOR_FILTER_CONST$7 = [255, 255, 0, 0.2];
function Walden(a) {
  BaseFilters.apply(a, BaseFilters.brightness(BRIGHTNESS_CONST$5), BaseFilters.colorFilter(COLOR_FILTER_CONST$7));
}
Walden.filterName = "Walden";
var COLOR_FILTER_CONST$6 = [255, 25, 0, 0.15], BRIGHTNESS_CONST$4 = 0.1;
function NinteenSeventySeven(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$6), BaseFilters.brightness(BRIGHTNESS_CONST$4));
}
NinteenSeventySeven.filterName = "NinteenSeventySeven";
var COLOR_FILTER_CONST$5 = [255, 140, 0, 0.1], ADJUST_RGB_CONST = [1.15, 1.05, 1], SATURATION_CONST$2 = 0.35;
function Kelvin(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$5), BaseFilters.adjustRGB(ADJUST_RGB_CONST), BaseFilters.saturation(SATURATION_CONST$2));
}
Kelvin.filterName = "Kelvin";
var COLOR_FILTER_CONST$4 = [225, 240, 0, 0.1], SATURATION_CONST$1 = 0.25, CONTRAST_CONST$3 = 0.05;
function Maven(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$4), BaseFilters.saturation(SATURATION_CONST$1), BaseFilters.contrast(CONTRAST_CONST$3));
}
Maven.filterName = "Maven";
var SEPIA_CONST$1 = 0.06, BRIGHTNESS_CONST$3 = 0.1;
function Ginza(a) {
  BaseFilters.apply(a, BaseFilters.sepia(SEPIA_CONST$1), BaseFilters.brightness(BRIGHTNESS_CONST$3));
}
Ginza.filterName = "Ginza";
var SATURATION_CONST = 0.35, BRIGHTNESS_CONST$2 = 0.1;
function Skyline(a) {
  BaseFilters.apply(a, BaseFilters.saturation(SATURATION_CONST), BaseFilters.brightness(BRIGHTNESS_CONST$2));
}
Skyline.filterName = "Skyline";
var CONTRAST_CONST$2 = 0.15, BRIGHTNESS_CONST$1 = 0.1;
function Dogpatch(a) {
  BaseFilters.apply(a, BaseFilters.contrast(CONTRAST_CONST$2), BaseFilters.brightness(BRIGHTNESS_CONST$1));
}
Dogpatch.filterName = "Dogpatch";
var COLOR_FILTER_CONST$3 = [25, 240, 252, 0.05], SEPIA_CONST = 0.3;
function Brooklyn(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$3), BaseFilters.sepia(SEPIA_CONST));
}
Brooklyn.filterName = "Brooklyn";
var COLOR_FILTER_CONST$2 = [208, 208, 86, 0.2], CONTRAST_CONST$1 = 0.15;
function Helena(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$2), BaseFilters.contrast(CONTRAST_CONST$1));
}
Helena.filterName = "Helena";
var COLOR_FILTER_CONST$1 = [255, 160, 25, 0.1], BRIGHTNESS_CONST = 0.1;
function Ashby(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST$1), BaseFilters.brightness(BRIGHTNESS_CONST));
}
Ashby.filterName = "Ashby";
var COLOR_FILTER_CONST = [255, 50, 80, 0.12], CONTRAST_CONST = 0.05;
function Charmes(a) {
  BaseFilters.apply(a, BaseFilters.colorFilter(COLOR_FILTER_CONST), BaseFilters.contrast(CONTRAST_CONST));
}
Charmes.filterName = "Charmes";
const CustomFilters = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Aden,
  Amaro,
  Ashby,
  BlackAndWhite,
  Brannan,
  Brooklyn,
  Charmes,
  Clarendon,
  Crema,
  Dogpatch,
  Earlybird,
  Gingham,
  Ginza,
  Hefe,
  Helena,
  Hudson,
  Juno,
  Kelvin,
  Lark,
  LoFi,
  Ludwig,
  Maven,
  Mayfair,
  Moon,
  Nashville,
  NinteenSeventySeven,
  Perpetua,
  Reyes,
  Rise,
  Sierra,
  Skyline,
  Slumber,
  Stinson,
  Sutro,
  Toaster,
  Valencia,
  Vesper,
  Walden,
  Willow,
  XPro2
}, Symbol.toStringTag, { value: "Module" }));
var filterStrToClass = function(a) {
  return a ? CustomFilters[a] || Konva$1.Filters[a] : null;
};
function Warmth$1(a) {
  for (var b2 = this.warmth(), c2 = a.data, d2 = c2.length, e2 = 0; e2 < d2; e2 += 4) c2[e2] += b2, c2[e2 + 2] -= b2;
}
Warmth$1.finetuneName = "Warmth";
Factory.Factory.addGetterSetter(Konva$1.Image, "warmth", 0, getNumberValidator_1(), Factory.Factory.afterSetFilter);
function CustomThreshold(a) {
  for (var b2 = this.threshold(), c2 = a.data, d2 = c2.length, e2 = 0; e2 < d2; e2 += 4) 0 === b2 || (c2[e2] = c2[e2] >= b2 ? 255 : 0, c2[e2 + 1] = c2[e2 + 1] >= b2 ? 255 : 0, c2[e2 + 2] = c2[e2 + 2] >= b2 ? 255 : 0);
}
CustomThreshold.finetuneName = "CustomThreshold";
Factory.Factory.addGetterSetter(Konva$1.Image, "threshold", 0, getNumberValidator_1, Factory.Factory.afterSetFilter);
const CustomFinetunes = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  CustomThreshold,
  Warmth: Warmth$1
}, Symbol.toStringTag, { value: "Module" }));
var finetunesStrsToClasses = function(a) {
  return Array.isArray(a) && 0 < a.length ? a.map(function(a2) {
    return Konva$1.Filters[a2] || CustomFinetunes[a2];
  }) : [];
};
function ownKeys$1f(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1f(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1f(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1f(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var getInitialAppState = function() {
  var a, b2, c2, d2, e2 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, f2 = _objectSpread$1f({}, e2.loadableDesignState);
  Array.isArray(f2.finetunes) && (f2.finetunes = finetunesStrsToClasses(f2.finetunes)), f2.filter && (f2.filter = filterStrToClass(f2.filter));
  var g2 = !!e2.loadableDesignState || !!(e2.useCloudimage && (null === (a = e2.cloudimage) || void 0 === a ? void 0 : a.loadableQuery));
  return _objectSpread$1f(_objectSpread$1f({ imgSrc: "string" == typeof e2.source ? e2.source : (null === (b2 = e2.source) || void 0 === b2 ? void 0 : b2.src) || "", finetunes: [], finetunesProps: {}, filter: null, adjustments: { crop: { ratio: e2[TOOLS_IDS.CROP].ratio, ratioTitleKey: null !== (c2 = e2[TOOLS_IDS.CROP].ratioTitleKey) && void 0 !== c2 ? c2 : e2[TOOLS_IDS.CROP].ratio, width: null, height: null, x: 0, y: 0 }, isFlippedX: false, isFlippedY: false, rotation: 0 }, annotations: {}, resize: {}, shownImageDimensions: {} }, f2), {}, { pointerCssIcon: POINTER_ICONS.DEFAULT, canvasScale: 1, zoom: { factor: DEFAULT_ZOOM_FACTOR, x: null, y: null }, isLoadingGlobally: true, selectionsIds: [], tabId: e2.defaultTabId || null, toolId: e2.defaultToolId || null, feedback: {}, pastDesignStates: [], futureDesignStates: [], isResetted: null === (d2 = !g2) || void 0 === d2 || d2, haveNotSavedChanges: false, latestColors: {}, showTabsMenu: false });
};
var extractCurrentDesignState = function(a, b2) {
  var c2 = getInitialAppState(b2 ? a : defaultConfig);
  return { imgSrc: a.imgSrc || c2.imgSrc, finetunes: a.finetunes || c2.finetunes, finetunesProps: a.finetunesProps || c2.finetunesProps, filter: a.filter || c2.filter, adjustments: a.adjustments || c2.adjustments, annotations: a.annotations || c2.annotations, resize: a.resize || c2.resize };
};
function ownKeys$1e(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1e(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1e(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1e(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var REDO = "REDO";
var redo = function(a) {
  if (a.futureDesignStates && 0 < a.futureDesignStates.length) {
    var b2 = extractCurrentDesignState(a), c2 = _toArray(a.futureDesignStates), d2 = c2[0], e2 = c2.slice(1), f2 = [b2].concat(_toConsumableArray(a.pastDesignStates || []));
    return _objectSpread$1e(_objectSpread$1e(_objectSpread$1e({}, a), d2), {}, { selectionsIds: [], pastDesignStates: f2, futureDesignStates: e2, hasUndo: true, hasRedo: 0 < e2.length, haveNotSavedChanges: true });
  }
  return a;
};
function ownKeys$1d(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1d(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1d(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1d(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var RESET = "RESET";
var reset = function(a, b2) {
  var c2 = extractCurrentDesignState(_objectSpread$1d(_objectSpread$1d({}, b2.config), {}, { imgSrc: a.imgSrc }), true);
  return _objectSpread$1d(_objectSpread$1d(_objectSpread$1d({}, a), c2), {}, { zoom: { factor: DEFAULT_ZOOM_FACTOR, x: null, y: null }, selectionsIds: [], isResetted: true, pastDesignStates: [], futureDesignStates: [], hasUndo: false, hasRedo: false, haveNotSavedChanges: false });
};
function ownKeys$1c(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1c(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1c(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1c(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_FEEDBACK = "SET_FEEDBACK";
var setFeedback = function(a, b2) {
  return _objectSpread$1c(_objectSpread$1c({}, a), {}, { isLoadingGlobally: false, feedback: b2.feedback || {} });
};
function ownKeys$1b(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1b(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1b(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1b(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SHOW_LOADER = "SHOW_LOADER";
var showLoader = function(a) {
  return _objectSpread$1b(_objectSpread$1b({}, a), {}, { isLoadingGlobally: true });
};
function intrinsicComponent(render, displayName) {
  var component = /* @__PURE__ */ reactExports.forwardRef(render);
  component.displayName = render.name;
  return component;
}
var _excluded$27 = ["color", "stroke", "size"];
var Brightness$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$stroke = _ref.stroke, stroke = _ref$stroke === void 0 ? "currentColor" : _ref$stroke, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$27);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M23.54 1.53186C23.54 0.96198 24.002 0.5 24.5719 0.5C25.1417 0.5 25.6037 0.961981 25.6037 1.53186V5.82108C25.6037 6.39096 25.1417 6.85294 24.5719 6.85294C24.002 6.85294 23.54 6.39096 23.54 5.82108V1.53186ZM23.54 43.1985C23.54 42.6287 24.002 42.1667 24.5719 42.1667C25.1417 42.1667 25.6037 42.6287 25.6037 43.1985V47.4877C25.6037 48.0576 25.1417 48.5196 24.5719 48.5196C24.002 48.5196 23.54 48.0576 23.54 47.4877V43.1985ZM47.4876 23.5397C48.0574 23.5397 48.5194 24.0017 48.5194 24.5716C48.5194 25.1415 48.0574 25.6034 47.4876 25.6034H43.1983C42.6285 25.6034 42.1665 25.1415 42.1665 24.5716C42.1665 24.0017 42.6285 23.5397 43.1984 23.5397H47.4876ZM5.8209 23.5397C6.39078 23.5397 6.85276 24.0017 6.85276 24.5716C6.85276 25.1415 6.39078 25.6034 5.82089 25.6034H1.53168C0.961798 25.6034 0.499817 25.1415 0.499817 24.5716C0.499817 24.0017 0.961797 23.5397 1.53168 23.5397H5.8209ZM41.6177 39.8976C42.0207 40.3006 42.0207 40.9539 41.6177 41.3569C41.2147 41.7599 40.5614 41.7599 40.1584 41.3569L37.1255 38.324C36.7225 37.921 36.7225 37.2677 37.1255 36.8647C37.5285 36.4617 38.1818 36.4617 38.5848 36.8647L41.6177 39.8976ZM12.1551 10.4347C12.558 10.8377 12.558 11.491 12.1551 11.894C11.7521 12.297 11.0988 12.297 10.6958 11.894L7.66285 8.86105C7.25989 8.45808 7.25989 7.80474 7.66286 7.40178C8.06582 6.99881 8.71916 6.99881 9.12213 7.40178L12.1551 10.4347ZM9.12179 41.617C8.71882 42.0199 8.06548 42.0199 7.66251 41.617C7.25955 41.214 7.25955 40.5607 7.66251 40.1577L10.6954 37.1248C11.0984 36.7218 11.7518 36.7218 12.1547 37.1248C12.5577 37.5277 12.5577 38.1811 12.1547 38.584L9.12179 41.617ZM38.5862 12.1549C38.1832 12.5579 37.5299 12.5579 37.1269 12.1549C36.724 11.752 36.724 11.0986 37.1269 10.6957L40.1599 7.66274C40.5628 7.25977 41.2162 7.25977 41.6191 7.66274C42.0221 8.06571 42.0221 8.71905 41.6191 9.12201L38.5862 12.1549ZM38.7161 24.5098C38.7161 32.3555 32.3559 38.7157 24.5102 38.7157C16.6645 38.7157 10.3043 32.3555 10.3043 24.5098C10.3043 16.6641 16.6645 10.3039 24.5102 10.3039C32.3559 10.3039 38.7161 16.6641 38.7161 24.5098ZM24.5102 36.652C31.2161 36.652 36.6524 31.2157 36.6524 24.5098C36.6524 17.8039 31.2161 12.3676 24.5102 12.3676C17.8043 12.3676 12.3681 17.8039 12.3681 24.5098C12.3681 31.2157 17.8043 36.652 24.5102 36.652Z",
    fill: color,
    stroke
  }));
});
var isDefaultZeroValuesOnly = function(a, b2) {
  return a && Object.keys(a || {}).every(function(b3) {
    return 0 === a[b3];
  }) && b2 && 0 === Object.keys(b2 || {}).length;
};
var AppContext = reactExports.createContext({});
function useTheme() {
  return Xe();
}
function useMediaQuery(queryInput) {
  var query = queryInput.replace(/^@media( ?)/m, "");
  var _useState = reactExports.useState(function() {
    return window.matchMedia(query).matches;
  }), _useState2 = _slicedToArray(_useState, 2), match = _useState2[0], setMatch = _useState2[1];
  reactExports.useEffect(function() {
    var active = true;
    var queryList = window.matchMedia(query);
    var updateMatch = function updateMatch2() {
      if (active) {
        setMatch(queryList.matches);
      }
    };
    updateMatch();
    queryList.addEventListener("change", updateMatch);
    return function() {
      active = false;
      queryList.removeEventListener("change", updateMatch);
    };
  }, [query, matchMedia]);
  return match;
}
const defaultTranslations = { name: "Name", save: "Save", saveAs: "Save as", back: "Back", loading: "Loading...", resetOperations: "Reset/delete all operations", changesLoseWarningHint: "If you press button “reset” your changes will lost. Would you like to continue?", discardChangesWarningHint: "If you close modal, your last change will not be saved.", cancel: "Cancel", apply: "Apply", warning: "Warning", confirm: "Confirm", discardChanges: "Discard changes", undoTitle: "Undo last operation", redoTitle: "Redo last operation", showImageTitle: "Show original image", zoomInTitle: "Zoom in", zoomOutTitle: "Zoom out", toggleZoomMenuTitle: "Toggle zoom menu", adjustTab: "Adjust", finetuneTab: "Finetune", filtersTab: "Filters", watermarkTab: "Watermark", annotateTabLabel: "Annotate", resize: "Resize", resizeTab: "Resize", imageName: "Image name", invalidImageError: "Invalid image provided.", uploadImageError: "Error while uploading the image.", areNotImages: "are not images", isNotImage: "is not image", toBeUploaded: "to be uploaded", cropTool: "Crop", original: "Original", custom: "Custom", square: "Square", landscape: "Landscape", portrait: "Portrait", ellipse: "Ellipse", classicTv: "Classic TV", cinemascope: "Cinemascope", arrowTool: "Arrow", blurTool: "Blur", brightnessTool: "Brightness", contrastTool: "Contrast", ellipseTool: "Ellipse", unFlipX: "Un-Flip X", flipX: "Flip X", unFlipY: "Un-Flip Y", flipY: "Flip Y", hsvTool: "HSV", hue: "Hue", brightness: "Brightness", saturation: "Saturation", value: "Value", imageTool: "Image", importing: "Importing...", addImage: "+ Add image", uploadImage: "Upload image", fromGallery: "From gallery", lineTool: "Line", penTool: "Pen", polygonTool: "Polygon", sides: "Sides", rectangleTool: "Rectangle", cornerRadius: "Corner Radius", resizeWidthTitle: "Width in pixels", resizeHeightTitle: "Height in pixels", toggleRatioLockTitle: "Toggle ratio lock", resetSize: "Reset to original image size", rotateTool: "Rotate", textTool: "Text", textSpacings: "Text spacings", textAlignment: "Text alignment", fontFamily: "Font family", size: "Size", letterSpacing: "Letter Spacing", lineHeight: "Line height", warmthTool: "Warmth", addWatermark: "+ Add watermark", addTextWatermark: "+ Add text watermark", addWatermarkTitle: "Choose the watermark type", uploadWatermark: "Upload watermark", addWatermarkAsText: "Add as text", padding: "Padding", paddings: "Paddings", shadow: "Shadow", horizontal: "Horizontal", vertical: "Vertical", blur: "Blur", opacity: "Opacity", transparency: "Transparency", position: "Position", stroke: "Stroke", saveAsModalTitle: "Save as", extension: "Extension", format: "Format", nameIsRequired: "Name is required.", quality: "Quality", imageDimensionsHoverTitle: "Saved image size (width x height)", cropSizeLowerThanResizedWarning: "Note, the selected crop area is lower than the applied resize which might cause quality decrease", actualSize: "Actual size (100%)", fitSize: "Fit size", addImageTitle: "Select image to add...", mutualizedFailedToLoadImg: "Failed to load image.", tabsMenu: "Menu", download: "Download", width: "Width", height: "Height", plus: "+", cropItemNoEffect: "No preview available for this crop item" };
function ownKeys$1a(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1a(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1a(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1a(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var backendTranslations = {}, activatedTranslations = _objectSpread$1a({}, defaultTranslations), hardcodedErrorMsg = "Error while loading translations from backend.";
var updateTranslations = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, b2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : "en";
  return Object.assign(activatedTranslations, backendTranslations[null === b2 || void 0 === b2 ? void 0 : b2.toLowerCase()] || {}, a);
};
var sendMissingTranslationsToBackend = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : [];
  return new Promise(function(b2, c2) {
    var d2 = new XMLHttpRequest();
    d2.responseType = "json", d2.onload = function() {
      if (200 <= d2.status && 300 > d2.status) b2(d2.response);
      else {
        var a2;
        console.warn("Error in sending translation key to backend ".concat(null === (a2 = d2.response) || void 0 === a2 ? void 0 : a2.hint, ", ").concat(d2.status)), c2();
      }
    }, d2.onerror = function() {
      var a2;
      console.warn("Error in sending translation key to backend ".concat(null === (a2 = d2.response) || void 0 === a2 ? void 0 : a2.hint, ", ").concat(d2.status)), c2();
    };
    d2.open("POST", "https://neo.wordplex.io/api/import/request-translations?grid_uuid=".concat(TRANSLATIONS_GRID_UUID)), d2.send(JSON.stringify({ grid_uuid: TRANSLATIONS_GRID_UUID, translations_requests: a }));
  });
};
var getBackendTranslations = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : "en", b2 = 1 < arguments.length ? arguments[1] : void 0;
  return new Promise(function(c2, d2) {
    var e2 = a.toLowerCase(), f2 = new XMLHttpRequest();
    f2.responseType = "json", f2.onload = function() {
      if (200 <= f2.status && 300 > f2.status) {
        (f2.response || []).forEach(function(a3) {
          backendTranslations[e2] = _objectSpread$1a(_objectSpread$1a({}, backendTranslations[e2]), {}, _defineProperty({}, a3.translation_key, a3.translations[e2]));
        });
        var a2 = [];
        Object.keys(defaultTranslations).forEach(function(b3) {
          var c3;
          b3 && !(null !== (c3 = backendTranslations[e2]) && void 0 !== c3 && c3[b3]) && a2.push({ key: b3, lang: e2, default: defaultTranslations[b3] });
        }), 0 < a2.length && sendMissingTranslationsToBackend(a2), updateTranslations(b2, e2), c2(activatedTranslations);
      } else {
        var g2, h2, i;
        console.error("Status code: ".concat(f2.status)), console.error((null === (g2 = f2.response) || void 0 === g2 ? void 0 : g2.msg) || (null === (h2 = f2.response) || void 0 === h2 ? void 0 : h2.msg) || (null === (i = f2.response) || void 0 === i ? void 0 : i.details) || hardcodedErrorMsg), d2();
      }
    }, f2.onerror = function() {
      console.error("Status code ".concat(f2.status, ", error: ").concat(hardcodedErrorMsg)), d2();
    }, f2.open("GET", "https://i18n.ultrafast.io/api/export?grid=".concat(TRANSLATIONS_GRID_UUID)), f2.send();
  });
};
var translate = function(a) {
  return activatedTranslations[a] || a || "";
};
var appReducer = function(a, b2) {
  return actions[b2.type] ? actions[b2.type](a, b2.payload) || a : a;
};
function ownKeys$19(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$19(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$19(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$19(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var isFieMounted = true, AppProvider = function(a) {
  var b2 = a.children, c2 = a.config, d2 = void 0 === c2 ? {} : c2, e2 = useAppReducer(appReducer, getInitialAppState(d2), d2), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1];
  reactExports.useEffect(function() {
    return isFieMounted = true, function() {
      isFieMounted = false;
    };
  }, []);
  var i = reactExports.useCallback(function() {
    isFieMounted && h2.apply(void 0, arguments);
  }, [h2]);
  reactExports.useEffect(function() {
    updateTranslations(d2.translations, d2.language);
  }, [d2.useBackendTranslations, d2.language, d2.translations]);
  var j2 = useTheme(), k2 = reactExports.useMemo(function() {
    return _objectSpread$19(_objectSpread$19({}, g2), {}, { config: d2, theme: j2, dispatch: i, t: translate });
  }, [d2, g2]);
  return React.createElement(AppContext.Provider, { value: k2 }, b2);
};
AppProvider.defaultProps = { config: {} };
var AppProviderOverridenValue = function(a) {
  var b2 = a.children, c2 = a.overridingValue;
  return React.createElement(AppContext.Provider, { value: c2 }, b2);
};
var useStore = function() {
  return reactExports.useContext(AppContext);
};
function ownKeys$18(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$18(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$18(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$18(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var useFinetune = function(a, b2) {
  var c2 = useStore(), d2 = c2.dispatch, e2 = c2.finetunes, f2 = c2.finetunesProps, g2 = reactExports.useCallback(function(b3) {
    d2({ type: SET_FINETUNE, payload: { finetune: a, finetuneProps: b3 } });
  }, []);
  return reactExports.useEffect(function() {
    e2.includes(a) || isDefaultZeroValuesOnly(b2, f2) || g2(_objectSpread$18(_objectSpread$18({}, b2), f2));
  }, []), reactExports.useMemo(function() {
    return [f2, g2];
  }, [f2]);
};
var useFilter = function() {
  var a = useStore(), b2 = a.dispatch, c2 = a.filter, d2 = reactExports.useCallback(function(a2) {
    b2({ type: ADD_FILTER, payload: { filter: a2 } });
  }, []);
  return reactExports.useMemo(function() {
    return [c2, d2];
  }, [c2]);
};
var randomId = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : "";
  return "".concat(a).concat(a ? "-" : "").concat(parseInt(Date.now() * Math.random(), 10));
};
var debounce$1 = function(a) {
  var b2, c2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 300;
  return function() {
    var d2, e2;
    clearTimeout(b2);
    for (var f2 = arguments.length, g2 = Array(f2), h2 = 0; h2 < f2; h2++) g2[h2] = arguments[h2];
    var i = g2[0], j2 = g2.slice(1);
    b2 = setTimeout(a.bind.apply(a, [null, null !== (d2 = null === i || void 0 === i || null === (e2 = i.target) || void 0 === e2 ? void 0 : e2.value) && void 0 !== d2 ? d2 : i].concat(_toConsumableArray(j2))), c2);
  };
};
var getScrollOffset = function() {
  var a, b2, c2 = document, d2 = c2.body, e2 = document.documentElement, f2 = (null === (a = window) || void 0 === a ? void 0 : a.pageYOffset) || e2.scrollTop || d2.scrollTop, g2 = (null === (b2 = window) || void 0 === b2 ? void 0 : b2.pageXOffset) || e2.scrollLeft || d2.scrollLeft;
  return { topOffset: f2, leftOffset: g2 };
};
var getElemDocumentCoords = function(a) {
  if (!a) return null;
  var b2 = a.getBoundingClientRect(), c2 = document, d2 = c2.body, e2 = getScrollOffset(), f2 = e2.topOffset, g2 = e2.leftOffset, h2 = document.documentElement, i = h2.clientTop || d2.clientTop || 0, j2 = h2.clientLeft || d2.clientLeft || 0, k2 = b2.top + f2 - i, l2 = b2.left + g2 - j2;
  return { top: Math.round(k2), left: Math.round(l2), width: b2.width, height: b2.height };
};
var restrictNumber = function(a) {
  var b2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 0, c2 = 2 < arguments.length ? arguments[2] : void 0;
  return Math.min(Math.max(b2, +a), c2 || 1e6);
};
var getPointerOffsetPositionBoundedToObject = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, b2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, c2 = a.parent, d2 = c2.getStage(), e2 = d2.attrs.zoomFactor, f2 = c2.getRelativePointerPosition();
  return { offsetX: restrictNumber(f2.x, 0, b2.width / (d2.scaleX() / e2)) + c2.attrs.xPadding, offsetY: restrictNumber(f2.y, 0, b2.height / (d2.scaleY() / e2)) + c2.attrs.yPadding };
};
var getBoundingRectUnScaled = function() {
  var a = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, b2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, c2 = 2 < arguments.length ? arguments[2] : void 0, d2 = {}, e2 = c2.parent.attrs;
  return d2.x = Math.min(a.offsetX, b2.startedX) - e2.xPadding || 0, d2.y = Math.min(a.offsetY, b2.startedY) - e2.yPadding || 0, d2.width = a.offsetX - b2.startedX, d2.height = a.offsetY - b2.startedY, d2.startedX = b2.startedX - e2.xPadding || 0, d2.startedY = b2.startedY - e2.yPadding || 0, d2;
};
var _excluded$26 = ["width", "height", "startedX", "startedY"];
function ownKeys$17(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$17(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$17(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$17(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var annotationsNamesToKonvaClasses = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TOOLS_IDS.RECT, Konva$1.Rect), TOOLS_IDS.ELLIPSE, Konva$1.Ellipse), TOOLS_IDS.POLYGON, Konva$1.RegularPolygon), TOOLS_IDS.LINE, Konva$1.Line), TOOLS_IDS.IMAGE, Konva$1.Image), TOOLS_IDS.TEXT, Konva$1.Text), TOOLS_IDS.ARROW, Konva$1.Arrow), ANNOTATIONS_WITH_POINTS = [TOOLS_IDS.LINE, TOOLS_IDS.ARROW];
var NO_WIDTH_HEIGHT_ANNOTATIONS = [].concat(ANNOTATIONS_WITH_POINTS, [TOOLS_IDS.ELLIPSE, TOOLS_IDS.POLYGON]);
var getNewAnnotationPreview = function(a) {
  var b2, c2, d2;
  return new annotationsNamesToKonvaClasses[a.name](_objectSpread$17(_objectSpread$17({}, a), {}, { opacity: null !== (b2 = a.opacity) && void 0 !== b2 ? b2 : 0.7, x: null !== (c2 = a.x) && void 0 !== c2 ? c2 : 0, y: null !== (d2 = a.y) && void 0 !== d2 ? d2 : 0, width: Math.abs(a.width) || 0, height: Math.abs(a.height) || 0 }, ANNOTATIONS_WITH_POINTS.includes(a.name) ? { stroke: a.stroke || "#000000" } : {}));
};
var dimensToProperAnnotationDimens = function(a, b2, c2) {
  var d2 = a.width, e2 = a.height, f2 = a.startedX, g2 = a.startedY, h2 = _objectWithoutProperties(a, _excluded$26), i = Math.abs(d2), j2 = Math.abs(e2), k2 = 0 > d2, l2 = 0 > e2;
  switch (b2) {
    case TOOLS_IDS.RECT:
      c2 ? (h2.width = Math.sqrt(i * i + j2 * j2), h2.height = h2.width, h2.x -= k2 ? h2.width - i : 0, h2.y -= l2 ? h2.height - j2 : 0) : (h2.width = i, h2.height = j2);
      break;
    case TOOLS_IDS.ELLIPSE:
      c2 ? (h2.radiusX = Math.sqrt(i * i + j2 * j2) / 2, h2.radiusY = h2.radiusX, h2.x -= k2 ? 2 * h2.radiusX - i : 0, h2.y -= l2 ? 2 * h2.radiusY - j2 : 0) : (h2.radiusX = i / 2, h2.radiusY = j2 / 2), h2.offsetX = -h2.radiusX, h2.offsetY = -h2.radiusY;
      break;
    case TOOLS_IDS.POLYGON:
      h2.radius = (i + j2) / 2, h2.x -= k2 ? 2 * h2.radius - i : 0, h2.y -= l2 ? 2 * h2.radius - j2 : 0, h2.offsetX = -h2.radius, h2.offsetY = -h2.radius;
      break;
    case TOOLS_IDS.LINE:
    case TOOLS_IDS.ARROW:
      h2.x = f2, h2.y = g2, h2.points = [0, 0], c2 ? h2.points.push(i >= j2 ? d2 : 0, j2 > i ? e2 : 0) : h2.points = [0, 0, d2, e2];
      break;
    default:
      h2.width = i, h2.height = j2;
  }
  return h2;
};
var _excluded$25 = ["id", "x", "y", "points"], _excluded2$1 = ["startedX", "startedY", "offsetX", "offsetY", "width", "height"];
function ownKeys$16(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$16(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$16(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$16(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var pointerDown = { startedX: void 0, startedY: void 0, isOutOfCanvas: false }, eventsOptions$1 = { passive: true }, MIN_PIXELS = 1, shownAnnotationPreview = null, textAnnotationWrappedRect = null, latestAnnotationProps = null, previewThenCallAnnotationAdding = function(a, b2, c2, d2) {
  var f2 = function getCanvasBoundingRect() {
    return getElemDocumentCoords(a.content);
  }, g2 = function wrapTextBoundsPreviewByRect(a2) {
    textAnnotationWrappedRect = getNewAnnotationPreview(_objectSpread$16(_objectSpread$16({}, a2), {}, { name: TOOLS_IDS.RECT, fill: "", stroke: "#000000", strokeWidth: 2, shadowColor: "#ffffff", shadowBlur: 1, shadowOpacity: 0.7 })), c2.add(textAnnotationWrappedRect);
  }, h2 = function previewAnnotation(a2) {
    shownAnnotationPreview = getNewAnnotationPreview(a2), c2.add(shownAnnotationPreview), a2.name === TOOLS_IDS.TEXT && g2(a2), latestAnnotationProps = a2;
  }, i = function updateAnnotationPreview(a2, b3) {
    if (latestAnnotationProps) {
      var c3 = dimensToProperAnnotationDimens(a2, latestAnnotationProps.name, b3);
      textAnnotationWrappedRect && textAnnotationWrappedRect.setAttrs(c3), shownAnnotationPreview.setAttrs(c3), latestAnnotationProps = _objectSpread$16(_objectSpread$16({}, latestAnnotationProps), c3);
    }
  }, j2 = function updatePreviewWithBoundedDimens(a2) {
    var b3 = getPointerOffsetPositionBoundedToObject(c2, f2());
    i(getBoundingRectUnScaled(b3, pointerDown, c2), a2.shiftKey);
  }, k2 = function destroyShownPreview() {
    c2 && shownAnnotationPreview && c2.destroyChildren();
  }, l2 = function handlePointerMove(d3) {
    var e2;
    if (!(1 < (null === (e2 = d3.evt.touches) || void 0 === e2 ? void 0 : e2.length))) {
      var g3 = getPointerOffsetPositionBoundedToObject(c2, f2());
      pointerDown.isOutOfCanvas && (document.removeEventListener("mousemove", j2, eventsOptions$1), document.removeEventListener("touchmove", j2, eventsOptions$1), pointerDown.isOutOfCanvas = false);
      var k3 = getBoundingRectUnScaled(g3, pointerDown, c2);
      if (shownAnnotationPreview) i(k3, d3.evt.shiftKey);
      else {
        b2.id;
        b2.x;
        b2.y;
        b2.points;
        var p2 = _objectWithoutProperties(b2, _excluded$25);
        h2(_objectSpread$16(_objectSpread$16({}, p2), k3));
      }
      a.setAttrs({ isDrawing: true });
    }
  }, m2 = function handlePointerOut() {
    pointerDown.isOutOfCanvas || (document.addEventListener("mousemove", j2, eventsOptions$1), document.addEventListener("touchmove", j2, eventsOptions$1), pointerDown.isOutOfCanvas = true);
  }, n2 = function handlePointerUp() {
    var c3, e2;
    if (k2(), latestAnnotationProps && (latestAnnotationProps.width >= MIN_PIXELS && latestAnnotationProps.height >= MIN_PIXELS || latestAnnotationProps.radiusX >= MIN_PIXELS && latestAnnotationProps.radiusY >= MIN_PIXELS || null !== (c3 = latestAnnotationProps.points) && void 0 !== c3 && c3[2] || null !== (e2 = latestAnnotationProps.points) && void 0 !== e2 && e2[3] || latestAnnotationProps.radius >= MIN_PIXELS)) {
      var f3 = latestAnnotationProps;
      f3.startedX;
      f3.startedY;
      f3.offsetX;
      f3.offsetY;
      var p2 = f3.width, q2 = f3.height, r2 = _objectWithoutProperties(f3, _excluded2$1);
      NO_WIDTH_HEIGHT_ANNOTATIONS.includes(b2.name) || (r2.width = p2, r2.height = q2), d2(r2, true);
    }
    shownAnnotationPreview = null, textAnnotationWrappedRect = null, latestAnnotationProps = null, a.setAttrs({ isDrawing: false }), a.off("mousemove touchmove", l2), a.off("mouseleave touchcancel", m2), document.removeEventListener("mouseup", n2, eventsOptions$1), document.removeEventListener("touchend", n2, eventsOptions$1), document.removeEventListener("mouseleave", n2, eventsOptions$1), document.removeEventListener("touchcancel", n2, eventsOptions$1), document.removeEventListener("mousemove", j2, eventsOptions$1), document.removeEventListener("touchmove", j2, eventsOptions$1), pointerDown.isOutOfCanvas = false;
  }, o = function handlePointerDown(b3) {
    var d3;
    if (b3.evt.preventDefault(), !(b3.target.attrs.draggable || 1 < (null === (d3 = b3.evt.touches) || void 0 === d3 ? void 0 : d3.length))) {
      k2();
      var e2 = getPointerOffsetPositionBoundedToObject(c2, f2());
      pointerDown.startedX = e2.offsetX, pointerDown.startedY = e2.offsetY, pointerDown.isOutOfCanvas = false, a.on("mousemove touchmove", l2), a.on("mouseleave touchcancel", m2), document.addEventListener("mouseup", n2, eventsOptions$1), document.addEventListener("touchend", n2, eventsOptions$1), document.addEventListener("mouseleave", n2, eventsOptions$1), document.addEventListener("touchcancel", n2, eventsOptions$1);
    }
  };
  return a.on("mousedown touchstart", o), function() {
    k2(), a.off("mousedown touchstart", o);
  };
};
var useDebouncedCallback = function(a, b2) {
  var c2 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : [];
  return reactExports.useCallback(debounce$1(a, b2), c2);
};
var _excluded$24 = ["fonts", "onFontChange"], _excluded2 = ["x", "y", "width", "height", "radius", "radiusX", "radiusY", "points", "image", "text", "scaleX", "scaleY", "rotation"], _excluded3 = ["shouldSave", "neverSave"];
function ownKeys$15(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$15(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$15(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$15(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var useAnnotation = function() {
  var a, b2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, c2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], d2 = useStore(), e2 = d2.dispatch, f2 = d2.previewGroup, g2 = d2.annotations, h2 = d2.selectionsIds, i = void 0 === h2 ? [] : h2, j2 = d2.config, k2 = _objectSpread$15(_objectSpread$15({}, j2.annotationsCommon), j2[(null === (a = g2[i[0]]) || void 0 === a ? void 0 : a.name) || b2.name]), l2 = reactExports.useState(function() {
    return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, k2), b2), g2[i[0]]);
  }), m2 = _slicedToArray(l2, 2), n2 = m2[0], o = m2[1], p2 = reactExports.useRef(), q2 = null === f2 || void 0 === f2 ? void 0 : f2.getStage(), r2 = reactExports.useCallback(function(a2) {
    a2.fonts;
    a2.onFontChange;
    var f3 = _objectWithoutProperties(a2, _excluded$24);
    e2({ type: SET_ANNOTATION, payload: f3 }), f3.id && b2.name !== TOOLS_IDS.PEN && debounce$1(function() {
      e2({ type: SELECT_ANNOTATION, payload: { annotationId: f3.id } });
    }, 30)();
  }, []), s = useDebouncedCallback(function(a2) {
    o(function(b3) {
      return _objectSpread$15(_objectSpread$15({}, b3), {}, { shouldSave: false, neverSave: false }, "function" == typeof a2 ? a2(b3) : a2);
    });
  }, 15), t2 = reactExports.useCallback(function(a2, c3) {
    if (a2.name === c3) {
      a2.x;
      a2.y;
      a2.width;
      a2.height;
      a2.radius;
      a2.radiusX;
      a2.radiusY;
      a2.points;
      a2.image;
      a2.text;
      a2.scaleX;
      a2.scaleY;
      a2.rotation;
      var r3 = _objectWithoutProperties(a2, _excluded2);
      return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, k2), b2), r3);
    }
    return _objectSpread$15(_objectSpread$15({}, k2), b2);
  }, []), u2 = reactExports.useCallback(function(a2) {
    o(function(c3) {
      var d3 = t2(c3, a2.name || b2.name);
      return _objectSpread$15(_objectSpread$15(_objectSpread$15({}, d3), a2), {}, { id: a2.id || randomId(a2.name || c3.name), shouldSave: true, neverSave: false });
    });
  }, []);
  return reactExports.useEffect(function() {
    var a2 = n2.shouldSave, b3 = n2.neverSave, c3 = _objectWithoutProperties(n2, _excluded3), d3 = 1 === i.length && g2[i[0]];
    !b3 && (a2 || d3) && r2(_objectSpread$15(_objectSpread$15({}, c3), {}, { id: a2 ? c3.id : d3.id }));
  }, [n2]), reactExports.useEffect(function() {
    setTimeout(function() {
      1 === i.length ? (p2.current = n2, o(_objectSpread$15(_objectSpread$15({}, g2[i[0]]), {}, { neverSave: true }))) : p2.current && (o(_objectSpread$15(_objectSpread$15({}, p2.current), {}, { neverSave: true })), p2.current = null);
    });
  }, [i, g2]), reactExports.useEffect(function() {
    var a2 = null;
    if (q2 && c2) {
      var d3 = t2(n2, b2.name);
      a2 = previewThenCallAnnotationAdding(q2, _objectSpread$15(_objectSpread$15({}, d3), {}, { name: b2.name }), f2, u2);
    }
    return function() {
      a2 && a2();
    };
  }, [q2, n2, f2]), reactExports.useMemo(function() {
    return [n2, s, u2];
  }, [n2, s, u2]);
};
var _excluded$23 = ["isDesignState"];
function ownKeys$14(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$14(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$14(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$14(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var timeout, applyModifyFn = function(a, b2) {
  timeout = setTimeout(function() {
    clearTimeout(timeout), "function" == typeof a && b2 && a(b2);
  });
}, useAppReducer = function(a, b2) {
  var c2 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : {}, d2 = _objectSpread$14(_objectSpread$14({}, b2), {}, { pastDesignStates: [], futureDesignStates: [], hasRedo: false, hasUndo: false });
  return reactExports.useReducer(function undoRedoResetReducer(b3, e2) {
    var f2 = a(b3, e2) || d2;
    if ([UNDO, REDO, RESET].includes(e2.type)) return applyModifyFn(c2.onModify, f2), f2;
    if (f2.isDesignState) {
      var g2 = extractCurrentDesignState(b3);
      f2.isDesignState;
      var i = _objectWithoutProperties(f2, _excluded$23), j2 = _objectSpread$14(_objectSpread$14({}, i), {}, { pastDesignStates: [g2].concat(_toConsumableArray(b3.pastDesignStates)), hasUndo: true, hasRedo: false, futureDesignStates: [], isResetted: false, haveNotSavedChanges: true });
      return applyModifyFn(c2.onModify, j2), j2;
    }
    return f2;
  }, d2);
};
var useAnnotationEvents = function() {
  var a = useStore(), b2 = a.tabId, c2 = a.dispatch, d2 = reactExports.useMemo(function() {
    return b2 !== TABS_IDS.ANNOTATE && b2 !== TABS_IDS.WATERMARK;
  }, [b2]), f2 = reactExports.useCallback(function(a2) {
    c2({ type: SET_ANNOTATION, payload: a2 });
  }, []), g2 = reactExports.useCallback(function(a2) {
    f2({ id: a2.target.id(), x: a2.target.x(), y: a2.target.y() });
  }, []), h2 = reactExports.useCallback(function(a2) {
    var b3 = { id: a2.target.id(), rotation: a2.target.rotation(), x: a2.target.x(), y: a2.target.y() };
    return a2.target.name() === TOOLS_IDS.TEXT ? (b3.width = a2.target.width() * a2.target.scaleX(), b3.height = a2.target.height() * a2.target.scaleY(), b3.scaleX = 1, b3.scaleY = 1) : (b3.scaleX = a2.target.scaleX(), b3.scaleY = a2.target.scaleY()), b3;
  }, []), i = reactExports.useCallback(function(a2) {
    f2(h2(a2));
  }, []), j2 = reactExports.useCallback(function(a2) {
    a2.target.name() === TOOLS_IDS.TEXT && a2.target.setAttrs(h2(a2));
  }), k2 = reactExports.useCallback(function(a2) {
    if (!(a2.target.id() === WATERMARK_ANNOTATION_ID$1 || a2.target.getStage().attrs.isDrawing)) {
      var b3 = a2.evt.ctrlKey || a2.evt.shiftKey || a2.evt.metaKey;
      c2({ type: SELECT_ANNOTATION, payload: { annotationId: a2.target.id(), multiple: b3 } }), c2({ type: SELECT_TOOL, payload: { toolId: a2.target.name(), keepSelections: b3 } });
    }
  }, []);
  return reactExports.useMemo(function() {
    return d2 ? {} : { onTransform: j2, onTransformEnd: i, onDragEnd: g2, onClick: k2, onTap: k2 };
  }, [d2]);
};
var useResizeObserver = function() {
  var a = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : function() {
  }, b2 = reactExports.useRef(a), c2 = reactExports.useRef(), d2 = reactExports.useCallback(function(a2) {
    a2.forEach(function(a3) {
      if (a3.contentRect) {
        var c3 = a3.contentRect, d3 = c3.width, e3 = c3.height;
        b2.current({ entry: a3, width: d3, height: e3 });
      }
    });
  }, []), e2 = reactExports.useCallback(function(a2) {
    b2.current = a2;
  }, []), f2 = reactExports.useCallback(function() {
    c2.current || (c2.current = new ResizeObserver(d2));
  }, []), g2 = reactExports.useCallback(function(a2, d3) {
    a2 && (!c2.current && f2(), c2.current.observe(a2), d3 && (b2.current = d3));
  }, []), h2 = reactExports.useCallback(function(a2, d3) {
    c2.current && a2 && (c2.current.unobserve(a2), d3 && (b2.current = d3));
  }, []), i = reactExports.useCallback(function() {
    c2.current && c2.current.disconnect();
  }, []);
  return reactExports.useEffect(function() {
    return f2(), i;
  }, []), reactExports.useMemo(function() {
    return [g2, h2, e2];
  }, []);
};
var usePhoneScreen = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : 438;
  return window.matchMedia("(max-width: ".concat(a, "px)")).matches;
};
var mapNumber = function(a, b2, c2, d2, e2) {
  return (a - b2) * (e2 - d2) / (c2 - b2) + d2;
};
function ownKeys$13(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$13(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$13(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$13(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var mapCropBox = function(a, b2, c2) {
  var d2, e2;
  return _objectSpread$13(_objectSpread$13(_objectSpread$13({}, a.x || 0 === a.x ? { x: Math.round(mapNumber(a.x, 0, b2.width, 0, c2.width)) } : {}), a.y || 0 === a.y ? { y: Math.round(mapNumber(a.y, 0, b2.height, 0, c2.height)) } : {}), {}, { width: Math.round(mapNumber(null !== (d2 = a.width) && void 0 !== d2 ? d2 : b2.width, 0, b2.width, 0, c2.width)), height: Math.round(mapNumber(null !== (e2 = a.height) && void 0 !== e2 ? e2 : b2.height, 0, b2.height, 0, c2.height)) });
};
var getSizeAfterRotation = function(a, b2) {
  var c2 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0, d2 = Math.abs(c2), e2 = Math.round(c2), f2 = 90 < d2, g2 = f2 ? d2 - 90 : d2, h2 = f2 ? b2 : a, i = f2 ? a : b2, j2 = g2 * Math.PI / 180, k2 = Math.abs(Math.sin(j2)), l2 = Math.abs(Math.cos(j2));
  return { width: Math.round(h2 * l2) + Math.round(i * k2), height: Math.round(h2 * k2) + Math.round(i * l2), offsetTop: 0 <= e2 && 90 >= e2 ? 0 : function getTopOffset() {
    return 0 > e2 && -90 < e2 ? h2 * k2 : 90 < e2 ? h2 * k2 : i * l2 + h2 * k2;
  }(), offsetLeft: 0 >= e2 && -90 <= e2 ? 0 : function getLeftOffset() {
    return 90 < e2 ? h2 * l2 + i * k2 : i * k2;
  }() };
};
var imageToBase64 = function(a) {
  if (a instanceof HTMLImageElement) {
    var b2 = document.createElement("canvas"), c2 = b2.getContext("2d");
    return b2.width = a.width, b2.height = a.height, c2.drawImage(a, 0, 0), b2.toDataURL();
  }
  return "";
};
var getFileFullName = function() {
  var a = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", b2 = 1 < arguments.length ? arguments[1] : void 0, c2 = b2, d2 = a;
  if (!c2 && POSSIBLE_IMAGE_TYPES.some(function(b3) {
    return a.lastIndexOf(".".concat(b3)) === a.length - ".".concat(b3).length;
  })) {
    var e2, f2 = null === (e2 = a.slice(a.lastIndexOf(".") + 1)) || void 0 === e2 ? void 0 : e2.toLowerCase();
    c2 = f2 && SUPPORTED_IMAGE_TYPES.includes(f2) ? f2 : DEFAULT_IMAGE_TYPE, d2 = a.slice(0, a.lastIndexOf("."));
  }
  return c2 = c2 || DEFAULT_IMAGE_TYPE, { fullName: "".concat(d2, ".").concat(c2), name: d2, extension: c2 };
};
var rotateLeft = function(a, b2) {
  return a << b2 | a >>> 32 - b2;
}, cvtHex = function(a) {
  var b2, c2, d2 = "";
  for (b2 = 7; 0 <= b2; b2--) c2 = 15 & a >>> 4 * b2, d2 += c2.toString(16);
  return d2;
}, Utf8Encode = function(a) {
  for (var b2, d2 = a.replace(/\r\n/g, "\n"), e2 = "", f2 = 0; f2 < d2.length; f2++) b2 = d2.charCodeAt(f2), 128 > b2 ? e2 += String.fromCharCode(b2) : 127 < b2 && 2048 > b2 ? (e2 += String.fromCharCode(192 | b2 >> 6), e2 += String.fromCharCode(128 | 63 & b2)) : (e2 += String.fromCharCode(224 | b2 >> 12), e2 += String.fromCharCode(128 | 63 & b2 >> 6), e2 += String.fromCharCode(128 | 63 & b2));
  return e2;
}, sha1 = function(a) {
  var b2, c2, d2, e2, f2, g2, h2, k2, l2, m2 = a, n2 = Array(80), o = 1732584193, p2 = 4023233417, q2 = 2562383102, r2 = 271733878, s = 3285377520;
  m2 = Utf8Encode(m2);
  var t2 = m2.length, u2 = [];
  for (c2 = 0; c2 < t2 - 3; c2 += 4) d2 = m2.charCodeAt(c2) << 24 | m2.charCodeAt(c2 + 1) << 16 | m2.charCodeAt(c2 + 2) << 8 | m2.charCodeAt(c2 + 3), u2.push(d2);
  switch (t2 % 4) {
    case 0:
      c2 = 2147483648;
      break;
    case 1:
      c2 = 8388608 | m2.charCodeAt(t2 - 1) << 24;
      break;
    case 2:
      c2 = 32768 | (m2.charCodeAt(t2 - 2) << 24 | m2.charCodeAt(t2 - 1) << 16);
      break;
    case 3:
      c2 = 128 | (m2.charCodeAt(t2 - 3) << 24 | m2.charCodeAt(t2 - 2) << 16 | m2.charCodeAt(t2 - 1) << 8);
      break;
  }
  for (u2.push(c2); 14 != u2.length % 16; ) u2.push(0);
  for (u2.push(t2 >>> 29), u2.push(4294967295 & t2 << 3), b2 = 0; b2 < u2.length; b2 += 16) {
    for (c2 = 0; 16 > c2; c2++) n2[c2] = u2[b2 + c2];
    for (c2 = 16; 79 >= c2; c2++) n2[c2] = rotateLeft(n2[c2 - 3] ^ n2[c2 - 8] ^ n2[c2 - 14] ^ n2[c2 - 16], 1);
    for (e2 = o, f2 = p2, g2 = q2, h2 = r2, k2 = s, c2 = 0; 19 >= c2; c2++) l2 = 4294967295 & rotateLeft(e2, 5) + (f2 & g2 | ~f2 & h2) + k2 + n2[c2] + 1518500249, k2 = h2, h2 = g2, g2 = rotateLeft(f2, 30), f2 = e2, e2 = l2;
    for (c2 = 20; 39 >= c2; c2++) l2 = 4294967295 & rotateLeft(e2, 5) + (f2 ^ g2 ^ h2) + k2 + n2[c2] + 1859775393, k2 = h2, h2 = g2, g2 = rotateLeft(f2, 30), f2 = e2, e2 = l2;
    for (c2 = 40; 59 >= c2; c2++) l2 = 4294967295 & rotateLeft(e2, 5) + (f2 & g2 | f2 & h2 | g2 & h2) + k2 + n2[c2] + 2400959708, k2 = h2, h2 = g2, g2 = rotateLeft(f2, 30), f2 = e2, e2 = l2;
    for (c2 = 60; 79 >= c2; c2++) l2 = 4294967295 & rotateLeft(e2, 5) + (f2 ^ g2 ^ h2) + k2 + n2[c2] + 3395469782, k2 = h2, h2 = g2, g2 = rotateLeft(f2, 30), f2 = e2, e2 = l2;
    o = 4294967295 & o + e2, p2 = 4294967295 & p2 + f2, q2 = 4294967295 & q2 + g2, r2 = 4294967295 & r2 + h2, s = 4294967295 & s + k2;
  }
  return l2 = cvtHex(o) + cvtHex(p2) + cvtHex(q2) + cvtHex(r2) + cvtHex(s), l2.toLowerCase();
};
var encodeBase64 = function(a) {
  return btoa(a).replace(/=*$/g, "");
}, getSha1 = function(a, b2) {
  return sha1(a).slice(0, b2);
}, getSealingParams = function(a, b2, c2, d2) {
  var e2 = encodeBase64(a), f2 = getSha1(b2 + e2 + c2, d2);
  return [f2 ? "ci_seal=".concat(f2) : "", e2 ? "ci_eqs=".concat(e2) : ""].filter(function(a2) {
    return a2;
  }).join("&");
}, getImageSealingParams = function(a, b2, c2) {
  var d2 = b2 || {}, e2 = d2.salt, f2 = d2.charCount, g2 = d2.includeParams, h2 = void 0 === g2 ? [] : g2, i = !h2 || 0 === (null === h2 || void 0 === h2 ? void 0 : h2.length), j2 = "", k2 = "", l2 = [], m2 = [];
  return a.split("&").forEach(function(a2) {
    var b3 = a2.split("="), c3 = _slicedToArray(b3, 1), d3 = c3[0];
    -1 < (null === h2 || void 0 === h2 ? void 0 : h2.indexOf(d3)) || i ? l2.push(a2) : m2.push(a2);
  }), 0 < m2.length && (k2 = m2.join("&")), j2 = getSealingParams(l2.join("&"), c2, e2, f2), [j2, k2].filter(function(a2) {
    return a2;
  }).join("&");
};
var rgbaToHexWithOpacity = function() {
  var a, c2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", d2 = { hex: "000000", opacity: 1 };
  if (!c2) return d2;
  if (c2.startsWith("#")) return { hex: c2.replace("#", ""), opacity: 1 };
  var e2 = c2.split(","), f2 = _slicedToArray(e2, 4), h2 = f2[0], i = f2[1], j2 = f2[2], k2 = f2[3];
  return h2 && i && j2 ? (h2 = parseFloat(h2.replace(/rgba?\(/, "").trim()).toString(16), i = parseFloat(i.trim()).toString(16), j2 = parseFloat(j2.trim()).toString(16), k2 = k2 ? parseFloat(null !== (a = k2.trim()) && void 0 !== a ? a : 1) : void 0, 1 === h2.length && (h2 = "0".concat(h2)), 1 === i.length && (i = "0".concat(i)), 1 === j2.length && (j2 = "0".concat(j2)), { hex: "".concat(h2).concat(i).concat(j2), opacity: k2 }) : d2;
};
var toPrecisedFloat = function(a) {
  var b2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : 5;
  return a && +parseFloat(a).toFixed(b2);
};
var _excluded$22 = ["width", "height", "x", "y", "opacity", "scaleX", "scaleY"];
function ownKeys$12(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$12(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$12(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$12(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var generateCropQuery = function(a, b2, c2, d2) {
  if (a.noEffect) return a.ratio.includes("=") ? a.ratio : "gravity=".concat(a.ratio);
  var e2 = (d2 || {}).lockCropAreaAt, f2 = mapCropBox(a, b2, c2), g2 = f2.x, h2 = f2.y, i = f2.width, j2 = f2.height, k2 = a.ratio === ELLIPSE_CROP ? "&radius=".concat(Math.max(i, j2), "&force_format=png") : "";
  if (e2) {
    var l2 = e2.split("-"), m2 = _slicedToArray(l2, 2), n2 = m2[0], o = m2[1], p2 = "".concat(EDITOR_TO_CLOUDIMG_POSITIONS[n2]).concat(EDITOR_TO_CLOUDIMG_POSITIONS[o]);
    return "gravity=".concat(p2, "&aspect_ratio=").concat(toPrecisedFloat("string" == typeof a.ratio ? i / j2 : a.ratio, 2)).concat(k2);
  }
  return "tl_px=".concat(g2, ",").concat(h2, "&br_px=").concat(g2 + i, ",").concat(h2 + j2).concat(k2);
}, generateResizeQuery = function() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, b2 = a.width, c2 = a.height;
  return "w=".concat(b2, "&h=").concat(c2);
}, generateRotationQuery = function(a) {
  return "r=".concat(-a);
}, generateFlipQuery = function(a, b2) {
  return "flip=".concat(a ? "x" : "").concat(b2 ? "y" : "");
}, generateWatermarkQuery = function(a) {
  var b2, c2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, d2 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : {}, e2 = c2.width, f2 = c2.height, g2 = c2.x, h2 = c2.y, i = c2.opacity, j2 = c2.scaleX, k2 = void 0 === j2 ? 1 : j2, l2 = c2.scaleY, m2 = void 0 === l2 ? 1 : l2, n2 = _objectWithoutProperties(c2, _excluded$22), o = a.width / a.height, p2 = a.width * a.scaledBy, q2 = a.height * a.scaledBy, r2 = g2 * a.scaledBy, s = h2 * a.scaledBy, t2 = "wat=1&wat_gravity=absolute&wat_pos=".concat(Math.floor(100 * ((r2 - (d2.x || 0)) / p2), 2), "p,").concat(Math.floor(100 * ((s - (d2.y || 0)) / q2), 2), "p");
  if (c2.name === TOOLS_IDS.TEXT) {
    var u2, v2 = rgbaToHexWithOpacity(n2.fill), w2 = v2.hex, x2 = v2.opacity;
    return "".concat(t2, "&wat_text=").concat(n2.text.replaceAll("\n", ""), "&wat_font=").concat(n2.fontFamily, "&wat_color=").concat(w2, "&wat_opacity=").concat(null !== (u2 = null !== x2 && void 0 !== x2 ? x2 : i) && void 0 !== u2 ? u2 : 1, "&wat_fontsize=").concat(n2.fontSize, "max");
  }
  var y2 = (null === (b2 = n2.image) || void 0 === b2 ? void 0 : b2.src) || n2.image, z2 = !y2.startsWith("blob:") && y2, A2 = toPrecisedFloat(100 * (e2 / f2 > o ? e2 * k2 / p2 : f2 * m2 / q2), 2);
  return "".concat(t2, "&wat_opacity=").concat(i, "&wat_scale=").concat(A2, "p").concat(z2 ? "&wat_url=".concat(encodeURIComponent(z2)) : "");
};
var finetuneNameToParamInfo = { Brighten: { cloudimage: { name: "bright", min: -100, max: 100 }, internal: { propName: "brightness", min: -1, max: 1 } }, Contrast: { cloudimage: { name: "contrast", min: -100, max: 100 }, internal: { propName: "contrast", min: -100, max: 100 } }, Blur: { cloudimage: { name: "blur", min: 0, max: 100 }, internal: { propName: "blurRadius", min: 0, max: 100 } } };
var generateFinetuneQuery = function(a) {
  var b2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, c2 = [];
  return a.forEach(function(a2) {
    var d2 = (a2.finetuneName || a2.name) && finetuneNameToParamInfo[a2.finetuneName || a2.name];
    if (d2) {
      var e2 = toPrecisedFloat(mapNumber(b2[d2.internal.propName], d2.internal.min, d2.internal.max, d2.cloudimage.min, d2.cloudimage.max), 2);
      c2.push("".concat(d2.cloudimage.name, "=").concat(e2));
    }
  }), c2.join("&");
}, operationsToCloudimageUrl = function(a, b2, c2, d2, e2) {
  var f2 = a.token, g2 = a.domain, h2 = a.dontPrefixUrl, i = a.version, j2 = a.imageSealing, k2 = a.secureProtocol, l2 = b2.imgSrc, m2 = b2.adjustments, n2 = m2.crop, o = m2.rotation, p2 = m2.isFlippedX, q2 = m2.isFlippedY, r2 = b2.resize, s = void 0 === r2 ? {} : r2, t2 = b2.finetunes, u2 = void 0 === t2 ? {} : t2, v2 = b2.finetunesProps, w2 = b2.annotations, x2 = void 0 === w2 ? {} : w2, y2 = h2 ? "" : "http".concat(k2 ? "s" : "", "://").concat(f2, ".").concat(g2.replace(/^(https?:\/\/)?(www\.)?|^\.|\/$/g, ""), "/").concat(i ? "".concat(i, "/") : ""), z2 = [];
  n2.width && n2.height && (n2.x || 0 === n2.x) && (n2.y || 0 === n2.y) && z2.push(generateCropQuery(n2, c2, d2, e2)), (s.width || s.height) && z2.push(generateResizeQuery(_objectSpread$12(_objectSpread$12({}, d2), s))), o && z2.push(generateRotationQuery(o)), (p2 || q2) && z2.push(generateFlipQuery(p2, q2)), 0 < u2.length && v2 && z2.push(generateFinetuneQuery(u2, v2)), x2[WATERMARK_ANNOTATION_ID$1] && z2.push(generateWatermarkQuery(c2, x2[WATERMARK_ANNOTATION_ID$1], n2)), z2.push("ci_url_encoded=1");
  var A2 = z2.join("&");
  j2.enable && (A2 = getImageSealingParams(A2, j2, l2)), A2 = A2.replaceAll(" ", "+");
  var B2 = !h2 && "?" || -1 === l2.indexOf("?") ? "?" : "&";
  return "".concat(y2).concat(h2 ? l2 : encodeURIComponent(l2)).concat(A2 ? "".concat(B2).concat(A2.replace(/&$/, "")) : "");
};
var _excluded$21 = ["filter"];
function ownKeys$11(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$11(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$11(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$11(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var useTransformedImgData = function() {
  var a = useStore(), b2 = a.dispatch, c2 = a.designLayer, d2 = a.shownImageDimensions, e2 = a.originalImage, f2 = a.resize, g2 = void 0 === f2 ? {} : f2, h2 = a.adjustments, i = void 0 === h2 ? {} : h2, j2 = i.crop, k2 = void 0 === j2 ? {} : j2, l2 = i.rotation, m2 = void 0 === l2 ? 0 : l2, n2 = i.isFlippedX, o = i.isFlippedY, p2 = a.config, q2 = p2.savingPixelRatio, r2 = p2.previewPixelRatio, s = p2.forceToPngInEllipticalCrop, t2 = p2.defaultSavedImageType, u2 = p2.useCloudimage, v2 = p2.cloudimage, w2 = p2[TOOLS_IDS.CROP];
  return u2 ? function getTransformedCloudimageData() {
    var b3, c3, f3 = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, g3 = extractCurrentDesignState(a);
    g3.filter;
    var i2 = _objectWithoutProperties(g3, _excluded$21), j3 = operationsToCloudimageUrl(v2, i2, d2, e2, w2), l3 = mapCropBox({ x: k2.x, y: k2.y, width: k2.width, height: k2.height }, d2, e2), m3 = { cloudimageUrl: j3, width: (null === f3 || void 0 === f3 || null === (b3 = f3.size) || void 0 === b3 ? void 0 : b3.width) || l3.width, height: (null === f3 || void 0 === f3 || null === (c3 = f3.size) || void 0 === c3 ? void 0 : c3.height) || l3.height };
    return { imageData: m3, designState: i2 };
  } : function getTransformedImgData() {
    var f3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, h3 = !!(1 < arguments.length && void 0 !== arguments[1]) && arguments[1], i2 = !!(2 < arguments.length && void 0 !== arguments[2]) && arguments[2], j3 = _objectSpread$11({ size: g2 }, f3);
    Konva$1.pixelRatio = h3 || q2;
    var l3 = c2.attrs, p3 = l3.clipWidth, u3 = l3.clipHeight, v3 = l3.clipX, w3 = l3.clipY;
    c2.setAttr("isSaving", true);
    var x2 = c2.getStage().clone({ width: e2.width, height: e2.height, scaleX: n2 ? -1 : 1, scaleY: o ? -1 : 1 }), y2 = _slicedToArray(x2.children, 1), z2 = y2[0];
    x2.children[1].destroy();
    var A2 = x2.findOne("#".concat(IMAGE_NODE_ID));
    A2.cache();
    var B2 = { x: x2.width() / d2.width, y: x2.height() / d2.height };
    z2.setAttrs({ rotation: 0, offsetX: 0, offsetY: 0, x: 0, y: 0, scaleX: B2.x, scaleY: B2.y });
    var C2 = _objectSpread$11(_objectSpread$11({}, (!j3.name || !j3.extension) && getFileFullName(e2.name, s && k2.ratio === ELLIPSE_CROP ? "png" : SUPPORTED_IMAGE_TYPES.includes(null === t2 || void 0 === t2 ? void 0 : t2.toLowerCase()) && t2)), j3), D2 = C2.name, E2 = C2.extension, F2 = C2.quality, G2 = void 0 === F2 ? 92 : F2, H2 = C2.size, I2 = void 0 === H2 ? {} : H2, J2 = ["jpeg", "jpg", "webp"].includes(E2), K2 = mapCropBox(k2.noEffect ? { x: 0, y: 0 } : { x: k2.x || v3, y: k2.y || w3, width: k2.width || p3, height: k2.height || u3 }, d2, x2.attrs), L2 = getSizeAfterRotation(K2.width, K2.height, m2);
    if (x2.setAttrs({ offsetX: K2.width / 2 + K2.x, offsetY: K2.height / 2 + K2.y, width: L2.width, height: L2.height, x: L2.width / 2, y: L2.height / 2, rotation: m2 }), I2.width) {
      var M2 = (n2 ? -1 : 1) * (I2.width / x2.width());
      x2.setAttrs({ scaleX: M2, width: I2.width, x: x2.x() * Math.abs(M2) });
    }
    if (I2.height) {
      var N2 = (o ? -1 : 1) * (I2.height / x2.height());
      x2.setAttrs({ scaleY: N2, height: I2.height, y: x2.y() * Math.abs(N2) });
    }
    var O2 = _objectSpread$11({ mimeType: "image/".concat("jpg" === E2 ? "jpeg" : E2) }, J2 ? { quality: G2 } : {}), P2 = x2.toCanvas(O2), Q2 = x2.toDataURL(O2), R2 = _objectSpread$11(_objectSpread$11({}, extractCurrentDesignState(a)), {}, { shownImageDimensions: { width: a.shownImageDimensions.width, height: a.shownImageDimensions.height, scaledBy: a.shownImageDimensions.scaledBy } });
    R2.filter && (R2.filter = R2.filter.filterName || R2.filter.name), R2.finetunes = R2.finetunes.map(function(a2) {
      return a2.finetuneName || a2.name;
    }), Object.keys(R2.annotations).forEach(function(a2) {
      var b3, c3 = R2.annotations[a2], d3 = c3.name === TOOLS_IDS.IMAGE && (null === (b3 = c3.image) || void 0 === b3 ? void 0 : b3.src);
      d3 && d3.startsWith("blob:") ? R2.annotations[a2].image = imageToBase64(c3.image) : c3.image instanceof HTMLImageElement && (R2.annotations[a2].image = d3);
    });
    var S2 = _objectSpread$11({ fullName: "".concat(D2, ".").concat(E2), name: D2, extension: E2, mimeType: "image/".concat(E2), imageCanvas: P2, imageBase64: Q2, width: I2.width || K2.width, height: I2.height || K2.height }, J2 ? { quality: G2 } : {});
    c2.setAttr("isSaving", false), b2({ type: SET_SAVED }), A2.clearCache(), x2.destroy(), Konva$1.pixelRatio = r2;
    var T2 = function() {
      b2({ type: HIDE_LOADER });
    };
    return i2 || T2(), { imageData: S2, designState: R2, hideLoadingSpinner: T2 };
  };
};
var Position$2 = {
  Left: "left",
  Right: "right",
  Top: "top",
  Bottom: "bottom"
};
var BadgeColor = {
  Primary: "primary",
  Secondary: "secondary",
  White: "white"
};
var ButtonColor = {
  Primary: "primary",
  Secondary: "secondary",
  Basic: "basic",
  LinkPrimary: "link-primary",
  LinkSecondary: "link-secondary",
  LinkBasicPrimary: "link-basic-primary",
  LinkBasicSecondary: "link-basic-secondary",
  ErrorPrimary: "error-primary",
  ErrorSecondary: "error-secondary",
  ErrorBasic: "error-basic",
  WarningPrimary: "warning-primary",
  WarningSecondary: "warning-secondary",
  WarningBasic: "warning-basic"
};
var IconButtonColor = {
  Primary: "primary",
  Secondary: "secondary",
  Basic: "basic"
};
var ButtonSize = {
  Xs: "xs",
  Sm: "sm",
  Md: "md",
  Lg: "lg"
};
var InputSize = {
  Sm: "sm",
  Md: "md"
};
var Type$2 = {
  Default: "default",
  Localization: "localization"
};
var errorMixin$2 = function errorMixin(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["color:", " !important;"], palette[Color.Error]);
};
var sizeInputMixin = _defineProperty(_defineProperty({}, InputSize.Sm, "\n    padding: 8px 12px;\n    height: 32px;\n  "), InputSize.Md, "\n    padding: 11px 16px;\n    height: 40px;\n  ");
_defineProperty(_defineProperty({}, InputSize.Sm, "\n    padding: 4px 6px 4px 12px;\n    max-height: 32px;\n  "), InputSize.Md, "\n    padding: 0px 4px 0px 16px;\n    max-height: 40px;\n  ");
var fontSizeInputMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function(_ref) {
  var font = _ref.theme.typography.font;
  return Ae(["", ""], font[FontVariant.InputMd]);
}), InputSize.Md, function(_ref2) {
  var font = _ref2.theme.typography.font;
  return Ae(["", ""], font[FontVariant.InputLg]);
});
var sizeInputLabelMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function(_ref3) {
  var font = _ref3.theme.typography.font;
  return Ae(font[FontVariant.LabelSmall]);
}), InputSize.Md, function(_ref4) {
  var font = _ref4.theme.typography.font;
  return Ae(font[FontVariant.LabelMedium]);
});
var errorMixin$1 = function errorMixin2(_ref5) {
  var palette = _ref5.theme.palette;
  return Ae(["background:", " !important;border:1px solid ", " !important;"], palette[Color.BackgroundSecondary], palette[Color.Error]);
};
var baseClassName$t = "Label";
var Label$6 = /* @__PURE__ */ qe.label.attrs({
  className: generateClassNames(baseClassName$t, "root")
}).withConfig({
  componentId: "sc-16k2ql4-0"
})(function(_ref) {
  var _ref$size = _ref.size, size = _ref$size === void 0 ? InputSize.Md : _ref$size, _ref$error = _ref.error, error2 = _ref$error === void 0 ? false : _ref$error, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, htmlFor = _ref.htmlFor, theme = _ref.theme;
  return Ae(["display:flex;align-items:center;color:", ";font-style:normal;font-weight:normal;", " ", " cursor:", ";", ";"], theme.palette[Color.TextSecondary], disabled && Ae(["color:", ";", "{color:", ";}"], theme.palette[Color.ButtonDisabledText], Icon$6, theme.palette[Color.IconsMuted]), sizeInputLabelMixin[size], htmlFor && "pointer", error2 && errorMixin$2);
});
var Text$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$t, "text")
}).withConfig({
  componentId: "sc-16k2ql4-1"
})(["white-space:nowrap;text-overflow:ellipsis;overflow:hidden;"]);
var Icon$6 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$t, "Icon")
}).withConfig({
  componentId: "sc-16k2ql4-2"
})(function(_ref2) {
  var palette = _ref2.theme.palette, _ref2$$end = _ref2.$end, $end = _ref2$$end === void 0 ? false : _ref2$$end;
  return Ae(["display:flex;", ";color:", ";"], $end ? "margin-left: 4px" : "margin-right: 4px", palette[Color.IconsSecondary]);
});
var Styled$u = applyDisplayNames({
  Label: Label$6,
  Icon: Icon$6,
  Text: Text$2
});
var _excluded$20 = ["children", "iconStart", "iconEnd", "error", "disabled", "size", "type"];
var Label$5 = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, iconStart = _ref.iconStart, iconEnd = _ref.iconEnd, error2 = _ref.error, disabled = _ref.disabled, size = _ref.size, type = _ref.type, rest = _objectWithoutProperties(_ref, _excluded$20);
  var textRef = reactExports.useRef(null);
  var _useState = reactExports.useState(false), _useState2 = _slicedToArray(_useState, 2), isEllipsisActive = _useState2[0], setIsEllipsisActive = _useState2[1];
  var renderIcon = function renderIcon2(icon, end2) {
    return /* @__PURE__ */ React.createElement(Styled$u.Icon, {
      $end: end2
    }, typeof icon === "function" ? icon({
      size: size === "md" ? 14 : 12
    }) : icon);
  };
  var getTextTooltip = function getTextTooltip2() {
    if (typeof children === "string" && isEllipsisActive) {
      return children;
    }
  };
  var handleTextTooltip = function handleTextTooltip2() {
    if (textRef.current !== null && textRef.current) {
      var _textRef$current, _textRef$current2;
      setIsEllipsisActive((textRef === null || textRef === void 0 || (_textRef$current = textRef.current) === null || _textRef$current === void 0 ? void 0 : _textRef$current.offsetWidth) < (textRef === null || textRef === void 0 || (_textRef$current2 = textRef.current) === null || _textRef$current2 === void 0 ? void 0 : _textRef$current2.scrollWidth));
    }
  };
  return /* @__PURE__ */ React.createElement(Styled$u.Label, _extends({
    ref,
    error: error2,
    disabled,
    size,
    type
  }, rest), iconStart && renderIcon(iconStart, false), /* @__PURE__ */ React.createElement(Styled$u.Text, {
    title: getTextTooltip(),
    onMouseOver: handleTextTooltip,
    ref: textRef
  }, children), iconEnd && renderIcon(iconEnd, true));
});
Label$5.defaultProps = {
  type: Type$2.Default,
  error: false
};
var propTypes$9 = {
  type: PropTypes.oneOf(objectValues(Type$2)),
  iconStart: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  iconEnd: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  error: PropTypes.bool,
  size: PropTypes.oneOf(objectValues(InputSize)),
  htmlFor: PropTypes.string
};
Label$5.propTypes = propTypes$9;
var StyledToolsBar = qe.div.withConfig({ componentId: "sc-dwg14p-0" })(["width:fit-content;margin:0 auto;max-width:99.5%;max-height:170px;[data-phone='true'] &{padding:0;margin-top:8px;max-height:initial;}"]), StyledToolsBarItems = qe.div.withConfig({ componentId: "sc-dwg14p-1" })(["padding:8px 16px 16px 16px;display:flex;gap:12px;align-items:center;overflow:hidden;", ""], function(a) {
  var b2 = a.isPhoneScreen;
  return b2 && "\n    justify-content: space-between;\n    padding: 12px;\n    gap: 8px;\n  ";
}), StyledToolsBarItemButton = qe.div.withConfig({ componentId: "sc-dwg14p-2" })(function(a) {
  var b2 = a.theme, c2 = a.isPhoneScreen;
  return "\n    display: flex;\n    gap: 6px;\n    border-radius: 2px;\n    align-items: center;\n    justify-content: center;\n    padding: 8px 12px;\n\n    svg {\n      color: ".concat(b2.palette[Color.IconsPrimary], ";\n    }\n\n    &,\n    * {\n      cursor: pointer;\n    }\n\n    &:hover {\n      ").concat(!c2 && "background: ".concat(b2.palette["bg-primary-active"], ";"), "\n    }\n\n    &[aria-selected='true'] {\n      ").concat(!c2 && "background: ".concat(b2.palette["bg-primary-active"], ";"), "\n      border-radius: 4px;\n\n      * {\n        color: ").concat(b2.palette["accent-primary-active"], ";\n      }\n    }\n\n    ").concat(c2 && Ae(["display:flex;flex-direction:column;min-width:52px;min-height:52px;padding:8px;gap:4px;"]), "\n  ");
}), StyledToolsBarItemButtonLabel = qe(Label$5).withConfig({ componentId: "sc-dwg14p-3" })(function(a) {
  var b2 = a.theme, c2 = a.isPhoneScreen;
  return Ae(["color:", ";", ";"], b2.palette[Color.TextPrimary], c2 && b2.typography.font[FontVariant.LabelExtraSmallUp]);
}), StyledToolsBarItemOptionsWrapper = qe.div.withConfig({ componentId: "sc-dwg14p-4" })(["position:relative;width:100%;transition:max-height 100ms ease-in-out;display:flex;justify-content:center;align-items:center;gap:24px;", ";", ""], function(a) {
  return "\n      max-height: ".concat(a.hasChildren ? "56px" : 0, ";\n      margin: ").concat(a.hasChildren ? "0 auto 8px" : 0, ";\n    ");
}, function(a) {
  var b2 = a.isPhoneScreen;
  return b2 && "\n    max-height: unset;\n    flex-direction: column;\n    padding: 0 12px 8px 12px;\n    gap: 8px;\n    margin: 0;\n  ";
});
var ToolsBarItemButton = function(a) {
  var b2 = a.id, c2 = a.label, d2 = a.onClick, e2 = a.Icon, f2 = a.isSelected, g2 = a.children, h2 = a.className, i = usePhoneScreen(320);
  return React.createElement(StyledToolsBarItemButton, { className: h2, onClick: function handleClick(a2) {
    d2(b2, a2);
  }, "aria-selected": f2, isPhoneScreen: i }, React.createElement(e2, { size: i ? 20 : 16 }), c2 && React.createElement(StyledToolsBarItemButtonLabel, { isPhoneScreen: i }, c2), g2);
};
ToolsBarItemButton.defaultProps = { isSelected: false, id: void 0, children: null, label: "" };
const ToolsBarItemButton$1 = reactExports.memo(ToolsBarItemButton);
var Brightness = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_brightness-tool-button", id: TOOLS_IDS.BRIGHTNESS, label: d2("brightnessTool"), Icon: Brightness$1, onClick: b2, isSelected: c2 });
};
Brightness.defaultProps = { isSelected: false };
function useControlled(_ref) {
  var controlled = _ref.controlled, defaultProp = _ref["default"];
  var _React$useRef = reactExports.useRef(controlled !== void 0), isControlled = _React$useRef.current;
  var _React$useState = reactExports.useState(defaultProp), _React$useState2 = _slicedToArray(_React$useState, 2), valueState = _React$useState2[0], setValue = _React$useState2[1];
  var value = isControlled ? controlled : valueState;
  var setValueIfUncontrolled = reactExports.useCallback(function(newValue) {
    if (!isControlled) {
      setValue(newValue);
    }
  }, []);
  return [value, setValueIfUncontrolled];
}
var useEnhancedEffect = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect;
function useEventCallback(fn2) {
  var ref = reactExports.useRef(fn2);
  useEnhancedEffect(function() {
    ref.current = fn2;
  });
  return reactExports.useCallback(function() {
    return (
      // @ts-expect-error hide `this`
      // tslint:disable-next-line:ban-comma-operator
      ref.current.apply(void 0, arguments)
    );
  }, []);
}
var LabelTooltip$1 = {
  Auto: "auto",
  On: "on",
  Off: "off"
};
var baseClassName$s = "Slider";
var Slider$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$s, "root")
}).withConfig({
  componentId: "sc-jjink6-0"
})(function(_ref) {
  var theme = _ref.theme, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled;
  return Ae(["display:inline-block;border-radius:2px;position:relative;cursor:pointer;touch-action:none;color:", ";height:4px;width:100%;padding:12px 0;"], disabled ? theme.palette[Color.AccentPrimaryDisabled] : theme.palette[Color.BorderActiveBottom]);
});
var Rail = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$s, "rail")
}).withConfig({
  componentId: "sc-jjink6-1"
})(["display:block;position:absolute;border-radius:inherit;background-color:currentColor;opacity:0.38;width:100%;height:inherit;top:50%;transform:translateY(-50%);"]);
var Track = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$s, "Track")
}).withConfig({
  componentId: "sc-jjink6-2"
})(["display:block;position:absolute;border-radius:inherit;border:1px solid currentColor;background-color:currentColor;height:inherit;top:50%;transform:translateY(-50%);"]);
var Thumb = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$s, "thumb")
}).withConfig({
  componentId: "sc-jjink6-3"
})(["position:absolute;width:15px;height:15px;box-sizing:border-box;border-radius:50%;outline:0;background-color:currentColor;display:flex;align-items:center;justify-content:center;top:50%;transform:translate(-50%,-50%);& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"]);
var LabelTooltip = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$s, "label")
}).withConfig({
  componentId: "sc-jjink6-4"
})(function(_ref2) {
  var theme = _ref2.theme, _ref2$open = _ref2.open, open = _ref2$open === void 0 ? false : _ref2$open, _ref2$disabled = _ref2.disabled, disabled = _ref2$disabled === void 0 ? false : _ref2$disabled;
  return Ae(["display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:", ";background-color:", ";color:#fff;cursor:pointer;transition:all 100ms ease-out;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}"], open ? "translateY(-100%) scale(1)" : "translateY(-100%) scale(0)", disabled ? theme.palette[Color.AccentPrimaryDisabled] : theme.palette[Color.LinkStateless]);
});
var SliderAnnotation = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$s, "annotation")
}).withConfig({
  componentId: "sc-jjink6-5"
})(function(_ref3) {
  var theme = _ref3.theme;
  return Ae(["display:flex;justify-content:space-between;margin-top:12px;color:", ";"], theme.palette[Color.TextSecondary]);
});
var Styled$t = applyDisplayNames({
  Slider: Slider$2,
  Rail,
  Track,
  Thumb,
  SliderAnnotation,
  LabelTooltip
});
var _excluded$1$ = ["defaultValue", "disabled", "disableSwap", "hideTrack", "hideAnnotation", "value", "min", "max", "onChange", "onMouseDown", "onMouseUp", "step", "labelTooltip", "annotation", "components", "componentsProps"];
function ownKeys$10(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$10(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$10(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$10(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
var dataIndex = "data-index";
var Slider$1 = intrinsicComponent$1(function(_ref, ref) {
  var defaultValue = _ref.defaultValue, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$disableSwap = _ref.disableSwap, disableSwap = _ref$disableSwap === void 0 ? false : _ref$disableSwap, _ref$hideTrack = _ref.hideTrack, hideTrack = _ref$hideTrack === void 0 ? false : _ref$hideTrack, _ref$hideAnnotation = _ref.hideAnnotation, hideAnnotation = _ref$hideAnnotation === void 0 ? false : _ref$hideAnnotation, valueProp = _ref.value, _ref$min = _ref.min, min2 = _ref$min === void 0 ? 0 : _ref$min, _ref$max = _ref.max, max2 = _ref$max === void 0 ? 100 : _ref$max, onChange2 = _ref.onChange, onMouseDown = _ref.onMouseDown, onMouseUp = _ref.onMouseUp, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step, _ref$labelTooltip = _ref.labelTooltip, labelTooltip = _ref$labelTooltip === void 0 ? LabelTooltip$1.Off : _ref$labelTooltip, _ref$annotation = _ref.annotation, annotation = _ref$annotation === void 0 ? "" : _ref$annotation, _ref$components = _ref.components, components = _ref$components === void 0 ? {} : _ref$components, _ref$componentsProps = _ref.componentsProps, componentsProps = _ref$componentsProps === void 0 ? {} : _ref$componentsProps, rest = _objectWithoutProperties(_ref, _excluded$1$);
  var _useState = reactExports.useState(-1), _useState2 = _slicedToArray(_useState, 2), active = _useState2[0], setActive = _useState2[1];
  var _useState3 = reactExports.useState(-1), _useState4 = _slicedToArray(_useState3, 2), open = _useState4[0], setOpen = _useState4[1];
  var _useState5 = reactExports.useState(false), _useState6 = _slicedToArray(_useState5, 2), dragging = _useState6[0], setDragging = _useState6[1];
  var moveCount = reactExports.useRef(0);
  var previousIndex = reactExports.useRef(0);
  var touchId = reactExports.useRef();
  var sliderRef = reactExports.useRef(null);
  var handleRef = useForkRef(ref, sliderRef);
  var _useControlled = useControlled({
    controlled: valueProp,
    "default": defaultValue !== null && defaultValue !== void 0 ? defaultValue : min2
  }), _useControlled2 = _slicedToArray(_useControlled, 2), valueDerived = _useControlled2[0], setValueState = _useControlled2[1];
  var axis = "horizontal";
  var range = Array.isArray(valueDerived);
  var values = range ? valueDerived.slice().sort(asc) : [valueDerived];
  var getFingerNewValue = function getFingerNewValue2(_ref2) {
    var finger = _ref2.finger, _ref2$move = _ref2.move, move = _ref2$move === void 0 ? false : _ref2$move, values2 = _ref2.values;
    var slider = sliderRef.current;
    if (slider) {
      var _slider$getBoundingCl = slider.getBoundingClientRect(), width = _slider$getBoundingCl.width, height = _slider$getBoundingCl.height, bottom2 = _slider$getBoundingCl.bottom, left2 = _slider$getBoundingCl.left;
      var percent;
      if (axis.indexOf("vertical") === 0) {
        percent = (bottom2 - finger.y) / height;
      } else {
        percent = (finger.x - left2) / width;
      }
      if (axis.includes("-reverse")) {
        percent = 1 - percent;
      }
      var newValue;
      newValue = percentToValue(percent, min2, max2);
      if (step) {
        newValue = roundValueToStep(newValue, step, min2);
      }
      newValue = clamp(newValue, min2, max2);
      var activeIndex = 0;
      if (range) {
        if (!move) {
          activeIndex = findClosest(values2, newValue);
        } else {
          activeIndex = previousIndex.current;
        }
        if (disableSwap) {
          newValue = clamp(newValue, values2[activeIndex - 1] || -Infinity, values2[activeIndex + 1] || Infinity);
        }
        var previousValue = newValue;
        newValue = setValueIndex({
          values: values2,
          newValue,
          index: activeIndex
        });
        if (!(disableSwap && move) && Array.isArray(newValue)) {
          activeIndex = newValue.indexOf(previousValue);
          previousIndex.current = activeIndex;
        }
      }
      return {
        newValue,
        activeIndex
      };
    }
    return null;
  };
  var handleChange = function handleChange2(event, value, thumbIndex) {
    if (onChange2) {
      onChange2(event, value, thumbIndex);
    }
  };
  var handleHiddenInputChange = function handleHiddenInputChange2(event) {
    var index = Number(event.currentTarget.getAttribute(dataIndex));
    var newValue = event.target.valueAsNumber;
    if (range) {
      if (disableSwap) {
        newValue = clamp(newValue, values[index - 1] || -Infinity, values[index + 1] || Infinity);
      }
      var previousValue = newValue;
      newValue = setValueIndex({
        values,
        newValue,
        index
      });
      var activeIndex = index;
      if (!disableSwap) {
        activeIndex = newValue.indexOf(previousValue);
      }
      focusThumb({
        sliderRef,
        activeIndex
      });
    }
    setValueState(newValue);
    handleChange(event, newValue, index);
    if (onMouseUp) {
      onMouseUp(event);
    }
  };
  var handleTouchMove = useEventCallback(function(nativeEvent) {
    var finger = trackFinger(nativeEvent, touchId);
    if (!finger) {
      return;
    }
    moveCount.current += 1;
    if (nativeEvent.type === "mousemove" && nativeEvent.buttons === 0) {
      handleTouchEnd(nativeEvent);
      return;
    }
    var _ref3 = getFingerNewValue({
      finger,
      move: true,
      values
    }), newValue = _ref3.newValue, activeIndex = _ref3.activeIndex;
    focusThumb({
      sliderRef,
      activeIndex,
      setActive
    });
    setValueState(newValue);
    if (!dragging && moveCount.current > INTENTIONAL_DRAG_COUNT_THRESHOLD) {
      setDragging(true);
    }
    handleChange(nativeEvent, newValue, activeIndex);
  });
  var handleTouchEnd = useEventCallback(function(nativeEvent) {
    var finger = trackFinger(nativeEvent, touchId);
    setDragging(false);
    if (!finger) {
      return;
    }
    setActive(-1);
    if (nativeEvent.type === "touchend") {
      setOpen(-1);
    }
    if (onMouseUp) {
      onMouseUp(nativeEvent);
    }
    touchId.current = void 0;
    stopListening();
  });
  var handleTouchStart = useEventCallback(function(nativeEvent) {
    var touch = nativeEvent.changedTouches[0];
    if (touch != null) {
      touchId.current = touch.identifier;
    }
    var finger = trackFinger(nativeEvent, touchId);
    var _ref4 = getFingerNewValue({
      finger,
      values
    }), newValue = _ref4.newValue, activeIndex = _ref4.activeIndex;
    focusThumb({
      sliderRef,
      activeIndex,
      setActive
    });
    setValueState(newValue);
    handleChange(nativeEvent, newValue, activeIndex);
    moveCount.current = 0;
    var doc = ownerDocument(sliderRef.current);
    doc.addEventListener("touchmove", handleTouchMove);
    doc.addEventListener("touchend", handleTouchEnd);
  });
  var handleMouseOver = useEventCallback(function(event) {
    var index = Number(event.currentTarget.getAttribute(dataIndex));
    setOpen(index);
  });
  var handleMouseLeave = useEventCallback(function() {
    setOpen(-1);
  });
  var handleMouseDown = useEventCallback(function(event) {
    if (!disabled) {
      if (onMouseDown) {
        onMouseDown(event);
      }
      if (event.button !== 0) {
        return;
      }
      event.preventDefault();
      var finger = trackFinger(event, touchId);
      var _ref5 = getFingerNewValue({
        finger,
        values
      }), newValue = _ref5.newValue, activeIndex = _ref5.activeIndex;
      focusThumb({
        sliderRef,
        activeIndex,
        setActive
      });
      setValueState(newValue);
      handleChange(event, newValue, activeIndex);
      moveCount.current = 0;
      var doc = ownerDocument(sliderRef.current);
      doc.addEventListener("mousemove", handleTouchMove);
      doc.addEventListener("mouseup", handleTouchEnd);
    } else {
      event.preventDefault();
    }
  });
  var stopListening = reactExports.useCallback(function() {
    var doc = ownerDocument(sliderRef.current);
    doc.removeEventListener("mousemove", handleTouchMove);
    doc.removeEventListener("mouseup", handleTouchEnd);
    doc.removeEventListener("touchmove", handleTouchMove);
    doc.removeEventListener("touchend", handleTouchEnd);
  }, [handleTouchEnd, handleTouchMove]);
  reactExports.useEffect(function() {
    var slider = sliderRef.current;
    if (slider) {
      return function() {
        stopListening();
      };
    }
  }, [stopListening, handleTouchStart]);
  reactExports.useEffect(function() {
    if (disabled) {
      stopListening();
    }
  }, [disabled, stopListening]);
  if (disabled && active !== -1) {
    setActive(-1);
  }
  var trackOffset = valueToPercent(range ? values[0] : min2, min2, max2);
  var trackLeap = valueToPercent(values[values.length - 1], min2, max2) - trackOffset;
  var trackStyle = _objectSpread$10(_objectSpread$10({}, axisProps[axis].offset(trackOffset)), axisProps[axis].leap(trackLeap));
  var railProps = componentsProps.rail;
  var Rail2 = typeof components.Rail === "function" ? /* @__PURE__ */ React.createElement(components.Rail, _extends({}, railProps, {
    style: _objectSpread$10({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)
  })) : /* @__PURE__ */ React.createElement(Styled$t.Rail, _extends({}, railProps, {
    style: _objectSpread$10({}, railProps === null || railProps === void 0 ? void 0 : railProps.style)
  }));
  var trackProps = componentsProps.track;
  var Track2 = !hideTrack && (typeof components.Track === "function" ? /* @__PURE__ */ React.createElement(components.Track, _extends({}, trackProps, {
    style: _objectSpread$10(_objectSpread$10({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)
  })) : /* @__PURE__ */ React.createElement(Styled$t.Track, _extends({}, trackProps, {
    style: _objectSpread$10(_objectSpread$10({}, trackStyle), trackProps === null || trackProps === void 0 ? void 0 : trackProps.style)
  })));
  var thumbProps = componentsProps.thumb;
  var Thumb2 = components.Thumb || Styled$t.Thumb;
  var LabelTooltipComponent = components.LabelTooltip || Styled$t.LabelTooltip;
  var labelTooltipProps = componentsProps.labelTooltip;
  var annotationText = annotation ? " ".concat(annotation) : "";
  return /* @__PURE__ */ React.createElement(Styled$t.Slider, _extends({
    ref: handleRef,
    disabled,
    onTouchStart: handleTouchStart,
    onMouseDown: handleMouseDown
  }, rest), Rail2, Track2, values.map(function(value, index) {
    var percent = valueToPercent(value, min2, max2);
    var style2 = axisProps[axis].offset(percent);
    return /* @__PURE__ */ React.createElement(React.Fragment, {
      key: index
    }, /* @__PURE__ */ React.createElement(Thumb2, _extends({
      "data-index": index,
      onMouseOver: handleMouseOver,
      onMouseLeave: handleMouseLeave
    }, thumbProps, {
      style: _objectSpread$10(_objectSpread$10({}, style2), {}, {
        pointerEvents: disableSwap && active !== index ? "none" : void 0
      }, thumbProps === null || thumbProps === void 0 ? void 0 : thumbProps.style)
    }), /* @__PURE__ */ React.createElement("input", {
      "data-index": index,
      type: "range",
      min: min2,
      max: max2,
      value: values[index],
      step,
      disabled,
      onChange: handleHiddenInputChange
    }), /* @__PURE__ */ React.createElement(LabelTooltipComponent, {
      open: (open === index || active === index || labelTooltip === "on") && labelTooltip !== "off",
      disabled,
      style: _objectSpread$10({}, labelTooltipProps === null || labelTooltipProps === void 0 ? void 0 : labelTooltipProps.style)
    }, values[index], annotationText)));
  }), !hideAnnotation && /* @__PURE__ */ React.createElement(Styled$t.SliderAnnotation, null, /* @__PURE__ */ React.createElement("span", null, min2, annotationText), /* @__PURE__ */ React.createElement("span", null, max2, annotationText)));
});
Slider$1.defaultProps = {
  annotation: "MB",
  min: 0,
  max: 100,
  step: 1,
  labelTooltip: LabelTooltip$1.Off
};
Slider$1.propTypes = {
  defaultValue: PropTypes.oneOfType([PropTypes.array, PropTypes.number]),
  value: PropTypes.oneOfType([PropTypes.array, PropTypes.number]),
  min: PropTypes.number,
  max: PropTypes.number,
  onChange: PropTypes.func,
  onMouseDown: PropTypes.func,
  onMouseUp: PropTypes.func,
  step: PropTypes.number,
  annotation: PropTypes.string,
  disabled: PropTypes.bool,
  disableSwap: PropTypes.bool,
  hideTrack: PropTypes.bool,
  hideAnnotation: PropTypes.bool,
  labelTooltip: PropTypes.oneOf(objectValues(LabelTooltip$1)),
  components: PropTypes.shape({
    Rail: PropTypes.elementType,
    Track: PropTypes.elementType,
    Thumb: PropTypes.elementType,
    LabelTooltip: PropTypes.elementType
  }),
  componentsProps: PropTypes.object
};
var StyledSlider = qe(Slider$1).withConfig({ componentId: "sc-1wort0h-0" })(["width:", ";max-width:", ";user-select:none;padding:0;margin-bottom:", ";.SfxSlider-thumb{background-color:", ";}.SfxSlider-Track{height:2px;color:", ";}.SfxSlider-rail{height:2px;background-color:", ";}"], function(a) {
  var b2 = a.width;
  return b2 || "104px";
}, function(a) {
  var b2 = a.width;
  return b2 || "104px";
}, function(a) {
  var b2 = a.noMargin;
  return b2 ? "" : "16px";
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.AccentStateless];
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.AccentStateless];
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BordersItem];
});
var _excluded$1_ = ["onChange"];
var Slider = function(a) {
  var b2 = a.onChange, c2 = _objectWithoutProperties(a, _excluded$1_);
  return React.createElement(StyledSlider, _extends({ annotation: "", onChange: function onChange2(a2, c3) {
    return b2 ? b2(c3) : void 0;
  }, hideAnnotation: true, labelTooltip: "auto" }, c2));
};
var iconPropTypes = {
  size: PropTypes.number,
  width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  color: PropTypes.string,
  color2: PropTypes.string,
  stroke: PropTypes.string,
  stroke2: PropTypes.string,
  viewBox: PropTypes.string
};
var _excluded$1Z = ["color", "size"];
var ArrowBottom = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1Z);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 11 12",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M10.8468 3.13984C11.0457 3.33138 11.0517 3.64791 10.8602 3.84682L6.04534 8.84682C5.95332 8.94238 5.82709 8.99746 5.69445 8.99991C5.5618 9.00237 5.43362 8.95201 5.33812 8.85992L0.152931 3.85992C-0.0458479 3.66824 -0.0516033 3.35171 0.140078 3.15293C0.331758 2.95415 0.648288 2.9484 0.847067 3.14008L5.67208 7.79277L10.1398 3.15318C10.3314 2.95427 10.6479 2.9483 10.8468 3.13984Z",
    fill: color
  }));
});
var typeArrowTickMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Position$2.Right, Ae(["svg{transform:rotate(-90deg);transition:transform 150ms ease-out;}"])), Position$2.Left, Ae(["svg{transform:rotate(90deg);transition:transform 150ms ease-out;}"])), Position$2.Top, Ae(["svg{transform:rotate(180deg);transition:transform 150ms ease-out;}"])), Position$2.Bottom, Ae(["svg{transform:rotate(0);transition:transform 150ms ease-out;}"]));
var baseClassName$r = "ArrowTick";
var ArrowTick$1 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$r, "root")
}).withConfig({
  componentId: "sc-tlypde-0"
})(function(_ref) {
  var _ref$type = _ref.type, type = _ref$type === void 0 ? Position$2.Right : _ref$type;
  return Ae(["display:inline-flex;", ""], typeArrowTickMixin[type]);
});
var Styled$s = applyDisplayNames({
  ArrowTick: ArrowTick$1
});
var _excluded$1Y = ["IconProps"];
var ArrowTick = intrinsicComponent$1(function(_ref, ref) {
  var IconPropsData = _ref.IconProps, rest = _objectWithoutProperties(_ref, _excluded$1Y);
  return /* @__PURE__ */ React.createElement(Styled$s.ArrowTick, _extends({}, rest, {
    ref
  }), /* @__PURE__ */ React.createElement(ArrowBottom, IconPropsData));
});
ArrowTick.defaultProps = {
  type: Position$2.Right
};
ArrowTick.propTypes = {
  type: PropTypes.oneOf(objectValues(Position$2)),
  IconProps: PropTypes.exact(iconPropTypes)
};
var baseClassName$q = "AccordionHeader";
var Icon$5 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$q, "icon")
}).withConfig({
  componentId: "sc-1dtjsgt-0"
})(function() {
  return Ae(["display:inline-flex;padding-left:8px;"]);
});
var Label$4 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$q, "label")
}).withConfig({
  componentId: "sc-1dtjsgt-1"
})(function(_ref) {
  var theme = _ref.theme;
  return Ae(["", ""], theme.typography.font[FontVariant.ButtonSm]);
});
var Header$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$q, "root")
}).withConfig({
  componentId: "sc-1dtjsgt-2"
})(function(_ref2) {
  var theme = _ref2.theme, fullWidth = _ref2.fullWidth;
  return Ae(["display:inline-flex;align-items:center;justify-content:space-between;box-sizing:border-box;cursor:pointer;width:", ";color:", ";user-select:none;"], fullWidth ? "100%" : "auto", theme.palette[Color.LinkPrimary]);
});
var Wrapper$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$q, "wrapper")
}).withConfig({
  componentId: "sc-1dtjsgt-3"
})(function(_ref3) {
  var theme = _ref3.theme;
  return Ae(["color:", ";"], theme.palette[Color.LinkPrimary]);
});
var Styled$r = applyDisplayNames({
  Header: Header$1,
  Wrapper: Wrapper$2,
  Icon: Icon$5,
  Label: Label$4
});
var _excluded$1X = ["expanded", "label", "onChange", "onClick", "onContextMenu", "hideIcon", "fullWidth", "iconProps"];
function ownKeys$$(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$$(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$$(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$$(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var AccordionHeader = intrinsicComponent$1(function(_ref, ref) {
  var expanded = _ref.expanded, label = _ref.label, onChange2 = _ref.onChange, _onClick = _ref.onClick, onContextMenu = _ref.onContextMenu, hideIcon = _ref.hideIcon, fullWidth = _ref.fullWidth, iconPropsData = _ref.iconProps, rest = _objectWithoutProperties(_ref, _excluded$1X);
  return /* @__PURE__ */ React.createElement(Styled$r.Header, _extends({
    ref,
    onClick: function onClick(event) {
      if (typeof onChange2 === "function") {
        onChange2(!expanded);
      }
      if (typeof _onClick === "function") {
        _onClick(event);
      }
    },
    fullWidth
  }, rest), /* @__PURE__ */ React.createElement(Styled$r.Label, {
    onContextMenu
  }, label), !hideIcon && /* @__PURE__ */ React.createElement(Styled$r.Icon, {
    onContextMenu
  }, /* @__PURE__ */ React.createElement(ArrowTick, {
    type: expanded ? Position$2.Top : Position$2.Bottom,
    IconProps: _objectSpread$$({
      size: 11
    }, iconPropsData)
  })));
});
AccordionHeader.defaultProps = {
  expanded: false,
  hideIcon: false,
  fullWidth: false
};
AccordionHeader.propTypes = {
  label: PropTypes.node.isRequired,
  expanded: PropTypes.bool,
  hideIcon: PropTypes.bool,
  fullWidth: PropTypes.bool,
  onChange: PropTypes.func,
  iconProps: PropTypes.exact(iconPropTypes)
};
var baseClassName$p = "AccordionDetails";
var AccordionDetails$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$p, "root")
}).withConfig({
  componentId: "sc-1wr6wpr-0"
})(["margin:16px 0;"]);
var Styled$q = applyDisplayNames({
  AccordionDetails: AccordionDetails$1
});
var _excluded$1W = ["expanded", "children"];
var AccordionDetails = intrinsicComponent$1(function(_ref, ref) {
  var expanded = _ref.expanded, children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$1W);
  return /* @__PURE__ */ React.createElement(React.Fragment, null, expanded && /* @__PURE__ */ React.createElement(Styled$q.AccordionDetails, _extends({
    ref
  }, rest), children));
});
AccordionDetails.defaultProps = {
  expanded: false
};
AccordionDetails.propTypes = {
  expanded: PropTypes.bool
};
var baseClassName$o = "Accordion";
var Accordion$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$o, "root")
}).withConfig({
  componentId: "sc-1g4tz7s-0"
})([""]);
var Styled$p = applyDisplayNames({
  Accordion: Accordion$1
});
var _excluded$1V = ["label", "expanded", "children", "detailStyle", "headerStyle", "fullWidth", "iconProps", "onClick", "onChange", "onContextMenu", "hideIcon"];
function ownKeys$_(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$_(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$_(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$_(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Accordion = intrinsicComponent$1(function(_ref, ref) {
  var label = _ref.label, expanded = _ref.expanded, children = _ref.children, detailStyle = _ref.detailStyle, headerStyle = _ref.headerStyle, fullWidth = _ref.fullWidth, iconPropsData = _ref.iconProps, _onClick = _ref.onClick, onChange2 = _ref.onChange, onContextMenu = _ref.onContextMenu, hideIcon = _ref.hideIcon, rest = _objectWithoutProperties(_ref, _excluded$1V);
  return /* @__PURE__ */ React.createElement(Styled$p.Accordion, _extends({
    ref
  }, rest), /* @__PURE__ */ React.createElement(AccordionHeader, {
    label,
    expanded,
    style: _objectSpread$_({}, headerStyle),
    hideIcon,
    onClick: function onClick(event) {
      if (typeof onChange2 === "function") {
        onChange2(!expanded, event);
      }
      if (typeof _onClick === "function") {
        _onClick(event);
      }
    },
    onContextMenu,
    iconProps: iconPropsData,
    fullWidth
  }), /* @__PURE__ */ React.createElement(AccordionDetails, {
    expanded,
    style: _objectSpread$_({}, detailStyle)
  }, children));
});
Accordion.defaultProps = {
  expanded: false,
  hideIcon: false
};
Accordion.propTypes = {
  label: PropTypes.node.isRequired,
  expanded: PropTypes.bool,
  detailStyle: PropTypes.object,
  headerStyle: PropTypes.object,
  onChange: PropTypes.func,
  onContextMenu: PropTypes.func,
  hideIcon: PropTypes.bool,
  fullWidth: PropTypes.bool,
  iconProps: PropTypes.exact(iconPropTypes)
};
var _excluded$1U = ["stroke", "size"];
var Arrow$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$stroke = _ref.stroke, stroke = _ref$stroke === void 0 ? "currentColor" : _ref$stroke, _ref$size = _ref.size, size = _ref$size === void 0 ? 10 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1U);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size * (51 / 56),
    height: size,
    viewBox: "0 0 51 56",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M12.2754 3L37.2754 27.0741L12.2754 53",
    stroke,
    strokeWidth: "5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }));
});
var _excluded$1T = ["color", "size"];
var Tick = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1T);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 14 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M12.9783 2.30184C12.7972 2.12074 12.586 2 12.3143 2C12.0728 2 11.8314 2.09055 11.6503 2.30184L4.73816 9.84779L2.29327 7.34254C2.11217 7.16143 1.8707 7.07088 1.62923 7.07088C1.38776 7.07088 1.14629 7.19162 0.995367 7.37272C0.663345 7.76511 0.663345 8.36879 1.02555 8.73099L4.13448 11.9003C4.31559 12.0814 4.52687 12.1719 4.76835 12.1719C5.00982 12.1719 5.25129 12.0814 5.43239 11.8701L12.9783 3.62993C13.3406 3.2979 13.3406 2.66404 12.9783 2.30184Z",
    fill: color
  }));
});
var _excluded$1S = ["color", "size"];
var CopyOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1S);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 16 16",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2.33984 12.111V2.04761C2.33984 1.49532 2.78756 1.04761 3.33984 1.04761H10.8182C11.3705 1.04761 11.8182 1.49532 11.8182 2.04761V12.111C11.8182 12.6633 11.3705 13.111 10.8182 13.111H3.33984C2.78756 13.111 2.33984 12.6633 2.33984 12.111ZM3.33984 12.111V2.04761L10.8182 2.04761L10.8182 12.111L3.33984 12.111Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M13.66 4.97388C13.66 4.69774 13.4361 4.47388 13.16 4.47388C12.8838 4.47388 12.66 4.69774 12.66 4.97388V13.9523H5.40491C5.12876 13.9523 4.90491 14.1761 4.90491 14.4523C4.90491 14.7284 5.12876 14.9523 5.40491 14.9523H13.16C13.4361 14.9523 13.66 14.7284 13.66 14.4523V4.97388Z",
    fill: color
  }));
});
var _excluded$1R = ["color", "size"];
var EyeOpen = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1R);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 32",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M25 31.625C8.64336 31.625 0.533984 17.3656 0.196875 16.759C-0.065625 16.2867 -0.065625 15.7129 0.196875 15.2406C0.533984 14.6344 8.64336 0.375 25 0.375C41.3566 0.375 49.466 14.6344 49.8031 15.241C50.0656 15.7133 50.0656 16.2871 49.8031 16.7594C49.466 17.3656 41.3566 31.625 25 31.625ZM3.40117 15.9977C5.25977 18.8145 12.557 28.5 25 28.5C37.4824 28.5 44.7473 18.8223 46.5988 16.0023C44.7402 13.1855 37.443 3.5 25 3.5C12.5176 3.5 5.25273 13.1777 3.40117 15.9977ZM25 25.375C19.8305 25.375 15.625 21.1695 15.625 16C15.625 10.8305 19.8305 6.625 25 6.625C30.1695 6.625 34.375 10.8305 34.375 16C34.375 21.1695 30.1695 25.375 25 25.375ZM25 9.75C21.5539 9.75 18.75 12.5539 18.75 16C18.75 19.4461 21.5539 22.25 25 22.25C28.4461 22.25 31.25 19.4461 31.25 16C31.25 12.5539 28.4461 9.75 25 9.75Z",
    fill: color
  }));
});
var _excluded$1Q = ["color", "size"];
var EyeClosed = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1Q);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 44 44",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M36.2553 6.05501C36.5966 5.71376 37.1514 5.71376 37.4926 6.05501C37.8339 6.39626 37.8339 6.95103 37.4926 7.29228L32.3765 12.4084C38.3601 15.8067 42.6046 20.7607 42.7917 20.9825C43.0682 21.3097 43.0699 21.7874 42.7936 22.113C42.3893 22.5908 32.7818 33.7978 22.0001 33.7978C18.9909 33.7978 15.9678 33.1203 13.0065 31.7785L7.74272 37.0423C7.57292 37.2121 7.34897 37.2978 7.12495 37.2978C6.90092 37.2978 6.67698 37.212 6.50545 37.0423C6.1642 36.701 6.1642 36.1462 6.50545 35.805L17.0426 25.2678C17.0453 25.265 17.0481 25.2622 17.0509 25.2595C17.0531 25.2573 17.0553 25.2551 17.0575 25.2529L25.7063 16.6041C25.7081 16.6023 25.7098 16.6005 25.7116 16.5987C25.7134 16.5969 25.7152 16.5952 25.717 16.5934L30.2895 12.0208C30.3028 12.0067 30.3164 11.9931 30.3304 11.9799L36.2553 6.05501ZM31.0895 13.6954L27.5301 17.2548C28.4835 18.476 28.9998 19.9721 28.9998 21.5478C28.9998 25.4083 25.8603 28.5478 21.9999 28.5478C20.4242 28.5478 18.9281 28.0314 17.7069 27.078L14.3353 30.4497C16.8728 31.5113 19.445 32.0478 22 32.0478C30.6537 32.0478 38.863 23.8071 40.9489 21.5478C39.6267 20.1195 35.855 16.3016 31.0895 13.6954ZM18.9574 25.8276C19.8392 26.458 20.8929 26.7977 21.9999 26.7977C24.8943 26.7977 27.2499 24.4422 27.2499 21.5477C27.2499 20.4409 26.9092 19.3873 26.2793 18.5056L18.9574 25.8276Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M27.7418 10.3057C25.7504 9.63545 23.8184 9.29773 22.0001 9.29773C11.2183 9.29773 1.61084 20.5047 1.20659 20.9825C0.951064 21.2835 0.930064 21.721 1.15762 22.0482C1.27837 22.2215 4.17111 26.3287 9.18485 29.659C9.33358 29.7587 9.49985 29.806 9.66785 29.806C9.94963 29.806 10.2279 29.6695 10.3959 29.4122C10.6636 29.0115 10.5534 28.4672 10.1509 28.2012C6.46889 25.753 3.94889 22.7973 3.00561 21.595C5.01989 19.4075 13.2834 11.0478 22.0001 11.0478C23.6293 11.0478 25.3741 11.3558 27.1835 11.963C27.642 12.1275 28.139 11.8738 28.2913 11.4135C28.4453 10.955 28.2003 10.4598 27.7418 10.3057Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M23.2197 14.6685C22.8224 14.5985 22.4164 14.5477 22 14.5477C18.1395 14.5477 15 17.6872 15 21.5477C15 21.9642 15.0508 22.3702 15.1225 22.7674C15.1977 23.1909 15.567 23.4902 15.9817 23.4902C16.0325 23.4902 16.0832 23.4867 16.1357 23.4762C16.6099 23.3922 16.9285 22.9371 16.8445 22.4629C16.7902 22.1654 16.75 21.8627 16.75 21.5477C16.75 18.6532 19.1055 16.2977 22 16.2977C22.315 16.2977 22.6177 16.338 22.9152 16.3905C23.3807 16.485 23.8444 16.1559 23.9284 15.6817C24.0124 15.2075 23.694 14.7525 23.2197 14.6685Z",
    fill: color
  }));
});
var getInputBackgroundColor = function getInputBackgroundColor2(readOnly, disabled) {
  if (readOnly || disabled) {
    return lightPalette[Color.BackgroundHover];
  }
  return lightPalette[Color.BackgroundStateless];
};
var getInputTextColor = function getInputTextColor2(readOnly, disabled) {
  if (readOnly) {
    return lightPalette[Color.AccentPrimaryHover];
  }
  if (disabled) {
    return lightPalette[Color.TextPlaceholder];
  }
  return lightPalette[Color.TextPrimary];
};
var getInputBorderColor = function getInputBorderColor2(readOnly, disabled) {
  if (readOnly) {
    return lightPalette[Color.BordersItem];
  }
  if (disabled) {
    return lightPalette[Color.BordersSecondary];
  }
  return lightPalette[Color.BorderPrimaryStateless];
};
var handleCopyIcon = function handleCopyIcon2(value, setShowCopyMessage) {
  navigator.clipboard.writeText(value);
  setShowCopyMessage(true);
};
var Type$1 = {
  Text: "text",
  Password: "password"
};
var baseClassName$n = "Input";
var Icon$4 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$n, "Icon")
}).withConfig({
  componentId: "sc-150k0cz-0"
})(function(_ref) {
  var iconClickStart = _ref.iconClickStart, iconClickEnd = _ref.iconClickEnd, disabled = _ref.disabled, readOnly = _ref.readOnly, iconType = _ref.iconType, palette = _ref.theme.palette;
  return Ae(["display:flex;color:", ";cursor:", ";flex-shrink:0;", ""], palette[Color.IconsPrimary], (iconClickStart || iconClickEnd) && !disabled && !readOnly ? "pointer" : "default", iconType === "end" && Ae(["color:", ";"], palette[Color.IconsSecondary]));
});
var CopyIcon$1 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$n, "CopyIcon")
}).withConfig({
  componentId: "sc-150k0cz-1"
})(function(_ref2) {
  var palette = _ref2.theme.palette;
  return Ae(["display:flex;color:", ";cursor:pointer;"], palette[Color.IconsSecondary]);
});
var PasswordIcon = /* @__PURE__ */ qe(CopyIcon$1).attrs({
  className: generateClassNames(baseClassName$n, "PasswordIcon")
}).withConfig({
  componentId: "sc-150k0cz-2"
})([""]);
var Container$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$n, "Container")
}).withConfig({
  componentId: "sc-150k0cz-3"
})(function() {
  return Ae(["display:block;color:inherit;font-size:inherit;width:100%;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;"]);
});
var Base$1 = /* @__PURE__ */ qe.input.attrs({
  className: generateClassNames(baseClassName$n, "Base")
}).withConfig({
  componentId: "sc-150k0cz-4"
})(function(_ref3) {
  var palette = _ref3.theme.palette, _ref3$isEllipsis = _ref3.isEllipsis, isEllipsis = _ref3$isEllipsis === void 0 ? false : _ref3$isEllipsis;
  return Ae(["display:block;color:inherit;width:100%;min-width:fit-content;margin:0;padding:0;border:0;background-color:transparent;outline:none;", " &::placeholder{color:", ";}"], isEllipsis && Ae(["text-overflow:ellipsis;"]), palette[Color.TextPlaceholder]);
});
var Input$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$n, "root")
}).withConfig({
  componentId: "sc-150k0cz-5"
})(function(_ref4) {
  var _ref4$size = _ref4.size, size = _ref4$size === void 0 ? InputSize.Md : _ref4$size, _ref4$error = _ref4.error, error2 = _ref4$error === void 0 ? false : _ref4$error, _ref4$fullWidth = _ref4.fullWidth, fullWidth = _ref4$fullWidth === void 0 ? false : _ref4$fullWidth, _ref4$readOnly = _ref4.readOnly, readOnly = _ref4$readOnly === void 0 ? false : _ref4$readOnly, _ref4$disabled = _ref4.disabled, disabled = _ref4$disabled === void 0 ? false : _ref4$disabled, _ref4$isHovering = _ref4.isHovering, isHovering = _ref4$isHovering === void 0 ? false : _ref4$isHovering, _ref4$isSelectedItems = _ref4.isSelectedItems, isSelectedItems = _ref4$isSelectedItems === void 0 ? false : _ref4$isSelectedItems, theme = _ref4.theme;
  return Ae(["position:relative;display:inline-flex;align-items:center;box-sizing:border-box;column-gap:8px;cursor:text;transition:all 100ms ease-out;width:", ";pointer-events:", ";background-color:", ";border-radius:", ";border:1px solid ", ";color:", ";", " ", ";", "{", "}", " ", " &:hover{color:", ";}", ""], fullWidth ? "100%" : "300px", disabled ? "none" : "auto", getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BorderRadiusSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[Color.TextPlaceholder] : theme.palette[Color.TextPrimary], sizeInputMixin[size], isSelectedItems && "\n      height: fit-content;\n\n      ".concat(Base$1, " {\n        max-width: fit-content;\n        min-width: 20px;\n        flex-grow: 1;\n        width: 40px;\n      }\n    "), Base$1, fontSizeInputMixin[size], !readOnly && !disabled && Ae(["&:focus-within{background-color:", "!important;border:1px solid ", ";&:hover{border:1px solid ", ";", "{color:", ";}}}", " &:hover{background-color:", ";border:1px solid ", ";", "{color:", ";}}"], theme.palette[Color.BackgroundSecondary], theme.palette[Color.AccentStateless], theme.palette[Color.AccentStateless], Icon$4, theme.palette[Color.IconsPrimary], isHovering && Ae(["", "{color:", ";}"], Icon$4, theme.palette[Color.IconsPrimaryHover]), theme.palette[Color.BackgroundStateless], theme.palette[Color.BordersPrimaryHover], Icon$4, theme.palette[Color.IconsPrimaryHover]), disabled && Ae(["", "{color:", ";}"], Icon$4, theme.palette[Color.IconsMuted]), getInputTextColor(readOnly, disabled), error2 && errorMixin$1);
});
var ClearIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$n, "ClearIcon")
}).withConfig({
  componentId: "sc-150k0cz-6"
})(function(_ref5) {
  var palette = _ref5.theme.palette;
  return Ae(["display:flex;cursor:pointer;color:", ";"], palette[Color.IconsPrimary]);
});
var NotificationBox = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$n, "NotificationBox")
}).withConfig({
  componentId: "sc-150k0cz-7"
})(function(_ref6) {
  var _ref6$size = _ref6.size, size = _ref6$size === void 0 ? InputSize.Md : _ref6$size, _ref6$isTextarea = _ref6.isTextarea, isTextarea = _ref6$isTextarea === void 0 ? false : _ref6$isTextarea, palette = _ref6.theme.palette;
  return Ae(["display:flex;position:absolute;align-items:center;max-height:34px;right:0px;padding:8px 12px;gap:6px;bottom:", ";box-shadow:0px 2px 6px ", ";background-color:", ";border-radius:4px;align-items:center;", ""], size === InputSize.Md ? "45px" : "35px", palette[Color.LargeShadow], palette[Color.BackgroundStateless], isTextarea && "\n      bottom: ".concat(size === InputSize.Md ? 27 : 22, "px;\n      right: ").concat(size === InputSize.Md ? 16 : 12, "px;\n    "));
});
var NotificationIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$n, "NotificationIcon")
}).withConfig({
  componentId: "sc-150k0cz-8"
})(function(_ref7) {
  var palette = _ref7.theme.palette;
  return Ae(["display:flex;color:", ";"], palette[Color.IconsPrimary]);
});
var NotificationText = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$n, "NotificationText")
}).withConfig({
  componentId: "sc-150k0cz-9"
})(function(_ref8) {
  var _ref8$theme = _ref8.theme, palette = _ref8$theme.palette, font = _ref8$theme.typography.font;
  return Ae(["display:flex;white-space:nowrap;", ";color:", ";"], font[FontVariant.TextSmall], palette[Color.TextPrimary]);
});
var FieldWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$n, "fieldWrapper")
}).withConfig({
  componentId: "sc-150k0cz-10"
})(function(_ref9) {
  var isSelectedItems = _ref9.isSelectedItems;
  return Ae(["width:100%;height:100%;display:inline-flex;flex-wrap:wrap;gap:8px;max-height:120px;", ";::-webkit-scrollbar{display:none;}"], isSelectedItems && "\n      overflow-y: auto;\n    ");
});
var Styled$o = applyDisplayNames({
  Input: Input$2,
  Container: Container$2,
  Base: Base$1,
  Icon: Icon$4,
  CopyIcon: CopyIcon$1,
  PasswordIcon,
  ClearIcon,
  NotificationBox,
  NotificationIcon,
  NotificationText,
  FieldWrapper
});
var _excluded$1P = ["inputType", "children", "iconStart", "iconEnd", "iconChange", "clearIcon", "iconClickStart", "iconClickEnd", "clearIconClick", "size", "className", "style", "fullWidth", "readOnly", "disabled", "hideCopyIcon", "focusOnMount", "focusOnClick", "isEllipsis", "copyTextMessage", "copySuccessIcon", "error", "renderTags", "showPlaceholder"];
var getIconSize$4 = function getIconSize(sizeName, iconType) {
  switch (sizeName) {
    case InputSize.Md:
      return iconType === "start" ? 15 : 14;
    case InputSize.Sm:
    default:
      return iconType === "start" ? 13 : 10;
  }
};
var getPasswordIconSize = function getPasswordIconSize2(sizeName) {
  switch (sizeName) {
    case InputSize.Md:
      return 16;
    case InputSize.Sm:
    default:
      return 14;
  }
};
var Input$1 = intrinsicComponent$1(function(_ref, ref) {
  var _rest$selectedItems;
  var inputType = _ref.inputType, children = _ref.children, iconStart = _ref.iconStart, iconEnd = _ref.iconEnd, iconChange = _ref.iconChange, clearIcon = _ref.clearIcon, iconClickStart = _ref.iconClickStart, iconClickEnd = _ref.iconClickEnd, clearIconClick = _ref.clearIconClick, _ref$size = _ref.size, size = _ref$size === void 0 ? InputSize.Md : _ref$size, className = _ref.className, style2 = _ref.style, fullWidth = _ref.fullWidth, readOnly = _ref.readOnly, disabled = _ref.disabled, _ref$hideCopyIcon = _ref.hideCopyIcon, hideCopyIcon = _ref$hideCopyIcon === void 0 ? false : _ref$hideCopyIcon, _ref$focusOnMount = _ref.focusOnMount, focusOnMount = _ref$focusOnMount === void 0 ? false : _ref$focusOnMount, _ref$focusOnClick = _ref.focusOnClick, focusOnClick = _ref$focusOnClick === void 0 ? true : _ref$focusOnClick, _ref$isEllipsis = _ref.isEllipsis, isEllipsis = _ref$isEllipsis === void 0 ? false : _ref$isEllipsis, copyTextMessage = _ref.copyTextMessage, copySuccessIcon = _ref.copySuccessIcon, error2 = _ref.error, renderTags = _ref.renderTags, showPlaceholder = _ref.showPlaceholder, rest = _objectWithoutProperties(_ref, _excluded$1P);
  var _useState = reactExports.useState(false), _useState2 = _slicedToArray(_useState, 2), isHovering = _useState2[0], setIsHovering = _useState2[1];
  var _useState3 = reactExports.useState(false), _useState4 = _slicedToArray(_useState3, 2), showCopyMessage = _useState4[0], setShowCopyMessage = _useState4[1];
  var _useState5 = reactExports.useState(false), _useState6 = _slicedToArray(_useState5, 2), isVisible = _useState6[0], setIsVisible = _useState6[1];
  var inputRef = reactExports.useRef(null);
  var isSelectedItems = (_rest$selectedItems = rest.selectedItems) === null || _rest$selectedItems === void 0 ? void 0 : _rest$selectedItems.length;
  var placeholder = rest.value || isSelectedItems ? "" : rest.placeholder;
  var showCopyIcon = isHovering && readOnly && rest.value.length > 0 && !hideCopyIcon;
  var handleFocus = function handleFocus2() {
    var _inputRef$current;
    if (disabled || readOnly) return;
    showPlaceholder === null || showPlaceholder === void 0 || showPlaceholder(false);
    (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
  };
  reactExports.useEffect(function() {
    if (focusOnMount) {
      handleFocus();
    }
  }, []);
  reactExports.useEffect(function() {
    setTimeout(function() {
      return setShowCopyMessage(false);
    }, 2e3);
  }, [showCopyMessage]);
  var handleEntering = function handleEntering2() {
    setTimeout(function() {
      setIsHovering(true);
    }, 150);
  };
  var handleLeaving = function handleLeaving2() {
    setTimeout(function() {
      setIsHovering(false);
    }, 200);
  };
  var handleIconClick = function handleIconClick2(event, type) {
    if (disabled || readOnly) return;
    if (focusOnClick) {
      handleFocus();
    }
    if (type === "start") {
      if (iconClickStart) {
        iconClickStart(event);
      }
    } else if (type === "end") {
      if (iconClickEnd) {
        iconClickEnd(event);
      }
    } else if (clearIconClick) {
      clearIconClick(event);
    }
  };
  var renderIcon = function renderIcon2(_icon, type) {
    return _icon ? /* @__PURE__ */ React.createElement(Styled$o.Icon, {
      onClick: function onClick(event) {
        return handleIconClick(event, type);
      },
      iconClickStart,
      iconClickEnd,
      iconType: type,
      disabled,
      readOnly
    }, typeof _icon === "function" ? _icon({
      size: getIconSize$4(size, type)
    }) : _icon) : void 0;
  };
  var renderClearIcon = function renderClearIcon2() {
    return disabled || readOnly || !clearIcon ? void 0 : /* @__PURE__ */ React.createElement(Styled$o.ClearIcon, {
      onClick: function onClick(event) {
        return handleIconClick(event, "clear");
      }
    }, typeof clearIcon === "function" ? clearIcon({
      size: getIconSize$4(size, "clear")
    }) : clearIcon);
  };
  var renderCopyIcon = function renderCopyIcon2(icon) {
    return showCopyIcon ? /* @__PURE__ */ React.createElement(Styled$o.CopyIcon, {
      onClick: function onClick() {
        return handleCopyIcon(rest.value, setShowCopyMessage);
      }
    }, typeof icon === "function" ? icon() : icon) : void 0;
  };
  var toggleVisibility = function toggleVisibility2(event) {
    event.stopPropagation();
    setIsVisible(!isVisible);
  };
  var renderPasswordIcon = function renderPasswordIcon2() {
    return /* @__PURE__ */ React.createElement(Styled$o.PasswordIcon, {
      onClick: function onClick(event) {
        return toggleVisibility(event);
      }
    }, isVisible ? /* @__PURE__ */ React.createElement(EyeClosed, {
      size: getPasswordIconSize(size)
    }) : /* @__PURE__ */ React.createElement(EyeOpen, {
      size: getPasswordIconSize(size)
    }));
  };
  var getInputType = function getInputType2() {
    if (!inputType && rest !== null && rest !== void 0 && rest.type) {
      return rest === null || rest === void 0 ? void 0 : rest.type;
    }
    if (inputType === Type$1.Password && !isVisible) {
      return Type$1.Password;
    }
    return Type$1.Text;
  };
  var renderField = function renderField2() {
    return /* @__PURE__ */ React.createElement(Styled$o.FieldWrapper, {
      isSelectedItems: Boolean(isSelectedItems)
    }, renderTags && renderTags(), /* @__PURE__ */ React.createElement(Styled$o.Base, _extends({}, rest, {
      placeholder,
      ref: inputRef,
      readOnly: Boolean(readOnly),
      type: getInputType(),
      isEllipsis
    })));
  };
  var renderCopyText = function renderCopyText2() {
    return /* @__PURE__ */ React.createElement(Styled$o.NotificationBox, {
      size
    }, /* @__PURE__ */ React.createElement(Styled$o.NotificationIcon, null, copySuccessIcon), /* @__PURE__ */ React.createElement(Styled$o.NotificationText, null, copyTextMessage));
  };
  return /* @__PURE__ */ React.createElement(Styled$o.Input, {
    onClick: focusOnClick ? handleFocus : void 0,
    ref,
    size,
    onMouseEnter: handleEntering,
    onMouseLeave: handleLeaving,
    className,
    style: style2,
    readOnly,
    disabled,
    fullWidth: Boolean(fullWidth),
    error: error2,
    clearIcon,
    isHovering: rest.isHovering,
    isSelectedItems: Boolean(isSelectedItems)
  }, renderIcon(iconStart, "start"), renderField(), renderCopyIcon(/* @__PURE__ */ React.createElement(CopyOutline, {
    size: getIconSize$4(size, "copy")
  })), showCopyMessage && renderCopyText(), renderClearIcon(), inputType === Type$1.Password && renderPasswordIcon(), renderIcon(iconEnd, "end"), renderIcon(iconChange, ""), children && /* @__PURE__ */ React.createElement(React.Fragment, null, children));
});
var defaultProps$7 = {
  size: InputSize.Md,
  error: false,
  fullWidth: false,
  readOnly: false,
  disabled: false,
  copyTextMessage: "Copied!"
};
Input$1.defaultProps = defaultProps$7;
var propTypes$8 = {
  size: PropTypes.oneOf(objectValues(InputSize)),
  iconStart: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  iconEnd: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  iconChange: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  copySuccessIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  clearIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  error: PropTypes.bool,
  fullWidth: PropTypes.bool,
  value: PropTypes.any,
  readOnly: PropTypes.bool,
  disabled: PropTypes.bool,
  iconClickStart: PropTypes.func,
  showPlaceholder: PropTypes.func,
  iconClickEnd: PropTypes.func,
  clearIconClick: PropTypes.func,
  focusOnMount: PropTypes.bool,
  focusOnClick: PropTypes.bool,
  copyTextMessage: PropTypes.string,
  inputType: PropTypes.string,
  renderTags: PropTypes.func
};
Input$1.propTypes = propTypes$8;
var top = "top";
var bottom = "bottom";
var right = "right";
var left = "left";
var auto = "auto";
var basePlacements = [top, bottom, right, left];
var start = "start";
var end = "end";
var clippingParents = "clippingParents";
var viewport = "viewport";
var popper = "popper";
var reference = "reference";
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
  return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
  return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead = "beforeRead";
var read = "read";
var afterRead = "afterRead";
var beforeMain = "beforeMain";
var main = "main";
var afterMain = "afterMain";
var beforeWrite = "beforeWrite";
var write = "write";
var afterWrite = "afterWrite";
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
function getNodeName(element) {
  return element ? (element.nodeName || "").toLowerCase() : null;
}
function getWindow(node) {
  if (node == null) {
    return window;
  }
  if (node.toString() !== "[object Window]") {
    var ownerDocument2 = node.ownerDocument;
    return ownerDocument2 ? ownerDocument2.defaultView || window : window;
  }
  return node;
}
function isElement(node) {
  var OwnElement = getWindow(node).Element;
  return node instanceof OwnElement || node instanceof Element;
}
function isHTMLElement(node) {
  var OwnElement = getWindow(node).HTMLElement;
  return node instanceof OwnElement || node instanceof HTMLElement;
}
function isShadowRoot(node) {
  if (typeof ShadowRoot === "undefined") {
    return false;
  }
  var OwnElement = getWindow(node).ShadowRoot;
  return node instanceof OwnElement || node instanceof ShadowRoot;
}
function applyStyles(_ref) {
  var state = _ref.state;
  Object.keys(state.elements).forEach(function(name) {
    var style2 = state.styles[name] || {};
    var attributes = state.attributes[name] || {};
    var element = state.elements[name];
    if (!isHTMLElement(element) || !getNodeName(element)) {
      return;
    }
    Object.assign(element.style, style2);
    Object.keys(attributes).forEach(function(name2) {
      var value = attributes[name2];
      if (value === false) {
        element.removeAttribute(name2);
      } else {
        element.setAttribute(name2, value === true ? "" : value);
      }
    });
  });
}
function effect$2(_ref2) {
  var state = _ref2.state;
  var initialStyles = {
    popper: {
      position: state.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  Object.assign(state.elements.popper.style, initialStyles.popper);
  state.styles = initialStyles;
  if (state.elements.arrow) {
    Object.assign(state.elements.arrow.style, initialStyles.arrow);
  }
  return function() {
    Object.keys(state.elements).forEach(function(name) {
      var element = state.elements[name];
      var attributes = state.attributes[name] || {};
      var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
      var style2 = styleProperties.reduce(function(style3, property) {
        style3[property] = "";
        return style3;
      }, {});
      if (!isHTMLElement(element) || !getNodeName(element)) {
        return;
      }
      Object.assign(element.style, style2);
      Object.keys(attributes).forEach(function(attribute) {
        element.removeAttribute(attribute);
      });
    });
  };
}
const applyStyles$1 = {
  name: "applyStyles",
  enabled: true,
  phase: "write",
  fn: applyStyles,
  effect: effect$2,
  requires: ["computeStyles"]
};
function getBasePlacement(placement) {
  return placement.split("-")[0];
}
var max = Math.max;
var min = Math.min;
var round = Math.round;
function getUAString() {
  var uaData = navigator.userAgentData;
  if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
    return uaData.brands.map(function(item) {
      return item.brand + "/" + item.version;
    }).join(" ");
  }
  return navigator.userAgent;
}
function isLayoutViewport() {
  return !/^((?!chrome|android).)*safari/i.test(getUAString());
}
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
  if (includeScale === void 0) {
    includeScale = false;
  }
  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }
  var clientRect = element.getBoundingClientRect();
  var scaleX = 1;
  var scaleY = 1;
  if (includeScale && isHTMLElement(element)) {
    scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
    scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
  }
  var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
  var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
  var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
  var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
  var width = clientRect.width / scaleX;
  var height = clientRect.height / scaleY;
  return {
    width,
    height,
    top: y2,
    right: x2 + width,
    bottom: y2 + height,
    left: x2,
    x: x2,
    y: y2
  };
}
function getLayoutRect(element) {
  var clientRect = getBoundingClientRect(element);
  var width = element.offsetWidth;
  var height = element.offsetHeight;
  if (Math.abs(clientRect.width - width) <= 1) {
    width = clientRect.width;
  }
  if (Math.abs(clientRect.height - height) <= 1) {
    height = clientRect.height;
  }
  return {
    x: element.offsetLeft,
    y: element.offsetTop,
    width,
    height
  };
}
function contains(parent, child) {
  var rootNode = child.getRootNode && child.getRootNode();
  if (parent.contains(child)) {
    return true;
  } else if (rootNode && isShadowRoot(rootNode)) {
    var next = child;
    do {
      if (next && parent.isSameNode(next)) {
        return true;
      }
      next = next.parentNode || next.host;
    } while (next);
  }
  return false;
}
function getComputedStyle(element) {
  return getWindow(element).getComputedStyle(element);
}
function isTableElement(element) {
  return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
}
function getDocumentElement(element) {
  return ((isElement(element) ? element.ownerDocument : (
    // $FlowFixMe[prop-missing]
    element.document
  )) || window.document).documentElement;
}
function getParentNode(element) {
  if (getNodeName(element) === "html") {
    return element;
  }
  return (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    element.parentNode || // DOM Element detected
    (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    getDocumentElement(element)
  );
}
function getTrueOffsetParent(element) {
  if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
  getComputedStyle(element).position === "fixed") {
    return null;
  }
  return element.offsetParent;
}
function getContainingBlock(element) {
  var isFirefox = /firefox/i.test(getUAString());
  var isIE = /Trident/i.test(getUAString());
  if (isIE && isHTMLElement(element)) {
    var elementCss = getComputedStyle(element);
    if (elementCss.position === "fixed") {
      return null;
    }
  }
  var currentNode = getParentNode(element);
  if (isShadowRoot(currentNode)) {
    currentNode = currentNode.host;
  }
  while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
    var css = getComputedStyle(currentNode);
    if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
      return currentNode;
    } else {
      currentNode = currentNode.parentNode;
    }
  }
  return null;
}
function getOffsetParent(element) {
  var window2 = getWindow(element);
  var offsetParent = getTrueOffsetParent(element);
  while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
    offsetParent = getTrueOffsetParent(offsetParent);
  }
  if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
    return window2;
  }
  return offsetParent || getContainingBlock(element) || window2;
}
function getMainAxisFromPlacement(placement) {
  return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}
function within(min$1, value, max$1) {
  return max(min$1, min(value, max$1));
}
function withinMaxClamp(min2, value, max2) {
  var v2 = within(min2, value, max2);
  return v2 > max2 ? max2 : v2;
}
function getFreshSideObject() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function mergePaddingObject(paddingObject) {
  return Object.assign({}, getFreshSideObject(), paddingObject);
}
function expandToHashMap(value, keys) {
  return keys.reduce(function(hashMap, key) {
    hashMap[key] = value;
    return hashMap;
  }, {});
}
var toPaddingObject = function toPaddingObject2(padding, state) {
  padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
    placement: state.placement
  })) : padding;
  return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
};
function arrow(_ref) {
  var _state$modifiersData$;
  var state = _ref.state, name = _ref.name, options = _ref.options;
  var arrowElement = state.elements.arrow;
  var popperOffsets2 = state.modifiersData.popperOffsets;
  var basePlacement = getBasePlacement(state.placement);
  var axis = getMainAxisFromPlacement(basePlacement);
  var isVertical = [left, right].indexOf(basePlacement) >= 0;
  var len = isVertical ? "height" : "width";
  if (!arrowElement || !popperOffsets2) {
    return;
  }
  var paddingObject = toPaddingObject(options.padding, state);
  var arrowRect = getLayoutRect(arrowElement);
  var minProp = axis === "y" ? top : left;
  var maxProp = axis === "y" ? bottom : right;
  var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
  var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
  var arrowOffsetParent = getOffsetParent(arrowElement);
  var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  var centerToReference = endDiff / 2 - startDiff / 2;
  var min2 = paddingObject[minProp];
  var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
  var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
  var offset5 = within(min2, center, max2);
  var axisProp = axis;
  state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset5, _state$modifiersData$.centerOffset = offset5 - center, _state$modifiersData$);
}
function effect$1(_ref2) {
  var state = _ref2.state, options = _ref2.options;
  var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
  if (arrowElement == null) {
    return;
  }
  if (typeof arrowElement === "string") {
    arrowElement = state.elements.popper.querySelector(arrowElement);
    if (!arrowElement) {
      return;
    }
  }
  if (!contains(state.elements.popper, arrowElement)) {
    return;
  }
  state.elements.arrow = arrowElement;
}
const arrow$1 = {
  name: "arrow",
  enabled: true,
  phase: "main",
  fn: arrow,
  effect: effect$1,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function getVariation(placement) {
  return placement.split("-")[1];
}
var unsetSides = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function roundOffsetsByDPR(_ref, win) {
  var x2 = _ref.x, y2 = _ref.y;
  var dpr = win.devicePixelRatio || 1;
  return {
    x: round(x2 * dpr) / dpr || 0,
    y: round(y2 * dpr) / dpr || 0
  };
}
function mapToStyles(_ref2) {
  var _Object$assign2;
  var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
  var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y;
  var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
    x: x2,
    y: y2
  }) : {
    x: x2,
    y: y2
  };
  x2 = _ref3.x;
  y2 = _ref3.y;
  var hasX = offsets.hasOwnProperty("x");
  var hasY = offsets.hasOwnProperty("y");
  var sideX = left;
  var sideY = top;
  var win = window;
  if (adaptive) {
    var offsetParent = getOffsetParent(popper2);
    var heightProp = "clientHeight";
    var widthProp = "clientWidth";
    if (offsetParent === getWindow(popper2)) {
      offsetParent = getDocumentElement(popper2);
      if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
        heightProp = "scrollHeight";
        widthProp = "scrollWidth";
      }
    }
    offsetParent = offsetParent;
    if (placement === top || (placement === left || placement === right) && variation === end) {
      sideY = bottom;
      var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        offsetParent[heightProp]
      );
      y2 -= offsetY - popperRect.height;
      y2 *= gpuAcceleration ? 1 : -1;
    }
    if (placement === left || (placement === top || placement === bottom) && variation === end) {
      sideX = right;
      var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        offsetParent[widthProp]
      );
      x2 -= offsetX - popperRect.width;
      x2 *= gpuAcceleration ? 1 : -1;
    }
  }
  var commonStyles = Object.assign({
    position
  }, adaptive && unsetSides);
  var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
    x: x2,
    y: y2
  }, getWindow(popper2)) : {
    x: x2,
    y: y2
  };
  x2 = _ref4.x;
  y2 = _ref4.y;
  if (gpuAcceleration) {
    var _Object$assign;
    return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign));
  }
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles(_ref5) {
  var state = _ref5.state, options = _ref5.options;
  var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
  var commonStyles = {
    placement: getBasePlacement(state.placement),
    variation: getVariation(state.placement),
    popper: state.elements.popper,
    popperRect: state.rects.popper,
    gpuAcceleration,
    isFixed: state.options.strategy === "fixed"
  };
  if (state.modifiersData.popperOffsets != null) {
    state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.popperOffsets,
      position: state.options.strategy,
      adaptive,
      roundOffsets
    })));
  }
  if (state.modifiersData.arrow != null) {
    state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
      offsets: state.modifiersData.arrow,
      position: "absolute",
      adaptive: false,
      roundOffsets
    })));
  }
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    "data-popper-placement": state.placement
  });
}
const computeStyles$1 = {
  name: "computeStyles",
  enabled: true,
  phase: "beforeWrite",
  fn: computeStyles,
  data: {}
};
var passive = {
  passive: true
};
function effect(_ref) {
  var state = _ref.state, instance = _ref.instance, options = _ref.options;
  var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
  var window2 = getWindow(state.elements.popper);
  var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
  if (scroll) {
    scrollParents.forEach(function(scrollParent) {
      scrollParent.addEventListener("scroll", instance.update, passive);
    });
  }
  if (resize) {
    window2.addEventListener("resize", instance.update, passive);
  }
  return function() {
    if (scroll) {
      scrollParents.forEach(function(scrollParent) {
        scrollParent.removeEventListener("scroll", instance.update, passive);
      });
    }
    if (resize) {
      window2.removeEventListener("resize", instance.update, passive);
    }
  };
}
const eventListeners = {
  name: "eventListeners",
  enabled: true,
  phase: "write",
  fn: function fn() {
  },
  effect,
  data: {}
};
var hash$1 = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function getOppositePlacement(placement) {
  return placement.replace(/left|right|bottom|top/g, function(matched) {
    return hash$1[matched];
  });
}
var hash = {
  start: "end",
  end: "start"
};
function getOppositeVariationPlacement(placement) {
  return placement.replace(/start|end/g, function(matched) {
    return hash[matched];
  });
}
function getWindowScroll(node) {
  var win = getWindow(node);
  var scrollLeft = win.pageXOffset;
  var scrollTop = win.pageYOffset;
  return {
    scrollLeft,
    scrollTop
  };
}
function getWindowScrollBarX(element) {
  return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}
function getViewportRect(element, strategy) {
  var win = getWindow(element);
  var html = getDocumentElement(element);
  var visualViewport = win.visualViewport;
  var width = html.clientWidth;
  var height = html.clientHeight;
  var x2 = 0;
  var y2 = 0;
  if (visualViewport) {
    width = visualViewport.width;
    height = visualViewport.height;
    var layoutViewport = isLayoutViewport();
    if (layoutViewport || !layoutViewport && strategy === "fixed") {
      x2 = visualViewport.offsetLeft;
      y2 = visualViewport.offsetTop;
    }
  }
  return {
    width,
    height,
    x: x2 + getWindowScrollBarX(element),
    y: y2
  };
}
function getDocumentRect(element) {
  var _element$ownerDocumen;
  var html = getDocumentElement(element);
  var winScroll = getWindowScroll(element);
  var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element);
  var y2 = -winScroll.scrollTop;
  if (getComputedStyle(body || html).direction === "rtl") {
    x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width;
  }
  return {
    width,
    height,
    x: x2,
    y: y2
  };
}
function isScrollParent(element) {
  var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
  return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
function getScrollParent(node) {
  if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
    return node.ownerDocument.body;
  }
  if (isHTMLElement(node) && isScrollParent(node)) {
    return node;
  }
  return getScrollParent(getParentNode(node));
}
function listScrollParents(element, list) {
  var _element$ownerDocumen;
  if (list === void 0) {
    list = [];
  }
  var scrollParent = getScrollParent(element);
  var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
  var win = getWindow(scrollParent);
  var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
  var updatedList = list.concat(target);
  return isBody ? updatedList : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    updatedList.concat(listScrollParents(getParentNode(target)))
  );
}
function rectToClientRect(rect) {
  return Object.assign({}, rect, {
    left: rect.x,
    top: rect.y,
    right: rect.x + rect.width,
    bottom: rect.y + rect.height
  });
}
function getInnerBoundingClientRect(element, strategy) {
  var rect = getBoundingClientRect(element, false, strategy === "fixed");
  rect.top = rect.top + element.clientTop;
  rect.left = rect.left + element.clientLeft;
  rect.bottom = rect.top + element.clientHeight;
  rect.right = rect.left + element.clientWidth;
  rect.width = element.clientWidth;
  rect.height = element.clientHeight;
  rect.x = rect.left;
  rect.y = rect.top;
  return rect;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
}
function getClippingParents(element) {
  var clippingParents2 = listScrollParents(getParentNode(element));
  var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  if (!isElement(clipperElement)) {
    return [];
  }
  return clippingParents2.filter(function(clippingParent) {
    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
  });
}
function getClippingRect(element, boundary, rootBoundary, strategy) {
  var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
  var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
  var firstClippingParent = clippingParents2[0];
  var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
    var rect = getClientRectFromMixedType(element, clippingParent, strategy);
    accRect.top = max(rect.top, accRect.top);
    accRect.right = min(rect.right, accRect.right);
    accRect.bottom = min(rect.bottom, accRect.bottom);
    accRect.left = max(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromMixedType(element, firstClippingParent, strategy));
  clippingRect.width = clippingRect.right - clippingRect.left;
  clippingRect.height = clippingRect.bottom - clippingRect.top;
  clippingRect.x = clippingRect.left;
  clippingRect.y = clippingRect.top;
  return clippingRect;
}
function computeOffsets(_ref) {
  var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
  var basePlacement = placement ? getBasePlacement(placement) : null;
  var variation = placement ? getVariation(placement) : null;
  var commonX = reference2.x + reference2.width / 2 - element.width / 2;
  var commonY = reference2.y + reference2.height / 2 - element.height / 2;
  var offsets;
  switch (basePlacement) {
    case top:
      offsets = {
        x: commonX,
        y: reference2.y - element.height
      };
      break;
    case bottom:
      offsets = {
        x: commonX,
        y: reference2.y + reference2.height
      };
      break;
    case right:
      offsets = {
        x: reference2.x + reference2.width,
        y: commonY
      };
      break;
    case left:
      offsets = {
        x: reference2.x - element.width,
        y: commonY
      };
      break;
    default:
      offsets = {
        x: reference2.x,
        y: reference2.y
      };
  }
  var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
  if (mainAxis != null) {
    var len = mainAxis === "y" ? "height" : "width";
    switch (variation) {
      case start:
        offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
        break;
      case end:
        offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
        break;
    }
  }
  return offsets;
}
function detectOverflow(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
  var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
  var altContext = elementContext === popper ? reference : popper;
  var popperRect = state.rects.popper;
  var element = state.elements[altBoundary ? altContext : elementContext];
  var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
  var referenceClientRect = getBoundingClientRect(state.elements.reference);
  var popperOffsets2 = computeOffsets({
    reference: referenceClientRect,
    element: popperRect,
    strategy: "absolute",
    placement
  });
  var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
  var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
  var overflowOffsets = {
    top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
    bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
    left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
    right: elementClientRect.right - clippingClientRect.right + paddingObject.right
  };
  var offsetData = state.modifiersData.offset;
  if (elementContext === popper && offsetData) {
    var offset5 = offsetData[placement];
    Object.keys(overflowOffsets).forEach(function(key) {
      var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
      var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
      overflowOffsets[key] += offset5[axis] * multiply;
    });
  }
  return overflowOffsets;
}
function computeAutoPlacement(state, options) {
  if (options === void 0) {
    options = {};
  }
  var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
  var variation = getVariation(placement);
  var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
    return getVariation(placement2) === variation;
  }) : basePlacements;
  var allowedPlacements = placements$1.filter(function(placement2) {
    return allowedAutoPlacements.indexOf(placement2) >= 0;
  });
  if (allowedPlacements.length === 0) {
    allowedPlacements = placements$1;
  }
  var overflows = allowedPlacements.reduce(function(acc, placement2) {
    acc[placement2] = detectOverflow(state, {
      placement: placement2,
      boundary,
      rootBoundary,
      padding
    })[getBasePlacement(placement2)];
    return acc;
  }, {});
  return Object.keys(overflows).sort(function(a, b2) {
    return overflows[a] - overflows[b2];
  });
}
function getExpandedFallbackPlacements(placement) {
  if (getBasePlacement(placement) === auto) {
    return [];
  }
  var oppositePlacement = getOppositePlacement(placement);
  return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip(_ref) {
  var state = _ref.state, options = _ref.options, name = _ref.name;
  if (state.modifiersData[name]._skip) {
    return;
  }
  var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
  var preferredPlacement = state.options.placement;
  var basePlacement = getBasePlacement(preferredPlacement);
  var isBasePlacement = basePlacement === preferredPlacement;
  var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
  var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
    return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
      placement: placement2,
      boundary,
      rootBoundary,
      padding,
      flipVariations,
      allowedAutoPlacements
    }) : placement2);
  }, []);
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var checksMap = /* @__PURE__ */ new Map();
  var makeFallbackChecks = true;
  var firstFittingPlacement = placements2[0];
  for (var i = 0; i < placements2.length; i++) {
    var placement = placements2[i];
    var _basePlacement = getBasePlacement(placement);
    var isStartVariation = getVariation(placement) === start;
    var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
    var len = isVertical ? "width" : "height";
    var overflow = detectOverflow(state, {
      placement,
      boundary,
      rootBoundary,
      altBoundary,
      padding
    });
    var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
    if (referenceRect[len] > popperRect[len]) {
      mainVariationSide = getOppositePlacement(mainVariationSide);
    }
    var altVariationSide = getOppositePlacement(mainVariationSide);
    var checks = [];
    if (checkMainAxis) {
      checks.push(overflow[_basePlacement] <= 0);
    }
    if (checkAltAxis) {
      checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
    }
    if (checks.every(function(check) {
      return check;
    })) {
      firstFittingPlacement = placement;
      makeFallbackChecks = false;
      break;
    }
    checksMap.set(placement, checks);
  }
  if (makeFallbackChecks) {
    var numberOfChecks = flipVariations ? 3 : 1;
    var _loop = function _loop2(_i2) {
      var fittingPlacement = placements2.find(function(placement2) {
        var checks2 = checksMap.get(placement2);
        if (checks2) {
          return checks2.slice(0, _i2).every(function(check) {
            return check;
          });
        }
      });
      if (fittingPlacement) {
        firstFittingPlacement = fittingPlacement;
        return "break";
      }
    };
    for (var _i = numberOfChecks; _i > 0; _i--) {
      var _ret = _loop(_i);
      if (_ret === "break") break;
    }
  }
  if (state.placement !== firstFittingPlacement) {
    state.modifiersData[name]._skip = true;
    state.placement = firstFittingPlacement;
    state.reset = true;
  }
}
const flip$1 = {
  name: "flip",
  enabled: true,
  phase: "main",
  fn: flip,
  requiresIfExists: ["offset"],
  data: {
    _skip: false
  }
};
function getSideOffsets(overflow, rect, preventedOffsets) {
  if (preventedOffsets === void 0) {
    preventedOffsets = {
      x: 0,
      y: 0
    };
  }
  return {
    top: overflow.top - rect.height - preventedOffsets.y,
    right: overflow.right - rect.width + preventedOffsets.x,
    bottom: overflow.bottom - rect.height + preventedOffsets.y,
    left: overflow.left - rect.width - preventedOffsets.x
  };
}
function isAnySideFullyClipped(overflow) {
  return [top, right, bottom, left].some(function(side) {
    return overflow[side] >= 0;
  });
}
function hide(_ref) {
  var state = _ref.state, name = _ref.name;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var preventedOffsets = state.modifiersData.preventOverflow;
  var referenceOverflow = detectOverflow(state, {
    elementContext: "reference"
  });
  var popperAltOverflow = detectOverflow(state, {
    altBoundary: true
  });
  var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
  var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
  var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
  var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
  state.modifiersData[name] = {
    referenceClippingOffsets,
    popperEscapeOffsets,
    isReferenceHidden,
    hasPopperEscaped
  };
  state.attributes.popper = Object.assign({}, state.attributes.popper, {
    "data-popper-reference-hidden": isReferenceHidden,
    "data-popper-escaped": hasPopperEscaped
  });
}
const hide$1 = {
  name: "hide",
  enabled: true,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: hide
};
function distanceAndSkiddingToXY(placement, rects, offset5) {
  var basePlacement = getBasePlacement(placement);
  var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
  var _ref = typeof offset5 === "function" ? offset5(Object.assign({}, rects, {
    placement
  })) : offset5, skidding = _ref[0], distance = _ref[1];
  skidding = skidding || 0;
  distance = (distance || 0) * invertDistance;
  return [left, right].indexOf(basePlacement) >= 0 ? {
    x: distance,
    y: skidding
  } : {
    x: skidding,
    y: distance
  };
}
function offset4(_ref2) {
  var state = _ref2.state, options = _ref2.options, name = _ref2.name;
  var _options$offset = options.offset, offset5 = _options$offset === void 0 ? [0, 0] : _options$offset;
  var data = placements.reduce(function(acc, placement) {
    acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset5);
    return acc;
  }, {});
  var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y2 = _data$state$placement.y;
  if (state.modifiersData.popperOffsets != null) {
    state.modifiersData.popperOffsets.x += x2;
    state.modifiersData.popperOffsets.y += y2;
  }
  state.modifiersData[name] = data;
}
const offset$1 = {
  name: "offset",
  enabled: true,
  phase: "main",
  requires: ["popperOffsets"],
  fn: offset4
};
function popperOffsets(_ref) {
  var state = _ref.state, name = _ref.name;
  state.modifiersData[name] = computeOffsets({
    reference: state.rects.reference,
    element: state.rects.popper,
    strategy: "absolute",
    placement: state.placement
  });
}
const popperOffsets$1 = {
  name: "popperOffsets",
  enabled: true,
  phase: "read",
  fn: popperOffsets,
  data: {}
};
function getAltAxis(axis) {
  return axis === "x" ? "y" : "x";
}
function preventOverflow(_ref) {
  var state = _ref.state, options = _ref.options, name = _ref.name;
  var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
  var overflow = detectOverflow(state, {
    boundary,
    rootBoundary,
    padding,
    altBoundary
  });
  var basePlacement = getBasePlacement(state.placement);
  var variation = getVariation(state.placement);
  var isBasePlacement = !variation;
  var mainAxis = getMainAxisFromPlacement(basePlacement);
  var altAxis = getAltAxis(mainAxis);
  var popperOffsets2 = state.modifiersData.popperOffsets;
  var referenceRect = state.rects.reference;
  var popperRect = state.rects.popper;
  var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
    placement: state.placement
  })) : tetherOffset;
  var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
    mainAxis: tetherOffsetValue,
    altAxis: tetherOffsetValue
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, tetherOffsetValue);
  var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
  var data = {
    x: 0,
    y: 0
  };
  if (!popperOffsets2) {
    return;
  }
  if (checkMainAxis) {
    var _offsetModifierState$;
    var mainSide = mainAxis === "y" ? top : left;
    var altSide = mainAxis === "y" ? bottom : right;
    var len = mainAxis === "y" ? "height" : "width";
    var offset5 = popperOffsets2[mainAxis];
    var min$1 = offset5 + overflow[mainSide];
    var max$1 = offset5 - overflow[altSide];
    var additive = tether ? -popperRect[len] / 2 : 0;
    var minLen = variation === start ? referenceRect[len] : popperRect[len];
    var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
    var arrowElement = state.elements.arrow;
    var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
      width: 0,
      height: 0
    };
    var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
    var arrowPaddingMin = arrowPaddingObject[mainSide];
    var arrowPaddingMax = arrowPaddingObject[altSide];
    var arrowLen = within(0, referenceRect[len], arrowRect[len]);
    var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
    var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
    var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
    var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
    var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
    var tetherMin = offset5 + minOffset - offsetModifierValue - clientOffset;
    var tetherMax = offset5 + maxOffset - offsetModifierValue;
    var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset5, tether ? max(max$1, tetherMax) : max$1);
    popperOffsets2[mainAxis] = preventedOffset;
    data[mainAxis] = preventedOffset - offset5;
  }
  if (checkAltAxis) {
    var _offsetModifierState$2;
    var _mainSide = mainAxis === "x" ? top : left;
    var _altSide = mainAxis === "x" ? bottom : right;
    var _offset = popperOffsets2[altAxis];
    var _len = altAxis === "y" ? "height" : "width";
    var _min = _offset + overflow[_mainSide];
    var _max = _offset - overflow[_altSide];
    var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
    var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
    var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
    var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
    var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
    popperOffsets2[altAxis] = _preventedOffset;
    data[altAxis] = _preventedOffset - _offset;
  }
  state.modifiersData[name] = data;
}
const preventOverflow$1 = {
  name: "preventOverflow",
  enabled: true,
  phase: "main",
  fn: preventOverflow,
  requiresIfExists: ["offset"]
};
function getHTMLElementScroll(element) {
  return {
    scrollLeft: element.scrollLeft,
    scrollTop: element.scrollTop
  };
}
function getNodeScroll(node) {
  if (node === getWindow(node) || !isHTMLElement(node)) {
    return getWindowScroll(node);
  } else {
    return getHTMLElementScroll(node);
  }
}
function isElementScaled(element) {
  var rect = element.getBoundingClientRect();
  var scaleX = round(rect.width) / element.offsetWidth || 1;
  var scaleY = round(rect.height) / element.offsetHeight || 1;
  return scaleX !== 1 || scaleY !== 1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
  if (isFixed === void 0) {
    isFixed = false;
  }
  var isOffsetParentAnElement = isHTMLElement(offsetParent);
  var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
  var documentElement = getDocumentElement(offsetParent);
  var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
  var scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  var offsets = {
    x: 0,
    y: 0
  };
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
    isScrollParent(documentElement)) {
      scroll = getNodeScroll(offsetParent);
    }
    if (isHTMLElement(offsetParent)) {
      offsets = getBoundingClientRect(offsetParent, true);
      offsets.x += offsetParent.clientLeft;
      offsets.y += offsetParent.clientTop;
    } else if (documentElement) {
      offsets.x = getWindowScrollBarX(documentElement);
    }
  }
  return {
    x: rect.left + scroll.scrollLeft - offsets.x,
    y: rect.top + scroll.scrollTop - offsets.y,
    width: rect.width,
    height: rect.height
  };
}
function order(modifiers) {
  var map = /* @__PURE__ */ new Map();
  var visited = /* @__PURE__ */ new Set();
  var result = [];
  modifiers.forEach(function(modifier) {
    map.set(modifier.name, modifier);
  });
  function sort(modifier) {
    visited.add(modifier.name);
    var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
    requires.forEach(function(dep) {
      if (!visited.has(dep)) {
        var depModifier = map.get(dep);
        if (depModifier) {
          sort(depModifier);
        }
      }
    });
    result.push(modifier);
  }
  modifiers.forEach(function(modifier) {
    if (!visited.has(modifier.name)) {
      sort(modifier);
    }
  });
  return result;
}
function orderModifiers(modifiers) {
  var orderedModifiers = order(modifiers);
  return modifierPhases.reduce(function(acc, phase) {
    return acc.concat(orderedModifiers.filter(function(modifier) {
      return modifier.phase === phase;
    }));
  }, []);
}
function debounce(fn2) {
  var pending;
  return function() {
    if (!pending) {
      pending = new Promise(function(resolve) {
        Promise.resolve().then(function() {
          pending = void 0;
          resolve(fn2());
        });
      });
    }
    return pending;
  };
}
function mergeByName(modifiers) {
  var merged = modifiers.reduce(function(merged2, current) {
    var existing = merged2[current.name];
    merged2[current.name] = existing ? Object.assign({}, existing, current, {
      options: Object.assign({}, existing.options, current.options),
      data: Object.assign({}, existing.data, current.data)
    }) : current;
    return merged2;
  }, {});
  return Object.keys(merged).map(function(key) {
    return merged[key];
  });
}
var DEFAULT_OPTIONS = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function areValidElements() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return !args.some(function(element) {
    return !(element && typeof element.getBoundingClientRect === "function");
  });
}
function popperGenerator(generatorOptions) {
  if (generatorOptions === void 0) {
    generatorOptions = {};
  }
  var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
  return function createPopper2(reference2, popper2, options) {
    if (options === void 0) {
      options = defaultOptions;
    }
    var state = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
      modifiersData: {},
      elements: {
        reference: reference2,
        popper: popper2
      },
      attributes: {},
      styles: {}
    };
    var effectCleanupFns = [];
    var isDestroyed = false;
    var instance = {
      state,
      setOptions: function setOptions(setOptionsAction) {
        var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
        cleanupModifierEffects();
        state.options = Object.assign({}, defaultOptions, state.options, options2);
        state.scrollParents = {
          reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
          popper: listScrollParents(popper2)
        };
        var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
        state.orderedModifiers = orderedModifiers.filter(function(m2) {
          return m2.enabled;
        });
        runModifierEffects();
        return instance.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function forceUpdate() {
        if (isDestroyed) {
          return;
        }
        var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
        if (!areValidElements(reference3, popper3)) {
          return;
        }
        state.rects = {
          reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
          popper: getLayoutRect(popper3)
        };
        state.reset = false;
        state.placement = state.options.placement;
        state.orderedModifiers.forEach(function(modifier) {
          return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
        });
        for (var index = 0; index < state.orderedModifiers.length; index++) {
          if (state.reset === true) {
            state.reset = false;
            index = -1;
            continue;
          }
          var _state$orderedModifie = state.orderedModifiers[index], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
          if (typeof fn2 === "function") {
            state = fn2({
              state,
              options: _options,
              name,
              instance
            }) || state;
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: debounce(function() {
        return new Promise(function(resolve) {
          instance.forceUpdate();
          resolve(state);
        });
      }),
      destroy: function destroy() {
        cleanupModifierEffects();
        isDestroyed = true;
      }
    };
    if (!areValidElements(reference2, popper2)) {
      return instance;
    }
    instance.setOptions(options).then(function(state2) {
      if (!isDestroyed && options.onFirstUpdate) {
        options.onFirstUpdate(state2);
      }
    });
    function runModifierEffects() {
      state.orderedModifiers.forEach(function(_ref) {
        var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect;
        if (typeof effect2 === "function") {
          var cleanupFn = effect2({
            state,
            name,
            instance,
            options: options2
          });
          var noopFn = function noopFn2() {
          };
          effectCleanupFns.push(cleanupFn || noopFn);
        }
      });
    }
    function cleanupModifierEffects() {
      effectCleanupFns.forEach(function(fn2) {
        return fn2();
      });
      effectCleanupFns = [];
    }
    return instance;
  };
}
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
var createPopper = /* @__PURE__ */ popperGenerator({
  defaultModifiers
});
function createRootElement(id2) {
  var rootContainer = document.createElement("div");
  rootContainer.setAttribute("id", id2);
  return rootContainer;
}
function addRootElement(rootElem) {
  document.body.append(rootElem);
}
function usePortal(id2) {
  var rootElemRef = reactExports.useRef(null);
  reactExports.useEffect(function() {
    var existingParent = document.querySelector("#".concat(id2));
    var parentElem = existingParent || createRootElement(id2);
    if (!existingParent) {
      addRootElement(parentElem);
    }
    if (rootElemRef.current) {
      parentElem.append(rootElemRef.current);
    }
    return function removeElement() {
      if (rootElemRef.current) {
        rootElemRef.current.remove();
      }
      if (parentElem.childNodes.length === -1) {
        parentElem.remove();
      }
    };
  }, []);
  function getRootElem() {
    if (!rootElemRef.current) {
      rootElemRef.current = document.createElement("div");
    }
    return rootElemRef.current;
  }
  return getRootElem();
}
var Position$1 = {
  AutoStart: "auto-start",
  Auto: "auto",
  AutoEnd: "auto-end",
  TopStart: "top-start",
  Top: "top",
  TopEnd: "top-end",
  BottomStart: "bottom-start",
  Bottom: "bottom",
  BottomEnd: "bottom-end",
  LeftStart: "left-start",
  Left: "left",
  LeftEnd: "left-end",
  RightStart: "right-start",
  Right: "right",
  RightEnd: "right-end"
};
var Strategy = {
  Absloute: "absolute",
  Fixed: "fixed"
};
var _PopperMixin;
var PopperMixin = (_PopperMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position$1.Auto, Ae(["top:0px;bottom:0px;left:0px;right:0px;"])), Position$1.AutoEnd, Ae(["top:0px;bottom:0px;left:0px;right:0px;"])), Position$1.AutoStart, Ae(["top:0px;bottom:0px;left:0px;right:0px;"])), Position$1.Right, Ae(["left:-4px;"])), Position$1.RightEnd, Ae(["left:-4px;"])), Position$1.RightStart, Ae(["left:-4px;"])), Position$1.Left, Ae(["right:-4px;"])), Position$1.LeftEnd, Ae(["right:-4px;"])), Position$1.LeftStart, Ae(["right:-4px;"])), Position$1.Top, Ae(["bottom:-4px;"])), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_PopperMixin, Position$1.TopEnd, Ae(["bottom:-4px;"])), Position$1.TopStart, Ae(["bottom:-4px;"])), Position$1.Bottom, Ae(["top:-4px;"])), Position$1.BottomEnd, Ae(["top:-4px;"])), Position$1.BottomStart, Ae(["top:-4px;"])));
var baseClassName$m = "Popper";
var Popper$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$m, "root")
}).withConfig({
  componentId: "sc-1373tsp-0"
})([""]);
var PopperWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$m, "wrapper")
}).withConfig({
  componentId: "sc-1373tsp-1"
})(function(_ref) {
  var zIndex = _ref.zIndex;
  return Ae(["position:relative;z-index:", ";"], zIndex);
});
var Arrow3 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$m, "arrow")
}).withConfig({
  componentId: "sc-1373tsp-2"
})(function(_ref2) {
  var _ref2$warning = _ref2.warning, warning = _ref2$warning === void 0 ? false : _ref2$warning, _ref2$position = _ref2.position, position = _ref2$position === void 0 ? Position$1.Right : _ref2$position, theme = _ref2.theme;
  return Ae(["width:8px;height:8px;position:absolute;&::before{content:'';background:", ";width:8px;height:8px;transform:rotate(45deg);position:absolute;top:0;left:0;z-index:-1;}", ""], warning ? theme.palette[Color.BackgroundOrange] : theme.palette[Color.BackgroundGrey], PopperMixin[position]);
});
var Overlay$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$m, "Overlay")
}).withConfig({
  componentId: "sc-1373tsp-3"
})(function() {
  return Ae(["position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;"]);
});
var Styled$n = applyDisplayNames({
  Popper: Popper$2,
  Overlay: Overlay$2,
  Arrow: Arrow3,
  PopperWrapper
});
var _excluded$1O = ["anchorEl", "children", "open", "warning", "position", "arrow", "popperOptions", "onClick", "overlay", "zIndex", "enableUnderlayingEvent", "wrapperStyles"];
function ownKeys$Z(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$Z(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$Z(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$Z(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Popper = intrinsicComponent$1(function(_ref, ref) {
  var anchorEl = _ref.anchorEl, children = _ref.children, open = _ref.open, _ref$warning = _ref.warning, warning = _ref$warning === void 0 ? false : _ref$warning, _ref$position = _ref.position, initialPlacement = _ref$position === void 0 ? "bottom" : _ref$position, _ref$arrow = _ref.arrow, arrow2 = _ref$arrow === void 0 ? false : _ref$arrow, popperOptions = _ref.popperOptions, onClick = _ref.onClick, _ref$overlay = _ref.overlay, overlay = _ref$overlay === void 0 ? false : _ref$overlay, _ref$zIndex = _ref.zIndex, zIndex = _ref$zIndex === void 0 ? 1300 : _ref$zIndex, enableUnderlayingEvent = _ref.enableUnderlayingEvent, _ref$wrapperStyles = _ref.wrapperStyles, wrapperStyles = _ref$wrapperStyles === void 0 ? {} : _ref$wrapperStyles, rest = _objectWithoutProperties(_ref, _excluded$1O);
  var target = usePortal(generateClassNames("Popper"));
  var popperRef = reactExports.useRef(null);
  var handlePopperRef = useForkRef(popperRef, ref);
  reactExports.useEffect(function() {
    if (!anchorEl || !open || popperRef.current === null) {
      return void 0;
    }
    var defaultModifiers2 = [{
      name: "arrow",
      options: {
        element: "[data-popper-arrow]"
      }
    }, {
      name: "offset",
      options: {
        offset: [0, 10]
      }
    }];
    var popperModifiers = arrow2 ? defaultModifiers2 : [];
    if (popperOptions && popperOptions.modifiers != null) {
      popperModifiers = popperModifiers.concat(popperOptions.modifiers);
    }
    var popper2 = createPopper(anchorEl, popperRef.current, _objectSpread$Z(_objectSpread$Z({
      placement: initialPlacement
    }, popperOptions), {}, {
      modifiers: popperModifiers
    }));
    handlePopperRef.current = popper2;
    return function() {
      popper2.destroy();
      handlePopperRef.current = null;
    };
  }, [anchorEl, open, popperOptions, initialPlacement, arrow2]);
  var passEventToUnderlayingEvent = function passEventToUnderlayingEvent2(event) {
    setTimeout(function() {
      if (event.clientX && event.clientY) {
        var elem = document.elementFromPoint(event.clientX, event.clientY);
        if (elem) {
          elem.dispatchEvent(event.nativeEvent);
        }
      }
    }, 0);
  };
  var handleOnClicking = function handleOnClicking2(event) {
    event.persist();
    event.preventDefault();
    event.stopPropagation();
    if (onClick) {
      onClick(event);
    }
    if (enableUnderlayingEvent) {
      passEventToUnderlayingEvent(event);
    }
  };
  var renderOverlay = function renderOverlay2() {
    return /* @__PURE__ */ React.createElement(Styled$n.Overlay, {
      onClick: handleOnClicking,
      onContextMenu: handleOnClicking
    });
  };
  if (!open) {
    return /* @__PURE__ */ React.createElement("div", {
      hidden: true,
      ref: handlePopperRef
    });
  }
  var render = function render2() {
    var _handlePopperRef$stat;
    return /* @__PURE__ */ React.createElement(Styled$n.PopperWrapper, {
      zIndex,
      style: _objectSpread$Z({}, wrapperStyles)
    }, overlay && renderOverlay(), /* @__PURE__ */ React.createElement(Styled$n.Popper, _extends({
      ref: handlePopperRef
    }, rest), children, arrow2 && /* @__PURE__ */ React.createElement(Styled$n.Arrow, {
      warning,
      "data-popper-arrow": true,
      position: (handlePopperRef === null || handlePopperRef === void 0 || (_handlePopperRef$stat = handlePopperRef.state) === null || _handlePopperRef$stat === void 0 ? void 0 : _handlePopperRef$stat.placement) || initialPlacement
    })));
  };
  return /* @__PURE__ */ reactDomExports.createPortal(render(), target);
});
Popper.defaultProps = {};
var propTypes$7 = {
  anchorEl: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.object]),
  popperOptions: PropTypes.shape({
    modifiers: PropTypes.arrayOf(PropTypes.shape({
      data: PropTypes.object,
      effect: PropTypes.func,
      enabled: PropTypes.bool,
      fn: PropTypes.func,
      name: PropTypes.any.isRequired,
      options: PropTypes.object,
      phase: PropTypes.oneOf(["afterMain", "afterRead", "afterWrite", "beforeMain", "beforeRead", "beforeWrite", "main", "read", "write"]),
      requires: PropTypes.arrayOf(PropTypes.string),
      requiresIfExists: PropTypes.arrayOf(PropTypes.string)
    })),
    onFirstUpdate: PropTypes.func,
    placement: PropTypes.oneOf(objectValues(Position$1)),
    strategy: PropTypes.oneOf(objectValues(Strategy))
  }),
  overlay: PropTypes.bool,
  warning: PropTypes.bool,
  arrow: PropTypes.bool,
  zIndex: PropTypes.number,
  enableUnderlayingEvent: PropTypes.bool,
  wrapperStyles: PropTypes.object
};
Popper.propTypes = propTypes$7;
const Popper$1 = Popper;
var baseClassName$l = "Menu";
var Overlay$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$l, "Overlay")
}).withConfig({
  componentId: "sc-10okxhw-0"
})(function() {
  return Ae(["position:fixed;right:0;bottom:0;top:0;left:0;background-color:transparent;z-index:-1;"]);
});
var opacityKeyframes = /* @__PURE__ */ We(["from{opacity:0;}to{opacity:1;}"]);
var transformKeyframes = /* @__PURE__ */ We(["from{transform:scale(0.97);margin-top:0px;}to{transform:scale(1);margin-top:4px;}"]);
var fadeInAnimation = /* @__PURE__ */ Ae(["animation:", " 250ms 0ms cubic-bezier(0.4,0,0.2,1),", " 250ms cubic-bezier(0.4,0,0.2,1);"], opacityKeyframes, transformKeyframes);
var Menu$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$l, "root")
}).withConfig({
  componentId: "sc-10okxhw-1"
})(function(_ref) {
  var rect = _ref.rect, theme = _ref.theme, scroll = _ref.scroll, _ref$maxHeight = _ref.maxHeight, maxHeight = _ref$maxHeight === void 0 ? "" : _ref$maxHeight;
  return Ae(["min-width:", "px;width:195px;min-height:16px;overflow-x:hidden;overflow-y:auto;transition:opacity 250ms cubic-bezier(0.4,0,0,1),transform 250ms cubic-bezier(0.4,0,0,1),margin-top 250ms cubic-bezier(0.4,0,0,1);outline:0;box-shadow:0 2px 4px ", ";border-radius:", ";", " ", " margin-top:4px;", ""], rect.width, theme.palette[Color.MediumShadow], theme.shape.borderRadius[BorderRadiusSize.Md], scroll && scrollBar, maxHeight && Ae(["max-height:", ";"], Number.isNaN(+maxHeight) ? maxHeight : "".concat(maxHeight, "px")), fadeInAnimation);
});
var Styled$m = applyDisplayNames({
  Menu: Menu$2,
  Overlay: Overlay$1
});
var _excluded$1N = ["id", "children", "open", "fullWidth", "anchorElPosition", "anchorEl", "onClose", "containerProps", "alignCenter", "maxHeight", "position", "popperOptions", "enableOverlay", "zIndex", "hideScroll", "scroll", "enableUnderlayingEvent", "popperWrapperStyles"];
function ownKeys$Y(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$Y(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$Y(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$Y(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Menu$1 = intrinsicComponent$1(function(_ref, ref) {
  _ref.id;
  var children = _ref.children, open = _ref.open;
  _ref.fullWidth;
  var anchorElPosition = _ref.anchorElPosition, anchorEl = _ref.anchorEl, onClose2 = _ref.onClose, containerProps = _ref.containerProps, alignCenter = _ref.alignCenter, maxHeight = _ref.maxHeight, position = _ref.position, popperOptions = _ref.popperOptions, _ref$enableOverlay = _ref.enableOverlay, enableOverlay = _ref$enableOverlay === void 0 ? true : _ref$enableOverlay, zIndex = _ref.zIndex, _ref$hideScroll = _ref.hideScroll, hideScroll = _ref$hideScroll === void 0 ? true : _ref$hideScroll, _ref$scroll = _ref.scroll, scroll = _ref$scroll === void 0 ? true : _ref$scroll, _ref$enableUnderlayin = _ref.enableUnderlayingEvent, enableUnderlayingEvent = _ref$enableUnderlayin === void 0 ? false : _ref$enableUnderlayin, _ref$popperWrapperSty = _ref.popperWrapperStyles, popperWrapperStyles = _ref$popperWrapperSty === void 0 ? {} : _ref$popperWrapperSty, rest = _objectWithoutProperties(_ref, _excluded$1N);
  var _useState = reactExports.useState(null), _useState2 = _slicedToArray(_useState, 2), timeout2 = _useState2[0], setTimeoutState = _useState2[1];
  var _useState3 = reactExports.useState(new DOMRect()), _useState4 = _slicedToArray(_useState3, 2), rect = _useState4[0], setRect = _useState4[1];
  var menuRef = reactExports.useRef(null);
  var updateRect = reactExports.useCallback(function() {
    var _anchorEl$getBounding;
    var defaultPosition = _objectSpread$Y({
      top: 0,
      left: 0,
      height: 0,
      width: 0
    }, anchorElPosition || {});
    var defaultRect = new DOMRect(defaultPosition.left, defaultPosition.top, defaultPosition.width, defaultPosition.height);
    setRect((_anchorEl$getBounding = anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.getBoundingClientRect()) !== null && _anchorEl$getBounding !== void 0 ? _anchorEl$getBounding : defaultRect);
  }, [open, timeout2, anchorEl]);
  var handleWindowSizeChanged = reactExports.useCallback(function() {
    if (open) {
      if (timeout2) {
        clearTimeout(timeout2);
      }
      setTimeoutState(setTimeout(updateRect, 300));
    }
  }, [open, timeout2]);
  reactExports.useEffect(function() {
    window.addEventListener("resize", handleWindowSizeChanged);
    return function() {
      window.removeEventListener("resize", handleWindowSizeChanged);
    };
  }, [handleWindowSizeChanged]);
  reactExports.useEffect(function() {
    updateRect();
  }, [anchorElPosition, updateRect]);
  reactExports.useEffect(function() {
    if (hideScroll) {
      if (open) {
        document.body.classList.add("Menu-open");
        updateRect();
      } else {
        document.body.classList.remove("Menu-open");
      }
      return function() {
        document.body.classList.remove("Menu-open");
      };
    }
  }, [open, updateRect]);
  var handleClose = function handleClose2(event) {
    if (typeof onClose2 === "function") {
      onClose2(event);
    }
  };
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Popper$1, {
    ref: menuRef,
    position: position || "bottom-start",
    open: Boolean(anchorEl),
    anchorEl,
    overlay: Boolean(enableOverlay),
    onClick: handleClose,
    popperOptions,
    zIndex,
    enableUnderlayingEvent,
    wrapperStyles: popperWrapperStyles
  }, /* @__PURE__ */ React.createElement(Styled$m.Menu, _extends({}, containerProps, {
    alignCenter: Boolean(alignCenter),
    scroll,
    rect
  }, rest, {
    ref,
    maxHeight
  }), children)));
});
var defaultProps$6 = {
  open: false,
  containerProps: {},
  maxHeight: 250,
  position: Position$1.BottomStart,
  enableOverlay: true,
  hideScroll: true,
  scroll: true
};
Menu$1.defaultProps = defaultProps$6;
var propTypes$6 = {
  anchorElPosition: PropTypes.shape({
    left: PropTypes.number,
    right: PropTypes.number,
    top: PropTypes.number,
    bottom: PropTypes.number
  }),
  anchorEl: PropTypes.instanceOf(Element),
  open: PropTypes.bool,
  fullWidth: PropTypes.bool,
  onClose: PropTypes.func,
  id: PropTypes.string,
  containerProps: PropTypes.object,
  alignCenter: PropTypes.bool,
  maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  popperOptions: propTypes$7.popperOptions,
  position: PropTypes.oneOf(objectValues(Position$1)),
  enableOverlay: PropTypes.bool,
  zIndex: PropTypes.number,
  hideScroll: PropTypes.bool,
  scroll: PropTypes.bool,
  enableUnderlayingEvent: PropTypes.bool,
  popperWrapperStyles: PropTypes.object,
  style: PropTypes.object
};
Menu$1.propTypes = propTypes$6;
var Size$2 = {
  Sm: "sm",
  Md: "md"
};
var sizeMenuItemMixin = _defineProperty(_defineProperty({}, Size$2.Sm, function(_ref) {
  var font = _ref.theme.typography.font;
  return Ae(["padding:8px 16px;min-height:32px;", ""], font[FontVariant.LabelMedium]);
}), Size$2.Md, function(_ref2) {
  var font = _ref2.theme.typography.font;
  return Ae(["padding:11px 16px;min-height:40px;", ""], font[FontVariant.LabelLarge]);
});
var baseClassName$k = "MenuItem";
var Icon$3 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$k, "Icon")
}).withConfig({
  componentId: "sc-rrzye0-0"
})(function(_ref) {
  var palette = _ref.theme.palette, disabled = _ref.disabled;
  return Ae(["flex-shrink:0;margin-right:10px;color:", ";"], disabled ? palette[Color.TextPlaceholder] : palette[Color.IconsPrimary]);
});
var Actions = /* @__PURE__ */ qe(Icon$3).attrs({
  className: generateClassNames(baseClassName$k, "Actions")
}).withConfig({
  componentId: "sc-rrzye0-1"
})(function() {
  return Ae(["margin-right:0px;margin-left:16px;"]);
});
var Label$3 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$k, "Label")
}).withConfig({
  componentId: "sc-rrzye0-2"
})(["align-items:center;column-gap:4px;flex-grow:1;"]);
var MenuItemWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$k, "wrapper")
}).withConfig({
  componentId: "sc-rrzye0-3"
})(function(_ref2) {
  var _ref2$divider = _ref2.divider, divider = _ref2$divider === void 0 ? false : _ref2$divider, _ref2$noOptionsText = _ref2.noOptionsText, noOptionsText = _ref2$noOptionsText === void 0 ? false : _ref2$noOptionsText, _ref2$disabled = _ref2.disabled, disabled = _ref2$disabled === void 0 ? false : _ref2$disabled, theme = _ref2.theme;
  return Ae(["", " ", ""], divider && Ae(["width:100%;height:1px;background:", ";box-sizing:border-box;"], theme.palette[Color.BordersSecondary]), (noOptionsText || disabled) && Ae(["color:", ";"], theme.palette[Color.ButtonDisabledText]));
});
var MenuItem$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$k, "root")
}).withConfig({
  componentId: "sc-rrzye0-4"
})(function(_ref3) {
  var _ref3$size = _ref3.size, size = _ref3$size === void 0 ? Size$2.Sm : _ref3$size, active = _ref3.active, theme = _ref3.theme, _ref3$disableHover = _ref3.disableHover, disableHover = _ref3$disableHover === void 0 ? false : _ref3$disableHover, noOptionsText = _ref3.noOptionsText, disabled = _ref3.disabled;
  return Ae(["display:flex;justify-content:space-between;flex-direction:row;align-items:center;width:100%;background:", ";color:", ";cursor:pointer;box-sizing:border-box;transition:all 100ms ease-out;", " &:focus-within,&:focus,&:hover{", ";", "}", ""], theme.palette[active ? Color.BackgroundActive : Color.BackgroundSecondary], theme.palette[Color.TextPrimary], sizeMenuItemMixin[size], !disableHover && "background-color: ".concat(theme.palette[Color.BackgroundHover]), (noOptionsText || disabled) && Ae(["cursor:default;background-color:white;"]), (noOptionsText || disabled) && Ae(["& > svg{path{fill:", ";}}color:", ";"], theme.palette[Color.ButtonDisabledText], theme.palette[Color.ButtonDisabledText]));
});
var MenuPrefix = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$k, "prefix")
}).withConfig({
  componentId: "sc-rrzye0-5"
})(function() {
  return Ae(["display:flex;"]);
});
var MenuContent = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$k, "content")
}).withConfig({
  componentId: "sc-rrzye0-6"
})(function() {
  return Ae(["flex-grow:1;line-height:16px;"]);
});
var MenuSuffix = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$k, "suffix")
}).withConfig({
  componentId: "sc-rrzye0-7"
})(function() {
  return Ae(["display:flex;margin-left:8px;"]);
});
var Styled$l = applyDisplayNames({
  MenuItemWrapper,
  MenuItem: MenuItem$1,
  MenuPrefix,
  MenuContent,
  MenuSuffix,
  Label: Label$3,
  Icon: Icon$3,
  Actions
});
var _excluded$1M = ["list", "depth", "children", "disableHover", "noOptionsText", "disabled", "enableScrollIntoView"];
function ownKeys$X(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$X(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$X(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$X(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var MenuItem = intrinsicComponent$1(function(_ref, ref) {
  var list = _ref.list, _ref$depth = _ref.depth, depth = _ref$depth === void 0 ? 0 : _ref$depth, children = _ref.children, disableHover = _ref.disableHover, noOptionsText = _ref.noOptionsText, disabled = _ref.disabled, enableScrollIntoView = _ref.enableScrollIntoView, props = _objectWithoutProperties(_ref, _excluded$1M);
  var menuItemRef = reactExports.useRef(null);
  var _React$useState = React.useState(null), _React$useState2 = _slicedToArray(_React$useState, 2), anchorEl = _React$useState2[0], setAnchorEl = _React$useState2[1];
  var _React$useState3 = React.useState([]), _React$useState4 = _slicedToArray(_React$useState3, 2), selectedIds = _React$useState4[0], setSelectedIds = _React$useState4[1];
  var handleOpenMenu = function handleOpenMenu2(event) {
    setAnchorEl(event.currentTarget);
  };
  var handleScroll = function handleScroll2() {
    var _menuItemRef$current;
    (_menuItemRef$current = menuItemRef.current) === null || _menuItemRef$current === void 0 || _menuItemRef$current.scrollIntoView({
      behavior: "auto",
      block: "nearest"
    });
  };
  reactExports.useEffect(function() {
    if (props.active && enableScrollIntoView) {
      handleScroll();
    }
  }, [props.active]);
  var handleSelectedId = function handleSelectedId2(ev, selected, depthLevel) {
    var updatedArray = selectedIds.slice(0);
    updatedArray[depthLevel] = selected;
    setSelectedIds(updatedArray);
    handleOpenMenu(ev);
  };
  var handleCloseSubMenu = function handleCloseSubMenu2(depthLevel) {
    var updatedArray = selectedIds.slice(0);
    updatedArray[depthLevel] = "";
    setSelectedIds(updatedArray);
    setAnchorEl(null);
  };
  var renderItems = function renderItems2(options) {
    var depthLevel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    return options.map(function(option) {
      var hasOptions = option.subList && option.subList.length > 0;
      var subMenu;
      if (selectedIds[depthLevel] === option.key && hasOptions) {
        var newDepthLevel = depthLevel + 1;
        subMenu = /* @__PURE__ */ React.createElement(Menu$1, _extends({
          key: option.key,
          position: "right",
          open: Boolean(anchorEl),
          anchorEl,
          enableOverlay: false
        }, option.subMenuProps), /* @__PURE__ */ React.createElement(MenuItem, _extends({
          list: option.subList,
          depth: newDepthLevel
        }, props)));
      }
      if (option.content === "divider") {
        return /* @__PURE__ */ React.createElement(Styled$l.MenuItemWrapper, {
          divider: true,
          key: option.key
        });
      }
      return /* @__PURE__ */ React.createElement(Styled$l.MenuItemWrapper, _extends({
        disabled: false,
        key: option.key,
        onMouseLeave: function onMouseLeave() {
          return handleCloseSubMenu(depthLevel);
        }
      }, props), /* @__PURE__ */ React.createElement(Styled$l.MenuItem, _extends({}, props, {
        className: option.className,
        ref,
        active: Boolean(option.active),
        onClick: option.onClick ? function(event) {
          return option.onClick(_objectSpread$X({
            event
          }, props));
        } : void 0,
        onMouseEnter: function onMouseEnter(ev) {
          return handleSelectedId(ev, option.key, depthLevel);
        },
        disableHover: disableHover || option.disableHover
      }), option.prefix && /* @__PURE__ */ React.createElement(Styled$l.MenuPrefix, null, typeof option.prefix === "function" ? option.prefix(props) : option.prefix), option.content && /* @__PURE__ */ React.createElement(Styled$l.MenuContent, null, typeof option.content === "function" ? option.content(props) : option.content), (option.suffix || option.subList) && /* @__PURE__ */ React.createElement(Styled$l.MenuSuffix, null, typeof option.suffix === "function" ? option.suffix(props) : option.suffix, option.subList && /* @__PURE__ */ React.createElement(Arrow$1, {
        size: 10,
        color: "#768A9F"
      }))), subMenu);
    });
  };
  if (!list) {
    if (props.value === "divider") {
      return /* @__PURE__ */ React.createElement(Styled$l.MenuItemWrapper, {
        divider: true,
        key: props.value
      });
    }
    return /* @__PURE__ */ React.createElement(Styled$l.MenuItemWrapper, {
      noOptionsText: Boolean(noOptionsText),
      disabled: Boolean(disabled)
    }, /* @__PURE__ */ React.createElement(Styled$l.MenuItem, _extends({}, props, {
      ref: menuItemRef,
      disableHover,
      noOptionsText,
      disabled
    }), children));
  }
  return /* @__PURE__ */ React.createElement(React.Fragment, null, renderItems(list, depth));
});
MenuItem.displayName = "MenuItem";
var defaultProps$5 = {
  size: Size$2.Sm,
  active: false
};
MenuItem.defaultProps = defaultProps$5;
MenuItem.propTypes = {
  size: PropTypes.oneOf(objectValues(Size$2)),
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  active: PropTypes.bool,
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool, PropTypes.oneOf([null])]),
  depth: PropTypes.number,
  disableHover: PropTypes.bool,
  noOptionsText: PropTypes.bool,
  disabled: PropTypes.bool,
  enableScrollIntoView: PropTypes.bool
};
var _excluded$1L = ["children", "disabled", "size"];
var getIconSize$3 = function getIconSize2(sizeName) {
  switch (sizeName) {
    case Size$2.Md:
      return 16;
    case Size$2.Sm:
    default:
      return 14;
  }
};
var MenuItemIcon = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, disabled = _ref.disabled, _ref$size = _ref.size, size = _ref$size === void 0 ? Size$2.Md : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1L);
  return /* @__PURE__ */ React.createElement(Styled$l.Icon, _extends({
    disabled
  }, rest, {
    ref
  }), children && typeof children === "function" ? children({
    size: getIconSize$3(size)
  }) : children);
});
MenuItemIcon.defaultProps = {
  size: Size$2.Md
};
MenuItemIcon.propTypes = {
  size: PropTypes.oneOf(objectValues(Size$2)),
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
  disabled: PropTypes.bool
};
var _excluded$1K = ["children"];
var MenuItemLabel = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$1K);
  return /* @__PURE__ */ React.createElement(Styled$l.Label, _extends({}, rest, {
    ref
  }), children);
});
MenuItemLabel.displayName = "MenuItemLabel";
var _excluded$1J = ["children"];
var MenuItemActions = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$1J);
  return /* @__PURE__ */ React.createElement(Styled$l.Actions, _extends({}, rest, {
    ref
  }), children && typeof children === "function" ? children({
    size: rest.size
  }) : children);
});
MenuItemActions.displayName = "MenuItemActions";
MenuItemActions.defaultProps = {
  size: Size$2.Md
};
MenuItemActions.propTypes = {
  size: PropTypes.oneOf(objectValues(Size$2)),
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
};
var _excluded$1I = ["color", "size"];
var CrossOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1I);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 44 44",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M43.3196 40.0403C44.2253 40.9461 44.2253 42.4146 43.3196 43.3204C42.4138 44.2262 40.9453 44.2262 40.0396 43.3204L21.9997 25.2802L3.95952 43.3207C3.05376 44.2264 1.58525 44.2264 0.679494 43.3207C-0.226258 42.4149 -0.226258 40.9464 0.679495 40.0406L18.7197 22.0001L0.679313 3.95941C-0.226437 3.05364 -0.226439 1.5851 0.679314 0.679328C1.58507 -0.226442 3.05358 -0.226443 3.95934 0.679328L21.9997 18.72L40.0398 0.679604C40.9455 -0.226163 42.414 -0.226165 43.3198 0.679605C44.2255 1.58537 44.2255 3.05392 43.3198 3.95969L25.2797 22.0001L43.3196 40.0403Z",
    fill: color
  }));
});
var sizeHintMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function(_ref) {
  var font = _ref.theme.typography.font;
  return Ae(font[FontVariant.LabelExtraSmallUp]);
}), InputSize.Md, function(_ref2) {
  var font = _ref2.theme.typography.font;
  return Ae(font[FontVariant.LabelSmall]);
});
var baseClassName$j = "FormHint";
var FormHint$1 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$j, "root")
}).withConfig({
  componentId: "sc-1vu99sv-0"
})(function(_ref) {
  var _ref$size = _ref.size, size = _ref$size === void 0 ? InputSize.Md : _ref$size, _ref$error = _ref.error, error2 = _ref$error === void 0 ? false : _ref$error, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, theme = _ref.theme;
  return Ae(["display:flex;align-items:center;color:", ";", " ", ""], error2 ? theme.palette[Color.Error] : theme.palette[Color.TextSecondary], disabled && Ae(["color:", ";"], theme.palette[Color.ButtonDisabledText]), sizeHintMixin[size]);
});
var Styled$k = applyDisplayNames({
  FormHint: FormHint$1
});
var FormHint = intrinsicComponent$1(function(props, ref) {
  return /* @__PURE__ */ React.createElement(Styled$k.FormHint, _extends({
    ref
  }, props));
});
FormHint.defaultProps = {
  error: false
};
FormHint.propTypes = {
  error: PropTypes.bool,
  size: PropTypes.oneOf(objectValues(InputSize))
};
var colorBadgeMixin = _defineProperty(_defineProperty(_defineProperty({}, BadgeColor.Primary, function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["background-color:", ";color:", ";"], palette[Color.AccentPrimary], palette[Color.ButtonPrimaryText]);
}), BadgeColor.White, function(_ref2) {
  var palette = _ref2.theme.palette;
  return Ae(["background-color:", ";color:", ";"], palette[Color.ButtonPrimaryText], palette[Color.AccentPrimary]);
}), BadgeColor.Secondary, function(_ref3) {
  var palette = _ref3.theme.palette;
  return Ae(["background-color:", ";color:", ";"], palette[Color.Accent_1_2_Opacity], palette[Color.TextPrimary]);
});
var baseClassName$i = "Badge";
var defaultSize = 20;
var BadgeRoot = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$i, "root")
}).withConfig({
  componentId: "sc-1rfm40m-0"
})(["position:relative;display:inline-flex;flex-shrink:0;vertical-align:middle;"]);
var Badge$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$i)
}).withConfig({
  componentId: "sc-1rfm40m-1"
})(function(_ref) {
  var size = _ref.size, _ref$color = _ref.color, color = _ref$color === void 0 ? "secondary" : _ref$color, fontSize = _ref.fontSize, _ref$padding = _ref.padding, padding = _ref$padding === void 0 ? "0 6px" : _ref$padding, inline = _ref.inline;
  return Ae(["", " display:flex;flex-wrap:wrap;flex-direction:row;justify-content:center;align-items:center;align-content:center;height:", "px;min-width:", "px;line-height:1;padding:", ";font-size:", ";box-sizing:border-box;transition:transform 225ms cubic-bezier(0.4,0,0.2,1) 0ms;border-radius:", "px;z-index:1;", ""], inline ? "" : "position: absolute;", size || defaultSize, size || defaultSize, typeof padding === "number" ? "".concat(padding, "px") : padding, typeof fontSize === "number" ? "".concat(fontSize, "px") : fontSize, (size || defaultSize) / 2, colorBadgeMixin[color]);
});
var Styled$j = applyDisplayNames({
  BadgeRoot,
  Badge: Badge$2
});
var _excluded$1H = ["badgeContent"];
var Badge$1 = intrinsicComponent$1(function(_ref, ref) {
  var badgeContent = _ref.badgeContent, rest = _objectWithoutProperties(_ref, _excluded$1H);
  return /* @__PURE__ */ React.createElement(Styled$j.BadgeRoot, {
    ref
  }, /* @__PURE__ */ React.createElement(Styled$j.Badge, rest, badgeContent));
});
Badge$1.defaultProps = {
  color: BadgeColor.Secondary,
  inline: false
};
Badge$1.propTypes = {
  color: PropTypes.oneOf(objectValues(BadgeColor)),
  badgeContent: PropTypes.node,
  size: PropTypes.oneOfType([PropTypes.number]),
  fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  padding: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  inline: PropTypes.bool
};
var _excluded$1G = ["color", "size"];
var Spinner$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 28 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1G);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M41.3465 44.355C33.5656 50.7844 22.9687 51.6268 14.3708 47.3665L17.8949 44.4545C24.754 47.117 32.7424 46.1093 38.709 41.1792C44.6755 36.249 47.1546 28.6071 45.8085 21.3893L49.3325 18.4773C51.9291 27.6967 49.1274 37.9256 41.3465 44.355Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.1749 2.63356L32.6509 5.54555C25.821 2.91828 17.838 3.86187 11.8366 8.82088C5.87009 13.7511 3.42028 21.4282 4.7372 28.6107L1.21311 31.5227C-1.38344 22.3034 1.45314 12.0456 9.19916 5.64502C16.9801 -0.784402 27.5768 -1.62682 36.1749 2.63356Z",
    fill: color
  }));
});
var _excluded$1F = ["color", "size"];
var TwoArrowsRight = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1F);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 12 12",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M5.74299 0.152553C5.95998 -0.056404 6.30528 -0.0498885 6.51424 0.167105C6.7232 0.384099 6.71668 0.7294 6.49969 0.938357L1.43832 5.81227L6.51398 11.0759C6.72309 11.2928 6.71681 11.6381 6.49996 11.8472C6.28311 12.0563 5.9378 12.05 5.7287 11.8332L0.274151 6.1766C0.17369 6.07242 0.118752 5.93258 0.121433 5.78788C0.124113 5.64317 0.184193 5.50547 0.288444 5.40508L5.74299 0.152553Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M10.9549 0.152554C11.1719 -0.0564031 11.5172 -0.0498876 11.7262 0.167106C11.9351 0.3841 11.9286 0.729401 11.7116 0.938357L6.65023 5.81227L11.7259 11.0759C11.935 11.2928 11.9287 11.6381 11.7119 11.8472C11.495 12.0563 11.1497 12.05 10.9406 11.8332L5.48606 6.1766C5.3856 6.07242 5.33067 5.93258 5.33335 5.78788C5.33603 5.64317 5.39611 5.50547 5.50036 5.40508L10.9549 0.152554Z",
    fill: color
  }));
});
var _excluded$1E = ["color", "size"];
var TwoArrowsLeft = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1E);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 12 12",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M6.25714 11.8474C6.04014 12.0564 5.69484 12.0499 5.48588 11.8329C5.27693 11.6159 5.28344 11.2706 5.50043 11.0616L10.5618 6.18773L5.48614 0.924074C5.27704 0.707224 5.28331 0.361919 5.50016 0.152813C5.71701 -0.0562931 6.06232 -0.0500145 6.27143 0.166835L11.726 5.8234C11.8264 5.92758 11.8814 6.06742 11.8787 6.21212C11.876 6.35683 11.8159 6.49453 11.7117 6.59492L6.25714 11.8474Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M1.04522 11.8474C0.828227 12.0564 0.482925 12.0499 0.273969 11.8329C0.065012 11.6159 0.0715275 11.2706 0.288521 11.0616L5.34989 6.18773L0.274227 0.924074C0.0651226 0.707224 0.0714006 0.361919 0.28825 0.152813C0.5051 -0.0562931 0.850407 -0.0500145 1.05951 0.166835L6.51406 5.8234C6.61452 5.92758 6.66946 6.06742 6.66678 6.21212C6.6641 6.35683 6.60402 6.49453 6.49977 6.59492L1.04522 11.8474Z",
    fill: color
  }));
});
var ButtonType = {
  Default: "default",
  Sidebar: "sidebar"
};
var SideBar = {
  Left: "left",
  Right: "right"
};
var getIconSize$2 = function getIconSize3(sizeName) {
  switch (sizeName) {
    case ButtonSize.Lg:
      return 18;
    case ButtonSize.Md:
      return 16;
    case ButtonSize.Sm:
      return 14;
    case ButtonSize.Xs:
      return 12;
    default:
      return 16;
  }
};
var getSideBarIconSize = function getSideBarIconSize2(sizeName) {
  switch (sizeName) {
    case ButtonSize.Lg:
      return 12;
    case ButtonSize.Md:
      return 11;
    case ButtonSize.Sm:
      return 10;
    default:
      return 11;
  }
};
var _colorButtonMixin;
var colorButtonMixin$1 = (_colorButtonMixin = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.Primary, function(_ref) {
  var palette = _ref.theme.palette, active = _ref.active;
  return Ae(["background-color:", ";color:", ";", "{color:", ";background:transparent;}&:hover{background-color:", ";}&:active{background-color:", ";}", " &:disabled{color:", ";background:", ";cursor:default;", "{color:", ";background:transparent;}}"], palette[Color.AccentStateless], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], active && Ae(["background-color:", ";&:hover,&:focus{background-color:", ";}"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.Secondary, function(_ref2) {
  var palette = _ref2.theme.palette, active = _ref2.active;
  return Ae(["background-color:", ";color:", ";border:1px solid ", ";", "{color:", ";background:transparent;}&:hover{color:", ";background-color:", ";", "{color:", ";}}&:focus{color:", ";background-color:", ";border:1px solid ", ";", "{color:", ";}}&:active{color:", ";background-color:", ";", "{color:", ";}}", " &:disabled{color:", ";background:", ";border:none;cursor:default;", "{color:", ";}}"], palette[Color.BackgroundStateless], palette[Color.AccentStateless], palette[Color.AccentStateless], Styled$j.Badge, palette[Color.AccentStateless], palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryHover], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryActive], palette[Color.Accent_1_2_Opacity], palette[Color.AccentPrimaryActive], Styled$j.Badge, palette[Color.AccentPrimaryActive], palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryActive], Styled$j.Badge, palette[Color.ButtonPrimaryText], active && Ae(["color:", ";background-color:", ";", "{color:", ";}&:hover,&:focus{color:", ";background-color:", ";", "{color:", ";}}"], palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryActive], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.ButtonPrimaryText], palette[Color.AccentPrimaryActive], Styled$j.Badge, palette[Color.ButtonPrimaryText]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.Basic, function(_ref3) {
  var palette = _ref3.theme.palette, active = _ref3.active;
  return Ae(["background-color:transparent;border:1px solid ", ";color:", ";", "{background-color:transparent;color:", ";}&:hover{background-color:", ";color:", ";", "{color:", ";}}&:active{background-color:", ";color:", ";", "{color:", ";}}", " &:disabled{background-color:", ";color:", ";cursor:default;border:none;", "{color:", ";}}"], palette[Color.BordersButton], palette[Color.LinkStateless], Styled$j.Badge, palette[Color.LinkStateless], palette[Color.BackgroundHover], palette[Color.LinkHover], Styled$j.Badge, palette[Color.LinkHover], palette[Color.BackgroundActive], palette[Color.LinkHover], Styled$j.Badge, palette[Color.LinkHover], active && Ae(["background-color:", ";color:", ";", "{color:", ";}&:hover,&:focus{background-color:", ";color:", ";}"], palette[Color.BackgroundActive], palette[Color.LinkHover], Styled$j.Badge, palette[Color.LinkHover], palette[Color.BackgroundActive], palette[Color.LinkHover]), palette[Color.Accent_1_2_Opacity], palette[Color.BordersDisabled], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.LinkPrimary, function(_ref4) {
  var palette = _ref4.theme.palette, active = _ref4.active;
  return Ae(["color:", ";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:", ";}&:active{color:", ";}", " &:disabled{background-color:transparent;color:", ";cursor:default;}"], palette[Color.AccentStateless], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled]);
}), ButtonColor.LinkSecondary, function(_ref5) {
  var palette = _ref5.theme.palette, active = _ref5.active;
  return Ae(["color:", ";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:", ";}&:active{color:", ";}", " &:disabled{background-color:transparent;color:", ";cursor:default;}"], palette[Color.LinkStateless], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";}"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled]);
}), ButtonColor.LinkBasicPrimary, function(_ref6) {
  var palette = _ref6.theme.palette, active = _ref6.active;
  return Ae(["color:", ";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:", ";}&:active{color:", ";}", " &:disabled{background-color:transparent;color:", ";cursor:default;}"], palette[Color.AccentStateless], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";}"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled]);
}), ButtonColor.LinkBasicSecondary, function(_ref7) {
  var palette = _ref7.theme.palette, active = _ref7.active;
  return Ae(["color:", ";background-color:transparent;padding:0px !important;&:hover{background-color:transparent;color:", ";}&:active{color:", ";}", " &:disabled{background-color:transparent;color:", ";cursor:default;}"], palette[Color.LinkStateless], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";}"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled]);
}), ButtonColor.ErrorPrimary, function(_ref8) {
  var palette = _ref8.theme.palette, active = _ref8.active;
  return Ae(["background-color:", ";color:", ";", "{color:", ";background:transparent;}&:hover{background-color:", ";}&:active{background-color:", ";}", " &:disabled{background-color:", ";color:", ";cursor:default;", "{color:", ";background:transparent;}}"], palette[Color.Error], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.ErrorHover], palette[Color.ErrorActive], active && Ae(["background-color:", ";&:hover,&:focus{background-color:", ";}"], palette[Color.ErrorActive], palette[Color.ErrorActive]), palette[Color.Accent_1_2_Opacity], palette[Color.BordersDisabled], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.ErrorSecondary, function(_ref9) {
  var palette = _ref9.theme.palette, active = _ref9.active;
  return Ae(["background-color:", ";color:", ";border:1px solid ", ";", "{color:", ";background-color:transparent;}&:hover{background-color:", ";color:", ";border:none;", "{color:", ";}}&:active{background-color:", ";color:", ";border:none;}", " &:disabled{color:", ";background:", ";border:none;cursor:default;", "{color:", ";}}"], palette[Color.BackgroundStateless], palette[Color.LinkStateless], palette[Color.BordersButton], Styled$j.Badge, palette[Color.LinkStateless], palette[Color.ErrorHover], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.ErrorActive], palette[Color.ButtonPrimaryText], active && Ae(["background-color:", ";color:", ";border:none;&:hover,&:focus{background-color:", ";}"], palette[Color.ErrorActive], palette[Color.ButtonPrimaryText], palette[Color.ErrorActive]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.ErrorBasic, function(_ref10) {
  var palette = _ref10.theme.palette, active = _ref10.active;
  return Ae(["color:", ";background-color:transparent;&:hover{color:", ";}&:active{color:", ";}", " &:disabled{color:", ";cursor:default;}"], palette[Color.LinkStateless], palette[Color.ErrorHover], palette[Color.ErrorActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";}"], palette[Color.ErrorActive], palette[Color.ErrorActive]), palette[Color.BordersDisabled]);
}), _defineProperty(_defineProperty(_defineProperty(_colorButtonMixin, ButtonColor.WarningPrimary, function(_ref11) {
  var palette = _ref11.theme.palette, active = _ref11.active;
  return Ae(["background-color:", ";color:", ";", "{color:", ";background:transparent;}&:hover{background-color:", ";}&:active{background-color:", ";}", " &:disabled{background-color:", ";color:", ";cursor:default;", "{color:", ";background:transparent;}}"], palette[Color.Warning], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.WarningHover], palette[Color.WarningActive], active && Ae(["background-color:", ";&:hover,&:focus{background-color:", ";}"], palette[Color.WarningActive], palette[Color.WarningActive]), palette[Color.Accent_1_2_Opacity], palette[Color.BordersDisabled], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.WarningSecondary, function(_ref12) {
  var palette = _ref12.theme.palette, active = _ref12.active;
  return Ae(["background-color:", ";color:", ";border:1px solid ", ";", "{color:", ";background-color:transparent;}&:hover{background-color:", ";color:", ";border:none;", "{color:", ";}}&:active{background-color:", ";color:", ";border:none;}", " &:disabled{color:", ";background:", ";border:none;cursor:default;", "{color:", ";}}"], palette[Color.BackgroundStateless], palette[Color.LinkStateless], palette[Color.BordersButton], Styled$j.Badge, palette[Color.LinkStateless], palette[Color.WarningHover], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.WarningActive], palette[Color.ButtonPrimaryText], active && Ae(["background-color:", ";color:", ";border:none;", "{color:", ";background-color:transparent;}&:hover,&:focus{background-color:", ";}"], palette[Color.WarningActive], palette[Color.ButtonPrimaryText], Styled$j.Badge, palette[Color.ButtonPrimaryText], palette[Color.WarningActive]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity], Styled$j.Badge, palette[Color.BordersDisabled]);
}), ButtonColor.WarningBasic, function(_ref13) {
  var palette = _ref13.theme.palette, active = _ref13.active;
  return Ae(["color:", ";background-color:transparent;&:hover{color:", ";}&:active{color:", ";}", " &:disabled{color:", ";cursor:default;}"], palette[Color.LinkStateless], palette[Color.WarningHover], palette[Color.WarningActive], active && Ae(["color:", ";&:hover,&:focus{color:", ";}"], palette[Color.WarningActive], palette[Color.WarningActive]), palette[Color.BordersDisabled]);
}));
var sizeButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["padding:5px 10px;"])), ButtonSize.Sm, Ae(["padding:8px 12px;"])), ButtonSize.Md, Ae(["padding:11px 16px;"])), ButtonSize.Lg, Ae(["padding:14px 24px;"]));
var sizeSecondaryButtonMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["padding:4px 10px;"])), ButtonSize.Sm, Ae(["padding:7px 12px;"])), ButtonSize.Md, Ae(["padding:10px 16px;"])), ButtonSize.Lg, Ae(["padding:13px 24px;"]));
var sizeSidebarMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["padding:5px 10px;"])), ButtonSize.Sm, Ae(["padding:8px 12px;"])), ButtonSize.Md, Ae(["padding:11px 14px;"])), ButtonSize.Lg, Ae(["padding:14px 16px;"]));
var sizeSidebarDividerMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["height:14px;"])), ButtonSize.Sm, Ae(["height:16px;"])), ButtonSize.Md, Ae(["height:18px;"])), ButtonSize.Lg, Ae(["height:20px;"]));
var paddingIconLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["margin-right:5px;"])), ButtonSize.Sm, Ae(["margin-right:6px;"])), ButtonSize.Md, Ae(["margin-right:7px;"])), ButtonSize.Lg, Ae(["margin-right:8px;"]));
var sizeButtonLabelMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, function(_ref14) {
  var font = _ref14.theme.typography.font;
  return Ae(font[FontVariant.ButtonSm]);
}), ButtonSize.Sm, function(_ref15) {
  var font = _ref15.theme.typography.font;
  return Ae(font[FontVariant.ButtonMd]);
}), ButtonSize.Md, function(_ref16) {
  var font = _ref16.theme.typography.font;
  return Ae(font[FontVariant.ButtonLg]);
}), ButtonSize.Lg, function(_ref17) {
  var font = _ref17.theme.typography.font;
  return Ae(font[FontVariant.ButtonLgUp]);
});
var baseClassName$h = "Button";
var Label$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "Label")
}).withConfig({
  componentId: "sc-lxwit0-0"
})(["display:flex;"]);
var Badge = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "Badge")
}).withConfig({
  componentId: "sc-lxwit0-1"
})(["display:flex;margin-left:5px;"]);
var Wrapper$1 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "Body")
}).withConfig({
  componentId: "sc-lxwit0-2"
})(function() {
  return Ae(["display:flex;align-items:center;"]);
});
var Button$1 = /* @__PURE__ */ qe.button.attrs({
  className: generateClassNames(baseClassName$h, "root")
}).withConfig({
  componentId: "sc-lxwit0-3"
})(function(_ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? ButtonColor.Secondary : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? ButtonSize.Md : _ref$size, buttonType = _ref.buttonType, active = _ref.active, theme = _ref.theme;
  return Ae(["display:inline-flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center;border-radius:", ";transition:all 100ms ease-out;border:0;cursor:pointer;outline:none;", " ", " ", " ", "{", " ", "}", "{", "}", ""], theme.shape.borderRadius[BorderRadiusSize.Md], buttonType !== ButtonType.Sidebar && colorButtonMixin$1[color], buttonType === ButtonType.Sidebar ? sizeSidebarMixin[size] : sizeButtonMixin[size], color === ButtonColor.Secondary && sizeSecondaryButtonMixin[size], Label$2, sizeButtonLabelMixin[size], (color === ButtonColor.LinkBasicPrimary || color === ButtonColor.LinkBasicSecondary) && "font-weight: 400", Badge, sizeButtonLabelMixin[size], buttonType === ButtonType.Sidebar && Ae(["background-color:", ";color:", ";border:1px solid ", ";", " ", " &:disabled{color:", ";background:", ";border:none;cursor:default;}"], theme.palette[Color.ButtonPrimaryText], theme.palette[Color.LinkStateless], theme.palette[Color.BordersButton], !active && Ae(["&:hover{color:", ";background-color:", ";border:none;}&:active{color:", ";background-color:", ";border:none;}"], theme.palette[Color.ButtonPrimaryText], theme.palette[Color.AccentPrimaryHover], theme.palette[Color.ButtonPrimaryText], theme.palette[Color.AccentPrimaryActive]), active && Ae(["background-color:", ";color:", ";border:1px solid ", ";"], theme.palette[Color.Accent_1_2_Opacity], theme.palette[Color.AccentPrimaryActive], theme.palette[Color.AccentPrimaryActive]), theme.palette[Color.BordersDisabled], theme.palette[Color.AccentPrimaryDisabled]));
});
var StartIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "StartIcon")
}).withConfig({
  componentId: "sc-lxwit0-4"
})(function(_ref2) {
  var $loading = _ref2.$loading, _ref2$size = _ref2.size, size = _ref2$size === void 0 ? ButtonSize.Md : _ref2$size;
  return Ae(["display:flex;svg{animation:", ";}", ""], $loading ? "spinner 1.2s linear infinite" : "1.2s", paddingIconLabelMixin[size]);
});
var SideArrows = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "SideBar")
}).withConfig({
  componentId: "sc-lxwit0-5"
})(function(_ref3) {
  var sideBarType = _ref3.sideBarType;
  return Ae(["display:flex;", ":12px;"], "margin-".concat(sideBarType === SideBar.Left ? "right" : "left"));
});
var Divider = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "Divider")
}).withConfig({
  componentId: "sc-lxwit0-6"
})(function(_ref4) {
  var sideBarType = _ref4.sideBarType, _ref4$size = _ref4.size, size = _ref4$size === void 0 ? ButtonSize.Md : _ref4$size;
  return Ae(["border-left-style:solid;border-width:1px;", " ", ":12px;"], sizeSidebarDividerMixin[size], "margin-".concat(sideBarType === SideBar.Left ? "right" : "left"));
});
var EndIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$h, "EndIcon")
}).withConfig({
  componentId: "sc-lxwit0-7"
})(["display:flex;margin-left:6px;"]);
var Styled$i = applyDisplayNames({
  Button: Button$1,
  Wrapper: Wrapper$1,
  Label: Label$2,
  SideArrows,
  Divider,
  StartIcon,
  EndIcon,
  Badge
});
var _excluded$1D = ["children", "startIcon", "endIcon", "badge", "color", "active", "buttonType", "sideBarType", "size", "loading", "disabled"];
var Button = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, startIcon = _ref.startIcon, endIcon = _ref.endIcon, badge = _ref.badge, color = _ref.color, active = _ref.active, buttonType = _ref.buttonType, _ref$sideBarType = _ref.sideBarType, sideBarType = _ref$sideBarType === void 0 ? SideBar.Left : _ref$sideBarType, size = _ref.size, loading = _ref.loading, disabled = _ref.disabled, rest = _objectWithoutProperties(_ref, _excluded$1D);
  var getSideBarArrows = function getSideBarArrows2(props) {
    switch (sideBarType) {
      case SideBar.Right:
        return active ? /* @__PURE__ */ React.createElement(TwoArrowsLeft, props) : /* @__PURE__ */ React.createElement(TwoArrowsRight, props);
      case SideBar.Left:
        return active ? /* @__PURE__ */ React.createElement(TwoArrowsRight, props) : /* @__PURE__ */ React.createElement(TwoArrowsLeft, props);
    }
  };
  var getSideBarSection = function getSideBarSection2() {
    var sideBarSection = [/* @__PURE__ */ React.createElement(Styled$i.SideArrows, {
      key: "arrows",
      sideBarType
    }, getSideBarArrows({
      size: getSideBarIconSize(size)
    }))];
    var divider = /* @__PURE__ */ React.createElement(Styled$i.Divider, {
      key: "divider",
      size,
      sideBarType
    });
    if (sideBarType === SideBar.Right) {
      sideBarSection.unshift(divider);
    } else {
      sideBarSection.push(divider);
    }
    return buttonType === ButtonType.Sidebar && sideBarSection;
  };
  return /* @__PURE__ */ React.createElement(Styled$i.Button, _extends({
    type: "button",
    buttonType
  }, rest, {
    disabled: loading || disabled,
    sideBarType,
    color,
    active,
    size,
    ref
  }), sideBarType === SideBar.Left && getSideBarSection(), /* @__PURE__ */ React.createElement(Styled$i.Wrapper, null, startIcon && /* @__PURE__ */ React.createElement(Styled$i.StartIcon, {
    $loading: loading,
    size
  }, typeof startIcon === "function" ? loading ? /* @__PURE__ */ React.createElement(Spinner$1, {
    size: getIconSize$2(size)
  }) : startIcon({
    size: getIconSize$2(size)
  }) : (
    // eslint-disable-next-line unicorn/no-nested-ternary
    loading ? /* @__PURE__ */ React.createElement(Spinner$1, {
      size: getIconSize$2(size)
    }) : startIcon
  )), loading && !startIcon && /* @__PURE__ */ React.createElement(Styled$i.StartIcon, {
    $loading: loading
  }, /* @__PURE__ */ React.createElement(Spinner$1, {
    size: getIconSize$2(size)
  })), /* @__PURE__ */ React.createElement(Styled$i.Label, null, children), endIcon && /* @__PURE__ */ React.createElement(Styled$i.EndIcon, null, typeof endIcon === "function" ? endIcon({
    size: getIconSize$2(size)
  }) : endIcon)), sideBarType === SideBar.Right && getSideBarSection(), badge && /* @__PURE__ */ React.createElement(Styled$i.Badge, null, /* @__PURE__ */ React.createElement(Badge$1, {
    inline: true,
    size: 14,
    padding: "0 1px",
    badgeContent: badge,
    color: color === ButtonColor.Primary ? "white" : "secondary"
  })));
});
Button.defaultProps = {
  size: ButtonSize.Md,
  color: ButtonColor.Secondary,
  buttonType: ButtonType.Default,
  active: false
};
Button.propTypes = {
  size: PropTypes.oneOf(objectValues(ButtonSize)),
  color: PropTypes.oneOf(objectValues(ButtonColor)),
  buttonType: PropTypes.oneOf(objectValues(ButtonType)),
  sideBarType: PropTypes.oneOf(objectValues(SideBar)),
  startIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  endIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  badge: PropTypes.node,
  active: PropTypes.bool,
  loading: PropTypes.bool,
  disabled: PropTypes.bool
};
var _excluded$1C = ["color", "size"];
var Image22 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1C);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 42 42",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0.483002 4.49014V37.5097C0.483002 38.5725 0.90519 39.5917 1.65669 40.3432C2.40819 41.0947 3.42745 41.5169 4.49023 41.5169H37.5098C38.5726 41.5169 39.5918 41.0947 40.3433 40.3432C41.0948 39.5917 41.517 38.5725 41.517 37.5097V4.49014C41.517 3.42735 41.0948 2.4081 40.3433 1.6566C39.5918 0.905099 38.5726 0.48291 37.5098 0.48291H4.49023C3.42745 0.48291 2.40819 0.905099 1.65669 1.6566C0.90519 2.4081 0.483002 3.42735 0.483002 4.49014ZM38.9272 5.87776V31.3044L26.3817 19.5446L21.8068 22.3356L14.8048 15.3337L3.07279 23.0543V6.06233C3.07279 5.2695 3.38775 4.50913 3.94836 3.94851C4.50898 3.38789 5.26935 3.07294 6.06218 3.07294H36.1222C36.8661 3.07294 37.5795 3.36844 38.1055 3.89444C38.6316 4.42044 38.9272 5.13385 38.9272 5.87776Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M30.4602 15.6943C33.066 15.6943 35.1784 13.5819 35.1784 10.976C35.1784 8.37021 33.066 6.25777 30.4602 6.25777C27.8543 6.25777 25.7419 8.37021 25.7419 10.976C25.7419 13.5819 27.8543 15.6943 30.4602 15.6943Z",
    fill: color
  }));
});
var _excluded$1B = ["color", "size"];
var Undo = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1B);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 40 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M39.5112 31.2036C39.5112 41.568 31.0785 50 20.7148 50H14.0613C12.9587 50 12.0652 49.1066 12.0652 48.004V47.3386C12.0652 46.2359 12.9586 45.3425 14.0613 45.3425H20.7148C28.5107 45.3425 34.8537 38.9995 34.8537 31.2036C34.8537 23.4078 28.5107 17.0648 20.7148 17.0648H8.4394L16.8935 25.5189C17.8015 26.4266 17.8015 27.9042 16.8935 28.8119C16.0124 29.6923 14.479 29.691 13.5999 28.8119L1.17111 16.3828C0.731285 15.943 0.488892 15.3581 0.488892 14.7359C0.488892 14.1142 0.731285 13.529 1.17111 13.0894L13.6006 0.65976C14.4797 -0.220001 16.0144 -0.220001 16.8936 0.65976C17.8016 1.56722 17.8016 3.04511 16.8936 3.95246L8.43951 12.4072H20.7148C31.0785 12.4072 39.5112 20.8395 39.5112 31.2036Z",
    fill: color
  }));
});
var _excluded$1A = ["color", "size"];
var Redo = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1A);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 40 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0.98 31.2037C0.98 41.568 9.41216 50 19.7752 50H26.4284C27.5309 50 28.4244 49.1066 28.4244 48.004V47.3386C28.4244 46.2359 27.531 45.3425 26.4284 45.3425H19.7752C11.9798 45.3425 5.6372 38.9995 5.6372 31.2037C5.6372 23.4079 11.9798 17.0648 19.7752 17.0648H32.05L23.5964 25.5189C22.6884 26.4266 22.6884 27.9043 23.5964 28.812C24.4774 29.6924 26.0107 29.6911 26.8897 28.812L39.3178 16.3828C39.7576 15.943 40 15.3582 40 14.736C40 14.1142 39.7576 13.5291 39.3178 13.0895L26.8891 0.659821C26.01 -0.21994 24.4754 -0.21994 23.5962 0.659821C22.6883 1.56728 22.6883 3.04517 23.5962 3.95252L32.0498 12.4073H19.7752C9.41216 12.4073 0.98 20.8396 0.98 31.2037Z",
    fill: color
  }));
});
var _excluded$1z = ["color", "size"];
var Line3 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1z);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M40.1901 7.27549L7.59689 39.8687C6.83412 40.6315 6.83412 41.8681 7.59689 42.6308C8.35965 43.3936 9.59626 43.3936 10.359 42.6308L42.9522 10.0376C43.715 9.27486 43.715 8.03825 42.9522 7.27549C42.1895 6.51272 40.9529 6.51272 40.1901 7.27549Z",
    fill: color
  }));
});
var _excluded$1y = ["color", "size"];
var ImageFilters = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1y);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M41.2229 16.7653C41.3215 12.426 39.7436 8.284 36.6864 5.02956C33.6292 1.77513 29.4872 -2.09808e-05 25.0493 -2.09808e-05C20.6114 -2.09808e-05 16.3708 1.77513 13.3136 5.02956C10.2564 8.18538 8.6785 12.3274 8.77712 16.7653C3.45168 19.5266 0 25.1479 0 31.1637C0 37.2781 3.25444 42.6035 8.57988 45.4635C11.0454 46.7455 13.7081 47.4359 16.2722 47.4359C19.3294 47.4359 22.288 46.5483 24.9507 44.8718C29.9803 48.1262 36.0947 48.3234 41.4201 45.4635C46.7456 42.6035 50 37.2781 50 31.1637C50 25.0493 46.6469 19.5266 41.2229 16.7653ZM22.7811 43.0966C18.6391 45.3649 13.7081 45.3649 9.56607 42.998C5.22682 40.5325 2.66272 36.1933 2.66272 31.1637C2.66272 26.43 5.12821 22.0907 9.1716 19.6252C10.1578 24.359 13.3136 28.501 17.6529 30.6706C17.4556 35.4043 19.3294 39.8422 22.7811 43.0966ZM32.1499 27.8106C31.4596 24.5562 29.783 21.499 27.3176 19.2307C30.6706 17.357 34.8126 17.0611 38.4615 18.3432C37.7712 22.2879 35.503 25.7396 32.1499 27.8106ZM20.6114 28.1065C21.3018 25.2465 22.8797 22.6824 25.0493 20.8087C27.5148 22.8797 29.1913 25.8382 29.6844 28.9941C26.7258 30.0789 23.4714 30.0789 20.4142 28.9941C20.4142 28.6982 20.5128 28.4023 20.6114 28.1065ZM25.0493 17.4556C23.57 16.4694 21.8935 15.7791 20.1183 15.3846C19.428 15.1874 18.6391 15.6805 18.5404 16.3708C18.4418 16.7653 18.5404 17.0611 18.7377 17.357C18.9349 17.6528 19.2308 17.8501 19.5266 17.9487C20.7101 18.2446 21.7949 18.639 22.7811 19.2307C20.3156 21.499 18.6391 24.4576 17.9487 27.8106C14.5957 25.7396 12.2288 22.2879 11.6371 18.3432C11.9329 18.2446 12.1302 18.1459 12.426 18.0473C12.7219 17.9487 13.0178 17.7515 13.215 17.357C13.4122 17.0611 13.4122 16.6666 13.3136 16.3708C13.1164 15.6805 12.3274 15.286 11.6371 15.4832C11.5385 15.4832 11.5385 15.4832 11.4398 15.5818C11.8343 8.48124 17.7515 2.6627 25.0493 2.6627C32.3471 2.6627 38.2643 8.38262 38.6588 15.5818C34.0237 14.2012 28.9941 14.8915 25.0493 17.4556ZM29.783 31.7554C29.5858 35.5029 27.9093 39.0532 25.0493 41.5187C22.1893 39.0532 20.4142 35.6016 20.3156 31.7554C23.3728 32.7416 26.7258 32.7416 29.783 31.7554ZM32.4458 30.6706C36.785 28.4023 39.8422 24.359 40.927 19.6252C44.9704 22.0907 47.4359 26.43 47.4359 31.1637C47.4359 36.0947 44.8718 40.5325 40.5325 42.998C36.3905 45.3649 31.4596 45.3649 27.3176 43.0966C30.7692 39.8422 32.643 35.4043 32.4458 30.6706Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M15.5819 14.8915C14.9901 14.9901 14.497 15.5818 14.497 16.1735C14.497 16.8639 15.0888 17.5542 15.8777 17.5542C16.6667 17.5542 17.2584 16.9625 17.2584 16.1735C17.2584 15.7791 17.0611 15.3846 16.7653 15.1874C16.3708 14.9901 15.9763 14.8915 15.5819 14.8915Z",
    fill: color
  }));
});
var _excluded$1x = ["color", "size"];
var Crop$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1x);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5 2.00049C3.34315 2.00049 2 3.34364 2 5.00049V16.7505H5.5V5.50049H16.75V2.00049H5ZM45 2.00049H33.25V5.50049H44.5V16.7505H48V5.00049C48 3.34363 46.6569 2.00049 45 2.00049ZM5.5 33.2505H2V45.0005C2 46.6573 3.34315 48.0005 5 48.0005H16.75V44.5005H5.5V33.2505ZM48 33.2505H44.5V44.5005H33.25V48.0005H45C46.6569 48.0005 48 46.6573 48 45.0005V33.2505Z",
    fill: color
  }));
});
var _excluded$1w = ["color", "size"];
var CropLandscape = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1w);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 53 37",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M4.11841 3.93799V32.063H47.8684V3.93799H4.11841ZM3.49341 0.812988C2.1127 0.812988 0.993408 1.91229 0.993408 3.26835V32.7326C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7326V3.26835C50.9934 1.91229 49.8741 0.812988 48.4934 0.812988H3.49341Z",
    fill: color
  }));
});
var _excluded$1v = ["color", "size"];
var Resize$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1v);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0.5 0.5H3V2.375H2.375V3H0.5V0.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.5 21.125H3V21.2693H24.7308V43H24.875V45.5L0.5 45.5001V21.125ZM22.2308 43L3 43.0001V23.7693H22.2308V43Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M43 45.5H45.5V43H43.625V43.625H43V45.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 3V0.5H43V2.375H43.625V3H45.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M6.125 0.5V3H9.875V0.5H6.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M13.625 0.5V3H17.375V0.5H13.625Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M21.125 0.5V3H24.875V0.5H21.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.625 0.5V3H32.375V0.5H28.625Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.125 0.5V3H39.875V0.5H36.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 6.125H43V9.875H45.5V6.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 13.625H43V17.375H45.5V13.625Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 21.125H43V24.875H45.5V21.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 28.625H43V32.375H45.5V28.625Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 36.125H43V39.875H45.5V36.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M39.875 45.5V43H36.125V45.5H39.875Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M32.375 45.5V43H28.625V45.5H32.375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M0.5 17.375H3V13.625H0.5V17.375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M0.5 9.875H3V6.125H0.5V9.875Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M35.1391 9.23718L26.3209 17.8619C25.8274 18.3446 25.8186 19.136 26.3013 19.6295C26.784 20.1231 27.5754 20.1319 28.069 19.6492L37.1012 10.815V16.9907C37.1012 17.681 37.6609 18.2407 38.3512 18.2407C39.0416 18.2407 39.6012 17.681 39.6012 16.9907V7.98718C39.6012 7.29683 39.0416 6.73718 38.3512 6.73718L29.3477 6.73718C28.6574 6.73718 28.0977 7.29683 28.0977 7.98718C28.0977 8.67754 28.6574 9.23718 29.3477 9.23718L35.1391 9.23718Z",
    fill: color
  }));
});
var _excluded$1u = ["color", "size"];
var Watermark$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1u);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M42.1323 0.500031H2.73399C1.42693 0.500031 0.399963 1.527 0.399963 2.83406V43.166C0.399963 44.4731 1.42693 45.5 2.73399 45.5H42.1323C43.4394 45.5 44.4664 44.4731 44.4664 43.166V2.83406C44.4664 1.527 43.4394 0.500031 42.1323 0.500031ZM41.6655 3.30086V25.8942L36.624 21.693C36.1572 21.2262 35.4103 21.2262 34.8502 21.5996L28.595 26.2677L15.5244 11.2365C15.3377 10.9565 14.9643 10.7697 14.5908 10.7697C14.2174 10.7697 13.8439 10.9565 13.5639 11.1432L3.20079 21.693V3.30086H41.6655ZM3.20079 42.6992V39.8984C4.22776 40.3652 5.72154 40.832 7.58876 40.832C9.36262 40.832 10.483 40.2718 11.3232 39.805C12.0701 39.4316 12.5369 39.1515 13.3771 39.2448C14.3108 39.3382 14.8709 39.5249 15.4311 39.805C16.2713 40.0851 17.2049 40.4585 18.9788 40.4585V38.3112C17.6717 38.3112 17.0182 38.0312 16.178 37.7511C15.5244 37.471 14.6842 37.1909 13.5639 37.0975C12.0701 36.9108 11.1365 37.471 10.2962 37.8444C9.54934 38.2179 8.80245 38.5913 7.4954 38.5913C5.06801 38.5913 3.6676 37.7511 3.10743 37.2843V35.0436C4.1344 35.5104 5.62818 35.9772 7.4954 35.9772C9.26926 35.9772 10.3896 35.417 11.2298 34.9502C11.9767 34.5768 12.4435 34.2967 13.2838 34.3901C14.2174 34.4834 14.7776 34.6702 15.3377 34.9502C16.178 35.2303 17.1116 35.6038 18.8854 35.6038V33.4565C17.5784 33.4565 16.9249 33.1764 16.0846 32.8963C15.4311 32.6162 14.5908 32.3361 13.4705 32.2428C11.9767 32.056 11.0431 32.6162 10.2029 32.9897C9.45598 33.3631 8.70909 33.7365 7.40204 33.7365C4.97465 33.7365 3.57424 32.8963 3.01407 32.4295V30.1888C4.04104 30.6556 5.53482 31.1224 7.40204 31.1224C9.1759 31.1224 10.2962 30.5623 11.1365 30.0955C11.8834 29.722 12.3502 29.4419 13.1904 29.5353C14.124 29.6287 14.6842 29.8154 15.2444 30.0955C16.0846 30.3755 17.0182 30.749 18.7921 30.749V28.6017C17.485 28.6017 16.8315 28.3216 15.9912 28.0415C15.3377 27.7614 14.4975 27.4814 13.3771 27.388C11.8834 27.2013 10.9498 27.7614 10.1095 28.1349C9.36262 28.5083 8.61573 28.8818 7.30868 28.8818C4.88129 28.8818 3.48088 28.0415 2.92071 27.5747V25.7075L14.124 14.2241L27.1012 29.0685C27.568 29.6287 28.4083 29.722 28.9684 29.2552L35.4103 24.4004L41.3854 29.4419V42.6058H3.20079V42.6992Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M32.7029 15.7179C35.4103 15.7179 37.651 13.4772 37.651 10.7697C37.651 8.06227 35.4103 5.82161 32.7029 5.82161C29.9954 5.82161 27.7547 8.06227 27.7547 10.7697C27.7547 13.4772 29.9954 15.7179 32.7029 15.7179ZM32.7029 8.15563C34.1966 8.15563 35.317 9.36933 35.317 10.7697C35.317 12.1702 34.1033 13.3838 32.7029 13.3838C31.3025 13.3838 30.0888 12.1702 30.0888 10.7697C30.0888 9.36933 31.2091 8.15563 32.7029 8.15563Z",
    fill: color
  }));
});
var _excluded$1t = ["color", "size"];
var Images = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1t);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M43.4164 5.98527H1.06762C0.533808 5.98527 0 6.53674 0 7.08821V49C0 49.7353 0.533808 50.1029 1.06762 50.1029H43.4164C44.1281 50.1029 44.484 49.7353 44.484 49V7.08821C44.484 6.53674 44.1281 5.98527 43.4164 5.98527ZM35.7651 13.1544C37.9004 13.1544 39.5 15.0809 39.5 17.1029C39.5 19.3088 37.7224 20.6029 35.7651 20.6029C33.8078 20.6029 32 19.125 32 17.1029C31.8221 14.897 33.6299 13.1544 35.7651 13.1544ZM1.9573 45.875C2.13523 45.6912 14.2349 30.9853 16.548 27.8603C16.726 27.4926 17.2598 27.4926 17.4377 27.8603L29.7153 43.4853L35.0534 37.4191C35.4093 37.0514 35.7651 37.2353 35.9431 37.4191L42.5267 45.875H1.9573Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M48.9164 -3.8147e-06H6.74555C6.03381 -3.8147e-06 5.5 0.367643 5.5 1.10294V4.29294H7.5V2.20588H47.6892V39H46.2473V44.1176H48.9164C49.6281 44.1176 49.984 43.75 49.984 43.0147V1.10294C49.984 0.367643 49.6281 -3.8147e-06 48.9164 -3.8147e-06Z",
    fill: color
  }));
});
var _excluded$1s = ["color", "size"];
var Reset = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1s);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M25 0C38.8071 0 50 11.1929 50 25C50 38.807 38.8071 50 25 50C14.111 50 4.854 43.0397 1.42326 33.333C0.963005 32.0312 1.6455 30.603 2.94725 30.143C4.249 29.6828 5.67725 30.365 6.1375 31.667C8.88425 39.4382 16.2957 45 25 45C36.0457 45 45 36.0457 45 25C45 13.9543 36.0457 5 25 5C21.121 5 17.8345 6.40292 14.7095 8.6015C12.6078 10.0803 10.663 11.8526 8.6895 13.75H16.25C17.6308 13.75 18.75 14.8693 18.75 16.25C18.75 17.6307 17.6308 18.75 16.25 18.75H2.5C1.11926 18.75 0 17.6307 0 16.25V2.5C0 1.1193 1.11926 0 2.5 0C3.88075 0 5 1.1193 5 2.5V10.3593C7.12075 8.31457 9.38601 6.23342 11.8325 4.51222C15.5128 1.9229 19.7882 0 25 0Z",
    fill: color
  }));
});
var _excluded$1r = ["color", "size"];
var Text3 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1r);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M39.4229 8.89453L39.7891 16.6582H38.8613C38.6823 15.291 38.4382 14.3145 38.1289 13.7285C37.6243 12.7845 36.9489 12.0928 36.1025 11.6533C35.2725 11.1976 34.1738 10.9697 32.8066 10.9697H28.1436V36.2627C28.1436 38.2972 28.3633 39.5667 28.8027 40.0713C29.4212 40.7549 30.3734 41.0967 31.6592 41.0967H32.8066V42H18.7686V41.0967H19.9404C21.3402 41.0967 22.333 40.6735 22.9189 39.8271C23.277 39.3063 23.4561 38.1182 23.4561 36.2627V10.9697H19.4766C17.9303 10.9697 16.8317 11.0837 16.1807 11.3115C15.3343 11.6208 14.61 12.2148 14.0078 13.0938C13.4056 13.9727 13.0475 15.1608 12.9336 16.6582H12.0059L12.3965 8.89453H39.4229Z",
    fill: color
  }));
});
const Text$1 = Text3;
var _excluded$1q = ["color", "size"];
var TextAlignLeft = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1q);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 45 29",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0 1.89502C0 1.20466 0.559644 0.64502 1.25 0.64502H28.75C29.4404 0.64502 30 1.20466 30 1.89502C30 2.58538 29.4404 3.14502 28.75 3.14502H1.25C0.559645 3.14502 0 2.58538 0 1.89502Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M0 14.395C0 13.7047 0.559644 13.145 1.25 13.145H43.75C44.4404 13.145 45 13.7047 45 14.395C45 15.0854 44.4404 15.645 43.75 15.645H1.25C0.559645 15.645 0 15.0854 0 14.395Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M1.25 25.645C0.559644 25.645 0 26.2047 0 26.895C0 27.5854 0.559645 28.145 1.25 28.145H28.75C29.4404 28.145 30 27.5854 30 26.895C30 26.2047 29.4404 25.645 28.75 25.645H1.25Z",
    fill: color
  }));
});
var _excluded$1p = ["color", "size"];
var TextAlignCenter = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1p);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 46 28",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M38 1.50049C38 0.810132 37.4404 0.250488 36.75 0.250488H9.25C8.55964 0.250488 8 0.810132 8 1.50049C8 2.19084 8.55964 2.75049 9.25 2.75049H36.75C37.4404 2.75049 38 2.19084 38 1.50049Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 14.0005C45.5 13.3101 44.9404 12.7505 44.25 12.7505H1.75C1.05964 12.7505 0.5 13.3101 0.5 14.0005C0.5 14.6908 1.05964 15.2505 1.75 15.2505H44.25C44.9404 15.2505 45.5 14.6908 45.5 14.0005Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.75 25.2505C37.4404 25.2505 38 25.8101 38 26.5005C38 27.1908 37.4404 27.7505 36.75 27.7505H9.25C8.55964 27.7505 8 27.1908 8 26.5005C8 25.8101 8.55964 25.2505 9.25 25.2505H36.75Z",
    fill: color
  }));
});
var _excluded$1o = ["color", "size"];
var RotationLeft = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1o);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 45 43",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M2.66027 14.6997L3.59752 14.4437L3.09232 3.93218C3.05918 3.24262 2.47331 2.71049 1.78375 2.74363C1.09419 2.77677 0.562061 3.36263 0.595202 4.05219L1.16041 15.8123C1.19355 16.5018 1.77942 17.034 2.46898 17.0008L14.2291 16.4356C14.9186 16.4025 15.4508 15.8166 15.4176 15.1271C15.3845 14.4375 14.7986 13.9054 14.1091 13.9385L5.48447 14.353C8.23224 7.41077 15.0052 2.50049 22.925 2.50049C33.2802 2.50049 41.6748 10.8951 41.6748 21.2503C41.6748 22.4035 41.5706 23.5324 41.3713 24.6281L43.7968 25.261C44.0449 23.9622 44.1748 22.6214 44.1748 21.2503C44.1748 9.51435 34.6609 0.000488281 22.925 0.000488281C15.0467 0.000488281 8.16974 4.28779 4.50001 10.6566L2.66027 14.6997Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.88491 34.708L8.27773 36.6309C8.82614 37.1539 9.40248 37.6479 10.0043 38.1103L11.5276 36.128C10.9528 35.6863 10.4043 35.2121 9.88491 34.708Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M12.3142 39.6567C13.9038 40.5764 15.6235 41.2961 17.439 41.7814L18.0846 39.3662C16.4846 38.9385 14.9685 38.3041 13.5662 37.4928L12.3142 39.6567Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M20.1654 42.3209C21.0738 42.4394 22.0002 42.5005 22.9408 42.5005C23.8815 42.5005 24.8079 42.4394 25.7162 42.3209L25.3929 39.8419C24.5915 39.9465 23.7731 40.0005 22.9408 40.0005C22.1086 40.0005 21.2902 39.9465 20.4888 39.8419L20.1654 42.3209Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.4427 41.7814C30.2582 41.2961 31.9779 40.5764 33.5674 39.6567L32.3154 37.4928C30.9132 38.3041 29.397 38.9385 27.7971 39.3662L28.4427 41.7814Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M35.8774 38.1103C37.3494 36.9791 38.6692 35.6594 39.8004 34.1873L37.8181 32.664C36.8193 33.9638 35.6538 35.1292 34.354 36.128L35.8774 38.1103Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M41.3468 31.8773C42.2665 30.2878 42.9862 28.5681 43.4715 26.7526L41.0563 26.107C40.6286 27.707 39.9942 29.2231 39.1829 30.6253L41.3468 31.8773Z",
    fill: color
  }));
});
const RotationLeft$1 = RotationLeft;
var _excluded$1n = ["color", "size"];
var RotationRight = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1n);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("g", {
    clipPath: "url(#clip0)"
  }, /* @__PURE__ */ React.createElement("path", {
    d: "M50.2753 26.8064H24.4689L36.5656 14.7096C32.735 11.0806 28.7027 9.66933 23.6624 9.66933C13.3802 9.66933 6.32372 15.3145 3.50118 25.5967L0.275391 24.7903C3.50118 13.0968 11.9689 6.44355 23.6625 6.44355C29.7109 6.44355 34.348 8.25806 38.9851 12.2903L50.2754 1L50.2753 26.8064Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M34.5495 46.3628L33.1382 44.3467C33.743 43.9435 34.3479 43.3386 34.9527 42.9355L36.5656 44.75C35.9608 45.1532 35.3559 45.758 34.5495 46.3628Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M27.2913 49.387C26.6865 49.5886 26.0817 49.5886 25.4768 49.7903L25.0736 47.3709C26.4848 47.1693 27.8962 46.7661 29.3074 46.3628L30.1139 48.5806C29.1058 48.9838 28.2994 49.1854 27.2913 49.387ZM20.4365 49.9919C18.8235 49.7903 17.2107 49.5886 15.5978 48.9838L16.4042 46.766C17.8155 47.1693 19.2268 47.5724 20.6381 47.5724L20.4365 49.9919ZM11.1623 46.9677C9.75104 46.1612 8.33971 45.1532 7.13003 43.9435L8.74296 42.129C9.75104 43.137 10.9607 43.9435 12.372 44.7499L11.1623 46.9677ZM3.90425 40.3144C2.89617 38.9032 2.08974 37.2903 1.6865 35.879L3.90425 35.0726C4.50909 36.4838 5.11393 37.6935 5.92036 38.9032L3.90425 40.3144Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M3.2996 30.0322L0.880241 30.2338C0.678647 29.2257 0.678647 28.4193 0.678647 27.4112H3.09801C3.09801 28.4193 3.2996 29.2258 3.2996 30.0322Z",
    fill: color
  })), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("rect", {
    width: "50",
    height: "50",
    fill: "white",
    transform: "translate(0.275391)"
  })));
});
var _excluded$1m = ["color", "size"];
var LockOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1m);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 51 51",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M40.5 20H38V12.5C38 5.6 32.4 0 25.5 0C18.6 0 13 5.6 13 12.5V20H10.5C9.1 20 8 21.1 8 22.5V47.5C8 48.9 9.1 50 10.5 50H40.5C41.9 50 43 48.9 43 47.5V22.5C43 21.1 41.9 20 40.5 20ZM15.5 12.5C15.5 7 20 2.5 25.5 2.5C31 2.5 35.5 7 35.5 12.5V20H15.5V12.5ZM40.5 47.5H10.5V22.5H40.5V47.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M24.3 37.3V41.3H26.8V37.3C28.3 36.8 29.3 35.4 29.3 33.8C29.3 31.7 27.6 30 25.5 30C23.4 30 21.7 31.7 21.7 33.8C21.8 35.4 22.8 36.8 24.3 37.3ZM25.5 32.5C26.2 32.5 26.8 33.1 26.8 33.8C26.8 34.5 26.2 35.1 25.5 35.1C24.8 35.1 24.2 34.5 24.2 33.8C24.3 33.1 24.8 32.5 25.5 32.5Z",
    fill: color
  }));
});
var _excluded$1l = ["color", "size"];
var UnlockOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1l);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M36.2754 7.5C34.2754 3.1 29.8754 0 24.7754 0C17.8754 0 12.2754 5.6 12.2754 12.5V20H9.77539C8.37539 20 7.27539 21.1 7.27539 22.5V47.5C7.27539 48.9 8.37539 50 9.77539 50H39.7754C41.1754 50 42.2754 48.9 42.2754 47.5V22.5C42.2754 21.1 41.1754 20 39.7754 20H14.7754V12.5C14.7754 7 19.2754 2.5 24.7754 2.5C28.4754 2.5 31.7754 4.5 33.4754 7.6L36.2754 7.5ZM39.7754 47.5H9.77539V22.5H39.7754V47.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M24.7754 30C22.6754 30 20.9754 31.7 20.9754 33.7C20.9754 35.3 21.9754 36.7 23.4754 37.2V41.2H25.9754V37.2C27.4754 36.7 28.4754 35.3 28.4754 33.7C28.5754 31.7 26.8754 30 24.7754 30ZM24.7754 35C24.0754 35 23.4754 34.4 23.4754 33.7C23.4754 33 24.0754 32.4 24.7754 32.4C25.4754 32.4 25.9754 33 25.9754 33.7C25.9754 34.4 25.4754 35 24.7754 35Z",
    fill: color
  }));
});
var _excluded$1k = ["color", "size"];
var Point = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1k);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("circle", {
    cx: "25",
    cy: "25",
    r: "8.33333",
    fill: color
  }));
});
var _excluded$1j = ["color", "size"];
var About = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1j);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M42.6793 7.32203C32.916 -2.44013 17.0863 -2.44122 7.32197 7.32203C-2.44128 17.0853 -2.4402 32.915 7.32197 42.6793C17.0852 52.4404 32.9149 52.4415 42.6793 42.6793C52.4414 32.915 52.4403 17.0864 42.6793 7.32203ZM28.2605 35.8705C28.2605 37.6716 26.8007 39.1314 24.9995 39.1314C23.1984 39.1314 21.7386 37.6716 21.7386 35.8705V22.8267C21.7386 21.0256 23.1984 19.5658 24.9995 19.5658C26.8007 19.5658 28.2605 21.0256 28.2605 22.8267V35.8705ZM24.9419 17.2527C23.0636 17.2527 21.8114 15.9222 21.8506 14.2798C21.8114 12.558 23.0636 11.2678 24.98 11.2678C26.8974 11.2678 28.1105 12.5591 28.1507 14.2798C28.1496 15.9222 26.8985 17.2527 24.9419 17.2527Z",
    fill: color
  }));
});
var _excluded$1i = ["color", "size"];
var Warning = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1i);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M48.9856 38.314L31.3034 3.80423C29.9688 1.42247 27.6118 0 24.9985 0C22.3852 0 20.0282 1.42247 18.6936 3.80423C18.6836 3.82245 18.6751 3.84067 18.665 3.8589L1.04158 38.2594C-0.321602 40.6914 -0.347383 43.612 0.971367 46.0713C2.29314 48.5321 4.67439 50 7.345 50H42.5544C45.225 50 47.7041 48.5321 49.0258 46.0713C50.3445 43.6121 50.3188 40.6913 48.9856 38.314ZM22.0659 15.8013C22.0659 14.0842 23.3789 12.6924 24.9985 12.6924C26.6182 12.6924 27.9311 14.0843 27.9311 15.8013V28.2372C27.9311 29.9541 26.6181 31.3462 24.9985 31.3462C23.3789 31.3462 22.0659 29.954 22.0659 28.2372V15.8013ZM24.9985 43.7821C22.5728 43.7821 20.5995 41.6902 20.5995 39.1186C20.5995 36.5471 22.5727 34.4552 24.9985 34.4552C27.4242 34.4552 29.3974 36.5471 29.3974 39.1186C29.3975 41.6901 27.4243 43.7821 24.9985 43.7821Z",
    fill: color
  }));
});
var _excluded$1h = ["color", "size"];
var InfoOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1h);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M25 50C11.2033 50 0 38.7967 0 25C0 11.2033 11.2033 0 25 0C38.7967 0 50 11.2033 50 25C50 38.7967 38.6929 50 25 50ZM25 3.52697C13.1743 3.52697 3.63071 13.1743 3.63071 24.8963C3.63071 36.6183 13.278 46.2656 25 46.2656C36.8257 46.2656 46.3693 36.6183 46.3693 24.8963C46.3693 13.1743 36.8257 3.52697 25 3.52697Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.3755 13.125C28.3755 11.3992 26.9765 10 25.2505 10C23.5245 10 22.1255 11.3992 22.1255 13.125C22.1255 14.8516 23.5245 16.25 25.2505 16.25C26.9765 16.25 28.3755 14.8516 28.3755 13.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M20.563 38.5H29.938C30.8009 38.5 31.5005 37.8012 31.5005 36.9375C31.5005 36.0746 30.8009 35.375 29.938 35.375H28.3755V20.9375C28.3755 20.0746 27.6759 19.375 26.813 19.375H20.563C19.7001 19.375 19.0005 20.0746 19.0005 20.9375C19.0005 21.8012 19.7001 22.5 20.563 22.5H22.1255V35.375H20.563C19.7001 35.375 19.0005 36.0746 19.0005 36.9375C19.0005 37.8012 19.7001 38.5 20.563 38.5Z",
    fill: color
  }));
});
var _excluded$1g = ["color", "size"];
var ImageOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1g);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M31.3032 17.8662C34.0646 17.8662 36.3032 15.6276 36.3032 12.8662C36.3032 10.1048 34.0646 7.86618 31.3032 7.86618C28.5418 7.86618 26.3032 10.1048 26.3032 12.8662C26.3032 15.6276 28.5418 17.8662 31.3032 17.8662ZM31.3032 15.3662C32.6839 15.3662 33.8032 14.2469 33.8032 12.8662C33.8032 11.4855 32.6839 10.3662 31.3032 10.3662C29.9225 10.3662 28.8032 11.4855 28.8032 12.8662C28.8032 14.2469 29.9225 15.3662 31.3032 15.3662Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M15.9372 15.1063C16.3967 15.0794 16.8338 15.3071 17.075 15.6991L25.0831 28.7141L29.8357 24.4289C30.0935 24.1966 30.4362 24.0818 30.7819 24.1121C31.1276 24.1424 31.4452 24.3151 31.6586 24.5887L40.2822 35.6497C40.5759 36.0264 40.6292 36.5376 40.4196 36.9668C40.21 37.396 39.7741 37.6683 39.2964 37.6683H6.70331C6.2766 37.6683 5.87937 37.4506 5.64974 37.091C5.42011 36.7313 5.38981 36.2794 5.56937 35.8923L14.8765 15.8282C15.0702 15.4106 15.4777 15.1333 15.9372 15.1063ZM16.1652 18.991L8.66108 35.1683H36.7368L30.5126 27.1848L25.6422 31.5761C25.3666 31.8246 24.9947 31.9378 24.6274 31.885C24.26 31.8322 23.9351 31.6189 23.7406 31.3027L16.1652 18.991Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z",
    fill: color
  }));
});
var _excluded$1f = ["color", "size"];
var Custom = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1f);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.562515 0.562512H3.68752V2.90626H2.90627V3.68751H0.562515V0.562512ZM0.562515 44.3125V47.4375H3.68752V45.0938H2.90627V44.3125H0.562515ZM44.3125 47.4375H47.4375V44.3125H45.0938V45.0938H44.3125V47.4375ZM47.4375 3.68751V0.562512H44.3125V2.90626H45.0938V3.68751H47.4375ZM7.59376 0.562512V3.68751H12.2813V0.562512H7.59376ZM16.9688 0.562512V3.68751H21.6563V0.562512H16.9688ZM26.3438 0.562512V3.68751H31.0313V0.562512H26.3438ZM35.7188 0.562512V3.68751H40.4063V0.562512H35.7188ZM47.4375 7.59376H44.3125V12.2813H47.4375V7.59376ZM47.4375 16.9688H44.3125V21.6563H47.4375V16.9688ZM47.4375 26.3438H44.3125V31.0313H47.4375V26.3438ZM47.4375 35.7188H44.3125V40.4063H47.4375V35.7188ZM40.4063 47.4375V44.3125H35.7188V47.4375H40.4063ZM31.0313 47.4375V44.3125H26.3438V47.4375H31.0313ZM21.6563 47.4375V44.3125H16.9688V47.4375H21.6563ZM12.2813 47.4375V44.3125H7.59377V47.4375H12.2813ZM0.562515 40.4063H3.68752V35.7188H0.562515V40.4063ZM0.562515 31.0313H3.68752V26.3438H0.562515V31.0313ZM0.562515 21.6563H3.68752V16.9688H0.562515V21.6563ZM0.562515 12.2813H3.68752V7.59376H0.562515V12.2813Z",
    fill: color
  }));
});
var _excluded$1e = ["color", "size"];
var FlipY$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1e);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M37.5001 24.0625C38.2086 24.0625 38.8284 23.5858 39.0102 22.901C39.1921 22.2162 38.8904 21.4948 38.2753 21.1433L3.27531 1.14333C2.79171 0.866989 2.19757 0.868973 1.71583 1.14854C1.23409 1.4281 0.937592 1.94298 0.937592 2.49996V22.5C0.937592 23.3629 1.63715 24.0625 2.50009 24.0625L37.5001 24.0625ZM4.06259 20.9375L4.06259 5.19243L31.6164 20.9375L4.06259 20.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M38.2753 28.8566C38.8904 28.5051 39.1921 27.7837 39.0102 27.0989C38.8284 26.4142 38.2086 25.9375 37.5001 25.9375H35.3126V26.9504L34.5374 27.3933L35.3126 28.75V29.0625H35.4912L36.0878 30.1066L38.2753 28.8566Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M27.3378 35.1066L31.7128 32.6066L30.1624 29.8933L25.7874 32.3933L27.3378 35.1066Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M30.9376 25.9375H26.5626L26.5626 29.0625H30.9376L30.9376 25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M18.5878 40.1066L22.9628 37.6066L21.4124 34.8933L17.0374 37.3933L18.5878 40.1066Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M22.1876 25.9375H17.8126V29.0625H22.1876V25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.83781 45.1066L14.2128 42.6066L12.6624 39.8933L8.28738 42.3933L9.83781 45.1066Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M13.4376 25.9375H9.0626V29.0625H13.4376V25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M3.27531 48.8566L5.46281 47.6066L4.06259 45.1562V45H3.97331L3.91238 44.8933L3.72578 45H0.937592V47.5C0.937592 48.0569 1.23409 48.5718 1.71583 48.8514C2.19758 49.1309 2.79171 49.1329 3.27531 48.8566Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M4.6876 25.9375L2.50009 25.9375C1.63715 25.9375 0.937592 26.637 0.937592 27.5V30H4.06259V29.0625H4.6876V25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M0.937592 35V40L4.06259 40V35H0.937592Z",
    fill: color
  }));
});
var _excluded$1d = ["color", "size"];
var FlipX$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1d);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M24.0625 1.93758C24.0625 1.22909 23.5858 0.609274 22.901 0.427427C22.2163 0.245581 21.4949 0.547225 21.1434 1.16237L1.14337 39.2874C0.867028 39.771 0.869012 40.3651 1.14858 40.8468C1.42814 41.3286 1.94302 41.6251 2.5 41.6251H22.5C23.3629 41.6251 24.0625 40.9255 24.0625 40.0626V1.93758ZM20.9375 38.5001H5.19247L20.9375 7.82128V38.5001Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.8566 1.16237C28.5051 0.547225 27.7837 0.245581 27.099 0.427428C26.4142 0.609274 25.9375 1.22909 25.9375 1.93758V4.12508H26.9504L27.3934 4.9003L28.75 4.12508H29.0625V3.94651L30.1066 3.34986L28.8566 1.16237Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M35.1066 12.0999L32.6066 7.72486L29.8934 9.2753L32.3934 13.6503L35.1066 12.0999Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M25.9375 8.50008V12.8751H29.0625V8.50008H25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M40.1066 23.9749L37.6066 19.5999L34.8934 21.1503L37.3934 25.5253L40.1066 23.9749Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M25.9375 20.3751V24.7501H29.0625V20.3751H25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.1066 32.7249L42.6066 28.3499L39.8934 29.9003L42.3934 34.2753L45.1066 32.7249Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M25.9375 29.1251V33.5001H29.0625V29.1251H25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M48.8566 39.2874L47.6066 37.0999L45.1562 38.5001H45V38.5894L44.8934 38.6503L45 38.8369V41.6251H47.5C48.057 41.6251 48.5719 41.3286 48.8514 40.8468C49.131 40.3651 49.133 39.771 48.8566 39.2874Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M25.9375 37.8751V40.0626C25.9375 40.9255 26.6371 41.6251 27.5 41.6251H30V38.5001H29.0625V37.8751H25.9375Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M35 41.6251H40V38.5001H35V41.6251Z",
    fill: color
  }));
});
var _excluded$1c = ["color", "size"];
var Ellipse3 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1c);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M25.2047 46.875C37.2859 46.875 47.0797 37.0812 47.0797 25C47.0797 12.9188 37.2859 3.125 25.2047 3.125C13.1235 3.125 3.32968 12.9188 3.32968 25C3.32968 37.0812 13.1235 46.875 25.2047 46.875ZM25.2047 50C39.0118 50 50.2047 38.8071 50.2047 25C50.2047 11.1929 39.0118 0 25.2047 0C11.3976 0 0.204681 11.1929 0.204681 25C0.204681 38.8071 11.3976 50 25.2047 50Z",
    fill: color
  }));
});
var _excluded$1b = ["color", "size"];
var Landscape = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1b);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 51 36",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M4.11841 3.93805V32.063H47.8684V3.93805H4.11841ZM3.49341 0.813049C2.1127 0.813049 0.993408 1.91235 0.993408 3.26841V32.7327C0.993408 34.0887 2.1127 35.188 3.49341 35.188H48.4934C49.8741 35.188 50.9934 34.0887 50.9934 32.7327V3.26841C50.9934 1.91235 49.8741 0.813049 48.4934 0.813049H3.49341Z",
    fill: color
  }));
});
var _excluded$1a = ["color", "size"];
var Stroke = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$1a);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5.50015 7.9997C5.50015 6.61898 6.61944 5.49969 8.00015 5.49969H38.0002C39.3809 5.49969 40.5002 6.61898 40.5002 7.99969V37.9997C40.5002 39.3804 39.3809 40.4997 38.0002 40.4997H8.00015C6.61944 40.4997 5.50015 39.3804 5.50015 37.9997V7.9997ZM8.00015 7.99969H38.0002V37.9997H8.00015V7.99969Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.5 3C0.5 1.61929 1.61929 0.5 3 0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V43C45.5 44.3807 44.3807 45.5 43 45.5H3C1.61929 45.5 0.5 44.3807 0.5 43V3ZM3 3H43V43H3V3Z",
    fill: color
  }));
});
var _excluded$19 = ["color", "size"];
var Transparency = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$19);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0.166672 0.166664H8.50001V8.5H0.166672V0.166664Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M16.8333 8.5H8.50001V16.8333H0.166672V25.1667H8.50001V33.5H0.166672V41.8333H8.50001V33.5H16.8333V41.8333H25.1667V33.5H33.5V41.8333H41.8333V33.5H33.5V25.1667H41.8333V16.8333H33.5V8.5H41.8333V0.166664H33.5V8.5H25.1667V0.166664H16.8333V8.5ZM16.8333 16.8333V8.5H25.1667V16.8333H16.8333ZM16.8333 25.1667V33.5H25.1667V25.1667H33.5V16.8333H25.1667V25.1667H16.8333ZM16.8333 25.1667H8.50001V16.8333H16.8333V25.1667Z",
    fill: color
  }));
});
var _excluded$18 = ["color", "size"];
var Shadow = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$18);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2.95831 0.458374C1.5776 0.458374 0.458313 1.57766 0.458313 2.95837V35.4584C0.458313 36.8391 1.5776 37.9584 2.95831 37.9584H7.54167V43.7917C7.54167 45.8627 9.2206 47.5417 11.2917 47.5417H43.7917C45.8627 47.5417 47.5417 45.8627 47.5417 43.7917V11.2917C47.5417 9.22059 45.8627 7.54166 43.7917 7.54166H37.9583V2.95837C37.9583 1.57766 36.839 0.458374 35.4583 0.458374H2.95831ZM35.4583 2.95837H2.95831L2.95831 35.4584H35.4583V2.95837ZM15.7267 37.9584L10.0417 43.746V37.9584H15.7267ZM11.5135 45.0417L18.4712 37.9584H28.5529L21.4696 45.0417H11.5135ZM24.4159 45.0417H34.2932L45.0417 34.1339V24.0207L37.9583 31.3242V35.4584C37.9583 36.8391 36.839 37.9584 35.4583 37.9584H31.4912C31.4689 37.9859 31.445 38.0126 31.4194 38.0382L24.4159 45.0417ZM45.0417 21.3515L37.9583 28.655V18.9107L45.0417 11.8338V21.3515ZM37.0311 45.0417H43.7917C44.482 45.0417 45.0417 44.482 45.0417 43.7917V36.9124L37.0311 45.0417ZM43.8844 10.045C43.8538 10.0428 43.8229 10.0417 43.7917 10.0417H37.9583V15.9657L43.8844 10.045Z",
    fill: color
  }));
});
var _excluded$17 = ["color", "size"];
var RadiusCorner = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$17);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M3 3H23V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V23H43V43H3V3Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 7.25076H43V5.50076C43 5.15718 42.9321 4.83576 42.8113 4.54446L45.1206 3.58682C45.3651 4.17636 45.5 4.82281 45.5 5.50076V7.25076Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M24.75 0.500763V3.00076H28.25V0.500763H24.75Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M31.75 0.500763V3.00076H35.25V0.500763H31.75Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M38.75 0.500763V3.00076H40.5C40.8436 3.00076 41.165 3.06868 41.4563 3.18948L42.414 0.880166C41.8244 0.635694 41.178 0.500763 40.5 0.500763H38.75Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 10.7508H43V14.2508H45.5V10.7508Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M45.5 17.7508H43V21.2508H45.5V17.7508Z",
    fill: color
  }));
});
var _excluded$16 = ["color", "size"];
var Position = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$16);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M9.25008 9.24878H11.7501V10.9675H10.9688V11.7488H9.25008V9.24878Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.25008 34.2488V36.7488H11.7501V35.03H10.9688V34.2488H9.25008Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M34.2501 36.7488H36.7501V34.2488H35.0313V35.03H34.2501V36.7488Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.7501 11.7488V9.24878H34.2501V10.9675H35.0313V11.7488H36.7501Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M14.4063 9.24878V11.7488H17.8438V9.24878H14.4063Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M21.2813 9.24878V11.7488H24.7188V9.24878H21.2813Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.1563 9.24878V11.7488H31.5938V9.24878H28.1563Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.7501 14.405H34.2501V17.8425H36.7501V14.405Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.7501 21.28H34.2501V24.7175H36.7501V21.28Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.7501 28.155H34.2501V31.5925H36.7501V28.155Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M31.5938 36.7488V34.2488H28.1563V36.7488H31.5938Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M24.7188 36.7488V34.2488H21.2813V36.7488H24.7188Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M17.8438 36.7488V34.2488H14.4063V36.7488H17.8438Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.25008 31.5925H11.7501V28.155H9.25008V31.5925Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.25008 24.7175H11.7501V21.28H9.25008V24.7175Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M9.25008 17.8425H11.7501V14.405H9.25008V17.8425Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M23.0002 26.7497C25.0712 26.7497 26.7502 25.0708 26.7502 22.9997C26.7502 20.9286 25.0712 19.2497 23.0002 19.2497C20.9291 19.2497 19.2502 20.9286 19.2502 22.9997C19.2502 25.0708 20.9291 26.7497 23.0002 26.7497Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z",
    fill: color
  }));
});
var _excluded$15 = ["color", "size"];
var Spacing = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$15);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M4.29986 0.991788C4.78802 0.503633 5.57947 0.503633 6.06763 0.991788L9.367 4.29116C9.85516 4.77932 9.85516 5.57077 9.367 6.05893C8.87885 6.54708 8.08739 6.54708 7.59924 6.05893L6.43374 4.89344V34.0829L7.59924 32.9174C8.08739 32.4293 8.87885 32.4293 9.367 32.9174C9.85516 33.4056 9.85516 34.197 9.367 34.6852L6.06763 37.9846C5.8332 38.219 5.51524 38.3507 5.18371 38.3507C4.85217 38.3507 4.53422 38.219 4.29981 37.9845L1.00084 34.6851C0.512712 34.1969 0.512761 33.4055 1.00095 32.9174C1.48913 32.4292 2.28059 32.4293 2.76871 32.9175L3.93374 34.0827V4.89344L2.76825 6.05893C2.2801 6.54708 1.48864 6.54708 1.00049 6.05893C0.51233 5.57077 0.51233 4.77932 1.00049 4.29116L4.29986 0.991788ZM13.1588 8.34109V1.49725H46.3156V8.34102H43.398V7.19776C43.398 5.54595 42.0562 4.20442 40.4047 4.20442H31.8516V26.0992C31.8516 28.1387 33.5088 29.7957 35.5481 29.7957H36.5137V32.4599H23.01V29.7957H23.9756C26.0151 29.7957 27.6721 28.1387 27.6721 26.0992V4.20448H19.0697C17.418 4.20448 16.0763 5.54604 16.0763 7.19783V8.34109H13.1588ZM46.9995 39.7088C47.4877 39.2207 47.4877 38.4292 46.9995 37.9411L43.7001 34.6417C43.212 34.1535 42.4205 34.1535 41.9324 34.6417C41.4442 35.1298 41.4442 35.9213 41.9324 36.4095L43.0979 37.5749L15.0832 37.5749L16.2484 36.4099C16.7366 35.9218 16.7366 35.1303 16.2485 34.6421C15.7604 34.154 14.9689 34.1539 14.4807 34.642L11.1814 37.941C10.9469 38.1754 10.8152 38.4934 10.8152 38.8249C10.8152 39.1564 10.9469 39.4744 11.1813 39.7088L14.4807 43.0082C14.9688 43.4964 15.7603 43.4964 16.2485 43.0082C16.7366 42.5201 16.7366 41.7286 16.2485 41.2404L15.083 40.0749L43.0979 40.0749L41.9324 41.2404C41.4442 41.7286 41.4442 42.5201 41.9324 43.0082C42.4205 43.4964 43.212 43.4964 43.7001 43.0082L46.9995 39.7088Z",
    fill: color
  }));
});
var _excluded$14 = ["color", "size"];
var Padding = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$14);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M13.8334 9.19949C13.8334 8.50914 14.3931 7.94949 15.0834 7.94949H31.3334C32.0238 7.94949 32.5834 8.50914 32.5834 9.19949C32.5834 9.88985 32.0238 10.4495 31.3334 10.4495H15.0834C14.3931 10.4495 13.8334 9.88985 13.8334 9.19949Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M15.0834 35.5496C14.3931 35.5496 13.8334 36.1092 13.8334 36.7996C13.8334 37.4899 14.3931 38.0496 15.0834 38.0496H31.3334C32.0238 38.0496 32.5834 37.4899 32.5834 36.7996C32.5834 36.1092 32.0238 35.5496 31.3334 35.5496H15.0834Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M36.8001 13.4163C37.4905 13.4163 38.0501 13.9759 38.0501 14.6663V30.9163C38.0501 31.6066 37.4905 32.1663 36.8001 32.1663C36.1098 32.1663 35.5501 31.6066 35.5501 30.9163V14.6663C35.5501 13.9759 36.1098 13.4163 36.8001 13.4163Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M10.45 14.6663C10.45 13.9759 9.89038 13.4163 9.20003 13.4163C8.50967 13.4163 7.95003 13.9759 7.95003 14.6663L7.95003 30.9163C7.95003 31.6066 8.50967 32.1663 9.20003 32.1663C9.89038 32.1663 10.45 31.6066 10.45 30.9163L10.45 14.6663Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V43C0.5 44.3807 1.61929 45.5 3 45.5H43C44.3807 45.5 45.5 44.3807 45.5 43V3C45.5 1.61929 44.3807 0.5 43 0.5H3ZM43 3H3V43H43V3Z",
    fill: color
  }));
});
var _excluded$13 = ["color", "size"];
var Polygon = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$13);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M44.103 18.4866L24.0002 3.8811L3.89749 18.4866L11.5761 42.1188H36.4244L44.103 18.4866ZM25.8371 1.35293C24.7418 0.557164 23.2587 0.557162 22.1634 1.35292L2.06066 15.9584C0.96539 16.7542 0.507082 18.1647 0.925439 19.4523L8.604 43.0845C9.02236 44.372 10.2222 45.2438 11.5761 45.2438H36.4244C37.7782 45.2438 38.9781 44.372 39.3965 43.0845L47.075 19.4523C47.4934 18.1647 47.0351 16.7542 45.9398 15.9584L25.8371 1.35293Z",
    fill: color
  }));
});
var _excluded$12 = ["color", "size"];
var PolygonSides = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$12);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 48",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M23.0078 29.9669H25.835L24.7803 35.9727H27.4609L28.5156 29.9669H32.2363V27.4473H28.9551L29.6875 23.2872H33.3496V20.7383H30.1416L31.2109 14.6446H28.5303L27.4609 20.7383H24.6191L25.6885 14.6446H23.0225L21.9531 20.7383H18.1006V23.2872H21.499L20.7666 27.4473H17.002V29.9669H20.3271L19.2725 35.9727H21.9531L23.0078 29.9669ZM26.2744 27.4473H23.4473L24.165 23.2872H27.0068L26.2744 27.4473Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M23.5448 0.821208C24.421 0.184598 25.6075 0.184597 26.4837 0.821207L48.4803 16.8026C49.3565 17.4392 49.7231 18.5677 49.3885 19.5977L40.9865 45.4562C40.6518 46.4862 39.692 47.1836 38.6089 47.1836H11.4197C10.3366 47.1836 9.37672 46.4862 9.04204 45.4562L0.640107 19.5977C0.305422 18.5677 0.672067 17.4392 1.54829 16.8026L23.5448 0.821208ZM25.0143 2.84375L47.0108 18.8252L38.6089 44.6836H11.4197L3.01775 18.8252L25.0143 2.84375Z",
    fill: color
  }));
});
var _excluded$11 = ["color", "size"];
var ArrowRight = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$11);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 46 30",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M45.5 15.0005C45.5 15.7079 45.2003 16.3822 44.6753 16.8562L30.8291 29.3562C29.8042 30.2814 28.2234 30.2006 27.2982 29.1758C26.373 28.1509 26.4537 26.57 27.4786 25.6448L36.5 17.5005L3 17.5005C1.61928 17.5005 0.499999 16.3812 0.499999 15.0005C0.499999 13.6198 1.61929 12.5005 3 12.5005L36.5 12.5005L27.4786 4.35618C26.4537 3.43096 26.373 1.85011 27.2982 0.82525C28.2234 -0.199608 29.8042 -0.280382 30.8291 0.644837L44.6753 13.1448C45.2003 13.6189 45.5 14.2931 45.5 15.0005Z",
    fill: color
  }));
});
var _excluded$10 = ["color", "size"];
var FontItalic = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$10);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M19 48L26.9931 2H31.2019L23.2087 48H19Z",
    fill: color
  }));
});
var _excluded$$ = ["color", "size"];
var FontBold = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$$);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 14 18",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M0.214966 17.4813V0.518677H6.61123C8.82693 0.518677 10.5075 0.914783 11.653 1.70699C12.7985 2.49144 13.3712 3.64481 13.3712 5.16709C13.3712 5.99814 13.1413 6.7321 12.6814 7.36898C12.2216 7.99809 11.5819 8.46021 10.7625 8.75535C11.699 8.97282 12.4348 9.41164 12.9699 10.0718C13.5133 10.732 13.7851 11.5397 13.7851 12.4951C13.7851 14.1261 13.2249 15.361 12.1045 16.1998C10.9841 17.0386 9.38713 17.4658 7.31357 17.4813H0.214966ZM3.97748 10.0951V14.6736H7.20069C8.08697 14.6736 8.77677 14.4795 9.27007 14.0911C9.77174 13.695 10.0226 13.1513 10.0226 12.4601C10.0226 10.9067 9.1572 10.1184 7.42644 10.0951H3.97748ZM3.97748 7.62528H6.76173C8.65971 7.59421 9.6087 6.89132 9.6087 5.5166C9.6087 4.74769 9.36623 4.19625 8.88128 3.86228C8.4047 3.52054 7.64801 3.34967 6.61123 3.34967H3.97748V7.62528Z",
    fill: color
  }));
});
var _excluded$_ = ["color", "size"];
var UploadOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$_);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M17.5911 1.54582C16.7075 0.680052 15.2937 0.680014 14.4101 1.54573L4.05296 11.6925C3.15635 12.5709 3.14159 14.0098 4.01999 14.9064C4.89839 15.8031 6.33733 15.8178 7.23394 14.9394L13.7278 8.57741V30.4419C13.7278 31.6971 14.7454 32.7147 16.0006 32.7147C17.2558 32.7147 18.2733 31.6971 18.2733 30.4419V8.57782L24.766 14.9393C25.6625 15.8178 27.1015 15.8031 27.9799 14.9065C28.8584 14.01 28.8437 12.571 27.9471 11.6926L17.5911 1.54582Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M2.78827 36.5543C1.53308 36.5543 0.515541 37.5719 0.515541 38.827C0.515541 40.0822 1.53308 41.0998 2.78827 41.0998H29.1519C30.4071 41.0998 31.4246 40.0822 31.4246 38.827C31.4246 37.5719 30.4071 36.5543 29.1519 36.5543H2.78827Z",
    fill: color
  }));
});
const UploadOutline$1 = UploadOutline;
var _excluded$Z = ["color", "size"];
var ArrowLeftOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$Z);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 28 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M26.907 0.71085C25.7493 -0.292553 23.9445 -0.224769 22.8758 0.862251L0.931376 23.1837C-0.0773525 24.2097 -0.0773525 25.7913 0.931376 26.8173L22.8758 49.1388C23.9445 50.2258 25.7493 50.2936 26.907 49.2902C28.0647 48.2868 28.1369 46.5921 27.0683 45.5051L6.90997 25.0005L27.0683 4.49589C28.1369 3.40888 28.0647 1.71425 26.907 0.71085Z",
    fill: color
  }));
});
const ArrowLeftOutline$1 = ArrowLeftOutline;
var _excluded$Y = ["color", "size"];
var ArrowRightOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$Y);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 28 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M1.09286 0.71085C2.25057 -0.292553 4.05541 -0.224769 5.12407 0.862251L27.0685 23.1837C28.0772 24.2097 28.0772 25.7913 27.0685 26.8173L5.12407 49.1388C4.05541 50.2258 2.25057 50.2936 1.09286 49.2902C-0.0648579 48.2868 -0.137051 46.5921 0.93161 45.5051L21.0899 25.0005L0.93161 4.49589C-0.137051 3.40888 -0.0648579 1.71425 1.09286 0.71085Z",
    fill: color
  }));
});
var _excluded$X = ["color", "size"];
var PlusOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$X);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 38 38",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M16.9167 21.0838L16.9167 35.6672C16.9167 36.8177 17.8494 37.7505 19 37.7505C20.1506 37.7505 21.0833 36.8177 21.0833 35.6672L21.0833 21.0838H35.6667C36.8173 21.0838 37.75 20.1511 37.75 19.0005C37.75 17.8499 36.8173 16.9172 35.6667 16.9172L21.0833 16.9172L21.0833 2.33382C21.0833 1.18323 20.1506 0.250488 19 0.250488C17.8494 0.250488 16.9167 1.18323 16.9167 2.33382L16.9167 16.9172H2.33333C1.18274 16.9172 0.25 17.8499 0.25 19.0005C0.25 20.1511 1.18274 21.0838 2.33333 21.0838H16.9167Z",
    fill: color
  }));
});
var _excluded$W = ["color", "size"];
var ArrowTool = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$W);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M1.04757 38.9503C0.437373 38.3401 0.437373 37.3508 1.04757 36.7406L33.9229 3.86697L23.8354 3.33584C22.9736 3.29047 22.3118 2.5551 22.3572 1.69335C22.4026 0.831601 23.138 0.169794 23.9997 0.215167L37.5909 0.930759C38.3892 0.972794 39.027 1.61063 39.0691 2.40894L39.7846 16.0001C39.83 16.8619 39.1682 17.5972 38.3065 17.6426C37.4447 17.688 36.7093 17.0262 36.664 16.1644L36.1328 6.07651L3.25728 38.9503C2.64708 39.5605 1.65776 39.5605 1.04757 38.9503Z",
    fill: color
  }));
});
var _excluded$V = ["color", "size"];
var Compare = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$V);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M27.1607 4.16667V2.08333C27.1607 0.93274 26.2279 0 25.0773 0C23.9267 0 22.994 0.932741 22.994 2.08333V4.16667H4.244C1.94281 4.16667 0.0773315 6.03215 0.0773315 8.33333V41.6667C0.0773315 43.9679 1.94281 45.8333 4.244 45.8333H22.994V47.9167C22.994 49.0673 23.9267 50 25.0773 50C26.2279 50 27.1607 49.0673 27.1607 47.9167V45.8333H45.9107C48.2118 45.8333 50.0773 43.9678 50.0773 41.6667V8.33333C50.0773 6.03215 48.2119 4.16667 45.9107 4.16667H27.1607ZM22.994 8.33333H4.244L4.244 41.6667H22.994V8.33333ZM27.1607 41.6667V8.33333H45.9107V41.6667H27.1607Z",
    fill: color
  }));
});
var _excluded$U = ["color", "size"];
var MinusOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$U);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 38 6",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M35.835 5.0769L2.16498 5.0769C1.00277 5.0769 0.0606079 4.14726 0.0606079 3.00048C0.060608 1.85371 1.00277 0.924072 2.16498 0.924072L35.835 0.924074C36.9972 0.924074 37.9394 1.85372 37.9394 3.00049C37.9394 4.14726 36.9972 5.0769 35.835 5.0769Z",
    fill: color
  }));
});
var _excluded$T = ["color", "size"];
var Temprature = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$T);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M9.48799 3.125H17.0311L17.0311 24.4063C17.0311 26.6148 18.1889 28.4084 19.5429 29.5401C21.7011 31.3438 23.0656 34.0456 23.0656 37.069C23.0656 42.4847 18.6753 46.875 13.2595 46.875C7.84382 46.875 3.45351 42.4847 3.45351 37.069C3.45351 34.0456 4.81799 31.3438 6.97617 29.5401C8.33021 28.4084 9.48799 26.6148 9.48799 24.4063V3.125ZM20.1561 3.125C20.1561 1.39911 18.757 0 17.0311 0H9.48799C7.7621 0 6.36299 1.39911 6.36299 3.125V24.4063C6.36299 25.4785 5.79482 26.4547 4.97216 27.1423C2.13398 29.5143 0.328506 33.0808 0.328506 37.069C0.328506 44.2106 6.11793 50 13.2595 50C20.4012 50 26.1906 44.2106 26.1906 37.069C26.1906 33.0808 24.3851 29.5143 21.5469 27.1423C20.7243 26.4547 20.1561 25.4785 20.1561 24.4063V3.125ZM35.6715 1.25C35.6715 0.559645 35.1119 0 34.4215 0H28.1715C27.4812 0 26.9215 0.559644 26.9215 1.25C26.9215 1.94036 27.4812 2.5 28.1715 2.5L34.4215 2.5C35.1119 2.5 35.6715 1.94036 35.6715 1.25ZM35.6715 8.24951C35.6715 7.55916 35.1119 6.99951 34.4215 6.99951H28.1715C27.4812 6.99951 26.9215 7.55916 26.9215 8.24951C26.9215 8.93987 27.4812 9.49951 28.1715 9.49951H34.4215C35.1119 9.49951 35.6715 8.93987 35.6715 8.24951ZM34.4215 13.999C35.1119 13.999 35.6715 14.5587 35.6715 15.249C35.6715 15.9394 35.1119 16.499 34.4215 16.499H28.1715C27.4812 16.499 26.9215 15.9394 26.9215 15.249C26.9215 14.5587 27.4812 13.999 28.1715 13.999H34.4215ZM13.2594 43.7501C16.366 43.7501 18.8844 41.2317 18.8844 38.1251C18.8844 35.4037 16.9519 33.1337 14.3844 32.6126V10.3662C14.3844 9.67582 13.8247 9.11617 13.1344 9.11617C12.444 9.11617 11.8844 9.67582 11.8844 10.3662V32.6694C9.44245 33.2829 7.63441 35.4928 7.63441 38.1251C7.63441 41.2317 10.1528 43.7501 13.2594 43.7501Z",
    fill: color
  }));
});
var _excluded$S = ["color", "size"];
var Contrast$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$S);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.4376 40.6858V38.5625V4.18746V3.31418C10.8133 4.10816 3.25006 12.1708 3.25006 22C3.25006 31.8292 10.8133 39.8918 20.4376 40.6858ZM40.7501 22C40.7501 31.8292 33.1868 39.8918 23.5626 40.6858V38.5625V4.18746V3.31418C33.1868 4.10816 40.7501 12.1708 40.7501 22ZM43.8751 22C43.8751 34.0812 34.0813 43.875 22.0001 43.875C9.91883 43.875 0.125061 34.0812 0.125061 22C0.125061 9.91877 9.91883 0.125 22.0001 0.125C34.0813 0.125 43.8751 9.91877 43.8751 22Z",
    fill: color
  }));
});
var _excluded$R = ["color", "size"];
var FineTune = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$R);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M16.3679 7.50003C15.7995 10.005 13.5592 11.875 10.8823 11.875C8.20528 11.875 5.96506 10.005 5.39665 7.50003H1.5448C0.854444 7.50003 0.2948 6.94039 0.2948 6.25003C0.2948 5.55967 0.854444 5.00003 1.5448 5.00003H5.39665C5.96506 2.49504 8.20528 0.625031 10.8823 0.625031C13.5592 0.625031 15.7995 2.49504 16.3679 5.00003H48.4557C49.1461 5.00003 49.7057 5.55967 49.7057 6.25003C49.7057 6.94039 49.1461 7.50003 48.4557 7.50003H16.3679ZM14.0073 6.25003C14.0073 7.97592 12.6082 9.37503 10.8823 9.37503C9.15637 9.37503 7.75726 7.97592 7.75726 6.25003C7.75726 4.52414 9.15637 3.12503 10.8823 3.12503C12.6082 3.12503 14.0073 4.52414 14.0073 6.25003Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M34.5715 27.625C37.2485 27.625 39.4887 25.755 40.0571 23.25H48.4554C49.1458 23.25 49.7054 22.6904 49.7054 22C49.7054 21.3096 49.1458 20.75 48.4554 20.75H40.0571C39.4887 18.245 37.2485 16.375 34.5715 16.375C31.8946 16.375 29.6543 18.245 29.0859 20.75H1.5448C0.854444 20.75 0.2948 21.3096 0.2948 22C0.2948 22.6904 0.854444 23.25 1.5448 23.25H29.0859C29.6543 25.755 31.8946 27.625 34.5715 27.625ZM34.5715 25.125C36.2974 25.125 37.6965 23.7259 37.6965 22C37.6965 20.2741 36.2974 18.875 34.5715 18.875C32.8456 18.875 31.4465 20.2741 31.4465 22C31.4465 23.7259 32.8456 25.125 34.5715 25.125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M22.7702 39C22.2018 41.505 19.9615 43.375 17.2845 43.375C14.6076 43.375 12.3673 41.505 11.7989 39H1.5448C0.854444 39 0.2948 38.4403 0.2948 37.75C0.2948 37.0596 0.854444 36.5 1.5448 36.5H11.7989C12.3673 33.995 14.6076 32.125 17.2845 32.125C19.9615 32.125 22.2018 33.995 22.7702 36.5H48.4554C49.1458 36.5 49.7054 37.0596 49.7054 37.75C49.7054 38.4403 49.1458 39 48.4554 39H22.7702ZM20.4095 37.75C20.4095 39.4759 19.0104 40.875 17.2845 40.875C15.5587 40.875 14.1595 39.4759 14.1595 37.75C14.1595 36.0241 15.5587 34.625 17.2845 34.625C19.0104 34.625 20.4095 36.0241 20.4095 37.75Z",
    fill: color
  }));
});
var _excluded$Q = ["color", "size"];
var Saturation = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$Q);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M37.2341 37.6984H37.5121V37.4237C41.4447 33.4687 43.875 28.0182 43.875 22C43.875 15.9819 41.4447 10.5314 37.5121 6.57632V6.30045H37.2328C33.2942 2.47819 27.9219 0.125031 22 0.125031C9.91877 0.125031 0.125 9.9188 0.125 22C0.125 34.0813 9.91877 43.875 22 43.875C24.718 43.875 27.3203 43.3793 29.7213 42.4733H30.5303V42.1494C33.0389 41.0861 35.308 39.5679 37.2341 37.6984ZM20.4257 3.31519C10.807 4.1148 3.25 12.1749 3.25 22C3.25 31.8252 10.807 39.8853 20.4257 40.6849V3.31519ZM34.3871 36.0759C33.221 37.1029 31.9263 37.9873 30.5303 38.7017V5.29836C31.9263 6.01281 33.221 6.89715 34.3871 7.92411V36.0759ZM37.5121 11.4641C39.5556 14.4669 40.75 18.094 40.75 22C40.75 25.9061 39.5556 29.5332 37.5121 32.536V11.4641ZM23.5507 40.6868C24.8796 40.578 26.1693 40.3307 27.4053 39.9592V4.04089C26.1693 3.66941 24.8796 3.42203 23.5507 3.31324V40.6868Z",
    fill: color
  }));
});
var _excluded$P = ["color", "size"];
var Annotate = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$P);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M46.1442 31.379C45.4585 31.379 44.8974 31.9429 44.8974 32.6321V43.7349C44.8974 45.8025 43.2267 47.4817 41.157 47.4943H6.22156C4.16433 47.4943 2.49361 45.8151 2.48114 43.7349V11.1283C2.48114 9.06067 4.15186 7.38147 6.22156 7.36894H17.2807C17.9665 7.36894 18.5275 6.80503 18.5275 6.1158C18.5275 5.42658 17.9665 4.86267 17.2807 4.86267H6.22156C2.79284 4.8752 0 7.66969 0 11.1283V43.7349C0 47.1935 2.79284 50.0005 6.22156 50.0005H41.157C44.5982 50.0005 47.3786 47.1935 47.3786 43.7474V32.6321C47.391 31.9429 46.83 31.379 46.1442 31.379Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M46.8923 1.65462C44.698 -0.55089 41.157 -0.55089 38.9627 1.65462L16.7571 23.9729C16.6075 24.1233 16.4953 24.3113 16.4329 24.5243L13.5154 35.1258C13.3907 35.5644 13.5154 36.0281 13.8396 36.3413C14.1513 36.6546 14.6251 36.7799 15.049 36.6672L25.5969 33.7348C25.8089 33.6722 25.9959 33.5719 26.1455 33.409L48.3636 11.0782C50.5455 8.87267 50.5455 5.31377 48.3636 3.10826L46.8923 1.65462ZM19.4751 24.7875L37.6535 6.51678L43.5135 12.4065L25.3351 30.6897L19.4751 24.7875ZM18.3031 27.1559L22.9911 31.8677L16.5077 33.6722L18.3031 27.1559ZM46.5931 9.31127L45.2715 10.6396L39.4115 4.74986L40.7331 3.42154C41.9425 2.206 43.9249 2.206 45.1343 3.42154L46.5931 4.88771C47.815 6.11578 47.815 8.09573 46.5931 9.31127Z",
    fill: color
  }));
});
var _excluded$O = ["color", "size"];
var Blur$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$O);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M18.3626 41.293C17.5103 41.4285 16.7096 40.8474 16.5742 39.9952C16.4387 39.143 17.0198 38.3423 17.872 38.2068C18.2902 38.1403 18.6988 38.0456 19.0958 37.9246C21.9368 37.059 24.1957 34.8468 25.1254 32.0335C25.2671 31.6049 25.378 31.1621 25.4555 30.7076C25.6005 29.857 26.4076 29.2849 27.2583 29.4299C28.109 29.5749 28.681 30.3821 28.536 31.2327C28.432 31.8429 28.283 32.4379 28.0926 33.0142C26.8449 36.7893 23.8206 39.7519 20.0065 40.914C19.4728 41.0766 18.9239 41.2038 18.3626 41.293Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M33.9356 31.0645C33.9356 23.9644 24.1764 8.59028 19.4747 1.59549C18.2785 -0.184172 15.7216 -0.184172 14.5254 1.59548C9.82374 8.59028 0.0645752 23.9644 0.0645752 31.0645C0.0645752 40.4177 7.64685 48 17.0001 48C26.3533 48 33.9356 40.4177 33.9356 31.0645ZM30.8106 31.0645C30.8106 29.8836 30.375 28.0316 29.4236 25.578C28.5 23.1959 27.1988 20.5159 25.7187 17.7756C22.8106 12.3913 19.3287 6.98743 17.0001 3.51586C14.6715 6.98743 11.1895 12.3913 8.28145 17.7756C6.80135 20.5159 5.50017 23.1959 4.57655 25.578C3.62517 28.0316 3.18958 29.8836 3.18958 31.0645C3.18958 38.6918 9.37274 44.875 17.0001 44.875C24.6274 44.875 30.8106 38.6918 30.8106 31.0645Z",
    fill: color
  }));
});
var _excluded$N = ["color", "size"];
var PinOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$N);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M43.0081 15.2287L36.7869 17.6214L28.935 29.9601C30.5809 33.9266 30.3662 38.0903 27.1408 41.3158L26.5656 41.8909C25.9554 42.5011 24.9661 42.5011 24.3559 41.8909L14.4122 31.9472L2.99211 43.3673C2.38192 43.9775 1.3926 43.9775 0.782403 43.3673C0.17221 42.7571 0.172211 41.7678 0.782403 41.1576L12.2025 29.7375L2.25883 19.7938C1.64864 19.1836 1.64864 18.1943 2.25883 17.5841L2.50512 17.3378C5.73058 14.1123 10.2231 13.5688 14.1897 15.2147L26.5283 7.36283L28.9211 1.14165C29.327 0.0863053 30.6847 -0.201832 31.4843 0.597706L43.552 12.6655C44.3516 13.465 44.0634 14.8228 43.0081 15.2287ZM29.0752 9.44618L30.9747 4.50752L39.6422 13.1751L34.7035 15.0745L25.4251 29.655L26.0486 31.1577C27.234 34.0146 27.0773 36.5309 25.4342 38.5498L5.64209 18.7576C7.75439 17.2384 10.4304 17.0382 12.992 18.1011L14.4948 18.7246L29.0752 9.44618Z",
    fill: color
  }));
});
var _excluded$M = ["color", "size"];
var Duplicate = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$M);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.312012 34.847V3.39883C0.312012 1.67294 1.71112 0.273834 3.43701 0.273834H26.807C28.5329 0.273834 29.932 1.67294 29.932 3.39883V34.847C29.932 36.5729 28.5329 37.972 26.807 37.972H3.43701C1.71112 37.972 0.312012 36.5729 0.312012 34.847ZM3.43701 34.847V3.39883L26.807 3.39883L26.807 34.847L3.43701 34.847Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M35.6874 12.5434C35.6874 11.6805 34.9878 10.9809 34.1249 10.9809C33.2619 10.9809 32.5624 11.6805 32.5624 12.5434V40.6009H9.89033C9.02739 40.6009 8.32783 41.3005 8.32783 42.1634C8.32783 43.0263 9.02739 43.7259 9.89033 43.7259H34.1249C34.9878 43.7259 35.6874 43.0263 35.6874 42.1634V12.5434Z",
    fill: color
  }));
});
var _excluded$L = ["color", "size"];
var DeleteOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$L);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M15.75 17.3125C15.75 16.4496 16.4496 15.75 17.3125 15.75C18.1754 15.75 18.875 16.4496 18.875 17.3125L18.875 32.9375C18.875 33.8005 18.1754 34.5 17.3125 34.5C16.4496 34.5 15.75 33.8005 15.75 32.9375L15.75 17.3125Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M26.6875 15.75C25.8246 15.75 25.125 16.4496 25.125 17.3125L25.125 32.9375C25.125 33.8005 25.8246 34.5 26.6875 34.5C27.5504 34.5 28.25 33.8005 28.25 32.9375V17.3125C28.25 16.4496 27.5504 15.75 26.6875 15.75Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M12.625 6.37503V3.25003C12.625 1.52414 14.0241 0.125031 15.75 0.125031H28.25C29.9759 0.125031 31.375 1.52414 31.375 3.25003V6.37503H42.3125C43.1754 6.37503 43.875 7.07459 43.875 7.93753C43.875 8.80048 43.1754 9.50003 42.3125 9.50003H39.1875V40.75C39.1875 42.4759 37.7884 43.875 36.0625 43.875H7.9375C6.21161 43.875 4.8125 42.4759 4.8125 40.75V9.50003L1.6875 9.50003C0.824554 9.50003 0.125 8.80048 0.125 7.93753C0.125 7.07459 0.824555 6.37503 1.6875 6.37503H12.625ZM15.75 3.25003H28.25V6.37503H15.75V3.25003ZM7.9375 9.50003L7.9375 40.75H36.0625V9.50003H7.9375Z",
    fill: color
  }));
});
var _excluded$K = ["color", "size"];
var CropFrame = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$K);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M43 3H31.75V0.5H43C44.3807 0.5 45.5 1.61929 45.5 3V14.25H43V3Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M3 14.25V3H14.25V0.5H3C1.61929 0.5 0.5 1.61929 0.5 3V14.25H3Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M0.5 31.75V43C0.5 44.3807 1.61929 45.5 3 45.5H14.25V43H3V31.75H0.5Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M43 31.75H45.5V43C45.5 44.3807 44.3807 45.5 43 45.5H31.75V43H43V31.75Z",
    fill: color
  }));
});
var _excluded$J = ["color", "size"];
var Portrait = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$J);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 36 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M32.0559 46.8755L32.0559 3.12555L3.93091 3.12555L3.93091 46.8755H32.0559ZM35.1809 3.12555C35.1809 1.39966 33.7818 0.000549316 32.0559 0.000549316H3.93091C2.20502 0.000549316 0.805908 1.39966 0.805908 3.12555V46.8755C0.805908 48.6014 2.20502 50.0005 3.93091 50.0005H32.0559C33.7818 50.0005 35.1809 48.6014 35.1809 46.8755L35.1809 3.12555Z",
    fill: color
  }));
});
var _excluded$I = ["color", "size"];
var WarningOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$I);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M45.961 39.0119L28.2837 7.27185C27.5934 6.17538 26.3971 5.5 24.9981 5.5C23.5956 5.5 22.3967 6.17887 21.7073 7.28034L4.06571 38.9613L4.03009 39.0197C3.33595 40.159 3.32316 41.4697 3.9939 42.6216C4.67405 43.786 5.89 44.5 7.34459 44.5H42.554C44.0596 44.5 45.3464 43.7436 46.0016 42.6231C46.6817 41.4564 46.652 40.1455 45.9968 39.0706L45.961 39.0119ZM49.0254 44.3856C47.7038 46.6495 45.2246 48 42.554 48H7.34459C4.67398 48 2.29272 46.6495 0.970942 44.3856C-0.347811 42.1231 -0.322029 39.4361 1.04116 37.1987L18.6646 5.55018C18.6697 5.5418 18.6743 5.53342 18.6789 5.52504C18.6836 5.51666 18.6882 5.50828 18.6932 5.49989C20.0278 3.30867 22.3849 2 24.9981 2C27.6114 2 29.9685 3.30867 31.303 5.49989L48.9853 37.2489C50.3185 39.436 50.3442 42.1232 49.0254 44.3856Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M22.0001 16C22.0001 14.3431 23.3433 13 25.0001 13C26.657 13 28.0001 14.3431 28.0001 16V28C28.0001 29.6569 26.657 31 25.0001 31C23.3433 31 22.0001 29.6569 22.0001 28V16Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M28.0001 37C28.0001 38.6569 26.657 40 25.0001 40C23.3433 40 22.0001 38.6569 22.0001 37C22.0001 35.3431 23.3433 34 25.0001 34C26.657 34 28.0001 35.3431 28.0001 37Z",
    fill: color
  }));
});
var _excluded$H = ["color", "size"];
var Success = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$H);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 21 21",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.5 10.5001C20.5 16.023 16.0228 20.5001 10.5 20.5001C4.97714 20.5001 0.5 16.023 0.5 10.5001C0.5 4.97727 4.97714 0.500122 10.5 0.500122C16.0228 0.500122 20.5 4.97727 20.5 10.5001ZM7.88239 9.56904C8.00439 9.62145 8.11473 9.69763 8.20698 9.79314L9.49998 11.0861L12.793 7.79314C12.8852 7.69763 12.9956 7.62145 13.1176 7.56904C13.2396 7.51663 13.3708 7.48905 13.5036 7.48789C13.6363 7.48674 13.768 7.51204 13.8909 7.56232C14.0138 7.6126 14.1255 7.68686 14.2194 7.78075C14.3133 7.87464 14.3875 7.98629 14.4378 8.10919C14.4881 8.23208 14.5134 8.36376 14.5122 8.49654C14.5111 8.62932 14.4835 8.76054 14.4311 8.88255C14.3787 9.00455 14.3025 9.1149 14.207 9.20714L10.207 13.2071C10.0194 13.3946 9.76514 13.4999 9.49998 13.4999C9.23482 13.4999 8.98051 13.3946 8.79298 13.2071L6.79298 11.2071C6.69747 11.1149 6.62129 11.0046 6.56888 10.8825C6.51647 10.7605 6.48889 10.6293 6.48773 10.4965C6.48658 10.3638 6.51188 10.2321 6.56216 10.1092C6.61244 9.98629 6.6867 9.87464 6.78059 9.78075C6.87448 9.68686 6.98613 9.6126 7.10903 9.56232C7.23193 9.51204 7.3636 9.48674 7.49638 9.48789C7.62916 9.48905 7.76038 9.51663 7.88239 9.56904Z",
    fill: color
  }));
});
var _excluded$G = ["color", "size"];
var Error$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$G);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 21 21",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M10.5 20.5001C16.0228 20.5001 20.5 16.023 20.5 10.5001C20.5 4.97727 16.0228 0.500122 10.5 0.500122C4.97715 0.500122 0.5 4.97727 0.5 10.5001C0.5 16.023 4.97715 20.5001 10.5 20.5001ZM15.4375 7.0912L11.8155 10.7132L15.4638 14.309C15.6213 14.4665 15.7 14.6503 15.7 14.8865C15.7 15.1227 15.6213 15.3064 15.4638 15.4639C15.3063 15.6214 15.1226 15.7001 14.8864 15.7001C14.6501 15.7001 14.4664 15.6214 14.3089 15.4639L10.6869 11.8419L7.06483 15.4639C6.77612 15.7789 6.25118 15.7789 5.93622 15.4639C5.77874 15.3064 5.7 15.0964 5.7 14.8865C5.7 14.6765 5.77874 14.4928 5.93622 14.3353L9.55827 10.7132L5.93622 7.0912C5.77874 6.93372 5.7 6.72374 5.7 6.51377C5.7 6.3038 5.77874 6.12007 5.93622 5.96259C6.25118 5.64763 6.74987 5.64763 7.06483 5.96259L10.6869 9.58464L14.3089 5.93634C14.5976 5.62138 15.1226 5.62138 15.4375 5.93634C15.595 6.09382 15.6738 6.27755 15.6738 6.51377C15.6738 6.74999 15.595 6.93372 15.4375 7.0912Z",
    fill: color
  }));
});
var _excluded$F = ["color", "size"];
var ErrorOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$F);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 52",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M37.3438 16.4782L28.2887 25.5333L37.4095 34.5228C37.8032 34.9165 38 35.3758 38 35.9664C38 36.5569 37.8032 37.0162 37.4095 37.4099C37.0158 37.8036 36.5564 38.0005 35.9659 38.0005C35.3753 38.0005 34.916 37.8036 34.5223 37.4099L25.4672 28.3548L16.4121 37.4099C15.6903 38.1973 14.378 38.1973 13.5906 37.4099C13.1969 37.0162 13 36.4913 13 35.9664C13 35.4414 13.1969 34.9821 13.5906 34.5884L22.6457 25.5333L13.5906 16.4782C13.1969 16.0845 13 15.5595 13 15.0346C13 14.5097 13.1969 14.0504 13.5906 13.6567C14.378 12.8693 15.6247 12.8693 16.4121 13.6567L25.4672 22.7118L34.5223 13.591C35.2441 12.8036 36.5564 12.8036 37.3438 13.591C37.7375 13.9847 37.9344 14.4441 37.9344 15.0346C37.9344 15.6252 37.7375 16.0845 37.3438 16.4782Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M-0.000488281 25.0005C-0.000488281 38.7972 11.2028 50.0005 24.9995 50.0005C38.6925 50.0005 49.9995 38.7972 49.9995 25.0005C49.9995 11.2038 38.7962 0.000488281 24.9995 0.000488281C11.2028 0.000488281 -0.000488281 11.2038 -0.000488281 25.0005ZM3.63022 24.8968C3.63022 13.1748 13.1738 3.52746 24.9995 3.52746C36.8252 3.52746 46.3688 13.1748 46.3688 24.8968C46.3688 36.6187 36.8252 46.266 24.9995 46.266C13.2775 46.266 3.63022 36.6187 3.63022 24.8968Z",
    fill: color
  }));
});
var _excluded$E = ["color", "size"];
var Loading = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$E);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M29.9338 5.26853C27.8524 4.75154 25.7006 4.56814 23.5381 4.72351C22.4874 4.799 21.4379 4.95535 20.4183 5.18855L19.3724 0.636496C20.6245 0.350265 21.9128 0.158175 23.2017 0.065597C25.8579 -0.125223 28.5034 0.100753 31.0653 0.737277L29.9338 5.26853Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.9",
    d: "M40.6131 11.9278C38.5498 9.48098 35.9044 7.52805 32.963 6.2805L34.7952 1.98303C38.4106 3.51633 41.6615 5.91575 44.1962 8.922L40.6131 11.9278Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.8",
    d: "M45.3329 23.5739L45.3303 23.5392C45.097 20.3085 44.1359 17.275 42.4734 14.5227L46.4838 12.1129C48.5302 15.501 49.7133 19.2325 50 23.2036L45.3329 23.5739Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.7",
    d: "M46.2688 38.2308L42.2981 35.7565C43.9958 33.0458 45.0372 29.9357 45.3095 26.7618L49.9744 27.1604C49.639 31.0674 48.3577 34.8958 46.2688 38.2308Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.6",
    d: "M34.4209 48.1735L32.6626 43.8456C35.6192 42.6505 38.2938 40.7405 40.3975 38.3222L43.9338 41.3828C41.3483 44.3551 38.0588 46.7033 34.4209 48.1735V48.1735Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.5",
    d: "M26.8033 49.9345C24.1593 50.1242 21.5262 49.9011 18.9766 49.2716L20.1013 44.7386C22.1729 45.25 24.3148 45.4309 26.4673 45.2766C27.5283 45.2004 28.5879 45.0416 29.6165 44.8049L30.6697 49.3551C29.4061 49.6459 28.1052 49.841 26.8033 49.9345V49.9345Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.4",
    d: "M15.2449 48.0311C11.6272 46.5033 8.37276 44.1086 5.83362 41.1063L9.412 38.0952C11.479 40.5388 14.1272 42.4877 17.0704 43.7306L15.2449 48.0311Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.3",
    d: "M3.54069 37.9198C1.48217 34.5223 0.292537 30.78 0.00479729 26.7959L0 26.7274L4.66972 26.3918L4.67579 26.478C4.90861 29.7017 5.87511 32.7443 7.54751 35.504L3.54069 37.9198Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    opacity: "0.2",
    d: "M4.69761 23.2075L0.0335693 22.802C0.374666 18.8955 1.66191 15.0691 3.75587 11.7373L7.72274 14.2175C6.02088 16.9257 4.97478 20.0344 4.69761 23.2075V23.2075Z",
    fill: color
  }));
});
var _excluded$D = ["color", "color2", "size"];
var ColorPicker$1 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color;
  _ref.color2;
  var _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$D);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 42 42",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M42.0001 6.11477C42.0001 4.48089 41.3639 2.94468 40.2086 1.78931C37.8238 -0.595528 33.9433 -0.595878 31.5582 1.78931L25.666 7.68191L22.9908 5.00654C22.5351 4.5509 21.7965 4.5509 21.3407 5.00654L17.8405 8.50695C17.3849 8.96259 17.3849 9.70141 17.8405 10.1572L20.5157 12.8325L3.63971 29.7097C3.5116 29.8378 3.41511 29.9939 3.35783 30.1658L2.27826 33.4048L1.30626 34.3769C-0.435198 36.1186 -0.435314 38.9525 1.30626 40.6943C3.04783 42.436 5.88157 42.4359 7.62314 40.6943L8.59514 39.7223L11.834 38.6426C12.0058 38.5853 12.1619 38.4888 12.29 38.3607L29.1661 21.4835L31.8413 24.1588C32.297 24.6145 33.0357 24.6145 33.4914 24.1588L36.9916 20.6584C37.4472 20.2028 37.4472 19.464 36.9916 19.0082L34.3164 16.3328L40.2086 10.4402C41.3639 9.28486 42.0001 7.74876 42.0001 6.11477ZM20.5157 26.8341H9.81507L22.1658 14.4826L27.516 19.8333L20.5157 26.8341ZM32.6663 21.6836L20.3156 9.332L22.1657 7.48168L34.5163 19.8333L32.6663 21.6836ZM38.5585 8.79014L32.6663 14.6827L27.316 9.332L33.2081 3.4394C34.6833 1.96421 37.0835 1.96409 38.5584 3.4394C40.0263 4.84774 40.0261 7.3818 38.5585 8.79014Z",
    fill: color
  }));
});
var _excluded$C = ["color", "size"];
var Menu = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$C);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0 7.75049C0 6.92206 0.671573 6.25049 1.5 6.25049H48.5C49.3284 6.25049 50 6.92206 50 7.75049V9.43806C50 10.2665 49.3284 10.9381 48.5 10.9381H1.5C0.671571 10.9381 0 10.2665 0 9.43806V7.75049ZM0 24.1567C0 23.3283 0.671573 22.6567 1.5 22.6567H48.5C49.3284 22.6567 50 23.3283 50 24.1567V25.8443C50 26.6727 49.3284 27.3443 48.5 27.3443H1.5C0.671571 27.3443 0 26.6727 0 25.8443V24.1567ZM1.5 39.0629C0.671573 39.0629 0 39.7345 0 40.5629V42.2505C0 43.0789 0.671571 43.7505 1.5 43.7505H48.5C49.3284 43.7505 50 43.0789 50 42.2505V40.5629C50 39.7345 49.3284 39.0629 48.5 39.0629H1.5Z",
    fill: color
  }));
});
var _excluded$B = ["color", "size"];
var MoveDownOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$B);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 46 26",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M1.23229 1.23267C2.20863 0.256387 3.79154 0.256434 4.76782 1.23277L22.9989 19.465L41.2323 1.23267C42.2086 0.256387 43.7915 0.256434 44.7678 1.23277C45.7441 2.20911 45.7441 3.79203 44.7677 4.76831L24.7665 24.7683C24.2977 25.2371 23.6618 25.5005 22.9987 25.5005C22.3357 25.5005 21.6998 25.2371 21.231 24.7682L1.23218 4.7682C0.255899 3.79186 0.255946 2.20895 1.23229 1.23267Z",
    fill: color
  }));
});
var _excluded$A = ["color", "size"];
var MoveUpOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$A);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 46 26",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M21.2326 1.23271C22.2089 0.256404 23.7918 0.256417 24.7681 1.23274L44.7678 21.2327C45.7441 22.2091 45.7441 23.792 44.7678 24.7683C43.7914 25.7446 42.2085 25.7446 41.2322 24.7682L23.0003 6.53602L4.76775 24.7683C3.79143 25.7446 2.20852 25.7446 1.23222 24.7682C0.255916 23.7919 0.255928 22.209 1.23225 21.2327L21.2326 1.23271Z",
    fill: color
  }));
});
var _excluded$z = ["color", "size"];
var ArrowSidebarLeftOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$z);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M27.7355 35.1357C27.1751 35.7705 26.2217 35.7926 25.6359 35.1773L17.3026 26.423C17.0301 26.1368 16.8819 25.755 16.8752 25.3647C16.8686 24.9745 17.0037 24.5881 17.2652 24.2923L25.5985 14.8647C26.1593 14.2302 27.1128 14.2089 27.6981 14.8247C28.2539 15.4093 28.2679 16.3516 27.7348 16.9546L20.36 25.2978L27.6974 33.0057C28.2536 33.59 28.2681 34.5323 27.7355 35.1357ZM26.6695 34.3756C26.7058 34.3748 26.753 34.3599 26.7984 34.3085C26.9042 34.1886 26.8989 33.9798 26.792 33.8676L19.0594 25.7444C18.8357 25.5095 18.829 25.1425 19.0438 24.8995L26.7983 16.1268C26.9041 16.007 26.899 15.7983 26.7921 15.6859C26.7464 15.6377 26.7001 15.6249 26.6639 15.6256C26.6276 15.6263 26.5805 15.6412 26.5351 15.6926L18.2017 25.1202C18.1562 25.1717 18.1235 25.2514 18.1251 25.3435C18.1266 25.4356 18.1619 25.5128 18.208 25.5612L26.5413 34.3154C26.5871 34.3635 26.6334 34.3763 26.6695 34.3756Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M26.7984 34.3085C26.753 34.3599 26.7058 34.3748 26.6695 34.3756C26.6334 34.3763 26.5871 34.3635 26.5413 34.3154L18.208 25.5612C18.1619 25.5128 18.1266 25.4356 18.1251 25.3435C18.1235 25.2514 18.1562 25.1717 18.2017 25.1202L26.5351 15.6926C26.5805 15.6412 26.6276 15.6263 26.6639 15.6256C26.7001 15.6249 26.7464 15.6377 26.7921 15.6859C26.899 15.7983 26.9041 16.007 26.7983 16.1268L19.0438 24.8995C18.829 25.1425 18.8357 25.5095 19.0594 25.7444L26.792 33.8676C26.8989 33.9798 26.9042 34.1886 26.7984 34.3085Z",
    fill: color
  }));
});
var _excluded$y = ["color", "size"];
var ArrowSidebarRightOutline = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$y);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M25 47.5006C37.4264 47.5006 47.5 37.427 47.5 25.0006C47.5 12.5742 37.4264 2.50061 25 2.50061C12.5736 2.50061 2.5 12.5742 2.5 25.0006C2.5 37.427 12.5736 47.5006 25 47.5006ZM25 50.0006C38.8071 50.0006 50 38.8077 50 25.0006C50 11.1935 38.8071 0.000610352 25 0.000610352C11.1929 0.000610352 0 11.1935 0 25.0006C0 38.8077 11.1929 50.0006 25 50.0006Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M22.2645 14.8655C22.8249 14.2307 23.7783 14.2086 24.3641 14.8239L32.6974 23.5781C32.9699 23.8644 33.1181 24.2461 33.1248 24.6364C33.1314 25.0267 32.9963 25.4131 32.7348 25.7089L24.4015 35.1365C23.8406 35.7709 22.8872 35.7923 22.3019 35.1765C21.7461 34.5919 21.7321 33.6496 22.2652 33.0465L29.6399 24.7034L22.3026 16.9954C21.7464 16.4112 21.7319 15.4689 22.2645 14.8655ZM23.3305 15.6256C23.2942 15.6264 23.247 15.6413 23.2016 15.6927C23.0958 15.8126 23.1011 16.0214 23.208 16.1336L30.9406 24.2568C31.1643 24.4917 31.171 24.8586 30.9562 25.1016L23.2017 33.8744C23.0959 33.9942 23.101 34.2029 23.2079 34.3153C23.2536 34.3634 23.2999 34.3763 23.3361 34.3756C23.3724 34.3748 23.4195 34.36 23.4649 34.3086L31.7983 24.881C31.8438 24.8295 31.8765 24.7497 31.8749 24.6577C31.8734 24.5656 31.838 24.4883 31.792 24.44L23.4587 15.6858C23.4129 15.6377 23.3666 15.6249 23.3305 15.6256Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    d: "M23.2016 15.6927C23.247 15.6413 23.2942 15.6264 23.3305 15.6256C23.3666 15.6249 23.4129 15.6377 23.4587 15.6858L31.792 24.44C31.838 24.4883 31.8734 24.5656 31.8749 24.6577C31.8765 24.7497 31.8438 24.8295 31.7983 24.881L23.4649 34.3086C23.4195 34.36 23.3724 34.3748 23.3361 34.3756C23.2999 34.3763 23.2536 34.3634 23.2079 34.3153C23.101 34.2029 23.0959 33.9942 23.2017 33.8744L30.9562 25.1016C31.171 24.8586 31.1643 24.4917 30.9406 24.2568L23.208 16.1336C23.1011 16.0214 23.0958 15.8126 23.2016 15.6927Z",
    fill: color
  }));
});
var _excluded$x = ["color", "size"];
var Annotation = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$x);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 50 50",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M48.5577 38.9423H34.8557C31.8069 38.9423 29.327 41.4224 29.327 44.4712C29.327 45.9293 28.1406 47.1157 26.6827 47.1157H5.52902C4.07066 47.1157 2.88467 45.9293 2.88467 44.4712V42.5459C2.88467 41.0886 4.07028 39.9025 5.5275 39.9018L9.33952 39.8999C9.34067 39.8999 9.34219 39.8995 9.34334 39.8995C9.38683 39.8995 9.43031 39.8968 9.47418 39.893C9.49211 39.8915 9.50966 39.8884 9.52759 39.8861C9.54628 39.8835 9.56535 39.8819 9.58405 39.8789L19.7636 38.1229C19.7689 38.1217 19.7739 38.1206 19.7788 38.1195C19.7948 38.1164 19.8105 38.113 19.8261 38.1095C19.8517 38.1038 19.8769 38.0981 19.9017 38.0908C19.9192 38.0863 19.9368 38.0809 19.9543 38.0756C19.9776 38.068 20.0008 38.0599 20.0241 38.0512C20.0409 38.0447 20.0581 38.039 20.0748 38.0321C20.1107 38.0168 20.1458 38.0008 20.1805 37.9829C20.1942 37.9756 20.208 37.9672 20.2217 37.9596C20.2461 37.9459 20.2702 37.9321 20.2938 37.9169C20.3083 37.9077 20.3228 37.8978 20.3373 37.8879C20.3602 37.8719 20.3831 37.8551 20.4052 37.8375C20.417 37.8284 20.4292 37.8192 20.4411 37.8093C20.4746 37.7815 20.5074 37.7525 20.5383 37.7212L46.2479 12.0109C48.3097 9.94895 48.3097 6.59377 46.2479 4.53146L43.2632 1.54708C41.2014 -0.515234 37.846 -0.514853 35.7841 1.54708L10.075 27.2574C10.0437 27.2883 10.0147 27.3215 9.9865 27.355C9.97696 27.3665 9.9678 27.3783 9.95865 27.3901C9.9411 27.4127 9.92432 27.4355 9.90829 27.4588C9.89838 27.4729 9.88846 27.4874 9.8793 27.5019C9.86443 27.5252 9.85069 27.5488 9.83734 27.5729C9.82857 27.5885 9.81941 27.6042 9.81102 27.6198C9.79424 27.653 9.77898 27.6862 9.76448 27.7205C9.75723 27.7377 9.75113 27.7556 9.74426 27.7732C9.73625 27.7953 9.72824 27.8178 9.72099 27.8403C9.71527 27.8586 9.70993 27.8769 9.70497 27.8952C9.69849 27.9189 9.69276 27.9429 9.68742 27.9673C9.68361 27.9841 9.67979 28.0009 9.67674 28.0177C9.6756 28.0226 9.67445 28.0272 9.67369 28.0318L8.12378 37.0158L5.52597 37.017C2.47879 37.0185 0 39.4989 0 42.5459V44.4712C0 47.5201 2.48032 50.0005 5.52902 50.0005H26.6827C29.7314 50.0005 32.2117 47.5201 32.2117 44.4712C32.2117 43.0132 33.3977 41.8267 34.8557 41.8267H48.5577C49.3542 41.8267 50 41.1813 50 40.3847C50 39.5878 49.3542 38.9423 48.5577 38.9423ZM12.043 31.2653L16.5306 35.7531L11.1076 36.6885L12.043 31.2653ZM33.5567 7.85382L35.7288 10.026L15.3065 30.4493L13.1344 28.2771L33.5567 7.85382ZM19.5183 34.6613L17.3462 32.4891L37.7689 12.0658L39.941 14.238L19.5183 34.6613ZM37.8239 3.58651C38.7611 2.64958 40.2859 2.64958 41.2235 3.58651L44.2078 6.57126C45.145 7.50858 45.145 9.03376 44.2078 9.97108L41.9804 12.1986L35.5965 5.81401L37.8239 3.58651Z",
    fill: color
  }));
});
var _excluded$w = ["color", "size"];
var Rotate90 = intrinsicComponent(function(_ref, ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 14 : _ref$size, rest = _objectWithoutProperties(_ref, _excluded$w);
  return /* @__PURE__ */ React.createElement("svg", _extends({
    ref,
    width: size,
    height: size,
    viewBox: "0 0 52 42",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, rest), /* @__PURE__ */ React.createElement("path", {
    d: "M46.4326 40.0282C46.1217 40.5666 45.6098 40.9595 45.0093 41.1204C44.4088 41.2813 43.7691 41.197 43.2307 40.8862C42.6923 40.5754 42.2995 40.0634 42.1386 39.463C41.9777 38.8625 42.0619 38.2227 42.3727 37.6843C45.2819 32.6454 46.0703 26.6571 44.5644 21.0369C43.0584 15.4167 39.3816 10.6249 34.3426 7.71563C25.1427 2.4043 13.7736 4.38306 6.93632 12.1744L14.5457 12.0831H14.5744C15.196 12.0795 15.7937 12.3229 16.2358 12.7599C16.678 13.1969 16.9284 13.7916 16.9321 14.4133C16.9357 15.0349 16.6923 15.6326 16.2553 16.0747C15.8183 16.5169 15.2236 16.7673 14.6019 16.771L2.37222 16.9175H2.34409C2.03391 16.9175 1.72681 16.856 1.44059 16.7364C1.15437 16.6169 0.894721 16.4417 0.676697 16.2211C0.458674 16.0004 0.28661 15.7387 0.170478 15.4511C0.0543471 15.1635 -0.00354164 14.8557 0.000167612 14.5455L0.147346 2.31591C0.151046 2.00811 0.215338 1.70404 0.336549 1.42108C0.457761 1.13812 0.633519 0.881802 0.853788 0.666765C1.07406 0.451728 1.33453 0.282182 1.62032 0.167807C1.90611 0.0534328 2.21164 -0.00353076 2.51944 0.000169355C2.82725 0.00386947 3.13132 0.0681609 3.41428 0.189372C3.69724 0.310584 3.95356 0.486342 4.16859 0.706611C4.38363 0.926881 4.55318 1.18735 4.66755 1.47314C4.78193 1.75894 4.83889 2.06446 4.83519 2.37227L4.77171 7.65586C9.37537 3.16334 15.4496 0.489016 21.8718 0.127065C28.2941 -0.234886 34.6303 1.74001 39.7096 5.6868C44.7889 9.63359 48.2679 15.2855 49.5038 21.5981C50.7397 27.9107 49.6485 34.4574 46.4326 40.0282Z",
    fill: color
  }), /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M25 28C26.6569 28 28 26.6569 28 25C28 23.3431 26.6569 22 25 22C23.3431 22 22 23.3431 22 25C22 26.6569 23.3431 28 25 28ZM25 32C28.866 32 32 28.866 32 25C32 21.134 28.866 18 25 18C21.134 18 18 21.134 18 25C18 28.866 21.134 32 25 32Z",
    fill: color
  }));
});
function _objectDestructuringEmpty(t2) {
  if (null == t2) throw new TypeError("Cannot destructure " + t2);
}
var Size$1 = {
  Xs: "xs",
  Sm: "sm",
  Md: "md",
  Lg: "lg"
};
var baseClassName$g = "CrossButton";
var crossButtonPaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size$1.Xs, Ae(["padding:5px;height:20px;"])), Size$1.Sm, Ae(["padding:6px;height:24px;"])), Size$1.Md, Ae(["padding:9px;"])), Size$1.Lg, Ae(["padding:12px;"]));
var CrossButton$1 = /* @__PURE__ */ qe.button.attrs({
  className: generateClassNames(baseClassName$g, "root")
}).withConfig({
  componentId: "sc-ygfku-0"
})(function(_ref) {
  var _ref$size = _ref.size, size = _ref$size === void 0 ? Size$1.Lg : _ref$size, theme = _ref.theme;
  return Ae(["display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:4px;", " color:", ";background:transparent;border:none;transition:all 100ms ease-out;&:hover{color:", ";background:", ";}&:active{color:", ";background:", ";}"], crossButtonPaddingMixin[size], theme.palette[Color.IconsSecondary], theme.palette[Color.IconsPrimary], theme.palette[Color.BackgroundHover], theme.palette[Color.IconsPrimaryHover], theme.palette[Color.BackgroundActive]);
});
var Styled$h = applyDisplayNames({
  CrossButton: CrossButton$1
});
var getIconSize$1 = function getIconSize4(sizeName) {
  switch (sizeName) {
    case Size$1.Lg:
      return 16;
    case Size$1.Xs:
      return 10;
    case Size$1.Sm:
    default:
      return 12;
  }
};
var CrossButton = intrinsicComponent$1(function(_ref, ref) {
  var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
  return /* @__PURE__ */ React.createElement(Styled$h.CrossButton, _extends({}, rest, {
    ref
  }), /* @__PURE__ */ React.createElement(CrossOutline, {
    size: getIconSize$1(rest.size)
  }));
});
CrossButton.defaultProps = {
  size: Size$1.Lg
};
CrossButton.propTypes = {
  size: PropTypes.oneOf(objectValues(Size$1))
};
var baseClassName$f = "Select";
var Icon$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$f, "Icon")
}).withConfig({
  componentId: "sc-mfrapg-0"
})(function(_ref) {
  var palette = _ref.theme.palette, size = _ref.size;
  return Ae(["display:flex;flex-shrink:0;color:", ";padding:", ";"], palette[Color.IconsPrimary], size === Size$2.Md ? "2.5px" : "2px");
});
var TickIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$f, "tickIcon")
}).withConfig({
  componentId: "sc-mfrapg-1"
})(function(_ref2) {
  var palette = _ref2.theme.palette;
  return Ae(["color:", ";"], palette[Color.AccentStateless]);
});
var Container$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$f, "Container")
}).withConfig({
  componentId: "sc-mfrapg-2"
})(function(_ref3) {
  var _ref3$fullWidth = _ref3.fullWidth, fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth;
  return Ae(["position:relative;display:inline-flex;", ""], fullWidth ? "width: 100%" : "");
});
var StyledCrossButton = /* @__PURE__ */ qe(CrossButton).attrs({
  className: generateClassNames(baseClassName$f, "CrossButton")
}).withConfig({
  componentId: "sc-mfrapg-3"
})(function() {
  return Ae(["display:none;margin-right:6px;"]);
});
var Select$2 = /* @__PURE__ */ qe(Styled$o.Input).attrs({
  className: generateClassNames(baseClassName$f, "root")
}).withConfig({
  componentId: "sc-mfrapg-4"
})(function(_ref4) {
  var palette = _ref4.theme.palette, disabled = _ref4.disabled, readOnly = _ref4.readOnly, _ref4$size = _ref4.size, size = _ref4$size === void 0 ? "sm" : _ref4$size, isValueExists = _ref4.isValueExists;
  return Ae(["cursor:", ";user-select:none;gap:0px;background:", ";", " ", ";"], disabled || readOnly ? "default" : "pointer", disabled ? palette[Color.BackgroundHover] : palette[Color.BackgroundStateless], isValueExists && "\n    &:hover {\n      ".concat(StyledCrossButton, " {\n        display: flex;\n      }\n    }\n    "), fontSizeInputMixin[size]);
});
var Label$1 = /* @__PURE__ */ qe.label.attrs({
  className: generateClassNames(baseClassName$f, "Label")
}).withConfig({
  componentId: "sc-mfrapg-5"
})(function(_ref5) {
  var hideEllipsis = _ref5.hideEllipsis, _ref5$size = _ref5.size, size = _ref5$size === void 0 ? Size$2.Md : _ref5$size;
  return "\n    flex-grow: 1;\n    margin-right: ".concat(size === Size$2.Md ? 8 : 12, "px;\n\n    ").concat(!hideEllipsis && Ae(["white-space:nowrap;text-overflow:ellipsis;overflow:hidden;"]), "\n  ");
});
var Placeholder = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$f, "Placeholder")
}).withConfig({
  componentId: "sc-mfrapg-6"
})(function(_ref6) {
  var palette = _ref6.theme.palette, size = _ref6.size;
  return Ae(["width:100%;color:", ";margin-right:", "px;"], palette[Color.TextPlaceholder], size === Size$2.Md ? 16 : 12);
});
var Input = /* @__PURE__ */ qe.input.attrs({
  className: generateClassNames(baseClassName$f, "Input"),
  "aria-hidden": "true",
  tabindex: "-1"
}).withConfig({
  componentId: "sc-mfrapg-7"
})(["left:0;width:100%;bottom:0;opacity:0;position:absolute;pointer-events:none;box-sizing:border-box;"]);
var Styled$g = applyDisplayNames({
  Container: Container$1,
  Select: Select$2,
  Label: Label$1,
  Icon: Icon$2,
  TickIcon,
  Input,
  Placeholder,
  StyledCrossButton
});
function ownKeys$W(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$W(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$W(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$W(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var getIconSize5 = function getIconSize6(size) {
  switch (size) {
    case InputSize.Md:
      return 16;
    case InputSize.Sm:
    default:
      return 14;
  }
};
var generateChildren = function generateChildren2(children) {
  var isActive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
  var size = arguments.length > 2 ? arguments[2] : void 0;
  var hideMenuItemsActions = arguments.length > 3 ? arguments[3] : void 0;
  var miChildren = /* @__PURE__ */ React.createElement(MenuItemLabel, null, children);
  if (isActive && children) {
    var miActions = /* @__PURE__ */ React.createElement(MenuItemActions, null, /* @__PURE__ */ React.createElement(Styled$g.TickIcon, null, /* @__PURE__ */ React.createElement(Tick, {
      size: getIconSize5(size)
    })));
    if (React.Children.count(children) === 1) {
      return /* @__PURE__ */ React.createElement(React.Fragment, null, miChildren, !hideMenuItemsActions && miActions);
    }
    if (React.Children.count(children) > 1 && !React.Children.toArray(children).some(function(child) {
      var _child$type;
      return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === "MenuItemActions";
    })) {
      return /* @__PURE__ */ React.createElement(React.Fragment, null, children, miActions);
    }
  }
  return miChildren;
};
var renderOption = function renderOption2(menuItem, _ref) {
  var _type, _props, _props2, _props3;
  var value = _ref.value, _ref$multiple = _ref.multiple, multiple = _ref$multiple === void 0 ? false : _ref$multiple, _ref$size = _ref.size, size = _ref$size === void 0 ? InputSize.Md : _ref$size, _ref$hideMenuItemsAct = _ref.hideMenuItemsActions, hideMenuItemsActions = _ref$hideMenuItemsAct === void 0 ? false : _ref$hideMenuItemsAct, onClose2 = _ref.onClose, onChange2 = _ref.onChange;
  if (!/* @__PURE__ */ React.isValidElement(menuItem)) {
    return menuItem;
  }
  if (((_type = menuItem.type) === null || _type === void 0 ? void 0 : _type.displayName) !== "MenuItem") {
    return /* @__PURE__ */ React.cloneElement(menuItem);
  }
  var menuItemValue = menuItem === null || menuItem === void 0 || (_props = menuItem.props) === null || _props === void 0 ? void 0 : _props.value;
  var valueArr = multiple ? Array.isArray(value) ? value : [] : [value];
  var active = valueArr.length > 0 && valueArr.includes(menuItemValue);
  var isDisabledMenuItem = menuItem === null || menuItem === void 0 || (_props2 = menuItem.props) === null || _props2 === void 0 ? void 0 : _props2.disabled;
  return /* @__PURE__ */ React.cloneElement(menuItem, {
    active,
    size,
    children: generateChildren(menuItem === null || menuItem === void 0 || (_props3 = menuItem.props) === null || _props3 === void 0 ? void 0 : _props3.children, active, size, hideMenuItemsActions),
    onClick: function onClick() {
      var _menuItemValue$toStri;
      if (!multiple && typeof onClose2 === "function") {
        onClose2();
      }
      if (typeof onChange2 === "function" && !isDisabledMenuItem && !!(menuItemValue !== null && menuItemValue !== void 0 && (_menuItemValue$toStri = menuItemValue.toString()) !== null && _menuItemValue$toStri !== void 0 && _menuItemValue$toStri.length)) {
        var newValue = menuItemValue;
        if (multiple) {
          newValue = _toConsumableArray(Array.isArray(value) ? value : []);
          var index = newValue.indexOf(menuItemValue);
          if (index > -1) {
            newValue.splice(index, 1);
          } else {
            newValue.push(menuItemValue);
          }
        }
        onChange2(newValue);
      }
    }
  });
};
var getOptionValue = function getOptionValue2(option) {
  var children = option.props ? option.props.children : option;
  if (Array.isArray(children)) return children.map(function(child) {
    return getOptionValue2(child);
  }).join(" ");
  if (_typeof(children) === "object") return getOptionValue2(children.props.children);
  return children;
};
var renderOptionValue = function renderOptionValue2(option, showSelectionKey) {
  if (option && option.children) {
    var child = showSelectionKey ? option.value : option.children;
    while (typeof child !== "string") {
      if (Array.isArray(child)) {
        child = getOptionValue(child[1]);
      } else {
        child = getOptionValue(child);
      }
    }
    return child;
  }
};
var renderValue = function renderValue2(_ref2) {
  var value = _ref2.value, _ref2$multiple = _ref2.multiple, multiple = _ref2$multiple === void 0 ? false : _ref2$multiple, children = _ref2.children, _ref2$showSelectionKe = _ref2.showSelectionKey, showSelectionKey = _ref2$showSelectionKe === void 0 ? false : _ref2$showSelectionKe;
  var optionsProps = [];
  React.Children.forEach(children, function(child) {
    if (/* @__PURE__ */ React.isValidElement(child)) {
      var _type2 = child === null || child === void 0 ? void 0 : child.type, displayName = _type2.displayName;
      if (displayName === "MenuItem" && Boolean(child.props)) {
        optionsProps.push(_objectSpread$W({}, child.props));
      }
    }
  });
  var activeOptions = multiple ? optionsProps.filter(function(itemProps) {
    return Array.isArray(value) && value.includes(itemProps.value);
  }) : [optionsProps.find(function(itemProps) {
    return itemProps.value === value;
  })];
  if (activeOptions.length > 0) {
    return activeOptions.map(function(option) {
      return renderOptionValue(option, showSelectionKey);
    }).join(", ");
  }
  return Array.isArray(value) ? value.join(", ") : value;
};
var _excluded$v = ["children", "size", "error", "multiple", "onChange", "value", "fullWidth", "selectProps", "MenuProps", "readOnly", "disabled", "scroll", "placeholder", "showSelectionKey", "hideMenuItemsActions", "showClearIcon", "renderLabel", "onRequestClose", "hideEllipsis"];
var Select$1 = intrinsicComponent$1(function(_ref, ref) {
  var _value$toString;
  var children = _ref.children, size = _ref.size, error2 = _ref.error, multiple = _ref.multiple, onChange2 = _ref.onChange, value = _ref.value, fullWidth = _ref.fullWidth, selectProps = _ref.selectProps, MenuProps = _ref.MenuProps, readOnly = _ref.readOnly, disabled = _ref.disabled, _ref$scroll = _ref.scroll, scroll = _ref$scroll === void 0 ? true : _ref$scroll, placeholder = _ref.placeholder, showSelectionKey = _ref.showSelectionKey, hideMenuItemsActions = _ref.hideMenuItemsActions, showClearIcon = _ref.showClearIcon, renderLabel = _ref.renderLabel, onRequestClose = _ref.onRequestClose, _ref$hideEllipsis = _ref.hideEllipsis, hideEllipsis = _ref$hideEllipsis === void 0 ? false : _ref$hideEllipsis, rest = _objectWithoutProperties(_ref, _excluded$v);
  var _useState = reactExports.useState(void 0), _useState2 = _slicedToArray(_useState, 2), anchorEl = _useState2[0], setAnchorEl = _useState2[1];
  var open = Boolean(anchorEl);
  var handleClick = function handleClick2(event) {
    return setAnchorEl(event.currentTarget);
  };
  var isValueExists = Array.isArray(value) ? !!value.length : !!(value !== null && value !== void 0 && (_value$toString = value.toString()) !== null && _value$toString !== void 0 && _value$toString.length);
  var handleClose = function handleClose2() {
    if (onRequestClose) {
      onRequestClose();
    }
    setAnchorEl(void 0);
  };
  var handleClearSelection = function handleClearSelection2(event) {
    event.stopPropagation();
    if (typeof onChange2 === "function") {
      onChange2("");
    }
  };
  return /* @__PURE__ */ React.createElement(Styled$g.Container, {
    ref,
    fullWidth: Boolean(fullWidth)
  }, /* @__PURE__ */ React.createElement(Styled$g.Select, _extends({}, rest, {
    disabled,
    size,
    error: error2,
    fullWidth: Boolean(fullWidth),
    readOnly,
    showSelectionKey,
    isValueExists,
    onClick: readOnly || disabled ? void 0 : handleClick
  }), isValueExists && /* @__PURE__ */ React.createElement(Styled$g.Label, {
    hideEllipsis,
    size
  }, typeof renderLabel === "function" ? renderLabel(value) : renderValue({
    value,
    multiple,
    children,
    showSelectionKey
  })), !isValueExists && /* @__PURE__ */ React.createElement(Styled$g.Placeholder, {
    size
  }, placeholder), !readOnly && showClearIcon && /* @__PURE__ */ React.createElement(Styled$g.StyledCrossButton, {
    size: size === Size$1.Md ? Size$1.Sm : Size$1.Xs,
    onClick: handleClearSelection
  }), /* @__PURE__ */ React.createElement(Styled$g.Icon, {
    size
  }, /* @__PURE__ */ React.createElement(ArrowTick, {
    type: open ? "top" : "bottom",
    IconProps: {
      size: size === Size$1.Md ? 11 : 10
    }
  })), /* @__PURE__ */ React.createElement(Styled$g.Input, selectProps)), /* @__PURE__ */ React.createElement(Menu$1, _extends({
    onClose: handleClose,
    scroll,
    open,
    anchorEl
  }, MenuProps), React.Children.map(children, function(child) {
    return renderOption(child, {
      value,
      multiple,
      size,
      hideMenuItemsActions,
      onClose: handleClose,
      onChange: readOnly || disabled ? void 0 : onChange2
    });
  })));
});
var defaultProps$4 = {
  size: InputSize.Md,
  error: false,
  multiple: false,
  fullWidth: false,
  readOnly: false,
  disabled: false,
  showClearIcon: false,
  scroll: true,
  hideMenuItemsActions: false
};
Select$1.defaultProps = defaultProps$4;
var simpleValuePropTypes = PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.oneOf([null])]);
var propTypes$5 = {
  size: PropTypes.oneOf(objectValues(InputSize)),
  error: PropTypes.bool,
  multiple: PropTypes.bool,
  fullWidth: PropTypes.bool,
  children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]),
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool, PropTypes.oneOf([null]), PropTypes.arrayOf(simpleValuePropTypes)]),
  onChange: PropTypes.func,
  MenuProps: PropTypes.exact(propTypes$6),
  // eslint-disable-next-line react/forbid-prop-types
  selectProps: PropTypes.object,
  readOnly: PropTypes.bool,
  disabled: PropTypes.bool,
  showClearIcon: PropTypes.bool,
  hideMenuItemsActions: PropTypes.bool,
  showSelectionKey: PropTypes.bool,
  scroll: PropTypes.bool,
  renderLabel: PropTypes.func,
  onRequestClose: PropTypes.func,
  hideEllipsis: PropTypes.bool
};
Select$1.propTypes = propTypes$5;
function useDrag(onMove, onStart, onEnd) {
  var onDragging = function onDragging2(e2) {
    if (typeof onMove === "function") {
      var _e$touches;
      onMove(((_e$touches = e2.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e2);
    }
  };
  var disableSliding = function disableSliding2(e2) {
    document.removeEventListener("mousemove", onDragging);
    document.removeEventListener("mouseup", disableSliding2);
    document.removeEventListener("mouseleave", disableSliding2);
    document.removeEventListener("touchmove", onDragging);
    document.removeEventListener("touchend", disableSliding2);
    document.removeEventListener("touchcancel", disableSliding2);
  };
  var enableDrag = function enableDrag2(e2) {
    document.addEventListener("mousemove", onDragging);
    document.addEventListener("mouseup", disableSliding);
    document.addEventListener("mouseleave", disableSliding);
    document.addEventListener("touchmove", onDragging);
    document.addEventListener("touchend", disableSliding);
    document.addEventListener("touchcancel", disableSliding);
    if (typeof onStart === "function") {
      var _e$touches3;
      onStart(((_e$touches3 = e2.touches) === null || _e$touches3 === void 0 ? void 0 : _e$touches3[0]) || e2);
    }
  };
  return {
    onMouseDown: enableDrag,
    onTouchStart: enableDrag
  };
}
function ownKeys$V(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$V(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$V(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$V(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var baseClassName$e = "ColorPicker";
var colorItemClassName = "ColorItem";
var ColorPickerWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "root")
}).withConfig({
  componentId: "sc-qj4xo5-0"
})(["background-color:", ";box-shadow:0px 1px 2px rgba(78,77,77,0.15);border-radius:2px;padding:12px;max-width:300px;"], function(_ref) {
  var theme = _ref.theme;
  return theme.palette[Color.BackgroundSecondary];
});
var ColorPickerIcon = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "icon")
}).withConfig({
  componentId: "sc-qj4xo5-1"
})(["display:flex;justify-content:space-between;align-items:center;cursor:pointer;"]);
var RangePickerWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "range-picker")
}).withConfig({
  componentId: "sc-qj4xo5-2"
})(function(_ref2) {
  var color = _ref2.color;
  return Ae(["position:relative;border-radius:2px;width:100%;height:180px;user-select:none;cursor:crosshair;background-color:", ";"], color);
});
var WhiteGradient = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "white-gradient")
}).withConfig({
  componentId: "sc-qj4xo5-3"
})(["background:linear-gradient(to right,white 0%,rgba(255,255,255,0) 100%);z-index:0;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;top:-1px;"]);
var BlackGradient = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "black-gradient")
}).withConfig({
  componentId: "sc-qj4xo5-4"
})(["background:linear-gradient(to bottom,rgba(0,0,0,0) 0%,black 100%);z-index:1;position:absolute;width:100%;height:100%;border-radius:2px;user-select:none;pointer-events:none;"]);
var ColorPointer = /* @__PURE__ */ qe.span.attrs(function(_ref3) {
  var _ref3$left = _ref3.left, left2 = _ref3$left === void 0 ? 0 : _ref3$left, _ref3$top = _ref3.top, top2 = _ref3$top === void 0 ? 0 : _ref3$top, _ref3$considerTopWidt = _ref3.considerTopWidth, considerTopWidth = _ref3$considerTopWidt === void 0 ? false : _ref3$considerTopWidt, style2 = _ref3.style;
  return {
    className: generateClassNames(baseClassName$e, "pointer"),
    style: _objectSpread$V({
      left: left2 - 7,
      // 7
      top: top2 - (considerTopWidth ? 7 : 0)
    }, style2)
  };
}).withConfig({
  componentId: "sc-qj4xo5-5"
})(function(_ref4) {
  var theme = _ref4.theme, pointerColor = _ref4.pointerColor;
  return Ae(["display:inline-block;box-sizing:border-box;width:15px;height:15px;border-radius:20px;box-shadow:0px 1px 2px rgba(78,77,77,0.15);border:2px solid ", ";background-color:", ";position:absolute;cursor:pointer;z-index:11;user-select:none;outline:none;"], theme.palette[Color.BackgroundSecondary], pointerColor);
});
var BarWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "bar-wrapper")
}).withConfig({
  componentId: "sc-qj4xo5-6"
})(["margin-top:8px;position:relative;width:100%;height:12px;"]);
var Bar = /* @__PURE__ */ qe.table.attrs({
  className: generateClassNames(baseClassName$e, "bar")
}).withConfig({
  componentId: "sc-qj4xo5-7"
})(["border-radius:4px;width:100%;height:8px;border-collapse:collapse;"]);
var BarColorStop = /* @__PURE__ */ qe.td.attrs(function(_ref5) {
  var $color = _ref5.$color;
  return {
    className: generateClassNames(baseClassName$e, "stop"),
    style: {
      backgroundColor: $color
    }
  };
}).withConfig({
  componentId: "sc-qj4xo5-8"
})(["padding:0;user-select:none;pointer-events:none;&:first-child{width:4px;border-top-left-radius:4px;border-bottom-left-radius:4px;}&:last-child{width:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;}"]);
var ColorPickerAction = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "action")
}).withConfig({
  componentId: "sc-qj4xo5-9"
})(["display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;"]);
var ColorItemWrapper = /* @__PURE__ */ qe.label.attrs({
  className: generateClassNames(colorItemClassName, "label")
}).withConfig({
  componentId: "sc-qj4xo5-10"
})(function(_ref6) {
  var theme = _ref6.theme, size = _ref6.size, color = _ref6.color, stroke = _ref6.stroke, value = _ref6.value;
  return Ae(["border-radius:2px;border:", ";box-sizing:border-box;width:", "px;height:", "px;background-color:", ";user-select:none;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 300ms;margin-bottom:8px;background:", ";input{display:none;}"], "1px solid ".concat(stroke), size, size, color, value === "rgba(0,0,0,0)" && "repeating-conic-gradient(".concat(theme.palette[Color.LinkPrimary], " 0% 25%, transparent 0% 50%) 50% / 8px 8px"));
});
var ColorItemsContainer = /* @__PURE__ */ qe.div.withConfig({
  componentId: "sc-qj4xo5-11"
})(["display:flex;flex-wrap:wrap;align-content:space-between;margin-top:14px;margin-left:12px;& > .item{margin-right:8px;display:flex;justify-content:center;}"]);
var Select = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$e, "select")
}).withConfig({
  componentId: "sc-qj4xo5-12"
})(function(_ref7) {
  var value = _ref7.value;
  return Ae(["width:", ";"], value === "rgb" ? "25%" : "35%");
});
var SelectWrapper = /* @__PURE__ */ qe.div.withConfig({
  componentId: "sc-qj4xo5-13"
})({
  display: "flex",
  alignItems: "center",
  gap: "12px"
});
var Styled$f = applyDisplayNames({
  ColorPickerWrapper,
  RangePickerWrapper,
  WhiteGradient,
  BlackGradient,
  ColorPointer,
  BarWrapper,
  Bar,
  BarColorStop,
  ColorPickerAction,
  ColorPickerIcon,
  ColorItemsContainer,
  ColorItemWrapper,
  Select,
  SelectWrapper
});
var ColorItem = intrinsicComponent$1(function(_ref, ref) {
  var value = _ref.value, onChange2 = _ref.onChange, checked = _ref.checked, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size;
  var checkIconColor = reactExports.useMemo(function() {
    if (value === "#ffffff" || value === "rgba(0,0,0,0)") {
      return "black";
    }
    return "white";
  }, [value]);
  return /* @__PURE__ */ React.createElement(Styled$f.ColorItemWrapper, {
    ref,
    color: value,
    size,
    stroke: value === "rgba(0,0,0,0)" ? "#a8a8a8" : "#E9EEF2",
    value
  }, /* @__PURE__ */ React.createElement("input", {
    type: "radio",
    value,
    checked,
    onChange: onChange2
  }), checked && /* @__PURE__ */ React.createElement(Tick, {
    color: checkIconColor
  }));
});
ColorItem.defaultProps = {};
ColorItem.propTypes = {
  value: PropTypes.string.isRequired,
  checked: PropTypes.bool,
  onChange: PropTypes.func.isRequired,
  size: PropTypes.number
};
var _excluded$u = ["defaultColor", "onChange", "pinnedColors", "showTransparentColor", "hidePinIcon", "containerProps"];
function ownKeys$U(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$U(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$U(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$U(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var transparentColor = ["rgba(0,0,0,0)"];
var transparentColorHex = "#00000000";
var colorsHuesCount = 360;
var ColorPicker = intrinsicComponent$1(function(_ref, ref) {
  var _ref$defaultColor = _ref.defaultColor, defaultColor = _ref$defaultColor === void 0 ? "#000000" : _ref$defaultColor, onChange2 = _ref.onChange, _ref$pinnedColors = _ref.pinnedColors, pinnedColors = _ref$pinnedColors === void 0 ? [] : _ref$pinnedColors, _ref$showTransparentC = _ref.showTransparentColor, showTransparentColor = _ref$showTransparentC === void 0 ? false : _ref$showTransparentC, _ref$hidePinIcon = _ref.hidePinIcon, hidePinIcon = _ref$hidePinIcon === void 0 ? false : _ref$hidePinIcon, containerProps = _ref.containerProps, rest = _objectWithoutProperties(_ref, _excluded$u);
  var showedColors = showTransparentColor ? transparentColor.concat(pinnedColors) : pinnedColors;
  var isTransparentColor = function isTransparentColor2(color) {
    return color === transparentColorHex || color === transparentColor[0];
  };
  var _useState = reactExports.useState({
    color: "#ff0000",
    pointerLeft: 0
  }), _useState2 = _slicedToArray(_useState, 2), bar = _useState2[0], setBar = _useState2[1];
  var _useState3 = reactExports.useState({
    color: isTransparentColor(defaultColor) ? "#00000000" : colorToHex(defaultColor) || "#000000",
    pointer: {
      left: 0,
      top: 0
    }
  }), _useState4 = _slicedToArray(_useState3, 2), rangePicker = _useState4[0], setRangePicker = _useState4[1];
  var _useState5 = reactExports.useState(showedColors), _useState6 = _slicedToArray(_useState5, 2), localPinnedColors = _useState6[0], setLocalPinnedColors = _useState6[1];
  var _useState7 = reactExports.useState("hex"), _useState8 = _slicedToArray(_useState7, 2), inputType = _useState8[0], setInputType = _useState8[1];
  var _useState9 = reactExports.useState([]), _useState10 = _slicedToArray(_useState9, 2), rgbColorValue = _useState10[0], setRgbColorValue = _useState10[1];
  var _useState11 = reactExports.useState(colorToHex(rangePicker.color)), _useState12 = _slicedToArray(_useState11, 2), hexInputValue = _useState12[0], setHexInputValue = _useState12[1];
  var _useState13 = reactExports.useState(null), _useState14 = _slicedToArray(_useState13, 2), barRef = _useState14[0], setBarRef = _useState14[1];
  var _useState15 = reactExports.useState(null), _useState16 = _slicedToArray(_useState15, 2), rangePickerRef = _useState16[0], setRangePickerRef = _useState16[1];
  var isColorChecked = function isColorChecked2(checkedColor) {
    if (checkedColor === transparentColor[0] && rangePicker.color === transparentColorHex) {
      return true;
    }
    return checkedColor === rangePicker.color;
  };
  var filterTransparentColor = function filterTransparentColor2(colors) {
    return colors.filter(function(item) {
      return item !== "rgba(0,0,0,0)";
    });
  };
  var getRgbColor = function getRgbColor2(color) {
    return isTransparentColor(color) ? transparentColor[0] : "rgb(".concat(hexToRgb(color).join(", "), ")");
  };
  var handlePinnedColors = function handlePinnedColors2(hexColor, type) {
    if (type === "add") {
      var newLocalPinnedColors = [].concat(_toConsumableArray(localPinnedColors), [hexColor]);
      setLocalPinnedColors(newLocalPinnedColors);
      if (typeof onChange2 === "function") {
        onChange2(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(newLocalPinnedColors));
      }
    } else {
      var _newLocalPinnedColors = localPinnedColors.filter(function(item) {
        return item !== rangePicker.color;
      });
      setLocalPinnedColors(_newLocalPinnedColors);
      if (typeof onChange2 === "function") {
        onChange2(rangePicker.color, getRgbColor(hexColor), filterTransparentColor(_newLocalPinnedColors));
      }
    }
  };
  var changeBarPosByColor = function changeBarPosByColor2(color) {
    if (barRef !== null) {
      var _ref2 = getElemDocumentCoords$1(barRef), left2 = _ref2.left;
      var _colorToHsl = colorToHsl(color || rangePicker.color), _colorToHsl2 = _slicedToArray(_colorToHsl, 1), h2 = _colorToHsl2[0];
      var targetColorElem = barRef.querySelector("[data-hue='".concat(h2, "']"));
      if (targetColorElem !== null) {
        var targetColorRgb = targetColorElem.style.backgroundColor || bar.color;
        setBar({
          color: targetColorRgb,
          pointerLeft: getElemDocumentCoords$1(targetColorElem).left - left2 || bar.pointerLeft
        });
      }
    }
  };
  var handleRgbInput = function handleRgbInput2(value, index) {
    if (value > 255 || Number.isNaN(value)) {
      return;
    }
    var rgbArr = rgbColorValue;
    rgbArr[index] = value;
    var newHexColor = rgbToHex.apply(void 0, _toConsumableArray(rgbArr));
    setRgbColorValue(_toConsumableArray(rgbArr));
    if (validateHex(newHexColor)) {
      setRangePicker(_objectSpread$U(_objectSpread$U({}, rangePicker), {}, {
        color: newHexColor
      }));
      changeBarPosByColor(newHexColor);
    }
  };
  var updateRgb = function updateRgb2(color) {
    if (color.includes("rgb")) {
      setRgbColorValue(rgbStringToArray(color));
    } else {
      setRgbColorValue(hexToRgb(color));
    }
  };
  var getHexColor = function getHexColor2(color) {
    return isTransparentColor(color) ? transparentColorHex : color;
  };
  var changeRangePickerPointerPosByColor = function changeRangePickerPointerPosByColor2(color) {
    if (rangePickerRef !== null) {
      var _ref3 = getElemDocumentCoords$1(rangePickerRef), width = _ref3.width, height = _ref3.height;
      var colorHsl = colorToHsl(color);
      var colorHsv = hslToHsv(colorHsl[0], colorHsl[1] / 100, colorHsl[2] / 100);
      var left2 = mapNumber$1(colorHsv[1], 0, 100, 0, width);
      var top2 = height - mapNumber$1(colorHsv[2], 0, 100, 0, height);
      setRangePicker({
        color: getHexColor(color),
        pointer: {
          left: left2,
          top: top2
        }
      });
      changeBarPosByColor(color);
      updateRgb(color);
      if (typeof onChange2 === "function") {
        onChange2(getHexColor(color), getRgbColor(color), filterTransparentColor(localPinnedColors));
      }
    }
  };
  var changeRangePickerColorByPosition = function changeRangePickerColorByPosition2(left2, top2, barColor) {
    if (rangePickerRef !== null) {
      var _ref4 = getElemDocumentCoords$1(rangePickerRef), width = _ref4.width, height = _ref4.height;
      var _colorToHsl3 = colorToHsl(barColor), _colorToHsl4 = _slicedToArray(_colorToHsl3, 1), barColorHue = _colorToHsl4[0];
      var restrictedLeft = restrictNumber$1(left2, 0, width) || 0;
      var restrictedTop = restrictNumber$1(top2, 0, height) || 0;
      var hsl = hsvToHsl(barColorHue, restrictedLeft / width, (height - restrictedTop) / height);
      var hexColor = hslToHex(hsl[0], hsl[1], hsl[2]);
      setRangePicker({
        color: hexColor,
        pointer: {
          left: restrictedLeft,
          top: restrictedTop
        }
      });
      if (typeof onChange2 === "function") {
        onChange2(hexColor, "rgb(".concat(hexToRgb(hexColor).join(", "), ")"), filterTransparentColor(localPinnedColors));
      }
    }
  };
  var changeBarColorByPosition = function changeBarColorByPosition2(pointerLeft) {
    var barElem = barRef;
    if (barElem !== null) {
      var _ref5 = getElemDocumentCoords$1(barElem), width = _ref5.width;
      var mappedPointerLeft = restrictNumber$1(Math.round(mapNumber$1(pointerLeft, 0, width, 0, colorsHuesCount)), 0, colorsHuesCount);
      var targetColorElem = barElem.querySelector("[data-hue='".concat(mappedPointerLeft, "']"));
      var targetColorRgb = targetColorElem.style.backgroundColor;
      setBar({
        color: targetColorRgb,
        pointerLeft: restrictNumber$1(pointerLeft, 0, width)
      });
      return targetColorRgb;
    }
    return bar.color;
  };
  var updateBarColor = function updateBarColor2(e2) {
    var barElem = barRef;
    if (barElem !== null) {
      var _e$touches;
      var _ref6 = getElemDocumentCoords$1(barElem), left2 = _ref6.left;
      var pointerEvent = ((_e$touches = e2.touches) === null || _e$touches === void 0 ? void 0 : _e$touches[0]) || e2;
      var barColor = changeBarColorByPosition(pointerEvent.pageX - left2);
      changeRangePickerColorByPosition(rangePicker.pointer.left, rangePicker.pointer.top, barColor);
    }
  };
  var updateRangePickerColor = function updateRangePickerColor2(e2) {
    var rangePickerElem = rangePickerRef;
    if (rangePickerElem !== null) {
      var _ref7 = getElemDocumentCoords$1(rangePickerElem), left2 = _ref7.left, top2 = _ref7.top, height = _ref7.height, width = _ref7.width;
      var pointerLeft = e2 ? restrictNumber$1(e2.pageX - left2, 0, width) : rangePicker.pointer.left || 0;
      var pointerTop = e2 ? restrictNumber$1(e2.pageY - top2, 0, height) : rangePicker.pointer.left || 0;
      changeRangePickerColorByPosition(pointerLeft, pointerTop, bar.color);
    }
  };
  var moveBarPointerByArrows = function moveBarPointerByArrows2(e2) {
    if (e2.key !== "ArrowLeft" && e2.key !== "ArrowRight") {
      return;
    }
    changeBarColorByPosition(bar.pointerLeft + (e2.key === "ArrowLeft" ? -1 : 1));
  };
  var moveRangePickerPointerByArrows = function moveRangePickerPointerByArrows2(e2) {
    var currentDirection = 0;
    if (e2.key === "ArrowLeft" || e2.key === "ArrowUp") {
      currentDirection = -1;
    } else if (e2.key === "ArrowRight" || e2.key === "ArrowDown") {
      currentDirection = 1;
    }
    if (currentDirection) {
      changeRangePickerColorByPosition((rangePicker.pointer.left || 0) + (["ArrowLeft", "ArrowRight"].includes(e2.key) ? currentDirection : 0), (rangePicker.pointer.top || 0) + (["ArrowUp", "ArrowDown"].includes(e2.key) ? currentDirection : 0), bar.color);
    }
  };
  var validateHexAndUpdate = function validateHexAndUpdate2(color) {
    var testHex = validateHex(color);
    if (testHex) {
      changeRangePickerPointerPosByColor(color);
    }
    setHexInputValue(color);
  };
  reactExports.useEffect(function() {
    changeBarPosByColor(rangePicker.color);
    changeRangePickerPointerPosByColor(rangePicker.color);
  }, [barRef]);
  reactExports.useEffect(function() {
    setHexInputValue(rangePicker.color);
    updateRgb(rangePicker.color);
  }, [rangePicker.color]);
  var barColors = reactExports.useMemo(function() {
    return _toConsumableArray(new Array(colorsHuesCount + 1)).map(function(_2, h2) {
      return /* @__PURE__ */ React.createElement(Styled$f.BarColorStop, {
        key: h2,
        $color: "hsl(".concat(h2, ", 100%, 50%)"),
        "data-hue": h2
      });
    });
  }, []);
  var barPointSliding = useDrag(updateBarColor, updateBarColor);
  var rangePickerPointSliding = useDrag(updateRangePickerColor, updateRangePickerColor);
  return /* @__PURE__ */ React.createElement(Styled$f.ColorPickerWrapper, _extends({
    ref
  }, rest), /* @__PURE__ */ React.createElement(Styled$f.ColorPickerAction, null, /* @__PURE__ */ React.createElement(Styled$f.SelectWrapper, null, /* @__PURE__ */ React.createElement(Styled$f.Select, {
    value: inputType
  }, /* @__PURE__ */ React.createElement(Select$1, {
    size: "sm",
    value: inputType,
    MenuProps: _objectSpread$U({
      zIndex: 11112
    }, containerProps),
    onChange: function onChange3(ev) {
      return setInputType(ev);
    },
    fullWidth: true,
    hideEllipsis: true
  }, /* @__PURE__ */ React.createElement(MenuItem, {
    value: "hex"
  }, "Hex"), /* @__PURE__ */ React.createElement(MenuItem, {
    value: "rgb"
  }, "RGB"))), inputType === "hex" ? /* @__PURE__ */ React.createElement(Input$1, {
    size: "sm",
    error: !/^#([\da-f]{3}){1,2}$/i.test(rangePicker.color),
    value: hexInputValue,
    onChange: function onChange3(e2) {
      return validateHexAndUpdate(e2.target.value);
    },
    style: {
      width: "45%"
    }
  }) : rgbColorValue.map(function(rgb, index) {
    return /* @__PURE__ */ React.createElement(Input$1, {
      key: index,
      size: "sm",
      value: rgb,
      onChange: function onChange3(e2) {
        var _e$target;
        return handleRgbInput(Number((_e$target = e2.target) === null || _e$target === void 0 ? void 0 : _e$target.value), index);
      },
      style: {
        width: "20%"
      }
    });
  })), rangePicker.color !== transparentColorHex && !hidePinIcon && /* @__PURE__ */ React.createElement(Styled$f.ColorPickerIcon, {
    onClick: function onClick() {
      return localPinnedColors.some(function(checkedColor) {
        return isColorChecked(checkedColor);
      }) ? handlePinnedColors(rangePicker.color, "delete") : handlePinnedColors(rangePicker.color, "add");
    }
  }, localPinnedColors.some(function(checkedColor) {
    return isColorChecked(checkedColor);
  }) ? /* @__PURE__ */ React.createElement(DeleteOutline, null) : /* @__PURE__ */ React.createElement(PinOutline, null))), /* @__PURE__ */ React.createElement(Styled$f.RangePickerWrapper, _extends({
    ref: setRangePickerRef,
    color: bar.color
  }, rangePickerPointSliding), /* @__PURE__ */ React.createElement(Styled$f.WhiteGradient, null), /* @__PURE__ */ React.createElement(Styled$f.BlackGradient, null), /* @__PURE__ */ React.createElement(Styled$f.ColorPointer, {
    tabIndex: -1,
    left: rangePicker.pointer.left || 0,
    top: rangePicker.pointer.top || 0,
    onKeyDown: moveRangePickerPointerByArrows,
    pointerColor: hexInputValue,
    considerTopWidth: true
  })), /* @__PURE__ */ React.createElement(Styled$f.BarWrapper, barPointSliding, /* @__PURE__ */ React.createElement(Styled$f.Bar, {
    ref: setBarRef
  }, /* @__PURE__ */ React.createElement("tbody", null, /* @__PURE__ */ React.createElement("tr", null, barColors))), /* @__PURE__ */ React.createElement(Styled$f.ColorPointer, {
    tabIndex: -1,
    left: bar.pointerLeft,
    onKeyDown: moveBarPointerByArrows,
    considerTopWidth: false,
    pointerColor: hexInputValue,
    style: {
      top: -3
    }
  })), /* @__PURE__ */ React.createElement(Styled$f.ColorItemsContainer, null, localPinnedColors.map(function(color) {
    return /* @__PURE__ */ React.createElement("div", {
      className: "item",
      key: color
    }, /* @__PURE__ */ React.createElement(ColorItem, {
      value: color,
      checked: isColorChecked(color),
      onChange: function onChange3(ev) {
        return changeRangePickerPointerPosByColor(ev.target.value);
      }
    }));
  })));
});
ColorPicker.defaultProps = {
  defaultColor: "#000000",
  pinnedColors: [],
  showTransparentColor: false,
  hidePinIcon: false
};
ColorPicker.propTypes = {
  defaultColor: PropTypes.string,
  onChange: PropTypes.func,
  pinnedColors: PropTypes.array,
  showTransparentColor: PropTypes.bool,
  hidePinIcon: PropTypes.bool
};
var colorButtonMixin = _defineProperty(_defineProperty(_defineProperty({}, IconButtonColor.Primary, function(_ref) {
  var palette = _ref.theme.palette, active = _ref.active;
  return Ae(["background-color:", ";color:", ";&:hover{background-color:", ";}&:focus{background-color:", ";}&:active{background-color:", ";}", " &:disabled{color:", ";background:", ";cursor:default;}"], palette[Color.AccentStateless], palette[Color.IconsInvert], palette[Color.AccentPrimaryHover], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive], active && Ae(["background-color:", ";&:hover,&:focus{background-color:", ";}"], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity]);
}), IconButtonColor.Secondary, function(_ref2) {
  var palette = _ref2.theme.palette, active = _ref2.active;
  return Ae(["background-color:", ";color:", ";border:1px solid ", ";&:hover{color:", ";background-color:", ";}&:focus{background-color:", ";color:", ";border:1px solid ", ";}&:active{color:", ";background-color:", ";}", " &:disabled{color:", ";background:", ";border:none;cursor:default;}"], palette[Color.BackgroundStateless], palette[Color.AccentStateless], palette[Color.AccentStateless], palette[Color.IconsInvert], palette[Color.AccentPrimaryHover], palette[Color.Accent_1_2_Opacity], palette[Color.AccentPrimaryActive], palette[Color.AccentPrimaryActive], palette[Color.IconsInvert], palette[Color.AccentPrimaryActive], active && Ae(["color:", ";background-color:", ";&:hover,&:focus{color:", ";background-color:", ";}"], palette[Color.IconsInvert], palette[Color.AccentPrimaryActive], palette[Color.IconsInvert], palette[Color.AccentPrimaryActive]), palette[Color.BordersDisabled], palette[Color.Accent_1_2_Opacity]);
}), IconButtonColor.Basic, function(_ref3) {
  var palette = _ref3.theme.palette, active = _ref3.active;
  return Ae(["background-color:transparent;color:", ";border:none;&:hover{background-color:", ";color:", ";}&:focus{background-color:", ";color:", ";}&:active{background-color:", ";color:", ";}", " &:disabled{background-color:transparent;color:", ";cursor:default;}"], palette[Color.IconsPrimary], palette[Color.BackgroundHover], palette[Color.IconsPrimaryHover], palette[Color.BackgroundActive], palette[Color.LinkActive], palette[Color.BackgroundActive], palette[Color.LinkActive], active && Ae(["background-color:", ";color:", ";&:hover,&:focus{background-color:", ";color:", ";}"], palette[Color.BackgroundActive], palette[Color.LinkActive], palette[Color.BackgroundActive], palette[Color.LinkActive]), palette[Color.BordersDisabled]);
});
var squarePaddingMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ButtonSize.Xs, Ae(["padding:6px;"])), ButtonSize.Sm, Ae(["padding:9px;"])), ButtonSize.Md, Ae(["padding:12px;"])), ButtonSize.Lg, Ae(["padding:11px;"]));
var baseClassName$d = "IconButton";
var IconButton$1 = /* @__PURE__ */ qe(Styled$i.Button).attrs({
  className: generateClassNames(baseClassName$d, "root")
}).withConfig({
  componentId: "sc-10edh45-0"
})(function(_ref) {
  var _ref$color = _ref.color, color = _ref$color === void 0 ? IconButtonColor.Secondary : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? ButtonSize.Md : _ref$size;
  return Ae(["", " ", ""], squarePaddingMixin[size], colorButtonMixin[color]);
});
var Styled$e = applyDisplayNames({
  IconButton: IconButton$1
});
var _excluded$t = ["children"];
var IconButton = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$t);
  return /* @__PURE__ */ React.createElement(Styled$e.IconButton, _extends({}, rest, {
    ref
  }), children && (typeof children === "function" ? children({
    size: getIconSize$2(rest.size)
  }) : children));
});
IconButton.defaultProps = {
  size: ButtonSize.Md,
  color: IconButtonColor.Secondary,
  active: false
};
IconButton.propTypes = {
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
  size: PropTypes.oneOf(objectValues(ButtonSize)),
  color: PropTypes.oneOf(objectValues(IconButtonColor)),
  disabled: PropTypes.bool,
  active: PropTypes.bool
};
var onClickByMouseDown = function onClickByMouseDown2(event, callback) {
  event.preventDefault();
  if (event.button !== 0) {
    return;
  }
  if (callback) {
    callback(event);
  }
};
var errorMixin3 = function errorMixin4(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["background:", " !important;border:1px solid ", " !important;"], palette[Color.BackgroundSecondary], palette[Color.Error]);
};
var heightTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function() {
  return Ae(["height:136px;"]);
}), InputSize.Md, function() {
  return Ae(["height:152px;"]);
});
var sizeTextAreaMixin = _defineProperty(_defineProperty({}, InputSize.Sm, function(_ref2) {
  var font = _ref2.theme.typography.font;
  return Ae(["padding:8px 12px;", ""], font[FontVariant.InputMd]);
}), InputSize.Md, function(_ref3) {
  var font = _ref3.theme.typography.font;
  return Ae(["padding:8px 16px;", ""], font[FontVariant.InputLg]);
});
var baseClassName$c = "Textarea";
var Textarea$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$c, "root")
}).withConfig({
  componentId: "sc-1usif6k-0"
})(function(_ref) {
  var _ref$size = _ref.size, size = _ref$size === void 0 ? InputSize.Md : _ref$size, _ref$error = _ref.error, error2 = _ref$error === void 0 ? false : _ref$error, _ref$fullWidth = _ref.fullWidth, fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth, _ref$readOnly = _ref.readOnly, readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$autoSize = _ref.autoSize, autoSize = _ref$autoSize === void 0 ? false : _ref$autoSize, theme = _ref.theme;
  return Ae(["position:relative;display:inline-flex;flex-direction:column;align-items:flex-end;justify-content:space-between;cursor:text;box-sizing:border-box;transition:all 100ms ease-out;width:", ";pointer-events:", ";background-color:", ";border-radius:", ";border:1px solid ", ";color:", ";", " ", " &:hover{color:", ";}", " ", ""], fullWidth ? "100%" : "300px", disabled ? "none" : "auto", getInputBackgroundColor(readOnly, disabled), theme.shape.borderRadius[BorderRadiusSize.Md], getInputBorderColor(readOnly, disabled), disabled ? theme.palette[Color.TextPlaceholder] : theme.palette[Color.TextPrimary], heightTextAreaMixin[size], !readOnly && !disabled && Ae(["&:focus-within{background-color:", "!important;border:1px solid ", ";&:hover{border:1px solid ", ";}}&:hover{background-color:", ";border:1px solid ", ";}"], theme.palette[Color.BackgroundSecondary], theme.palette[Color.AccentStateless], theme.palette[Color.AccentStateless], theme.palette[Color.BackgroundStateless], theme.palette[Color.BordersPrimaryHover]), getInputTextColor(readOnly, disabled), error2 && errorMixin3, autoSize && Ae(["width:auto;height:auto;"]));
});
var Base = /* @__PURE__ */ qe.textarea.attrs({
  className: generateClassNames(baseClassName$c, "Base")
}).withConfig({
  componentId: "sc-1usif6k-1"
})(function(_ref2) {
  var palette = _ref2.theme.palette, _ref2$readOnly = _ref2.readOnly, readOnly = _ref2$readOnly === void 0 ? false : _ref2$readOnly, _ref2$size = _ref2.size, size = _ref2$size === void 0 ? InputSize.Md : _ref2$size;
  return Ae(["display:block;width:100%;height:100%;color:inherit;outline:none;resize:none;min-width:0;margin:0;padding:0;border:0;background-color:transparent;outline:none;font-size:inherit;line-height:inherit;color:inherit;font-weight:inherit;font-family:inherit;box-sizing:border-box;flex:1;", " ", ";&::placeholder{color:", ";}::-webkit-scrollbar{width:12px;}::-webkit-scrollbar-track{width:8px;}::-webkit-scrollbar-thumb{background:", ";border-radius:8px;border:4px solid ", ";}"], readOnly && "padding-bottom: 0px;", sizeTextAreaMixin[size], palette[Color.TextPlaceholder], palette[Color.BorderPrimaryStateless], palette[Color.BackgroundStateless]);
});
var ActionsButtonsWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$c, "ActionsButtonsWrapper")
}).withConfig({
  componentId: "sc-1usif6k-2"
})(function(_ref3) {
  var _ref3$size = _ref3.size, size = _ref3$size === void 0 ? InputSize.Md : _ref3$size;
  return Ae(["display:flex;align-items:center;width:100%;column-gap:12px;box-sizing:border-box;", ";.SfxButton-Label{font-weight:500;}"], sizeTextAreaMixin[size]);
});
var CopyIcon = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$c, "CopyIcon")
}).withConfig({
  componentId: "sc-1usif6k-3"
})(function(_ref4) {
  var palette = _ref4.theme.palette;
  return Ae(["cursor:pointer;color:", ";margin-left:auto;"], palette[Color.IconsPrimary]);
});
var Styled$d = applyDisplayNames({
  Textarea: Textarea$1,
  CopyIcon,
  Base,
  ActionsButtonsWrapper
});
var _excluded$s = ["fullWidth", "size", "value", "readOnly", "disabled", "error", "cols", "rows", "copyTextMessage", "copySuccessIcon", "showActionButton", "showClearButton", "showCopyIcon", "disableActionButton", "isActionButtonLoading", "actionButtonLabel", "clearAllButtonLabel", "onClickActionButton", "onClear", "onChange"];
function ownKeys$T(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$T(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$T(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$T(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Textarea = intrinsicComponent$1(function(_ref, ref) {
  var _inputRef$current;
  var fullWidth = _ref.fullWidth, size = _ref.size, value = _ref.value, readOnly = _ref.readOnly, disabled = _ref.disabled, error2 = _ref.error, cols = _ref.cols, rows = _ref.rows, _ref$copyTextMessage = _ref.copyTextMessage, copyTextMessage = _ref$copyTextMessage === void 0 ? "" : _ref$copyTextMessage, copySuccessIcon = _ref.copySuccessIcon, _ref$showActionButton = _ref.showActionButton, showActionButton = _ref$showActionButton === void 0 ? false : _ref$showActionButton, _ref$showClearButton = _ref.showClearButton, showClearButton = _ref$showClearButton === void 0 ? false : _ref$showClearButton, _ref$showCopyIcon = _ref.showCopyIcon, showCopyIcon = _ref$showCopyIcon === void 0 ? false : _ref$showCopyIcon, _ref$disableActionBut = _ref.disableActionButton, disableActionButton = _ref$disableActionBut === void 0 ? false : _ref$disableActionBut, _ref$isActionButtonLo = _ref.isActionButtonLoading, isActionButtonLoading = _ref$isActionButtonLo === void 0 ? false : _ref$isActionButtonLo, actionButtonLabel = _ref.actionButtonLabel, clearAllButtonLabel = _ref.clearAllButtonLabel, onClickActionButton = _ref.onClickActionButton, onClear = _ref.onClear, onChange2 = _ref.onChange, rest = _objectWithoutProperties(_ref, _excluded$s);
  var inputRef = reactExports.useRef(null);
  var textareaRef = useForkRef(inputRef, ref);
  var _useState = reactExports.useState(false), _useState2 = _slicedToArray(_useState, 2), isHovering = _useState2[0], setIsHovering = _useState2[1];
  var _useState3 = reactExports.useState({}), _useState4 = _slicedToArray(_useState3, 2), overflowStyles = _useState4[0], setOverflowStyles = _useState4[1];
  var _useState5 = reactExports.useState(false), _useState6 = _slicedToArray(_useState5, 2), showCopyMessage = _useState6[0], setShowCopyMessage = _useState6[1];
  var _useState7 = reactExports.useState(value), _useState8 = _slicedToArray(_useState7, 2), inputValue = _useState8[0], setInputValue = _useState8[1];
  var actionButtonHandler = function actionButtonHandler2(event) {
    if (onClickActionButton) {
      onClickActionButton(event);
    }
  };
  var clearAllHandler = function clearAllHandler2(event) {
    setInputValue("");
    if (onClear) {
      onClear(event);
    }
  };
  var onChangeHandler = function onChangeHandler2(event) {
    setInputValue(event.target.value);
    if (onChange2) {
      onChange2(event);
    }
  };
  var copyIconHandler = function copyIconHandler2() {
    if (showCopyIcon) {
      handleCopyIcon(inputValue, setShowCopyMessage);
    }
  };
  reactExports.useEffect(function() {
    var current = inputRef.current;
    if (current && current.scrollHeight > current.clientHeight) {
      setOverflowStyles({
        paddingRight: size === Size$2.Md ? "4px" : "0px"
      });
    }
  }, [(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.scrollHeight, size]);
  reactExports.useEffect(function() {
    setTimeout(function() {
      return setShowCopyMessage(false);
    }, 2e3);
  }, [showCopyMessage]);
  reactExports.useEffect(function() {
    setInputValue(value);
  }, [value]);
  var handleEntering = function handleEntering2() {
    setTimeout(function() {
      setIsHovering(true);
    }, 150);
  };
  var handleLeaving = function handleLeaving2() {
    setTimeout(function() {
      setIsHovering(false);
    }, 200);
  };
  var renderCopyText = function renderCopyText2() {
    return /* @__PURE__ */ React.createElement(Styled$o.NotificationBox, {
      size,
      isTextarea: true
    }, /* @__PURE__ */ React.createElement(Styled$o.NotificationIcon, null, copySuccessIcon), /* @__PURE__ */ React.createElement(Styled$o.NotificationText, null, copyTextMessage));
  };
  return /* @__PURE__ */ React.createElement(Styled$d.Textarea, {
    size,
    value: inputValue,
    onMouseEnter: handleEntering,
    onMouseLeave: handleLeaving,
    readOnly,
    disabled,
    fullWidth: Boolean(fullWidth),
    error: error2,
    autoSize: Boolean(cols) || Boolean(rows)
  }, /* @__PURE__ */ React.createElement(Styled$d.Base, _extends({}, rest, {
    value: inputValue,
    ref: textareaRef,
    size,
    onChange: onChangeHandler,
    readOnly,
    disabled,
    style: _objectSpread$T({}, overflowStyles)
  })), (showActionButton || showClearButton || showCopyIcon) && /* @__PURE__ */ React.createElement(Styled$d.ActionsButtonsWrapper, {
    size
  }, showActionButton && /* @__PURE__ */ React.createElement(Button, {
    color: "link-primary",
    size: "sm",
    disabled: disableActionButton,
    loading: isActionButtonLoading,
    onMouseDown: function onMouseDown(event) {
      return onClickByMouseDown(event, actionButtonHandler);
    }
  }, actionButtonLabel), showClearButton && /* @__PURE__ */ React.createElement(Button, {
    color: "link-secondary",
    size: "sm",
    onMouseDown: function onMouseDown(event) {
      return onClickByMouseDown(event, clearAllHandler);
    }
  }, clearAllButtonLabel), showCopyIcon && /* @__PURE__ */ React.createElement(Styled$d.CopyIcon, {
    showCopyIcon: isHovering && inputValue.length > 0,
    size,
    onMouseDown: function onMouseDown(event) {
      return onClickByMouseDown(event, copyIconHandler);
    }
  }, /* @__PURE__ */ React.createElement(CopyOutline, {
    size: getIconSize$2(size)
  }), showCopyMessage && renderCopyText())));
});
Textarea.defaultProps = {
  size: InputSize.Md,
  error: false,
  fullWidth: false,
  readOnly: false,
  disabled: false,
  disableActionButton: false,
  isActionButtonLoading: false,
  actionButtonLabel: "Action",
  clearAllButtonLabel: "Clear all"
};
var propTypes$4 = {
  error: PropTypes.bool,
  readOnly: PropTypes.bool,
  disabled: PropTypes.bool,
  fullWidth: PropTypes.bool,
  disableActionButton: PropTypes.bool,
  isActionButtonLoading: PropTypes.bool,
  value: PropTypes.any,
  size: PropTypes.oneOf(objectValues(InputSize)),
  copySuccessIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  copyTextMessage: PropTypes.string,
  cols: PropTypes.number,
  rows: PropTypes.number,
  showActionButton: PropTypes.bool,
  showClearButton: PropTypes.bool,
  showCopyIcon: PropTypes.bool,
  actionButtonLabel: PropTypes.string,
  clearAllButtonLabel: PropTypes.string,
  onClickActionButton: PropTypes.func,
  onClear: PropTypes.func
};
Textarea.propTypes = propTypes$4;
var Type = {
  Input: "input",
  Textarea: "textarea"
};
var baseClassName$b = "InputGroup";
var InputGroup$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$b, "root")
}).withConfig({
  componentId: "sc-zhtjwh-0"
})(["", "{margin-top:4px;}", "{margin-bottom:4px;}"], Styled$k.FormHint, Styled$u.Label);
var Styled$c = applyDisplayNames({
  InputGroup: InputGroup$1
});
var _excluded$r = ["children", "type", "error", "label", "hint", "LabelProps", "InputProps", "inputProps", "inputRef", "TextareaProps", "readOnly", "disabled", "size", "value"];
function ownKeys$S(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$S(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$S(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$S(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var InputGroup = intrinsicComponent$1(function(_ref, ref) {
  _ref.children;
  var type = _ref.type, error2 = _ref.error, label = _ref.label, hint = _ref.hint, LabelPropsData = _ref.LabelProps, InputPropsData = _ref.InputProps, inputProps = _ref.inputProps, inputRef = _ref.inputRef, TextareaPropsData = _ref.TextareaProps, readOnly = _ref.readOnly, disabled = _ref.disabled, size = _ref.size, value = _ref.value, rest = _objectWithoutProperties(_ref, _excluded$r);
  var renderLabel = function renderLabel2() {
    if (label) {
      if (typeof label === "function") {
        return label({
          error: error2
        });
      }
      if (_typeof(label) === "object") {
        return label;
      }
      return /* @__PURE__ */ React.createElement(Label$5, _extends({
        size,
        error: error2,
        disabled
      }, LabelPropsData || {}), label);
    }
    return null;
  };
  var renderField = function renderField2() {
    var fieldProps = _objectSpread$S({
      value,
      readOnly,
      disabled,
      size,
      error: error2
    }, rest);
    if (type === Type.Input) {
      return /* @__PURE__ */ React.createElement(Input$1, _extends({}, fieldProps, InputPropsData || {}, inputProps, {
        ref: (inputRef === null || inputRef === void 0 ? void 0 : inputRef.ref) || inputRef,
        readOnly,
        disabled
      }));
    }
    if (type === Type.Textarea) {
      return /* @__PURE__ */ React.createElement(Textarea, _extends({}, fieldProps, TextareaPropsData || {}));
    }
    return null;
  };
  var renderHint = function renderHint2() {
    if (hint) {
      if (typeof hint === "function") {
        return hint({
          error: error2
        });
      }
      if (_typeof(hint) === "object") {
        return hint;
      }
      return /* @__PURE__ */ React.createElement(FormHint, {
        size,
        error: error2,
        disabled
      }, hint);
    }
    return null;
  };
  return /* @__PURE__ */ React.createElement(Styled$c.InputGroup, {
    ref
  }, renderLabel(), renderField(), renderHint());
});
InputGroup.defaultProps = {
  type: Type.Input,
  error: false,
  readOnly: false
};
InputGroup.propTypes = {
  type: PropTypes.oneOf(objectValues(Type)),
  size: PropTypes.oneOf(objectValues(InputSize)),
  label: PropTypes.node,
  hint: PropTypes.node,
  error: PropTypes.bool,
  value: PropTypes.any,
  LabelProps: PropTypes.exact(propTypes$9),
  InputProps: PropTypes.exact(propTypes$8),
  inputProps: PropTypes.object,
  inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
  TextareaProps: PropTypes.exact(propTypes$4),
  readOnly: PropTypes.bool,
  disabled: PropTypes.bool
};
var Size = {
  Xs: "xs",
  Sm: "sm",
  Md: "md",
  Lg: "lg",
  Xl: "xl"
};
var ModalMenuContext = /* @__PURE__ */ reactExports.createContext({
  modalOpened: false
});
var modalSizeMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Size.Xs, Ae(["max-width:300px;"])), Size.Sm, Ae(["max-width:600px;"])), Size.Md, Ae(["max-width:960px;"])), Size.Lg, Ae(["max-width:1280px;"])), Size.Xl, Ae(["max-width:1920px;"]));
var baseClassName$a = "Modal";
var Wrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$a, "Wrapper")
}).withConfig({
  componentId: "sc-80m07l-0"
})(function(_ref) {
  var open = _ref.open;
  return Ae(["position:fixed;right:0px;bottom:0px;top:0px;left:0px;z-index:1200;visibility:", ";"], open ? "visible" : "hidden");
});
var Overlay = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$a, "Overlay")
}).withConfig({
  componentId: "sc-80m07l-1"
})(function(_ref2) {
  var open = _ref2.open;
  return Ae(["position:fixed;right:0px;bottom:0px;top:0px;left:0px;background-color:rgba(0,0,0,0.5);z-index:-1;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:", ";"], open ? "1" : "0");
});
var Container3 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$a, "Container")
}).withConfig({
  componentId: "sc-80m07l-2"
})(function(_ref3) {
  var theme = _ref3.theme, _ref3$open = _ref3.open, open = _ref3$open === void 0 ? false : _ref3$open, _ref3$fullWidth = _ref3.fullWidth, fullWidth = _ref3$fullWidth === void 0 ? false : _ref3$fullWidth, _ref3$maxWidth = _ref3.maxWidth, maxWidth = _ref3$maxWidth === void 0 ? Size.Sm : _ref3$maxWidth;
  return Ae(["position:absolute;overflow-x:hidden;overflow-y:auto;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms,transform 167ms cubic-bezier(0.4,0,0.2,1) 0ms;outline:0;border-radius:", ";background-color:", ";box-shadow:0px 2px 4px ", ";visibility:", ";opacity:", ";display:flex;max-height:calc(100% - 64px);flex-direction:column;", " ", " top:50%;left:50%;transform:translate(-50%,-50%);"], theme.shape.borderRadius[BorderRadiusSize.Lg], theme.palette[Color.BackgroundSecondary], theme.palette[Color.LightShadow], open ? "visible" : "hidden", open ? "1" : "0", fullWidth && Ae(["width:calc(100% - 64px);"]), modalSizeMixin[maxWidth]);
});
var Modal$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$a, "root")
}).withConfig({
  componentId: "sc-80m07l-3"
})(function() {
  return Ae(["position:relative;padding-top:8px;padding-bottom:8px;margin:0;padding:0;outline:0;display:flex;flex-direction:column;"]);
});
var Styled$b = applyDisplayNames({
  Modal: Modal$2,
  Wrapper,
  Overlay,
  Container: Container3
});
var _excluded$q = ["children", "open", "onClose", "maxWidth", "fullWidth", "modalStyles", "hideOverlay", "disableOverlayClick"];
function ownKeys$R(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$R(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$R(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$R(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var isValidSingleFragmentChildren = function isValidSingleFragmentChildren2(children) {
  return children && /* @__PURE__ */ reactExports.isValidElement(children) && React.Children.count(children) === 1 && children.type === React.Fragment;
};
var Modal$1 = intrinsicComponent$1(function(_ref, ref) {
  var _children = _ref.children, open = _ref.open, onClose2 = _ref.onClose, maxWidth = _ref.maxWidth, fullWidth = _ref.fullWidth, modalStyles2 = _ref.modalStyles, hideOverlay = _ref.hideOverlay, disableOverlayClick = _ref.disableOverlayClick, rest = _objectWithoutProperties(_ref, _excluded$q);
  var children = isValidSingleFragmentChildren(_children) ? _children.props.children : _children;
  var target = document.querySelector("body");
  reactExports.useEffect(function() {
    if (open) {
      document.body.classList.add("Modal-open");
    } else {
      document.body.classList.remove("Modal-open");
    }
    return function() {
      document.body.classList.remove("Modal-open");
    };
  }, [open]);
  var handleClose = function handleClose2() {
    if (typeof onClose2 === "function") {
      onClose2();
    }
  };
  reactExports.useEffect(function() {
    var keyListener = function keyListener2(ev) {
      if (ev.key === "Escape") {
        handleClose();
      }
    };
    document.addEventListener("keydown", keyListener);
    return function() {
      return document.removeEventListener("keydown", keyListener);
    };
  });
  var render = function render2() {
    return /* @__PURE__ */ React.createElement(ModalMenuContext.Provider, {
      value: {
        modalOpened: Boolean(open)
      }
    }, /* @__PURE__ */ React.createElement(Styled$b.Wrapper, {
      style: _objectSpread$R({}, modalStyles2),
      open: Boolean(open),
      ref
    }, !hideOverlay && /* @__PURE__ */ React.createElement(Styled$b.Overlay, {
      onClick: function onClick() {
        return disableOverlayClick ? null : handleClose();
      },
      open: Boolean(open)
    }), /* @__PURE__ */ React.createElement(Styled$b.Container, _extends({}, rest, {
      maxWidth,
      fullWidth,
      open: Boolean(open)
    }), /* @__PURE__ */ React.createElement(Styled$b.Modal, null, React.Children.map(children, function(child) {
      if (/* @__PURE__ */ reactExports.isValidElement(child) && child.type.displayName === "ModalTitle") {
        return /* @__PURE__ */ React.cloneElement(child, _objectSpread$R({
          onClose: handleClose
        }, child.props || {}));
      }
      return child;
    })))));
  };
  return /* @__PURE__ */ reactDomExports.createPortal(render(), target);
});
var defaultProps$3 = {
  open: false,
  fullWidth: false,
  disableOverlayClick: false,
  hideOverlay: false,
  maxWidth: Size.Xs
};
Modal$1.defaultProps = defaultProps$3;
var propTypes$3 = {
  onClose: PropTypes.func,
  modalStyles: PropTypes.object,
  disableOverlayClick: PropTypes.bool,
  hideOverlay: PropTypes.bool,
  children: PropTypes.node.isRequired,
  maxWidth: PropTypes.oneOf(objectValues(Size)),
  open: PropTypes.bool,
  fullWidth: PropTypes.bool
};
Modal$1.propTypes = propTypes$3;
var Align = {
  Left: "left",
  Center: "center",
  Right: "right"
};
var baseClassName$9 = "ModalActions";
var ModalActions$2 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$9, "root")
}).withConfig({
  componentId: "sc-1wg6u00-0"
})(function(_ref) {
  var _ref$align = _ref.align, align = _ref$align === void 0 ? Align.Center : _ref$align;
  return Ae(["position:relative;display:flex;align-items:center;padding:24px;justify-content:", ";gap:12px;"], align === Align.Right ? "flex-end" : align);
});
var Styled$a = applyDisplayNames({
  ModalActions: ModalActions$2
});
var _excluded$p = ["children"];
var ModalActions$1 = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$p);
  return /* @__PURE__ */ React.createElement(Styled$a.ModalActions, _extends({}, rest, {
    ref
  }), children);
});
ModalActions$1.defaultProps = {
  align: Align.Center
};
ModalActions$1.propTypes = {
  children: PropTypes.node.isRequired,
  align: PropTypes.oneOf(objectValues(Align))
};
ModalActions$1.displayName = "ModalActions";
var baseClassName$8 = "ModalContent";
var ModalContent$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$8, "root")
}).withConfig({
  componentId: "sc-1ng1w0v-0"
})(function() {
  return Ae(["position:relative;padding:12px 24px 0px;"]);
});
var Styled$9 = applyDisplayNames({
  ModalContent: ModalContent$1
});
var _excluded$o = ["children"];
var ModalContent = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$o);
  return /* @__PURE__ */ React.createElement(Styled$9.ModalContent, _extends({}, rest, {
    ref
  }), children);
});
ModalContent.defaultProps = {};
ModalContent.propTypes = {
  children: PropTypes.node.isRequired
};
ModalContent.displayName = "ModalContent";
var Variant$1 = {
  Default: "default",
  WithIcon: "with-icon"
};
var baseClassName$7 = "ModalTitle";
var Icon$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$7, "Icon")
}).withConfig({
  componentId: "sc-l3tf49-0"
})(function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["display:flex;margin-bottom:8px;padding:14.5px;border-radius:50%;background:", ";color:", ";"], palette[Color.Accent_1_2_Opacity], palette[Color.AccentStateless]);
});
var LabelPrimary = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$7, "LabelPrimary")
}).withConfig({
  componentId: "sc-l3tf49-1"
})(function(_ref2) {
  var _ref2$variant = _ref2.variant, variant = _ref2$variant === void 0 ? Variant$1.Default : _ref2$variant;
  return Ae(["font-size:18px;line-height:27px;font-weight:", ";"], variant === Variant$1.Default ? 400 : 500);
});
var LabelSecondary = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$7, "LabelSecondary")
}).withConfig({
  componentId: "sc-l3tf49-2"
})(["font-size:12px;line-height:14px;margin-top:4px;"]);
var Close = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$7, "Close")
}).withConfig({
  componentId: "sc-l3tf49-3"
})(function(_ref3) {
  var _ref3$variant = _ref3.variant, variant = _ref3$variant === void 0 ? Variant$1.Default : _ref3$variant, palette = _ref3.theme.palette;
  return Ae(["position:absolute;display:flex;top:", "px;right:", "px;color:", ";&:hover{color:", ";}cursor:pointer;"], variant === Variant$1.WithIcon ? 2 : 8, variant === Variant$1.WithIcon ? 2 : 8, palette[Color.IconsSecondary], palette[Color.AccentPrimary]);
});
var ModalTitle$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$7, "root")
}).withConfig({
  componentId: "sc-l3tf49-4"
})(function(_ref4) {
  var _ref4$variant = _ref4.variant, variant = _ref4$variant === void 0 ? Variant$1.Default : _ref4$variant, _ref4$theme = _ref4.theme, palette = _ref4$theme.palette, borderRadius = _ref4$theme.shape.borderRadius;
  return Ae(["position:relative;color:", ";border-radius:", " ", " 0px 0px;", " ", " ", ""], palette[Color.TextPrimary], borderRadius[BorderRadiusSize.Md], borderRadius[BorderRadiusSize.Md], function() {
    var paddingY = variant === Variant$1.WithIcon ? 26 : 14;
    var paddingX = variant === Variant$1.WithIcon ? 12 : 14;
    var paddingLeft = 18;
    var paddingRight = variant === Variant$1.WithIcon ? paddingLeft : 40;
    return Ae(["padding:", "px ", "px ", "px ", "px;"], paddingY, paddingRight, paddingX, paddingLeft);
  }, variant === Variant$1.Default && Ae(["background:", ";border-bottom:1px solid ", ";"], palette[Color.BackgroundPrimary], palette[Color.BordersSecondary]), variant === Variant$1.WithIcon && Ae(["display:flex;align-items:center;flex-direction:column;"]));
});
var Styled$8 = applyDisplayNames({
  ModalTitle: ModalTitle$1,
  LabelPrimary,
  LabelSecondary,
  Close,
  Icon: Icon$1
});
var _excluded$n = ["secondary", "onClose", "primaryLabelStyles"];
var ModalTitle = intrinsicComponent$1(function(_ref, ref) {
  var secondary = _ref.secondary, onClose2 = _ref.onClose, primaryLabelStyles = _ref.primaryLabelStyles, rest = _objectWithoutProperties(_ref, _excluded$n);
  return /* @__PURE__ */ React.createElement(Styled$8.ModalTitle, _extends({}, rest, {
    ref
  }), rest.icon && /* @__PURE__ */ React.createElement(Styled$8.Icon, {
    iconShadow: Boolean(rest.iconShadow)
  }, rest.icon), /* @__PURE__ */ React.createElement(Styled$8.LabelPrimary, {
    variant: rest.variant,
    style: primaryLabelStyles
  }, rest.primary), rest.variant === Variant$1.WithIcon && secondary && /* @__PURE__ */ React.createElement(Styled$8.LabelSecondary, null, secondary), /* @__PURE__ */ React.createElement(Styled$8.Close, {
    variant: rest.variant
  }, /* @__PURE__ */ React.createElement(CrossButton, {
    size: "lg",
    onClick: onClose2
  })));
});
ModalTitle.defaultProps = {
  iconShadow: true,
  variant: Variant$1.Default
};
ModalTitle.propTypes = {
  primary: PropTypes.node.isRequired,
  secondary: PropTypes.node,
  icon: PropTypes.node,
  iconShadow: PropTypes.bool,
  onClose: PropTypes.func,
  primaryLabelStyles: PropTypes.object,
  variant: PropTypes.oneOf(objectValues(Variant$1))
};
ModalTitle.displayName = "ModalTitle";
var Status = {
  Success: "success",
  Info: "info",
  Error: "error",
  Warning: "warning"
};
var baseClassName$6 = "PopupStatus";
var PopupStatus$2 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$6, "root")
}).withConfig({
  componentId: "sc-qash56-0"
})(function() {
  return Ae(["display:flex;"]);
});
var Styled$7 = applyDisplayNames({
  PopupStatus: PopupStatus$2
});
var _excluded$m = ["status", "notificationBackground"];
var getPopupStatusIcon = function getPopupStatusIcon2(status, notificationBackground) {
  switch (status) {
    case Status.Warning:
      return notificationBackground ? /* @__PURE__ */ React.createElement(Warning, {
        color: lightPalette[Color.Warning],
        size: 20
      }) : /* @__PURE__ */ React.createElement(WarningOutline, {
        color: lightPalette[Color.Warning],
        size: 12
      });
    case Status.Error:
      return notificationBackground ? /* @__PURE__ */ React.createElement(Error$1, {
        color: lightPalette[Color.Error],
        size: 20
      }) : /* @__PURE__ */ React.createElement(ErrorOutline, {
        color: lightPalette[Color.Error],
        size: 12
      });
    case Status.Info:
      return notificationBackground ? /* @__PURE__ */ React.createElement(About, {
        color: lightPalette[Color.Info],
        size: 20
      }) : /* @__PURE__ */ React.createElement(InfoOutline, {
        color: lightPalette[Color.Info],
        size: 12
      });
    case Status.Success:
    default:
      return /* @__PURE__ */ React.createElement(Success, {
        color: lightPalette[Color.Success],
        size: 20
      });
  }
};
var PopupStatus$1 = intrinsicComponent$1(function(_ref, ref) {
  var status = _ref.status, _ref$notificationBack = _ref.notificationBackground, notificationBackground = _ref$notificationBack === void 0 ? true : _ref$notificationBack, rest = _objectWithoutProperties(_ref, _excluded$m);
  return /* @__PURE__ */ React.createElement(Styled$7.PopupStatus, _extends({
    status
  }, rest, {
    ref
  }), getPopupStatusIcon(status, notificationBackground));
});
var defaultProps$2 = {
  status: Status.Success
};
PopupStatus$1.defaultProps = defaultProps$2;
var propTypes$2 = {
  status: PropTypes.oneOf(objectValues(Status))
};
PopupStatus$1.propTypes = propTypes$2;
var popupContentMixin = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Status.Success, function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["background-color:", ";"], palette[Color.BackgroundGreen]);
}), Status.Info, function(_ref2) {
  var palette = _ref2.theme.palette;
  return Ae(["background-color:", ";"], palette[Color.BackgroundBlue]);
}), Status.Error, function(_ref3) {
  var palette = _ref3.theme.palette;
  return Ae(["background-color:", ";"], palette[Color.BackgroundRed]);
}), Status.Warning, function(_ref4) {
  var palette = _ref4.theme.palette;
  return Ae(["background-color:", ";"], palette[Color.BackgroundOrange]);
});
var baseClassName$5 = "PopupContent";
var LabelWrapper = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$5, "LabelWrapper")
}).withConfig({
  componentId: "sc-njbmnt-0"
})(function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["display:flex;flex-grow:1;margin-left:44px;margin-right:28px;padding:16px;padding-right:0;overflow:hidden;background:", ";"], palette[Color.ButtonPrimaryText]);
});
var Label3 = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$5, "Label")
}).withConfig({
  componentId: "sc-njbmnt-1"
})(function(_ref2) {
  var _ref2$theme = _ref2.theme, palette = _ref2$theme.palette, font = _ref2$theme.typography.font;
  return Ae(["max-width:100%;overflow:hidden;text-overflow:ellipsis;color:", ";", ""], palette[Color.TextPrimary], font[FontVariant.TextSmallUp]);
});
var PopupContent$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$5, "PopupContent")
}).withConfig({
  componentId: "sc-njbmnt-2"
})(function(_ref3) {
  var theme = _ref3.theme;
  return Ae(["position:relative;display:flex;align-items:center;width:360px;border-radius:4px;box-shadow:0px 2px 6px ", ";"], theme.palette[Color.LargeShadow]);
});
var CloseWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$5, "PopupContent")
}).withConfig({
  componentId: "sc-njbmnt-3"
})(function(_ref4) {
  var theme = _ref4.theme;
  return Ae(["position:absolute;top:0;right:0;display:flex;justify-content:center;align-items:flex-start;box-sizing:border-box;padding:2px;height:fit-content;cursor:pointer;background:", ";border-radius:0 4px 4px 0;height:100%;"], theme.palette[Color.BackgroundStateless]);
});
var PopupStatus = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$5, "PopupStatus")
}).withConfig({
  componentId: "sc-njbmnt-4"
})(function(_ref5) {
  var _ref5$status = _ref5.status, status = _ref5$status === void 0 ? "success" : _ref5$status;
  return Ae(["position:absolute;display:flex;left:0;z-index:1;height:100%;min-width:44px;align-items:center;justify-content:center;box-sizing:border-box;border-radius:4px 0 0 4px;", ""], popupContentMixin[status]);
});
var Styled$6 = applyDisplayNames({
  PopupContent: PopupContent$1,
  PopupStatus,
  LabelWrapper,
  CloseWrapper,
  Label: Label3
});
var _excluded$l = ["onClose", "message", "status"];
function ownKeys$Q(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$Q(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$Q(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$Q(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var PopupContent = intrinsicComponent$1(function(_ref, ref) {
  var onClose2 = _ref.onClose, message = _ref.message, status = _ref.status, rest = _objectWithoutProperties(_ref, _excluded$l);
  return /* @__PURE__ */ React.createElement(Styled$6.PopupContent, _extends({}, rest, {
    ref
  }), /* @__PURE__ */ React.createElement(Styled$6.PopupStatus, _extends({
    status,
    message
  }, rest), /* @__PURE__ */ React.createElement(PopupStatus$1, {
    status
  })), /* @__PURE__ */ React.createElement(Styled$6.LabelWrapper, null, /* @__PURE__ */ React.createElement(Styled$6.Label, null, message)), /* @__PURE__ */ React.createElement(Styled$6.CloseWrapper, null, /* @__PURE__ */ React.createElement(CrossButton, {
    size: "sm",
    onClick: onClose2
  })));
});
var defaultProps$1 = _objectSpread$Q({}, defaultProps$2);
PopupContent.defaultProps = defaultProps$1;
var propTypes$1 = _objectSpread$Q(_objectSpread$Q({}, propTypes$2), {}, {
  message: PropTypes.node.isRequired,
  onClose: PropTypes.func
});
PopupContent.propTypes = propTypes$1;
var Horizontal = {
  Center: "center",
  Left: "left",
  Right: "right"
};
var Vertical = {
  Top: "top",
  Bottom: "bottom"
};
var positionHorizontalMixin = _defineProperty(_defineProperty(_defineProperty({}, Horizontal.Left, Ae(["left:25px;right:auto;"])), Horizontal.Center, Ae(["left:50%;right:auto;transform:translateX(-50%);"])), Horizontal.Right, Ae(["left:auto;right:25px;"]));
var positionVerticalMixin = _defineProperty(_defineProperty({}, Vertical.Top, Ae(["top:25px;bottom:auto;"])), Vertical.Bottom, Ae(["top:auto;bottom:25px;"]));
var baseClassName$4 = "Popup";
var Popup$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$4, "root")
}).withConfig({
  componentId: "sc-jmtjri-0"
})(function(_ref) {
  var anchorOrigin = _ref.anchorOrigin;
  return Ae(["position:fixed;display:flex;align-items:center;justify-content:center;z-index:1400;", " ", ""], positionHorizontalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.horizontal) || Horizontal.Left], positionVerticalMixin[(anchorOrigin === null || anchorOrigin === void 0 ? void 0 : anchorOrigin.vertical) || Vertical.Bottom]);
});
var Styled$5 = applyDisplayNames({
  Popup: Popup$1
});
var _excluded$k = ["autoHideDuration", "anchorOrigin", "open", "onClose"];
function ownKeys$P(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$P(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$P(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$P(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Popup = intrinsicComponent$1(function(props, ref) {
  var autoHideDuration = props.autoHideDuration;
  props.anchorOrigin;
  var open = props.open, onClose2 = props.onClose, rest = _objectWithoutProperties(props, _excluded$k);
  var target = usePortal(generateClassNames("Popup"));
  var _useState = reactExports.useState(autoHideDuration), _useState2 = _slicedToArray(_useState, 2), hoverHideDuration = _useState2[0], setHoverHideDuration = _useState2[1];
  var _useState3 = reactExports.useState(false), _useState4 = _slicedToArray(_useState3, 2), isHovering = _useState4[0], setIsHovering = _useState4[1];
  var handleMouseLeave = function handleMouseLeave2() {
    setIsHovering(false);
    setHoverHideDuration(1e3);
  };
  reactExports.useEffect(function() {
    if (open) setHoverHideDuration(autoHideDuration);
  }, [open]);
  reactExports.useEffect(function() {
    var timeout2 = null;
    if (open && !isHovering && hoverHideDuration && typeof onClose2 === "function") {
      timeout2 = setTimeout(onClose2, hoverHideDuration);
    }
    return function() {
      if (timeout2) {
        clearTimeout(timeout2);
      }
    };
  }, [hoverHideDuration, isHovering, open, onClose2]);
  var render = function render2() {
    if (!open) {
      return null;
    }
    return /* @__PURE__ */ React.createElement(Styled$5.Popup, _extends({
      onMouseEnter: function onMouseEnter() {
        return setIsHovering(true);
      },
      onMouseLeave: handleMouseLeave
    }, props), /* @__PURE__ */ React.createElement(PopupContent, _extends({
      onClose: onClose2
    }, rest, {
      ref
    })));
  };
  return /* @__PURE__ */ reactDomExports.createPortal(render(), target);
});
Popup.defaultProps = _objectSpread$P(_objectSpread$P({}, defaultProps$1), {}, {
  open: false,
  autoHideDuration: 5e3,
  anchorOrigin: {
    vertical: Vertical.Bottom,
    horizontal: Horizontal.Left
  }
});
Popup.propTypes = _objectSpread$P(_objectSpread$P({}, propTypes$1), {}, {
  anchorOrigin: PropTypes.exact({
    vertical: PropTypes.oneOf(objectValues(Vertical)),
    horizontal: PropTypes.oneOf(objectValues(Horizontal))
  }),
  open: PropTypes.bool,
  autoHideDuration: PropTypes.number,
  onClose: PropTypes.func
});
var baseClassName$3 = "RotationSlider";
var RotationSliderList = /* @__PURE__ */ qe.ul.attrs({
  className: generateClassNames(baseClassName$3, "list")
}).withConfig({
  componentId: "sc-1xuruq0-0"
})(["display:flex;align-items:center;position:relative;padding:0;width:100%;list-style:none;"]);
var RotationSliderBigDot = /* @__PURE__ */ qe.li.attrs({
  className: generateClassNames(baseClassName$3, "big-dot")
}).withConfig({
  componentId: "sc-1xuruq0-1"
})(function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["width:8px;height:8px;border-radius:50%;background-color:", ";cursor:pointer;"], palette[Color.LinkPrimary]);
});
var RotationSliderSmallDotWrapper = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$3, "small-dot-wrapper")
}).withConfig({
  componentId: "sc-1xuruq0-2"
})(["padding:2px;"]);
var RotationSliderSmallDot = /* @__PURE__ */ qe.li.attrs({
  className: generateClassNames(baseClassName$3, "small-dot")
}).withConfig({
  componentId: "sc-1xuruq0-3"
})(function(_ref2) {
  var palette = _ref2.theme.palette;
  return Ae(["width:2px;height:2px;border-radius:50%;background-color:", ";cursor:pointer;"], palette[Color.LinkPrimary]);
});
var RotationSliderControl = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$3, "control")
}).withConfig({
  componentId: "sc-1xuruq0-4"
})(function(_ref3) {
  var palette = _ref3.theme.palette;
  return Ae(["display:flex;justify-content:center;align-items:center;position:absolute;height:18px;width:2px;transform:translate(-50%,-50%);top:50%;background-color:", ";& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"], palette[Color.LinkActive]);
});
var RotationSliderMark = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$3, "mark")
}).withConfig({
  componentId: "sc-1xuruq0-5"
})(["padding:4px;"]);
var RotationSliderMarkText = /* @__PURE__ */ qe.span.attrs({
  className: generateClassNames(baseClassName$3, "mark-text")
}).withConfig({
  componentId: "sc-1xuruq0-6"
})(function(_ref4) {
  var palette = _ref4.theme.palette;
  return Ae(["position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:", ";"], palette[Color.TextPrimary]);
});
var Styled$4 = applyDisplayNames({
  RotationSliderList,
  RotationSliderBigDot,
  RotationSliderSmallDotWrapper,
  RotationSliderSmallDot,
  RotationSliderControl,
  RotationSliderMark,
  RotationSliderMarkText
});
var _excluded$j = ["min", "max", "angle", "onChange", "onMouseDown", "onMouseUp", "step", "labelTooltipOptions", "annotation", "hideMarkText", "showCurrentMarkText", "value", "railProps", "trackProps", "thumbProps", "labelTooltipProps", "markStyles", "markTextStyles"];
function ownKeys$O(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$O(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$O(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$O(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var RotationSlider = intrinsicComponent$1(function(_ref, ref) {
  var _ref$min = _ref.min, min2 = _ref$min === void 0 ? 0 : _ref$min, _ref$max = _ref.max, max2 = _ref$max === void 0 ? 100 : _ref$max, _ref$angle = _ref.angle, angle = _ref$angle === void 0 ? 10 : _ref$angle, onChange2 = _ref.onChange;
  _ref.onMouseDown;
  _ref.onMouseUp;
  var _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step, _ref$labelTooltipOpti = _ref.labelTooltipOptions, labelTooltipOptions = _ref$labelTooltipOpti === void 0 ? LabelTooltip$1.Off : _ref$labelTooltipOpti, _ref$annotation = _ref.annotation, annotation = _ref$annotation === void 0 ? "°" : _ref$annotation, _ref$hideMarkText = _ref.hideMarkText, hideMarkText = _ref$hideMarkText === void 0 ? false : _ref$hideMarkText, _ref$showCurrentMarkT = _ref.showCurrentMarkText, showCurrentMarkText = _ref$showCurrentMarkT === void 0 ? false : _ref$showCurrentMarkT, value = _ref.value, _ref$railProps = _ref.railProps, railProps = _ref$railProps === void 0 ? {} : _ref$railProps, _ref$trackProps = _ref.trackProps, trackProps = _ref$trackProps === void 0 ? {} : _ref$trackProps, _ref$thumbProps = _ref.thumbProps, thumbProps = _ref$thumbProps === void 0 ? {} : _ref$thumbProps, _ref$labelTooltipProp = _ref.labelTooltipProps, labelTooltipProps = _ref$labelTooltipProp === void 0 ? {} : _ref$labelTooltipProp, _ref$markStyles = _ref.markStyles, markStyles = _ref$markStyles === void 0 ? {} : _ref$markStyles, _ref$markTextStyles = _ref.markTextStyles, markTextStyles = _ref$markTextStyles === void 0 ? {} : _ref$markTextStyles, rest = _objectWithoutProperties(_ref, _excluded$j);
  var handleChange = function handleChange2(event, newValue) {
    if (onChange2) {
      onChange2(event, newValue);
    }
  };
  var getValue = function getValue2() {
    if (value || value === 0) {
      if (value > max2) {
        return max2;
      }
      if (value < min2) {
        return min2;
      }
      return value;
    }
    return min2;
  };
  var showMarkText = function showMarkText2(index) {
    if (hideMarkText) return false;
    if (!showCurrentMarkText) return true;
    return getValue() === index;
  };
  var renderBar = function renderBar2() {
    var barDom = [];
    var barDiv;
    for (var i = min2; i <= max2; i += step) {
      barDiv = [];
      if (i % angle === 0 || i === max2) {
        barDiv = /* @__PURE__ */ React.createElement(Styled$4.RotationSliderMark, {
          key: i,
          style: _objectSpread$O({}, markStyles)
        }, showMarkText(i) && /* @__PURE__ */ React.createElement(Styled$4.RotationSliderMarkText, {
          style: _objectSpread$O({}, markTextStyles)
        }, i === min2 + 1 ? max2 : i, /* @__PURE__ */ React.createElement("sup", null, annotation)), /* @__PURE__ */ React.createElement(Styled$4.RotationSliderBigDot, null));
      } else if (i % 10 === 0) {
        barDiv = /* @__PURE__ */ React.createElement(Styled$4.RotationSliderSmallDotWrapper, {
          key: i
        }, /* @__PURE__ */ React.createElement(Styled$4.RotationSliderSmallDot, null));
      }
      if (!Array.isArray(barDiv)) {
        barDom.push(barDiv);
      }
    }
    return barDom;
  };
  return /* @__PURE__ */ React.createElement(Slider$1, _extends({
    min: min2,
    max: max2,
    step,
    value: getValue(),
    hideTrack: true,
    hideAnnotation: true,
    annotation,
    onChange: handleChange,
    labelTooltip: labelTooltipOptions,
    ref,
    components: {
      Rail: function Rail2(props, style2) {
        return /* @__PURE__ */ React.createElement(Styled$4.RotationSliderList, _extends({}, props, {
          styles: _objectSpread$O({}, style2)
        }), renderBar());
      },
      Thumb: Styled$4.RotationSliderControl
    },
    componentsProps: {
      rail: _objectSpread$O(_objectSpread$O({}, railProps), {}, {
        style: _objectSpread$O({}, railProps.style)
      }),
      track: _objectSpread$O(_objectSpread$O({}, trackProps), {}, {
        style: _objectSpread$O({}, trackProps.style)
      }),
      thumb: _objectSpread$O(_objectSpread$O({}, thumbProps), {}, {
        style: _objectSpread$O({
          top: "15%"
        }, thumbProps.style)
      }),
      labelTooltip: _objectSpread$O(_objectSpread$O({}, labelTooltipProps), {}, {
        style: _objectSpread$O({}, labelTooltipProps.style)
      })
    }
  }, rest, {
    defaultValue: Number(rest.defaultValue),
    style: _objectSpread$O({
      width: "auto",
      height: "auto"
    }, rest.style)
  }));
});
RotationSlider.defaultProps = {
  annotation: "°",
  min: 0,
  max: 100,
  step: 1,
  labelTooltipOptions: LabelTooltip$1.Off
};
RotationSlider.propTypes = {
  value: PropTypes.oneOfType([PropTypes.array, PropTypes.number]),
  min: PropTypes.number,
  max: PropTypes.number,
  angle: PropTypes.number,
  onChange: PropTypes.func,
  onMouseDown: PropTypes.func,
  onMouseUp: PropTypes.func,
  step: PropTypes.number,
  annotation: PropTypes.string,
  hideMarkText: PropTypes.bool,
  showCurrentMarkText: PropTypes.bool,
  railProps: PropTypes.object,
  trackProps: PropTypes.object,
  thumbProps: PropTypes.object,
  labelTooltipProps: PropTypes.object,
  markStyles: PropTypes.object,
  markTextStyles: PropTypes.object,
  labelTooltipOptions: PropTypes.oneOf(objectValues(LabelTooltip$1))
};
var baseClassName$2 = "SelectGroup";
var SelectGroup$1 = /* @__PURE__ */ qe(Styled$c.InputGroup).attrs({
  className: generateClassNames(baseClassName$2, "root")
}).withConfig({
  componentId: "sc-1uvutwe-0"
})([""]);
var Styled$3 = applyDisplayNames({
  SelectGroup: SelectGroup$1
});
var _excluded$i = ["children", "size", "error", "label", "placeholder", "hint", "LabelProps", "SelectProps", "selectProps", "scroll", "fullWidth", "showSelectionKey", "value", "multiple", "hideMenuItemsActions", "onChange", "readOnly", "disabled", "showClearIcon"];
function ownKeys$N(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$N(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$N(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$N(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var SelectGroup = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, size = _ref.size, error2 = _ref.error, label = _ref.label, placeholder = _ref.placeholder, hint = _ref.hint, LabelPropsData = _ref.LabelProps, SelectPropsData = _ref.SelectProps, selectProps = _ref.selectProps, _ref$scroll = _ref.scroll, scroll = _ref$scroll === void 0 ? true : _ref$scroll, fullWidth = _ref.fullWidth, showSelectionKey = _ref.showSelectionKey, value = _ref.value, multiple = _ref.multiple, hideMenuItemsActions = _ref.hideMenuItemsActions, onChange2 = _ref.onChange, readOnly = _ref.readOnly, disabled = _ref.disabled, showClearIcon = _ref.showClearIcon, rest = _objectWithoutProperties(_ref, _excluded$i);
  var renderLabel = function renderLabel2() {
    if (label) {
      if (typeof label === "function") {
        return label({
          error: error2
        });
      }
      if (_typeof(label) === "object") {
        return label;
      }
      return /* @__PURE__ */ React.createElement(Label$5, _extends({
        error: error2
      }, LabelPropsData || {}), label);
    }
    return null;
  };
  var renderHint = function renderHint2() {
    if (hint) {
      if (typeof hint === "function") {
        return hint({
          error: error2
        });
      }
      if (_typeof(hint) === "object") {
        return hint;
      }
      return /* @__PURE__ */ React.createElement(FormHint, {
        error: error2
      }, hint);
    }
    return null;
  };
  return /* @__PURE__ */ React.createElement(Styled$3.SelectGroup, _extends({}, rest, {
    ref
  }), renderLabel(), /* @__PURE__ */ React.createElement(Select$1, _extends({
    error: error2,
    value,
    size,
    scroll,
    onChange: onChange2,
    multiple,
    fullWidth: Boolean(fullWidth)
  }, SelectPropsData || {}, {
    selectProps,
    readOnly,
    disabled,
    placeholder,
    showSelectionKey,
    hideMenuItemsActions,
    showClearIcon
  }), children), renderHint());
});
SelectGroup.defaultProps = {
  error: false,
  fullWidth: false,
  readOnly: false,
  disabled: false,
  scroll: true,
  hideMenuItemsActions: false
};
propTypes$5.size;
var restSelectPropTypes = _objectWithoutProperties(propTypes$5, ["size"]);
SelectGroup.propTypes = _objectSpread$N(_objectSpread$N({}, restSelectPropTypes), {}, {
  // Extends from SelectProps: multiple, error, children, value, onChange
  fullWidth: PropTypes.bool,
  size: PropTypes.oneOf(objectValues(InputSize)),
  label: PropTypes.node,
  hint: PropTypes.node,
  LabelProps: PropTypes.exact(propTypes$9),
  SelectProps: PropTypes.exact(propTypes$5),
  selectProps: PropTypes.object,
  readOnly: PropTypes.bool,
  scroll: PropTypes.bool,
  showSelectionKey: PropTypes.bool,
  disabled: PropTypes.bool
});
var baseClassName$1 = "Backdrop";
var Backdrop$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName$1, "root")
}).withConfig({
  componentId: "sc-txa5a-0"
})(function(_ref) {
  var palette = _ref.theme.palette;
  return Ae(["position:fixed;display:flex;align-items:center;justify-content:center;inset:0px;background-color:", ";transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:1;z-index:-1;"], palette[Color.Extra_0_3_Overlay]);
});
var Styled$2 = applyDisplayNames({
  Backdrop: Backdrop$1
});
var Backdrop = intrinsicComponent$1(function(_ref, ref) {
  var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
  return /* @__PURE__ */ React.createElement(Styled$2.Backdrop, _extends({}, rest, {
    ref
  }));
});
Backdrop.defaultProps = {};
Backdrop.propTypes = {};
var baseClassName = "Drawer";
var TemporaryDrawer = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "temporary")
}).withConfig({
  componentId: "sc-1riasfx-0"
})(function(_ref) {
  var open = _ref.open;
  return Ae(["position:absolute;inset:0px;z-index:1200;visibility:", ";"], !open && "hidden");
});
var PersistentDrawer = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "persistent")
}).withConfig({
  componentId: "sc-1riasfx-1"
})([""]);
var Drawer$1 = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "root")
}).withConfig({
  componentId: "sc-1riasfx-2"
})(function(_ref2) {
  var open = _ref2.open, isCollapsed = _ref2.isCollapsed, _ref2$top = _ref2.top, top2 = _ref2$top === void 0 ? 0 : _ref2$top, _ref2$theme = _ref2.theme, palette = _ref2$theme.palette, shadows2 = _ref2$theme.shadows, breakpoints = _ref2$theme.breakpoints;
  return Ae(["display:flex;flex-direction:column;flex:1 0 auto;background-color:", ";box-shadow:", ";overflow-y:overlay;overflow-x:hidden;transform:", ";visibility:", ";transition:200ms;height:calc(100% - ", "px);", "{margin-top:0px;height:100%;}", " &{margin-top:0px;height:100%;}box-sizing:border-box;width:", ";", ""], palette[Color.BackgroundStateless], shadows2[Shadows.LeftPanelMd], open ? "none" : "translateX(-100%)", !open && "hidden", top2, breakpoints.down("md"), breakpoints.classes.sm, isCollapsed ? "68px" : "302px", scrollBar);
});
var Header = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "header")
}).withConfig({
  componentId: "sc-1riasfx-3"
})(function(_ref3) {
  var isCollapsed = _ref3.isCollapsed;
  return Ae(["display:", ";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;margin-top:12px;transition:background-color 100ms ease-out;"], isCollapsed ? "none" : "flex");
});
var Body = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "body")
}).withConfig({
  componentId: "sc-1riasfx-4"
})(["flex:1 1 auto;.SfxAccordionDetails-root{margin:0;}"]);
var Footer = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "footer")
}).withConfig({
  componentId: "sc-1riasfx-5"
})(function(_ref4) {
  var isCollapsed = _ref4.isCollapsed;
  return Ae(["display:flex;flex-direction:column;width:100%;padding:", ";"], isCollapsed ? "0px" : "0px 8px");
});
var List = /* @__PURE__ */ qe.ul.attrs({
  className: generateClassNames(baseClassName, "list")
}).withConfig({
  componentId: "sc-1riasfx-6"
})(function() {
  return Ae(["list-style:none;margin:12px 0;padding:0;position:relative;"]);
});
var Item = /* @__PURE__ */ qe.li.attrs({
  className: generateClassNames(baseClassName, "item")
}).withConfig({
  componentId: "sc-1riasfx-7"
})(function(_ref5) {
  var palette = _ref5.theme.palette, isCollapsed = _ref5.isCollapsed, selected = _ref5.selected;
  return Ae(["display:", ";justify-content:flex-start;align-items:center;position:relative;text-decoration:none;width:100%;box-sizing:border-box;text-align:left;padding:13px 16px;transition:background-color 100ms ease-out;margin-bottom:4px;cursor:pointer;&:hover{background-color:", ";& > *{color:", ";}}", ""], isCollapsed ? "none" : "flex", palette[Color.BackgroundActive], palette[Color.AccentStateless], selected && Ae(["background-color:", ";& > *{color:", " !important;}"], palette[Color.BackgroundActive], palette[Color.AccentStateless]));
});
var ItemText = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "text")
}).withConfig({
  componentId: "sc-1riasfx-8"
})(function(_ref6) {
  var _ref6$theme = _ref6.theme, palette = _ref6$theme.palette, font = _ref6$theme.typography.font, fontKey = _ref6.font, isCollapsed = _ref6.isCollapsed;
  return Ae(["flex:1 1 auto;color:", ";", ";transition:color 100ms ease-out;display:", ";user-select:none;"], palette[Color.TextPrimary], font[fontKey || FontVariant.LabelLarge], isCollapsed && "none");
});
var Icon = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "icon")
}).withConfig({
  componentId: "sc-1riasfx-9"
})(function(_ref7) {
  var palette = _ref7.theme.palette, isCollapsed = _ref7.isCollapsed;
  return Ae(["display:flex;flex-shrink:0;color:", ";margin-right:", ";transition:color 100ms ease-out;"], palette[Color.IconsPrimary], isCollapsed ? "0px" : "12px");
});
var ItemButton = /* @__PURE__ */ qe.div.attrs({
  className: generateClassNames(baseClassName, "item-button")
}).withConfig({
  componentId: "sc-1riasfx-10"
})(function(_ref8) {
  var palette = _ref8.theme.palette, isCollapsed = _ref8.isCollapsed, selected = _ref8.selected;
  return Ae(["display:flex;justify-content:", ";align-items:center;border-radius:4px;box-sizing:border-box;text-align:left;padding:", ";width:", ";margin-bottom:8px;margin:", ";transition:background-color 150ms cubic-bezier(0.4,0,0.2,1) 0ms;cursor:pointer;&:hover{background-color:", ";& > *{color:", ";}}", ""], isCollapsed ? "center" : "flex-start", isCollapsed ? "12px 0px" : "13px 16px", isCollapsed && "56px", isCollapsed && "8px auto", palette[Color.BackgroundActive], palette[Color.AccentStateless], selected && Ae(["background-color:", ";& > *{color:", ";}"], palette[Color.BackgroundActive], palette[Color.AccentStateless]));
});
var CollapsedButton = /* @__PURE__ */ qe(ItemButton).attrs({
  className: generateClassNames(baseClassName, "item-button")
}).withConfig({
  componentId: "sc-1riasfx-11"
})(function(_ref9) {
  var isCollapsed = _ref9.isCollapsed;
  return Ae(["", ""], !isCollapsed && Ae(["padding:13px 16px;"]));
});
var DrawerAccordion = /* @__PURE__ */ qe(Accordion).attrs({
  className: generateClassNames(baseClassName, "accordion")
}).withConfig({
  componentId: "sc-1riasfx-12"
})(function(_ref10) {
  var _ref10$theme = _ref10.theme, palette = _ref10$theme.palette, font = _ref10$theme.typography.font, selected = _ref10.selected;
  return Ae(["", "{padding:13px 16px;transition:background-color 100ms ease-out;", "{", ";color:", ";}&:hover{background-color:", ";& > *{color:", ";}}", "}", "{padding:0px 16px;}"], Styled$r.Header, Styled$r.Label, font[FontVariant.LabelLargeEmphasis], palette[Color.TextPrimary], palette[Color.BackgroundActive], palette[Color.AccentStateless], selected && Ae(["", "{color:", ";}"], Styled$r.Label, palette[Color.AccentStateless]), Styled$q.AccordionDetails);
});
var Styled$1 = applyDisplayNames({
  TemporaryDrawer,
  PersistentDrawer,
  Drawer: Drawer$1,
  Header,
  Body,
  Footer,
  List,
  Item,
  ItemButton,
  Icon,
  ItemText,
  DrawerAccordion,
  CollapsedButton
});
var DrawerContext = /* @__PURE__ */ reactExports.createContext({
  isCollapsed: false,
  size: 20
});
var _excluded$h = ["children", "font"];
var DrawerItemText = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, font = _ref.font, rest = _objectWithoutProperties(_ref, _excluded$h);
  var _useContext = reactExports.useContext(DrawerContext), isCollapsed = _useContext.isCollapsed;
  return /* @__PURE__ */ React.createElement(Styled$1.ItemText, _extends({
    font,
    isCollapsed
  }, rest, {
    ref
  }), children);
});
DrawerItemText.defaultProps = {};
DrawerItemText.propTypes = {
  font: PropTypes.oneOf(objectValues(FontVariant))
};
var _excluded$g = ["children", "size"];
var DrawerItemIcon = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, iconSize = _ref.size, rest = _objectWithoutProperties(_ref, _excluded$g);
  var _useContext = reactExports.useContext(DrawerContext), isCollapsed = _useContext.isCollapsed, size = _useContext.size;
  return /* @__PURE__ */ React.createElement(Styled$1.Icon, _extends({}, rest, {
    isCollapsed,
    ref
  }), children && typeof children === "function" ? children({
    size: size || iconSize
  }) : children);
});
DrawerItemIcon.defaultProps = {
  size: 20
};
DrawerItemIcon.propTypes = {
  size: PropTypes.number,
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
};
var Variant = {
  Auto: "auto",
  Temporary: "temporary",
  Persistent: "persistent"
};
var _excluded$f = ["children", "open", "iconsSize", "collapsed", "top", "hideBackdrop", "disablePortal", "collapseButtonLabel", "persistentDrawerStyles", "temproryDrawerStyles", "variant", "onClose", "onCollapse", "onCollapseClick"];
function ownKeys$M(e2, r2) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e2);
    r2 && (o = o.filter(function(r3) {
      return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
    })), t2.push.apply(t2, o);
  }
  return t2;
}
function _objectSpread$M(e2) {
  for (var r2 = 1; r2 < arguments.length; r2++) {
    var t2 = null != arguments[r2] ? arguments[r2] : {};
    r2 % 2 ? ownKeys$M(Object(t2), true).forEach(function(r3) {
      _defineProperty(e2, r3, t2[r3]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$M(Object(t2)).forEach(function(r3) {
      Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
    });
  }
  return e2;
}
var Drawer = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, open = _ref.open, _ref$iconsSize = _ref.iconsSize, iconsSize = _ref$iconsSize === void 0 ? 20 : _ref$iconsSize, _ref$collapsed = _ref.collapsed, collapsed = _ref$collapsed === void 0 ? false : _ref$collapsed, top2 = _ref.top, hideBackdrop = _ref.hideBackdrop, disablePortal = _ref.disablePortal, _ref$collapseButtonLa = _ref.collapseButtonLabel, collapseButtonLabel = _ref$collapseButtonLa === void 0 ? "Collapse menu" : _ref$collapseButtonLa, _ref$persistentDrawer = _ref.persistentDrawerStyles, persistentDrawerStyles = _ref$persistentDrawer === void 0 ? {} : _ref$persistentDrawer, _ref$temproryDrawerSt = _ref.temproryDrawerStyles, temproryDrawerStyles = _ref$temproryDrawerSt === void 0 ? {} : _ref$temproryDrawerSt, _ref$variant = _ref.variant, variant = _ref$variant === void 0 ? Variant.Auto : _ref$variant, onClose2 = _ref.onClose, onCollapse = _ref.onCollapse, onCollapseClick = _ref.onCollapseClick, rest = _objectWithoutProperties(_ref, _excluded$f);
  var theme = useTheme();
  var matchDownXl = useMediaQuery(theme.breakpoints.down("xl"));
  var _useState = reactExports.useState(collapsed), _useState2 = _slicedToArray(_useState, 2), isCollapsed = _useState2[0], setIsCollapsed = _useState2[1];
  var temproryDrawerRef = reactExports.useRef(null);
  var DrawerIconsSize = reactExports.useMemo(function() {
    return iconsSize;
  }, [iconsSize]);
  var target = document.querySelector("body");
  reactExports.useEffect(function() {
    setIsCollapsed(collapsed);
  }, [collapsed]);
  reactExports.useEffect(function() {
    if (onCollapse) {
      onCollapse(isCollapsed);
    }
  }, [isCollapsed]);
  var handleCollapse = function handleCollapse2() {
    var newCollpaseState = !isCollapsed;
    setIsCollapsed(newCollpaseState);
    if (onCollapseClick) {
      onCollapseClick(newCollpaseState);
    }
  };
  var handleClose = function handleClose2() {
    if (typeof onClose2 === "function") {
      onClose2();
    }
  };
  var keyListener = function keyListener2(ev) {
    var isTemporaryDrawer = false;
    if (temproryDrawerRef !== null && temproryDrawerRef !== void 0 && temproryDrawerRef.current) {
      var _temproryDrawerRef$cu;
      isTemporaryDrawer = (temproryDrawerRef === null || temproryDrawerRef === void 0 || (_temproryDrawerRef$cu = temproryDrawerRef.current) === null || _temproryDrawerRef$cu === void 0 ? void 0 : _temproryDrawerRef$cu.offsetWidth) > 0;
    }
    if (ev.key === "Escape" && isTemporaryDrawer) {
      handleClose();
    }
  };
  reactExports.useEffect(function() {
    document.addEventListener("keydown", keyListener);
    return function() {
      return document.removeEventListener("keydown", keyListener);
    };
  }, []);
  var renderDrawer = function renderDrawer2(showCollapsedButton) {
    return /* @__PURE__ */ React.createElement(Styled$1.Drawer, _extends({
      open,
      top: top2
    }, rest, {
      isCollapsed: showCollapsedButton ? isCollapsed : false,
      ref
    }), children, showCollapsedButton && /* @__PURE__ */ React.createElement(Styled$1.CollapsedButton, {
      onClick: handleCollapse,
      isCollapsed
    }, /* @__PURE__ */ React.createElement(DrawerItemIcon, null, isCollapsed ? function(props) {
      return /* @__PURE__ */ React.createElement(ArrowSidebarRightOutline, _extends({}, props, {
        size: iconsSize
      }));
    } : function(props) {
      return /* @__PURE__ */ React.createElement(ArrowSidebarLeftOutline, _extends({}, props, {
        size: iconsSize
      }));
    }), /* @__PURE__ */ React.createElement(DrawerItemText, null, collapseButtonLabel)));
  };
  var renderBackdrop = function renderBackdrop2() {
    return !hideBackdrop && open ? /* @__PURE__ */ React.createElement(Backdrop, {
      onClick: onClose2
    }) : null;
  };
  var temporaryDrawer = function temporaryDrawer2() {
    return disablePortal ? /* @__PURE__ */ React.createElement(Styled$1.TemporaryDrawer, {
      ref: temproryDrawerRef,
      style: _objectSpread$M({}, temproryDrawerStyles),
      open
    }, renderBackdrop(), renderDrawer(false)) : /* @__PURE__ */ reactDomExports.createPortal(/* @__PURE__ */ React.createElement(Styled$1.TemporaryDrawer, {
      ref: temproryDrawerRef,
      style: _objectSpread$M({}, temproryDrawerStyles),
      open
    }, renderBackdrop(), renderDrawer(false)), target);
  };
  var persistentDrawer = function persistentDrawer2() {
    return /* @__PURE__ */ React.createElement(Styled$1.PersistentDrawer, {
      style: _objectSpread$M({}, persistentDrawerStyles)
    }, renderDrawer(true));
  };
  var getDrawerVariant = function getDrawerVariant2() {
    switch (variant) {
      case Variant.Auto:
        return matchDownXl ? temporaryDrawer() : persistentDrawer();
      case Variant.Temporary:
        return temporaryDrawer();
      case Variant.Persistent:
        return persistentDrawer();
      default:
        return matchDownXl ? temporaryDrawer() : persistentDrawer();
    }
  };
  return /* @__PURE__ */ React.createElement(DrawerContext.Provider, {
    value: {
      isCollapsed: !matchDownXl ? isCollapsed : false,
      size: DrawerIconsSize
    }
  }, getDrawerVariant());
});
var defaultProps = {
  open: false,
  hideBackdrop: false,
  iconsSize: 20,
  variant: Variant.Auto
};
Drawer.defaultProps = defaultProps;
var propTypes = {
  onClose: PropTypes.func.isRequired,
  onCollapse: PropTypes.func,
  onCollapseClick: PropTypes.func,
  children: PropTypes.node.isRequired,
  top: PropTypes.number,
  iconsSize: PropTypes.number,
  open: PropTypes.bool,
  hideBackdrop: PropTypes.bool,
  collapsed: PropTypes.bool,
  disablePortal: PropTypes.bool,
  collapseButtonLabel: PropTypes.string,
  persistentDrawerStyles: PropTypes.object,
  temproryDrawerStyles: PropTypes.object,
  variant: PropTypes.oneOf(objectValues(Variant))
};
Drawer.propTypes = propTypes;
var _excluded$e = ["children"];
var DrawerHeader = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$e);
  var _useContext = reactExports.useContext(DrawerContext), isCollapsed = _useContext.isCollapsed;
  return /* @__PURE__ */ React.createElement(Styled$1.Header, _extends({}, rest, {
    isCollapsed,
    ref
  }), children);
});
DrawerHeader.defaultProps = {};
DrawerHeader.propTypes = {};
var _excluded$d = ["children"];
var DrawerBody = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$d);
  return /* @__PURE__ */ React.createElement(Styled$1.Body, _extends({}, rest, {
    ref
  }), children);
});
DrawerBody.defaultProps = {};
DrawerBody.propTypes = {};
var _excluded$c = ["children"];
var DrawerList = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, rest = _objectWithoutProperties(_ref, _excluded$c);
  return /* @__PURE__ */ React.createElement(Styled$1.List, _extends({}, rest, {
    ref
  }), children);
});
DrawerList.defaultProps = {};
DrawerList.propTypes = {};
var _excluded$b = ["children", "selected"];
var DrawerItem = intrinsicComponent$1(function(_ref, ref) {
  var children = _ref.children, selected = _ref.selected, rest = _objectWithoutProperties(_ref, _excluded$b);
  var _useContext = reactExports.useContext(DrawerContext), isCollapsed = _useContext.isCollapsed;
  return /* @__PURE__ */ React.createElement(Styled$1.Item, _extends({
    selected,
    isCollapsed
  }, rest, {
    ref
  }), children);
});
DrawerItem.defaultProps = {
  selected: false
};
DrawerItem.propTypes = {
  selected: PropTypes.bool
};
var StyledHSVOptions = qe.div.withConfig({ componentId: "sc-1rfxjvn-0" })(["display:flex;width:100%;justify-content:space-between;gap:10px;.SfxSlider-root{min-width:100px;}", ""], function(a) {
  var b2 = a.isPhoneScreen;
  return b2 && "\n      flex-direction: column;\n\n      .SfxSlider-root {\n        min-width: 230px;\n      }\n    ";
}), StyledSliderContainer = qe.div.withConfig({ componentId: "sc-1rfxjvn-1" })(["display:flex;flex-direction:column;"]), StyledSliderLabel = qe(Label$5).withConfig({ componentId: "sc-1rfxjvn-2" })(["", ";"], function(a) {
  var b2 = a.theme;
  return b2.typography.font[FontVariant.LabelExtraSmallUp];
}), StyledSliderWrapper = qe.div.withConfig({ componentId: "sc-1rfxjvn-3" })(["display:flex;align-items:center;"]), StyledSliderInput = qe(Input$1).withConfig({ componentId: "sc-1rfxjvn-4" })(["display:inline-block;width:40px;height:28px;padding:6px 2px;margin-left:10px;border:none;.SfxInput-Base{text-align:center;width:100%;min-width:100%;max-width:100%;}"]);
var MIN_VALUE$6 = -1, DEFAULT_VALUE$4 = { brightness: 0 }, MAX_VALUE$7 = 1, sliderStyle$5 = { width: 150, padding: 0, margin: 0 }, BrightnessOptions = function(a) {
  var b2, c2, d2 = a.t, e2 = useFinetune(Konva$1.Filters.Brighten, DEFAULT_VALUE$4), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = function(a2) {
    h2({ brightness: restrictNumber(a2, MIN_VALUE$6, MAX_VALUE$7) });
  };
  return React.createElement(StyledSliderContainer, { className: "FIE_brightness-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_brightness-option-label" }, d2("brightness")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_brightness-option", min: MIN_VALUE$6, step: 0.05, max: MAX_VALUE$7, width: "124px", value: null !== (b2 = g2.brightness) && void 0 !== b2 ? b2 : DEFAULT_VALUE$4.brightness, onChange: i, style: sliderStyle$5 }), React.createElement(StyledSliderInput, { value: null !== (c2 = g2.brightness) && void 0 !== c2 ? c2 : DEFAULT_VALUE$4.brightness, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return i(b3);
  } })));
};
var getZoomFitFactor = function(a, b2) {
  return Math.min(a.width / b2.width, a.height / b2.height) || DEFAULT_ZOOM_FACTOR;
};
var DEFAULT_CROP_PRESETS = [{ titleKey: "custom", ratio: CUSTOM_CROP, icon: Custom, hide: function hide2() {
  var a = 0 < arguments.length && arguments[0] !== void 0 ? arguments[0] : {}, b2 = a.lockCropAreaAt;
  return b2;
} }, { titleKey: "original", ratio: ORIGINAL_CROP, icon: ImageOutline }, { titleKey: "landscape", descriptionKey: "16:9", ratio: toPrecisedFloat(16 / 9), icon: Landscape }, { titleKey: "portrait", descriptionKey: "9:16", ratio: toPrecisedFloat(9 / 16), icon: Portrait }, { titleKey: "ellipse", ratio: ELLIPSE_CROP, icon: Ellipse3 }];
var StyledToolsBarItemButtonWrapper = qe.div.withConfig({ componentId: "sc-ldar2z-0" })(["display:flex;"]), StyledOpenMenuButton = qe(Button).withConfig({ componentId: "sc-ldar2z-1" })(["margin:0 0 0 6px;padding:0;"]), StyledMenuItemIcon = qe.div.withConfig({ componentId: "sc-ldar2z-2" })(["svg,span{vertical-align:middle;}"]), StyledRatioDescription = qe(Label$5).withConfig({ componentId: "sc-ldar2z-3" })(["cursor:pointer;", ""], function(a) {
  var b2 = a.theme.typography;
  return b2.font[FontVariant.InputSm];
}), StyledMenu$1 = qe.div.withConfig({ componentId: "sc-ldar2z-4" })(["min-width:270px;border-radius:4px;overflow:hidden;background-color:", ";"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BackgroundStateless];
}), StyledMenuItem$1 = qe(MenuItem).withConfig({ componentId: "sc-ldar2z-5" })(["display:flex;gap:10px;justify-content:flex-start;align-items:center;border-radius:4px;padding:8px 16px;", " ", ""], function(a) {
  var b2 = a.isAccordion;
  return b2 && "padding-left: 22px;";
}, function(a) {
  var b2 = a.isListItem;
  return b2 && "padding: 0;";
}), StyledMenuItemLabel = qe(Label$5).withConfig({ componentId: "sc-ldar2z-6" })(function(a) {
  var b2 = a.theme;
  return Ae(["color:", ";", ";"], b2.palette[Color.TextPrimary], b2.typography.font[FontVariant.InputMd]);
}), StyledAccordion = qe(Accordion).withConfig({ componentId: "sc-ldar2z-7" })(function(a) {
  var b2 = a.theme;
  return Ae([".SfxAccordionHeader-icon{padding-left:0;}.SfxAccordionHeader-label{", ";color:", ";}.SfxAccordionHeader-root{display:flex;flex-direction:row-reverse;width:fit-content;gap:10px;}"], b2.typography.font[FontVariant.LabelMediumEmphasis], b2.palette[Color.TextPrimary]);
});
var CropPresetItem = function(a) {
  var b2 = a.titleKey, c2 = a.description, d2 = a.ratio, f2 = a.onClick, g2 = a.Icon, h2 = a.isActive, i = a.isAccordion, j2 = a.theme, k2 = a.width, l2 = a.height, m2 = a.t, n2 = a.disableManualResize, o = a.noEffect;
  return React.createElement(StyledMenuItem$1, { active: h2, onClick: function handleOnClick(a2) {
    return f2(a2, d2, { ratioTitleKey: b2, width: k2, height: l2, disableManualResize: n2, noEffect: o });
  }, isAccordion: i }, g2 && React.createElement(StyledMenuItemIcon, null, "string" == typeof g2 ? React.createElement("span", { dangerouslySetInnerHTML: { __html: g2 } }) : React.createElement(g2, { color: j2.palette["icon-primary"] })), React.createElement(StyledMenuItemLabel, null, m2(b2)), c2 && React.createElement(StyledRatioDescription, null, c2));
};
CropPresetItem.defaultProps = { Icon: void 0, width: void 0, height: void 0, disableManualResize: false, isAccordion: false, noEffect: false };
function ownKeys$L(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$L(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$L(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$L(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CropPresetGroup = function(a) {
  var b2 = a.groupTitleKey, c2 = a.items, d2 = a.onItemSelect, e2 = a.t, f2 = a.isExpanded, g2 = a.setExpandedGroup, h2 = useStore(), i = h2.adjustments.crop, j2 = i.ratio, k2 = i.ratioGroupKey, l2 = i.ratioTitleKey, m2 = h2.theme, n2 = function(a2, c3, e3) {
    d2(a2, c3, _objectSpread$L(_objectSpread$L({}, e3), {}, { ratioGroupKey: b2 }));
  };
  return React.createElement(StyledAccordion, { label: e2(b2), onChange: function toggleExpand() {
    g2(f2 ? null : b2);
  }, expanded: f2 }, c2.map(function(a2) {
    var c3 = a2.titleKey, d3 = a2.ratio, f3 = a2.width, g3 = a2.height, h3 = a2.descriptionKey, i2 = a2.icon, o = a2.disableManualResize, p2 = a2.noEffect, q2 = null !== d3 && void 0 !== d3 ? d3 : toPrecisedFloat(f3 / g3);
    return React.createElement(CropPresetItem, { key: c3, titleKey: c3, t: e2, description: e2(h3), size: "sm", onClick: n2, width: f3, height: g3, ratio: q2, Icon: i2, theme: m2, isAccordion: true, disableManualResize: o, isActive: j2 === q2 && l2 === c3 && k2 === b2, noEffect: p2 });
  }));
};
function ownKeys$K(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$K(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$K(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$K(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CropPresetGroupsFolder = function(a) {
  var b2 = a.titleKey, c2 = a.Icon, d2 = a.theme, e2 = a.groups, f2 = a.onItemSelect, g2 = a.t, h2 = useStore(), i = h2.adjustments.crop, j2 = i.ratioFolderKey, k2 = i.ratioGroupKey, l2 = reactExports.useState(""), m2 = _slicedToArray(l2, 2), n2 = m2[0], o = m2[1], p2 = function(a2, c3, d3) {
    f2(a2, c3, _objectSpread$K(_objectSpread$K({}, d3), {}, { ratioFolderKey: b2 }));
  };
  return React.createElement(StyledMenuItem$1, { isListItem: true, list: [{ content: g2(b2), key: b2, active: b2 === j2, prefix: c2 && React.createElement(StyledMenuItemIcon, null, "string" == typeof c2 ? React.createElement("span", { dangerouslySetInnerHTML: { __html: c2 } }) : React.createElement(c2, { color: d2.palette["icon-primary"] })), subList: e2.map(function(a2) {
    var b3 = a2.titleKey, c3 = a2.items;
    return { content: React.createElement(CropPresetGroup, { groupTitleKey: b3, setExpandedGroup: o, isExpanded: "" === n2 ? k2 === b3 : n2 === b3, t: g2, items: c3, onItemSelect: p2 }), key: b3, disableHover: true };
  }), subMenuProps: { style: { backgroundColor: d2.palette[Color.BackgroundStateless] } } }] });
};
CropPresetGroupsFolder.defaultProps = { Icon: void 0 };
var CropPresetsOption = function(a) {
  var b2 = a.anchorEl, c2 = a.onClose, d2 = useStore(), f2 = d2.dispatch, g2 = d2.t, e2 = d2.adjustments, h2 = void 0 === e2 ? {} : e2, i = h2.crop, j2 = void 0 === i ? {} : i, k2 = j2.ratio, l2 = j2.ratioTitleKey, m2 = j2.ratioFolderKey, n2 = d2.shownImageDimensions, o = d2.config, p2 = d2.theme, q2 = o[TOOLS_IDS.CROP], r2 = usePhoneScreen(), s = reactExports.useMemo(function() {
    var a2 = q2.presetsItems, b3 = void 0 === a2 ? [] : a2, c3 = q2.presetsFolders, d3 = void 0 === c3 ? [] : c3, e3 = q2.lockCropAreaAt, f3 = e3 ? DEFAULT_CROP_PRESETS.filter(function(a3) {
      var b4;
      return !(null !== (b4 = a3.hide) && void 0 !== b4 && b4.call(a3, { lockCropAreaAt: e3 }));
    }) : DEFAULT_CROP_PRESETS;
    return [].concat(_toConsumableArray(d3), _toConsumableArray(f3), _toConsumableArray(b3));
  }, [q2]), t2 = function(a2, b3, d3) {
    a2.stopPropagation();
    var e3 = { ratio: b3, ratioTitleKey: d3.ratioTitleKey, ratioGroupKey: d3.ratioGroupKey, ratioFolderKey: d3.ratioFolderKey, noEffect: d3.noEffect };
    f2({ type: SET_CROP, payload: e3 }), q2.autoResize && (f2({ type: SET_RESIZE, payload: { width: d3.width, height: d3.height, manualChangeDisabled: d3.disableManualResize } }), f2({ type: ZOOM_CANVAS, payload: { factor: d3.width > n2.width || d3.height > n2.height ? getZoomFitFactor(n2, d3) : DEFAULT_ZOOM_FACTOR } })), c2();
  };
  return React.createElement(React.Fragment, null, React.createElement(StyledToolsBarItemButtonWrapper, null, React.createElement(StyledToolsBarItemButtonLabel, { className: "FIE_crop-tool-label FIE_selected-crop-preset-label", isPhoneScreen: r2 }, g2(l2 || "cropTool")), React.createElement(StyledOpenMenuButton, { className: "FIE_crop-presets-opener-button", color: "link-secondary", size: "lg" }, b2 ? React.createElement(MoveUpOutline, { size: 10 }) : React.createElement(MoveDownOutline, { size: 10 }))), React.createElement(Menu$1, { className: "FIE_crop-presets-menu", anchorEl: b2, enableOverlay: true, onClose: c2, open: !!b2, position: "top", popperOptions: { modifiers: [{ name: "offset", options: { offset: [0, 4] } }] }, maxHeight: "100%" }, React.createElement(StyledMenu$1, null, s.map(function renderPreset(a2) {
    var b3 = a2.titleKey, c3 = a2.descriptionKey, d3 = a2.ratio, e3 = a2.width, f3 = a2.height, h3 = a2.groups, i2 = a2.icon, j3 = a2.disableManualResize, l3 = a2.noEffect;
    return h3 ? React.createElement(CropPresetGroupsFolder, { key: b3, titleKey: b3, groups: h3, Icon: i2, theme: p2, onItemSelect: t2, t: g2, disableManualResize: j3 }) : React.createElement(CropPresetItem, { key: d3, ratio: null !== d3 && void 0 !== d3 ? d3 : toPrecisedFloat(e3 / f3), titleKey: b3, t: g2, description: g2(c3), Icon: i2, isActive: (k2 || ORIGINAL_CROP) === (null !== d3 && void 0 !== d3 ? d3 : toPrecisedFloat(e3 / f3)) && !m2, theme: p2, width: e3, height: f3, onClick: t2, disableManualResize: j3, noEffect: l3 });
  }))));
};
CropPresetsOption.defaultProps = { anchorEl: null };
var Crop = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = useStore(), e2 = d2.config, f2 = d2.t, g2 = reactExports.useState(), h2 = _slicedToArray(g2, 2), i = h2[0], j2 = h2[1];
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_crop-tool", id: TOOLS_IDS.CROP, Icon: Crop$1, onClick: function selectToolAndShowPresets(a2, c3) {
    b2(a2), j2(c3.currentTarget);
  }, isSelected: c2 }, e2[TOOLS_IDS.CROP].noPresets ? React.createElement(StyledToolsBarItemButtonLabel, { className: "FIE_crop-tool-label" }, f2("cropTool")) : React.createElement(CropPresetsOption, { anchorEl: i, onClose: function closeCropPresets() {
    j2(null);
  } }));
};
Crop.defaultProps = { isSelected: false };
var xFlipReverseSideStyle$1 = { transform: "scaleX(-1)" }, FlipX = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t, e2 = useStore(), f2 = e2.dispatch, g2 = e2.adjustments.isFlippedX, h2 = usePhoneScreen(320), i = reactExports.useMemo(function() {
    return { reverseLabelOfCurrXFlipDir: g2 ? d2("unFlipX") : d2("flipX"), reverseIconOfCurrXFlipDir: function() {
      return React.createElement(FlipX$1, { size: h2 ? 20 : 16, style: g2 ? xFlipReverseSideStyle$1 : void 0 });
    } };
  }, [g2]), j2 = i.reverseLabelOfCurrXFlipDir, k2 = i.reverseIconOfCurrXFlipDir, l2 = reactExports.useCallback(function() {
    f2({ type: TOGGLE_FLIP, payload: { direction: FLIP_DIRECTIONS.X } });
  }, []), m2 = reactExports.useCallback(function(a2) {
    b2(a2), l2();
  }, []);
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_flip-x-tool-button", id: TOOLS_IDS.FLIP_X, label: j2, Icon: k2, onClick: m2, isSelected: c2 });
};
FlipX.defaultProps = { isSelected: false };
var xFlipReverseSideStyle = { transform: "scaleY(-1)" }, FlipY = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t, e2 = useStore(), f2 = e2.dispatch, g2 = e2.adjustments.isFlippedY, h2 = usePhoneScreen(320), i = reactExports.useMemo(function() {
    return { reverseLabelOfCurrXFlipDir: g2 ? d2("unFlipY") : d2("flipY"), reverseIconOfCurrXFlipDir: function() {
      return React.createElement(FlipY$1, { size: h2 ? 20 : 16, style: g2 ? xFlipReverseSideStyle : void 0 });
    } };
  }, [g2]), j2 = i.reverseLabelOfCurrXFlipDir, k2 = i.reverseIconOfCurrXFlipDir, l2 = reactExports.useCallback(function() {
    f2({ type: TOGGLE_FLIP, payload: { direction: FLIP_DIRECTIONS.Y } });
  }, []), m2 = reactExports.useCallback(function(a2) {
    b2(a2), l2();
  }, []);
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_flip-y-tool-button", id: TOOLS_IDS.FLIP_Y, label: j2, Icon: k2, onClick: m2, isSelected: c2 });
};
FlipY.defaultProps = { isSelected: false };
var RotateButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_rotate-tool-button", id: TOOLS_IDS.ROTATE, label: d2("rotateTool"), Icon: RotationLeft, onClick: b2, isSelected: c2 });
};
RotateButton.defaultProps = { isSelected: false };
var StyledRotationOptions = qe.div.withConfig({ componentId: "sc-wbx58r-0" })(["display:flex;align-items:center;gap:16px;"]), StyledRotationSlider = qe(RotationSlider).withConfig({ componentId: "sc-wbx58r-1" })([".SfxRotationSlider-control{width:1px;height:10px;background-color:", ";&:before{box-shadow:unset;}}.SfxRotationSlider-mark,.SfxRotationSlider-small-dot-wrapper{padding:0;.SfxRotationSlider-mark-text{top:10px;}.SfxRotationSlider-big-dot{width:4px;height:4px;}.SfxRotationSlider-small-dot{width:1px;height:1px;}}.SfxRotationSlider-list{gap:4px;}"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.IconsSecondary];
}), StyledRotateButton = qe(IconButton).withConfig({ componentId: "sc-wbx58r-2" })([""]);
var RotateOptions = function() {
  var a = useStore(), b2 = a.dispatch, c2 = a.adjustments.rotation, d2 = void 0 === c2 ? 0 : c2, e2 = a.resize, f2 = void 0 === e2 ? {} : e2, g2 = a.config, h2 = g2[TOOLS_IDS.ROTATE], i = usePhoneScreen(), j2 = useDebouncedCallback(function(a2, c3) {
    var d3 = restrictNumber(c3, -180, 180);
    if (b2({ type: CHANGE_ROTATION, payload: { rotation: d3 } }), f2.width && f2.height) {
      var e3 = getSizeAfterRotation(f2.width, f2.height, d3);
      b2({ type: SET_RESIZE, payload: { width: e3.width, height: e3.height } });
    }
  }, 20);
  return "buttons" === h2.componentType ? React.createElement(React.Fragment, null, React.createElement(ToolsBarItemButton$1, { className: "FIE_rotate_button_left", id: TOOLS_IDS.IMAGE, label: "-".concat(h2.angle, "°"), Icon: RotationLeft$1, onClick: function changeRotationButtonNegative(a2) {
    var b3 = d2 - h2.angle;
    j2(a2, b3);
  } }), React.createElement(ToolsBarItemButton$1, { className: "FIE_rotate_button_right", id: TOOLS_IDS.IMAGE, label: "+".concat(h2.angle, "°"), Icon: RotationRight, onClick: function changeRotationButtonPositive(a2) {
    var b3 = d2 + h2.angle;
    j2(a2, b3);
  } })) : React.createElement(StyledRotationOptions, null, React.createElement(StyledRotationSlider, { className: "FIE_rotate-slider", showCurrentMarkText: true, min: -180, max: 180, step: i ? h2.angle / 3 : 1, value: d2, angle: h2.angle || 90, onChange: j2 }), React.createElement(StyledRotateButton, { size: "sm", color: "basic", onClick: function onClick(a2) {
    return j2(a2, d2 + 90);
  } }, React.createElement(Rotate90, { width: 15 })));
};
var Contrast = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_contrast-tool-button", id: TOOLS_IDS.CONTRAST, label: d2("contrastTool"), Icon: Contrast$1, onClick: b2, isSelected: c2 });
};
Contrast.defaultProps = { isSelected: false };
var MIN_VALUE$5 = -100, DEFAULT_VALUE$3 = { contrast: 0 }, MAX_VALUE$6 = 100, sliderStyle$4 = { width: 150, padding: 0, margin: 0 }, ContrastOptions = function(a) {
  var b2, c2, d2 = a.t, e2 = useFinetune(Konva$1.Filters.Contrast, DEFAULT_VALUE$3), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = function(a2) {
    h2({ contrast: restrictNumber(a2, MIN_VALUE$5, MAX_VALUE$6) });
  };
  return React.createElement(StyledSliderContainer, { className: "FIE_contrast-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_contrast-option-label" }, d2("contrastTool")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_contrast-option", min: MIN_VALUE$5, max: MAX_VALUE$6, width: "124px", value: null !== (b2 = g2.contrast) && void 0 !== b2 ? b2 : DEFAULT_VALUE$3.contrast, onChange: i, style: sliderStyle$4 }), React.createElement(StyledSliderInput, { value: null !== (c2 = g2.contrast) && void 0 !== c2 ? c2 : DEFAULT_VALUE$3.contrast, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return i(b3);
  } })));
};
var HSV = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_hsv-tool-button", id: TOOLS_IDS.HSV, label: d2("hsvTool"), Icon: Saturation, onClick: b2, isSelected: c2 });
};
HSV.defaultProps = { isSelected: false };
var DEFAULT_VALUE$2 = { hue: 0, saturation: 0, value: 0 }, MAX_VALUE$5 = { hue: 259, saturation: 10, value: 2 }, sliderStyle$3 = { padding: 0, margin: 0 }, isPhoneScreen = usePhoneScreen(), HSVOptions = function(a) {
  var b2, c2, d2, e2, f2, g2, h2 = a.t, i = useFinetune(Konva$1.Filters.HSV, DEFAULT_VALUE$2), j2 = _slicedToArray(i, 2), k2 = j2[0], l2 = j2[1], m2 = function(a2, b3) {
    l2(_defineProperty({}, a2, b3 > MAX_VALUE$5[a2] ? MAX_VALUE$5[a2] : +b3));
  };
  return React.createElement(StyledHSVOptions, { isPhoneScreen }, React.createElement(StyledSliderContainer, { className: "FIE_hue-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_hue-option-label" }, h2("hue")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_hue-option", min: 0, step: 1, max: 259, value: null !== (b2 = k2.hue) && void 0 !== b2 ? b2 : DEFAULT_VALUE$2.hue, onChange: function onChange2(a2) {
    return m2("hue", a2);
  }, style: sliderStyle$3 }), React.createElement(StyledSliderInput, { value: null !== (c2 = k2.hue) && void 0 !== c2 ? c2 : DEFAULT_VALUE$2.hue, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return m2("hue", b3);
  } }))), React.createElement(StyledSliderContainer, { className: "FIE_saturation-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_saturation-option-label" }, h2("saturation")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_saturation-option", min: -2, step: 0.5, max: 10, value: null !== (d2 = k2.saturation) && void 0 !== d2 ? d2 : DEFAULT_VALUE$2.saturation, onChange: function onChange2(a2) {
    return m2("saturation", a2);
  }, style: sliderStyle$3 }), React.createElement(StyledSliderInput, { value: null !== (e2 = k2.saturation) && void 0 !== e2 ? e2 : DEFAULT_VALUE$2.saturation, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return m2("saturation", b3);
  } }))), React.createElement(StyledSliderContainer, { className: "FIE_value-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_value-option-label" }, h2("value")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_value-option", min: -2, step: 0.1, max: 2, value: null !== (f2 = k2.value) && void 0 !== f2 ? f2 : DEFAULT_VALUE$2.value, onChange: function onChange2(a2) {
    return m2("value", a2);
  }, style: sliderStyle$3 }), React.createElement(StyledSliderInput, { value: null !== (g2 = k2.value) && void 0 !== g2 ? g2 : DEFAULT_VALUE$2.value, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return m2("value", b3);
  } }))));
};
var Blur3 = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_blur-tool-button", id: TOOLS_IDS.BLUR, label: d2("blurTool"), Icon: Blur$1, onClick: b2, isSelected: c2 });
};
Blur3.defaultProps = { isSelected: false };
var MIN_VALUE$4 = 0, DEFAULT_VALUE$1 = { blurRadius: 0 }, MAX_VALUE$4 = 100, sliderStyle$2 = { width: 150, padding: 0, margin: 0 }, BlurOptions = function(a) {
  var b2, c2, d2 = a.t, e2 = useFinetune(Konva$1.Filters.Blur, DEFAULT_VALUE$1), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = function(a2) {
    h2({ blurRadius: restrictNumber(a2, MIN_VALUE$4, MAX_VALUE$4) });
  };
  return React.createElement(StyledSliderContainer, { className: "FIE_blur-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_blur-option-label" }, d2("blur")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_blur-option", min: MIN_VALUE$4, max: MAX_VALUE$4, width: "124px", value: null !== (b2 = g2.blurRadius) && void 0 !== b2 ? b2 : DEFAULT_VALUE$1.blurRadius, onChange: i, style: sliderStyle$2 }), React.createElement(StyledSliderInput, { value: null !== (c2 = g2.blurRadius) && void 0 !== c2 ? c2 : DEFAULT_VALUE$1.blurRadius, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return i(b3);
  } })));
};
var Warmth = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_warmth-tool-button", id: TOOLS_IDS.WARMTH, label: d2("warmthTool"), Icon: Temprature, onClick: b2, isSelected: c2 });
};
Warmth.defaultProps = { isSelected: false };
var MIN_VALUE$3 = 0, DEFAULT_VALUE = { warmth: 0 }, MAX_VALUE$3 = 200, sliderStyle$1 = { width: 150, padding: 0, margin: 0 }, WarmthOptions = function(a) {
  var b2, c2, d2 = a.t, e2 = useFinetune(Warmth$1, DEFAULT_VALUE), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = function(a2) {
    h2({ warmth: restrictNumber(a2, MIN_VALUE$3, MAX_VALUE$3) });
  };
  return React.createElement(StyledSliderContainer, { className: "FIE_warmth-option-wrapper" }, React.createElement(StyledSliderLabel, { className: "FIE_warmth-option-label" }, d2("warmthTool")), React.createElement(StyledSliderWrapper, null, React.createElement(Slider, { className: "FIE_warmth-option", min: MIN_VALUE$3, max: MAX_VALUE$3, width: "124px", value: null !== (b2 = g2.warmth) && void 0 !== b2 ? b2 : DEFAULT_VALUE.warmth, onChange: i, style: sliderStyle$1 }), React.createElement(StyledSliderInput, { value: null !== (c2 = g2.warmth) && void 0 !== c2 ? c2 : DEFAULT_VALUE.warmth, onChange: function onChange2(a2) {
    var b3 = a2.target.value;
    return i(b3);
  } })));
};
var StyledCarouselWrapper = qe.div.withConfig({ componentId: "sc-1nr0bka-0" })(["max-width:680px;min-width:150px;position:relative;overflow:hidden;touch-action:pan-y pinch-zoom;"]), StyledCarousel = qe.ul.withConfig({ componentId: "sc-1nr0bka-1" })(["padding:0;margin:0;white-space:nowrap;overflow:hidden;"]), StyledCarouselItem = qe.li.withConfig({ componentId: "sc-1nr0bka-2" })(["padding:4px;display:inline-block;list-style-type:none;user-select:none;"]), arrowsCommonStyles = Ae(["position:absolute;top:0;height:100%;width:60px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1;svg{color:", ";}"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.IconsSecondary];
}), StyledPrevArrowWrapper = qe.div.withConfig({ componentId: "sc-1nr0bka-3" })(["", " left:0;justify-content:flex-start;background:linear-gradient( 90deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );"], arrowsCommonStyles), StyledNextArrowWrapper = qe.div.withConfig({ componentId: "sc-1nr0bka-4" })(["", " right:0;justify-content:flex-end;background:linear-gradient( 270deg,#ffffff 1.56%,rgba(255,255,255,0.89) 52.4%,rgba(255,255,255,0.532165) 76.04%,rgba(255,255,255,0) 100% );"], arrowsCommonStyles);
var Carousel = function(a) {
  var b2 = a.children, c2 = a.style, d2 = a.className, f2 = reactExports.useRef(false), g2 = reactExports.useRef(), h2 = useResizeObserver(), i = _slicedToArray(h2, 1), j2 = i[0], k2 = reactExports.useState(false), l2 = _slicedToArray(k2, 2), m2 = l2[0], n2 = l2[1], o = reactExports.useState(false), p2 = _slicedToArray(o, 2), q2 = p2[0], r2 = p2[1], s = reactExports.Children.toArray(b2), t2 = function() {
    if (g2.current) {
      var a2 = g2.current, b3 = a2.scrollWidth, c3 = a2.offsetWidth, d3 = a2.scrollLeft, e2 = Math.round(b3 - c3), f3 = Math.round(e2 - d3);
      n2(0 < d3), r2(0 < f3);
    }
  }, u2 = function(a2, b3) {
    var c3 = a2.findIndex(function(a3) {
      return a3.classList.contains("FIE_carousel-item");
    });
    -1 !== c3 && (a2[c3].scrollIntoView({ inline: b3, behavior: "smooth", block: "nearest" }), setTimeout(function() {
      t2();
    }, 500));
  }, v2 = function(a2) {
    if (f2.current) {
      var b3, c3 = ((null === (b3 = a2.touches) || void 0 === b3 ? void 0 : b3[0]) || a2).pageX;
      g2.current.scrollBy(f2.current - c3, 0), f2.current = c3, debounce$1(t2, 30)();
    }
  }, w2 = function() {
    f2.current = null, document.removeEventListener("mousemove", v2), document.removeEventListener("mouseup", w2), document.removeEventListener("touchmove", v2), document.removeEventListener("touchcancel", w2), document.removeEventListener("touchend", w2);
  }, x2 = function(a2) {
    var b3;
    f2.current = ((null === (b3 = a2.touches) || void 0 === b3 ? void 0 : b3[0]) || a2).pageX, document.addEventListener("mousemove", v2), document.addEventListener("mouseup", w2), document.addEventListener("touchmove", v2), document.addEventListener("touchcancel", w2), document.addEventListener("touchend", w2);
  };
  return reactExports.useEffect(function() {
    g2.current && j2(g2.current, t2);
  }, []), React.createElement(StyledCarouselWrapper, { className: "".concat(d2, "-wrapper"), style: c2, onMouseDown: x2, onTouchStart: x2 }, m2 && React.createElement(StyledPrevArrowWrapper, { className: "FIE_carousel-prev-button", onClick: function scrollToPrev(a2) {
    var b3 = getScrollOffset(), c3 = b3.topOffset, d3 = b3.leftOffset, e2 = document.elementsFromPoint(a2.pageX + a2.currentTarget.offsetWidth - d3, a2.pageY - c3);
    u2(e2, "end");
  } }, React.createElement(ArrowLeftOutline, null)), React.createElement(StyledCarousel, { className: "".concat(d2, "-items"), ref: g2 }, s.map(function(a2) {
    return React.createElement(StyledCarouselItem, { className: "".concat(d2, "-item-wrapper FIE_carousel-item"), key: a2.key }, a2);
  })), q2 && React.createElement(StyledNextArrowWrapper, { className: "FIE_carousel-next-button", onClick: function scrollToNext(a2) {
    var b3 = getScrollOffset(), c3 = b3.topOffset, d3 = b3.leftOffset, e2 = document.elementsFromPoint(a2.pageX - a2.currentTarget.offsetWidth - d3, a2.pageY - c3);
    u2(e2, "start");
  } }, React.createElement(ArrowRightOutline, null)));
};
Carousel.defaultProps = { style: null };
var StyledFilterItem = qe.div.withConfig({ componentId: "sc-oxugzy-0" })(["display:inline-flex;flex-direction:column;align-items:center;justify-content:center;padding:0px 2px;gap:6px;cursor:pointer;border-radius:2px;canvas{border-radius:2px;}"]), FilterItemPreview = qe(Stage$1).withConfig({ componentId: "sc-oxugzy-1" })(["[aria-selected='true'] &{padding:1px;border:1px solid ", ";border-radius:2px;}"], function(a) {
  var b2 = a.theme;
  return b2.palette["accent-primary-active"];
}), FilterItemLabel = qe(Label$5).withConfig({ componentId: "sc-oxugzy-2" })(function(a) {
  var b2 = a.theme;
  return Ae(["color:", ";", ";[aria-selected='true'] &{color:", ";}"], b2.palette[Color.TextPrimary], b2.typography.font[FontVariant.LabelExtraSmallUp], b2.palette["accent-primary-active"]);
});
var MAX_FILTER_PREVIEW_WIDTH = 60, MAX_FILTER_PREVIEW_HEIGHT = 45, FilterItem = function(a) {
  var b2 = a.filterLabel, c2 = a.filterFn, d2 = a.applyFilter, e2 = a.isActive, f2 = a.image, g2 = reactExports.useRef(), h2 = reactExports.useCallback(function() {
    d2(c2);
  }, [c2]), i = reactExports.useCallback(function() {
    g2.current ? g2.current.cache() : setTimeout(i, 0);
  }, []);
  reactExports.useEffect(function() {
    return f2 && i(), function() {
      var a2;
      null === (a2 = g2.current) || void 0 === a2 || a2.clearCache();
    };
  }, [f2]);
  var j2 = f2.width / f2.height, k2 = 1 > j2, l2 = k2 ? MAX_FILTER_PREVIEW_WIDTH : MAX_FILTER_PREVIEW_HEIGHT * j2, m2 = k2 ? MAX_FILTER_PREVIEW_WIDTH / j2 : MAX_FILTER_PREVIEW_HEIGHT;
  return React.createElement(StyledFilterItem, { className: "FIE_filters-item", onClick: h2, "aria-selected": e2 }, React.createElement(FilterItemPreview, { className: "FIE_filters-item-preview", width: MAX_FILTER_PREVIEW_WIDTH, height: MAX_FILTER_PREVIEW_HEIGHT }, React.createElement(Layer$2, { onTap: h2 }, React.createElement(Image$3, { image: f2, filters: c2 ? [c2] : [], width: l2, height: m2, x: -(l2 - MAX_FILTER_PREVIEW_WIDTH) / 2, y: -(m2 - MAX_FILTER_PREVIEW_HEIGHT) / 2, ref: g2 }))), React.createElement(FilterItemLabel, { className: "FIE_filters-item-label" }, b2));
};
FilterItem.defaultProps = { filterFn: void 0 };
const FilterItem$1 = reactExports.memo(FilterItem);
var konvaFilters = Konva$1.Filters;
var AVAILABLE_FILTERS = [{ label: "Original", filterFn: null }, { label: "Invert", filterFn: konvaFilters.Invert }, { label: "Black & White", filterFn: BlackAndWhite }, { label: "Sepia", filterFn: konvaFilters.Sepia }, { label: "Solarize", filterFn: konvaFilters.Solarize }, { label: "Clarendon", filterFn: Clarendon }, { label: "Gingham", filterFn: Gingham }, { label: "Moon", filterFn: Moon }, { label: "Lark", filterFn: Lark }, { label: "Reyes", filterFn: Reyes }, { label: "Juno", filterFn: Juno }, { label: "Slumber", filterFn: Slumber }, { label: "Crema", filterFn: Crema }, { label: "Ludwig", filterFn: Ludwig }, { label: "Aden", filterFn: Aden }, { label: "Perpetua", filterFn: Perpetua }, { label: "Amaro", filterFn: Amaro }, { label: "Mayfair", filterFn: Mayfair }, { label: "Rise", filterFn: Rise }, { label: "Hudson", filterFn: Hudson }, { label: "Valencia", filterFn: Valencia }, { label: "X-Pro II", filterFn: XPro2 }, { label: "Sierra", filterFn: Sierra }, { label: "Willow", filterFn: Willow }, { label: "Lo-Fi", filterFn: LoFi }, { label: "Inkwell", filterFn: konvaFilters.Grayscale }, { label: "Hefe", filterFn: Hefe }, { label: "Nashville", filterFn: Nashville }, { label: "Stinson", filterFn: Stinson }, { label: "Vesper", filterFn: Vesper }, { label: "Earlybird", filterFn: Earlybird }, { label: "Brannan", filterFn: Brannan }, { label: "Sutro", filterFn: Sutro }, { label: "Toaster", filterFn: Toaster }, { label: "Walden", filterFn: Walden }, { label: "1977", filterFn: NinteenSeventySeven }, { label: "Kelvin", filterFn: Kelvin }, { label: "Maven", filterFn: Maven }, { label: "Ginza", filterFn: Ginza }, { label: "Skyline", filterFn: Skyline }, { label: "Dogpatch", filterFn: Dogpatch }, { label: "Brooklyn", filterFn: Brooklyn }, { label: "Helena", filterFn: Helena }, { label: "Ashby", filterFn: Ashby }, { label: "Charmes", filterFn: Charmes }];
var style$1 = { maxWidth: "100%", width: "100%" }, Filters = function() {
  var a = useStore(), b2 = a.originalImage, c2 = useFilter(), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(Carousel, { className: "FIE_filters", style: style$1 }, AVAILABLE_FILTERS.map(function(a2) {
    return React.createElement(FilterItem$1, { key: a2.label, filterLabel: a2.label, filterFn: a2.filterFn, applyFilter: f2, isActive: e2 === a2.filterFn, image: b2 });
  }));
};
var TextButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_text-tool-button", id: TOOLS_IDS.TEXT, label: d2("textTool"), Icon: Text3, onClick: b2, isSelected: c2 });
};
TextButton.defaultProps = { isSelected: false };
var StyledOptions = qe.div.withConfig({ componentId: "sc-qvjmv1-0" })(["display:flex;align-items:center;justify-content:center;padding:8px 16px;margin-top:4px;gap:8px;flex-wrap:wrap;", " svg{color:", ";}"], function(a) {
  var b2 = a.isPhoneScreen;
  return b2 && "\n    max-width: 315px;\n    padding: 0;\n  ";
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.IconsPrimary];
}), StyledOptionsWrapper = qe.div.withConfig({ componentId: "sc-qvjmv1-1" })(["display:flex;flex-wrap:wrap;margin-left:-4px;gap:4px;.FIE_annotation-option-triggerer{padding:6px;}"]), StyledOptionPopupContent = qe.div.withConfig({ componentId: "sc-qvjmv1-2" })(["background:", ";border-radius:4px;display:flex;flex-direction:column;padding:8px 12px;overflow:visible;", " ", " *{font-family:'Roboto',sans-serif;}"], function(a) {
  var b2 = a.theme;
  return b2.palette["bg-secondary"];
}, function(a) {
  var b2 = a.position;
  return b2 && "\n    display: grid;\n    grid-template-columns: repeat(4, auto);\n    padding: 0;\n    margin-top: 8px;\n    box-shadow: 0px 1px 2px ".concat(function(a2) {
    var b3 = a2.theme;
    return b3.palette["light-shadow"];
  }, ";\n    ");
}, function(a) {
  var b2 = a.disablePadding;
  return b2 && "\n      padding: 0;\n    ";
}), StyledSpacedOptionFields = qe.div.withConfig({ componentId: "sc-qvjmv1-3" })(["display:flex;align-items:center;gap:12px;", ""], function(a) {
  var b2 = a.preventFlex;
  return b2 && "\n      display: block;\n\n      label {\n        margin-bottom: 8px;\n      }\n  ";
}), StyledTwoColumnsContainer = qe.div.withConfig({ componentId: "sc-qvjmv1-4" })(["display:flex;align-items:center;justify-content:space-between;"]), StyledColumn = qe.div.withConfig({ componentId: "sc-qvjmv1-5" })(["&:not(:first-child){margin-left:12px;}"]), StyledIconWrapper = qe.div.withConfig({ componentId: "sc-qvjmv1-6" })(function(a) {
  var b2 = a.theme, c2 = a.addThinBorder, d2 = a.secondaryIconColor, e2 = a.active, f2 = a.watermarkTool;
  return "\n    cursor: pointer;\n    padding: ".concat(f2 ? "6px" : "8px 12px", ";\n    border-radius: 2px;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    gap: 6px;\n\n    svg {\n      vertical-align: middle;\n      margin: 0 auto;\n    }\n\n    ").concat(c2 ? "border: 0.5px solid ".concat(b2.palette["borders-secondary"], ";\n        padding: 8px 8px;") : "", ";\n    color: ").concat(d2 ? b2.palette[Color.IconsSecondary] : "", ";\n\n    ").concat(e2 && "\n      border-radius: 4px;\n      border-color: ".concat(b2.palette[Color.AccentStateless], ";\n      background-color: ").concat(b2.palette[Color.BackgroundActive], ";\n\n        * {\n          color: ").concat(b2.palette[Color.AccentStateless], ";\n        }\n      "), "\n\n    :hover {\n      background: ").concat(b2.palette["bg-primary-active"], ";\n    }\n  ");
}), StyledIconLabel = qe(Label$5).withConfig({ componentId: "sc-qvjmv1-7" })(["color:", ";"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.TextPrimary];
});
var MIN_PERCENTANGE$1 = 0, MAX_PERCENTANGE$1 = 1, OpacityField = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = a.t, e2 = b2.opacity, f2 = Math.round(100 * e2);
  return React.createElement(StyledOptionPopupContent, { disablePadding: true }, React.createElement(Label$5, null, d2("transparency")), React.createElement(StyledSpacedOptionFields, null, React.createElement(Slider, { annotation: "%", onChange: function changeOpacity(a2) {
    c2({ opacity: restrictNumber(a2 / 100, MIN_PERCENTANGE$1, MAX_PERCENTANGE$1) });
  }, value: f2, noMargin: true }), React.createElement(StyledIconLabel, null, "".concat(f2, "%"))));
};
var ColorPickerModal$1 = qe(Modal$1).withConfig({ componentId: "sc-7tf41j-0" })(["max-width:350px;"]), ColorPickerWrap = qe.div.withConfig({ componentId: "sc-7tf41j-1" })([".SfxColorPicker-root{max-width:100%;padding:0;box-shadow:none;border:none;", "}.SfxColorPicker-action{display:flex;gap:12px;.SfxColorPicker-select{width:100px;}.SfxInput-root{width:190px !important;}}.SfxColorPicker-icon{color:", ";}.SfxColorPicker-range-picker,.SfxColorPicker-bar-wrapper{width:100%;}"], function(a) {
  var b2 = a.hideModalTitle;
  return b2 && "padding-top: 12px;";
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.IconsPrimary];
}), ModalActions = qe(ModalActions$1).withConfig({ componentId: "sc-7tf41j-2" })(["gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}"]), Styled = { ColorPickerModal: ColorPickerModal$1, ColorPickerWrap, ModalActions };
var modalStyles = { zIndex: 1301 }, ColorPickerModal = function(a) {
  var b2 = a.hideModalTitle, c2 = a.defaultColor, d2 = void 0 === c2 ? "" : c2, e2 = a.onChange, f2 = a.open, g2 = a.pinnedColors, h2 = a.onClose, i = a.onApply, j2 = useStore(), k2 = j2.t;
  return f2 ? React.createElement(Styled.ColorPickerModal, { onClose: h2, open: f2, fullWidth: true, modalStyles }, !b2 && React.createElement(ModalTitle, { onClose: h2, primary: k2("colorPickerModalTitleLabel", "Pick color"), icon: React.createElement(ColorPicker$1, { size: 29 }), iconShadow: true, variant: "with-icon" }), React.createElement(ModalContent, null, React.createElement(Styled.ColorPickerWrap, { hideModalTitle: b2 }, React.createElement(ColorPicker, { onChange: e2, pinnedColors: g2, defaultColor: d2, showTransparentColor: true }))), React.createElement(Styled.ModalActions, null, React.createElement(Button, { color: "basic", onClick: h2 }, k2("cancel")), React.createElement(Button, { color: "primary", onClick: i }, k2("apply")))) : null;
};
ColorPickerModal.defaultProps = { defaultColor: "", pinnedColors: [], onChange: function onChange() {
}, open: false, hideModalTitle: false, onClose: function onClose() {
}, onApply: function onApply() {
} };
var StyledPickerTrigger = qe.div.attrs(function(a) {
  var b2 = a.$color;
  return { style: { background: "rgba(0,0,0,0)" === b2 ? "repeating-conic-gradient(#5d6d7e 0% 25%, transparent 0% 50%) 50% / 8px 8px" : b2 } };
}).withConfig({ componentId: "sc-zmv0gj-0" })(["background:", ";border-radius:4px;width:32px;height:32px;border:1px solid ", ";cursor:pointer;box-sizing:border-box;"], function(a) {
  var b2 = a.theme;
  return b2.palette["icons-primary"];
}, function(a) {
  var b2 = a.theme;
  return b2.palette[Color.BorderPrimaryStateless];
});
var pinnedColorsKey = "FIE_pinnedColors", ColorInput = function(a) {
  var b2, c2 = a.onChange, d2 = a.color, e2 = a.colorFor, f2 = useStore(), g2 = f2.selectionsIds, h2 = void 0 === g2 ? [] : g2, i = f2.config.annotationsCommon, j2 = void 0 === i ? {} : i, k2 = f2.dispatch, l2 = f2.latestColors, m2 = void 0 === l2 ? {} : l2, n2 = m2[e2], o = reactExports.useState(), p2 = _slicedToArray(o, 2), q2 = p2[0], r2 = p2[1], s = reactExports.useState(function() {
    return n2 || d2 || j2.fill;
  }), t2 = _slicedToArray(s, 2), u2 = t2[0], v2 = t2[1], w2 = reactExports.useState(null !== (b2 = window) && void 0 !== b2 && b2.localStorage ? JSON.parse(localStorage.getItem(pinnedColorsKey) || "[]") : []), x2 = _slicedToArray(w2, 2), y2 = x2[0], z2 = x2[1], A2 = reactExports.useRef(u2), B2 = function(a2) {
    var b3;
    if (null !== (b3 = window) && void 0 !== b3 && b3.localStorage) {
      var c3 = window.localStorage.getItem(pinnedColorsKey);
      if (JSON.stringify(a2) !== c3) {
        var d3 = a2.slice(-9);
        window.localStorage.setItem(pinnedColorsKey, JSON.stringify(d3)), z2(d3);
      }
    }
  }, C2 = function(a2) {
    r2(q2 ? null : a2.currentTarget);
  };
  return reactExports.useEffect(function() {
    var a2 = 0 === h2.length && n2 || d2;
    v2(a2), c2(a2);
  }, [d2, h2]), React.createElement(React.Fragment, null, React.createElement(StyledPickerTrigger, { className: "FIE_color-picker-triggerer", onClick: C2, $color: u2, onChange: c2 }), React.createElement(ColorPickerModal, { hideModalTitle: true, onChange: function changeColor(a2, b3, d3) {
    v2(b3), c2(b3), B2(d3), n2 !== b3 && k2({ type: SET_LATEST_COLOR, payload: { latestColors: _defineProperty({}, e2, b3) } });
  }, defaultColor: u2, pinnedColors: y2, open: !!q2, onClose: function closePicker(a2) {
    c2(A2.current || u2), C2(a2);
  }, onApply: C2 }));
};
ColorInput.defaultProps = { color: void 0 };
var MIN_PERCENTANGE = 0, MAX_PERCENTANGE = 100, StrokeFields = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = b2.stroke, e2 = b2.strokeWidth;
  return React.createElement(StyledSpacedOptionFields, null, React.createElement(Slider, { annotation: "px", onChange: function changeStrokeWidth(a2) {
    c2({ strokeWidth: restrictNumber(a2, MIN_PERCENTANGE, MAX_PERCENTANGE) });
  }, value: e2, noMargin: true }), React.createElement(ColorInput, { color: d2, onChange: function changeStrokeColor(a2) {
    c2({ stroke: a2 });
  }, colorFor: "stroke" }));
};
var ShadowFields = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = a.t, e2 = b2.shadowOffsetX, f2 = b2.shadowOffsetY, g2 = b2.shadowBlur, h2 = b2.shadowColor, i = b2.shadowOpacity, j2 = function(a2, b3) {
    var d3 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : 0, e3 = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : 100;
    c2(_defineProperty({}, a2, restrictNumber(b3, d3, e3)));
  };
  return React.createElement(StyledSpacedOptionFields, { preventFlex: true }, React.createElement(Label$5, null, d2("shadow")), React.createElement(StyledTwoColumnsContainer, null, React.createElement(StyledColumn, null, React.createElement(Label$5, null, d2("horizontal")), React.createElement(Slider, { annotation: "px", min: -100, max: 100, onChange: function onChange2(a2) {
    return j2("shadowOffsetX", a2, -100, 100);
  }, value: e2 || 0, hideTrack: true })), React.createElement(StyledColumn, null, React.createElement(Label$5, null, d2("vertical")), React.createElement(Slider, { annotation: "px", min: -100, max: 100, onChange: function onChange2(a2) {
    return j2("shadowOffsetY", a2, -100, 100);
  }, value: f2 || 0, hideTrack: true }))), React.createElement(StyledTwoColumnsContainer, null, React.createElement(StyledColumn, null, React.createElement(Label$5, null, d2("blur")), React.createElement(Slider, { annotation: "%", onChange: function onChange2(a2) {
    return j2("shadowBlur", a2);
  }, value: g2 })), React.createElement(StyledColumn, null, React.createElement(Label$5, null, d2("opacity")), React.createElement(Slider, { annotation: "%", onChange: function onChange2(a2) {
    return j2("shadowOpacity", a2 / 100, 0, 1);
  }, value: Math.round(100 * i) }))), React.createElement(ColorInput, { color: h2, onChange: function changeShadowColor(a2) {
    c2({ shadowColor: a2 });
  }, colorFor: "shadow" }));
};
var mapPositionStringToPoint = function(a, b2, c2) {
  var d2 = a.width, e2 = a.height, f2 = a.scaleX, g2 = void 0 === f2 ? 1 : f2, h2 = a.scaleY, i = void 0 === h2 ? 1 : h2, j2 = a.rotation, k2 = void 0 === j2 ? 0 : j2, l2 = a.padding, m2 = void 0 === l2 ? 0 : l2, n2 = a.radius, o = a.radiusX, p2 = a.radiusY, q2 = getSizeAfterRotation((d2 || 2 * (n2 || o)) * g2, (e2 || 2 * (n2 || p2)) * i, k2), r2 = b2.attrs, s = r2.clipWidth, t2 = r2.clipHeight, u2 = r2.clipX, v2 = void 0 === u2 ? 0 : u2, w2 = r2.clipY, x2 = void 0 === w2 ? 0 : w2, y2 = { left: v2 + q2.offsetLeft + m2, center: v2 + s / 2 - (q2.width / 2 - q2.offsetLeft) + m2, right: v2 + s - q2.width - m2 + q2.offsetLeft }, z2 = { top: x2 + q2.offsetTop + m2, middle: x2 + t2 / 2 - (q2.height / 2 - q2.offsetTop) + m2, bottom: x2 + t2 - q2.height - m2 + q2.offsetTop }, A2 = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, POSITIONS.TOP_LEFT, function() {
    return { x: y2.left, y: z2.top };
  }), POSITIONS.TOP_CENTER, function() {
    return { x: y2.center, y: z2.top };
  }), POSITIONS.TOP_RIGHT, function() {
    return { x: y2.right, y: z2.top };
  }), POSITIONS.MIDDLE_LEFT, function() {
    return { x: y2.left, y: z2.middle };
  }), POSITIONS.MIDDLE_CENTER, function() {
    return { x: y2.center, y: z2.middle };
  }), POSITIONS.MIDDLE_RIGHT, function() {
    return { x: y2.right, y: z2.middle };
  }), POSITIONS.BOTTOM_LEFT, function() {
    return { x: y2.left, y: z2.bottom };
  }), POSITIONS.BOTTOM_CENTER, function() {
    return { x: y2.center, y: z2.bottom };
  }), POSITIONS.BOTTOM_RIGHT, function() {
    return { x: y2.right, y: z2.bottom };
  });
  return A2[c2]();
};
var AVAILABLE_POSITIONS = Object.values(POSITIONS);
var posCssRotateDegFromRightSide = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, POSITIONS.TOP_LEFT, -145), POSITIONS.TOP_CENTER, -90), POSITIONS.TOP_RIGHT, -45), POSITIONS.MIDDLE_LEFT, 180), POSITIONS.MIDDLE_CENTER, 0), POSITIONS.MIDDLE_RIGHT, 0), POSITIONS.BOTTOM_LEFT, 135), POSITIONS.BOTTOM_CENTER, 90), POSITIONS.BOTTOM_RIGHT, 45);
var POPPABLE_OPTIONS = { OPACITY: "opacity", STROKE: "stroke", SHADOW: "shadow", POSITION: "position" };
var PositionFields = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = reactExports.useState(null), e2 = _slicedToArray(d2, 2), f2 = e2[0], g2 = e2[1], h2 = useStore(), i = h2.designLayer, j2 = function(a2) {
    c2(mapPositionStringToPoint(b2, i, a2)), g2(a2);
  }, k2 = AVAILABLE_POSITIONS.length;
  return AVAILABLE_POSITIONS.map(function(a2, b3) {
    return React.createElement(reactExports.Fragment, { key: a2 }, React.createElement(StyledIconWrapper, { onClick: function onClick() {
      return j2(a2);
    }, active: f2 === a2, secondaryIconColor: true, addThinBorder: true }, a2 === POSITIONS.MIDDLE_CENTER ? React.createElement(Point, null) : React.createElement(ArrowRight, { style: { transform: "rotate(".concat(posCssRotateDegFromRightSide[a2], "deg)") } })), 0 == (b3 + 1) % 3 && b3 + 1 !== k2 && React.createElement("div", null));
  });
};
var _excluded$a = ["children", "morePoppableOptionsPrepended", "moreOptionsPopupComponentsObj", "morePoppableOptionsAppended", "annotation", "updateAnnotation", "hideFillOption", "hidePositionField", "className"];
function ownKeys$J(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$J(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$J(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$J(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var AnnotationOptions = function(a) {
  var b2 = a.children, c2 = a.morePoppableOptionsPrepended, d2 = a.moreOptionsPopupComponentsObj, e2 = a.morePoppableOptionsAppended, f2 = a.annotation, g2 = a.updateAnnotation, h2 = a.hideFillOption, i = a.hidePositionField, j2 = a.className, k2 = _objectWithoutProperties(a, _excluded$a), l2 = reactExports.useState(null), m2 = _slicedToArray(l2, 2), n2 = m2[0], o = m2[1], p2 = reactExports.useState(null), q2 = _slicedToArray(p2, 2), r2 = q2[0], s = q2[1], u2 = useStore(), v2 = u2.config.useCloudimage, w2 = u2.t, t2 = usePhoneScreen(320), x2 = reactExports.useMemo(function() {
    return [].concat(_toConsumableArray(c2), [{ titleKey: "opacity", name: POPPABLE_OPTIONS.OPACITY, Icon: Transparency }], _toConsumableArray(v2 ? [] : [{ titleKey: "stroke", name: POPPABLE_OPTIONS.STROKE, Icon: Stroke }, { titleKey: "shadow", name: POPPABLE_OPTIONS.SHADOW, Icon: Shadow }]), [i ? void 0 : { titleKey: "position", name: POPPABLE_OPTIONS.POSITION, Icon: Position }]);
  }, [c2]), y2 = reactExports.useMemo(function() {
    return _objectSpread$J(_objectSpread$J({}, d2), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, POPPABLE_OPTIONS.OPACITY, OpacityField), POPPABLE_OPTIONS.STROKE, StrokeFields), POPPABLE_OPTIONS.SHADOW, ShadowFields), POPPABLE_OPTIONS.POSITION, PositionFields), e2);
  }, [d2]), z2 = reactExports.useCallback(function(a2, b3) {
    var c3 = null === a2 || void 0 === a2 ? void 0 : a2.currentTarget;
    o(c3), s(b3);
  }, []), A2 = reactExports.useCallback(function(a2) {
    g2({ fill: a2 });
  }, [g2]), B2 = n2 && r2 && y2[r2];
  return React.createElement(StyledOptions, { className: "FIE_annotations-options".concat(j2 ? " ".concat(j2) : ""), isPhoneScreen: t2 }, !h2 && React.createElement(ColorInput, { color: f2.fill, onChange: A2, colorFor: "fill" }), b2, React.createElement(StyledOptionsWrapper, null, x2.map(function(a2) {
    return a2 && React.createElement(StyledIconWrapper, { className: "FIE_annotation-option-triggerer", key: a2.name, title: w2(a2.titleKey), onClick: function onClick(b3) {
      return z2(b3, a2.name);
    }, active: r2 === a2.name }, React.createElement(a2.Icon, { size: 20 }));
  })), B2 && React.createElement(Menu$1, { className: "FIE_annotation-option-popup", anchorEl: n2, open: !!n2, onClose: z2, position: "top" }, React.createElement(StyledOptionPopupContent, null, r2 === POPPABLE_OPTIONS.POSITION ? function renderPositionFields() {
    return React.createElement(React.Fragment, null, React.createElement(Label$5, null, w2("position")), React.createElement(StyledOptionPopupContent, { position: true }, React.createElement(B2, _extends({ annotation: f2, updateAnnotation: g2 }, k2))));
  }() : React.createElement(B2, _extends({ annotation: f2, updateAnnotation: g2 }, k2)))));
};
AnnotationOptions.defaultProps = { children: void 0, morePoppableOptionsPrepended: [], moreOptionsPopupComponentsObj: {}, morePoppableOptionsAppended: [], hideFillOption: false, hidePositionField: false, className: void 0 };
var StyledFontFamilySelect = qe(Select$1).withConfig({ componentId: "sc-1cwdnjz-0" })(["width:160px;"]), StyledFontSizeInput = qe(Input$1).withConfig({ componentId: "sc-1cwdnjz-1" })(["width:72px;"]), StyledToolsWrapper = qe.div.withConfig({ componentId: "sc-1cwdnjz-2" })(["display:flex;"]);
var MIN_VALUE$2 = 0, MAX_VALUE$2 = 100, SLIDER_STEP = 1, TextSpacingsFields = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = a.t, e2 = b2.letterSpacing, f2 = b2.lineHeight, g2 = function(a2, b3) {
    c2(_defineProperty({}, a2, restrictNumber(b3, MIN_VALUE$2, MAX_VALUE$2)));
  };
  return React.createElement(StyledSpacedOptionFields, { preventFlex: true }, React.createElement(Label$5, null, d2("letterSpacing")), React.createElement(Slider, { annotation: "px", isActive: !!e2, onChange: function onChange2(a2) {
    return g2("letterSpacing", a2);
  }, value: e2, step: SLIDER_STEP }), React.createElement(Label$5, null, d2("lineHeight")), React.createElement(Slider, { annotation: "px", isActive: !!f2, onChange: function onChange2(a2) {
    return g2("lineHeight", a2);
  }, value: f2, step: SLIDER_STEP }));
};
var rightAlignmentCssTransform = { transform: "scaleX(-1)" }, TextAlignmentFields = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = b2.align, e2 = function(a2) {
    c2({ align: a2 });
  };
  return React.createElement(StyledSpacedOptionFields, null, React.createElement(StyledIconWrapper, { onClick: function onClick() {
    return e2("left");
  }, active: "left" === d2 }, React.createElement(TextAlignLeft, null)), React.createElement(StyledIconWrapper, { onClick: function onClick() {
    return e2("center");
  }, active: "center" === d2 }, React.createElement(TextAlignCenter, null)), React.createElement(StyledIconWrapper, { onClick: function onClick() {
    return e2("right");
  }, active: "right" === d2 }, React.createElement(TextAlignLeft, { style: rightAlignmentCssTransform })));
};
var TEXT_POPPABLE_OPTIONS = [{ titleKey: "textAlignment", name: "text-alignment", Icon: TextAlignCenter }, { titleKey: "textSpacings", name: "text-spacings", Icon: Spacing }];
var textOptionsPopupComponents = _defineProperty(_defineProperty({}, "text-alignment", TextAlignmentFields), "text-spacings", TextSpacingsFields);
var textarea, textNode, transformer, editFinishCallback, disableTextEditCallback, handleOutsideClick = function(a) {
  if (a.target !== textarea) {
    var b2 = textarea.value;
    deactivateTextChange(), editFinishCallback(b2);
  }
}, deactivateTextChange = function() {
  textarea && textarea.remove(textarea), window && window.removeEventListener("click", handleOutsideClick), textNode && textNode.show(), transformer && transformer.show(), "function" == typeof disableTextEditCallback && disableTextEditCallback(), textNode = null, textarea = null, transformer = null;
}, activateTextChange = function(a, b2, c2, d2, e2) {
  function f2(a2) {
    var b3 = a2;
    b3 || (b3 = textNode.placeholder.length * textNode.fontSize());
    var c3 = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
    (c3 || k2) && (b3 = Math.ceil(b3));
    var d3 = document.documentMode || /Edge/.test(navigator.userAgent);
    d3 && (b3 += 1), textarea.style.width = "".concat(b3, "px");
  }
  editFinishCallback = d2, disableTextEditCallback = e2, transformer = c2, textNode = b2.findOne("#".concat(a)), textNode.hide(), transformer.hide();
  var g2 = textNode.absolutePosition();
  textarea = document.createElement("textarea"), b2.container().parentNode.appendChild(textarea), textarea.value = textNode.text(), textarea.style.position = "absolute", textarea.style.top = "".concat(g2.y, "px"), textarea.style.left = "".concat(g2.x, "px"), textarea.style.width = "".concat(textNode.width() - 2 * textNode.padding(), "px"), textarea.style.height = "".concat(textNode.height() - 2 * textNode.padding() + 5, "px"), textarea.style.maxWidth = "".concat(textNode.width() - 2 * textNode.padding(), "px"), textarea.style.maxHeight = "".concat(textNode.height() - 2 * textNode.padding() + 5, "px"), textarea.style.fontSize = "".concat(textNode.fontSize(), "px"), textarea.style.border = "1px solid rgba(0, 0, 0, 0.5)", textarea.style.padding = "0px", textarea.style.margin = "0px", textarea.style.overflow = "hidden", textarea.style.background = "none", textarea.style.outline = "none", textarea.style.resize = "none", textarea.style.lineHeight = textNode.lineHeight(), textarea.style.fontFamily = textNode.fontFamily(), textarea.style.transformOrigin = "left top", textarea.style.textAlign = textNode.align(), textarea.style.fontStyle = textNode.fontStyle(), textarea.style.letterSpacing = textNode.letterSpacing(), textarea.style.lineHeight = textNode.lineHeight(), textarea.style.color = textNode.fill();
  var h2 = textNode.rotation(), i = "";
  h2 && (i += "rotateZ(".concat(h2, "deg)"));
  var j2 = 0, k2 = -1 < navigator.userAgent.toLowerCase().indexOf("firefox");
  k2 && (j2 += 2 + Math.round(textNode.fontSize() / 20)), i += "translateY(-".concat(j2, "px)"), textarea.style.transform = i, textarea.style.height = "auto", textarea.style.height = "".concat(textarea.scrollHeight + 3, "px"), textarea.focus(), textarea.addEventListener("keydown", function(a2) {
    if ("Enter" === a2.key && !a2.shiftKey) {
      var b3 = textarea.value;
      deactivateTextChange(), editFinishCallback(b3);
    }
    "Escape" === a2.key && deactivateTextChange();
  }), textarea.addEventListener("keydown", function(a2) {
    if ("Enter" !== a2.key && "Escape" !== a2.key) {
      var b3 = textNode.getAbsoluteScale().x;
      f2(textNode.width() * b3), textarea.style.height = "auto", textarea.style.height = "".concat(textarea.scrollHeight + textNode.fontSize(), "px");
    }
  }), window && setTimeout(function() {
    window.addEventListener("click", handleOutsideClick);
  });
};
var TextControls = function(a) {
  var b2 = a.text, c2 = a.saveText, d2 = a.children, e2 = useStore(), f2 = e2.dispatch, g2 = e2.textIdOfEditableContent, h2 = e2.designLayer, i = e2.t, j2 = e2.config, k2 = j2.useCloudimage, l2 = j2[TOOLS_IDS.TEXT], m2 = l2.fonts, n2 = void 0 === m2 ? [] : m2, o = l2.onFontChange, p2 = reactExports.useCallback(function(a2) {
    var b3 = a2.target, d3 = b3.name, e3 = b3.value, f3 = b3.type;
    c2(function(a3) {
      return _defineProperty({ id: a3.id }, d3, "number" === f3 ? restrictNumber(e3, 1, 500) : e3);
    });
  }, [c2]), q2 = reactExports.useCallback(function(a2) {
    if (p2({ target: { name: "fontFamily", value: a2 } }), b2.fontFamily !== a2 && "function" == typeof o) {
      var c3 = h2.draw.bind(h2);
      o(a2, c3);
    }
  }, [p2, b2, h2]), r2 = reactExports.useCallback(function(a2) {
    var c3, d3 = (null === (c3 = b2.fontStyle) || void 0 === c3 ? void 0 : c3.replace("normal", "").split(" ")) || [];
    0 < Object.keys(d3).length && d3.includes(a2) ? d3 = d3.filter(function(b3) {
      return b3 !== a2;
    }) : d3.push(a2), p2({ target: { name: "fontStyle", value: d3.join(" ").trim() || "normal" } });
  }, [b2]), s = reactExports.useCallback(function() {
    f2({ type: ENABLE_TEXT_CONTENT_EDIT, payload: { textIdOfEditableContent: null } });
  }, []), t2 = reactExports.useCallback(function(a2) {
    p2({ target: { name: "text", value: a2 } }), s();
  }, []);
  return reactExports.useEffect(function() {
    var a2;
    if (g2 && b2.id === g2) {
      var c3 = h2.getStage(), d3 = _slicedToArray(c3.findOne("#".concat(TRANSFORMERS_LAYER_ID)).children, 1);
      a2 = d3[0], activateTextChange(g2, c3, a2, t2, s);
    }
    return function() {
      a2 && g2 && deactivateTextChange();
    };
  }, [g2]), React.createElement(AnnotationOptions, { className: "FIE_text-tool-options", annotation: b2, updateAnnotation: c2, morePoppableOptionsPrepended: k2 ? [] : TEXT_POPPABLE_OPTIONS, moreOptionsPopupComponentsObj: k2 ? {} : textOptionsPopupComponents, t: i }, Array.isArray(n2) && 1 < n2.length && React.createElement(StyledFontFamilySelect, { className: "FIE_text-font-family-option", onChange: q2, value: b2.fontFamily, placeholder: i("fontFamily"), size: "sm" }, n2.map(function() {
    var a2, b3, c3, d3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "";
    return React.createElement(MenuItem, { className: "FIE_text-font-family-item", key: null !== (a2 = d3.value) && void 0 !== a2 ? a2 : d3, value: null !== (b3 = d3.value) && void 0 !== b3 ? b3 : d3 }, null !== (c3 = d3.label) && void 0 !== c3 ? c3 : d3);
  })), React.createElement(StyledFontSizeInput, { className: "FIE_text-size-option", value: b2.fontSize || "", name: "fontSize", onChange: p2, inputMode: "numeric", type: "number", size: "sm", placeholder: i("size") }), React.createElement(StyledToolsWrapper, null, !k2 && React.createElement(React.Fragment, null, React.createElement(StyledIconWrapper, { className: "FIE_text-bold-option", active: (b2.fontStyle || "").includes("bold"), onClick: function onClick() {
    return r2("bold");
  }, watermarkTool: true }, React.createElement(FontBold, { size: 20 })), React.createElement(StyledIconWrapper, { className: "FIE_text-italic-option", active: (b2.fontStyle || "").includes("italic"), onClick: function onClick() {
    return r2("italic");
  }, watermarkTool: true }, React.createElement(FontItalic, { size: 20 }))), d2));
};
TextControls.defaultProps = { children: null };
var TextOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.TEXT }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(TextControls, { text: e2, saveText: f2, t: b2 });
};
var ImageButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_image-tool-button", id: TOOLS_IDS.IMAGE, label: d2("imageTool"), Icon: ImageOutline, onClick: b2, isSelected: c2 });
};
ImageButton.defaultProps = { isSelected: false };
var StyledHiddenUploadInput = qe.input.withConfig({ componentId: "sc-h20emh-0" })(["display:none;width:1px;height:1px;position:absolute;z-index:-1;"]);
var HiddenUploadInput = function(a, b2) {
  return React.createElement(StyledHiddenUploadInput, _extends({ type: "file", ref: b2 }, a));
};
const HiddenUploadInput$1 = reactExports.forwardRef(HiddenUploadInput);
var StyledButtonWrapper = qe.div.withConfig({ componentId: "sc-m9ezm7-0" })(["display:flex;align-items:center;margin-left:", ";flex-shrink:0;"], function(a) {
  var b2 = a.noMargin;
  return b2 ? "0" : "12px";
}), StyledMainButton = qe(Button).withConfig({ componentId: "sc-m9ezm7-1" })(["flex-grow:1;justify-content:center;align-items:center;"]), StyledMenu = qe(Menu$1).withConfig({ componentId: "sc-m9ezm7-2" })(["padding:8px;background-color:", ";"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BackgroundStateless];
}), StyledMenuItem = qe(MenuItem).withConfig({ componentId: "sc-m9ezm7-3" })(["border-radius:4px;"]), StyledMenuIcon = qe(MenuItemIcon).withConfig({ componentId: "sc-m9ezm7-4" })(["display:flex;align-items:center;"]);
var ButtonWithMenu = function(a) {
  var b2 = a.onClick, c2 = a.title, d2 = a.label, e2 = a.color, f2 = a.menuFromBtn, g2 = a.menuItems, h2 = a.menuPosition, i = void 0 === h2 ? "bottom" : h2, j2 = a.disabled, k2 = void 0 !== j2 && j2, l2 = a.className, m2 = a.menuStyle, n2 = a.wrapperStyle, o = a.buttonRef, p2 = a.noMargin, q2 = useStore(), r2 = q2.t, s = reactExports.useRef(true), t2 = reactExports.useState(null), u2 = _slicedToArray(t2, 2), v2 = u2[0], w2 = u2[1], x2 = "sm", y2 = g2.filter(Boolean), z2 = 1 < y2.length, A2 = function(a2) {
    s.current && w2(a2.currentTarget);
  }, B2 = function() {
    s.current && w2(null);
  }, C2 = function(a2) {
    "function" == typeof a2 && a2(), B2();
  };
  return reactExports.useEffect(function() {
    return s.current = true, function() {
      s.current = false;
    };
  }, []), React.createElement(React.Fragment, null, React.createElement(StyledButtonWrapper, { className: "".concat(l2, "-wrapper"), style: n2, ref: o, noMargin: p2 }, React.createElement(StyledMainButton, { className: "".concat(l2, "-button"), color: e2, size: x2, title: c2, onClick: k2 ? void 0 : function handleButtonClick(a2) {
    var c3;
    return f2 && z2 ? void A2(a2) : void ("function" == typeof b2 ? b2() : null !== (c3 = y2[0]) && void 0 !== c3 && c3.onClick && y2[0].onClick());
  }, disabled: k2 }, d2 || r2("saveAs"))), z2 && React.createElement(StyledMenu, { className: "".concat(l2, "-menu"), anchorEl: v2, onClose: B2, open: true, style: m2, position: i }, g2.map(function(a2) {
    return a2 && React.createElement(StyledMenuItem, { className: "".concat(l2, "-menu-item"), key: a2.key, active: a2.isActive, onClick: function() {
      return C2(a2.onClick);
    }, size: x2 }, a2.icon && React.createElement(StyledMenuIcon, { size: x2 }, "string" == typeof a2.icon ? React.createElement("span", { dangerouslySetInnerHTML: { __html: a2.icon } }) : React.createElement(a2.icon, null)), React.createElement(MenuItemLabel, null, a2.label));
  })));
};
ButtonWithMenu.defaultProps = { title: "", label: "", color: "primary", menuFromBtn: false, noMargin: false, menuPosition: "bottom", onClick: void 0, disabled: false, menuStyle: void 0, wrapperStyle: void 0, buttonRef: void 0 };
var ImageControls = function(a) {
  var b2 = a.image, c2 = a.saveImage, d2 = a.children, e2 = a.t;
  return React.createElement(AnnotationOptions, { className: "FIE_image-tool-options", annotation: b2, updateAnnotation: c2, t: e2, hideFillOption: true }, d2);
};
ImageControls.defaultProps = { children: null };
var StyledImagesGallery = qe.div.withConfig({ componentId: "sc-dqni47-0" })(["background:", ";box-shadow:0px 1px 2px ", ";border-radius:4px;padding:8px;overflow-y:auto;max-height:350px;max-width:300px;"], function(a) {
  var b2 = a.theme;
  return b2.palette["bg-secondary"];
}, function(a) {
  var b2 = a.theme;
  return b2.palette["light-shadow"];
}), StyledImageWrapper = qe.div.withConfig({ componentId: "sc-dqni47-1" })(["display:inline-flex;align-items:center;justify-content:center;width:60px;height:60px;margin:4px;padding:4px;cursor:pointer;border-radius:4px;border:2px solid ", ";user-select:none;:hover{border-color:", ";}img{width:100%;height:100%;object-fit:contain;}"], function(a) {
  var b2 = a.theme;
  return b2.palette["bg-primary-active"];
}, function(a) {
  var b2 = a.theme;
  return b2.palette["accent-primary-active"];
});
var ImagesGallery = function(a) {
  var b2 = a.gallery, c2 = a.anchorEl, d2 = a.onClose, e2 = a.onSelect;
  return React.createElement(Popper$1, { className: "FIE_image-tool-gallery", anchorEl: c2, open: !!c2, position: "top", onClick: d2, overlay: true }, React.createElement(StyledImagesGallery, null, b2.map(function(a2) {
    var b3 = a2.originalUrl, c3 = a2.previewUrl;
    return React.createElement(StyledImageWrapper, { key: b3, onClick: function onClick() {
      return e2(b3);
    } }, React.createElement("img", { src: c3, alt: c3, crossOrigin: "Anonymous", draggable: false }));
  })));
};
ImagesGallery.defaultProps = { gallery: [], anchorEl: null };
var ADDED_IMG_SPACING_PERCENT = 0.15, ImageOptions = function() {
  var a = reactExports.useState(), b2 = _slicedToArray(a, 2), c2 = b2[0], d2 = b2[1], e2 = reactExports.useState(null), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = reactExports.useRef(), j2 = reactExports.useRef(), k2 = useStore(), l2 = k2.shownImageDimensions, m2 = k2.dispatch, n2 = k2.adjustments.crop, o = void 0 === n2 ? {} : n2, p2 = k2.t, q2 = k2.config, r2 = void 0 === q2 ? {} : q2, s = r2[TOOLS_IDS.IMAGE], t2 = !s.disableUpload, u2 = Array.isArray(s.gallery) && 0 < s.gallery.length, v2 = useAnnotation({ name: TOOLS_IDS.IMAGE, opacity: 1 }, false), w2 = _slicedToArray(v2, 3), x2 = w2[0], y2 = w2[1], z2 = w2[2], A2 = reactExports.useRef(0), B2 = function(a2) {
    var b3 = o.width || l2.width, c3 = o.height || l2.height, d3 = o.x || 0, e3 = o.y || 0, f3 = Math.min(1, b3 / (a2.width + a2.width * ADDED_IMG_SPACING_PERCENT), c3 / (a2.height + a2.height * ADDED_IMG_SPACING_PERCENT));
    z2({ image: a2, x: d3 + b3 / 2 - a2.width * f3 / 2, y: e3 + c3 / 2 - a2.height * f3 / 2, width: a2.width * f3, height: a2.height * f3 });
  }, C2 = function(a2) {
    A2.current += 1, A2.current === a2 && (A2.current = 0, d2(false));
  }, D2 = function(a2) {
    m2({ type: SET_FEEDBACK, payload: { feedback: { message: a2, status: FEEDBACK_STATUSES.WARNING } } });
  }, E2 = function() {
    i.current && i.current.click();
  }, F2 = function() {
    h2(j2.current);
  }, G2 = reactExports.useMemo(function() {
    return [t2 && { key: "add-by-upload-image", label: c2 ? p2("importing") : p2("uploadImage"), icon: UploadOutline, onClick: c2 ? void 0 : E2 }, u2 && { key: "add-from-gallery", label: p2("fromGallery"), icon: Images, onClick: F2 }];
  }, [s, c2, p2]);
  return React.createElement(ImageControls, { image: x2, saveImage: y2, t: p2 }, React.createElement(ButtonWithMenu, { className: "FIE_image-tool-add-option", color: "secondary", label: p2("addImage"), title: p2("addImageTitle"), menuPosition: "top", menuItems: G2, size: "sm", style: { maxHeight: 24 }, buttonRef: j2, menuFromBtn: true }), t2 && React.createElement(HiddenUploadInput$1, { ref: i, onChange: c2 ? void 0 : function importImages(a2) {
    if (a2.target.files) {
      d2(true);
      var b3 = [], c3 = Array.from(a2.target.files), e3 = c3.length;
      if (c3.forEach(function(a3) {
        if (a3.type.startsWith("image/")) {
          var c4 = new Image();
          c4.onload = function() {
            B2(c4), URL.revokeObjectURL(a3), C2(e3);
          }, c4.onerror = function() {
            D2(p2("uploadImageError")), C2(e3);
          }, c4.src = URL.createObjectURL(a3);
        } else b3.push(a3.name), C2(e3);
      }), 0 < b3.length) {
        var f3 = 1 < b3.length ? p2("areNotImages") : p2("isNotImage");
        D2("".concat(b3.join(", "), " ").concat(f3, " ").concat(p2("toBeUploaded"), "."));
      }
    }
    a2.target.value = "";
  }, disabled: c2, multiple: true }), u2 && React.createElement(ImagesGallery, { gallery: s.gallery, onSelect: function importImgFromGallery(a2) {
    d2(true);
    var b3 = new Image();
    b3.onload = function() {
      B2(b3), C2(1);
    }, b3.onerror = function() {
      D2(p2("uploadImageError")), C2(1);
    }, b3.crossOrigin = "Anonymous", b3.src = a2;
  }, onClose: function closeGalleryPanel() {
    h2(null);
  }, anchorEl: g2 }));
};
var RectButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_rect-tool-button", id: TOOLS_IDS.RECT, label: d2("rectangleTool"), Icon: CropLandscape, onClick: b2, isSelected: c2 });
};
RectButton.defaultProps = { isSelected: false };
var MIN_VALUE$1 = 0, MAX_VALUE$1 = 150, RectCornerField = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = a.t, e2 = b2.cornerRadius;
  return React.createElement(StyledSpacedOptionFields, null, React.createElement(Label$5, null, d2("cornerRadius")), React.createElement(Slider, { annotation: "px", onChange: function updateCornerRadius(a2) {
    c2({ cornerRadius: restrictNumber(a2, MIN_VALUE$1, MAX_VALUE$1) });
  }, value: e2, min: MIN_VALUE$1, max: MAX_VALUE$1, noMargin: true }));
};
var RECT_POPPABLE_OPTIONS = [{ titleKey: "cornerRadius", name: "corner-radius", Icon: RadiusCorner }];
var rectOptionsPopupComponents = _defineProperty({}, "corner-radius", RectCornerField);
var RectOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.RECT }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(AnnotationOptions, { className: "FIE_rect-tool-options", moreOptionsPopupComponentsObj: rectOptionsPopupComponents, morePoppableOptionsPrepended: RECT_POPPABLE_OPTIONS, annotation: e2, updateAnnotation: f2, t: b2 });
};
var EllipseButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_ellipse-tool-button", id: TOOLS_IDS.ELLIPSE, label: d2("ellipseTool"), Icon: Ellipse3, onClick: b2, isSelected: c2 });
};
EllipseButton.defaultProps = { isSelected: false };
var EllipseOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.ELLIPSE }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(AnnotationOptions, { className: "FIE_ellipse-tool-options", annotation: e2, updateAnnotation: f2, t: b2 });
};
var PenButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_pen-tool-button", id: TOOLS_IDS.PEN, label: d2("penTool"), Icon: Annotation, onClick: b2, isSelected: c2 });
};
PenButton.defaultProps = { isSelected: false };
function ownKeys$I(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$I(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$I(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$I(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var eventsOptions = { passive: true }, PenOptions = function(a) {
  var b2 = a.t, c2 = useStore(), d2 = c2.dispatch, e2 = c2.designLayer, f2 = c2.previewGroup, g2 = c2.config, h2 = useAnnotation(_objectSpread$I(_objectSpread$I(_objectSpread$I({}, g2.annotationsCommon), g2[TOOLS_IDS.PEN]), {}, { name: TOOLS_IDS.PEN }), false), i = _slicedToArray(h2, 3), j2 = i[0], k2 = i[1], l2 = i[2], m2 = reactExports.useRef(null), n2 = reactExports.useRef({ points: [], moved: false, id: "" }), o = reactExports.useCallback(function() {
    var a2 = getElemDocumentCoords(m2.current.content), b3 = getPointerOffsetPositionBoundedToObject(f2, a2);
    return [b3.offsetX - (e2.attrs.xPadding || 0), b3.offsetY - (e2.attrs.yPadding || 0)];
  }, [e2]), p2 = reactExports.useCallback(function() {
    n2.current.moved ? (n2.current.points = n2.current.points.concat(o()), d2({ type: SET_ANNOTATION, payload: { id: n2.current.id, points: n2.current.points, dismissHistory: true } })) : (n2.current = { moved: true, id: randomId(TOOLS_IDS.PEN), points: [].concat(_toConsumableArray(n2.current.points), _toConsumableArray(o())) }, l2({ id: n2.current.id, name: TOOLS_IDS.PEN, points: n2.current.points }));
  }, [o]), q2 = reactExports.useCallback(function() {
    n2.current.id && g2[TOOLS_IDS.PEN].selectAnnotationAfterDrawing && d2({ type: SELECT_ANNOTATION, payload: { annotationId: n2.current.id } }), n2.current = null, m2.current.off("mousemove touchmove", p2), m2.current.off("mouseleave touchcancel", q2), document.removeEventListener("mouseup", q2, eventsOptions), document.removeEventListener("touchend", q2, eventsOptions), document.removeEventListener("mouseleave", q2, eventsOptions), document.removeEventListener("touchcancel", q2, eventsOptions);
  }, [p2]), r2 = reactExports.useCallback(function(a2) {
    a2.target.attrs.draggable || (a2.evt.preventDefault(), n2.current = { points: o() }, m2.current.on("mousemove touchmove", p2), m2.current.on("mouseleave touchcancel", q2), document.addEventListener("mouseup", q2, eventsOptions), document.addEventListener("touchend", q2, eventsOptions), document.addEventListener("mouseleave", q2, eventsOptions), document.addEventListener("touchcancel", q2, eventsOptions));
  }, [o, p2, q2]);
  return reactExports.useEffect(function() {
    return m2.current = null === e2 || void 0 === e2 ? void 0 : e2.getStage(), m2.current && m2.current.on("mousedown touchstart", r2), function() {
      m2.current && m2.current.off("mousedown touchstart", r2);
    };
  }, [e2]), React.createElement(AnnotationOptions, { className: "FIE_pen-tool-options", annotation: j2, updateAnnotation: k2, t: b2, hidePositionField: true, hideFillOption: true });
};
var LineButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_line-tool-button", id: TOOLS_IDS.LINE, label: d2("lineTool"), Icon: Line3, onClick: b2, isSelected: c2 });
};
LineButton.defaultProps = { isSelected: false };
var LineOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.LINE }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(AnnotationOptions, { className: "FIE_line-tool-options", annotation: e2, updateAnnotation: f2, t: b2, hidePositionField: true, hideFillOption: true });
};
var ArrowButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_arrow-tool-button", id: TOOLS_IDS.ARROW, label: d2("arrowTool"), Icon: ArrowTool, onClick: b2, isSelected: c2 });
};
ArrowButton.defaultProps = { isSelected: false };
var ArrowOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.ARROW }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(AnnotationOptions, { className: "FIE_arrow-tool-options", annotation: e2, updateAnnotation: f2, t: b2, hidePositionField: true, hideFillOption: true });
};
var PolygonButton = function(a) {
  var b2 = a.selectTool, c2 = a.isSelected, d2 = a.t;
  return React.createElement(ToolsBarItemButton$1, { className: "FIE_polygon-tool-button", id: TOOLS_IDS.POLYGON, label: d2("polygonTool"), Icon: Polygon, onClick: b2, isSelected: c2 });
};
PolygonButton.defaultProps = { isSelected: false };
var MIN_VALUE = 3, MAX_VALUE = 25, PolygonSidesField = function(a) {
  var b2 = a.annotation, c2 = a.updateAnnotation, d2 = a.t, e2 = b2.sides;
  return React.createElement(StyledSpacedOptionFields, null, React.createElement(Label$5, null, d2("sides")), React.createElement(Slider, { annotation: "", onChange: function updateSidesNumber(a2) {
    c2({ sides: restrictNumber(a2, MIN_VALUE, MAX_VALUE) });
  }, value: e2, min: MIN_VALUE, max: MAX_VALUE, noMargin: true }));
};
var POLYGON_POPPABLE_OPTIONS = [{ titleKey: "sides", name: "sides-number", Icon: PolygonSides }];
var polygonOptionsPopupComponents = _defineProperty({}, "sides-number", PolygonSidesField);
var PolygonOptions = function(a) {
  var b2 = a.t, c2 = useAnnotation({ name: TOOLS_IDS.POLYGON }), d2 = _slicedToArray(c2, 2), e2 = d2[0], f2 = d2[1];
  return React.createElement(AnnotationOptions, { className: "FIE_polygon-tool-options", morePoppableOptionsPrepended: POLYGON_POPPABLE_OPTIONS, moreOptionsPopupComponentsObj: polygonOptionsPopupComponents, annotation: e2, updateAnnotation: f2, t: b2, hidePositionField: true });
};
function ownKeys$H(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$H(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$H(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$H(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var getProperDimensions = function(a, b2, c2, d2) {
  var e2 = 4 < arguments.length && arguments[4] !== void 0 ? arguments[4] : 0;
  if (a.width && a.height) return a;
  var f2 = mapCropBox(b2, c2, d2), g2 = getSizeAfterRotation(f2.width, f2.height, e2);
  return a.width || a.height ? { width: a.width || g2.width, height: a.height || g2.height } : g2.width && g2.height && g2 || _objectSpread$H(_objectSpread$H({}, d2), getSizeAfterRotation(d2.width, d2.height, e2));
};
var StyledResizeWrapper = qe.div.withConfig({ componentId: "sc-17otqpz-0" })(["display:flex;justify-content:", ";align-items:flex-end;gap:3px;flex-wrap:wrap;"], function(a) {
  var b2 = a.alignment;
  return b2 || "center";
}), StyledResizeInput = qe(InputGroup).withConfig({ componentId: "sc-17otqpz-1" })(function(a) {
  var b2 = a.theme;
  return Ae(["width:106px;max-width:106px;margin-top:4px;.SfxInput-Base{width:100%;min-width:100%;max-width:100%;}span{color:", ";", ";}"], b2.palette[Color.TextSecondary], b2.typography.font[FontVariant.LabelMedium]);
}), StyledRatioLockIcon = qe(IconButton).withConfig({ componentId: "sc-17otqpz-2" })(["svg{margin-bottom:1px;}"]), StyledResetButton = qe(IconButton).withConfig({ componentId: "sc-17otqpz-3" })(["margin-left:12px;"]);
function ownKeys$G(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$G(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$G(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$G(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var Resize = function(a) {
  var b2 = a.onChange, c2 = a.currentSize, d2 = a.hideResetButton, e2 = a.alignment, f2 = useStore(), g2 = f2.dispatch, h2 = f2.originalImage, i = f2.resize, j2 = f2.shownImageDimensions, k2 = f2.adjustments, l2 = k2.crop, m2 = k2.rotation, n2 = void 0 === m2 ? 0 : m2, o = f2.theme, p2 = f2.t, q2 = function(a2) {
    var d3, e3 = a2.target, f3 = e3.name, k3 = e3.value;
    if (!(1 > parseFloat(k3))) {
      var m3 = Math.min(10 * h2.width, 10 * h2.height), o2 = getSizeAfterRotation(h2.width, h2.height, n2), p3 = _defineProperty({}, f3, k3 ? restrictNumber(k3, 0, m3) : k3), q3 = "height" === f3, r3 = q3 ? "width" : "height", s2 = null !== (d3 = c2.ratioUnlocked) && void 0 !== d3 ? d3 : i.ratioUnlocked;
      if (!s2) {
        var t3 = o2.width / o2.height;
        p3[r3] = q3 ? Math.round(p3[f3] * t3) : Math.round(p3[f3] / t3);
      }
      if (p3[f3] !== i[f3] || p3[r3] !== i[r3]) {
        if ("function" == typeof b2) return void b2(p3);
        g2({ type: SET_RESIZE, payload: p3 });
        var u3 = l2.width && l2.height && l2 || j2, v3 = _objectSpread$G(_objectSpread$G({}, i), p3);
        g2({ type: ZOOM_CANVAS, payload: { factor: v3.width && v3.height ? getZoomFitFactor(u3, v3) : DEFAULT_ZOOM_FACTOR, isAbsoluteZoom: true } });
      }
    }
  }, r2 = "undefined" == typeof i.width && "undefined" == typeof i.height || h2.width === i.width && h2.height === i.height, s = getProperDimensions((c2.width || c2.height) && c2 || i, l2, j2, h2, n2), t2 = i.manualChangeDisabled, u2 = "undefined" != typeof i.width && !i.width, v2 = "undefined" != typeof i.height && !i.height;
  return React.createElement(StyledResizeWrapper, { className: "FIE_resize-tool-options", alignment: e2 }, React.createElement(StyledResizeInput, { className: "FIE_resize-width-option", value: u2 ? "" : s.width, name: "width", onChange: t2 ? void 0 : q2, inputMode: "numeric", title: p2("resizeWidthTitle"), label: p2("width"), inputProps: { type: "number" }, size: "sm", iconEnd: "px", placeholder: "Width", disabled: t2 }), React.createElement(StyledRatioLockIcon, { className: "FIE_resize-ratio-locker", title: p2("toggleRatioLockTitle"), onClick: t2 ? void 0 : function toggleRatioLock() {
    return "function" == typeof b2 ? void b2({ ratioUnlocked: !c2.ratioUnlocked }) : void g2({ type: SET_RESIZE, payload: { ratioUnlocked: !i.ratioUnlocked } });
  }, color: "basic", size: "sm", disabled: t2 }, c2.ratioUnlocked || i.ratioUnlocked ? React.createElement(UnlockOutline, { size: 16, color: o.palette.success }) : React.createElement(LockOutline, { size: 16, color: o.palette.error })), React.createElement(StyledResizeInput, { className: "FIE_resize-height-option", value: v2 ? "" : s.height, name: "height", onChange: t2 ? void 0 : q2, inputMode: "numeric", title: p2("resizeHeightTitle"), label: p2("height"), inputProps: { type: "number" }, size: "sm", iconEnd: "px", placeholder: "Height", disabled: t2 }), !d2 && React.createElement(StyledResetButton, { className: "FIE_resize-reset-button", size: "sm", color: "basic", onClick: r2 || t2 ? void 0 : function resetResize() {
    g2({ type: SET_RESIZE, payload: { width: void 0, height: void 0, ratioUnlocked: false } });
    var a2 = l2.width && l2.height && l2 || j2;
    g2({ type: ZOOM_CANVAS, payload: { factor: getZoomFitFactor(a2, a2) } });
  }, disabled: r2 || t2 }, React.createElement(Reset, null)));
};
Resize.defaultProps = { onChange: void 0, currentSize: {}, hideResetButton: false, alignment: "center" };
var StyledWatermarkWrapper = qe.div.withConfig({ componentId: "sc-fvaj5j-0" })(["display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;overflow:hidden;", ";"], function(a) {
  var b2 = a.noWrap;
  return b2 ? "flex-wrap: nowrap;" : "";
}), StyledControlsWrapper = qe.div.withConfig({ componentId: "sc-fvaj5j-1" })(["margin-bottom:8px;"]), StyledWatermarkGalleryItem = qe.div.withConfig({ componentId: "sc-fvaj5j-2" })(function(a) {
  var b2 = a.theme;
  return "\n    padding: 6px 4px;\n    border: 1px solid ".concat(b2.palette["borders-secondary"], ";\n    width: fit-content;\n    height: 32px;\n    border-radius: 2px;\n    overflow: hidden;\n    cursor: pointer;\n    border-radius: 4px;\n\n    :hover {\n      background: ").concat(b2.palette["bg-primary-active"], ";\n    }\n\n    &[aria-selected='true'] {\n      background: ").concat(b2.palette["bg-primary-active"], ";\n      border-color: ").concat(b2.palette["accent-primary-active"], ";\n    }\n\n    img {\n      max-width: 100%;\n      max-height: 100%;\n    }\n  ");
});
var WatermarksGallery = function(a) {
  var b2 = a.addImgWatermark, c2 = a.loadAndSetWatermarkImg, d2 = a.style, e2 = useStore(), f2 = e2.config, g2 = e2.annotations, h2 = e2.dispatch, i = e2.t, j2 = reactExports.useMemo(function() {
    var a2;
    return null === (a2 = (g2[WATERMARK_ANNOTATION_ID$1] || {}).image) || void 0 === a2 ? void 0 : a2.src;
  }, [g2[WATERMARK_ANNOTATION_ID$1]]), k2 = function(a2) {
    var c3 = a2.currentTarget.children[0];
    if (c3.complete) {
      if (!c3.naturalWidth) return void h2({ type: SET_FEEDBACK, payload: { feedback: { message: i("mutualizedFailedToLoadImg"), duration: 2e3 } } });
      b2(c3);
    }
  }, l2 = f2[TOOLS_IDS.WATERMARK] || {}, m2 = l2.gallery, n2 = void 0 === m2 ? [] : m2;
  return 0 === n2.length ? null : React.createElement(Carousel, { className: "FIE_watermark-gallery", style: d2 }, n2.map(function(a2) {
    var b3 = (null === a2 || void 0 === a2 ? void 0 : a2.url) || a2, d3 = (null === a2 || void 0 === a2 ? void 0 : a2.previewUrl) || b3;
    return React.createElement(StyledWatermarkGalleryItem, { className: "FIE_watermark-selected-item", onClick: function onClick(a3) {
      return b3 === d3 ? k2(a3) : c2(b3);
    }, key: b3, "aria-selected": b3 === j2 }, React.createElement("img", { src: d3, alt: "Failed to load.", crossOrigin: "Anonymous", draggable: false }));
  }));
};
WatermarksGallery.defaultProps = { style: void 0 };
var WatermarkPadding = function(a) {
  var b2 = a.watermark, c2 = a.saveWatermark, d2 = a.t, e2 = reactExports.useState(null), f2 = _slicedToArray(e2, 2), g2 = f2[0], h2 = f2[1], i = b2.padding || 0;
  return React.createElement(React.Fragment, null, React.createElement(StyledIconWrapper, { className: "FIE_watermark-padding-triggerer", title: d2("padding"), onClick: function openOptionPopup(a2) {
    h2(a2.currentTarget);
  }, active: g2 }, React.createElement(Padding, { size: 20 })), React.createElement(Menu$1, { className: "FIE_watermark-padding-popup", anchorEl: g2, open: !!g2, onClose: function closeOptionPopup() {
    h2(null);
  }, position: "top" }, React.createElement(StyledOptionPopupContent, null, React.createElement(Label$5, null, d2("padding")), React.createElement(StyledSpacedOptionFields, null, React.createElement(Slider, { annotation: "px", onChange: function updatePadding(a2) {
    c2({ padding: restrictNumber(a2, 0, 100) });
  }, value: i, noMargin: true }), React.createElement(StyledIconLabel, null, "".concat(i, "px"))))));
};
function ownKeys$F(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$F(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$F(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$F(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var WATERMARK_IMG_RATIO_FROM_ORIGINAL = 0.33, WATERMARK_ANNOTATION_ID = "watermark", Watermark = function() {
  var a = useStore(), b2 = a.annotations, c2 = a.shownImageDimensions, d2 = a.selectionsIds, e2 = a.config, f2 = a.dispatch, g2 = a.t, h2 = a.adjustments.crop, i = void 0 === h2 ? {} : h2, j2 = usePhoneScreen(), k2 = reactExports.useState(false), l2 = _slicedToArray(k2, 2), m2 = l2[0], n2 = l2[1], o = reactExports.useRef(), p2 = e2[TOOLS_IDS.WATERMARK], q2 = reactExports.useMemo(function() {
    return b2[WATERMARK_ANNOTATION_ID];
  }, [b2[WATERMARK_ANNOTATION_ID]]), r2 = i.width || c2.width, s = i.height || c2.height, t2 = i.x || 0, u2 = i.y || 0, v2 = p2.textScalingRatio || WATERMARK_IMG_RATIO_FROM_ORIGINAL, w2 = p2.imageScalingRatio || WATERMARK_IMG_RATIO_FROM_ORIGINAL, x2 = function(a2) {
    var b3 = a2.naturalWidth || a2.width, c3 = a2.naturalHeight || a2.height, d3 = s > r2 ? s * w2 / c3 : r2 * w2 / b3, g3 = _objectSpread$F(_objectSpread$F(_objectSpread$F({}, e2.annotationsCommon), e2[TOOLS_IDS.IMAGE]), {}, { scaleX: d3, scaleY: d3, padding: 1, image: a2, width: b3, height: c3, x: t2 + r2 / 2 - b3 * d3 / 2, y: u2 + s / 2 - c3 * d3 / 2, id: WATERMARK_ANNOTATION_ID, name: TOOLS_IDS.IMAGE, replaceCurrent: true });
    f2({ type: SET_ANNOTATION, payload: g3 });
  }, y2 = function(a2) {
    f2({ type: SET_ANNOTATION, payload: _objectSpread$F(_objectSpread$F({}, "function" == typeof a2 ? a2(q2) : a2), {}, { id: WATERMARK_ANNOTATION_ID }) });
  }, z2 = function(a2) {
    f2({ type: SET_FEEDBACK, payload: { feedback: { message: a2, status: FEEDBACK_STATUSES.WARNING } } });
  }, A2 = function(a2, b3) {
    if (a2) {
      n2(true);
      var c3 = new Image();
      c3.onload = function() {
        x2(c3), b3 && URL.revokeObjectURL(a2), n2(false);
      }, c3.onerror = function() {
        z2(g2("mutualizedFailedToLoadImg")), b3 && URL.revokeObjectURL(a2), n2(false);
      }, c3.src = a2;
    }
  };
  reactExports.useEffect(function() {
    q2 && (f2({ type: CLEAR_ANNOTATIONS_SELECTIONS }), f2({ type: SELECT_ANNOTATION, payload: { annotationId: "watermark" } }));
  }, [q2]), reactExports.useEffect(function() {
    q2 && (0 === d2.length || d2[0].id !== WATERMARK_ANNOTATION_ID) && f2({ type: SELECT_ANNOTATION, payload: { annotationId: "watermark" } });
  }, [d2]);
  var B2 = [(!e2.useCloudimage || "function" == typeof p2.onUploadWatermarkImgClick) && { key: "upload-watermark", label: g2("uploadWatermark"), icon: UploadOutline$1, onClick: function handleUploadWatermarkClick() {
    if ("function" == typeof p2.onUploadWatermarkImgClick) {
      var a2 = p2.onUploadWatermarkImgClick(A2);
      return void (a2 instanceof Promise && a2.then(function() {
        var a3 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, b3 = a3.url, c3 = a3.revokeObjectUrl;
        return A2(b3, void 0 !== c3 && c3);
      }));
    }
    o.current && o.current.click();
  } }, !p2.hideTextWatermark && { key: "add-text-watermark", label: g2("addWatermarkAsText"), icon: Text$1, onClick: function addTextWatermark() {
    var a2 = { height: s * v2, width: r2 * v2 }, b3 = _objectSpread$F(_objectSpread$F(_objectSpread$F(_objectSpread$F({}, e2.annotationsCommon), e2[TOOLS_IDS.TEXT]), a2), {}, { padding: 1, x: t2 + r2 / 2 - a2.width / 2, y: u2 + s / 2 - a2.height / 2, fill: "#000000", id: WATERMARK_ANNOTATION_ID, name: TOOLS_IDS.TEXT, replaceCurrent: true });
    f2({ type: SET_ANNOTATION, payload: b3 });
  } }], C2 = function() {
    return React.createElement(WatermarkPadding, { watermark: q2, saveWatermark: y2, t: g2 });
  };
  return React.createElement("div", { className: "FIE_watermark-tool-wrapper" }, (null === q2 || void 0 === q2 ? void 0 : q2.name) === TOOLS_IDS.TEXT && React.createElement(StyledControlsWrapper, { className: "FIE_watermark-options-wrapper" }, React.createElement(TextControls, { text: q2, saveText: y2, t: g2 }, C2())), (null === q2 || void 0 === q2 ? void 0 : q2.name) === TOOLS_IDS.IMAGE && React.createElement(StyledControlsWrapper, { className: "FIE_watermark-options-wrapper" }, React.createElement(ImageControls, { image: q2, saveImage: y2, t: g2 }, C2())), React.createElement(StyledWatermarkWrapper, { className: "FIE_watermark-add-wrapper", noWrap: true }, React.createElement(ButtonWithMenu, { className: "FIE_watermark-add", color: "secondary", label: function addWatermarkLabel() {
    return j2 ? g2("plus") : B2[0] ? g2("addWatermark") : g2("addTextWatermark");
  }(), title: g2("addWatermarkTitle"), menuPosition: "top", menuItems: B2, menuFromBtn: true, noMargin: true }), React.createElement(WatermarksGallery, { loadAndSetWatermarkImg: A2, addImgWatermark: x2, style: j2 && !(!(null !== q2 && void 0 !== q2) || !q2.name) ? { width: "55%" } : void 0 }), React.createElement(HiddenUploadInput$1, { onChange: m2 ? void 0 : function importWatermarkImg(a2) {
    if (a2.target.files) {
      var b3 = a2.target.files[0];
      b3.type.startsWith("image/") && A2(URL.createObjectURL(b3), true);
    }
    a2.target.value = "";
  }, disabled: m2, ref: o })));
};
var _TOOLS_ITEMS;
var TOOLS_ITEMS = (_TOOLS_ITEMS = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_TOOLS_ITEMS, TOOLS_IDS.CROP, { id: TOOLS_IDS.CROP, Item: Crop }), TOOLS_IDS.ROTATE, { id: TOOLS_IDS.ROTATE, Item: RotateButton, ItemOptions: RotateOptions }), TOOLS_IDS.FLIP_X, { id: TOOLS_IDS.FLIP_X, Item: FlipX }), TOOLS_IDS.FLIP_Y, { id: TOOLS_IDS.FLIP_Y, Item: FlipY }), TOOLS_IDS.BRIGHTNESS, { id: TOOLS_IDS.BRIGHTNESS, Item: Brightness, ItemOptions: BrightnessOptions }), TOOLS_IDS.CONTRAST, { id: TOOLS_IDS.CONTRAST, Item: Contrast, ItemOptions: ContrastOptions }), TOOLS_IDS.HSV, { id: TOOLS_IDS.HSV, Item: HSV, ItemOptions: HSVOptions, hideFn: function hideFn(a) {
  var b2 = a.useCloudimage;
  return b2;
} }), TOOLS_IDS.BLUR, { id: TOOLS_IDS.BLUR, Item: Blur3, ItemOptions: BlurOptions }), TOOLS_IDS.WARMTH, { id: TOOLS_IDS.WARMTH, Item: Warmth, ItemOptions: WarmthOptions, hideFn: function hideFn2(a) {
  var b2 = a.useCloudimage;
  return b2;
} }), TOOLS_IDS.FILTERS, { id: TOOLS_IDS.FILTERS, Item: Filters }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_TOOLS_ITEMS, TOOLS_IDS.WATERMARK, { id: TOOLS_IDS.WATERMARK, Item: Watermark }), TOOLS_IDS.TEXT, { id: TOOLS_IDS.TEXT, Item: TextButton, ItemOptions: TextOptions }), TOOLS_IDS.IMAGE, { id: TOOLS_IDS.IMAGE, Item: ImageButton, ItemOptions: ImageOptions }), TOOLS_IDS.RECT, { id: TOOLS_IDS.RECT, Item: RectButton, ItemOptions: RectOptions }), TOOLS_IDS.POLYGON, { id: TOOLS_IDS.POLYGON, Item: PolygonButton, ItemOptions: PolygonOptions }), TOOLS_IDS.ELLIPSE, { id: TOOLS_IDS.ELLIPSE, Item: EllipseButton, ItemOptions: EllipseOptions }), TOOLS_IDS.PEN, { id: TOOLS_IDS.PEN, Item: PenButton, ItemOptions: PenOptions }), TOOLS_IDS.LINE, { id: TOOLS_IDS.LINE, Item: LineButton, ItemOptions: LineOptions }), TOOLS_IDS.ARROW, { id: TOOLS_IDS.ARROW, Item: ArrowButton, ItemOptions: ArrowOptions }), TOOLS_IDS.RESIZE, { id: TOOLS_IDS.RESIZE, Item: Resize }));
var TABS_TOOLS = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TABS_IDS.ADJUST, [TOOLS_IDS.CROP, TOOLS_IDS.ROTATE, TOOLS_IDS.FLIP_X, TOOLS_IDS.FLIP_Y]), TABS_IDS.FINETUNE, [TOOLS_IDS.BRIGHTNESS, TOOLS_IDS.CONTRAST, TOOLS_IDS.HSV, TOOLS_IDS.BLUR, TOOLS_IDS.WARMTH]), TABS_IDS.FILTERS, [TOOLS_IDS.FILTERS]), TABS_IDS.WATERMARK, [TOOLS_IDS.WATERMARK]), TABS_IDS.ANNOTATE, [TOOLS_IDS.TEXT, TOOLS_IDS.IMAGE, TOOLS_IDS.RECT, TOOLS_IDS.ELLIPSE, TOOLS_IDS.POLYGON, TOOLS_IDS.PEN, TOOLS_IDS.LINE, TOOLS_IDS.ARROW]), TABS_IDS.RESIZE, [TOOLS_IDS.RESIZE]);
function ownKeys$E(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$E(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$E(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$E(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SELECT_TAB = "SELECT_TAB";
var selectTab = function(a, b2) {
  return b2.tabId === a.tabId ? a : _objectSpread$E(_objectSpread$E({}, a), {}, { tabId: b2.tabId, toolId: TABS_TOOLS[b2.tabId][0], selectionsIds: [], pointerCssIcon: b2.tabId === TABS_IDS.ANNOTATE ? POINTER_ICONS.DRAW : POINTER_ICONS.DEFAULT });
};
function ownKeys$D(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$D(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$D(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$D(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var UNDO = "UNDO";
var undo = function(a) {
  if (a.pastDesignStates && 0 < a.pastDesignStates.length) {
    var b2 = extractCurrentDesignState(a), c2 = _toArray(a.pastDesignStates), d2 = c2[0], e2 = c2.slice(1), f2 = [b2].concat(_toConsumableArray(a.futureDesignStates || []));
    return _objectSpread$D(_objectSpread$D(_objectSpread$D({}, a), d2), {}, { selectionsIds: [], pastDesignStates: e2, futureDesignStates: f2, hasUndo: 0 < e2.length, hasRedo: true, haveNotSavedChanges: 0 < e2.length });
  }
  return a;
};
function ownKeys$C(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$C(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$C(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$C(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_FINETUNE = "SET_FINETUNE";
var setFinetune = function(a, b2) {
  return _objectSpread$C(_objectSpread$C({}, a), {}, { isDesignState: !b2.dismissHistory, finetunes: !b2.finetune || a.finetunes.includes(b2.finetune) ? a.finetunes : [].concat(_toConsumableArray(a.finetunes), [b2.finetune]), finetunesProps: _objectSpread$C(_objectSpread$C({}, a.finetunesProps), b2.finetuneProps) });
};
var _excluded$9 = ["dismissHistory", "replaceCurrent"];
function ownKeys$B(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$B(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$B(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$B(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_ANNOTATION = "SET_ANNOTATION";
var setAnnotation = function(a) {
  var b2, c2 = 1 < arguments.length && arguments[1] !== void 0 ? arguments[1] : {}, d2 = c2.dismissHistory, e2 = c2.replaceCurrent, f2 = _objectWithoutProperties(c2, _excluded$9), g2 = null !== (b2 = f2.id) && void 0 !== b2 ? b2 : randomId(f2.name), h2 = a.annotations[g2];
  return h2 && !Object.keys(f2).some(function(a2) {
    return (f2[a2] || 0 === f2[a2]) && f2[a2] !== h2[a2];
  }) ? a : _objectSpread$B(_objectSpread$B({}, a), {}, { isDesignState: !(void 0 !== d2 && d2), annotations: _objectSpread$B(_objectSpread$B({}, a.annotations), {}, _defineProperty({}, g2, _objectSpread$B(_objectSpread$B({}, void 0 !== e2 && e2 ? {} : h2), f2))) });
};
function ownKeys$A(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$A(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$A(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$A(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CHANGE_POINTER_ICON = "CHANGE_POINTER_ICON";
var changingPointerIcon = function(a, b2) {
  return a.pointerCssIcon === b2.pointerCssIcon ? a : _objectSpread$A(_objectSpread$A({}, a), {}, { pointerCssIcon: b2.pointerCssIcon });
};
function ownKeys$z(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$z(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$z(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$z(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SELECT_ANNOTATION = "SELECT_ANNOTATION";
var selectAnnotation = function(a, b2) {
  if (1 === a.selectionsIds.length && a.selectionsIds[0] === b2.annotationId) return a;
  var c2;
  if (b2.multiple) {
    c2 = a.selectionsIds.filter(function(a2) {
      return a2 !== b2.annotationId;
    });
    var d2 = c2.length !== a.selectionsIds.length;
    d2 || c2.push(b2.annotationId);
  } else c2 = [b2.annotationId];
  return _objectSpread$z(_objectSpread$z({}, a), {}, { selectionsIds: c2 });
};
function ownKeys$y(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$y(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$y(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$y(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CLEAR_ANNOTATIONS_SELECTIONS = "CLEAR_ANNOTATIONS_SELECTIONS";
var clearAnnotationsSelections = function(a) {
  return 0 === a.selectionsIds.length ? a : _objectSpread$y(_objectSpread$y({}, a), {}, { selectionsIds: [] });
};
function ownKeys$x(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$x(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$x(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$x(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var TOGGLE_ORIGINAL_IMAGE_DISPLAY = "TOGGLE_ORIGINAL_IMAGE_DISPLAY";
var toggleOriginalImageDisplay = function(a, b2) {
  return _objectSpread$x(_objectSpread$x({}, a), {}, { isShowOriginalImage: b2.isShow });
};
function ownKeys$w(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$w(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$w(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$w(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SELECT_TOOL = "SELECT_TOOL";
var selectTool = function(a, b2) {
  return a.toolId === b2.toolId ? a : _objectSpread$w(_objectSpread$w({}, a), {}, { toolId: b2.toolId, selectionsIds: b2.keepSelections ? a.selectionsIds : [] });
};
function ownKeys$v(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$v(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$v(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$v(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var TOGGLE_FLIP = "TOGGLE_FLIP";
var toggleFlip = function(a, b2) {
  var c2 = "isFlipped".concat(b2.direction === FLIP_DIRECTIONS.X ? "X" : "Y");
  return _objectSpread$v(_objectSpread$v({}, a), {}, { isDesignState: !b2.dismissHistory, adjustments: _objectSpread$v(_objectSpread$v({}, a.adjustments), {}, _defineProperty({}, c2, !a.adjustments[c2])) });
};
function ownKeys$u(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$u(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$u(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$u(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_CROP = "SET_CROP";
var setCrop = function(a, b2) {
  var c2, d2, e2, f2, g2, h2, i, j2 = null !== (c2 = a.adjustments.crop) && void 0 !== c2 ? c2 : {}, k2 = { x: null !== (d2 = toPrecisedFloat(b2.x)) && void 0 !== d2 ? d2 : j2.x, y: null !== (e2 = toPrecisedFloat(b2.y)) && void 0 !== e2 ? e2 : j2.y, ratio: "string" == typeof b2.ratio ? b2.ratio : null !== (f2 = toPrecisedFloat(b2.ratio)) && void 0 !== f2 ? f2 : j2.ratio, width: null !== (g2 = toPrecisedFloat(b2.width)) && void 0 !== g2 ? g2 : j2.width, height: null !== (h2 = toPrecisedFloat(b2.height)) && void 0 !== h2 ? h2 : j2.height, ratioTitleKey: null !== (i = b2.ratioTitleKey) && void 0 !== i ? i : j2.ratioTitleKey, ratioGroupKey: b2.ratioGroupKey, ratioFolderKey: b2.ratioFolderKey, noEffect: b2.noEffect };
  return _objectSpread$u(_objectSpread$u({}, a), {}, { isDesignState: !b2.dismissHistory, adjustments: _objectSpread$u(_objectSpread$u({}, a.adjustments), {}, { crop: _objectSpread$u(_objectSpread$u({}, j2), k2) }) });
};
function ownKeys$t(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$t(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$t(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$t(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CHANGE_ROTATION = "CHANGE_ROTATION";
var changeRotation = function(a, b2) {
  return a.adjustments.rotation === b2.rotation ? a : _objectSpread$t(_objectSpread$t({}, a), {}, { isDesignState: !b2.dismissHistory, adjustments: _objectSpread$t(_objectSpread$t({}, a.adjustments), {}, { rotation: b2.rotation }) });
};
function ownKeys$s(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$s(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$s(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$s(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var calculateZoomData = function(a, b2, c2, d2) {
  if (a.factor === DEFAULT_ZOOM_FACTOR) return { x: 0, y: 0, factor: DEFAULT_ZOOM_FACTOR };
  var e2 = a.factor > b2.factor, f2 = { x: (a.x - b2.x || 0) / b2.factor, y: (a.y - b2.y || 0) / b2.factor }, g2 = { x: a.x - f2.x * a.factor, y: a.y - f2.y * a.factor };
  if (e2 && 1 === b2.factor || (g2.x = Math.min(0, Math.max(g2.x, c2 * (1 - b2.factor))), g2.y = Math.min(0, Math.max(g2.y, d2 * (1 - b2.factor)))), 1 > a.factor) {
    var h2 = c2 - c2 * a.factor, i = d2 - d2 * a.factor;
    g2.x += h2 / 2, g2.y += i / 2;
  }
  return _objectSpread$s(_objectSpread$s({}, g2), {}, { factor: a.factor });
};
var _excluded$8 = ["preparedDimensions"];
function ownKeys$r(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$r(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$r(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$r(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ZOOM_CANVAS = "ZOOM_CANVAS";
var MIN_ZOOM_FACTOR = 0.03, MAX_ZOOM_FACTOR = 60, zoomCanvas = function(a, b2) {
  var c2, d2 = restrictNumber(parseFloat(b2.factor).toFixed(2), MIN_ZOOM_FACTOR, MAX_ZOOM_FACTOR);
  if (b2.preparedDimensions) {
    b2.preparedDimensions;
    var f2 = _objectWithoutProperties(b2, _excluded$8);
    c2 = f2;
  } else {
    var g2, h2, i = { x: b2.x || 0 === b2.x ? null !== (g2 = b2.x) && void 0 !== g2 ? g2 : a.zoom.x : a.canvasWidth / 2, y: b2.y || 0 === b2.y ? null !== (h2 = b2.y) && void 0 !== h2 ? h2 : a.zoom.y : a.canvasHeight / 2 };
    c2 = calculateZoomData(_objectSpread$r(_objectSpread$r({}, i), {}, { factor: d2 }), b2.isAbsoluteZoom ? { factor: DEFAULT_ZOOM_FACTOR, x: null, y: null } : a.zoom, a.canvasWidth, a.canvasHeight);
  }
  return c2.factor === a.zoom.factor && c2.x === a.zoom.x && c2.y === a.zoom.y ? a : _objectSpread$r(_objectSpread$r({}, a), {}, { zoom: _objectSpread$r(_objectSpread$r({}, a.zoom), c2) });
};
function ownKeys$q(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$q(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$q(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$q(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_CANVAS_SIZE = "SET_CANVAS_SIZE";
var setCanvasSize = function(a, b2) {
  if (a.canvasWidth === b2.canvasWidth && a.canvasHeight === b2.canvasHeight) return a;
  var c2 = a.initialCanvasWidth, d2 = void 0 === c2 ? b2.canvasWidth : c2, e2 = a.initialCanvasHeight, f2 = void 0 === e2 ? b2.canvasHeight : e2, g2 = getDimensionsMinimalRatio(a.initialCanvasWidth, a.initialCanvasHeight, a.originalImage.width, a.originalImage.height), h2 = g2 * a.originalImage.width, i = g2 * a.originalImage.height, j2 = 1;
  if (d2 !== b2.canvasWidth || f2 !== b2.canvasHeight) {
    var k2 = b2.canvasWidth / h2, l2 = b2.canvasHeight / i;
    j2 = Math.min(k2, l2);
  }
  return _objectSpread$q(_objectSpread$q({}, a), {}, { initialCanvasWidth: d2, initialCanvasHeight: f2, canvasWidth: b2.canvasWidth, canvasHeight: b2.canvasHeight, canvasScale: j2 });
};
function ownKeys$p(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$p(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$p(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$p(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_ORIGINAL_IMAGE = "SET_ORIGINAL_IMAGE";
var setOriginalImage = function(a, b2) {
  return _objectSpread$p(_objectSpread$p({}, a), {}, { feedback: {}, originalImage: b2.originalImage, imgSrc: b2.originalImage.src });
};
function ownKeys$o(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$o(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$o(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$o(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_SHOWN_IMAGE_DIMENSIONS = "SET_SHOWN_IMAGE_DIMENSIONS";
var setShownImageDimensions = function(a, b2) {
  return _objectSpread$o(_objectSpread$o({}, a), {}, { shownImageDimensions: _objectSpread$o(_objectSpread$o({}, a.shownImageDimensions), b2.shownImageDimensions), designLayer: b2.designLayer || a.designLayer, previewGroup: b2.previewGroup || a.previewGroup });
};
function ownKeys$n(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$n(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$n(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$n(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var REMOVE_ANNOTATIONS = "REMOVE_ANNOTATIONS";
var removeAnnotations = function(a, b2) {
  var c2 = a.annotations, d2 = a.selectionsIds;
  return b2.annotationsIds.forEach(function(b3) {
    if (d2 = d2.filter(function(a2) {
      return a2 !== b3;
    }), a.designLayer && c2[b3]) {
      var e2 = a.designLayer.findOne("#".concat(b3));
      e2 && e2.destroy(), delete c2[b3];
    }
  }), _objectSpread$n(_objectSpread$n({}, a), {}, { isDesignState: b2.isDesignState || true, annotations: c2, selectionsIds: [] });
};
function ownKeys$m(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$m(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$m(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$m(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var DUPLICATE_ANNOTATIONS = "DUPLICATE_ANNOTATIONS";
var duplicateAnnotations = function(a, b2) {
  var c2 = a.annotations, d2 = {};
  return b2.annotationsIds.forEach(function(a2) {
    var b3 = c2[a2];
    if (b3) {
      var e2 = randomId(b3.name);
      d2[e2] = _objectSpread$m(_objectSpread$m({}, b3), {}, { id: e2, x: b3.x + 20, y: b3.y + 20 });
    }
  }), _objectSpread$m(_objectSpread$m({}, a), {}, { isDesignState: !b2.dismissHistory, annotations: _objectSpread$m(_objectSpread$m({}, c2), d2) });
};
function ownKeys$l(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$l(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$l(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$l(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ENABLE_TEXT_CONTENT_EDIT = "ENABLE_TEXT_CONTENT_EDIT";
var enableTextContentEdit = function(a, b2) {
  return _objectSpread$l(_objectSpread$l({}, a), {}, { textIdOfEditableContent: b2.textIdOfEditableContent || null });
};
function ownKeys$k(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$k(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$k(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$k(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_RESIZE = "SET_RESIZE";
var setResize = function(a, b2) {
  var c2;
  return _objectSpread$k(_objectSpread$k({}, a), {}, { isDesignState: !b2.dismissHistory, resize: _objectSpread$k(_objectSpread$k(_objectSpread$k({}, a.resize), b2), {}, { manualChangeDisabled: !(null === (c2 = b2.manualChangeDisabled) || void 0 === c2) && c2 }) });
};
function ownKeys$j(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$j(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$j(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$j(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_SAVED = "SET_SAVED";
var setSaved = function(a) {
  return a.haveNotSavedChanges ? _objectSpread$j(_objectSpread$j({}, a), {}, { haveNotSavedChanges: false }) : a;
};
function ownKeys$i(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$i(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$i(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$i(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var deepMerge = function(a) {
  var b2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, c2 = !!(2 < arguments.length && void 0 !== arguments[2]) && arguments[2], d2 = _objectSpread$i({}, a), e2 = Object.keys(b2);
  return e2.forEach(function(e3) {
    var f2 = b2[e3];
    if (void 0 !== f2) {
      var g2 = _typeof(f2);
      if ("object" !== g2 || f2 instanceof HTMLElement || null === f2 || Array.isArray(f2) || !a[e3] || "object" !== _typeof(a[e3])) return void (d2[e3] = c2 && Array.isArray(d2[e3]) && Array.isArray(f2) ? [].concat(_toConsumableArray(d2[e3]), _toConsumableArray(f2)) : f2);
      d2[e3] = deepMerge(a[e3], f2);
    }
  }), d2;
};
var UPDATE_STATE = "UPDATE_STATE";
var updateState = function(a, b2) {
  var c2 = b2 && "function" == typeof b2 ? b2(a) : b2;
  return c2 ? deepMerge(a, c2) : a;
};
function ownKeys$h(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$h(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$h(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$h(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_LATEST_COLOR = "SET_LATEST_COLOR";
var setLatestColor = function(a, b2) {
  return _objectSpread$h(_objectSpread$h({}, a), {}, { latestColors: _objectSpread$h(_objectSpread$h({}, a.latestColors), b2.latestColors) });
};
function ownKeys$g(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$g(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$g(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$g(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var SET_SHOWN_TABS_MENU = "SET_SHOWN_TABS_MENU";
var setShowTabsMenu = function(a, b2) {
  return _objectSpread$g(_objectSpread$g({}, a), {}, { showTabsMenu: b2.opened });
};
var _SET_ORIGINAL_IMAGE$S;
const actions = (_SET_ORIGINAL_IMAGE$S = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_IMAGE$S, SET_ORIGINAL_IMAGE, setOriginalImage), SET_FEEDBACK, setFeedback), SHOW_LOADER, showLoader), HIDE_LOADER, hideLoader), CHANGE_POINTER_ICON, changingPointerIcon), SELECT_ANNOTATION, selectAnnotation), CLEAR_ANNOTATIONS_SELECTIONS, clearAnnotationsSelections), TOGGLE_ORIGINAL_IMAGE_DISPLAY, toggleOriginalImageDisplay), SELECT_TAB, selectTab), SELECT_TOOL, selectTool), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_IMAGE$S, ZOOM_CANVAS, zoomCanvas), SET_CANVAS_SIZE, setCanvasSize), SET_SHOWN_IMAGE_DIMENSIONS, setShownImageDimensions), ENABLE_TEXT_CONTENT_EDIT, enableTextContentEdit), SET_LATEST_COLOR, setLatestColor), SET_SHOWN_TABS_MENU, setShowTabsMenu), ADD_FILTER, addFilter), SET_FINETUNE, setFinetune), SET_ANNOTATION, setAnnotation), SET_CROP, setCrop), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_SET_ORIGINAL_IMAGE$S, CHANGE_ROTATION, changeRotation), TOGGLE_FLIP, toggleFlip), SET_RESIZE, setResize), REMOVE_ANNOTATIONS, removeAnnotations), DUPLICATE_ANNOTATIONS, duplicateAnnotations), UNDO, undo), REDO, redo), RESET, reset), SET_SAVED, setSaved), UPDATE_STATE, updateState));
var SPACING_PERCENTAGE = 0.05, DEFAULT_SPACING = 12, getProperImageToCanvasSpacing = function() {
  return 2 * (window ? Math.min(window.innerHeight, window.innerWidth) * SPACING_PERCENTAGE : DEFAULT_SPACING);
};
var getRotatedPoint = function(a, b2) {
  var c2 = a.x, d2 = a.y, e2 = b2 * Math.PI / 180, f2 = Math.cos(e2), g2 = Math.sin(e2);
  return { x: c2 * f2 - d2 * g2, y: d2 * f2 + c2 * g2 };
}, getCenterRotatedPoint = function(a, b2, c2) {
  if (!a || !b2 || !c2 && 0 !== c2) return { x: 0, y: 0, rotation: c2 };
  var d2 = { x: -a / 2, y: -b2 / 2 }, e2 = getRotatedPoint(d2, 0), f2 = getRotatedPoint(d2, c2), g2 = f2.x - e2.x, h2 = f2.y - e2.y;
  return { x: g2, y: h2, rotation: c2 };
};
var nodesCommonPropTypes = { definitions: { id: PropTypes.string.isRequired, name: PropTypes.string.isRequired, rotation: PropTypes.number, scaleX: PropTypes.number, scaleY: PropTypes.number, stroke: PropTypes.string, strokeWidth: PropTypes.number, shadowOffsetX: PropTypes.number, shadowOffsetY: PropTypes.number, shadowBlur: PropTypes.number, shadowColor: PropTypes.string, shadowOpacity: PropTypes.number, opacity: PropTypes.number }, defaults: { rotation: 0, scaleX: 1, scaleY: 1, stroke: void 0, strokeWidth: void 0, shadowOffsetX: void 0, shadowOffsetY: void 0, shadowBlur: void 0, shadowColor: void 0, shadowOpacity: void 0, opacity: 1 } };
var _excluded$7 = ["id", "name", "fill", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity", "cornerRadius"];
function ownKeys$f(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$f(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$f(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$f(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var RectNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.fill, e2 = a.x, f2 = a.y, g2 = a.width, h2 = a.height, i = a.scaleX, j2 = a.scaleY, k2 = a.rotation, l2 = a.annotationEvents, m2 = a.stroke, n2 = a.strokeWidth, o = a.shadowOffsetX, p2 = a.shadowOffsetY, q2 = a.shadowBlur, r2 = a.shadowColor, s = a.shadowOpacity, t2 = a.opacity, u2 = a.cornerRadius, v2 = _objectWithoutProperties(a, _excluded$7);
  return React.createElement(Rect$2, _extends({ id: b2, name: c2, rotation: k2, scaleX: i, scaleY: j2, stroke: m2, strokeWidth: n2, shadowOffsetX: o, shadowOffsetY: p2, shadowBlur: q2, shadowColor: r2, shadowOpacity: s, fill: d2, x: e2, y: f2, width: g2, height: h2, opacity: t2, cornerRadius: u2 }, l2, v2));
};
RectNode.defaultProps = _objectSpread$f(_objectSpread$f({}, nodesCommonPropTypes.defaults), {}, { fill: "#000", cornerRadius: 0, width: 0, height: 0 });
var _excluded$6 = ["id", "name", "fill", "x", "y", "radiusX", "radiusY", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
function ownKeys$e(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$e(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$e(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$e(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var EllipseNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.fill, e2 = a.x, f2 = a.y, g2 = a.radiusX, h2 = a.radiusY, i = a.scaleX, j2 = a.scaleY, k2 = a.rotation, l2 = a.annotationEvents, m2 = a.stroke, n2 = a.strokeWidth, o = a.shadowOffsetX, p2 = a.shadowOffsetY, q2 = a.shadowBlur, r2 = a.shadowColor, s = a.shadowOpacity, t2 = a.opacity, u2 = _objectWithoutProperties(a, _excluded$6);
  return React.createElement(Ellipse$3, _extends({ id: b2, name: c2, rotation: k2, scaleX: i, scaleY: j2, stroke: m2, strokeWidth: n2, shadowOffsetX: o, shadowOffsetY: p2, shadowBlur: q2, shadowColor: r2, shadowOpacity: s, fill: d2, x: e2, y: f2, radiusX: g2, radiusY: h2, offsetX: -g2, offsetY: -h2, opacity: t2 }, l2, u2));
};
EllipseNode.defaultProps = _objectSpread$e(_objectSpread$e({}, nodesCommonPropTypes.defaults), {}, { fill: "#000", radiusX: 0, radiusY: 0 });
var _excluded$5 = ["id", "name", "fill", "x", "y", "radius", "scaleX", "scaleY", "rotation", "sides", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
function ownKeys$d(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$d(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$d(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$d(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var PolygonNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.fill, e2 = a.x, f2 = a.y, g2 = a.radius, h2 = a.scaleX, i = a.scaleY, j2 = a.rotation, k2 = a.sides, l2 = a.annotationEvents, m2 = a.stroke, n2 = a.strokeWidth, o = a.shadowOffsetX, p2 = a.shadowOffsetY, q2 = a.shadowBlur, r2 = a.shadowColor, s = a.shadowOpacity, t2 = a.opacity, u2 = _objectWithoutProperties(a, _excluded$5);
  return React.createElement(RegularPolygon$2, _extends({ id: b2, name: c2, rotation: j2, scaleX: h2, scaleY: i, stroke: m2, strokeWidth: n2, shadowOffsetX: o, shadowOffsetY: p2, shadowBlur: q2, shadowColor: r2, shadowOpacity: s, fill: d2, x: e2, y: f2, radius: g2, offsetX: -g2, offsetY: -g2, sides: k2, opacity: t2 }, l2, u2));
};
PolygonNode.defaultProps = _objectSpread$d(_objectSpread$d({}, nodesCommonPropTypes.defaults), {}, { fill: "#000", sides: 3 });
var _excluded$4 = ["id", "name", "text", "fontFamily", "fontSize", "fontStyle", "fill", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity", "letterSpacing", "lineHeight", "align"];
function ownKeys$c(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$c(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$c(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$c(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var TextNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.text, e2 = a.fontFamily, f2 = a.fontSize, g2 = a.fontStyle, h2 = a.fill, i = a.x, j2 = a.y, k2 = a.width, l2 = a.height, m2 = a.scaleX, n2 = a.scaleY, o = a.rotation, p2 = a.annotationEvents, q2 = a.stroke, r2 = a.strokeWidth, s = a.shadowOffsetX, t2 = a.shadowOffsetY, u2 = a.shadowBlur, v2 = a.shadowColor, w2 = a.shadowOpacity, x2 = a.opacity, y2 = a.letterSpacing, z2 = a.lineHeight, A2 = a.align, B2 = _objectWithoutProperties(a, _excluded$4);
  return React.createElement(Text$5, _extends({ id: b2, name: c2, rotation: o, scaleX: m2, scaleY: n2, stroke: q2, strokeWidth: r2, shadowOffsetX: s, shadowOffsetY: t2, shadowBlur: u2, shadowColor: v2, shadowOpacity: w2, opacity: x2, fill: h2, text: d2, fontFamily: e2, fontStyle: g2, fontSize: f2, letterSpacing: y2, lineHeight: z2, align: A2, x: i, y: j2, width: k2, height: l2 }, p2, B2));
};
TextNode.defaultProps = _objectSpread$c(_objectSpread$c({}, nodesCommonPropTypes.defaults), {}, { text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet tortor quis odio facilisis, id aliquet nulla facilisis. Etiam tincidunt tempor odio nec placerat.", fontFamily: "Arial", fontSize: 14, fill: "#000", width: 0, height: 0, letterSpacing: void 0, lineHeight: void 0, align: "left" });
var extractNameFromUrl = function(a) {
  var b2 = a.split("/");
  return b2[b2.length - 1].split("?")[0];
};
var loadImage = function(a, b2) {
  var c2 = !!(2 < arguments.length && arguments[2] !== void 0) && arguments[2];
  return new Promise(function(d2, e2) {
    var f2 = new Image();
    c2 || (f2.crossOrigin = "Anonymous"), f2.src = a, f2.name = null !== b2 && void 0 !== b2 ? b2 : extractNameFromUrl(a), f2.onload = function() {
      d2(f2);
    }, f2.onerror = function() {
      e2(new Error("Error in loading the image with the provided url: ".concat(a)));
    };
  });
};
var _excluded$3 = ["id", "name", "image", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
function ownKeys$b(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$b(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$b(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$b(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ImageNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.image, e2 = a.x, f2 = a.y, g2 = a.width, h2 = a.height, i = a.scaleX, j2 = a.scaleY, k2 = a.rotation, l2 = a.annotationEvents, m2 = a.stroke, n2 = a.strokeWidth, o = a.shadowOffsetX, p2 = a.shadowOffsetY, q2 = a.shadowBlur, r2 = a.shadowColor, s = a.shadowOpacity, t2 = a.opacity, u2 = _objectWithoutProperties(a, _excluded$3), v2 = reactExports.useState(null), w2 = _slicedToArray(v2, 2), x2 = w2[0], y2 = w2[1];
  reactExports.useEffect(function() {
    "string" == typeof d2 && loadImage(d2).then(y2);
  }, [d2]);
  var z2 = d2 instanceof HTMLImageElement;
  if (!z2 && !x2) return null;
  var A2 = z2 ? d2 : x2;
  return React.createElement(Image$3, _extends({ id: b2, name: c2, rotation: k2, scaleX: i, scaleY: j2, stroke: m2, strokeWidth: n2, shadowOffsetX: o, shadowOffsetY: p2, shadowBlur: q2, shadowColor: r2, shadowOpacity: s, image: A2, x: e2, y: f2, width: g2, height: h2, opacity: t2 }, u2, l2, u2));
};
ImageNode.defaultProps = _objectSpread$b(_objectSpread$b({}, nodesCommonPropTypes.defaults), {}, { width: 0, height: 0 });
var _excluded$2 = ["id", "name", "scaleX", "scaleY", "rotation", "annotationEvents", "points", "lineCap", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "tension", "opacity"];
function ownKeys$a(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$a(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$a(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$a(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var LineNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.scaleX, e2 = a.scaleY, f2 = a.rotation, g2 = a.annotationEvents, h2 = a.points, i = a.lineCap, j2 = a.stroke, k2 = a.strokeWidth, l2 = a.shadowOffsetX, m2 = a.shadowOffsetY, n2 = a.shadowBlur, o = a.shadowColor, p2 = a.shadowOpacity, q2 = a.tension, r2 = a.opacity, s = _objectWithoutProperties(a, _excluded$2);
  return React.createElement(Line$3, _extends({ id: b2, name: c2, rotation: f2, scaleX: d2, scaleY: e2, stroke: j2, strokeWidth: k2, shadowOffsetX: l2, shadowOffsetY: m2, shadowBlur: n2, shadowColor: o, shadowOpacity: p2, points: h2, lineCap: i, tension: q2, hitStrokeWidth: 20, x: 0, y: 0, opacity: r2 }, g2, s));
};
LineNode.defaultProps = _objectSpread$a(_objectSpread$a({}, nodesCommonPropTypes.defaults), {}, { stroke: "#000000", strokeWidth: 1, lineCap: "butt", annotationEvents: {}, tension: void 0 });
var _excluded$1 = ["id", "name", "fill", "pointerLength", "pointerWidth", "scaleX", "scaleY", "rotation", "annotationEvents", "points", "lineCap", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
function ownKeys$9(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$9(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$9(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$9(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ArrowNode = function(a) {
  var b2 = a.id, c2 = a.name, d2 = a.fill, e2 = a.pointerLength, f2 = a.pointerWidth, g2 = a.scaleX, h2 = a.scaleY, i = a.rotation, j2 = a.annotationEvents, k2 = a.points, l2 = a.lineCap, m2 = a.stroke, n2 = a.strokeWidth, o = a.shadowOffsetX, p2 = a.shadowOffsetY, q2 = a.shadowBlur, r2 = a.shadowColor, s = a.shadowOpacity, t2 = a.opacity, u2 = _objectWithoutProperties(a, _excluded$1);
  return React.createElement(Arrow$4, _extends({ id: b2, name: c2, rotation: i, scaleX: g2, scaleY: h2, stroke: m2, strokeWidth: n2, shadowOffsetX: o, shadowOffsetY: p2, shadowBlur: q2, shadowColor: r2, shadowOpacity: s, fill: d2, x: 0, y: 0, points: k2, pointerLength: e2, pointerWidth: f2, lineCap: l2, opacity: t2 }, j2, u2));
};
ArrowNode.defaultProps = _objectSpread$9(_objectSpread$9({}, nodesCommonPropTypes.defaults), {}, { stroke: "#000000", strokeWidth: 6, fill: void 0, lineCap: "butt", pointerLength: void 0, pointerWidth: void 0 });
var ANNOTATION_NAMES_TO_COMPONENT = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TOOLS_IDS.RECT, RectNode), TOOLS_IDS.ELLIPSE, EllipseNode), TOOLS_IDS.POLYGON, PolygonNode), TOOLS_IDS.TEXT, TextNode), TOOLS_IDS.IMAGE, ImageNode), TOOLS_IDS.LINE, LineNode), TOOLS_IDS.ARROW, ArrowNode), TOOLS_IDS.PEN, LineNode);
var MemoizedAnnotation = function(a) {
  var b2 = a.annotation, c2 = a.annotationEvents, d2 = a.selectionsIds, e2 = ANNOTATION_NAMES_TO_COMPONENT[b2.name];
  return e2 ? React.createElement(e2, _extends({ key: b2.id, annotationEvents: c2, draggable: d2.includes(b2.id) }, b2)) : null;
};
const MemoizedAnnotation$1 = reactExports.memo(MemoizedAnnotation);
var AnnotationNodes = function() {
  var a = useStore(), b2 = a.annotations, c2 = void 0 === b2 ? {} : b2, d2 = a.selectionsIds, e2 = void 0 === d2 ? [] : d2, f2 = useAnnotationEvents();
  return reactExports.useMemo(function() {
    return Object.values(c2).map(function(a2) {
      return React.createElement(MemoizedAnnotation$1, { key: a2.id, annotation: a2, annotationEvents: f2, selectionsIds: e2 });
    });
  }, [c2, f2, e2]);
};
var PreviewGroup = function(a, b2) {
  return React.createElement(Group$2, _extends({ ref: b2 }, a));
};
const PreviewGroup$1 = reactExports.forwardRef(PreviewGroup);
function ownKeys$8(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$8(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$8(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$8(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var CANVAS_TO_IMG_SPACING = getProperImageToCanvasSpacing(), MIN_SPACED_WIDTH = 10, DesignLayer = function() {
  var a, b2, c2, d2, e2 = reactExports.useRef(), f2 = useStore(), g2 = f2.initialCanvasWidth, h2 = f2.initialCanvasHeight, i = f2.canvasWidth, j2 = f2.canvasHeight, k2 = f2.dispatch, l2 = f2.toolId, m2 = f2.canvasScale, n2 = f2.originalImage, o = void 0 === n2 ? {} : n2, p2 = f2.finetunes, q2 = void 0 === p2 ? [] : p2, r2 = f2.finetunesProps, s = void 0 === r2 ? {} : r2, t2 = f2.filter, u2 = void 0 === t2 ? null : t2, v2 = f2.adjustments, w2 = void 0 === v2 ? {} : v2, x2 = w2.rotation, y2 = void 0 === x2 ? 0 : x2, z2 = w2.crop, A2 = void 0 === z2 ? {} : z2, B2 = w2.isFlippedX, C2 = w2.isFlippedY, D2 = f2.resize, E2 = reactExports.useRef(), F2 = reactExports.useRef(), G2 = l2 === TOOLS_IDS.CROP, H2 = reactExports.useMemo(function() {
    return u2 ? [].concat(_toConsumableArray(q2), [u2]) : q2;
  }, [q2, u2]), I2 = reactExports.useMemo(function() {
    var a2 = Math.max(MIN_SPACED_WIDTH, o.width - CANVAS_TO_IMG_SPACING), b3 = o.width / o.height;
    return { width: a2, height: a2 / b3 };
  }, [o]), J2 = reactExports.useMemo(function() {
    return getSizeAfterRotation(o.width, o.height, y2);
  }, [o, y2]), K2 = reactExports.useMemo(function() {
    return getDimensionsMinimalRatio(g2, h2, o.width, o.height);
  }, [o, g2, h2]), L2 = reactExports.useMemo(function() {
    return { width: I2.width * K2, height: I2.height * K2 };
  }, [I2, K2]), M2 = D2.width && !G2 ? D2.width / (null !== (a = null !== (b2 = A2.width) && void 0 !== b2 ? b2 : L2.width) && void 0 !== a ? a : J2.width) : 1, N2 = D2.height && !G2 ? D2.height / (null !== (c2 = null !== (d2 = A2.height) && void 0 !== d2 ? d2 : L2.height) && void 0 !== c2 ? c2 : J2.height) : 1, O2 = i / (2 * m2) - L2.width * M2 / 2, P2 = j2 / (2 * m2) - L2.height * N2 / 2, Q2 = i / (2 * m2) - L2.width / 2, R2 = j2 / (2 * m2) - L2.height / 2, S2 = reactExports.useMemo(function() {
    return { x: Math.round(O2), y: Math.round(P2), abstractX: Math.round(Q2), abstractY: Math.round(R2), width: L2.width, height: L2.height, scaledBy: m2 };
  }, [m2, O2, P2, Q2, R2, L2]), T2 = reactExports.useCallback(function() {
    E2.current ? E2.current.cache() : setTimeout(T2, 0);
  }, []), U2 = getSizeAfterRotation(S2.width, S2.height, y2), V2 = G2 ? 1 : getDimensionsMinimalRatio(S2.width, S2.height, U2.width, U2.height);
  if (reactExports.useEffect(function() {
    return o && T2(), function() {
      var a2;
      null === (a2 = E2.current) || void 0 === a2 || a2.clearCache();
    };
  }, [o]), reactExports.useEffect(function() {
    S2 && k2({ type: SET_SHOWN_IMAGE_DIMENSIONS, payload: { shownImageDimensions: S2, designLayer: e2.current, previewGroup: F2.current } });
  }, [S2]), !O2 || !P2 || !S2) return null;
  var W2 = getCenterRotatedPoint(A2.x, A2.y, y2), X2 = O2 + (!G2 && A2.width ? (B2 ? -1 : 1) * (S2.width / 2 - A2.x - A2.width / 2 + W2.x) * M2 : 0), Y2 = P2 + (!G2 && A2.height ? (C2 ? -1 : 1) * (S2.height / 2 - A2.y - A2.height / 2 + W2.y) * N2 : 0), Z2 = G2 ? Q2 : X2, $2 = G2 ? R2 : Y2, _2 = (B2 ? -1 : 1) * (G2 ? 1 : M2) * V2, aa2 = (C2 ? -1 : 1) * (G2 ? 1 : N2) * V2;
  return React.createElement(Layer$2, { id: DESIGN_LAYER_ID, ref: e2, xPadding: Z2, yPadding: $2, offsetX: L2.width / 2, offsetY: L2.height / 2, x: L2.width * M2 / 2 + Z2, y: L2.height * N2 / 2 + $2, scaleX: _2, scaleY: aa2, rotation: G2 ? 0 : y2, clipFunc: function clipFunc(a2) {
    var b3, c3 = G2 && !(null !== (b3 = e2.current) && void 0 !== b3 && null !== (b3 = b3.attrs) && void 0 !== b3 && b3.isSaving), d3 = c3 || A2.noEffect ? _objectSpread$8(_objectSpread$8({}, S2), {}, { x: 0, y: 0 }) : { width: A2.width || S2.width, height: A2.height || S2.height, x: A2.x || 0, y: A2.y || 0 };
    cropImage(a2, _objectSpread$8({ ratio: A2.ratio }, d3), c3), e2.current && e2.current.setAttrs({ clipX: d3.x, clipY: d3.y, clipWidth: d3.width, clipHeight: d3.height });
  } }, React.createElement(Image$3, _extends({ id: IMAGE_NODE_ID, image: o, width: L2.width, height: L2.height, offsetX: L2.width / 2, offsetY: L2.height / 2, x: L2.width / 2, y: L2.height / 2, listening: false, filters: H2, ref: E2 }, s)), React.createElement(AnnotationNodes, null), React.createElement(PreviewGroup$1, { ref: F2 }));
};
var compareRatios = function(a, b2) {
  return toPrecisedFloat(a) === toPrecisedFloat(b2);
};
function ownKeys$7(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$7(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$7(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$7(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var boundDragging = function(a, b2) {
  var c2 = b2.width - (2 * a.radiusX || a.width), d2 = b2.height - (2 * a.radiusY || a.height);
  return { x: toPrecisedFloat(Math.min(Math.max(a.x, 0), c2)), y: toPrecisedFloat(Math.min(Math.max(a.y, 0), d2)) };
};
var getPositionByPlaceLabel = function(a, b2, c2) {
  var d2 = a.split("-"), e2 = _slicedToArray(d2, 2), f2 = e2[0], g2 = e2[1], h2 = { x: 0, y: 0 };
  return "center" === f2 ? h2.y = b2.height / 2 - c2.height / 2 : "bottom" === f2 && (h2.y = b2.height - c2.height), "center" === g2 ? h2.x = b2.width / 2 - c2.width / 2 : "right" === g2 && (h2.x = b2.width - c2.width), h2;
};
var boundResizing = function(a, b2, c2, d2) {
  var e2 = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : {}, f2 = { x: toPrecisedFloat(c2.abstractX * c2.scaledBy), y: toPrecisedFloat(c2.abstractY * c2.scaledBy), width: toPrecisedFloat(c2.width * c2.scaledBy), height: toPrecisedFloat(c2.height * c2.scaledBy) }, g2 = _objectSpread$7({}, b2);
  if (b2.x < f2.x && (g2.x = f2.x, g2.width = a.x - f2.x + a.width), b2.y < f2.y && (g2.y = f2.y, g2.height = a.y - f2.y + a.height), g2.x + g2.width > f2.x + f2.width && (g2.width = f2.x + f2.width - g2.x), g2.y + g2.height > f2.y + f2.height && (g2.height = f2.y + f2.height - g2.y), "number" == typeof d2 && !compareRatios(g2.width / g2.height, d2)) {
    var h2 = g2.height * d2, i = g2.width / d2;
    toPrecisedFloat(g2.y + i) <= f2.y + f2.height ? g2.height = i : g2.width = h2;
  }
  if ((e2.minWidth && g2.width <= e2.minWidth || e2.maxWidth && g2.width >= e2.maxWidth) && (g2.width = restrictNumber(g2.width, e2.minWidth, e2.maxWidth), g2.x = a.x, g2.y = a.y, "number" == typeof d2 && (g2.height = g2.width / d2)), (e2.minHeight && b2.height <= e2.minHeight || e2.maxHeight && b2.height >= e2.maxHeight) && (g2.height = restrictNumber(g2.height, e2.minHeight, e2.maxHeight), g2.x = a.x, g2.y = a.y, "number" == typeof d2 && (g2.width = g2.height * d2)), "string" == typeof e2.lockCropAreaAt) {
    var j2 = getPositionByPlaceLabel(e2.lockCropAreaAt, f2, g2), k2 = j2.x, l2 = j2.y;
    g2.x = k2, g2.y = l2;
  }
  return g2;
};
function ownKeys$6(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$6(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$6(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$6(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var isFirstRenderCropUpdated = false, noEffectTextDimensions = { width: 200, height: 100 }, CropTransformer = function() {
  var a = useStore(), b2 = a.dispatch, c2 = a.theme, d2 = a.designLayer, e2 = a.originalImage, f2 = a.shownImageDimensions, g2 = a.adjustments, h2 = void 0 === g2 ? {} : g2, i = h2.crop, j2 = void 0 === i ? {} : i, k2 = h2.isFlippedX, l2 = h2.isFlippedY, m2 = a.resize, n2 = void 0 === m2 ? {} : m2, o = a.config, p2 = a.t, q2 = reactExports.useRef(), r2 = reactExports.useRef(), s = reactExports.useRef(), t2 = reactExports.useRef(), u2 = o[TOOLS_IDS.CROP], v2 = reactExports.useMemo(function() {
    var a2;
    return _objectSpread$6(_objectSpread$6({}, u2), {}, { lockCropAreaAt: null !== (a2 = j2.lockCropAreaAt) && void 0 !== a2 ? a2 : null === u2 || void 0 === u2 ? void 0 : u2.lockCropAreaAt });
  }, [j2.lockCropAreaAt, u2]), w2 = v2.lockCropAreaAt, z2 = j2.ratio || v2.ratio, A2 = z2 === CUSTOM_CROP, B2 = z2 === ELLIPSE_CROP, C2 = function() {
    return z2 === ORIGINAL_CROP ? e2.width / e2.height : z2;
  }, D2 = function(a2, c3) {
    var d3 = a2.width, e3 = a2.height, g3 = a2.x, h3 = a2.y, i2 = { x: k2 ? f2.width - g3 - d3 : g3, y: l2 ? f2.height - h3 - e3 : h3, width: d3, height: e3 }, m3 = j2.width >= n2.width && j2.height >= n2.height;
    n2.width && n2.height && (d3 < n2.width || e3 < n2.height) && m3 && b2({ type: SET_FEEDBACK, payload: { feedback: { message: p2("cropSizeLowerThanResizedWarning"), status: FEEDBACK_STATUSES.WARNING } } }), b2({ type: SET_CROP, payload: _objectSpread$6(_objectSpread$6(_objectSpread$6({}, j2), i2), {}, { dismissHistory: c3 }) });
  }, E2 = function(a2, b3) {
    var c3, d3;
    r2.current && q2.current && r2.current.nodes([q2.current]);
    var e3 = t2.current, f3 = { width: a2, height: b3, x: null !== (c3 = j2.x) && void 0 !== c3 ? c3 : 0, y: null !== (d3 = j2.y) && void 0 !== d3 ? d3 : 0 };
    D2(boundResizing(f3, f3, _objectSpread$6(_objectSpread$6({}, e3), {}, { abstractX: 0, abstractY: 0 }), !(A2 || B2) && C2(), v2), true);
  };
  if (reactExports.useEffect(function() {
    return d2 && r2.current && q2.current && (s.current && s.current.cache(), r2.current.nodes([q2.current])), function() {
      s.current && s.current.clearCache();
    };
  }, [d2, e2, f2]), reactExports.useEffect(function() {
    if (t2.current) {
      var a2, b3, c3 = t2.current;
      E2(null !== (a2 = j2.width) && void 0 !== a2 ? a2 : c3.width, null !== (b3 = j2.height) && void 0 !== b3 ? b3 : c3.height);
    }
  }, [z2]), reactExports.useEffect(function() {
    r2.current && q2.current && t2.current && j2.width && j2.height && E2(j2.width, j2.height);
  }, [v2, f2.width, f2.height]), reactExports.useEffect(function() {
    if (f2 && (t2.current = f2, !isFirstRenderCropUpdated && z2 && f2.x && f2.width)) {
      var a2, b3;
      E2(null !== (a2 = j2.width) && void 0 !== a2 ? a2 : f2.width, null !== (b3 = j2.height) && void 0 !== b3 ? b3 : f2.height), isFirstRenderCropUpdated = true;
    }
  }, [f2]), !d2) return null;
  var F2, G2 = (w2 || j2.noEffect) && [] || (A2 || B2 ? void 0 : ["top-left", "bottom-left", "top-right", "bottom-right"]), H2 = function(a2) {
    var b3 = !!(1 < arguments.length && void 0 !== arguments[1]) && arguments[1];
    a2.target && D2({ width: a2.target.width() * a2.target.scaleX(), height: a2.target.height() * a2.target.scaleY(), x: a2.target.x(), y: a2.target.y() }, b3);
  };
  if (!j2.width && !j2.height) {
    var I2 = 1 > f2.scaledBy ? f2.scaledBy : 1, J2 = _objectSpread$6(_objectSpread$6({}, f2), {}, { width: f2.width / I2, height: f2.height / I2 });
    F2 = boundResizing(J2, _objectSpread$6(_objectSpread$6({}, J2), {}, { x: 0, y: 0 }), _objectSpread$6(_objectSpread$6({}, J2), {}, { abstractX: 0, abstractY: 0 }), !(A2 || B2) && C2(), v2);
  } else F2 = j2;
  var K2 = F2, L2 = K2.x, M2 = void 0 === L2 ? 0 : L2, x2 = K2.y, N2 = void 0 === x2 ? 0 : x2, y2 = K2.width, O2 = K2.height, P2 = { x: k2 ? f2.width - M2 - y2 : M2, y: l2 ? f2.height - N2 - O2 : N2, ref: q2, fill: "#FFFFFF", scaleX: 1, scaleY: 1, globalCompositeOperation: "destination-out", onDragEnd: w2 ? void 0 : H2, onDragMove: w2 ? void 0 : function limitDragging(a2) {
    var b3 = a2.target;
    b3.setAttrs(boundDragging(b3.attrs, t2.current));
  }, onTransformEnd: w2 ? void 0 : H2, draggable: !w2 };
  return React.createElement(React.Fragment, null, React.createElement(Image$3, { image: e2, x: k2 ? f2.width : 0, y: l2 ? f2.height : 0, width: f2.width, height: f2.height, filters: [Konva$1.Filters.Blur, Konva$1.Filters.Brighten], blurRadius: 10, brightness: -0.3, scaleX: k2 ? -1 : 1, scaleY: l2 ? -1 : 1, ref: s }), B2 ? React.createElement(Ellipse$3, _extends({}, P2, { radiusX: y2 / 2, radiusY: O2 / 2, offset: { x: -y2 / 2, y: -O2 / 2 } })) : React.createElement(Rect$2, _extends({}, P2, { width: j2.noEffect ? 0 : y2, height: j2.noEffect ? 0 : O2 })), j2.noEffect && React.createElement(TextNode, { name: "Text", id: "no-preview-text-node", text: p2("cropItemNoEffect"), x: f2.width / 2 - noEffectTextDimensions.width / 2, y: f2.height / 2 - noEffectTextDimensions.height / 2, fontSize: 20, fill: "#ffffff", stroke: "#ff0000", strokeWidth: 0.2, shadowColor: "#ff0000", shadowBlur: 10, annotationEvents: {}, align: "center", width: noEffectTextDimensions.width, height: noEffectTextDimensions.height }), React.createElement(Transformer$2, { centeredScaling: false, flipEnabled: false, rotateEnabled: false, nodes: q2.current ? [q2.current] : [], anchorSize: 14, anchorCornerRadius: 7, enabledAnchors: G2, ignoreStroke: false, anchorStroke: c2.palette["accent-primary"], anchorFill: c2.palette["access-primary"], anchorStrokeWidth: 2, borderStroke: c2.palette["accent-primary"], borderStrokeWidth: 2, borderDash: [4], keepRatio: !A2 || !B2, ref: r2, boundBoxFunc: function boundBoxFunc(a2, b3) {
    return boundResizing(a2, b3, t2.current, !(A2 || B2) && C2(), v2);
  } }));
};
var NodesTransformer = function() {
  var a, b2 = useStore(), c2 = b2.selectionsIds, d2 = void 0 === c2 ? [] : c2, e2 = b2.theme, f2 = b2.designLayer, g2 = b2.dispatch, h2 = b2.config.useCloudimage, i = reactExports.useMemo(function() {
    return null !== f2 && void 0 !== f2 && f2.findOne ? d2.map(function(a2) {
      return f2.findOne("#".concat(a2));
    }).filter(Boolean) : [];
  }, [d2]), j2 = function() {
    1 === i.length && i[0].name() === TOOLS_IDS.TEXT && g2({ type: ENABLE_TEXT_CONTENT_EDIT, payload: { textIdOfEditableContent: i[0].id() } });
  }, k2 = h2 ? ["top-left", "bottom-left", "top-right", "bottom-right"] : void 0;
  return React.createElement(Transformer$2, { id: NODES_TRANSFORMER_ID, centeredScaling: false, rotationSnaps: [0, 45, 90, 135, 180, 225, 270, 315], nodes: i, rotateAnchorOffset: 30, anchorSize: 14, anchorCornerRadius: 7, padding: 1 === i.length ? null !== (a = i[0].attrs.padding) && void 0 !== a ? a : 1 : 1, ignoreStroke: false, anchorStroke: e2.palette["accent-primary"], anchorFill: e2.palette["access-primary"], anchorStrokeWidth: 2, borderStroke: e2.palette["accent-primary"], borderStrokeWidth: 2, borderDash: [4], rotateEnabled: !h2, onMouseOver: function changePointerIconToMove() {
    g2({ type: CHANGE_POINTER_ICON, payload: { pointerCssIcon: POINTER_ICONS.MOVE } });
  }, onMouseLeave: function changePointerIconToDraw() {
    g2({ type: CHANGE_POINTER_ICON, payload: { pointerCssIcon: POINTER_ICONS.DRAW } });
  }, onDblClick: j2, onDblTap: j2, enabledAnchors: k2, flipEnabled: !h2, shouldOverdrawWholeArea: true });
};
var TransformersLayer = function() {
  var a = useStore(), b2 = a.toolId, c2 = a.shownImageDimensions;
  return React.createElement(Layer$2, { id: TRANSFORMERS_LAYER_ID, x: c2.abstractX || 0, y: c2.abstractY || 0 }, React.createElement(NodesTransformer, null), b2 === TOOLS_IDS.CROP && React.createElement(CropTransformer, null));
};
var StyledNodeControls = qe.div.withConfig({ componentId: "sc-1tst9ex-0" })(function(a) {
  var b2 = a.theme, c2 = a.top, d2 = a.left;
  return "\n  position: absolute;\n  z-index: 1;\n  background: ".concat(b2.palette["bg-secondary"], ";\n  border-radius: 2px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  box-shadow: 0px 1px 2px ").concat(b2.palette["light-shadow"], ";\n  top: ").concat((c2 || 0) + 8, "px;\n  left: ").concat((d2 || 0) + 4, "px;\n  transform: translateX(-50%);\n  height: 32px;\n");
});
var NodeControls = function() {
  var a = useStore(), b2 = a.selectionsIds, c2 = void 0 === b2 ? [] : b2, d2 = a.designLayer, e2 = a.annotations, f2 = a.dispatch, g2 = reactExports.useState({ left: 0, top: 0 }), h2 = _slicedToArray(g2, 2), i = h2[0], j2 = h2[1], k2 = reactExports.useMemo(function() {
    var a2;
    return null === d2 || void 0 === d2 || null === (a2 = d2.getStage()) || void 0 === a2 ? void 0 : a2.findOne("#".concat(NODES_TRANSFORMER_ID));
  }, [d2]), l2 = c2.length, m2 = debounce$1(function() {
    k2 && j2({ left: (k2.x() + k2.width() / 2) * k2.scaleX(), top: (k2.y() + k2.height()) * k2.scaleY() });
  }, 0);
  if (reactExports.useEffect(function() {
    m2();
  }, [c2, k2, e2]), 0 === l2 || !k2) return null;
  return React.createElement(StyledNodeControls, { className: "FIE_annotation-controls-overlay", left: i.left, top: i.top }, c2[0] !== WATERMARK_ANNOTATION_ID$1 && React.createElement(IconButton, { color: "basic", size: "sm", onClick: function duplicateSelectedNodes() {
    f2({ type: DUPLICATE_ANNOTATIONS, payload: { annotationsIds: c2 } });
  } }, React.createElement(Duplicate, null)), React.createElement(IconButton, { color: "basic", size: "sm", onClick: function removeSelectedNodes() {
    f2({ type: REMOVE_ANNOTATIONS, payload: { annotationsIds: c2 } });
  } }, React.createElement(DeleteOutline, null)));
};
function ownKeys$5(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$5(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$5(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$5(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
function getDistance(a, b2) {
  return Math.sqrt(Math.pow(b2.x - a.x, 2) + Math.pow(b2.y - a.y, 2));
}
function getCenter(a, b2) {
  return { x: (a.x + b2.x) / 2, y: (a.y + b2.y) / 2 };
}
var lastCenter = null, lastDist = 0;
var zoomOnTouchesMove = function(a, b2) {
  a.evt.preventDefault();
  var c2 = a.evt.touches[0], d2 = a.evt.touches[1];
  if (c2 && d2) {
    var e2 = a.currentTarget;
    e2.isDragging() && e2.stopDrag();
    var f2 = { x: c2.clientX, y: c2.clientY }, g2 = { x: d2.clientX, y: d2.clientY };
    if (!lastCenter) return void (lastCenter = getCenter(f2, g2));
    var h2 = getCenter(f2, g2), i = getDistance(f2, g2);
    lastDist || (lastDist = i);
    var j2 = e2.attrs.zoomFactor || DEFAULT_ZOOM_FACTOR, k2 = { x: (h2.x - e2.x()) / j2, y: (h2.y - e2.y()) / j2 }, l2 = (j2 || DEFAULT_ZOOM_FACTOR) * (i / lastDist), m2 = h2.x - lastCenter.x, n2 = h2.y - lastCenter.y, o = { x: h2.x - k2.x * l2 + m2, y: h2.y - k2.y * l2 + n2 };
    lastDist = i, lastCenter = h2, b2(_objectSpread$5(_objectSpread$5({}, o), {}, { factor: l2, preparedDimensions: true }));
  }
};
var endTouchesZooming = function(a) {
  lastDist = 0, lastCenter = null, "function" == typeof a && a();
};
var CanvasContainer = qe.div.withConfig({ componentId: "sc-3ln9py-0" })(["width:100%;position:relative;height:calc(100% - 112px - 16px);overflow:hidden;min-height:250px;padding:16px;flex-grow:1;"]), StyledOrignalImage = qe.img.withConfig({ componentId: "sc-3ln9py-1" })(["max-width:98%;max-height:98%;box-shadow:0 0 0 5px rgba(0,0,0,0.1);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:2;"]), StyledCanvasNode = qe(Stage$1).withConfig({ componentId: "sc-3ln9py-2" })(["outline:none;background:", ";"], function(a) {
  var b2 = a.theme;
  return b2.palette["bg-hover"];
});
function ownKeys$4(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$4(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$4(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$4(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var ZOOM_DELTA_TO_SCALE_CONVERT_FACTOR = 6e-3, CanvasNode = function(a) {
  var b2 = a.children;
  useStrictMode(true);
  var c2 = reactExports.useRef(), d2 = useStore(), f2 = d2.dispatch, g2 = d2.pointerCssIcon, h2 = d2.tabId, i = d2.toolId, j2 = d2.canvasWidth, k2 = d2.canvasHeight, l2 = d2.canvasScale, m2 = d2.selectionsIds, n2 = void 0 === m2 ? [] : m2, o = d2.zoom, p2 = void 0 === o ? {} : o, q2 = d2.config, r2 = q2.previewPixelRatio, s = q2.disableZooming;
  Konva$1.pixelRatio = r2;
  var t2 = DEFAULT_ZOOM_FACTOR, u2 = !s && i !== TOOLS_IDS.CROP, v2 = reactExports.useState(h2 !== TABS_IDS.ANNOTATE && h2 !== TABS_IDS.WATERMARK && p2.factor > t2), w2 = _slicedToArray(v2, 2), x2 = w2[0], y2 = w2[1], z2 = reactExports.useMemo(function() {
    return { cursor: g2 === POINTER_ICONS.DEFAULT && h2 === TABS_IDS.ANNOTATE ? POINTER_ICONS.DRAW : g2 };
  }, [h2, g2]), A2 = function(a2) {
    f2({ type: ZOOM_CANVAS, payload: a2 });
  }, B2 = reactExports.useCallback(function(a2) {
    var b3, c3;
    a2.evt.preventDefault(), null === (b3 = (c3 = a2.currentTarget).container) || void 0 === b3 || b3.call(c3).focus(), a2.target instanceof Konva$1.Stage && 0 < n2.length && f2({ type: CLEAR_ANNOTATIONS_SELECTIONS });
  }, [n2]), C2 = function() {
    return y2(h2 !== TABS_IDS.ANNOTATE || h2 === TABS_IDS.WATERMARK);
  }, D2 = function(a2) {
    ("Space" === a2.code || "Control" === a2.key) && !a2.repeat && p2.factor > t2 && u2 && (a2.preventDefault(), y2(true), f2({ type: CHANGE_POINTER_ICON, payload: { pointerCssIcon: POINTER_ICONS.DRAG } }));
  }, E2 = function(a2) {
    "Space" === a2.code && (a2.preventDefault(), C2());
  }, F2 = function() {
    c2.current && c2.current.container().focus();
  };
  reactExports.useEffect(function() {
    f2({ type: CHANGE_POINTER_ICON, payload: { pointerCssIcon: POINTER_ICONS[x2 ? "DRAG" : "DEFAULT"] } });
  }, [x2]), reactExports.useEffect(function() {
    y2(h2 !== TABS_IDS.ANNOTATE && h2 !== TABS_IDS.WATERMARK && p2.factor > t2);
    var a2;
    return c2.current && (a2 = c2.current.container(), a2.addEventListener("mouseenter", F2), a2.addEventListener("keydown", D2), a2.addEventListener("keyup", E2)), function() {
      a2 && (a2.removeEventListener("mouseenter", F2), a2.removeEventListener("keydown", D2), a2.removeEventListener("keyup", E2));
    };
  }, [h2, p2.factor, t2]);
  var G2 = l2 * (u2 && p2.factor || t2);
  return React.createElement(StyledCanvasNode, { className: "FIE_canvas-node", tabIndex: -1, ref: c2, width: j2, height: k2, scaleX: G2, scaleY: G2, x: u2 && p2.x || null, y: u2 && p2.y || null, zoomFactor: u2 && p2.factor || t2, onWheel: u2 ? function handleZoom(a2) {
    a2.evt.preventDefault();
    var b3 = (p2.factor || t2) + a2.evt.deltaY * -ZOOM_DELTA_TO_SCALE_CONVERT_FACTOR, c3 = a2.currentTarget.getPointerPosition();
    A2(_objectSpread$4(_objectSpread$4({}, c3), {}, { factor: b3 }));
  } : void 0, onTap: B2, onClick: B2, onTouchMove: u2 ? function(a2) {
    return zoomOnTouchesMove(a2, A2);
  } : void 0, onDragStart: function preventDraggingIfMultiTouches(a2) {
    var b3;
    1 < (null === (b3 = a2.evt.touches) || void 0 === b3 ? void 0 : b3.length) && y2(false);
  }, onTouchEnd: u2 ? function endTouchesZoomingEnablePanning() {
    endTouchesZooming(C2);
  } : void 0, dragBoundFunc: function dragBoundFunc(a2) {
    var b3 = Math.min(0, Math.max(a2.x, j2 * (1 - p2.factor))), c3 = Math.min(0, Math.max(a2.y, k2 * (1 - p2.factor)));
    return { x: b3, y: c3 };
  }, draggable: u2 && x2, onDragEnd: function handleCanvasDragEnd(a2) {
    a2.currentTarget.draggable() && "stage" === a2.target.nodeType.toLowerCase() && u2 && x2 && A2({ factor: p2.factor, x: a2.target.x(), y: a2.target.y(), preparedDimensions: true });
  }, style: z2 }, b2);
};
const CanvasNode$1 = reactExports.memo(CanvasNode);
var MainCanvas = function() {
  var a = useResizeObserver(), b2 = _slicedToArray(a, 1), c2 = b2[0], d2 = useStore(), e2 = reactExports.useRef(null), f2 = reactExports.useCallback(function(a2) {
    var b3 = a2.width, c3 = a2.height;
    d2.dispatch({ type: SET_CANVAS_SIZE, payload: { canvasWidth: b3, canvasHeight: c3 } });
  }, []);
  return reactExports.useEffect(function() {
    c2(e2.current, f2);
  }, []), React.createElement(CanvasContainer, { className: "FIE_canvas-container", ref: e2 }, !d2.textIdOfEditableContent && React.createElement(NodeControls, null), d2.isShowOriginalImage && React.createElement(StyledOrignalImage, { className: "FIE_original-image-compare", src: d2.originalImage.src }), React.createElement(CanvasNode$1, null, React.createElement(AppProviderOverridenValue, { overridingValue: d2 }, React.createElement(DesignLayer, null), React.createElement(TransformersLayer, null))));
};
var StyledSeparator = qe.div.withConfig({ componentId: "sc-etsyb6-0" })(["display:inline-block;height:", ";width:", ";border-radius:1px;background:", ";"], function(a) {
  return a.height;
}, function(a) {
  return a.width;
}, function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BordersSecondary];
});
var Separator = function(a) {
  var b2 = a.height, c2 = a.width;
  return React.createElement(StyledSeparator, { height: b2, width: c2 });
};
Separator.defaultProps = { height: "24px", width: "1px" };
var StyledTopbar = qe.div.withConfig({ componentId: "sc-21g986-0" })(["padding:16px;box-sizing:border-box;position:relative;width:100%;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;border-bottom:1px solid ", ";[data-phone='true'] &{padding:6px 6px 4px 6px;", "}"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BordersSecondary];
}, function(a) {
  var b2 = a.isPhoneScreen;
  return b2 && "\n      padding: 12px 12px 0px;\n      gap: 12px;\n    ";
}), StyledMainButtonsWrapper = qe.div.withConfig({ componentId: "sc-21g986-1" })(["display:flex;align-items:center;order:1;"]), StyledControlButtonsWrapper = qe.div.withConfig({ componentId: "sc-21g986-2" })(["display:flex;align-items:center;order:3;gap:4px;"]), StyledHistoryButton = qe(IconButton).withConfig({ componentId: "sc-21g986-3" })(["margin:", ";svg{color:", ";}"], function(a) {
  var b2 = a.margin;
  return null !== b2 && void 0 !== b2 ? b2 : "0 4px";
}, function(a) {
  var b2 = a.theme.palette, c2 = a.disabled;
  return c2 ? b2[Color.IconsMuted] : b2[Color.IconsPrimary];
}), StyledZoomingWrapper = qe.div.withConfig({ componentId: "sc-21g986-4" })(["display:flex;align-items:center;gap:2px;"]), StyledDimensionsLabel = qe(Label$5).withConfig({ componentId: "sc-21g986-5" })(["flex-shrink:0;color:", ";", ";"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.TextPlaceholder];
}, function(a) {
  var b2 = a.theme.typography;
  return b2.font[FontVariant.LabelMedium];
}), StyledSmallButton = qe(IconButton).withConfig({ componentId: "sc-21g986-6" })(["padding:8px;svg{color:", ";}"], function(a) {
  var b2 = a.theme.palette, c2 = a.showBackButton;
  return c2 ? b2[Color.IconsPrimary] : b2[Color.IconsMuted];
}), StyledFlexCenterAlignedContainer = qe.div.withConfig({ componentId: "sc-21g986-7" })(["width:", ";height:32px;display:block;width:100%;order:4;", ";@media (min-width:761px){display:flex;align-items:center;justify-content:center;width:fit-content;order:2;}"], function(a) {
  var b2 = a.showBackButton;
  return b2 ? "318px" : "384px";
}, function(a) {
  var b2 = a.reverseDirection;
  return b2 ? "flex-direction: row-reverse" : "";
}), StyledZoomPercentageLabel = qe(Label$5).withConfig({ componentId: "sc-21g986-8" })(["cursor:pointer;color:", ";", ";"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.TextPrimary];
}, function(a) {
  var b2 = a.theme.typography;
  return b2.font[FontVariant.InputMd];
}), StyledBackButtonLabel = qe.span.withConfig({ componentId: "sc-21g986-9" })(["", ";"], function(a) {
  var b2 = a.theme.typography;
  return b2.font[FontVariant.ButtonMdEmphasis];
}), StyledCloseButton = qe(CrossButton).withConfig({ componentId: "sc-21g986-10" })(["padding:8px;z-index:111;"]);
qe(Button).withConfig({ componentId: "sc-21g986-11" })(["padding:4px 12px;"]);
var StyledFileNameInput = qe(InputGroup).withConfig({ componentId: "sc-21g986-12" })([""]), StyledFileExtensionSelect = qe(SelectGroup).withConfig({ componentId: "sc-21g986-13" })(["margin-top:16px;"]), StyledQualityWrapper = qe.div.withConfig({ componentId: "sc-21g986-14" })(["width:100%;margin-top:16px;"]), StyledResizeOnSave = qe.div.withConfig({ componentId: "sc-21g986-15" })(["margin-top:16px;width:100%;"]), StyledResizeOnSaveLabel = qe(Label$5).withConfig({ componentId: "sc-21g986-16" })(["margin-bottom:4px;"]), StyledHistoryButtons = qe.div.withConfig({ componentId: "sc-21g986-17" })(["display:flex;gap:6px;"]), StyledImageOptionsButtons = qe.div.withConfig({ componentId: "sc-21g986-18" })(["display:flex;gap:12px;justify-content:", ";"], function(a) {
  var b2 = a.isPhoneScreen;
  return b2 ? "space-between" : "center";
}), StyledMenuIconButton = qe(IconButton).withConfig({ componentId: "sc-21g986-19" })(["@media (min-width:761px){display:none;}"]), StyledDimensionsButtons = qe.div.withConfig({ componentId: "sc-21g986-20" })(["display:flex;gap:12px;align-items:center;"]);
var StyledModal = qe(Modal$1).withConfig({ componentId: "sc-kpjpf5-0" })(["width:", ";max-width:unset;"], function(a) {
  var b2 = a.width;
  return b2 || "300px";
}), StyledModalTitle = qe(ModalTitle).withConfig({ componentId: "sc-kpjpf5-1" })(function(a) {
  var b2 = a.theme, c2 = a.isWarning;
  return Ae(["padding-bottom:0;.SfxModalTitle-Icon{background-color:", ";}.SfxModalTitle-LabelPrimary{margin-bottom:24px;", ";}.SfxModalTitle-LabelSecondary{", ";text-align:center;}"], c2 && b2.palette[Color.Orange_0_1_Overlay], b2.typography.font[FontVariant.TitleH3], b2.typography.font[FontVariant.TextLarge]);
}), StyledModalActions = qe(ModalActions$1).withConfig({ componentId: "sc-kpjpf5-2" })(["gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}"]);
var Modal = function(a) {
  var b2 = a.title, c2 = a.hint, d2 = a.Icon, f2 = a.onDone, g2 = a.onCancel, h2 = a.doneLabel, i = a.cancelLabel, j2 = a.isOpened, k2 = a.doneButtonStyle, l2 = a.doneButtonColor, m2 = void 0 === l2 ? "basic" : l2, n2 = a.cancelButtonColor, o = void 0 === n2 ? "basic" : n2, p2 = a.children, q2 = a.areButtonsDisabled, r2 = a.zIndex, s = a.className, t2 = a.width, u2 = a.isWarning;
  return React.createElement(StyledModal, { className: s, open: j2, onClose: g2, style: { zIndex: r2 }, onKeyUp: function onKeyUp(a2) {
    "Enter" === a2.key && f2(a2);
  }, width: t2 }, React.createElement(StyledModalTitle, { icon: React.createElement(d2, { size: 25 }), iconShadow: true, isWarning: u2, onClose: g2, primary: b2, secondary: c2, variant: "with-icon" }), p2 && React.createElement(ModalContent, null, p2), React.createElement(StyledModalActions, { align: "center" }, React.createElement(Button, { color: o, onClick: g2, size: "md", disabled: q2 }, i), React.createElement(Button, { color: m2, onClick: f2, size: "md", warning: u2, style: k2, disabled: q2 }, h2)));
};
Modal.defaultProps = { hint: "", isOpened: false, doneLabel: "Yes", cancelLabel: "No", doneButtonStyle: void 0, doneButtonColor: "basic", cancelButtonColor: "basic", children: void 0, areButtonsDisabled: false, zIndex: void 0, className: void 0, width: "", isWarning: false };
var ConfirmationModal = function(a) {
  var b2 = a.children, c2 = a.isReset, d2 = useStore(), e2 = d2.t, f2 = d2.theme, g2 = d2.config, h2 = d2.dispatch, i = d2.isResetted, j2 = d2.haveNotSavedChanges, k2 = d2.config.onClose, l2 = reactExports.useState(false), m2 = _slicedToArray(l2, 2), n2 = m2[0], o = m2[1];
  if ("function" != typeof k2 && !c2) return React.createElement("span", null);
  var p2 = function() {
    o(false);
  }, q2 = reactExports.useCallback(function() {
    h2({ type: RESET, payload: { config: g2 } }), p2();
  }, [g2]), r2 = function() {
    c2 || (k2(CLOSING_REASONS.CLOSE_BUTTON, j2), q2());
  };
  return React.createElement(React.Fragment, null, React.cloneElement(b2, { onClick: !(void 0 !== i) || i ? r2 : function openModal() {
    o(true);
  } }), n2 && React.createElement(Modal, { title: c2 ? e2("warning") : e2("discardChanges"), hint: c2 ? e2("changesLoseWarningHint") : e2("discardChangesWarningHint"), isOpened: n2, onCancel: p2, onDone: c2 ? q2 : r2, Icon: function WarningIcon() {
    return React.createElement(Warning, { color: f2.palette.warning, size: 25 });
  }, doneLabel: e2("confirm"), doneButtonColor: "warning-primary", cancelLabel: e2("cancel"), width: "400px", isWarning: true }));
};
ConfirmationModal.defaultProps = { isReset: false };
var CloseButton = function() {
  var a = useStore(), b2 = a.config.onClose;
  return "function" == typeof b2 ? React.createElement(React.Fragment, null, React.createElement(Separator, null), React.createElement(ConfirmationModal, null, React.createElement(StyledCloseButton, { className: "FIE_topbar-close-button", color: "basic", size: "md" }, React.createElement(CrossOutline, null)))) : null;
};
var getDefaultSaveQuality = function(a) {
  return 0 >= a || 1 < a ? DEFAULT_SAVE_QUALITY : a;
};
function ownKeys$3(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$3(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$3(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$3(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var sliderStyle = { marginBottom: 16 }, saveButtonWrapperStyle = { minWidth: 67, width: "fit-content" }, saveButtonMenuStyle = { marginLeft: 12 }, isFieSaveMounted = true, SaveButton = function() {
  var a = useStore(), b2 = reactExports.useRef(), c2 = a.theme, d2 = a.dispatch, e2 = a.originalImage, f2 = a.resize, g2 = a.isLoadingGlobally, h2 = a.haveNotSavedChanges, i = a.feedback, j2 = a.hasUndo, k2 = a.t, l2 = a.adjustments, m2 = void 0 === l2 ? {} : l2, n2 = m2.crop, o = a.config, p2 = o.onClose, q2 = o.closeAfterSave, r2 = o.onBeforeSave, s = o.onSave, t2 = o.forceToPngInEllipticalCrop, u2 = o.defaultSavedImageName, v2 = o.defaultSavedImageType, w2 = o.defaultSavedImageQuality, x2 = void 0 === w2 ? DEFAULT_SAVE_QUALITY : w2, y2 = o.useCloudimage, z2 = o.moreSaveOptions, A2 = o.disableSaveIfNoChanges, B2 = o.removeSaveButton, C2 = reactExports.useState(false), D2 = _slicedToArray(C2, 2), E2 = D2[0], F2 = D2[1], G2 = reactExports.useState({ quality: getDefaultSaveQuality(x2) }), H2 = _slicedToArray(G2, 2), I2 = H2[0], J2 = H2[1], K2 = useTransformedImgData(), L2 = ["jpeg", "jpg", "webp"].includes(I2.extension), M2 = 0 === i.duration, N2 = function handleSave() {
    var a2 = K2(I2, false, true), c3 = b2.current || s, e3 = c3(a2.imageData, a2.designState), f3 = function hideLoadingSpinner() {
      d2({ type: HIDE_LOADER });
    };
    e3 instanceof Promise ? e3["finally"](f3) : f3(), b2.current = null, q2 && p2 && p2(CLOSING_REASONS.AFTER_SAVE, h2);
  }, O2 = function startSaving() {
    d2({ type: SHOW_LOADER }), F2(false), setTimeout(N2, 3);
  }, P2 = function validateInfoThenSave() {
    var a2 = b2.current || s;
    if ("function" != typeof a2) throw new Error("Please provide onSave function handler.");
    return I2.name && I2.extension ? void O2() : void d2({ type: SET_FEEDBACK, payload: { feedback: { message: k2("nameIsRequired") } } });
  }, Q2 = function triggerSaveHandler() {
    if (!A2 || j2) {
      if (y2) {
        var a2 = K2(I2), c3 = b2.current || s;
        return void c3(a2.imageData, a2.designState);
      }
      return b2.current || "function" != typeof r2 || false !== r2(I2) ? void F2(true) : void P2();
    }
  }, R2 = function changeSaveFnAndTriggerAnother(a2, c3) {
    if ("function" == typeof a2) b2.current = a2, c3();
    else throw new Error("onSave function callback is required as an argument to the passed function.");
  }, S2 = function setFileNameAndExtension() {
    var a2 = getFileFullName(u2 || e2.name, t2 && n2.ratio === ELLIPSE_CROP ? "png" : SUPPORTED_IMAGE_TYPES.includes(null === v2 || void 0 === v2 ? void 0 : v2.toLowerCase()) && v2), b3 = a2.name, c3 = a2.extension;
    J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { name: b3, extension: c3 }));
  };
  if (reactExports.useEffect(function() {
    e2 && S2();
  }, [e2]), reactExports.useEffect(function() {
    !e2 || I2.name && I2.extension || S2();
  }, [E2]), reactExports.useEffect(function() {
    J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { size: { width: f2.width, height: f2.height } }));
  }, [f2]), reactExports.useEffect(function() {
    return isFieSaveMounted = true, function() {
      isFieSaveMounted = false;
    };
  }, []), B2) return null;
  var T2 = Array.isArray(z2) && 0 < z2.length ? z2.map(function(a2, b3) {
    return _objectSpread$3(_objectSpread$3({}, a2), {}, { key: "".concat(a2.label || b3, "-option-key"), onClick: "function" == typeof a2.onClick ? function() {
      return a2.onClick(function(a3) {
        return R2(a3, Q2);
      }, function(a3) {
        return R2(a3, O2);
      });
    } : void 0 });
  }) : [];
  return React.createElement(React.Fragment, null, React.createElement(ButtonWithMenu, { className: "FIE_topbar-save", color: "primary", onClick: Q2, menuPosition: "bottom", menuFromBtn: true, label: 0 < T2.length ? k2("saveAs") : k2("save"), menuItems: T2, menuStyle: saveButtonMenuStyle, wrapperStyle: saveButtonWrapperStyle, disabled: g2 || A2 && !j2 || M2, noMargin: true }), E2 && React.createElement(Modal, { className: "FIE_save-modal", title: k2("saveAsModalTitle"), Icon: function Icon2(a2) {
    return React.createElement(Image22, _extends({ color: c2.palette["accent-primary"] }, a2));
  }, isOpened: E2, onCancel: function cancelModal() {
    isFieSaveMounted && E2 && (b2.current = null, F2(false));
  }, onDone: P2, doneLabel: k2("save"), cancelLabel: k2("cancel"), doneButtonColor: "primary", areButtonsDisabled: g2, zIndex: 11110 }, React.createElement(StyledFileNameInput, { className: "FIE_save-file-name-input", value: I2.name, onChange: function changeFileName(a2) {
    var b3 = a2.target.value;
    J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { name: b3 }));
  }, size: "sm", label: k2("name"), placeholder: k2("imageName"), error: !I2.name, fullWidth: true, focusOnMount: true }), React.createElement(StyledFileExtensionSelect, { className: "FIE_save-extension-selector", onChange: function onChange2(a2) {
    return J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { extension: a2 }));
  }, value: I2.extension, label: k2("format"), placeholder: k2("extension"), size: "sm", fullWidth: true }, SUPPORTED_IMAGE_TYPES.map(function(a2) {
    return React.createElement(MenuItem, { key: a2, value: a2 }, a2);
  })), L2 && React.createElement(StyledQualityWrapper, { className: "FIE_save-quality-wrapper" }, React.createElement(Label$5, null, k2("quality")), React.createElement(Slider, { annotation: "%", min: 1, max: 100, onChange: function changeQuality(a2) {
    J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { quality: restrictNumber(a2 / 100, 0.01, 1) }));
  }, value: parseInt(100 * I2.quality, 10), width: "100%", style: sliderStyle })), React.createElement(StyledResizeOnSave, { className: "FIE_save-resize-wrapper" }, React.createElement(StyledResizeOnSaveLabel, null, k2("resize")), React.createElement(Resize, { onChange: function resizeImageFile(a2) {
    J2(_objectSpread$3(_objectSpread$3({}, I2), {}, { size: _objectSpread$3(_objectSpread$3({}, I2.size), a2) }));
  }, currentSize: (null === I2 || void 0 === I2 ? void 0 : I2.size) || {}, hideResetButton: true, alignLeft: true, alignment: "space-between" }))));
};
var ResetButton = function(a) {
  var b2 = a.margin, c2 = useStore(), d2 = c2.isResetted, e2 = c2.feedback, f2 = c2.t, g2 = 0 === e2.duration;
  return React.createElement(ConfirmationModal, { isReset: true }, React.createElement(StyledHistoryButton, { className: "FIE_topbar-reset-button", color: "basic", size: "sm", disabled: !(void 0 !== d2) || d2 || g2, title: f2("resetOperations"), margin: b2 }, React.createElement(Reset, null)));
};
ResetButton.defaultProps = { margin: void 0 };
var UndoButton = function(a) {
  var b2 = a.margin, c2 = useStore(), d2 = c2.dispatch, e2 = c2.hasUndo, f2 = void 0 !== e2 && e2, g2 = c2.t, h2 = c2.feedback, i = 0 === h2.duration, j2 = reactExports.useCallback(function() {
    d2({ type: UNDO });
  }, []);
  return React.createElement(StyledHistoryButton, { className: "FIE_topbar-undo-button", color: "basic", size: "sm", onClick: f2 ? j2 : void 0, disabled: !f2 || i, title: g2("undoTitle"), margin: b2 }, React.createElement(Undo, null));
};
UndoButton.defaultProps = { margin: void 0 };
var RedoButton = function(a) {
  var b2 = a.margin, c2 = useStore(), d2 = c2.dispatch, e2 = c2.hasRedo, f2 = void 0 !== e2 && e2, g2 = c2.t, h2 = reactExports.useCallback(function() {
    d2({ type: REDO });
  }, []);
  return React.createElement(StyledHistoryButton, { className: "FIE_topbar-redo-button", color: "basic", size: "sm", onClick: f2 ? h2 : void 0, disabled: !f2, title: g2("redoTitle"), margin: b2 }, React.createElement(Redo, null));
};
RedoButton.defaultProps = { margin: void 0 };
var ZOOM_FACTORS_PRESETS = [{ labelKey: "fitSize", factor: "fit" }, { labelKey: "actualSize", factor: 1 }, { label: "25%", factor: 0.25 }, { label: "50%", factor: 0.5 }, { label: "75%", factor: 0.75 }, { label: "125%", factor: 1.25 }, { label: "170%", factor: 1.7 }, { label: "300%", factor: 3 }, { label: "500%", factor: 5 }, { label: "1000%", factor: 10 }];
var MULTIPLY_ZOOM_FACTOR = 1.1, CanvasZooming = function(a) {
  var b2 = a.showBackButton, c2 = useStore(), d2 = c2.dispatch, e2 = c2.zoom, f2 = void 0 === e2 ? {} : e2, g2 = c2.toolId, h2 = c2.feedback, i = c2.t, j2 = c2.shownImageDimensions, k2 = c2.resize, l2 = c2.originalImage, m2 = c2.adjustments.crop, n2 = c2.config.useZoomPresetsMenu, o = 0 === h2.duration, p2 = reactExports.useState(null), q2 = _slicedToArray(p2, 2), r2 = q2[0], s = q2[1], t2 = function(a2, b3) {
    d2({ type: ZOOM_CANVAS, payload: { factor: a2, isAbsoluteZoom: b3 } });
  }, u2 = function() {
    var a2 = k2.width && k2.height && k2 || m2.width && m2.height && m2 || j2, b3 = getZoomFitFactor(m2.width && m2.height && m2 || j2, a2);
    t2(b3 || DEFAULT_ZOOM_FACTOR, true);
  }, v2 = function(a2) {
    s(r2 ? null : a2.target);
  }, w2 = function(a2) {
    if ("fit" === a2) return u2(), void v2();
    var b3 = k2.width || k2.height ? a2 : Math.min(a2 * l2.width / j2.width, a2 * l2.height / j2.height);
    t2(b3, true), v2();
  }, x2 = g2 === TOOLS_IDS.CROP || o, y2 = !l2 || k2.width || k2.height ? f2.factor : Math.min(j2.width * f2.factor / l2.width, j2.height * f2.factor / l2.height);
  return React.createElement(StyledZoomingWrapper, null, React.createElement(StyledSmallButton, { onClick: function zoomOut() {
    t2(f2.factor / MULTIPLY_ZOOM_FACTOR);
  }, color: "basic", title: i("zoomOutTitle"), disabled: x2, showBackButton: b2, className: "FIE_topbar-zoom-out-btn" }, React.createElement(MinusOutline, null)), React.createElement(StyledZoomPercentageLabel, { title: i("toggleZoomMenuTitle"), onClick: x2 ? void 0 : n2 && v2 || u2, "aria-disabled": x2, className: "FIE_topbar-zoom-label" }, "".concat(toPrecisedFloat(100 * y2, 0), "%")), React.createElement(StyledSmallButton, { onClick: function zoomIn() {
    t2(f2.factor * MULTIPLY_ZOOM_FACTOR);
  }, color: "basic", title: i("zoomInTitle"), disabled: x2, showBackButton: b2, className: "FIE_topbar-zoom-in-btn" }, React.createElement(PlusOutline, null)), React.createElement(Menu$1, { anchorEl: r2, onClose: v2, open: !!r2, position: "bottom", className: "FIE_topbar-zoom-menu" }, ZOOM_FACTORS_PRESETS.map(function(a2) {
    var b3 = a2.factor, c3 = a2.labelKey, d3 = a2.label;
    return React.createElement(MenuItem, { key: d3 || c3, onClick: function onClick() {
      return w2(b3);
    } }, React.createElement(MenuItemLabel, null, null !== d3 && void 0 !== d3 ? d3 : i(c3)));
  })));
};
CanvasZooming.defaultProps = { showBackButton: false };
var ImageDimensionsAndDisplayToggle = function(a) {
  var b2 = a.showBackButton, c2 = a.isPhoneScreen, d2 = useStore(), e2 = d2.dispatch, f2 = d2.isResetted, g2 = !(void 0 !== f2) || f2, h2 = d2.originalImage, i = d2.resize, j2 = void 0 === i ? {} : i, k2 = d2.adjustments, l2 = k2.crop, m2 = k2.rotation, n2 = void 0 === m2 ? 0 : m2, o = d2.shownImageDimensions, p2 = d2.config.disableZooming, q2 = d2.t, r2 = function() {
    e2({ type: TOGGLE_ORIGINAL_IMAGE_DISPLAY, payload: { isShow: false } }), document.removeEventListener("mouseup", r2), document.removeEventListener("mouseleave", r2), document.removeEventListener("touchcancel", r2), document.removeEventListener("touchend", r2);
  }, s = function() {
    e2({ type: TOGGLE_ORIGINAL_IMAGE_DISPLAY, payload: { isShow: true } }), document.addEventListener("mouseup", r2), document.addEventListener("mouseleave", r2), document.addEventListener("touchcancel", r2), document.addEventListener("touchend", r2);
  };
  if (!h2) return null;
  var t2 = getProperDimensions(j2, l2, o, h2, n2);
  return React.createElement(StyledImageOptionsButtons, { isPhoneScreen: c2 }, React.createElement(StyledDimensionsLabel, { title: q2("imageDimensionsHoverTitle") }, "".concat(t2.width, " x ").concat(t2.height, " px")), React.createElement(StyledDimensionsButtons, null, React.createElement(StyledSmallButton, { color: "basic", onMouseDown: g2 ? void 0 : s, onTouchStart: g2 ? void 0 : s, disabled: g2, showBackButton: b2, title: q2("showImageTitle") }, React.createElement(Compare, null)), !p2 && React.createElement(React.Fragment, null, React.createElement(Separator, null), React.createElement(CanvasZooming, { showBackButton: b2 }))));
};
ImageDimensionsAndDisplayToggle.defaultProps = { showBackButton: false, isPhoneScreen: false };
var BackButton = function() {
  var a = useStore(), b2 = a.t, c2 = usePhoneScreen();
  return React.createElement(ConfirmationModal, null, React.createElement(Button, { className: "FIE_topbar-back-button", color: "link-secondary", size: "sm", startIcon: React.createElement(ArrowLeftOutline$1, null) }, !c2 && React.createElement(StyledBackButtonLabel, null, b2("back"))));
};
var Topbar = function(a) {
  var b2 = a.toggleMainMenu, c2 = useStore(), d2 = c2.config.showBackButton, e2 = usePhoneScreen(320);
  return React.createElement(StyledTopbar, { className: "FIE_topbar", isPhoneScreen: e2 }, React.createElement(StyledMainButtonsWrapper, { className: "FIE_topbar-buttons-wrapper" }, React.createElement(StyledMenuIconButton, { className: "FIE_tabs_toggle_btn", size: e2 ? "sm" : "lg", color: "basic", onClick: function onClick() {
    return b2(true);
  } }, function(a2) {
    return React.createElement(Menu, a2);
  }), d2 ? React.createElement(BackButton, null) : React.createElement(SaveButton, null)), React.createElement(StyledFlexCenterAlignedContainer, { className: "FIE_topbar-center-options", showBackButton: d2 }, React.createElement(ImageDimensionsAndDisplayToggle, { showBackButton: d2, isPhoneScreen: e2 })), React.createElement(StyledControlButtonsWrapper, null, React.createElement(StyledHistoryButtons, { className: "FIE_topbar-history-buttons" }, React.createElement(ResetButton, { margin: "0", showBackButton: d2 }), React.createElement(UndoButton, { margin: "0", showBackButton: d2 }), React.createElement(RedoButton, { margin: "0", showBackButton: d2 })), d2 ? React.createElement(SaveButton, null) : React.createElement(CloseButton, null)));
};
Topbar.defaultProps = { toggleMainMenu: function toggleMainMenu() {
} };
var StyledTabItem = qe.div.withConfig({ componentId: "sc-qhd6ow-0" })(function(a) {
  var b2 = a.theme;
  return "\n    width: 72px;\n    min-height: 66px;\n    padding: 4px 2px;\n    border-radius: 4px;\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n    background: ".concat(b2.palette[Color.BackgroundStateless], ";\n    align-items: center;\n    justify-content: center;\n\n    [data-phone='true'] & {\n      margin-bottom: 0;\n      height: 50px;\n      border-radius: 0;\n    }\n\n    svg {\n      color: ").concat(b2.palette[Color.IconsPrimary], ";\n    }\n\n    &,\n    * {\n      cursor: pointer;\n    }\n\n    &:hover {\n      background: ").concat(b2.palette["bg-primary-active"], ";\n    }\n\n    &[aria-selected='true'] {\n      background: ").concat(b2.palette["bg-primary-active"], ";\n\n      * {\n        color: ").concat(b2.palette["accent-primary-active"], ";\n      }\n    }\n  ");
}), StyledTabItemLabel = qe(Label$5).withConfig({ componentId: "sc-qhd6ow-1" })(function(a) {
  var b2 = a.theme;
  return "\n  color: ".concat(b2.palette[Color.TextPrimary], ";\n  ").concat(b2.typography.font[FontVariant.LabelSmall], ";\n  font-size: 12px;\n  line-height: 14px;\n\n  span {\n    white-space: normal;\n  }\n\n  [data-phone='true'] & {\n    font-size: 10px;\n  }\n");
});
var TabItem = function(a) {
  var b2 = a.id, c2 = a.label, d2 = a.Icon, e2 = a.isSelected, f2 = a.onClick, g2 = reactExports.useCallback(function() {
    "function" == typeof f2 && f2(b2);
  }, [b2]);
  return React.createElement(StyledTabItem, { className: "FIE_tab", "aria-selected": e2, onClick: g2 }, React.createElement(d2, { size: 24 }), c2 && React.createElement(StyledTabItemLabel, { className: "FIE_tab-label" }, c2));
};
TabItem.defaultProps = { isSelected: false, onClick: void 0, label: void 0 };
const TabItem$1 = reactExports.memo(TabItem);
var AVAILABLE_TABS = [{ id: TABS_IDS.ADJUST, labelKey: "adjustTab", icon: CropFrame }, { id: TABS_IDS.FINETUNE, labelKey: "finetuneTab", icon: FineTune }, { id: TABS_IDS.FILTERS, labelKey: "filtersTab", icon: ImageFilters, hideFn: function hideFn3(a) {
  var b2 = a.useCloudimage;
  return b2;
} }, { id: TABS_IDS.WATERMARK, labelKey: "watermarkTab", icon: Watermark$1 }, { id: TABS_IDS.ANNOTATE, labelKey: "annotateTabLabel", icon: Annotate, hideFn: function hideFn4(a) {
  var b2 = a.useCloudimage;
  return b2;
} }, { id: TABS_IDS.RESIZE, labelKey: "resizeTab", icon: Resize$1 }];
var Tabs = function(a) {
  var b2 = a.toggleMainMenu, c2 = a.isDrawer, d2 = useStore(), e2 = d2.t, f2 = d2.tabId, g2 = void 0 === f2 ? null : f2, h2 = d2.dispatch, i = d2.config, j2 = i.defaultTabId, k2 = i.tabsIds, l2 = i.useCloudimage, m2 = reactExports.useCallback(function(a2) {
    h2({ type: SELECT_TAB, payload: { tabId: a2 } }), b2(false);
  }, []), n2 = reactExports.useMemo(function() {
    var a2 = [];
    return 0 < Object.keys(k2).length ? AVAILABLE_TABS.forEach(function(b3) {
      var c3 = k2.indexOf(b3.id);
      -1 !== c3 && (a2[c3] = b3);
    }) : a2 = AVAILABLE_TABS, (0 < a2.length ? a2 : AVAILABLE_TABS).filter(function(a3) {
      var b3 = a3.hideFn;
      return !b3 || !b3({ useCloudimage: l2 });
    });
  }, [k2]);
  if (1 === n2.length) return null;
  var o = function(a2) {
    var b3 = a2.id, c3 = a2.labelKey, d3 = a2.icon;
    return React.createElement(TabItem$1, { key: b3, id: b3, label: e2(c3), Icon: d3, isSelected: (g2 || j2) === b3, onClick: m2 });
  };
  return React.createElement(React.Fragment, null, n2.map(function(a2) {
    return c2 ? React.createElement(DrawerItem, { key: a2.id }, o(a2)) : o(a2);
  }));
};
Tabs.defaultProps = { toggleMainMenu: function toggleMainMenu2() {
}, isDrawer: false };
var ToolsBarItemOptionsWrapper = function(a) {
  var b2 = a.children, c2 = a.isPhoneScreen;
  return React.createElement(StyledToolsBarItemOptionsWrapper, { className: "FIE_tool-options-wrapper", hasChildren: !!b2, isPhoneScreen: c2 }, b2);
};
ToolsBarItemOptionsWrapper.defaultProps = { children: void 0, isPhoneScreen: false };
var style = { maxWidth: "100%", width: "100%" }, ToolsBar = function(a) {
  var b2, c2 = a.isPhoneScreen, d2 = useStore(), e2 = d2.t, f2 = d2.dispatch, g2 = d2.tabId, h2 = d2.toolId, i = d2.annotations, j2 = d2.selectionsIds, k2 = void 0 === j2 ? [] : j2, l2 = d2.config, m2 = l2.defaultTabId, n2 = l2.defaultToolId, o = l2.useCloudimage, p2 = g2 || m2, q2 = h2 || n2 || (null === (b2 = TABS_TOOLS[p2]) || void 0 === b2 ? void 0 : b2[0]), r2 = reactExports.useMemo(function() {
    return TABS_TOOLS[p2] || [];
  }, [p2]), s = reactExports.useCallback(function(a2) {
    f2({ type: SELECT_TOOL, payload: { toolId: a2 } });
  }, []), t2 = reactExports.useMemo(function() {
    return r2.map(function(a2) {
      var b3 = TOOLS_ITEMS[a2], c3 = b3.Item, d3 = b3.hideFn;
      return c3 && (!d3 || !d3({ useCloudimage: o })) && React.createElement(c3, { key: a2, selectTool: s, t: e2, isSelected: q2 === a2 });
    });
  }, [r2, q2]), u2 = reactExports.useMemo(function() {
    var a2, b3, c3;
    if (!q2) return false;
    if (p2 === TABS_IDS.ANNOTATE) {
      var d3 = k2.length;
      if (1 === d3) {
        var e3, f3 = i[k2[0]];
        return null === (e3 = TOOLS_ITEMS[f3.name]) || void 0 === e3 ? void 0 : e3.ItemOptions;
      }
      if (1 < d3) return null;
    }
    return p2 && q2 && TABS_TOOLS[p2].includes(q2) && (!(null !== (a2 = TOOLS_ITEMS[h2]) && void 0 !== a2 && a2.hideFn) || !(null !== (b3 = TOOLS_ITEMS[h2]) && void 0 !== b3 && b3.hideFn({ useCloudimage: o }))) && (null === (c3 = TOOLS_ITEMS[h2]) || void 0 === c3 ? void 0 : c3.ItemOptions);
  }, [p2, q2, i, k2]);
  return reactExports.useEffect(function() {
    !h2 && q2 && f2({ type: SELECT_TOOL, payload: { toolId: q2 } });
  }, []), React.createElement(StyledToolsBar, { className: "FIE_tools-bar-wrapper" }, React.createElement(ToolsBarItemOptionsWrapper, { isPhoneScreen: c2 }, u2 && React.createElement(u2, { t: e2 })), t2 && React.createElement(StyledToolsBarItems, { className: "FIE_tools-bar", isPhoneScreen: c2 }, p2 === TABS_IDS.WATERMARK ? t2 : React.createElement(Carousel, { className: "FIE_tools", style }, t2)));
};
ToolsBar.defaultProps = { isPhoneScreen: false };
var defaultAnchorOrigin = { horizontal: "center", vertical: "bottom" }, ERROR_TO_ROBOT_STATUS = _defineProperty(_defineProperty({}, FEEDBACK_STATUSES.ERROR, "error"), FEEDBACK_STATUSES.WARNING, "warning"), FeedbackPopup = function(a) {
  var b2, c2 = a.anchorOrigin, d2 = useStore(), e2 = d2.feedback, f2 = void 0 === e2 ? {} : e2, g2 = d2.dispatch;
  if (!f2.message) return null;
  return React.createElement(Popup, { className: "FIE_feedback-robot", anchorOrigin: c2, autoHideDuration: null !== (b2 = f2.duration) && void 0 !== b2 ? b2 : 5e3, message: f2.message, open: !!f2.message, status: ERROR_TO_ROBOT_STATUS[f2.status || FEEDBACK_STATUSES.ERROR], onClose: function onClose2() {
    g2({ type: SET_FEEDBACK, payload: { feedback: {} } });
  } });
};
FeedbackPopup.defaultProps = { anchorOrigin: defaultAnchorOrigin };
var spin = We(["to{transform:rotate(360deg);}"]), StyledSpinnerWrapper = qe.div.withConfig({ componentId: "sc-m42fbk-0" })(["background:", ";display:flex;align-items:center;justify-content:center;position:absolute;z-index:11111;top:0;bottom:0;right:0;left:0;flex-direction:column;user-select:none;"], function(a) {
  var b2 = a.theme.palette;
  return b2[Color.BackgroundStateless];
}), StyledSpinner = qe(Loading).withConfig({ componentId: "sc-m42fbk-1" })(["animation:", " 1.2s infinite;"], spin);
var Spinner = function(a) {
  var b2 = a.theme;
  return React.createElement(StyledSpinnerWrapper, { className: "FIE_spinner-wrapper" }, React.createElement(StyledSpinner, { size: 50, color: b2.palette[Color.AccentStateless] }));
};
Spinner.defaultProps = { theme: {} };
var _excluded = ["cropX2", "cropY2", "crop", "watermark"];
function ownKeys$2(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$2(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$2(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$2(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var propertyToOperation = function(a, b2) {
  var c2 = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : {}, d2 = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : {}, e2 = CLOUDIMG_TO_EDITOR_POSITIONS[b2];
  switch (a) {
    case "wat_text":
      return { watermark: { text: b2.replaceAll("+", " ") } };
    case "wat_font":
      return { watermark: { fontFamily: b2 } };
    case "wat_color":
      return { watermark: { fill: "#".concat(b2) } };
    case "wat_fontsize":
      return { watermark: { fontSize: parseFloat(b2) } };
    case "wat_opacity":
      return { watermark: { opacity: parseFloat(b2) } };
    case "wat_pos": {
      var f2 = b2.split(","), g2 = _slicedToArray(f2, 2), h2 = g2[0], i = g2[1];
      return { watermark: { x: parseFloat(h2) / 100 * c2.width, y: parseFloat(i) / 100 * c2.height } };
    }
    case "wat_url":
      return { watermark: { image: decodeURIComponent(b2) } };
    case "wat_scale": {
      var j2 = b2.split(","), k2 = _slicedToArray(j2, 2), l2 = k2[0], m2 = k2[1];
      return { watermark: { width: parseFloat(l2) / 100 * (c2.width || 0), height: parseFloat(m2) / 100 * (c2.height || 0) } };
    }
    case "tl_px": {
      var n2 = b2.split(","), o = _slicedToArray(n2, 2), p2 = o[0], q2 = o[1];
      return { crop: { x: mapNumber(parseFloat(p2), 0, d2.width, 0, c2.width), y: mapNumber(parseFloat(q2), 0, d2.height, 0, c2.height) } };
    }
    case "br_px": {
      var r2 = b2.split(","), s = _slicedToArray(r2, 2), t2 = s[0], u2 = s[1];
      return { cropX2: mapNumber(parseFloat(t2), 0, d2.width, 0, c2.width), cropY2: mapNumber(parseFloat(u2), 0, d2.height, 0, c2.height) };
    }
    case "round":
      return { crop: { ratio: ELLIPSE_CROP } };
    case "gravity":
      return { crop: e2 ? { lockCropAreaAt: e2, width: null, height: null } : { noEffect: true, ratio: b2, ratioTitleKey: b2, width: null, height: null } };
    case "aspect_ratio":
      return { crop: { ratio: +b2 } };
    case "w":
      return { resize: { width: parseFloat(b2) } };
    case "h":
      return { resize: { height: parseFloat(b2) } };
    case "r":
      return { adjustments: { rotation: -parseInt(b2, 10) } };
    case "flip":
    case "mirror":
      return { adjustments: { isFlippedX: b2.includes("x") || b2.includes("h"), isFlippedY: b2.includes("y") || b2.includes("v") } };
    default: {
      var v2;
      if (Object.keys(finetuneNameToParamInfo).forEach(function(b3) {
        finetuneNameToParamInfo[b3].cloudimage.name === a.toLowerCase() && (v2 = b3);
      }), !v2) return null;
      var w2 = finetuneNameToParamInfo[v2], x2 = w2.cloudimage, y2 = w2.internal;
      return { finetunes: [Konva$1.Filters[v2]], finetunesProps: _defineProperty({}, y2.propName, mapNumber(parseFloat(b2), x2.min, x2.max, y2.min, y2.max)) };
    }
  }
}, cloudimageQueryToDesignState = function(a, b2, c2) {
  if (!a) return null;
  var d2 = a.split("&"), e2 = {};
  d2.forEach(function(a2) {
    var d3 = a2.split("="), f3 = _slicedToArray(d3, 2), g3 = f3[0], h3 = f3[1], i2 = propertyToOperation(g3, h3, b2, c2);
    i2 && (e2 = deepMerge(e2, i2, true));
  });
  var f2 = e2, g2 = f2.cropX2, h2 = f2.cropY2, i = f2.crop, j2 = f2.watermark, k2 = _objectWithoutProperties(f2, _excluded), l2 = _objectSpread$2(_objectSpread$2(_objectSpread$2({}, k2), g2 && h2 && i || null !== i && void 0 !== i && i.noEffect || null !== i && void 0 !== i && i.lockCropAreaAt ? { adjustments: _objectSpread$2(_objectSpread$2({}, k2.adjustments), {}, { crop: _objectSpread$2({ width: (g2 || 0) - i.x, height: (h2 || 0) - i.y }, i) }) } : {}), {}, { annotations: _objectSpread$2({}, j2 ? _defineProperty({}, WATERMARK_ANNOTATION_ID$1, _objectSpread$2(_objectSpread$2({}, j2), {}, { x: ((null === i || void 0 === i ? void 0 : i.x) || 0) + (j2.x || 0), y: ((null === i || void 0 === i ? void 0 : i.y) || 0) + (j2.y || 0), id: WATERMARK_ANNOTATION_ID$1, name: j2.text ? TOOLS_IDS.TEXT : TOOLS_IDS.IMAGE }, j2.text ? { width: j2.text.length * j2.fontSize, height: j2.fontSize } : {})) : {}) });
  return l2;
};
var isSameImage = function(a, b2) {
  return a && b2 && (a instanceof HTMLImageElement && a.src === b2.src && a.width === b2.width && a.height === b2.height || ((null === a || void 0 === a ? void 0 : a.src) || a) === b2.src);
};
var useUpdateEffect = function(a, b2) {
  var c2 = reactExports.useRef(true);
  reactExports.useEffect(function() {
    return function() {
      c2.current = true;
    };
  }, []), reactExports.useEffect(function() {
    if (c2.current) c2.current = false;
    else if ("function" == typeof a) return a();
  }, b2);
};
var StyledAppWrapper = qe.div.attrs(function(a) {
  var b2, c2, d2 = a.$size, e2 = void 0 === d2 ? {} : d2;
  return { style: { width: null !== (b2 = e2.width) && void 0 !== b2 ? b2 : "100%", height: null !== (c2 = e2.height) && void 0 !== c2 ? c2 : "100%" } };
}).withConfig({ componentId: "sc-ugtqr7-0" })(["display:flex;flex-direction:column;align-items:center;height:100%;max-height:100%;width:100%;max-width:100%;overflow:auto;border-radius:8px;position:relative;min-height:250px;background:", ";", ""], function(a) {
  var b2 = a.theme;
  return b2.palette["bg-secondary"];
}, function(a) {
  var b2 = a.showTabsDrawer;
  return b2 && "\n      overflow: unset;\n  ";
}), StyledMainContent = qe.div.withConfig({ componentId: "sc-ugtqr7-1" })(["display:flex;align-items:flex-start;width:100%;box-sizing:border-box;height:calc(100% - 95px);flex-grow:1;[data-phone='true'] &{padding:0;}"]), StyledCanvasAndTools = qe.div.withConfig({ componentId: "sc-ugtqr7-2" })(["height:100%;width:calc(100% - 80px);flex-grow:1;overflow-y:auto;display:flex;flex-direction:column;", ""], function(a) {
  var b2 = a.showTabsDrawer;
  return b2 && "\n     overflow-y: unset;\n  ";
}), StyledTabs = qe.div.withConfig({ componentId: "sc-ugtqr7-3" })(["min-width:108px;height:100%;padding:16px;display:flex;flex-direction:column;gap:16px;overflow-y:auto;max-height:100%;box-shadow:6px 8px 12px 0px rgba(146,166,188,0.14);[data-phone='true'] &{display:flex;padding:0;}"]), StyledDrawer = qe(Drawer).withConfig({ componentId: "sc-ugtqr7-4" })(["transition:transform 200ms ease-in-out;width:92px;height:100%;padding:12px;.SfxDrawer-list,.SfxDrawer-item{padding:0;}"]);
var TabsDrawer = function(a) {
  var b2 = a.toggleMainMenu, c2 = useStore(), d2 = c2.t, e2 = c2.showTabsMenu;
  return React.createElement(StyledDrawer, { className: "FIE_tabs-drawer", open: e2, onClose: function onClose2() {
    return b2(false);
  }, disablePortal: true }, React.createElement(DrawerHeader, null, React.createElement(Button, { color: "link-basic-secondary", startIcon: React.createElement(Menu, null), onClick: function onClick() {
    return b2(false);
  } }, d2("tabsMenu"))), React.createElement(DrawerBody, null, React.createElement(DrawerList, null, React.createElement(Tabs, { toggleMainMenu: b2, isDrawer: true }))));
};
TabsDrawer.defaultProps = { toggleMainMenu: function toggleMainMenu3() {
} };
function ownKeys$1(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread$1(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys$1(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys$1(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
var App = function() {
  var a = useStore(), b2 = a.config, c2 = a.isLoadingGlobally, d2 = a.haveNotSavedChanges, e2 = a.dispatch, f2 = a.originalImage, g2 = a.shownImageDimensions, h2 = a.t, i = a.theme, j2 = a.feedback, k2 = void 0 === j2 ? {} : j2, l2 = b2.loadableDesignState, m2 = b2.useCloudimage, n2 = b2.cloudimage, o = b2.source, p2 = b2.avoidChangesNotSavedAlertOnLeave, q2 = b2.useBackendTranslations, r2 = b2.translations, s = b2.language, t2 = b2.defaultSavedImageName, u2 = b2.observePluginContainerSize, v2 = b2.showCanvasOnly, w2 = b2.getCurrentImgDataFnRef, x2 = b2.updateStateFnRef, y2 = b2.noCrossOrigin, z2 = b2.resetOnImageSourceChange, A2 = window.matchMedia("(max-width: 760px)").matches, B2 = useResizeObserver(), C2 = _slicedToArray(B2, 2), D2 = C2[0], E2 = C2[1], F2 = reactExports.useState({ width: void 0, height: void 0 }), G2 = _slicedToArray(F2, 2), H2 = G2[0], I2 = G2[1], J2 = usePhoneScreen(), K2 = reactExports.useRef(null), L2 = reactExports.useRef(false), M2 = reactExports.useRef(null), N2 = reactExports.useRef(d2), O2 = useTransformedImgData(), P2 = reactExports.useCallback(function(a2) {
    e2({ type: SET_ORIGINAL_IMAGE, payload: { originalImage: a2 } });
  }, []), Q2 = reactExports.useCallback(function(a2) {
    e2({ type: SET_FEEDBACK, payload: { feedback: { message: a2.message || a2, duration: 0 } } });
  }, []), R2 = function(a2) {
    return new Promise(function(b3) {
      var c3 = (null === a2 || void 0 === a2 ? void 0 : a2.src) || a2;
      if (M2.current === c3 || !c3 && f2 || isSameImage(c3, f2)) return void (M2.current || b3());
      var d3 = function() {
        M2.current = null, b3();
      };
      M2.current = c3, setTimeout(function() {
        if ("string" == typeof a2) loadImage(a2, t2, y2).then(P2)["catch"](Q2)["finally"](d3);
        else if (a2 instanceof HTMLImageElement) {
          if (!a2.name && t2 && (a2.name = t2), !a2.complete) return void a2.addEventListener("load", function() {
            P2(a2), d3();
          });
          P2(a2), d3();
        } else Q2(h2("invalidImageError")), d3();
      }, 0);
    });
  }, S2 = function(a2) {
    N2.current && (a2.preventDefault(), a2.returnValue = "");
  }, T2 = function() {
    var a2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : function() {
      return [];
    };
    return e2({ type: SHOW_LOADER }), Promise.all(a2())["finally"](function() {
      e2({ type: HIDE_LOADER });
    });
  }, U2 = function() {
    l2 && 0 < Object.keys(l2).length && e2({ type: UPDATE_STATE, payload: _objectSpread$1(_objectSpread$1({}, l2), {}, { finetunes: finetunesStrsToClasses(null === l2 || void 0 === l2 ? void 0 : l2.finetunes), filter: filterStrToClass(null === l2 || void 0 === l2 ? void 0 : l2.filter) }) });
  };
  useUpdateEffect(function() {
    o && !isSameImage(o, f2) && (L2.current = false, T2(function() {
      return [R2(o)];
    })), z2 && e2({ type: RESET, payload: { config: b2 } });
  }, [o]), useUpdateEffect(function() {
    var a2 = null === l2 || void 0 === l2 ? void 0 : l2.imgSrc;
    a2 && !isSameImage(a2, f2) ? T2(function() {
      return [R2(a2).then(U2)];
    }) : U2();
  }, [l2]), reactExports.useEffect(function() {
    0 < Object.keys(g2 || {}).length && !Object.keys(g2).some(function(a2) {
      return !g2[a2];
    }) && f2 && m2 && null !== n2 && void 0 !== n2 && n2.loadableQuery && !L2.current && (e2({ type: UPDATE_STATE, payload: cloudimageQueryToDesignState(n2.loadableQuery, g2, f2) }), L2.current = true);
  }, [g2, f2, m2, n2]), reactExports.useEffect(function() {
    var a2 = false;
    return u2 && K2.current ? D2(K2.current.parentNode, function(a3) {
      var b3 = a3.width, c3 = a3.height;
      return I2({ width: b3, height: c3 });
    }) : H2.width && H2.height && !a2 && I2({ width: void 0, height: void 0 }), function() {
      u2 && K2.current && E2(K2.current), a2 = true;
    };
  }, [u2]), reactExports.useEffect(function() {
    return T2(function initialRequestsPromisesFn() {
      return [R2((null === l2 || void 0 === l2 ? void 0 : l2.imgSrc) || o)].concat(_toConsumableArray(q2 ? [getBackendTranslations(s, r2)] : []));
    }), window && !p2 && window.addEventListener("beforeunload", S2), function() {
      window && !p2 && window.removeEventListener("beforeunload", S2);
    };
  }, []), reactExports.useEffect(function() {
    x2 && "object" === _typeof(x2) && (x2.current = function(a2) {
      e2({ type: UPDATE_STATE, payload: a2 });
    });
  }, [x2, e2]), reactExports.useEffect(function() {
    w2 && "object" === _typeof(w2) && (w2.current = O2);
  }, [O2]), reactExports.useEffect(function() {
    N2.current = d2;
  }, [d2]);
  var V2 = function(a2) {
    e2({ type: SET_SHOWN_TABS_MENU, payload: { opened: a2 } });
  };
  return React.createElement(StyledAppWrapper, { className: ROOT_CONTAINER_CLASS_NAME, "data-phone": J2, showTabsDrawer: A2, ref: K2, $size: H2 }, c2 && React.createElement(Spinner, { theme: i }), function renderContent() {
    return React.createElement(React.Fragment, null, !v2 && React.createElement(React.Fragment, null, A2 && React.createElement(TabsDrawer, { toggleMainMenu: V2 }), React.createElement(Topbar, { toggleMainMenu: V2 })), f2 && 0 !== k2.duration && React.createElement(StyledMainContent, { className: "FIE_main-container" }, !v2 && !A2 && React.createElement(StyledTabs, { className: "FIE_tabs" }, React.createElement(Tabs, { toggleMainMenu: V2 })), React.createElement(StyledCanvasAndTools, { className: "FIE_editor-content", showTabsDrawer: A2 }, React.createElement(MainCanvas, null), !v2 && React.createElement(ToolsBar, { isPhoneScreen: J2 }))));
  }(), React.createElement(FeedbackPopup, null));
};
const App$1 = reactExports.memo(App);
var assignFinetuneNamesToKonva = function() {
  Object.keys(Konva.Filters).forEach(function(a) {
    return Konva.Filters[a].finetuneName = a;
  });
};
var FontsFaces = $e([".", "{font-family:", ";}.SfxModal-Wrapper *{font-family:", ";}"], ROOT_CONTAINER_CLASS_NAME, function(a) {
  var b2, c2 = a.theme, d2 = void 0 === c2 ? {} : c2;
  return (null === (b2 = d2.typography) || void 0 === b2 ? void 0 : b2.fontFamily) || "Arial";
}, function(a) {
  var b2, c2 = a.theme, d2 = void 0 === c2 ? {} : c2;
  return (null === (b2 = d2.typography) || void 0 === b2 ? void 0 : b2.fontFamily) || "Arial";
}), OverrideDefaultStyles = $e([".Menu-open{overflow:visible !important;}.", ",#SfxPopper{box-sizing:border-box;.SfxPopper-root .SfxMenu-root{overflow:visible;width:max-content;.SfxMenuItem-prefix{margin-right:6px;}}}.", " *,#SfxPopper *{box-sizing:border-box;scrollbar-color:rgba(203,211,218,1) rgba(203,211,218,0.35);:not(button) > svg:not([color]){color:", '}:disabled,[aria-disabled="true"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}'], ROOT_CONTAINER_CLASS_NAME, ROOT_CONTAINER_CLASS_NAME, function(a) {
  var b2 = a.theme;
  return b2.palette["icons-primary"];
});
var AssemblyPoint = function(a) {
  var b2 = a.source, c2 = a.useCloudimage, d2 = a.cloudimage;
  if (!b2 || "string" != typeof b2 && !(b2 instanceof HTMLImageElement)) throw new Error("`source` property is required either a string of image url or a HTMLImageElement for the image that will be edited.");
  if (c2) {
    var e2, f2;
    if (null !== d2 && void 0 !== d2 && null !== (e2 = d2.imageSealing) && void 0 !== e2 && e2.enable && !(null !== d2 && void 0 !== d2 && null !== (f2 = d2.imageSealing) && void 0 !== f2 && f2.salt)) throw new Error("`salt` property of imageSealing object is required in cloudimage mode as long as `imageSealing` is enabled.");
  }
  reactExports.useEffect(function() {
    assignFinetuneNamesToKonva();
  }, []);
  var g2 = deepMerge(defaultConfig, a);
  return React.createElement(React.StrictMode, null, React.createElement(ThemeProvider, { theme: g2.theme }, React.createElement(FontsFaces, null), React.createElement(OverrideDefaultStyles, null), React.createElement(AppProvider, { config: g2 }, React.createElement(App$1, null))));
};
AssemblyPoint.defaultProps = { useCloudimage: false, cloudimage: {} };
const FilerobotImageEditor$1 = reactExports.memo(AssemblyPoint);
function ownKeys(a, b2) {
  var c2 = Object.keys(a);
  if (Object.getOwnPropertySymbols) {
    var d2 = Object.getOwnPropertySymbols(a);
    b2 && (d2 = d2.filter(function(b3) {
      return Object.getOwnPropertyDescriptor(a, b3).enumerable;
    })), c2.push.apply(c2, d2);
  }
  return c2;
}
function _objectSpread(a) {
  for (var b2, c2 = 1; c2 < arguments.length; c2++) b2 = null == arguments[c2] ? {} : arguments[c2], c2 % 2 ? ownKeys(Object(b2), true).forEach(function(c3) {
    _defineProperty(a, c3, b2[c3]);
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(b2)) : ownKeys(Object(b2)).forEach(function(c3) {
    Object.defineProperty(a, c3, Object.getOwnPropertyDescriptor(b2, c3));
  });
  return a;
}
function _classPrivateFieldInitSpec(a, b2, c2) {
  _checkPrivateRedeclaration(a, b2), b2.set(a, c2);
}
function _checkPrivateRedeclaration(a, b2) {
  if (b2.has(a)) throw new TypeError("Cannot initialize the same private elements twice on an object");
}
function _classPrivateFieldGet(b2, c2) {
  return b2.get(_assertClassBrand(b2, c2));
}
function _classPrivateFieldSet(b2, c2, a) {
  return b2.set(_assertClassBrand(b2, c2), a), a;
}
function _assertClassBrand(a, b2, c2) {
  if ("function" == typeof a ? a === b2 : a.has(b2)) return 3 > arguments.length ? b2 : c2;
  throw new TypeError("Private element is not present on this object");
}
var _root = /* @__PURE__ */ new WeakMap(), _getCurrentImgDataFnRef = /* @__PURE__ */ new WeakMap(), _updateStateFnRef = /* @__PURE__ */ new WeakMap(), FilerobotImageEditor = function() {
  function a(b2) {
    var c2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {};
    if (_classCallCheck(this, a), _classPrivateFieldInitSpec(this, _root, void 0), _classPrivateFieldInitSpec(this, _getCurrentImgDataFnRef, void 0), _classPrivateFieldInitSpec(this, _updateStateFnRef, void 0), this.container = b2, this.config = c2, !b2 || !(b2 instanceof HTMLElement)) throw new Error("`container` (argument 0) is required to initialize the image editor plugin.");
    _classPrivateFieldSet(_root, this, createRoot(this.container)), _classPrivateFieldSet(_getCurrentImgDataFnRef, this, {}), _classPrivateFieldSet(_updateStateFnRef, this, {}), this.getCurrentImgData = this.getCurrentImgData.bind(this), this.render = this.render.bind(this), this.terminate = this.terminate.bind(this), this.updateState = this.updateState.bind(this);
  }
  return _createClass(a, [{ key: "render", value: function render(a2) {
    "object" === _typeof(a2) && (this.config = this.config = deepMerge(this.config || {}, a2)), this.config = _objectSpread(_objectSpread({}, this.config), {}, { getCurrentImgDataFnRef: _classPrivateFieldGet(_getCurrentImgDataFnRef, this), updateStateFnRef: _classPrivateFieldGet(_updateStateFnRef, this) }), _classPrivateFieldGet(_root, this)._internalRoot || _classPrivateFieldSet(_root, this, createRoot(this.container)), _classPrivateFieldGet(_root, this).render(reactExports.createElement(FilerobotImageEditor$1, this.config));
  } }, { key: "terminate", value: function terminate() {
    _classPrivateFieldGet(_root, this).unmount();
  } }, { key: "getCurrentImgData", value: function getCurrentImgData(a2, b2, c2) {
    var d2, e2;
    return (null === (d2 = _classPrivateFieldGet(_getCurrentImgDataFnRef, this)) || void 0 === d2 || null === (e2 = d2.current) || void 0 === e2 ? void 0 : e2.call(d2, a2, b2, c2)) || {};
  } }, { key: "updateState", value: function updateState2(a2) {
    var b2, c2;
    null === (b2 = _classPrivateFieldGet(_updateStateFnRef, this)) || void 0 === b2 || null === (c2 = b2.current) || void 0 === c2 || c2.call(b2, a2);
  } }]);
}();
_defineProperty(FilerobotImageEditor, "TABS", TABS_IDS), _defineProperty(FilerobotImageEditor, "TOOLS", TOOLS_IDS), FilerobotImageEditor.TABS = TABS_IDS, FilerobotImageEditor.TOOLS = TOOLS_IDS;
export {
  FilerobotImageEditor as default
};
