bilicleaner

实现B站视频中广告相关片段自动跳过

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         bilicleaner
// @namespace    github/BlackVisor
// @version      1.0.7
// @description  实现B站视频中广告相关片段自动跳过
// @license      GPL-3.0
// @icon         data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M834.307%20432.093s67.731%2029.89%2062.994%20184.286l48.828%2048.766s51.971-119.645%2033.066-222.092c0%200-1.554-96.101-173.26-223.653%200%200-85.077%209.405-78.757-78.784l-67.731-67.764-122.881%20122.879%2059.855%2059.917s148.077%206.229%2096.105%20127.546l-222.098%20223.713-42.54-6.291-253.607%20253.607s-17.345%2061.411%2026.778%2099.215c0%200%2028.34%2034.69%2088.221%2033.072l248.868-258.341%204.738-42.54%20253.573-251.988s14.202-22.051%2037.84-1.554v0.003M353.842%20460.372l80.345%2080.398%20108.707-108.679-83.521-83.521c88.221-201.664-165.382-280.388-165.382-280.388-47.243-12.642-37.805%2023.6-37.805%2023.6%2099.246%2081.902%2083.489%20108.683%2083.489%20108.683-12.583%2094.54-94.512%20130.793-94.512%20130.793-81.899%2034.628-149.629-80.345-149.629-80.345-26.781-4.73-23.636%2025.227-23.636%2025.227%2066.171%20291.412%20281.943%20184.223%20281.943%20184.223v0.006M607.476%20723.443l250.431%20266.245%20122.884-122.879-263.075-253.607-110.239%20110.239M857.905%20808.517l50.951%2036.993-19.466%2059.917h-62.966l-19.433-59.917%2050.913-36.993M857.905%20808.517z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E
// @match        https://*.bilibili.com/video/*
// @match        https://*.bilibili.com/list/watchlater*
// @exclude      https://live.bilibili.com/*
// @require      https://registry.npmmirror.com/react/18.3.1/files/umd/react.production.min.js
// @require      https://registry.npmmirror.com/react-dom/18.3.1/files/umd/react-dom.production.min.js
// @require      https://registry.npmmirror.com/dayjs/1.11.20/files/dayjs.min.js
// @connect      www.bsbsb.top
// @connect      154.222.28.109
// @grant        GM_addStyle
// @grant        GM_xmlhttpRequest
// @grant        unsafeWindow
// @run-at       document-end
// ==/UserScript==

(function (React, require$$0, dayjs) {
  'use strict';

  function _interopNamespaceDefault(e) {
    const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
    if (e) {
      for (const k in e) {
        if (k !== 'default') {
          const d = Object.getOwnPropertyDescriptor(e, k);
          Object.defineProperty(n, k, d.get ? d : {
            enumerable: true,
            get: () => e[k]
          });
        }
      }
    }
    n.default = e;
    return Object.freeze(n);
  }

  const React__namespace = _interopNamespaceDefault(React);

  const d=new Set;const importCSS = async e=>{d.has(e)||(d.add(e),(t=>{typeof GM_addStyle=="function"?GM_addStyle(t):(document.head||document.documentElement).appendChild(document.createElement("style")).append(t);})(e));};

  function getDefaultExportFromCjs(x) {
    return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  }
  var jsxRuntime = { exports: {} };
  var reactJsxRuntime_production_min = {};
  var hasRequiredReactJsxRuntime_production_min;
  function requireReactJsxRuntime_production_min() {
    if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
    hasRequiredReactJsxRuntime_production_min = 1;
    var f = React, k = Symbol.for("react.element"), l2 = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n2 = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
    function q(c, a, g) {
      var b, d = {}, e2 = null, h = null;
      void 0 !== g && (e2 = "" + g);
      void 0 !== a.key && (e2 = "" + a.key);
      void 0 !== a.ref && (h = a.ref);
      for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
      if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
      return { $$typeof: k, type: c, key: e2, ref: h, props: d, _owner: n2.current };
    }
    reactJsxRuntime_production_min.Fragment = l2;
    reactJsxRuntime_production_min.jsx = q;
    reactJsxRuntime_production_min.jsxs = q;
    return reactJsxRuntime_production_min;
  }
  var hasRequiredJsxRuntime;
  function requireJsxRuntime() {
    if (hasRequiredJsxRuntime) return jsxRuntime.exports;
    hasRequiredJsxRuntime = 1;
    {
      jsxRuntime.exports = requireReactJsxRuntime_production_min();
    }
    return jsxRuntime.exports;
  }
  var jsxRuntimeExports = requireJsxRuntime();
  var client = {};
  var hasRequiredClient;
  function requireClient() {
    if (hasRequiredClient) return client;
    hasRequiredClient = 1;
    var m = require$$0;
    {
      client.createRoot = m.createRoot;
      client.hydrateRoot = m.hydrateRoot;
    }
    return client;
  }
  var clientExports = requireClient();
  const ReactDOM = getDefaultExportFromCjs(clientExports);
  var _GM_xmlhttpRequest = (() => typeof GM_xmlhttpRequest != "undefined" ? GM_xmlhttpRequest : void 0)();
  var _unsafeWindow = (() => typeof unsafeWindow != "undefined" ? unsafeWindow : void 0)();
  const $window = _unsafeWindow;
  const globalConfig$1 = {

server: "https://www.bsbsb.top",
headers: {
      "origin": "chrome-extension://eaoelafamejbnggahofapllmfhlhajdd",
      "x-ext-version": "0.5.0"
    }
  };
  class TamperMonkeyApi {
defaultConfig = {
      timeout: 1e4,
      headers: {
        "Content-Type": "application/json;charset=utf-8",
        ...globalConfig$1.headers
      },
      responseType: "json",
      anonymous: true
    };
    constructor(config) {
      this.defaultConfig = { ...this.defaultConfig, ...config };
    }
buildUrl(url2, params) {
      if (!params || Object.keys(params).length === 0) return url2;
      const searchParams = new URLSearchParams();
      Object.entries(params).forEach(([key, value]) => {
        if (value !== void 0 && value !== null) {
          searchParams.append(key, String(value));
        }
      });
      return `${url2}?${searchParams.toString()}`;
    }
request(method4, url2, params, body, config) {
      const finalConfig = { ...this.defaultConfig, ...config };
      const finalUrl = this.buildUrl(url2, params);
      return new Promise((resolve, reject) => {
        _GM_xmlhttpRequest({
          method: method4,
          url: finalUrl,
          headers: finalConfig.headers,
          data: body ? JSON.stringify(body) : void 0,
          responseType: finalConfig.responseType,
          timeout: finalConfig.timeout,
          anonymous: finalConfig.anonymous,
          fetch: true,
          onload: (response) => {
            console.log(`[BC] fetching ${method4} ${finalUrl}, response status: ${response.status}`);
            if (response.status === 408) {
              return reject(new Error("too frequent request"));
            }
            if (response.status < 200 || response.status >= 300) {
              return reject(new Error(`request failed with status ${response.status}: ${response.responseText}`));
            }
            resolve(response.response);
          },
          onerror: (error) => {
            reject(new Error(`[BC] fetch error: code is ${error.status}, error is ${error.error}`));
          },
          ontimeout: () => {
            reject(new Error(`[BC] fetch timeout (${finalConfig.timeout}ms)`));
          },
          onabort: () => {
            reject(new Error("[BC] fetch aborted"));
          }
        });
      });
    }
get(url2, params, config) {
      return this.request("GET", url2, params, void 0, config);
    }
post(url2, params, body, config) {
      return this.request("POST", url2, params, body, config);
    }
put(url2, params, body, config) {
      return this.request("PUT", url2, params, body, config);
    }
delete(url2, params, body, config) {
      return this.request("DELETE", url2, params, body, config);
    }
updateDefaultConfig(config) {
      this.defaultConfig = { ...this.defaultConfig, ...config };
    }
  }
  const api = new TamperMonkeyApi();
  const encoder = new TextEncoder();
  const getHashBySHA256 = async (value) => {
    try {
      if (!crypto || !crypto.subtle) {
        console.error("[BC] crypto.subtle is not available. Hash functions will not work.");
        return value;
      }
      return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", encoder.encode(value)))).map((b) => b.toString(16).padStart(2, "0")).join("");
    } catch (error) {
      console.error("[BC] error when hashing value:", error);
      return value;
    }
  };
  var RedundantType = ((RedundantType2) => {
    RedundantType2["SPONSOR"] = "sponsor";
    RedundantType2["PADDING"] = "padding";
    RedundantType2["PROMOTION"] = "selfpromo";
    RedundantType2["INTERACTION"] = "interaction";
    RedundantType2["BEGINNING"] = "intro";
    RedundantType2["ENDING"] = "outro";
    RedundantType2["PREVIEW"] = "preview";
    RedundantType2["MUSIC"] = "music_offtopic";
    RedundantType2["FILLER"] = "filler";
    RedundantType2["FULL"] = "exclusive_access";
    RedundantType2["POI"] = "poi_highlight";
    RedundantType2["UNKNOWN"] = "unknown";
    return RedundantType2;
  })(RedundantType || {});
  const getRedundantType = (category) => {
    switch (category) {
      case "sponsor":
        return "sponsor";
      case "selfpromo":
        return "selfpromo";
      case "exclusive_access":
        return "exclusive_access";
      case "interaction":
        return "interaction";
      case "poi_highlight":
        return "poi_highlight";
      case "intro":
        return "intro";
      case "outro":
        return "outro";
      case "preview":
        return "preview";
      case "padding":
        return "padding";
      case "filler":
        return "filler";
      case "music_offtopic":
        return "music_offtopic";
      default:
        return "unknown";
    }
  };
  const redundantTypeConfig = {
    [
      "sponsor"
]: { color: "#00d400", skip: true, opacity: 0.7, name: "广告" },
    [
      "padding"
]: { color: "#00d400", skip: true, opacity: 0.7, name: "广告" },
    [
      "selfpromo"
]: { color: "#ffff00", skip: true, opacity: 0.7, name: "推广" },
    [
      "interaction"
]: { color: "#cc00ff", skip: false, opacity: 0.7, name: "互动" },
    [
      "intro"
]: { color: "#00ffff", skip: false, opacity: 0.7, name: "开场" },
    [
      "outro"
]: { color: "#0202ed", skip: false, opacity: 0.7, name: "结尾" },
    [
      "preview"
]: { color: "#008fd6", skip: false, opacity: 0.7, name: "预览" },
    [
      "music_offtopic"
]: { color: "#ff9900", skip: true, opacity: 0.7, name: "音乐" },
    [
      "filler"
]: { color: "#7300FF", skip: true, opacity: 0.7, name: "后黑" },
    [
      "exclusive_access"
]: { color: "#008a5c", skip: false, opacity: 0.7, name: "全广" },
    [
      "poi_highlight"
]: { color: "#ff1684", skip: false, opacity: 0.7, name: "精彩时刻" },
    [
      "unknown"
]: { color: "#ffffff", skip: false, opacity: 0, name: "未知" }
  };
  const assembleSegment = (segments, chapterId) => {
    const validVideoSegments = segments.filter(
(x) => x.segment.length === 2 && x.segment[1] - x.segment[0] >= 3 && x.cid === String(chapterId) && x.actionType === "skip" && x.votes >= 0
).sort((a, b) => a.segment[0] !== b.segment[0] ? a.segment[0] - b.segment[0] : a.segment[1] - b.segment[1]);
    const mergedSegmentsResponse = [];
    validVideoSegments.forEach((x) => {
      let replaced = false;
      let redundant = false;
      mergedSegmentsResponse.forEach((y) => {
        if (y.segment[0] <= x.segment[0] && y.segment[1] >= x.segment[1]) {
          y.segment = [...x.segment];
          replaced = true;
        } else if (y.segment[0] < x.segment[0] && y.segment[1] > x.segment[1]) {
          redundant = true;
        }
      });
      if (!replaced && !redundant) mergedSegmentsResponse.push(x);
    });
    return mergedSegmentsResponse.map((x) => {
      const [start, end] = x.segment;
      const redundantType = getRedundantType(x.category);
      return {
        start,
        end,
        color: redundantTypeConfig[redundantType].color,
        skip: redundantTypeConfig[redundantType].skip,
        redundantType,
        opacity: redundantTypeConfig[redundantType].opacity
      };
    });
  };
  const getSegments = async (bvId, chapterId) => {
    try {
      console.log(`[BC] try to get segments for ${bvId} ${chapterId}`);
      if (bvId && chapterId) {
        const data = await api.get(`${globalConfig$1.server}/api/skipSegments/${(await getHashBySHA256(bvId)).slice(0, 4)}`);
        for (const videoSegment of data) {
          if (videoSegment.videoID === bvId) {
            return assembleSegment(videoSegment.segments, chapterId);
          }
        }
        console.log(`[BC] no segments found for bvId=${bvId} chapterId=${chapterId} in ${data.length} video segments`);
      }
      return [];
    } catch (error) {
      console.error(error);
      return [];
    }
  };
  const postSegments = async (segmentRequest) => {
    try {
      const r2 = await api.post(
        `${globalConfig$1.server}/api/skipSegments`,
        void 0,
        segmentRequest,
        void 0
      );
      if (r2.length) {
        return true;
      } else {
        console.error(`[BC] post segment failed, response is empty`);
        return false;
      }
    } catch (error) {
      console.error(error);
      return false;
    }
  };
  const findElement = (selectors) => {
    let target = null;
    for (const selector of selectors) {
      target = document.querySelector(selector);
      if (target) break;
    }
    return target;
  };
  const waitForElement = (selectors, klass, mountTarget = document.body, timeout = 1e4) => {
    return new Promise((resolve, reject) => {
      let targetElement = findElement(selectors);
      if (targetElement) {
        return targetElement instanceof klass ? resolve(targetElement) : reject(new Error(`element "${selectors}" found, but type is ${typeof targetElement}`));
      }
      const timer = timeout > 0 ? setTimeout(() => {
        observer2.disconnect();
        reject(new Error(`[BC] mutation observer timeout ${timeout}ms for any selector in ${selectors.join(",")}`));
      }, timeout) : void 0;
      const observer2 = new MutationObserver((mutations) => {
        for (const mutation of mutations) {
          if (mutation.addedNodes.length) {
            targetElement = findElement(selectors);
            if (targetElement) {
              clearTimeout(timer);
              observer2.disconnect();
              return targetElement instanceof klass ? resolve(targetElement) : reject(new Error(`element "${selectors}" found, but type is ${typeof targetElement}`));
            }
          }
        }
      });
      observer2.observe(mountTarget, {
        childList: true,
        subtree: true
      });
    });
  };
  var utc$2 = { exports: {} };
  var utc$1 = utc$2.exports;
  var hasRequiredUtc;
  function requireUtc() {
    if (hasRequiredUtc) return utc$2.exports;
    hasRequiredUtc = 1;
    (function(module, exports$1) {
      !(function(t2, i) {
        module.exports = i();
      })(utc$1, (function() {
        var t2 = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e2 = /([+-]|\d\d)/g;
        return function(s, f, n2) {
          var u = f.prototype;
          n2.utc = function(t3) {
            var i2 = { date: t3, utc: true, args: arguments };
            return new f(i2);
          }, u.utc = function(i2) {
            var e3 = n2(this.toDate(), { locale: this.$L, utc: true });
            return i2 ? e3.add(this.utcOffset(), t2) : e3;
          }, u.local = function() {
            return n2(this.toDate(), { locale: this.$L, utc: false });
          };
          var r2 = u.parse;
          u.parse = function(t3) {
            t3.utc && (this.$u = true), this.$utils().u(t3.$offset) || (this.$offset = t3.$offset), r2.call(this, t3);
          };
          var o2 = u.init;
          u.init = function() {
            if (this.$u) {
              var t3 = this.$d;
              this.$y = t3.getUTCFullYear(), this.$M = t3.getUTCMonth(), this.$D = t3.getUTCDate(), this.$W = t3.getUTCDay(), this.$H = t3.getUTCHours(), this.$m = t3.getUTCMinutes(), this.$s = t3.getUTCSeconds(), this.$ms = t3.getUTCMilliseconds();
            } else o2.call(this);
          };
          var a = u.utcOffset;
          u.utcOffset = function(s2, f2) {
            var n3 = this.$utils().u;
            if (n3(s2)) return this.$u ? 0 : n3(this.$offset) ? a.call(this) : this.$offset;
            if ("string" == typeof s2 && (s2 = (function(t3) {
              void 0 === t3 && (t3 = "");
              var s3 = t3.match(i);
              if (!s3) return null;
              var f3 = ("" + s3[0]).match(e2) || ["-", 0, 0], n4 = f3[0], u3 = 60 * +f3[1] + +f3[2];
              return 0 === u3 ? 0 : "+" === n4 ? u3 : -u3;
            })(s2), null === s2)) return this;
            var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
            if (0 === u2) return this.utc(f2);
            var r3 = this.clone();
            if (f2) return r3.$offset = u2, r3.$u = false, r3;
            var o3 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
            return (r3 = this.local().add(u2 + o3, t2)).$offset = u2, r3.$x.$localOffset = o3, r3;
          };
          var h = u.format;
          u.format = function(t3) {
            var i2 = t3 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
            return h.call(this, i2);
          }, u.valueOf = function() {
            var t3 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
            return this.$d.valueOf() - 6e4 * t3;
          }, u.isUTC = function() {
            return !!this.$u;
          }, u.toISOString = function() {
            return this.toDate().toISOString();
          }, u.toString = function() {
            return this.toDate().toUTCString();
          };
          var l2 = u.toDate;
          u.toDate = function(t3) {
            return "s" === t3 && this.$offset ? n2(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l2.call(this);
          };
          var c = u.diff;
          u.diff = function(t3, i2, e3) {
            if (t3 && this.$u === t3.$u) return c.call(this, t3, i2, e3);
            var s2 = this.local(), f2 = n2(t3).local();
            return c.call(s2, f2, i2, e3);
          };
        };
      }));
    })(utc$2);
    return utc$2.exports;
  }
  var utcExports = requireUtc();
  const utc = getDefaultExportFromCjs(utcExports);
  dayjs.extend(utc);
  const formatTime = (totalSeconds) => {
    return dayjs.unix(totalSeconds).utc().format("HH:mm:ss");
  };
  const useVideo = () => {
    const [bvId, setBvId] = React.useState("");
    const [chapterId, setChapterId] = React.useState(0);
    React.useEffect(() => {
      const handleUrlChange = () => {
        const newBvId = $window?.__INITIAL_STATE__?.bvid || "";
        const newChapterId = $window?.__INITIAL_STATE__?.cid || 0;
        setBvId(newBvId);
        setChapterId((prevChapterId) => {
          if (prevChapterId !== newChapterId) console.log(`[BC] video changed to: bvId=${newBvId}, chapterId=${newChapterId}`);
          return newChapterId;
        });
      };
      handleUrlChange();
      const _pushState = history.pushState;
      history.pushState = function(...args) {
        _pushState.apply(history, args);
        handleUrlChange();
      };
      const _replaceState = history.replaceState;
      history.replaceState = function(...args) {
        _replaceState.apply(history, args);
        handleUrlChange();
      };
      $window.addEventListener("pushState", handleUrlChange);
      return () => {
        $window.removeEventListener("popstate", handleUrlChange);
        history.pushState = _pushState;
        history.replaceState = _replaceState;
      };
    }, []);
    return { bvId, chapterId };
  };
  const useUserId = () => {
    const [userId, setUserId] = React.useState(0);
    const checkTimes = React.useRef(0);
    React.useEffect(() => {
      const getUserId = () => {
        return $window?.__INITIAL_STATE__?.userInfo?.mid || $window?.__INITIAL_STATE__?.user?.mid || 0;
      };
      const currentUserId = getUserId();
      if (currentUserId) {
        setUserId(currentUserId);
        return;
      }
      const timer = setInterval(() => {
        const newUserId = getUserId();
        if (newUserId) {
          setUserId(newUserId);
          clearInterval(timer);
          console.log(`[BC] user id obtained: ${newUserId}`);
        } else {
          checkTimes.current++;
          if (checkTimes.current >= 10) {
            clearInterval(timer);
            console.warn("[BC] get user id failed after 10s");
          }
        }
      }, 1e3);
      return () => {
        clearInterval(timer);
      };
    }, []);
    return userId;
  };
  const SkipSegmentCss = ".report-segment-button{display:flex;align-items:center;cursor:pointer;padding:0 6px;position:relative;transition:all .3s ease;-webkit-user-select:none;user-select:none;margin-right:18px;box-sizing:border-box}.report-segment-button-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;margin-right:4px;flex-shrink:0}.report-segment-button-border{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1;pointer-events:none;box-sizing:border-box;width:100%;height:calc(100% + 2px);border:1px solid #00AEEC;border-radius:8px;opacity:1;transition:opacity .2s,height .3s ease}@media(min-width:1681px){.report-segment-button-border{height:calc(100% + 6px)!important}}.segment-category-label{width:1em;height:1em;border-radius:2px;display:inline-block;flex-shrink:0;border:1px solid rgba(0,0,0,.05);vertical-align:middle}.ul-segment-bar{width:100%;height:100%;overflow:hidden;padding:0;margin:0;position:absolute;top:0;pointer-events:none;z-index:1;transition:transform .1s cubic-bezier(0,0,.2,1)}.li-segment-bar{position:absolute;height:100%;pointer-events:none;transition:opacity .2s ease}";
  importCSS(SkipSegmentCss);
  const getPercentage = (seconds, duration = 0, isLeft = true) => {
    if (Math.floor(seconds) > Math.floor(duration)) {
      console.warn(`[BC] video duration for getPercentage is out of range: ${seconds}, ${duration}.`);
      return isLeft ? "100%" : "0%";
    }
    if (duration <= 0) {
      console.error("[BC] video duration for getPercentage 0.");
      return isLeft ? "0%" : "100%";
    }
    return isLeft ? `${(Math.max(seconds, 0) / duration * 100).toFixed(2)}%` : `${((duration - Math.min(seconds, duration)) / duration * 100).toFixed(2)}%`;
  };
  const SegmentBar = (props) => {
    const sortedSegments = props.segments.sort((a, b) => a.start - b.start);
    return jsxRuntimeExports.jsx("ul", { id: props.isShadow ? "shadow-segments-bar" : "segments-bar", className: "ul-segment-bar", children: sortedSegments.map(
      (segment, i) => jsxRuntimeExports.jsx(
        "li",
        {
          id: props.isShadow ? "li-shadow-segment-bar" : "li-segment-bar",
          className: "li-segment-bar",
          "segment-category": segment.redundantType,
          style: {
            backgroundColor: segment.color,
            opacity: segment.opacity,
left: getPercentage(segment.start, props.duration, true),
right: getPercentage(segment.end, props.duration, false)
          }
        },
        i
      )
    ) });
  };
  const REACT_ELEMENT_TYPE_18 = Symbol.for("react.element");
  const REACT_ELEMENT_TYPE_19 = Symbol.for("react.transitional.element");
  const REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
  function isFragment$1(object4) {
    return (
object4 && typeof object4 === "object" &&
(object4.$$typeof === REACT_ELEMENT_TYPE_18 || object4.$$typeof === REACT_ELEMENT_TYPE_19) &&
object4.type === REACT_FRAGMENT_TYPE
    );
  }
  function toArray$3(children, option = {}) {
    let ret = [];
    React.Children.forEach(children, (child) => {
      if ((child === void 0 || child === null) && !option.keepEmpty) {
        return;
      }
      if (Array.isArray(child)) {
        ret = ret.concat(toArray$3(child));
      } else if (isFragment$1(child) && child.props) {
        ret = ret.concat(toArray$3(child.props.children, option));
      } else {
        ret.push(child);
      }
    });
    return ret;
  }
  let warned = {};
  const preMessage = (fn) => {
  };
  function warning$2(valid, message2) {
  }
  function note(valid, message2) {
  }
  function resetWarned() {
    warned = {};
  }
  function call(method4, valid, message2) {
    if (!valid && !warned[message2]) {
      method4(false, message2);
      warned[message2] = true;
    }
  }
  function warningOnce(valid, message2) {
    call(warning$2, valid, message2);
  }
  function noteOnce(valid, message2) {
    call(note, valid, message2);
  }
  warningOnce.preMessage = preMessage;
  warningOnce.resetWarned = resetWarned;
  warningOnce.noteOnce = noteOnce;
  function isEqual(obj1, obj2, shallow = false) {
    const refSet = new Set();
    function deepEqual(a, b, level = 1) {
      const circular = refSet.has(a);
      warningOnce(!circular, "Warning: There may be circular references");
      if (circular) {
        return false;
      }
      if (a === b) {
        return true;
      }
      if (shallow && level > 1) {
        return false;
      }
      refSet.add(a);
      const newLevel = level + 1;
      if (Array.isArray(a)) {
        if (!Array.isArray(b) || a.length !== b.length) {
          return false;
        }
        for (let i = 0; i < a.length; i++) {
          if (!deepEqual(a[i], b[i], newLevel)) {
            return false;
          }
        }
        return true;
      }
      if (a && b && typeof a === "object" && typeof b === "object") {
        const keys2 = Object.keys(a);
        if (keys2.length !== Object.keys(b).length) {
          return false;
        }
        return keys2.every((key) => deepEqual(a[key], b[key], newLevel));
      }
      return false;
    }
    return deepEqual(obj1, obj2);
  }
  const HOOK_MARK = "RC_FORM_INTERNAL_HOOKS";
  const warningFunc = () => {
    warningOnce(false, "Can not find FormContext. Please make sure you wrap Field under Form.");
  };
  const Context$1 = React__namespace.createContext({
    getFieldValue: warningFunc,
    getFieldsValue: warningFunc,
    getFieldError: warningFunc,
    getFieldWarning: warningFunc,
    getFieldsError: warningFunc,
    isFieldsTouched: warningFunc,
    isFieldTouched: warningFunc,
    isFieldValidating: warningFunc,
    isFieldsValidating: warningFunc,
    resetFields: warningFunc,
    setFields: warningFunc,
    setFieldValue: warningFunc,
    setFieldsValue: warningFunc,
    validateFields: warningFunc,
    submit: warningFunc,
    getInternalHooks: () => {
      warningFunc();
      return {
        dispatch: warningFunc,
        initEntityValue: warningFunc,
        registerField: warningFunc,
        useSubscribe: warningFunc,
        setInitialValues: warningFunc,
        destroyForm: warningFunc,
        setCallbacks: warningFunc,
        registerWatch: warningFunc,
        getFields: warningFunc,
        setValidateMessages: warningFunc,
        setPreserve: warningFunc,
        getInitialValue: warningFunc
      };
    }
  });
  const ListContext = React__namespace.createContext(null);
  function toArray$2(value) {
    if (value === void 0 || value === null) {
      return [];
    }
    return Array.isArray(value) ? value : [value];
  }
  function isFormInstance(form) {
    return form && !!form._init;
  }
  function _typeof$1(o2) {
    "@babel/helpers - typeof";
    return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$1(o2);
  }
  function toPrimitive(t2, r2) {
    if ("object" != _typeof$1(t2) || !t2) return t2;
    var e2 = t2[Symbol.toPrimitive];
    if (void 0 !== e2) {
      var i = e2.call(t2, r2);
      if ("object" != _typeof$1(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$1(i) ? i : i + "";
  }
  function _defineProperty$1(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;
  }
  function ownKeys$1(e2, r2) {
    var t2 = Object.keys(e2);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e2);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  function _objectSpread2(e2) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$1(Object(t2), true).forEach(function(r3) {
        _defineProperty$1(e2, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e2;
  }
  function _arrayLikeToArray(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(r2);
  }
  function _iterableToArray(r2) {
    if ("undefined" != typeof Symbol && null != r2[Symbol.iterator] || null != r2["@@iterator"]) return Array.from(r2);
  }
  function _unsupportedIterableToArray(r2, a) {
    if (r2) {
      if ("string" == typeof r2) return _arrayLikeToArray(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(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(r2) || _nonIterableSpread();
  }
  function _classCallCheck(a, n2) {
    if (!(a instanceof n2)) throw new TypeError("Cannot call a class as a function");
  }
  function _defineProperties(e2, r2) {
    for (var t2 = 0; t2 < r2.length; t2++) {
      var o2 = r2[t2];
      o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, toPropertyKey(o2.key), o2);
    }
  }
  function _createClass(e2, r2, t2) {
    return r2 && _defineProperties(e2.prototype, r2), Object.defineProperty(e2, "prototype", {
      writable: false
    }), e2;
  }
  function newMessages() {
    return {
      default: "Validation error on field %s",
      required: "%s is required",
      enum: "%s must be one of %s",
      whitespace: "%s cannot be empty",
      date: {
        format: "%s date %s is invalid for format %s",
        parse: "%s date could not be parsed, %s is invalid ",
        invalid: "%s date %s is invalid"
      },
      types: {
        string: "%s is not a %s",
        method: "%s is not a %s (function)",
        array: "%s is not an %s",
        object: "%s is not an %s",
        number: "%s is not a %s",
        date: "%s is not a %s",
        boolean: "%s is not a %s",
        integer: "%s is not an %s",
        float: "%s is not a %s",
        regexp: "%s is not a valid %s",
        email: "%s is not a valid %s",
        tel: "%s is not a valid %s",
        url: "%s is not a valid %s",
        hex: "%s is not a valid %s"
      },
      string: {
        len: "%s must be exactly %s characters",
        min: "%s must be at least %s characters",
        max: "%s cannot be longer than %s characters",
        range: "%s must be between %s and %s characters"
      },
      number: {
        len: "%s must equal %s",
        min: "%s cannot be less than %s",
        max: "%s cannot be greater than %s",
        range: "%s must be between %s and %s"
      },
      array: {
        len: "%s must be exactly %s in length",
        min: "%s cannot be less than %s in length",
        max: "%s cannot be greater than %s in length",
        range: "%s must be between %s and %s in length"
      },
      pattern: {
        mismatch: "%s value %s does not match pattern %s"
      },
      clone: function clone() {
        var cloned = JSON.parse(JSON.stringify(this));
        cloned.clone = this.clone;
        return cloned;
      }
    };
  }
  var messages = newMessages();
  function _assertThisInitialized(e2) {
    if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    return e2;
  }
  function _setPrototypeOf(t2, e2) {
    return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
      return t3.__proto__ = e3, t3;
    }, _setPrototypeOf(t2, e2);
  }
  function _inherits(t2, e2) {
    if ("function" != typeof e2 && null !== e2) throw new TypeError("Super expression must either be null or a function");
    t2.prototype = Object.create(e2 && e2.prototype, {
      constructor: {
        value: t2,
        writable: true,
        configurable: true
      }
    }), Object.defineProperty(t2, "prototype", {
      writable: false
    }), e2 && _setPrototypeOf(t2, e2);
  }
  function _getPrototypeOf(t2) {
    return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
      return t3.__proto__ || Object.getPrototypeOf(t3);
    }, _getPrototypeOf(t2);
  }
  function _isNativeReflectConstruct() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
      return !!t2;
    })();
  }
  function _possibleConstructorReturn(t2, e2) {
    if (e2 && ("object" == _typeof$1(e2) || "function" == typeof e2)) return e2;
    if (void 0 !== e2) throw new TypeError("Derived constructors may only return object or undefined");
    return _assertThisInitialized(t2);
  }
  function _createSuper(t2) {
    var r2 = _isNativeReflectConstruct();
    return function() {
      var e2, o2 = _getPrototypeOf(t2);
      if (r2) {
        var s = _getPrototypeOf(this).constructor;
        e2 = Reflect.construct(o2, arguments, s);
      } else e2 = o2.apply(this, arguments);
      return _possibleConstructorReturn(this, e2);
    };
  }
  function _isNativeFunction(t2) {
    try {
      return -1 !== Function.toString.call(t2).indexOf("[native code]");
    } catch (n2) {
      return "function" == typeof t2;
    }
  }
  function _construct(t2, e2, r2) {
    if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
    var o2 = [null];
    o2.push.apply(o2, e2);
    var p = new (t2.bind.apply(t2, o2))();
    return r2 && _setPrototypeOf(p, r2.prototype), p;
  }
  function _wrapNativeSuper(t2) {
    var r2 = "function" == typeof Map ? new Map() : void 0;
    return _wrapNativeSuper = function _wrapNativeSuper2(t3) {
      if (null === t3 || !_isNativeFunction(t3)) return t3;
      if ("function" != typeof t3) throw new TypeError("Super expression must either be null or a function");
      if (void 0 !== r2) {
        if (r2.has(t3)) return r2.get(t3);
        r2.set(t3, Wrapper2);
      }
      function Wrapper2() {
        return _construct(t3, arguments, _getPrototypeOf(this).constructor);
      }
      return Wrapper2.prototype = Object.create(t3.prototype, {
        constructor: {
          value: Wrapper2,
          enumerable: false,
          writable: true,
          configurable: true
        }
      }), _setPrototypeOf(Wrapper2, t3);
    }, _wrapNativeSuper(t2);
  }
  var formatRegExp = /%[sdj%]/g;
  var warning$1 = function warning2() {
  };
  function convertFieldsError(errors) {
    if (!errors || !errors.length) return null;
    var fields = {};
    errors.forEach(function(error) {
      var field = error.field;
      fields[field] = fields[field] || [];
      fields[field].push(error);
    });
    return fields;
  }
  function format(template) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    var i = 0;
    var len = args.length;
    if (typeof template === "function") {
      return template.apply(null, args);
    }
    if (typeof template === "string") {
      var str = template.replace(formatRegExp, function(x) {
        if (x === "%%") {
          return "%";
        }
        if (i >= len) {
          return x;
        }
        switch (x) {
          case "%s":
            return String(args[i++]);
          case "%d":
            return Number(args[i++]);
          case "%j":
            try {
              return JSON.stringify(args[i++]);
            } catch (_) {
              return "[Circular]";
            }
            break;
          default:
            return x;
        }
      });
      return str;
    }
    return template;
  }
  function isNativeStringType(type4) {
    return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern" || type4 === "tel";
  }
  function isEmptyValue(value, type4) {
    if (value === void 0 || value === null) {
      return true;
    }
    if (type4 === "array" && Array.isArray(value) && !value.length) {
      return true;
    }
    if (isNativeStringType(type4) && typeof value === "string" && !value) {
      return true;
    }
    return false;
  }
  function asyncParallelArray(arr, func, callback) {
    var results = [];
    var total = 0;
    var arrLength = arr.length;
    function count(errors) {
      results.push.apply(results, _toConsumableArray(errors || []));
      total++;
      if (total === arrLength) {
        callback(results);
      }
    }
    arr.forEach(function(a) {
      func(a, count);
    });
  }
  function asyncSerialArray(arr, func, callback) {
    var index = 0;
    var arrLength = arr.length;
    function next2(errors) {
      if (errors && errors.length) {
        callback(errors);
        return;
      }
      var original = index;
      index = index + 1;
      if (original < arrLength) {
        func(arr[original], next2);
      } else {
        callback([]);
      }
    }
    next2([]);
  }
  function flattenObjArr(objArr) {
    var ret = [];
    Object.keys(objArr).forEach(function(k) {
      ret.push.apply(ret, _toConsumableArray(objArr[k] || []));
    });
    return ret;
  }
  var AsyncValidationError = (function(_Error) {
    _inherits(AsyncValidationError2, _Error);
    var _super = _createSuper(AsyncValidationError2);
    function AsyncValidationError2(errors, fields) {
      var _this;
      _classCallCheck(this, AsyncValidationError2);
      _this = _super.call(this, "Async Validation Error");
      _defineProperty$1(_assertThisInitialized(_this), "errors", void 0);
      _defineProperty$1(_assertThisInitialized(_this), "fields", void 0);
      _this.errors = errors;
      _this.fields = fields;
      return _this;
    }
    return _createClass(AsyncValidationError2);
  })( _wrapNativeSuper(Error));
  function asyncMap(objArr, option, func, callback, source) {
    if (option.first) {
      var _pending = new Promise(function(resolve, reject) {
        var next2 = function next22(errors) {
          callback(errors);
          return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
        };
        var flattenArr = flattenObjArr(objArr);
        asyncSerialArray(flattenArr, func, next2);
      });
      _pending.catch(function(e2) {
        return e2;
      });
      return _pending;
    }
    var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
    var objArrKeys = Object.keys(objArr);
    var objArrLength = objArrKeys.length;
    var total = 0;
    var results = [];
    var pending = new Promise(function(resolve, reject) {
      var next2 = function next22(errors) {
        results.push.apply(results, errors);
        total++;
        if (total === objArrLength) {
          callback(results);
          return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
        }
      };
      if (!objArrKeys.length) {
        callback(results);
        resolve(source);
      }
      objArrKeys.forEach(function(key) {
        var arr = objArr[key];
        if (firstFields.indexOf(key) !== -1) {
          asyncSerialArray(arr, func, next2);
        } else {
          asyncParallelArray(arr, func, next2);
        }
      });
    });
    pending.catch(function(e2) {
      return e2;
    });
    return pending;
  }
  function isErrorObj(obj) {
    return !!(obj && obj.message !== void 0);
  }
  function getValue$1(value, path) {
    var v = value;
    for (var i = 0; i < path.length; i++) {
      if (v == void 0) {
        return v;
      }
      v = v[path[i]];
    }
    return v;
  }
  function complementError(rule, source) {
    return function(oe) {
      var fieldValue;
      if (rule.fullFields) {
        fieldValue = getValue$1(source, rule.fullFields);
      } else {
        fieldValue = source[oe.field || rule.fullField];
      }
      if (isErrorObj(oe)) {
        oe.field = oe.field || rule.fullField;
        oe.fieldValue = fieldValue;
        return oe;
      }
      return {
        message: typeof oe === "function" ? oe() : oe,
        fieldValue,
        field: oe.field || rule.fullField
      };
    };
  }
  function deepMerge(target, source) {
    if (source) {
      for (var s in source) {
        if (source.hasOwnProperty(s)) {
          var value = source[s];
          if (_typeof$1(value) === "object" && _typeof$1(target[s]) === "object") {
            target[s] = _objectSpread2(_objectSpread2({}, target[s]), value);
          } else {
            target[s] = value;
          }
        }
      }
    }
    return target;
  }
  var ENUM$1 = "enum";
  var enumerable$1 = function enumerable(rule, value, source, errors, options) {
    rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
    if (rule[ENUM$1].indexOf(value) === -1) {
      errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
    }
  };
  var pattern$2 = function pattern(rule, value, source, errors, options) {
    if (rule.pattern) {
      if (rule.pattern instanceof RegExp) {
        rule.pattern.lastIndex = 0;
        if (!rule.pattern.test(value)) {
          errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
        }
      } else if (typeof rule.pattern === "string") {
        var _pattern = new RegExp(rule.pattern);
        if (!_pattern.test(value)) {
          errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
        }
      }
    }
  };
  var range = function range2(rule, value, source, errors, options) {
    var len = typeof rule.len === "number";
    var min = typeof rule.min === "number";
    var max = typeof rule.max === "number";
    var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    var val = value;
    var key = null;
    var num = typeof value === "number";
    var str = typeof value === "string";
    var arr = Array.isArray(value);
    if (num) {
      key = "number";
    } else if (str) {
      key = "string";
    } else if (arr) {
      key = "array";
    }
    if (!key) {
      return false;
    }
    if (arr) {
      val = value.length;
    }
    if (str) {
      val = value.replace(spRegexp, "_").length;
    }
    if (len) {
      if (val !== rule.len) {
        errors.push(format(options.messages[key].len, rule.fullField, rule.len));
      }
    } else if (min && !max && val < rule.min) {
      errors.push(format(options.messages[key].min, rule.fullField, rule.min));
    } else if (max && !min && val > rule.max) {
      errors.push(format(options.messages[key].max, rule.fullField, rule.max));
    } else if (min && max && (val < rule.min || val > rule.max)) {
      errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
    }
  };
  var required$1 = function required(rule, value, source, errors, options, type4) {
    if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
      errors.push(format(options.messages.required, rule.fullField));
    }
  };
  var urlReg;
  const getUrlRegex = (function() {
    if (urlReg) {
      return urlReg;
    }
    var word = "[a-fA-F\\d:]";
    var b = function b2(options) {
      return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=".concat(word, ")|(?<=").concat(word, ")(?=\\s|$))") : "";
    };
    var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
    var v6seg = "[a-fA-F\\d]{1,4}";
    var v6List = [
      "(?:".concat(v6seg, ":){7}(?:").concat(v6seg, "|:)"),
"(?:".concat(v6seg, ":){6}(?:").concat(v4, "|:").concat(v6seg, "|:)"),
"(?:".concat(v6seg, ":){5}(?::").concat(v4, "|(?::").concat(v6seg, "){1,2}|:)"),
"(?:".concat(v6seg, ":){4}(?:(?::").concat(v6seg, "){0,1}:").concat(v4, "|(?::").concat(v6seg, "){1,3}|:)"),
"(?:".concat(v6seg, ":){3}(?:(?::").concat(v6seg, "){0,2}:").concat(v4, "|(?::").concat(v6seg, "){1,4}|:)"),
"(?:".concat(v6seg, ":){2}(?:(?::").concat(v6seg, "){0,3}:").concat(v4, "|(?::").concat(v6seg, "){1,5}|:)"),
"(?:".concat(v6seg, ":){1}(?:(?::").concat(v6seg, "){0,4}:").concat(v4, "|(?::").concat(v6seg, "){1,6}|:)"),
"(?::(?:(?::".concat(v6seg, "){0,5}:").concat(v4, "|(?::").concat(v6seg, "){1,7}|:))")
];
    var v6Eth0 = "(?:%[0-9a-zA-Z]{1,})?";
    var v6 = "(?:".concat(v6List.join("|"), ")").concat(v6Eth0);
    var v46Exact = new RegExp("(?:^".concat(v4, "$)|(?:^").concat(v6, "$)"));
    var v4exact = new RegExp("^".concat(v4, "$"));
    var v6exact = new RegExp("^".concat(v6, "$"));
    var ip = function ip2(options) {
      return options && options.exact ? v46Exact : new RegExp("(?:".concat(b(options)).concat(v4).concat(b(options), ")|(?:").concat(b(options)).concat(v6).concat(b(options), ")"), "g");
    };
    ip.v4 = function(options) {
      return options && options.exact ? v4exact : new RegExp("".concat(b(options)).concat(v4).concat(b(options)), "g");
    };
    ip.v6 = function(options) {
      return options && options.exact ? v6exact : new RegExp("".concat(b(options)).concat(v6).concat(b(options)), "g");
    };
    var protocol = "(?:(?:[a-z]+:)?//)";
    var auth = "(?:\\S+(?::\\S*)?@)?";
    var ipv4 = ip.v4().source;
    var ipv6 = ip.v6().source;
    var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
    var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
    var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
    var port = "(?::\\d{2,5})?";
    var path = '(?:[/?#][^\\s"]*)?';
    var regex = "(?:".concat(protocol, "|www\\.)").concat(auth, "(?:localhost|").concat(ipv4, "|").concat(ipv6, "|").concat(host).concat(domain).concat(tld, ")").concat(port).concat(path);
    urlReg = new RegExp("(?:^".concat(regex, "$)"), "i");
    return urlReg;
  });
  var pattern$1 = {
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,




tel: /^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,
    hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  };
  var types = {
    integer: function integer(value) {
      return types.number(value) && parseInt(value, 10) === value;
    },
    float: function float(value) {
      return types.number(value) && !types.integer(value);
    },
    array: function array(value) {
      return Array.isArray(value);
    },
    regexp: function regexp(value) {
      if (value instanceof RegExp) {
        return true;
      }
      try {
        return !!new RegExp(value);
      } catch (e2) {
        return false;
      }
    },
    date: function date(value) {
      return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
    },
    number: function number(value) {
      if (isNaN(value)) {
        return false;
      }
      return typeof value === "number";
    },
    object: function object(value) {
      return _typeof$1(value) === "object" && !types.array(value);
    },
    method: function method(value) {
      return typeof value === "function";
    },
    email: function email(value) {
      return typeof value === "string" && value.length <= 320 && !!value.match(pattern$1.email);
    },
    tel: function tel(value) {
      return typeof value === "string" && value.length <= 32 && !!value.match(pattern$1.tel);
    },
    url: function url(value) {
      return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
    },
    hex: function hex(value) {
      return typeof value === "string" && !!value.match(pattern$1.hex);
    }
  };
  var type$1 = function type(rule, value, source, errors, options) {
    if (rule.required && value === void 0) {
      required$1(rule, value, source, errors, options);
      return;
    }
    var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "tel", "number", "date", "url", "hex"];
    var ruleType = rule.type;
    if (custom.indexOf(ruleType) > -1) {
      if (!types[ruleType](value)) {
        errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
      }
    } else if (ruleType && _typeof$1(value) !== rule.type) {
      errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
    }
  };
  var whitespace$1 = function whitespace(rule, value, source, errors, options) {
    if (/^\s+$/.test(value) || value === "") {
      errors.push(format(options.messages.whitespace, rule.fullField));
    }
  };
  const rules = {
    required: required$1,
    whitespace: whitespace$1,
    type: type$1,
    range,
    enum: enumerable$1,
    pattern: pattern$2
  };
  var any = function any2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
    }
    callback(errors);
  };
  var array2 = function array3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if ((value === void 0 || value === null) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, "array");
      if (value !== void 0 && value !== null) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var boolean = function boolean2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var date2 = function date3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "date") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value, "date")) {
        var dateObject;
        if (value instanceof Date) {
          dateObject = value;
        } else {
          dateObject = new Date(value);
        }
        rules.type(rule, dateObject, source, errors, options);
        if (dateObject) {
          rules.range(rule, dateObject.getTime(), source, errors, options);
        }
      }
    }
    callback(errors);
  };
  var ENUM = "enum";
  var enumerable2 = function enumerable3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules[ENUM](rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var floatFn = function floatFn2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var integer2 = function integer3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var method2 = function method3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var number2 = function number3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (value === "") {
        value = void 0;
      }
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var object2 = function object3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (value !== void 0) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var pattern2 = function pattern3(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "string") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value, "string")) {
        rules.pattern(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var regexp$1 = function regexp2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options);
      if (!isEmptyValue(value)) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  var required2 = function required3(rule, value, callback, source, options) {
    var errors = [];
    var type4 = Array.isArray(value) ? "array" : _typeof$1(value);
    rules.required(rule, value, source, errors, options, type4);
    callback(errors);
  };
  var string = function string2(rule, value, callback, source, options) {
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, "string") && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, "string");
      if (!isEmptyValue(value, "string")) {
        rules.type(rule, value, source, errors, options);
        rules.range(rule, value, source, errors, options);
        rules.pattern(rule, value, source, errors, options);
        if (rule.whitespace === true) {
          rules.whitespace(rule, value, source, errors, options);
        }
      }
    }
    callback(errors);
  };
  var type2 = function type3(rule, value, callback, source, options) {
    var ruleType = rule.type;
    var errors = [];
    var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
    if (validate) {
      if (isEmptyValue(value, ruleType) && !rule.required) {
        return callback();
      }
      rules.required(rule, value, source, errors, options, ruleType);
      if (!isEmptyValue(value, ruleType)) {
        rules.type(rule, value, source, errors, options);
      }
    }
    callback(errors);
  };
  const validators = {
    string,
    method: method2,
    number: number2,
    boolean,
    regexp: regexp$1,
    integer: integer2,
    float: floatFn,
    array: array2,
    object: object2,
    enum: enumerable2,
    pattern: pattern2,
    date: date2,
    url: type2,
    hex: type2,
    email: type2,
    tel: type2,
    required: required2,
    any
  };
  var Schema = (function() {
    function Schema2(descriptor) {
      _classCallCheck(this, Schema2);
      _defineProperty$1(this, "rules", null);
      _defineProperty$1(this, "_messages", messages);
      this.define(descriptor);
    }
    _createClass(Schema2, [{
      key: "define",
      value: function define(rules2) {
        var _this = this;
        if (!rules2) {
          throw new Error("Cannot configure a schema with no rules");
        }
        if (_typeof$1(rules2) !== "object" || Array.isArray(rules2)) {
          throw new Error("Rules must be an object");
        }
        this.rules = {};
        Object.keys(rules2).forEach(function(name) {
          var item = rules2[name];
          _this.rules[name] = Array.isArray(item) ? item : [item];
        });
      }
    }, {
      key: "messages",
      value: function messages2(_messages) {
        if (_messages) {
          this._messages = deepMerge(newMessages(), _messages);
        }
        return this._messages;
      }
    }, {
      key: "validate",
      value: function validate(source_) {
        var _this2 = this;
        var o2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        var oc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
        };
        var source = source_;
        var options = o2;
        var callback = oc;
        if (typeof options === "function") {
          callback = options;
          options = {};
        }
        if (!this.rules || Object.keys(this.rules).length === 0) {
          if (callback) {
            callback(null, source);
          }
          return Promise.resolve(source);
        }
        function complete(results) {
          var errors = [];
          var fields = {};
          function add(e2) {
            if (Array.isArray(e2)) {
              var _errors;
              errors = (_errors = errors).concat.apply(_errors, _toConsumableArray(e2));
            } else {
              errors.push(e2);
            }
          }
          for (var i = 0; i < results.length; i++) {
            add(results[i]);
          }
          if (!errors.length) {
            callback(null, source);
          } else {
            fields = convertFieldsError(errors);
            callback(errors, fields);
          }
        }
        if (options.messages) {
          var messages$1 = this.messages();
          if (messages$1 === messages) {
            messages$1 = newMessages();
          }
          deepMerge(messages$1, options.messages);
          options.messages = messages$1;
        } else {
          options.messages = this.messages();
        }
        var series = {};
        var keys2 = options.keys || Object.keys(this.rules);
        keys2.forEach(function(z) {
          var arr = _this2.rules[z];
          var value = source[z];
          arr.forEach(function(r2) {
            var rule = r2;
            if (typeof rule.transform === "function") {
              if (source === source_) {
                source = _objectSpread2({}, source);
              }
              value = source[z] = rule.transform(value);
              if (value !== void 0 && value !== null) {
                rule.type = rule.type || (Array.isArray(value) ? "array" : _typeof$1(value));
              }
            }
            if (typeof rule === "function") {
              rule = {
                validator: rule
              };
            } else {
              rule = _objectSpread2({}, rule);
            }
            rule.validator = _this2.getValidationMethod(rule);
            if (!rule.validator) {
              return;
            }
            rule.field = z;
            rule.fullField = rule.fullField || z;
            rule.type = _this2.getType(rule);
            series[z] = series[z] || [];
            series[z].push({
              rule,
              value,
              source,
              field: z
            });
          });
        });
        var errorFields = {};
        return asyncMap(series, options, function(data, doIt) {
          var rule = data.rule;
          var deep = (rule.type === "object" || rule.type === "array") && (_typeof$1(rule.fields) === "object" || _typeof$1(rule.defaultField) === "object");
          deep = deep && (rule.required || !rule.required && data.value);
          rule.field = data.field;
          function addFullField(key, schema) {
            return _objectSpread2(_objectSpread2({}, schema), {}, {
              fullField: "".concat(rule.fullField, ".").concat(key),
              fullFields: rule.fullFields ? [].concat(_toConsumableArray(rule.fullFields), [key]) : [key]
            });
          }
          function cb() {
            var e2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
            var errorList = Array.isArray(e2) ? e2 : [e2];
            if (!options.suppressWarning && errorList.length) {
              Schema2.warning("async-validator:", errorList);
            }
            if (errorList.length && rule.message !== void 0 && rule.message !== null) {
              errorList = [].concat(rule.message);
            }
            var filledErrors = errorList.map(complementError(rule, source));
            if (options.first && filledErrors.length) {
              errorFields[rule.field] = 1;
              return doIt(filledErrors);
            }
            if (!deep) {
              doIt(filledErrors);
            } else {
              if (rule.required && !data.value) {
                if (rule.message !== void 0) {
                  filledErrors = [].concat(rule.message).map(complementError(rule, source));
                } else if (options.error) {
                  filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
                }
                return doIt(filledErrors);
              }
              var fieldsSchema = {};
              if (rule.defaultField) {
                Object.keys(data.value).map(function(key) {
                  fieldsSchema[key] = rule.defaultField;
                });
              }
              fieldsSchema = _objectSpread2(_objectSpread2({}, fieldsSchema), data.rule.fields);
              var paredFieldsSchema = {};
              Object.keys(fieldsSchema).forEach(function(field) {
                var fieldSchema = fieldsSchema[field];
                var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
                paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
              });
              var schema = new Schema2(paredFieldsSchema);
              schema.messages(options.messages);
              if (data.rule.options) {
                data.rule.options.messages = options.messages;
                data.rule.options.error = options.error;
              }
              schema.validate(data.value, data.rule.options || options, function(errs) {
                var finalErrors = [];
                if (filledErrors && filledErrors.length) {
                  finalErrors.push.apply(finalErrors, _toConsumableArray(filledErrors));
                }
                if (errs && errs.length) {
                  finalErrors.push.apply(finalErrors, _toConsumableArray(errs));
                }
                doIt(finalErrors.length ? finalErrors : null);
              });
            }
          }
          var res;
          if (rule.asyncValidator) {
            res = rule.asyncValidator(rule, data.value, cb, data.source, options);
          } else if (rule.validator) {
            try {
              res = rule.validator(rule, data.value, cb, data.source, options);
            } catch (error) {
              var _console$error, _console;
              (_console$error = (_console = console).error) === null || _console$error === void 0 || _console$error.call(_console, error);
              if (!options.suppressValidatorError) {
                setTimeout(function() {
                  throw error;
                }, 0);
              }
              cb(error.message);
            }
            if (res === true) {
              cb();
            } else if (res === false) {
              cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || "".concat(rule.fullField || rule.field, " fails"));
            } else if (res instanceof Array) {
              cb(res);
            } else if (res instanceof Error) {
              cb(res.message);
            }
          }
          if (res && res.then) {
            res.then(function() {
              return cb();
            }, function(e2) {
              return cb(e2);
            });
          }
        }, function(results) {
          complete(results);
        }, source);
      }
    }, {
      key: "getType",
      value: function getType(rule) {
        if (rule.type === void 0 && rule.pattern instanceof RegExp) {
          rule.type = "pattern";
        }
        if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
          throw new Error(format("Unknown rule type %s", rule.type));
        }
        return rule.type || "string";
      }
    }, {
      key: "getValidationMethod",
      value: function getValidationMethod(rule) {
        if (typeof rule.validator === "function") {
          return rule.validator;
        }
        var keys2 = Object.keys(rule);
        var messageIndex = keys2.indexOf("message");
        if (messageIndex !== -1) {
          keys2.splice(messageIndex, 1);
        }
        if (keys2.length === 1 && keys2[0] === "required") {
          return validators.required;
        }
        return validators[this.getType(rule)] || void 0;
      }
    }]);
    return Schema2;
  })();
  _defineProperty$1(Schema, "register", function register(type4, validator) {
    if (typeof validator !== "function") {
      throw new Error("Cannot register a validator by type, validator is not a function");
    }
    validators[type4] = validator;
  });
  _defineProperty$1(Schema, "warning", warning$1);
  _defineProperty$1(Schema, "messages", messages);
  _defineProperty$1(Schema, "validators", validators);
  const typeTemplate$1 = "'${name}' is not a valid ${type}";
  const defaultValidateMessages = {
    default: "Validation error on field '${name}'",
    required: "'${name}' is required",
    enum: "'${name}' must be one of [${enum}]",
    whitespace: "'${name}' cannot be empty",
    date: {
      format: "'${name}' is invalid for format date",
      parse: "'${name}' could not be parsed as date",
      invalid: "'${name}' is invalid date"
    },
    types: {
      string: typeTemplate$1,
      method: typeTemplate$1,
      array: typeTemplate$1,
      object: typeTemplate$1,
      number: typeTemplate$1,
      date: typeTemplate$1,
      boolean: typeTemplate$1,
      integer: typeTemplate$1,
      float: typeTemplate$1,
      regexp: typeTemplate$1,
      email: typeTemplate$1,
      tel: typeTemplate$1,
      url: typeTemplate$1,
      hex: typeTemplate$1
    },
    string: {
      len: "'${name}' must be exactly ${len} characters",
      min: "'${name}' must be at least ${min} characters",
      max: "'${name}' cannot be longer than ${max} characters",
      range: "'${name}' must be between ${min} and ${max} characters"
    },
    number: {
      len: "'${name}' must equal ${len}",
      min: "'${name}' cannot be less than ${min}",
      max: "'${name}' cannot be greater than ${max}",
      range: "'${name}' must be between ${min} and ${max}"
    },
    array: {
      len: "'${name}' must be exactly ${len} in length",
      min: "'${name}' cannot be less than ${min} in length",
      max: "'${name}' cannot be greater than ${max} in length",
      range: "'${name}' must be between ${min} and ${max} in length"
    },
    pattern: {
      mismatch: "'${name}' does not match pattern ${pattern}"
    }
  };
  function get(entity, path) {
    let current = entity;
    for (let i = 0; i < path.length; i += 1) {
      if (current === null || current === void 0) {
        return void 0;
      }
      current = current[path[i]];
    }
    return current;
  }
  function internalSet(entity, paths, value, removeIfUndefined) {
    if (!paths.length) {
      return value;
    }
    const [path, ...restPath] = paths;
    let clone;
    if (!entity && typeof path === "number") {
      clone = [];
    } else if (Array.isArray(entity)) {
      clone = [...entity];
    } else {
      clone = {
        ...entity
      };
    }
    if (removeIfUndefined && value === void 0 && restPath.length === 1) {
      delete clone[path][restPath[0]];
    } else {
      clone[path] = internalSet(clone[path], restPath, value, removeIfUndefined);
    }
    return clone;
  }
  function set(entity, paths, value, removeIfUndefined = false) {
    if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
      return entity;
    }
    return internalSet(entity, paths, value, removeIfUndefined);
  }
  function isObject(obj) {
    return typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
  }
  function createEmpty(source) {
    return Array.isArray(source) ? [] : {};
  }
  const keys = typeof Reflect === "undefined" ? Object.keys : Reflect.ownKeys;
  function mergeWith(sources, config = {}) {
    const {
      prepareArray
    } = config;
    const finalPrepareArray = prepareArray || (() => []);
    let clone = createEmpty(sources[0]);
    sources.forEach((src) => {
      function internalMerge(path, parentLoopSet) {
        const loopSet = new Set(parentLoopSet);
        const value = get(src, path);
        const isArr = Array.isArray(value);
        if (isArr || isObject(value)) {
          if (!loopSet.has(value)) {
            loopSet.add(value);
            const originValue = get(clone, path);
            if (isArr) {
              clone = set(clone, path, finalPrepareArray(originValue, value));
            } else if (!originValue || typeof originValue !== "object") {
              clone = set(clone, path, createEmpty(value));
            }
            keys(value).forEach((key) => {
              if (Object.getOwnPropertyDescriptor(value, key).enumerable) {
                internalMerge([...path, key], loopSet);
              }
            });
          }
        } else {
          clone = set(clone, path, value);
        }
      }
      internalMerge([]);
    });
    return clone;
  }
  function merge$1(...sources) {
    return mergeWith(sources);
  }
  const AsyncValidator = Schema;
  function replaceMessage(template, kv) {
    return template.replace(/\\?\$\{\w+\}/g, (str) => {
      if (str.startsWith("\\")) {
        return str.slice(1);
      }
      const key = str.slice(2, -1);
      return kv[key];
    });
  }
  const CODE_LOGIC_ERROR = "CODE_LOGIC_ERROR";
  async function validateRule(name, value, rule, options, messageVariables) {
    const cloneRule = {
      ...rule
    };
    delete cloneRule.ruleIndex;
    AsyncValidator.warning = () => void 0;
    if (cloneRule.validator) {
      const originValidator = cloneRule.validator;
      cloneRule.validator = (...args) => {
        try {
          return originValidator(...args);
        } catch (error) {
          console.error(error);
          return Promise.reject(CODE_LOGIC_ERROR);
        }
      };
    }
    let subRuleField = null;
    if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) {
      subRuleField = cloneRule.defaultField;
      delete cloneRule.defaultField;
    }
    const validator = new AsyncValidator({
      [name]: [cloneRule]
    });
    const messages2 = merge$1(defaultValidateMessages, options.validateMessages);
    validator.messages(messages2);
    let result = [];
    try {
      await Promise.resolve(validator.validate({
        [name]: value
      }, {
        ...options
      }));
    } catch (errObj) {
      if (errObj.errors) {
        result = errObj.errors.map(({
          message: message2
        }, index) => {
          const mergedMessage = message2 === CODE_LOGIC_ERROR ? messages2.default : message2;
          return React__namespace.isValidElement(mergedMessage) ? (

React__namespace.cloneElement(mergedMessage, {
              key: `error_${index}`
            })
          ) : mergedMessage;
        });
      }
    }
    if (!result.length && subRuleField && Array.isArray(value) && value.length > 0) {
      const subResults = await Promise.all(value.map((subValue, i) => validateRule(`${name}.${i}`, subValue, subRuleField, options, messageVariables)));
      return subResults.reduce((prev2, errors) => [...prev2, ...errors], []);
    }
    const kv = {
      ...rule,
      name,
      enum: (rule.enum || []).join(", "),
      ...messageVariables
    };
    const fillVariableResult = result.map((error) => {
      if (typeof error === "string") {
        return replaceMessage(error, kv);
      }
      return error;
    });
    return fillVariableResult;
  }
  function validateRules(namePath, value, rules2, options, validateFirst, messageVariables) {
    const name = namePath.join(".");
    const filledRules = rules2.map((currentRule, ruleIndex) => {
      const originValidatorFunc = currentRule.validator;
      const cloneRule = {
        ...currentRule,
        ruleIndex
      };
      if (originValidatorFunc) {
        cloneRule.validator = (rule, val, callback) => {
          let hasPromise = false;
          const wrappedCallback = (...args) => {
            Promise.resolve().then(() => {
              warningOnce(!hasPromise, "Your validator function has already return a promise. `callback` will be ignored.");
              if (!hasPromise) {
                callback(...args);
              }
            });
          };
          const promise = originValidatorFunc(rule, val, wrappedCallback);
          hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function";
          warningOnce(hasPromise, "`callback` is deprecated. Please return a promise instead.");
          if (hasPromise) {
            promise.then(() => {
              callback();
            }).catch((err) => {
              callback(err || " ");
            });
          }
        };
      }
      return cloneRule;
    }).sort(({
      warningOnly: w1,
      ruleIndex: i1
    }, {
      warningOnly: w2,
      ruleIndex: i2
    }) => {
      if (!!w1 === !!w2) {
        return i1 - i2;
      }
      if (w1) {
        return 1;
      }
      return -1;
    });
    let summaryPromise;
    if (validateFirst === true) {
      summaryPromise = new Promise(async (resolve, reject) => {
        for (let i = 0; i < filledRules.length; i += 1) {
          const rule = filledRules[i];
          const errors = await validateRule(name, value, rule, options, messageVariables);
          if (errors.length) {
            reject([{
              errors,
              rule
            }]);
            return;
          }
        }
        resolve([]);
      });
    } else {
      const rulePromises = filledRules.map((rule) => validateRule(name, value, rule, options, messageVariables).then((errors) => ({
        errors,
        rule
      })));
      summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then((errors) => {
        return Promise.reject(errors);
      });
    }
    summaryPromise.catch((e2) => e2);
    return summaryPromise;
  }
  async function finishOnAllFailed(rulePromises) {
    return Promise.all(rulePromises).then((errorsList) => {
      const errors = [].concat(...errorsList);
      return errors;
    });
  }
  async function finishOnFirstFailed(rulePromises) {
    let count = 0;
    return new Promise((resolve) => {
      rulePromises.forEach((promise) => {
        promise.then((ruleError) => {
          if (ruleError.errors.length) {
            resolve([ruleError]);
          }
          count += 1;
          if (count === rulePromises.length) {
            resolve([]);
          }
        });
      });
    });
  }
  function getNamePath(path) {
    return toArray$2(path);
  }
  function cloneByNamePathList(store, namePathList) {
    let newStore = {};
    namePathList.forEach((namePath) => {
      const value = get(store, namePath);
      newStore = set(newStore, namePath, value);
    });
    return newStore;
  }
  function containsNamePath(namePathList, namePath, partialMatch = false) {
    return namePathList && namePathList.some((path) => matchNamePath(namePath, path, partialMatch));
  }
  function matchNamePath(namePath, subNamePath, partialMatch = false) {
    if (!namePath || !subNamePath) {
      return false;
    }
    if (!partialMatch && namePath.length !== subNamePath.length) {
      return false;
    }
    return subNamePath.every((nameUnit, i) => namePath[i] === nameUnit);
  }
  function isSimilar(source, target) {
    if (source === target) {
      return true;
    }
    if (!source && target || source && !target) {
      return false;
    }
    if (!source || !target || typeof source !== "object" || typeof target !== "object") {
      return false;
    }
    const sourceKeys = Object.keys(source);
    const targetKeys = Object.keys(target);
    const keys2 = new Set([...sourceKeys, ...targetKeys]);
    return [...keys2].every((key) => {
      const sourceValue = source[key];
      const targetValue = target[key];
      if (typeof sourceValue === "function" && typeof targetValue === "function") {
        return true;
      }
      return sourceValue === targetValue;
    });
  }
  function defaultGetValueFromEvent(valuePropName, ...args) {
    const event = args[0];
    if (event && event.target && typeof event.target === "object" && valuePropName in event.target) {
      return event.target[valuePropName];
    }
    return event;
  }
  function move(array4, moveIndex, toIndex) {
    const {
      length: length2
    } = array4;
    if (moveIndex < 0 || moveIndex >= length2 || toIndex < 0 || toIndex >= length2) {
      return array4;
    }
    const item = array4[moveIndex];
    const diff = moveIndex - toIndex;
    if (diff > 0) {
      return [...array4.slice(0, toIndex), item, ...array4.slice(toIndex, moveIndex), ...array4.slice(moveIndex + 1, length2)];
    }
    if (diff < 0) {
      return [...array4.slice(0, moveIndex), ...array4.slice(moveIndex + 1, toIndex + 1), item, ...array4.slice(toIndex + 1, length2)];
    }
    return array4;
  }
  const macroTask = (fn) => {
    const channel = new MessageChannel();
    channel.port1.onmessage = fn;
    channel.port2.postMessage(null);
  };
  class WatcherCenter {
    namePathList = [];
    taskId = 0;
    watcherList = new Set();
    form;
    constructor(form) {
      this.form = form;
    }
    register(callback) {
      this.watcherList.add(callback);
      return () => {
        this.watcherList.delete(callback);
      };
    }
    notify(namePath) {
      namePath.forEach((path) => {
        if (this.namePathList.every((exist) => !matchNamePath(exist, path))) {
          this.namePathList.push(path);
        }
      });
      this.doBatch();
    }
    doBatch() {
      this.taskId += 1;
      const currentId = this.taskId;
      macroTask(() => {
        if (currentId === this.taskId && this.watcherList.size) {
          const formInst = this.form.getForm();
          const values = formInst.getFieldsValue();
          const allValues = formInst.getFieldsValue(true);
          this.watcherList.forEach((callback) => {
            callback(values, allValues, this.namePathList);
          });
          this.namePathList = [];
        }
      });
    }
  }
  let raf = (callback) => +setTimeout(callback, 16);
  let caf = (num) => clearTimeout(num);
  if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
    raf = (callback) => window.requestAnimationFrame(callback);
    caf = (handle) => window.cancelAnimationFrame(handle);
  }
  let rafUUID = 0;
  const rafIds = new Map();
  function cleanup(id) {
    rafIds.delete(id);
  }
  const wrapperRaf = (callback, times = 1) => {
    rafUUID += 1;
    const id = rafUUID;
    function callRef(leftTimes) {
      if (leftTimes === 0) {
        cleanup(id);
        callback();
      } else {
        const realId = raf(() => {
          callRef(leftTimes - 1);
        });
        rafIds.set(id, realId);
      }
    }
    callRef(times);
    return id;
  };
  wrapperRaf.cancel = (id) => {
    const realId = rafIds.get(id);
    cleanup(id);
    return caf(realId);
  };
  async function delayFrame() {
    return new Promise((resolve) => {
      macroTask(() => {
        wrapperRaf(() => {
          resolve();
        });
      });
    });
  }
  function _extends$n() {
    _extends$n = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$n.apply(this, arguments);
  }
  const EMPTY_ERRORS = [];
  const EMPTY_WARNINGS = [];
  function requireUpdate(shouldUpdate, prev2, next2, prevValue, nextValue, info) {
    if (typeof shouldUpdate === "function") {
      return shouldUpdate(prev2, next2, "source" in info ? {
        source: info.source
      } : {});
    }
    return prevValue !== nextValue;
  }
  class Field extends React__namespace.Component {
    static contextType = Context$1;
    state = {
      resetCount: 0
    };
    cancelRegisterFunc = null;
    mounted = false;
touched = false;
dirty = false;
    validatePromise;
    prevValidating;
    errors = EMPTY_ERRORS;
    warnings = EMPTY_WARNINGS;
constructor(props) {
      super(props);
      if (props.fieldContext) {
        const {
          getInternalHooks
        } = props.fieldContext;
        const {
          initEntityValue
        } = getInternalHooks(HOOK_MARK);
        initEntityValue(this);
      }
    }
    componentDidMount() {
      const {
        shouldUpdate,
        fieldContext
      } = this.props;
      this.mounted = true;
      if (fieldContext) {
        const {
          getInternalHooks
        } = fieldContext;
        const {
          registerField
        } = getInternalHooks(HOOK_MARK);
        this.cancelRegisterFunc = registerField(this);
      }
      if (shouldUpdate === true) {
        this.reRender();
      }
    }
    componentWillUnmount() {
      this.cancelRegister();
      this.triggerMetaEvent(true);
      this.mounted = false;
    }
    cancelRegister = () => {
      const {
        preserve: preserve2,
        isListField,
        name
      } = this.props;
      if (this.cancelRegisterFunc) {
        this.cancelRegisterFunc(isListField, preserve2, getNamePath(name));
      }
      this.cancelRegisterFunc = null;
    };
getNamePath = () => {
      const {
        name,
        fieldContext
      } = this.props;
      const {
        prefixName = []
      } = fieldContext;
      return name !== void 0 ? [...prefixName, ...name] : [];
    };
    getRules = () => {
      const {
        rules: rules2 = [],
        fieldContext
      } = this.props;
      return rules2.map((rule) => {
        if (typeof rule === "function") {
          return rule(fieldContext);
        }
        return rule;
      });
    };
    reRender() {
      if (!this.mounted) return;
      this.forceUpdate();
    }
    refresh = () => {
      if (!this.mounted) return;
      this.setState(({
        resetCount
      }) => ({
        resetCount: resetCount + 1
      }));
    };
metaCache = null;
    triggerMetaEvent = (destroy2) => {
      const {
        onMetaChange
      } = this.props;
      if (onMetaChange) {
        const meta = {
          ...this.getMeta(),
          destroy: destroy2
        };
        if (!isEqual(this.metaCache, meta)) {
          onMetaChange(meta);
        }
        this.metaCache = meta;
      } else {
        this.metaCache = null;
      }
    };

onStoreChange = (prevStore, namePathList, info) => {
      const {
        shouldUpdate,
        dependencies = [],
        onReset
      } = this.props;
      const {
        store
      } = info;
      const namePath = this.getNamePath();
      const prevValue = this.getValue(prevStore);
      const curValue = this.getValue(store);
      const namePathMatch = namePathList && containsNamePath(namePathList, namePath);
      if (info.type === "valueUpdate" && info.source === "external" && !isEqual(prevValue, curValue)) {
        this.touched = true;
        this.dirty = true;
        this.validatePromise = null;
        this.errors = EMPTY_ERRORS;
        this.warnings = EMPTY_WARNINGS;
        this.triggerMetaEvent();
      }
      switch (info.type) {
        case "reset":
          if (!namePathList || namePathMatch) {
            this.touched = false;
            this.dirty = false;
            this.validatePromise = void 0;
            this.errors = EMPTY_ERRORS;
            this.warnings = EMPTY_WARNINGS;
            this.triggerMetaEvent();
            onReset?.();
            this.refresh();
            return;
          }
          break;
case "remove": {
          if (shouldUpdate && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
            this.reRender();
            return;
          }
          break;
        }
        case "setField": {
          const {
            data
          } = info;
          if (namePathMatch) {
            if ("touched" in data) {
              this.touched = data.touched;
            }
            if ("validating" in data && !("originRCField" in data)) {
              this.validatePromise = data.validating ? Promise.resolve([]) : null;
            }
            if ("errors" in data) {
              this.errors = data.errors || EMPTY_ERRORS;
            }
            if ("warnings" in data) {
              this.warnings = data.warnings || EMPTY_WARNINGS;
            }
            this.dirty = true;
            this.triggerMetaEvent();
            this.reRender();
            return;
          } else if ("value" in data && containsNamePath(namePathList, namePath, true)) {
            this.reRender();
            return;
          }
          if (shouldUpdate && !namePath.length && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
            this.reRender();
            return;
          }
          break;
        }
        case "dependenciesUpdate": {
          const dependencyList = dependencies.map(getNamePath);
          if (dependencyList.some((dependency) => containsNamePath(info.relatedFields, dependency))) {
            this.reRender();
            return;
          }
          break;
        }
        default:
          if (namePathMatch || (!dependencies.length || namePath.length || shouldUpdate) && requireUpdate(shouldUpdate, prevStore, store, prevValue, curValue, info)) {
            this.reRender();
            return;
          }
          break;
      }
      if (shouldUpdate === true) {
        this.reRender();
      }
    };
    validateRules = (options) => {
      const namePath = this.getNamePath();
      const currentValue = this.getValue();
      const {
        triggerName,
        validateOnly = false,
        delayFrame: showDelayFrame
      } = options || {};
      const rootPromise = Promise.resolve().then(async () => {
        if (!this.mounted) {
          return [];
        }
        const {
          validateFirst = false,
          messageVariables,
          validateDebounce
        } = this.props;
        if (showDelayFrame) {
          await delayFrame();
        }
        let filteredRules = this.getRules();
        if (triggerName) {
          filteredRules = filteredRules.filter((rule) => rule).filter((rule) => {
            const {
              validateTrigger
            } = rule;
            if (!validateTrigger) {
              return true;
            }
            const triggerList = toArray$2(validateTrigger);
            return triggerList.includes(triggerName);
          });
        }
        if (validateDebounce && triggerName) {
          await new Promise((resolve) => {
            setTimeout(resolve, validateDebounce);
          });
          if (this.validatePromise !== rootPromise) {
            return [];
          }
        }
        const promise = validateRules(namePath, currentValue, filteredRules, options, validateFirst, messageVariables);
        promise.catch((e2) => e2).then((ruleErrors = EMPTY_ERRORS) => {
          if (this.validatePromise === rootPromise) {
            this.validatePromise = null;
            const nextErrors = [];
            const nextWarnings = [];
            ruleErrors.forEach?.(({
              rule: {
                warningOnly
              },
              errors = EMPTY_ERRORS
            }) => {
              if (warningOnly) {
                nextWarnings.push(...errors);
              } else {
                nextErrors.push(...errors);
              }
            });
            this.errors = nextErrors;
            this.warnings = nextWarnings;
            this.triggerMetaEvent();
            this.reRender();
          }
        });
        return promise;
      });
      if (validateOnly) {
        return rootPromise;
      }
      this.validatePromise = rootPromise;
      this.dirty = true;
      this.errors = EMPTY_ERRORS;
      this.warnings = EMPTY_WARNINGS;
      this.triggerMetaEvent();
      this.reRender();
      return rootPromise;
    };
    isFieldValidating = () => !!this.validatePromise;
    isFieldTouched = () => this.touched;
    isFieldDirty = () => {
      if (this.dirty || this.props.initialValue !== void 0) {
        return true;
      }
      const {
        fieldContext
      } = this.props;
      const {
        getInitialValue
      } = fieldContext.getInternalHooks(HOOK_MARK);
      if (getInitialValue(this.getNamePath()) !== void 0) {
        return true;
      }
      return false;
    };
    getErrors = () => this.errors;
    getWarnings = () => this.warnings;
    isListField = () => this.props.isListField;
    isList = () => this.props.isList;
    isPreserve = () => this.props.preserve;
getMeta = () => {
      this.prevValidating = this.isFieldValidating();
      const meta = {
        touched: this.isFieldTouched(),
        validating: this.prevValidating,
        errors: this.errors,
        warnings: this.warnings,
        name: this.getNamePath(),
        validated: this.validatePromise === null
      };
      return meta;
    };
getOnlyChild = (children) => {
      if (typeof children === "function") {
        const meta = this.getMeta();
        return {
          ...this.getOnlyChild(children(this.getControlled(), meta, this.props.fieldContext)),
          isFunction: true
        };
      }
      const childList = toArray$3(children);
      if (childList.length !== 1 || ! React__namespace.isValidElement(childList[0])) {
        return {
          child: childList,
          isFunction: false
        };
      }
      return {
        child: childList[0],
        isFunction: false
      };
    };
getValue = (store) => {
      const {
        getFieldsValue
      } = this.props.fieldContext;
      const namePath = this.getNamePath();
      return get(store || getFieldsValue(true), namePath);
    };
    getControlled = (childProps = {}) => {
      const {
        name,
        trigger = "onChange",
        validateTrigger,
        getValueFromEvent,
        normalize: normalize2,
        valuePropName = "value",
        getValueProps,
        fieldContext
      } = this.props;
      const mergedValidateTrigger = validateTrigger !== void 0 ? validateTrigger : fieldContext.validateTrigger;
      const namePath = this.getNamePath();
      const {
        getInternalHooks,
        getFieldsValue
      } = fieldContext;
      const {
        dispatch
      } = getInternalHooks(HOOK_MARK);
      const value = this.getValue();
      const mergedGetValueProps = getValueProps || ((val) => ({
        [valuePropName]: val
      }));
      const originTriggerFunc = childProps[trigger];
      const valueProps = name !== void 0 ? mergedGetValueProps(value) : {};
      const control = {
        ...childProps,
        ...valueProps
      };
      control[trigger] = (...args) => {
        this.touched = true;
        this.dirty = true;
        this.triggerMetaEvent();
        let newValue;
        if (getValueFromEvent) {
          newValue = getValueFromEvent(...args);
        } else {
          newValue = defaultGetValueFromEvent(valuePropName, ...args);
        }
        if (normalize2) {
          newValue = normalize2(newValue, value, getFieldsValue(true));
        }
        if (newValue !== value) {
          dispatch({
            type: "updateValue",
            namePath,
            value: newValue
          });
        }
        if (originTriggerFunc) {
          originTriggerFunc(...args);
        }
      };
      const validateTriggerList = toArray$2(mergedValidateTrigger || []);
      validateTriggerList.forEach((triggerName) => {
        const originTrigger = control[triggerName];
        control[triggerName] = (...args) => {
          if (originTrigger) {
            originTrigger(...args);
          }
          const {
            rules: rules2
          } = this.props;
          if (rules2 && rules2.length) {
            dispatch({
              type: "validateField",
              namePath,
              triggerName
            });
          }
        };
      });
      return control;
    };
    render() {
      const {
        resetCount
      } = this.state;
      const {
        children
      } = this.props;
      const {
        child,
        isFunction
      } = this.getOnlyChild(children);
      let returnChildNode;
      if (isFunction) {
        returnChildNode = child;
      } else if ( React__namespace.isValidElement(child)) {
        returnChildNode = React__namespace.cloneElement(child, this.getControlled(child.props));
      } else {
        warningOnce(!child, "`children` of Field is not validate ReactElement.");
        returnChildNode = child;
      }
      return React__namespace.createElement(React__namespace.Fragment, {
        key: resetCount
      }, returnChildNode);
    }
  }
  function WrapperField({
    name,
    ...restProps
  }) {
    const fieldContext = React__namespace.useContext(Context$1);
    const listContext = React__namespace.useContext(ListContext);
    const namePath = name !== void 0 ? getNamePath(name) : void 0;
    const isMergedListField = restProps.isListField ?? !!listContext;
    let key = "keep";
    if (!isMergedListField) {
      key = `_${(namePath || []).join("_")}`;
    }
    return React__namespace.createElement(Field, _extends$n({
      key,
      name: namePath,
      isListField: isMergedListField
    }, restProps, {
      fieldContext
    }));
  }
  function List({
    name,
    initialValue,
    children,
    rules: rules2,
    validateTrigger,
    isListField
  }) {
    const context = React__namespace.useContext(Context$1);
    const wrapperListContext = React__namespace.useContext(ListContext);
    const keyRef = React__namespace.useRef({
      keys: [],
      id: 0
    });
    const keyManager = keyRef.current;
    const prefixName = React__namespace.useMemo(() => {
      const parentPrefixName = getNamePath(context.prefixName) || [];
      return [...parentPrefixName, ...getNamePath(name)];
    }, [context.prefixName, name]);
    const fieldContext = React__namespace.useMemo(() => ({
      ...context,
      prefixName
    }), [context, prefixName]);
    const listContext = React__namespace.useMemo(() => ({
      getKey: (namePath) => {
        const len = prefixName.length;
        const pathName = namePath[len];
        return [keyManager.keys[pathName], namePath.slice(len + 1)];
      }
    }), [keyManager, prefixName]);
    if (typeof children !== "function") {
      warningOnce(false, "Form.List only accepts function as children.");
      return null;
    }
    const shouldUpdate = (prevValue, nextValue, {
      source
    }) => {
      if (source === "internal") {
        return false;
      }
      return prevValue !== nextValue;
    };
    return React__namespace.createElement(ListContext.Provider, {
      value: listContext
    }, React__namespace.createElement(Context$1.Provider, {
      value: fieldContext
    }, React__namespace.createElement(WrapperField, {
      name: [],
      shouldUpdate,
      rules: rules2,
      validateTrigger,
      initialValue,
      isList: true,
      isListField: isListField ?? !!wrapperListContext
    }, ({
      value = [],
      onChange
    }, meta) => {
      const {
        getFieldValue
      } = context;
      const getNewValue = () => {
        const values = getFieldValue(prefixName || []);
        return values || [];
      };
      const operations = {
        add: (defaultValue, index) => {
          const newValue = getNewValue();
          if (index >= 0 && index <= newValue.length) {
            keyManager.keys = [...keyManager.keys.slice(0, index), keyManager.id, ...keyManager.keys.slice(index)];
            onChange([...newValue.slice(0, index), defaultValue, ...newValue.slice(index)]);
          } else {
            keyManager.keys = [...keyManager.keys, keyManager.id];
            onChange([...newValue, defaultValue]);
          }
          keyManager.id += 1;
        },
        remove: (index) => {
          const newValue = getNewValue();
          const indexSet = new Set(Array.isArray(index) ? index : [index]);
          if (indexSet.size <= 0) {
            return;
          }
          keyManager.keys = keyManager.keys.filter((_, keysIndex) => !indexSet.has(keysIndex));
          onChange(newValue.filter((_, valueIndex) => !indexSet.has(valueIndex)));
        },
        move(from2, to) {
          if (from2 === to) {
            return;
          }
          const newValue = getNewValue();
          if (from2 < 0 || from2 >= newValue.length || to < 0 || to >= newValue.length) {
            return;
          }
          keyManager.keys = move(keyManager.keys, from2, to);
          onChange(move(newValue, from2, to));
        }
      };
      let listValue = value || [];
      if (!Array.isArray(listValue)) {
        listValue = [];
      }
      return children(listValue.map((__, index) => {
        let key = keyManager.keys[index];
        if (key === void 0) {
          keyManager.keys[index] = keyManager.id;
          key = keyManager.keys[index];
          keyManager.id += 1;
        }
        return {
          name: index,
          key,
          isListField: true
        };
      }), operations, meta);
    })));
  }
  function allPromiseFinish(promiseList) {
    let hasError = false;
    let count = promiseList.length;
    const results = [];
    if (!promiseList.length) {
      return Promise.resolve([]);
    }
    return new Promise((resolve, reject) => {
      promiseList.forEach((promise, index) => {
        promise.catch((e2) => {
          hasError = true;
          return e2;
        }).then((result) => {
          count -= 1;
          results[index] = result;
          if (count > 0) {
            return;
          }
          if (hasError) {
            reject(results);
          }
          resolve(results);
        });
      });
    });
  }
  const SPLIT$1 = "__@field_split__";
  function normalize(namePath) {
    return namePath.map((cell) => `${typeof cell}:${cell}`).join(SPLIT$1);
  }
  class NameMap {
    kvs = new Map();
    set(key, value) {
      this.kvs.set(normalize(key), value);
    }
    get(key) {
      return this.kvs.get(normalize(key));
    }
    getAsPrefix(key) {
      const normalizedKey = normalize(key);
      const normalizedPrefix = normalizedKey + SPLIT$1;
      const results = [];
      const current = this.kvs.get(normalizedKey);
      if (current !== void 0) {
        results.push(current);
      }
      this.kvs.forEach((value, itemNormalizedKey) => {
        if (itemNormalizedKey.startsWith(normalizedPrefix)) {
          results.push(value);
        }
      });
      return results;
    }
    update(key, updater) {
      const origin = this.get(key);
      const next2 = updater(origin);
      if (!next2) {
        this.delete(key);
      } else {
        this.set(key, next2);
      }
    }
    delete(key) {
      this.kvs.delete(normalize(key));
    }
map(callback) {
      return [...this.kvs.entries()].map(([key, value]) => {
        const cells = key.split(SPLIT$1);
        return callback({
          key: cells.map((cell) => {
            const [, type4, unit2] = cell.match(/^([^:]*):(.*)$/);
            return type4 === "number" ? Number(unit2) : unit2;
          }),
          value
        });
      });
    }
    toJSON() {
      const json = {};
      this.map(({
        key,
        value
      }) => {
        json[key.join(".")] = value;
        return null;
      });
      return json;
    }
  }
  class FormStore {
    formHooked = false;
    forceRootUpdate;
    subscribable = true;
    store = {};
    fieldEntities = [];
    initialValues = {};
    callbacks = {};
    validateMessages = null;
    preserve = null;
    lastValidatePromise = null;
    watcherCenter = new WatcherCenter(this);
    constructor(forceRootUpdate) {
      this.forceRootUpdate = forceRootUpdate;
    }
    getForm = () => ({
      getFieldValue: this.getFieldValue,
      getFieldsValue: this.getFieldsValue,
      getFieldError: this.getFieldError,
      getFieldWarning: this.getFieldWarning,
      getFieldsError: this.getFieldsError,
      isFieldsTouched: this.isFieldsTouched,
      isFieldTouched: this.isFieldTouched,
      isFieldValidating: this.isFieldValidating,
      isFieldsValidating: this.isFieldsValidating,
      resetFields: this.resetFields,
      setFields: this.setFields,
      setFieldValue: this.setFieldValue,
      setFieldsValue: this.setFieldsValue,
      validateFields: this.validateFields,
      submit: this.submit,
      _init: true,
      getInternalHooks: this.getInternalHooks
    });
getInternalHooks = (key) => {
      if (key === HOOK_MARK) {
        this.formHooked = true;
        return {
          dispatch: this.dispatch,
          initEntityValue: this.initEntityValue,
          registerField: this.registerField,
          useSubscribe: this.useSubscribe,
          setInitialValues: this.setInitialValues,
          destroyForm: this.destroyForm,
          setCallbacks: this.setCallbacks,
          setValidateMessages: this.setValidateMessages,
          getFields: this.getFields,
          setPreserve: this.setPreserve,
          getInitialValue: this.getInitialValue,
          registerWatch: this.registerWatch
        };
      }
      warningOnce(false, "`getInternalHooks` is internal usage. Should not call directly.");
      return null;
    };
    useSubscribe = (subscribable) => {
      this.subscribable = subscribable;
    };
prevWithoutPreserves = null;
setInitialValues = (initialValues, init) => {
      this.initialValues = initialValues || {};
      if (init) {
        let nextStore = merge$1(initialValues, this.store);
        this.prevWithoutPreserves?.map(({
          key: namePath
        }) => {
          nextStore = set(nextStore, namePath, get(initialValues, namePath));
        });
        this.prevWithoutPreserves = null;
        this.updateStore(nextStore);
      }
    };
    destroyForm = (clearOnDestroy) => {
      if (clearOnDestroy) {
        this.updateStore({});
      } else {
        const prevWithoutPreserves = new NameMap();
        this.getFieldEntities(true).forEach((entity) => {
          if (!this.isMergedPreserve(entity.isPreserve())) {
            prevWithoutPreserves.set(entity.getNamePath(), true);
          }
        });
        this.prevWithoutPreserves = prevWithoutPreserves;
      }
    };
    getInitialValue = (namePath) => {
      const initValue = get(this.initialValues, namePath);
      return namePath.length ? merge$1(initValue) : initValue;
    };
    setCallbacks = (callbacks) => {
      this.callbacks = callbacks;
    };
    setValidateMessages = (validateMessages) => {
      this.validateMessages = validateMessages;
    };
    setPreserve = (preserve2) => {
      this.preserve = preserve2;
    };
registerWatch = (callback) => {
      return this.watcherCenter.register(callback);
    };
    notifyWatch = (namePath = []) => {
      this.watcherCenter.notify(namePath);
    };
timeoutId = null;
    warningUnhooked = () => {
    };
updateStore = (nextStore) => {
      this.store = nextStore;
    };

getFieldEntities = (pure = false) => {
      if (!pure) {
        return this.fieldEntities;
      }
      return this.fieldEntities.filter((field) => field.getNamePath().length);
    };
getFieldsMap = (pure = false) => {
      const cache = new NameMap();
      this.getFieldEntities(pure).forEach((field) => {
        const namePath = field.getNamePath();
        cache.set(namePath, field);
      });
      return cache;
    };
getFieldEntitiesForNamePathList = (nameList, includesSubNamePath = false) => {
      if (!nameList) {
        return this.getFieldEntities(true);
      }
      const cache = this.getFieldsMap(true);
      if (!includesSubNamePath) {
        return nameList.map((name) => {
          const namePath = getNamePath(name);
          return cache.get(namePath) || {
            INVALIDATE_NAME_PATH: getNamePath(name)
          };
        });
      }
      return nameList.flatMap((name) => {
        const namePath = getNamePath(name);
        const fields = cache.getAsPrefix(namePath);
        if (fields.length) {
          return fields;
        }
        return [{
          INVALIDATE_NAME_PATH: namePath
        }];
      });
    };
    getFieldsValue = (nameList, filterFunc) => {
      this.warningUnhooked();
      let mergedNameList;
      let mergedFilterFunc;
      if (nameList === true || Array.isArray(nameList)) {
        mergedNameList = nameList;
        mergedFilterFunc = filterFunc;
      } else if (nameList && typeof nameList === "object") {
        mergedFilterFunc = nameList.filter;
      }
      if (mergedNameList === true && !mergedFilterFunc) {
        return this.store;
      }
      const fieldEntities = this.getFieldEntitiesForNamePathList(Array.isArray(mergedNameList) ? mergedNameList : null, true);
      const filteredNameList = [];
      const listNamePaths = [];
      fieldEntities.forEach((entity) => {
        const namePath = entity.INVALIDATE_NAME_PATH || entity.getNamePath();
        if (entity.isList?.()) {
          listNamePaths.push(namePath);
          return;
        }
        if (!mergedFilterFunc) {
          filteredNameList.push(namePath);
        } else {
          const meta = "getMeta" in entity ? entity.getMeta() : null;
          if (mergedFilterFunc(meta)) {
            filteredNameList.push(namePath);
          }
        }
      });
      let mergedValues = cloneByNamePathList(this.store, filteredNameList.map(getNamePath));
      listNamePaths.forEach((namePath) => {
        if (!get(mergedValues, namePath)) {
          mergedValues = set(mergedValues, namePath, []);
        }
      });
      return mergedValues;
    };
    getFieldValue = (name) => {
      this.warningUnhooked();
      const namePath = getNamePath(name);
      return get(this.store, namePath);
    };
    getFieldsError = (nameList) => {
      this.warningUnhooked();
      const fieldEntities = this.getFieldEntitiesForNamePathList(nameList);
      return fieldEntities.map((entity, index) => {
        if (entity && !entity.INVALIDATE_NAME_PATH) {
          return {
            name: entity.getNamePath(),
            errors: entity.getErrors(),
            warnings: entity.getWarnings()
          };
        }
        return {
          name: getNamePath(nameList[index]),
          errors: [],
          warnings: []
        };
      });
    };
    getFieldError = (name) => {
      this.warningUnhooked();
      const namePath = getNamePath(name);
      const fieldError = this.getFieldsError([namePath])[0];
      return fieldError.errors;
    };
    getFieldWarning = (name) => {
      this.warningUnhooked();
      const namePath = getNamePath(name);
      const fieldError = this.getFieldsError([namePath])[0];
      return fieldError.warnings;
    };
    isFieldsTouched = (...args) => {
      this.warningUnhooked();
      const [arg0, arg1] = args;
      let namePathList;
      let isAllFieldsTouched = false;
      if (args.length === 0) {
        namePathList = null;
      } else if (args.length === 1) {
        if (Array.isArray(arg0)) {
          namePathList = arg0.map(getNamePath);
          isAllFieldsTouched = false;
        } else {
          namePathList = null;
          isAllFieldsTouched = arg0;
        }
      } else {
        namePathList = arg0.map(getNamePath);
        isAllFieldsTouched = arg1;
      }
      const fieldEntities = this.getFieldEntities(true);
      const isFieldTouched = (field) => field.isFieldTouched();
      if (!namePathList) {
        return isAllFieldsTouched ? fieldEntities.every((entity) => isFieldTouched(entity) || entity.isList()) : fieldEntities.some(isFieldTouched);
      }
      const map = new NameMap();
      namePathList.forEach((shortNamePath) => {
        map.set(shortNamePath, []);
      });
      fieldEntities.forEach((field) => {
        const fieldNamePath = field.getNamePath();
        namePathList.forEach((shortNamePath) => {
          if (shortNamePath.every((nameUnit, i) => fieldNamePath[i] === nameUnit)) {
            map.update(shortNamePath, (list) => [...list, field]);
          }
        });
      });
      const isNamePathListTouched = (entities) => entities.some(isFieldTouched);
      const namePathListEntities = map.map(({
        value
      }) => value);
      return isAllFieldsTouched ? namePathListEntities.every(isNamePathListTouched) : namePathListEntities.some(isNamePathListTouched);
    };
    isFieldTouched = (name) => {
      this.warningUnhooked();
      return this.isFieldsTouched([name]);
    };
    isFieldsValidating = (nameList) => {
      this.warningUnhooked();
      const fieldEntities = this.getFieldEntities();
      if (!nameList) {
        return fieldEntities.some((testField) => testField.isFieldValidating());
      }
      const namePathList = nameList.map(getNamePath);
      return fieldEntities.some((testField) => {
        const fieldNamePath = testField.getNamePath();
        return containsNamePath(namePathList, fieldNamePath) && testField.isFieldValidating();
      });
    };
    isFieldValidating = (name) => {
      this.warningUnhooked();
      return this.isFieldsValidating([name]);
    };
resetWithFieldInitialValue = (info = {}) => {
      const cache = new NameMap();
      const fieldEntities = this.getFieldEntities(true);
      fieldEntities.forEach((field) => {
        const {
          initialValue
        } = field.props;
        const namePath = field.getNamePath();
        if (initialValue !== void 0) {
          const records = cache.get(namePath) || new Set();
          records.add({
            entity: field,
            value: initialValue
          });
          cache.set(namePath, records);
        }
      });
      const resetWithFields = (entities) => {
        entities.forEach((field) => {
          const {
            initialValue
          } = field.props;
          if (initialValue !== void 0) {
            const namePath = field.getNamePath();
            const formInitialValue = this.getInitialValue(namePath);
            if (formInitialValue !== void 0) {
              warningOnce(false, `Form already set 'initialValues' with path '${namePath.join(".")}'. Field can not overwrite it.`);
            } else {
              const records = cache.get(namePath);
              if (records && records.size > 1) {
                warningOnce(false, `Multiple Field with path '${namePath.join(".")}' set 'initialValue'. Can not decide which one to pick.`);
              } else if (records) {
                const originValue = this.getFieldValue(namePath);
                const isListField = field.isListField();
                if (!isListField && (!info.skipExist || originValue === void 0)) {
                  this.updateStore(set(this.store, namePath, [...records][0].value));
                }
              }
            }
          }
        });
      };
      let requiredFieldEntities;
      if (info.entities) {
        requiredFieldEntities = info.entities;
      } else if (info.namePathList) {
        requiredFieldEntities = [];
        info.namePathList.forEach((namePath) => {
          const records = cache.get(namePath);
          if (records) {
            requiredFieldEntities.push(...[...records].map((r2) => r2.entity));
          }
        });
      } else {
        requiredFieldEntities = fieldEntities;
      }
      resetWithFields(requiredFieldEntities);
    };
    resetFields = (nameList) => {
      this.warningUnhooked();
      const prevStore = this.store;
      if (!nameList) {
        this.updateStore(merge$1(this.initialValues));
        this.resetWithFieldInitialValue();
        this.notifyObservers(prevStore, null, {
          type: "reset"
        });
        this.notifyWatch();
        return;
      }
      const namePathList = nameList.map(getNamePath);
      namePathList.forEach((namePath) => {
        const initialValue = this.getInitialValue(namePath);
        this.updateStore(set(this.store, namePath, initialValue));
      });
      this.resetWithFieldInitialValue({
        namePathList
      });
      this.notifyObservers(prevStore, namePathList, {
        type: "reset"
      });
      this.notifyWatch(namePathList);
    };
    setFields = (fields) => {
      this.warningUnhooked();
      const prevStore = this.store;
      const namePathList = [];
      fields.forEach((fieldData) => {
        const {
          name,
          ...data
        } = fieldData;
        const namePath = getNamePath(name);
        namePathList.push(namePath);
        if ("value" in data) {
          this.updateStore(set(this.store, namePath, data.value));
        }
        this.notifyObservers(prevStore, [namePath], {
          type: "setField",
          data: fieldData
        });
      });
      this.notifyWatch(namePathList);
    };
    getFields = () => {
      const entities = this.getFieldEntities(true);
      const fields = entities.map((field) => {
        const namePath = field.getNamePath();
        const meta = field.getMeta();
        const fieldData = {
          ...meta,
          name: namePath,
          value: this.getFieldValue(namePath)
        };
        Object.defineProperty(fieldData, "originRCField", {
          value: true
        });
        return fieldData;
      });
      return fields;
    };

initEntityValue = (entity) => {
      const {
        initialValue
      } = entity.props;
      if (initialValue !== void 0) {
        const namePath = entity.getNamePath();
        const prevValue = get(this.store, namePath);
        if (prevValue === void 0) {
          this.updateStore(set(this.store, namePath, initialValue));
        }
      }
    };
    isMergedPreserve = (fieldPreserve) => {
      const mergedPreserve = fieldPreserve !== void 0 ? fieldPreserve : this.preserve;
      return mergedPreserve ?? true;
    };
    registerField = (entity) => {
      this.fieldEntities.push(entity);
      const namePath = entity.getNamePath();
      this.notifyWatch([namePath]);
      if (entity.props.initialValue !== void 0) {
        const prevStore = this.store;
        this.resetWithFieldInitialValue({
          entities: [entity],
          skipExist: true
        });
        this.notifyObservers(prevStore, [entity.getNamePath()], {
          type: "valueUpdate",
          source: "internal"
        });
      }
      return (isListField, preserve2, subNamePath = []) => {
        this.fieldEntities = this.fieldEntities.filter((item) => item !== entity);
        if (!this.isMergedPreserve(preserve2) && (!isListField || subNamePath.length > 1)) {
          const defaultValue = isListField ? void 0 : this.getInitialValue(namePath);
          if (namePath.length && this.getFieldValue(namePath) !== defaultValue && this.fieldEntities.every((field) => (
!matchNamePath(field.getNamePath(), namePath)
          ))) {
            const prevStore = this.store;
            this.updateStore(set(prevStore, namePath, defaultValue, true));
            this.notifyObservers(prevStore, [namePath], {
              type: "remove"
            });
            this.triggerDependenciesUpdate(prevStore, namePath);
          }
        }
        this.notifyWatch([namePath]);
      };
    };
    dispatch = (action) => {
      switch (action.type) {
        case "updateValue": {
          const {
            namePath,
            value
          } = action;
          this.updateValue(namePath, value);
          break;
        }
        case "validateField": {
          const {
            namePath,
            triggerName
          } = action;
          this.validateFields([namePath], {
            triggerName
          });
          break;
        }
      }
    };
    notifyObservers = (prevStore, namePathList, info) => {
      if (this.subscribable) {
        const mergedInfo = {
          ...info,
          store: this.getFieldsValue(true)
        };
        this.getFieldEntities().forEach(({
          onStoreChange
        }) => {
          onStoreChange(prevStore, namePathList, mergedInfo);
        });
      } else {
        this.forceRootUpdate();
      }
    };
triggerDependenciesUpdate = (prevStore, namePath) => {
      const childrenFields = this.getDependencyChildrenFields(namePath);
      if (childrenFields.length) {
        this.validateFields(childrenFields, {
delayFrame: true
        });
      }
      this.notifyObservers(prevStore, childrenFields, {
        type: "dependenciesUpdate",
        relatedFields: [namePath, ...childrenFields]
      });
      return childrenFields;
    };
    updateValue = (name, value) => {
      const namePath = getNamePath(name);
      const prevStore = this.store;
      this.updateStore(set(this.store, namePath, value));
      this.notifyObservers(prevStore, [namePath], {
        type: "valueUpdate",
        source: "internal"
      });
      this.notifyWatch([namePath]);
      const childrenFields = this.triggerDependenciesUpdate(prevStore, namePath);
      const {
        onValuesChange
      } = this.callbacks;
      if (onValuesChange) {
        const changedValues = cloneByNamePathList(this.store, [namePath]);
        const allValues = this.getFieldsValue();
        const mergedAllValues = set(allValues, namePath, get(changedValues, namePath));
        onValuesChange(changedValues, mergedAllValues);
      }
      this.triggerOnFieldsChange([namePath, ...childrenFields]);
    };
setFieldsValue = (store) => {
      this.warningUnhooked();
      const prevStore = this.store;
      if (store) {
        const nextStore = merge$1(this.store, store);
        this.updateStore(nextStore);
      }
      this.notifyObservers(prevStore, null, {
        type: "valueUpdate",
        source: "external"
      });
      this.notifyWatch();
    };
    setFieldValue = (name, value) => {
      this.setFields([{
        name,
        value,
        errors: [],
        warnings: [],
        touched: true
      }]);
    };
    getDependencyChildrenFields = (rootNamePath) => {
      const children = new Set();
      const childrenFields = [];
      const dependencies2fields = new NameMap();
      this.getFieldEntities().forEach((field) => {
        const {
          dependencies
        } = field.props;
        (dependencies || []).forEach((dependency) => {
          const dependencyNamePath = getNamePath(dependency);
          dependencies2fields.update(dependencyNamePath, (fields = new Set()) => {
            fields.add(field);
            return fields;
          });
        });
      });
      const fillChildren = (namePath) => {
        const fields = dependencies2fields.get(namePath) || new Set();
        fields.forEach((field) => {
          if (!children.has(field)) {
            children.add(field);
            const fieldNamePath = field.getNamePath();
            if (field.isFieldDirty() && fieldNamePath.length) {
              childrenFields.push(fieldNamePath);
              fillChildren(fieldNamePath);
            }
          }
        });
      };
      fillChildren(rootNamePath);
      return childrenFields;
    };
    triggerOnFieldsChange = (namePathList, filedErrors) => {
      const {
        onFieldsChange
      } = this.callbacks;
      if (onFieldsChange) {
        const fields = this.getFields();
        if (filedErrors) {
          const cache = new NameMap();
          filedErrors.forEach(({
            name,
            errors
          }) => {
            cache.set(name, errors);
          });
          fields.forEach((field) => {
            field.errors = cache.get(field.name) || field.errors;
          });
        }
        const changedFields = fields.filter(({
          name: fieldName
        }) => containsNamePath(namePathList, fieldName));
        if (changedFields.length) {
          onFieldsChange(changedFields, fields);
        }
      }
    };
validateFields = (arg1, arg2) => {
      this.warningUnhooked();
      let nameList;
      let options;
      if (Array.isArray(arg1) || typeof arg1 === "string" || typeof arg2 === "string") {
        nameList = arg1;
        options = arg2;
      } else {
        options = arg1;
      }
      const provideNameList = !!nameList;
      const namePathList = provideNameList ? nameList.map(getNamePath) : [];
      const finalValueNamePathList = [...namePathList];
      const promiseList = [];
      const TMP_SPLIT = String(Date.now());
      const validateNamePathList = new Set();
      const {
        recursive,
        dirty
      } = options || {};
      this.getFieldEntities(true).forEach((field) => {
        const fieldNamePath = field.getNamePath();
        if (!provideNameList) {
          if (
!field.isList() ||
!namePathList.some((name) => matchNamePath(name, fieldNamePath, true))
          ) {
            finalValueNamePathList.push(fieldNamePath);
          }
          namePathList.push(fieldNamePath);
        }
        if (!field.props.rules || !field.props.rules.length) {
          return;
        }
        if (dirty && !field.isFieldDirty()) {
          return;
        }
        validateNamePathList.add(fieldNamePath.join(TMP_SPLIT));
        if (!provideNameList || containsNamePath(namePathList, fieldNamePath, recursive)) {
          const promise = field.validateRules({
            validateMessages: {
              ...defaultValidateMessages,
              ...this.validateMessages
            },
            ...options
          });
          promiseList.push(promise.then(() => ({
            name: fieldNamePath,
            errors: [],
            warnings: []
          })).catch((ruleErrors) => {
            const mergedErrors = [];
            const mergedWarnings = [];
            ruleErrors.forEach?.(({
              rule: {
                warningOnly
              },
              errors
            }) => {
              if (warningOnly) {
                mergedWarnings.push(...errors);
              } else {
                mergedErrors.push(...errors);
              }
            });
            if (mergedErrors.length) {
              return Promise.reject({
                name: fieldNamePath,
                errors: mergedErrors,
                warnings: mergedWarnings
              });
            }
            return {
              name: fieldNamePath,
              errors: mergedErrors,
              warnings: mergedWarnings
            };
          }));
        }
      });
      const summaryPromise = allPromiseFinish(promiseList);
      this.lastValidatePromise = summaryPromise;
      summaryPromise.catch((results) => results).then((results) => {
        const resultNamePathList = results.map(({
          name
        }) => name);
        this.notifyObservers(this.store, resultNamePathList, {
          type: "validateFinish"
        });
        this.triggerOnFieldsChange(resultNamePathList, results);
      });
      const returnPromise = summaryPromise.then(() => {
        if (this.lastValidatePromise === summaryPromise) {
          return Promise.resolve(this.getFieldsValue(finalValueNamePathList));
        }
        return Promise.reject([]);
      }).catch((results) => {
        const errorList = results.filter((result) => result && result.errors.length);
        const errorMessage = errorList[0]?.errors?.[0];
        return Promise.reject({
          message: errorMessage,
          values: this.getFieldsValue(namePathList),
          errorFields: errorList,
          outOfDate: this.lastValidatePromise !== summaryPromise
        });
      });
      returnPromise.catch((e2) => e2);
      const triggerNamePathList = namePathList.filter((namePath) => validateNamePathList.has(namePath.join(TMP_SPLIT)));
      this.triggerOnFieldsChange(triggerNamePathList);
      return returnPromise;
    };
submit = () => {
      this.warningUnhooked();
      this.validateFields().then((values) => {
        const {
          onFinish
        } = this.callbacks;
        if (onFinish) {
          try {
            onFinish(values);
          } catch (err) {
            console.error(err);
          }
        }
      }).catch((e2) => {
        const {
          onFinishFailed
        } = this.callbacks;
        if (onFinishFailed) {
          onFinishFailed(e2);
        }
      });
    };
  }
  function useForm$1(form) {
    const formRef = React__namespace.useRef(null);
    const [, forceUpdate] = React__namespace.useState({});
    if (!formRef.current) {
      if (form) {
        formRef.current = form;
      } else {
        const forceReRender = () => {
          forceUpdate({});
        };
        const formStore = new FormStore(forceReRender);
        formRef.current = formStore.getForm();
      }
    }
    return [formRef.current];
  }
  const FormContext$1 = React__namespace.createContext({
    triggerFormChange: () => {
    },
    triggerFormFinish: () => {
    },
    registerForm: () => {
    },
    unregisterForm: () => {
    }
  });
  const FormProvider$1 = ({
    validateMessages,
    onFormChange,
    onFormFinish,
    children
  }) => {
    const formContext = React__namespace.useContext(FormContext$1);
    const formsRef = React__namespace.useRef({});
    return React__namespace.createElement(FormContext$1.Provider, {
      value: {
        ...formContext,
        validateMessages: {
          ...formContext.validateMessages,
          ...validateMessages
        },


triggerFormChange: (name, changedFields) => {
          if (onFormChange) {
            onFormChange(name, {
              changedFields,
              forms: formsRef.current
            });
          }
          formContext.triggerFormChange(name, changedFields);
        },
        triggerFormFinish: (name, values) => {
          if (onFormFinish) {
            onFormFinish(name, {
              values,
              forms: formsRef.current
            });
          }
          formContext.triggerFormFinish(name, values);
        },
        registerForm: (name, form) => {
          if (name) {
            formsRef.current = {
              ...formsRef.current,
              [name]: form
            };
          }
          formContext.registerForm(name, form);
        },
        unregisterForm: (name) => {
          const newForms = {
            ...formsRef.current
          };
          delete newForms[name];
          formsRef.current = newForms;
          formContext.unregisterForm(name);
        }
      }
    }, children);
  };
  function _extends$m() {
    _extends$m = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$m.apply(this, arguments);
  }
  const Form$2 = ({
    name,
    initialValues,
    fields,
    form,
    preserve: preserve2,
    children,
    component: Component = "form",
    validateMessages,
    validateTrigger = "onChange",
    onValuesChange,
    onFieldsChange,
    onFinish,
    onFinishFailed,
    clearOnDestroy,
    ...restProps
  }, ref) => {
    const nativeElementRef = React__namespace.useRef(null);
    const formContext = React__namespace.useContext(FormContext$1);
    const [formInstance] = useForm$1(form);
    const {
      useSubscribe,
      setInitialValues,
      setCallbacks,
      setValidateMessages,
      setPreserve,
      destroyForm
    } = formInstance.getInternalHooks(HOOK_MARK);
    React__namespace.useImperativeHandle(ref, () => ({
      ...formInstance,
      nativeElement: nativeElementRef.current
    }));
    React__namespace.useEffect(() => {
      formContext.registerForm(name, formInstance);
      return () => {
        formContext.unregisterForm(name);
      };
    }, [formContext, formInstance, name]);
    setValidateMessages({
      ...formContext.validateMessages,
      ...validateMessages
    });
    setCallbacks({
      onValuesChange,
      onFieldsChange: (changedFields, ...rest) => {
        formContext.triggerFormChange(name, changedFields);
        if (onFieldsChange) {
          onFieldsChange(changedFields, ...rest);
        }
      },
      onFinish: (values) => {
        formContext.triggerFormFinish(name, values);
        if (onFinish) {
          onFinish(values);
        }
      },
      onFinishFailed
    });
    setPreserve(preserve2);
    const mountRef = React__namespace.useRef(null);
    setInitialValues(initialValues, !mountRef.current);
    if (!mountRef.current) {
      mountRef.current = true;
    }
    React__namespace.useEffect(
      () => () => destroyForm(clearOnDestroy),
[]
    );
    let childrenNode;
    const childrenRenderProps = typeof children === "function";
    if (childrenRenderProps) {
      const values = formInstance.getFieldsValue(true);
      childrenNode = children(values, formInstance);
    } else {
      childrenNode = children;
    }
    useSubscribe(!childrenRenderProps);
    const prevFieldsRef = React__namespace.useRef(null);
    React__namespace.useEffect(() => {
      if (!isSimilar(prevFieldsRef.current || [], fields || [])) {
        formInstance.setFields(fields || []);
      }
      prevFieldsRef.current = fields;
    }, [fields, formInstance]);
    const formContextValue = React__namespace.useMemo(() => ({
      ...formInstance,
      validateTrigger
    }), [formInstance, validateTrigger]);
    const wrapperNode = React__namespace.createElement(ListContext.Provider, {
      value: null
    }, React__namespace.createElement(Context$1.Provider, {
      value: formContextValue
    }, childrenNode));
    if (Component === false) {
      return wrapperNode;
    }
    return React__namespace.createElement(Component, _extends$m({}, restProps, {
      ref: nativeElementRef,
      onSubmit: (event) => {
        event.preventDefault();
        event.stopPropagation();
        formInstance.submit();
      },
      onReset: (event) => {
        event.preventDefault();
        formInstance.resetFields();
        restProps.onReset?.(event);
      }
    }), wrapperNode);
  };
  const useEvent = (callback) => {
    const fnRef = React__namespace.useRef(callback);
    fnRef.current = callback;
    const memoFn = React__namespace.useCallback((...args) => fnRef.current?.(...args), []);
    return memoFn;
  };
  function canUseDom() {
    return !!(typeof window !== "undefined" && window.document && window.document.createElement);
  }
  const useInternalLayoutEffect = canUseDom() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
  const useLayoutEffect = (callback, deps) => {
    const firstMountRef = React__namespace.useRef(true);
    useInternalLayoutEffect(() => {
      return callback(firstMountRef.current);
    }, deps);
    useInternalLayoutEffect(() => {
      firstMountRef.current = false;
      return () => {
        firstMountRef.current = true;
      };
    }, []);
  };
  const useSafeState = (defaultValue) => {
    const destroyRef = React__namespace.useRef(false);
    const [value, setValue] = React__namespace.useState(defaultValue);
    React__namespace.useEffect(() => {
      destroyRef.current = false;
      return () => {
        destroyRef.current = true;
      };
    }, []);
    function safeSetState(updater, ignoreDestroy) {
      if (ignoreDestroy && destroyRef.current) {
        return;
      }
      setValue(updater);
    }
    return [value, safeSetState];
  };
  function useControlledState(defaultStateValue, value) {
    const [innerValue, setInnerValue] = React.useState(defaultStateValue);
    const mergedValue = value !== void 0 ? value : innerValue;
    useLayoutEffect((mount) => {
      if (!mount) {
        setInnerValue(value);
      }
    }, [value]);
    return [
mergedValue,
setInnerValue
    ];
  }
  var reactIs = { exports: {} };
  var reactIs_production_min = {};
  var hasRequiredReactIs_production_min;
  function requireReactIs_production_min() {
    if (hasRequiredReactIs_production_min) return reactIs_production_min;
    hasRequiredReactIs_production_min = 1;
    var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e2 = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l2 = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n2 = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t2 = Symbol.for("react.offscreen"), u;
    u = Symbol.for("react.module.reference");
    function v(a) {
      if ("object" === typeof a && null !== a) {
        var r2 = a.$$typeof;
        switch (r2) {
          case b:
            switch (a = a.type, a) {
              case d:
              case f:
              case e2:
              case m:
              case n2:
                return a;
              default:
                switch (a = a && a.$$typeof, a) {
                  case k:
                  case h:
                  case l2:
                  case q:
                  case p:
                  case g:
                    return a;
                  default:
                    return r2;
                }
            }
          case c:
            return r2;
        }
      }
    }
    reactIs_production_min.ContextConsumer = h;
    reactIs_production_min.ContextProvider = g;
    reactIs_production_min.Element = b;
    reactIs_production_min.ForwardRef = l2;
    reactIs_production_min.Fragment = d;
    reactIs_production_min.Lazy = q;
    reactIs_production_min.Memo = p;
    reactIs_production_min.Portal = c;
    reactIs_production_min.Profiler = f;
    reactIs_production_min.StrictMode = e2;
    reactIs_production_min.Suspense = m;
    reactIs_production_min.SuspenseList = n2;
    reactIs_production_min.isAsyncMode = function() {
      return false;
    };
    reactIs_production_min.isConcurrentMode = function() {
      return false;
    };
    reactIs_production_min.isContextConsumer = function(a) {
      return v(a) === h;
    };
    reactIs_production_min.isContextProvider = function(a) {
      return v(a) === g;
    };
    reactIs_production_min.isElement = function(a) {
      return "object" === typeof a && null !== a && a.$$typeof === b;
    };
    reactIs_production_min.isForwardRef = function(a) {
      return v(a) === l2;
    };
    reactIs_production_min.isFragment = function(a) {
      return v(a) === d;
    };
    reactIs_production_min.isLazy = function(a) {
      return v(a) === q;
    };
    reactIs_production_min.isMemo = function(a) {
      return v(a) === p;
    };
    reactIs_production_min.isPortal = function(a) {
      return v(a) === c;
    };
    reactIs_production_min.isProfiler = function(a) {
      return v(a) === f;
    };
    reactIs_production_min.isStrictMode = function(a) {
      return v(a) === e2;
    };
    reactIs_production_min.isSuspense = function(a) {
      return v(a) === m;
    };
    reactIs_production_min.isSuspenseList = function(a) {
      return v(a) === n2;
    };
    reactIs_production_min.isValidElementType = function(a) {
      return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e2 || a === m || a === n2 || a === t2 || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l2 || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
    };
    reactIs_production_min.typeOf = v;
    return reactIs_production_min;
  }
  var hasRequiredReactIs;
  function requireReactIs() {
    if (hasRequiredReactIs) return reactIs.exports;
    hasRequiredReactIs = 1;
    {
      reactIs.exports = requireReactIs_production_min();
    }
    return reactIs.exports;
  }
  var reactIsExports = requireReactIs();
  function useMemo(getValue2, condition, shouldUpdate) {
    const cacheRef = React__namespace.useRef({});
    if (!("value" in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
      cacheRef.current.value = getValue2();
      cacheRef.current.condition = condition;
    }
    return cacheRef.current.value;
  }
  const ReactMajorVersion = Number(React.version.split(".")[0]);
  const fillRef = (ref, node2) => {
    if (typeof ref === "function") {
      ref(node2);
    } else if (typeof ref === "object" && ref && "current" in ref) {
      ref.current = node2;
    }
  };
  const composeRef = (...refs) => {
    const refList = refs.filter(Boolean);
    if (refList.length <= 1) {
      return refList[0];
    }
    return (node2) => {
      refs.forEach((ref) => {
        fillRef(ref, node2);
      });
    };
  };
  const useComposeRef = (...refs) => {
    return useMemo(
      () => composeRef(...refs),
refs,
      (prev2, next2) => prev2.length !== next2.length || prev2.every((ref, i) => ref !== next2[i])
    );
  };
  const supportRef = (nodeOrComponent) => {
    if (!nodeOrComponent) {
      return false;
    }
    if (isReactElement(nodeOrComponent) && ReactMajorVersion >= 19) {
      return true;
    }
    const type4 = reactIsExports.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
    if (typeof type4 === "function" && !type4.prototype?.render && type4.$$typeof !== reactIsExports.ForwardRef) {
      return false;
    }
    if (typeof nodeOrComponent === "function" && !nodeOrComponent.prototype?.render && nodeOrComponent.$$typeof !== reactIsExports.ForwardRef) {
      return false;
    }
    return true;
  };
  function isReactElement(node2) {
    return React.isValidElement(node2) && !isFragment$1(node2);
  }
  const supportNodeRef = (node2) => {
    return isReactElement(node2) && supportRef(node2);
  };
  const getNodeRef = (node2) => {
    if (node2 && isReactElement(node2)) {
      const ele = node2;
      return ele.props.propertyIsEnumerable("ref") ? ele.props.ref : ele.ref;
    }
    return null;
  };
  function omit(obj, fields) {
    const clone = Object.assign({}, obj);
    if (Array.isArray(fields)) {
      fields.forEach((key) => {
        delete clone[key];
      });
    }
    return clone;
  }
  function stringify$1(value) {
    try {
      return JSON.stringify(value);
    } catch {
      return Math.random();
    }
  }
  function useWatch$1(...args) {
    const [dependencies, _form = {}] = args;
    const options = isFormInstance(_form) ? {
      form: _form
    } : _form;
    const form = options.form;
    const [value, setValue] = React.useState(() => typeof dependencies === "function" ? dependencies({}) : void 0);
    const valueStr = React.useMemo(() => stringify$1(value), [value]);
    const valueStrRef = React.useRef(valueStr);
    valueStrRef.current = valueStr;
    const fieldContext = React.useContext(Context$1);
    const formInstance = form || fieldContext;
    const isValidForm = formInstance && formInstance._init;
    const {
      getFieldsValue,
      getInternalHooks
    } = formInstance;
    const {
      registerWatch
    } = getInternalHooks(HOOK_MARK);
    const triggerUpdate = useEvent((values, allValues) => {
      const watchValue = options.preserve ? allValues ?? getFieldsValue(true) : values ?? getFieldsValue();
      const nextValue = typeof dependencies === "function" ? dependencies(watchValue) : get(watchValue, getNamePath(dependencies));
      if (stringify$1(value) !== stringify$1(nextValue)) {
        setValue(nextValue);
      }
    });
    const flattenDeps = typeof dependencies === "function" ? dependencies : JSON.stringify(dependencies);
    React.useEffect(() => {
      if (!isValidForm) {
        return;
      }
      triggerUpdate();
    }, [isValidForm, flattenDeps]);
    React.useEffect(() => {
      if (!isValidForm) {
        return;
      }
      const cancelRegister = registerWatch((values, allValues) => {
        triggerUpdate(values, allValues);
      });
      return cancelRegister;
    }, [isValidForm]);
    return value;
  }
  const InternalForm$1 = React__namespace.forwardRef(Form$2);
  const RefForm = InternalForm$1;
  RefForm.FormProvider = FormProvider$1;
  RefForm.Field = WrapperField;
  RefForm.List = List;
  RefForm.useForm = useForm$1;
  RefForm.useWatch = useWatch$1;
  function r$1(e2) {
    var t2, f, n2 = "";
    if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
    else if ("object" == typeof e2) if (Array.isArray(e2)) {
      var o2 = e2.length;
      for (t2 = 0; t2 < o2; t2++) e2[t2] && (f = r$1(e2[t2])) && (n2 && (n2 += " "), n2 += f);
    } else for (f in e2) e2[f] && (n2 && (n2 += " "), n2 += f);
    return n2;
  }
  function clsx() {
    for (var e2, t2, f = 0, n2 = "", o2 = arguments.length; f < o2; f++) (e2 = arguments[f]) && (t2 = r$1(e2)) && (n2 && (n2 += " "), n2 += t2);
    return n2;
  }
  var CloseOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
  const presetColors = {
    aliceblue: "9ehhb",
    antiquewhite: "9sgk7",
    aqua: "1ekf",
    aquamarine: "4zsno",
    azure: "9eiv3",
    beige: "9lhp8",
    bisque: "9zg04",
    black: "0",
    blanchedalmond: "9zhe5",
    blue: "73",
    blueviolet: "5e31e",
    brown: "6g016",
    burlywood: "8ouiv",
    cadetblue: "3qba8",
    chartreuse: "4zshs",
    chocolate: "87k0u",
    coral: "9yvyo",
    cornflowerblue: "3xael",
    cornsilk: "9zjz0",
    crimson: "8l4xo",
    cyan: "1ekf",
    darkblue: "3v",
    darkcyan: "rkb",
    darkgoldenrod: "776yz",
    darkgray: "6mbhl",
    darkgreen: "jr4",
    darkgrey: "6mbhl",
    darkkhaki: "7ehkb",
    darkmagenta: "5f91n",
    darkolivegreen: "3bzfz",
    darkorange: "9yygw",
    darkorchid: "5z6x8",
    darkred: "5f8xs",
    darksalmon: "9441m",
    darkseagreen: "5lwgf",
    darkslateblue: "2th1n",
    darkslategray: "1ugcv",
    darkslategrey: "1ugcv",
    darkturquoise: "14up",
    darkviolet: "5rw7n",
    deeppink: "9yavn",
    deepskyblue: "11xb",
    dimgray: "442g9",
    dimgrey: "442g9",
    dodgerblue: "16xof",
    firebrick: "6y7tu",
    floralwhite: "9zkds",
    forestgreen: "1cisi",
    fuchsia: "9y70f",
    gainsboro: "8m8kc",
    ghostwhite: "9pq0v",
    goldenrod: "8j4f4",
    gold: "9zda8",
    gray: "50i2o",
    green: "pa8",
    greenyellow: "6senj",
    grey: "50i2o",
    honeydew: "9eiuo",
    hotpink: "9yrp0",
    indianred: "80gnw",
    indigo: "2xcoy",
    ivory: "9zldc",
    khaki: "9edu4",
    lavenderblush: "9ziet",
    lavender: "90c8q",
    lawngreen: "4vk74",
    lemonchiffon: "9zkct",
    lightblue: "6s73a",
    lightcoral: "9dtog",
    lightcyan: "8s1rz",
    lightgoldenrodyellow: "9sjiq",
    lightgray: "89jo3",
    lightgreen: "5nkwg",
    lightgrey: "89jo3",
    lightpink: "9z6wx",
    lightsalmon: "9z2ii",
    lightseagreen: "19xgq",
    lightskyblue: "5arju",
    lightslategray: "4nwk9",
    lightslategrey: "4nwk9",
    lightsteelblue: "6wau6",
    lightyellow: "9zlcw",
    lime: "1edc",
    limegreen: "1zcxe",
    linen: "9shk6",
    magenta: "9y70f",
    maroon: "4zsow",
    mediumaquamarine: "40eju",
    mediumblue: "5p",
    mediumorchid: "79qkz",
    mediumpurple: "5r3rv",
    mediumseagreen: "2d9ip",
    mediumslateblue: "4tcku",
    mediumspringgreen: "1di2",
    mediumturquoise: "2uabw",
    mediumvioletred: "7rn9h",
    midnightblue: "z980",
    mintcream: "9ljp6",
    mistyrose: "9zg0x",
    moccasin: "9zfzp",
    navajowhite: "9zest",
    navy: "3k",
    oldlace: "9wq92",
    olive: "50hz4",
    olivedrab: "472ub",
    orange: "9z3eo",
    orangered: "9ykg0",
    orchid: "8iu3a",
    palegoldenrod: "9bl4a",
    palegreen: "5yw0o",
    paleturquoise: "6v4ku",
    palevioletred: "8k8lv",
    papayawhip: "9zi6t",
    peachpuff: "9ze0p",
    peru: "80oqn",
    pink: "9z8wb",
    plum: "8nba5",
    powderblue: "6wgdi",
    purple: "4zssg",
    rebeccapurple: "3zk49",
    red: "9y6tc",
    rosybrown: "7cv4f",
    royalblue: "2jvtt",
    saddlebrown: "5fmkz",
    salmon: "9rvci",
    sandybrown: "9jn1c",
    seagreen: "1tdnb",
    seashell: "9zje6",
    sienna: "6973h",
    silver: "7ir40",
    skyblue: "5arjf",
    slateblue: "45e4t",
    slategray: "4e100",
    slategrey: "4e100",
    snow: "9zke2",
    springgreen: "1egv",
    steelblue: "2r1kk",
    tan: "87yx8",
    teal: "pds",
    thistle: "8ggk8",
    tomato: "9yqfb",
    turquoise: "2j4r4",
    violet: "9b10u",
    wheat: "9ld4j",
    white: "9zldr",
    whitesmoke: "9lhpx",
    yellow: "9zl6o",
    yellowgreen: "61fzm"
  };
  const round = Math.round;
  function splitColorStr(str, parseNum) {
    const match2 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
    const numList = match2.map((item) => parseFloat(item));
    for (let i = 0; i < 3; i += 1) {
      numList[i] = parseNum(numList[i] || 0, match2[i] || "", i);
    }
    if (match2[3]) {
      numList[3] = match2[3].includes("%") ? numList[3] / 100 : numList[3];
    } else {
      numList[3] = 1;
    }
    return numList;
  }
  const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
  function limitRange(value, max) {
    const mergedMax = max || 255;
    if (value > mergedMax) {
      return mergedMax;
    }
    if (value < 0) {
      return 0;
    }
    return value;
  }
  class FastColor {
isValid = true;
r = 0;
g = 0;
b = 0;
a = 1;
_h;
    _hsl_s;
    _hsv_s;
    _l;
    _v;
_max;
    _min;
    _brightness;
    constructor(input) {
      function matchFormat(str) {
        return str[0] in input && str[1] in input && str[2] in input;
      }
      if (!input) ;
      else if (typeof input === "string") {
        let matchPrefix = function(prefix2) {
          return trimStr.startsWith(prefix2);
        };
        const trimStr = input.trim();
        if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
          this.fromHexString(trimStr);
        } else if (matchPrefix("rgb")) {
          this.fromRgbString(trimStr);
        } else if (matchPrefix("hsl")) {
          this.fromHslString(trimStr);
        } else if (matchPrefix("hsv") || matchPrefix("hsb")) {
          this.fromHsvString(trimStr);
        } else {
          const presetColor = presetColors[trimStr.toLowerCase()];
          if (presetColor) {
            this.fromHexString(
parseInt(presetColor, 36).toString(16).padStart(6, "0")
            );
          }
        }
      } else if (input instanceof FastColor) {
        this.r = input.r;
        this.g = input.g;
        this.b = input.b;
        this.a = input.a;
        this._h = input._h;
        this._hsl_s = input._hsl_s;
        this._hsv_s = input._hsv_s;
        this._l = input._l;
        this._v = input._v;
      } else if (matchFormat("rgb")) {
        this.r = limitRange(input.r);
        this.g = limitRange(input.g);
        this.b = limitRange(input.b);
        this.a = typeof input.a === "number" ? limitRange(input.a, 1) : 1;
      } else if (matchFormat("hsl")) {
        this.fromHsl(input);
      } else if (matchFormat("hsv")) {
        this.fromHsv(input);
      } else {
        throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input));
      }
    }
setR(value) {
      return this._sc("r", value);
    }
    setG(value) {
      return this._sc("g", value);
    }
    setB(value) {
      return this._sc("b", value);
    }
    setA(value) {
      return this._sc("a", value, 1);
    }
    setHue(value) {
      const hsv = this.toHsv();
      hsv.h = value;
      return this._c(hsv);
    }

getLuminance() {
      function adjustGamma(raw) {
        const val = raw / 255;
        return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
      }
      const R = adjustGamma(this.r);
      const G = adjustGamma(this.g);
      const B = adjustGamma(this.b);
      return 0.2126 * R + 0.7152 * G + 0.0722 * B;
    }
    getHue() {
      if (typeof this._h === "undefined") {
        const delta = this.getMax() - this.getMin();
        if (delta === 0) {
          this._h = 0;
        } else {
          this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
        }
      }
      return this._h;
    }
getSaturation() {
      return this.getHSVSaturation();
    }
    getHSVSaturation() {
      if (typeof this._hsv_s === "undefined") {
        const delta = this.getMax() - this.getMin();
        if (delta === 0) {
          this._hsv_s = 0;
        } else {
          this._hsv_s = delta / this.getMax();
        }
      }
      return this._hsv_s;
    }
    getHSLSaturation() {
      if (typeof this._hsl_s === "undefined") {
        const delta = this.getMax() - this.getMin();
        if (delta === 0) {
          this._hsl_s = 0;
        } else {
          const l2 = this.getLightness();
          this._hsl_s = delta / 255 / (1 - Math.abs(2 * l2 - 1));
        }
      }
      return this._hsl_s;
    }
    getLightness() {
      if (typeof this._l === "undefined") {
        this._l = (this.getMax() + this.getMin()) / 510;
      }
      return this._l;
    }
    getValue() {
      if (typeof this._v === "undefined") {
        this._v = this.getMax() / 255;
      }
      return this._v;
    }
getBrightness() {
      if (typeof this._brightness === "undefined") {
        this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3;
      }
      return this._brightness;
    }
darken(amount = 10) {
      const h = this.getHue();
      const s = this.getSaturation();
      let l2 = this.getLightness() - amount / 100;
      if (l2 < 0) {
        l2 = 0;
      }
      return this._c({
        h,
        s,
        l: l2,
        a: this.a
      });
    }
    lighten(amount = 10) {
      const h = this.getHue();
      const s = this.getSaturation();
      let l2 = this.getLightness() + amount / 100;
      if (l2 > 1) {
        l2 = 1;
      }
      return this._c({
        h,
        s,
        l: l2,
        a: this.a
      });
    }
mix(input, amount = 50) {
      const color = this._c(input);
      const p = amount / 100;
      const calc = (key) => (color[key] - this[key]) * p + this[key];
      const rgba = {
        r: round(calc("r")),
        g: round(calc("g")),
        b: round(calc("b")),
        a: round(calc("a") * 100) / 100
      };
      return this._c(rgba);
    }
tint(amount = 10) {
      return this.mix({
        r: 255,
        g: 255,
        b: 255,
        a: 1
      }, amount);
    }
shade(amount = 10) {
      return this.mix({
        r: 0,
        g: 0,
        b: 0,
        a: 1
      }, amount);
    }
    onBackground(background) {
      const bg = this._c(background);
      const alpha = this.a + bg.a * (1 - this.a);
      const calc = (key) => {
        return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
      };
      return this._c({
        r: calc("r"),
        g: calc("g"),
        b: calc("b"),
        a: alpha
      });
    }
isDark() {
      return this.getBrightness() < 128;
    }
    isLight() {
      return this.getBrightness() >= 128;
    }
equals(other) {
      return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
    }
    clone() {
      return this._c(this);
    }
toHexString() {
      let hex2 = "#";
      const rHex = (this.r || 0).toString(16);
      hex2 += rHex.length === 2 ? rHex : "0" + rHex;
      const gHex = (this.g || 0).toString(16);
      hex2 += gHex.length === 2 ? gHex : "0" + gHex;
      const bHex = (this.b || 0).toString(16);
      hex2 += bHex.length === 2 ? bHex : "0" + bHex;
      if (typeof this.a === "number" && this.a >= 0 && this.a < 1) {
        const aHex = round(this.a * 255).toString(16);
        hex2 += aHex.length === 2 ? aHex : "0" + aHex;
      }
      return hex2;
    }
toHsl() {
      return {
        h: this.getHue(),
        s: this.getHSLSaturation(),
        l: this.getLightness(),
        a: this.a
      };
    }
toHslString() {
      const h = this.getHue();
      const s = round(this.getHSLSaturation() * 100);
      const l2 = round(this.getLightness() * 100);
      return this.a !== 1 ? `hsla(${h},${s}%,${l2}%,${this.a})` : `hsl(${h},${s}%,${l2}%)`;
    }
toHsv() {
      return {
        h: this.getHue(),
        s: this.getHSVSaturation(),
        v: this.getValue(),
        a: this.a
      };
    }
    toRgb() {
      return {
        r: this.r,
        g: this.g,
        b: this.b,
        a: this.a
      };
    }
    toRgbString() {
      return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
    }
    toString() {
      return this.toRgbString();
    }

_sc(rgb, value, max) {
      const clone = this.clone();
      clone[rgb] = limitRange(value, max);
      return clone;
    }
    _c(input) {
      return new this.constructor(input);
    }
    getMax() {
      if (typeof this._max === "undefined") {
        this._max = Math.max(this.r, this.g, this.b);
      }
      return this._max;
    }
    getMin() {
      if (typeof this._min === "undefined") {
        this._min = Math.min(this.r, this.g, this.b);
      }
      return this._min;
    }
    fromHexString(trimStr) {
      const withoutPrefix = trimStr.replace("#", "");
      function connectNum(index1, index2) {
        return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
      }
      if (withoutPrefix.length < 6) {
        this.r = connectNum(0);
        this.g = connectNum(1);
        this.b = connectNum(2);
        this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
      } else {
        this.r = connectNum(0, 1);
        this.g = connectNum(2, 3);
        this.b = connectNum(4, 5);
        this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
      }
    }
    fromHsl({
      h: _h,
      s,
      l: l2,
      a
    }) {
      const h = (_h % 360 + 360) % 360;
      this._h = h;
      this._hsl_s = s;
      this._l = l2;
      this.a = typeof a === "number" ? a : 1;
      if (s <= 0) {
        const rgb = round(l2 * 255);
        this.r = rgb;
        this.g = rgb;
        this.b = rgb;
        return;
      }
      let r2 = 0, g = 0, b = 0;
      const huePrime = h / 60;
      const chroma = (1 - Math.abs(2 * l2 - 1)) * s;
      const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
      if (huePrime >= 0 && huePrime < 1) {
        r2 = chroma;
        g = secondComponent;
      } else if (huePrime >= 1 && huePrime < 2) {
        r2 = secondComponent;
        g = chroma;
      } else if (huePrime >= 2 && huePrime < 3) {
        g = chroma;
        b = secondComponent;
      } else if (huePrime >= 3 && huePrime < 4) {
        g = secondComponent;
        b = chroma;
      } else if (huePrime >= 4 && huePrime < 5) {
        r2 = secondComponent;
        b = chroma;
      } else if (huePrime >= 5 && huePrime < 6) {
        r2 = chroma;
        b = secondComponent;
      }
      const lightnessModification = l2 - chroma / 2;
      this.r = round((r2 + lightnessModification) * 255);
      this.g = round((g + lightnessModification) * 255);
      this.b = round((b + lightnessModification) * 255);
    }
    fromHsv({
      h: _h,
      s,
      v,
      a
    }) {
      const h = (_h % 360 + 360) % 360;
      this._h = h;
      this._hsv_s = s;
      this._v = v;
      this.a = typeof a === "number" ? a : 1;
      const vv = round(v * 255);
      this.r = vv;
      this.g = vv;
      this.b = vv;
      if (s <= 0) {
        return;
      }
      const hh = h / 60;
      const i = Math.floor(hh);
      const ff = hh - i;
      const p = round(v * (1 - s) * 255);
      const q = round(v * (1 - s * ff) * 255);
      const t2 = round(v * (1 - s * (1 - ff)) * 255);
      switch (i) {
        case 0:
          this.g = t2;
          this.b = p;
          break;
        case 1:
          this.r = q;
          this.b = p;
          break;
        case 2:
          this.r = p;
          this.b = t2;
          break;
        case 3:
          this.r = p;
          this.g = q;
          break;
        case 4:
          this.r = t2;
          this.g = p;
          break;
        case 5:
        default:
          this.g = p;
          this.b = q;
          break;
      }
    }
    fromHsvString(trimStr) {
      const cells = splitColorStr(trimStr, parseHSVorHSL);
      this.fromHsv({
        h: cells[0],
        s: cells[1],
        v: cells[2],
        a: cells[3]
      });
    }
    fromHslString(trimStr) {
      const cells = splitColorStr(trimStr, parseHSVorHSL);
      this.fromHsl({
        h: cells[0],
        s: cells[1],
        l: cells[2],
        a: cells[3]
      });
    }
    fromRgbString(trimStr) {
      const cells = splitColorStr(trimStr, (num, txt) => (
txt.includes("%") ? round(num / 100 * 255) : num
      ));
      this.r = cells[0];
      this.g = cells[1];
      this.b = cells[2];
      this.a = cells[3];
    }
  }
  const hueStep = 2;
  const saturationStep = 0.16;
  const saturationStep2 = 0.05;
  const brightnessStep1 = 0.05;
  const brightnessStep2 = 0.15;
  const lightColorCount = 5;
  const darkColorCount = 4;
  const darkColorMap = [{
    index: 7,
    amount: 15
  }, {
    index: 6,
    amount: 25
  }, {
    index: 5,
    amount: 30
  }, {
    index: 5,
    amount: 45
  }, {
    index: 5,
    amount: 65
  }, {
    index: 5,
    amount: 85
  }, {
    index: 4,
    amount: 90
  }, {
    index: 3,
    amount: 95
  }, {
    index: 2,
    amount: 97
  }, {
    index: 1,
    amount: 98
  }];
  function getHue(hsv, i, light) {
    let hue;
    if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
      hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
    } else {
      hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
    }
    if (hue < 0) {
      hue += 360;
    } else if (hue >= 360) {
      hue -= 360;
    }
    return hue;
  }
  function getSaturation(hsv, i, light) {
    if (hsv.h === 0 && hsv.s === 0) {
      return hsv.s;
    }
    let saturation;
    if (light) {
      saturation = hsv.s - saturationStep * i;
    } else if (i === darkColorCount) {
      saturation = hsv.s + saturationStep;
    } else {
      saturation = hsv.s + saturationStep2 * i;
    }
    if (saturation > 1) {
      saturation = 1;
    }
    if (light && i === lightColorCount && saturation > 0.1) {
      saturation = 0.1;
    }
    if (saturation < 0.06) {
      saturation = 0.06;
    }
    return Math.round(saturation * 100) / 100;
  }
  function getValue(hsv, i, light) {
    let value;
    if (light) {
      value = hsv.v + brightnessStep1 * i;
    } else {
      value = hsv.v - brightnessStep2 * i;
    }
    value = Math.max(0, Math.min(1, value));
    return Math.round(value * 100) / 100;
  }
  function generate$1(color, opts = {}) {
    const patterns = [];
    const pColor = new FastColor(color);
    const hsv = pColor.toHsv();
    for (let i = lightColorCount; i > 0; i -= 1) {
      const c = new FastColor({
        h: getHue(hsv, i, true),
        s: getSaturation(hsv, i, true),
        v: getValue(hsv, i, true)
      });
      patterns.push(c);
    }
    patterns.push(pColor);
    for (let i = 1; i <= darkColorCount; i += 1) {
      const c = new FastColor({
        h: getHue(hsv, i),
        s: getSaturation(hsv, i),
        v: getValue(hsv, i)
      });
      patterns.push(c);
    }
    if (opts.theme === "dark") {
      return darkColorMap.map(({
        index,
        amount
      }) => new FastColor(opts.backgroundColor || "#141414").mix(patterns[index], amount).toHexString());
    }
    return patterns.map((c) => c.toHexString());
  }
  const presetPrimaryColors = {
    "red": "#F5222D",
    "volcano": "#FA541C",
    "orange": "#FA8C16",
    "gold": "#FAAD14",
    "yellow": "#FADB14",
    "lime": "#A0D911",
    "green": "#52C41A",
    "cyan": "#13C2C2",
    "blue": "#1677FF",
    "geekblue": "#2F54EB",
    "purple": "#722ED1",
    "magenta": "#EB2F96",
    "grey": "#666666"
  };
  const red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
  red.primary = red[5];
  const volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
  volcano.primary = volcano[5];
  const orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
  orange.primary = orange[5];
  const gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
  gold.primary = gold[5];
  const yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
  yellow.primary = yellow[5];
  const lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
  lime.primary = lime[5];
  const green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
  green.primary = green[5];
  const cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
  cyan.primary = cyan[5];
  const blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
  blue.primary = blue[5];
  const geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
  geekblue.primary = geekblue[5];
  const purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
  purple.primary = purple[5];
  const magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
  magenta.primary = magenta[5];
  const grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
  grey.primary = grey[5];
  const presetPalettes = {
    red,
    volcano,
    orange,
    gold,
    yellow,
    lime,
    green,
    cyan,
    blue,
    geekblue,
    purple,
    magenta,
    grey
  };
  const IconContext = React.createContext({});
  function contains(root, n2) {
    if (!root) {
      return false;
    }
    if (root.contains) {
      return root.contains(n2);
    }
    let node2 = n2;
    while (node2) {
      if (node2 === root) {
        return true;
      }
      node2 = node2.parentNode;
    }
    return false;
  }
  const APPEND_ORDER = "data-rc-order";
  const APPEND_PRIORITY = "data-rc-priority";
  const MARK_KEY = `rc-util-key`;
  const containerCache = new Map();
  function getMark({
    mark
  } = {}) {
    if (mark) {
      return mark.startsWith("data-") ? mark : `data-${mark}`;
    }
    return MARK_KEY;
  }
  function getContainer(option) {
    if (option.attachTo) {
      return option.attachTo;
    }
    const head = document.querySelector("head");
    return head || document.body;
  }
  function getOrder(prepend) {
    if (prepend === "queue") {
      return "prependQueue";
    }
    return prepend ? "prepend" : "append";
  }
  function findStyles(container) {
    return Array.from((containerCache.get(container) || container).children).filter((node2) => node2.tagName === "STYLE");
  }
  function injectCSS(css, option = {}) {
    if (!canUseDom()) {
      return null;
    }
    const {
      csp,
      prepend,
      priority = 0
    } = option;
    const mergedOrder = getOrder(prepend);
    const isPrependQueue = mergedOrder === "prependQueue";
    const styleNode = document.createElement("style");
    styleNode.setAttribute(APPEND_ORDER, mergedOrder);
    if (isPrependQueue && priority) {
      styleNode.setAttribute(APPEND_PRIORITY, `${priority}`);
    }
    if (csp?.nonce) {
      styleNode.nonce = csp?.nonce;
    }
    styleNode.innerHTML = css;
    const container = getContainer(option);
    const {
      firstChild
    } = container;
    if (prepend) {
      if (isPrependQueue) {
        const existStyle = (option.styles || findStyles(container)).filter((node2) => {
          if (!["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER))) {
            return false;
          }
          const nodePriority = Number(node2.getAttribute(APPEND_PRIORITY) || 0);
          return priority >= nodePriority;
        });
        if (existStyle.length) {
          container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
          return styleNode;
        }
      }
      container.insertBefore(styleNode, firstChild);
    } else {
      container.appendChild(styleNode);
    }
    return styleNode;
  }
  function findExistNode(key, option = {}) {
    let {
      styles
    } = option;
    styles ||= findStyles(getContainer(option));
    return styles.find((node2) => node2.getAttribute(getMark(option)) === key);
  }
  function removeCSS(key, option = {}) {
    const existNode = findExistNode(key, option);
    if (existNode) {
      const container = getContainer(option);
      container.removeChild(existNode);
    }
  }
  function syncRealContainer(container, option) {
    const cachedRealContainer = containerCache.get(container);
    if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
      const placeholderStyle = injectCSS("", option);
      const {
        parentNode
      } = placeholderStyle;
      containerCache.set(container, parentNode);
      container.removeChild(placeholderStyle);
    }
  }
  function updateCSS(css, key, originOption = {}) {
    const container = getContainer(originOption);
    const styles = findStyles(container);
    const option = {
      ...originOption,
      styles
    };
    syncRealContainer(container, option);
    const existNode = findExistNode(key, option);
    if (existNode) {
      if (option.csp?.nonce && existNode.nonce !== option.csp?.nonce) {
        existNode.nonce = option.csp?.nonce;
      }
      if (existNode.innerHTML !== css) {
        existNode.innerHTML = css;
      }
      return existNode;
    }
    const newNode = injectCSS(css, option);
    newNode.setAttribute(getMark(option), key);
    return newNode;
  }
  function getRoot(ele) {
    return ele?.getRootNode?.();
  }
  function inShadow(ele) {
    return getRoot(ele) instanceof ShadowRoot;
  }
  function getShadowRoot(ele) {
    return inShadow(ele) ? getRoot(ele) : null;
  }
  function camelCase(input) {
    return input.replace(/-(.)/g, (match2, g) => g.toUpperCase());
  }
  function warning(valid, message2) {
    warningOnce(valid, `[@ant-design/icons] ${message2}`);
  }
  function isIconDefinition(target) {
    return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
  }
  function normalizeAttrs(attrs = {}) {
    return Object.keys(attrs).reduce((acc, key) => {
      const val = attrs[key];
      switch (key) {
        case "class":
          acc.className = val;
          delete acc.class;
          break;
        default:
          delete acc[key];
          acc[camelCase(key)] = val;
      }
      return acc;
    }, {});
  }
  function generate(node2, key, rootProps) {
    if (!rootProps) {
      return React.createElement(node2.tag, {
        key,
        ...normalizeAttrs(node2.attrs)
      }, (node2.children || []).map((child, index) => generate(child, `${key}-${node2.tag}-${index}`)));
    }
    return React.createElement(node2.tag, {
      key,
      ...normalizeAttrs(node2.attrs),
      ...rootProps
    }, (node2.children || []).map((child, index) => generate(child, `${key}-${node2.tag}-${index}`)));
  }
  function getSecondaryColor(primaryColor) {
    return generate$1(primaryColor)[0];
  }
  function normalizeTwoToneColors(twoToneColor) {
    if (!twoToneColor) {
      return [];
    }
    return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
  }
  const iconStyles = `
.anticon {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-style: normal;
  line-height: 0;
  text-align: center;
  text-transform: none;
  vertical-align: -0.125em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.anticon > * {
  line-height: 1;
}

.anticon svg {
  display: inline-block;
  vertical-align: inherit;
}

.anticon::before {
  display: none;
}

.anticon .anticon-icon {
  display: block;
}

.anticon[tabindex] {
  cursor: pointer;
}

.anticon-spin {
  -webkit-animation: loadingCircle 1s infinite linear;
  animation: loadingCircle 1s infinite linear;
}

@-webkit-keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes loadingCircle {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}
`;
  const useInsertStyles = (eleRef) => {
    const {
      csp,
      prefixCls,
      layer
    } = React.useContext(IconContext);
    let mergedStyleStr = iconStyles;
    if (prefixCls) {
      mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
    }
    if (layer) {
      mergedStyleStr = `@layer ${layer} {
${mergedStyleStr}
}`;
    }
    React.useEffect(() => {
      const ele = eleRef.current;
      const shadowRoot = getShadowRoot(ele);
      updateCSS(mergedStyleStr, "@ant-design-icons", {
        prepend: !layer,
        csp,
        attachTo: shadowRoot
      });
    }, []);
  };
  const twoToneColorPalette = {
    primaryColor: "#333",
    secondaryColor: "#E6E6E6",
    calculated: false
  };
  function setTwoToneColors({
    primaryColor,
    secondaryColor
  }) {
    twoToneColorPalette.primaryColor = primaryColor;
    twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
    twoToneColorPalette.calculated = !!secondaryColor;
  }
  function getTwoToneColors() {
    return {
      ...twoToneColorPalette
    };
  }
  const IconBase = (props) => {
    const {
      icon,
      className,
      onClick,
      style: style2,
      primaryColor,
      secondaryColor,
      ...restProps
    } = props;
    const svgRef = React__namespace.useRef(null);
    let colors = twoToneColorPalette;
    if (primaryColor) {
      colors = {
        primaryColor,
        secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
      };
    }
    useInsertStyles(svgRef);
    warning(isIconDefinition(icon), `icon should be icon definiton, but got ${icon}`);
    if (!isIconDefinition(icon)) {
      return null;
    }
    let target = icon;
    if (target && typeof target.icon === "function") {
      target = {
        ...target,
        icon: target.icon(colors.primaryColor, colors.secondaryColor)
      };
    }
    return generate(target.icon, `svg-${target.name}`, {
      className,
      onClick,
      style: style2,
      "data-icon": target.name,
      width: "1em",
      height: "1em",
      fill: "currentColor",
      "aria-hidden": "true",
      ...restProps,
      ref: svgRef
    });
  };
  IconBase.displayName = "IconReact";
  IconBase.getTwoToneColors = getTwoToneColors;
  IconBase.setTwoToneColors = setTwoToneColors;
  function setTwoToneColor(twoToneColor) {
    const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
    return IconBase.setTwoToneColors({
      primaryColor,
      secondaryColor
    });
  }
  function getTwoToneColor() {
    const colors = IconBase.getTwoToneColors();
    if (!colors.calculated) {
      return colors.primaryColor;
    }
    return [colors.primaryColor, colors.secondaryColor];
  }
  function _extends$l() {
    _extends$l = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$l.apply(this, arguments);
  }
  setTwoToneColor(blue.primary);
  const Icon = React__namespace.forwardRef((props, ref) => {
    const {
className,
icon,
      spin,
      rotate,
      tabIndex,
      onClick,
twoToneColor,
      ...restProps
    } = props;
    const {
      prefixCls = "anticon",
      rootClassName
    } = React__namespace.useContext(IconContext);
    const classString = clsx(rootClassName, prefixCls, {
      [`${prefixCls}-${icon.name}`]: !!icon.name,
      [`${prefixCls}-spin`]: !!spin || icon.name === "loading"
    }, className);
    let iconTabIndex = tabIndex;
    if (iconTabIndex === void 0 && onClick) {
      iconTabIndex = -1;
    }
    const svgStyle = rotate ? {
      msTransform: `rotate(${rotate}deg)`,
      transform: `rotate(${rotate}deg)`
    } : void 0;
    const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);
    return React__namespace.createElement("span", _extends$l({
      role: "img",
      "aria-label": icon.name
    }, restProps, {
      ref,
      tabIndex: iconTabIndex,
      onClick,
      className: classString
    }), React__namespace.createElement(IconBase, {
      icon,
      primaryColor,
      secondaryColor,
      style: svgStyle
    }));
  });
  Icon.getTwoToneColor = getTwoToneColor;
  Icon.setTwoToneColor = setTwoToneColor;
  function _extends$k() {
    _extends$k = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$k.apply(this, arguments);
  }
  const CloseOutlined = (props, ref) => React__namespace.createElement(Icon, _extends$k({}, props, {
    ref,
    icon: CloseOutlined$1
  }));
  const RefIcon$6 = React__namespace.forwardRef(CloseOutlined);
  const attributes = `accept acceptCharset accessKey action allowFullScreen allowTransparency
    alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
    charSet checked classID className colSpan cols content contentEditable contextMenu
    controls coords crossOrigin data dateTime default defer dir disabled download draggable
    encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
    headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
    is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
    mediaGroup method min minLength multiple muted name noValidate nonce open
    optimum pattern placeholder poster preload radioGroup readOnly rel required
    reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
    shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
    summary tabIndex target title type useMap value width wmode wrap`;
  const eventsName = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
    onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
    onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
    onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
    onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
    onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
    onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`;
  const propList = `${attributes} ${eventsName}`.split(/[\s\n]+/);
  const ariaPrefix = "aria-";
  const dataPrefix = "data-";
  function match$1(key, prefix2) {
    return key.indexOf(prefix2) === 0;
  }
  function pickAttrs(props, ariaOnly = false) {
    let mergedConfig;
    if (ariaOnly === false) {
      mergedConfig = {
        aria: true,
        data: true,
        attr: true
      };
    } else if (ariaOnly === true) {
      mergedConfig = {
        aria: true
      };
    } else {
      mergedConfig = {
        ...ariaOnly
      };
    }
    const attrs = {};
    Object.keys(props).forEach((key) => {
      if (
mergedConfig.aria && (key === "role" || match$1(key, ariaPrefix)) ||
mergedConfig.data && match$1(key, dataPrefix) ||
mergedConfig.attr && propList.includes(key)
      ) {
        attrs[key] = props[key];
      }
    });
    return attrs;
  }
  const WarningContext = React__namespace.createContext({});
  const locale$3 = {
items_per_page: "/ page",
    jump_to: "Go to",
    jump_to_confirm: "confirm",
    page: "Page",
prev_page: "Previous Page",
    next_page: "Next Page",
    prev_5: "Previous 5 Pages",
    next_5: "Next 5 Pages",
    prev_3: "Previous 3 Pages",
    next_3: "Next 3 Pages",
    page_size: "Page Size"
  };
  var commonLocale = {
    yearFormat: "YYYY",
    dayFormat: "D",
    cellMeridiemFormat: "A",
    monthBeforeYear: true
  };
  function _typeof(o2) {
    "@babel/helpers - typeof";
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof(o2);
  }
  function ownKeys(e2, r2) {
    var t2 = Object.keys(e2);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e2);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    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;
  }
  function _defineProperty(obj, key, value) {
    key = _toPropertyKey(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  function _toPropertyKey(t2) {
    var i = _toPrimitive(t2, "string");
    return "symbol" == _typeof(i) ? i : String(i);
  }
  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);
      if ("object" != _typeof(i)) return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  var locale$2 = _objectSpread(_objectSpread({}, commonLocale), {}, {
    locale: "en_US",
    today: "Today",
    now: "Now",
    backToToday: "Back to today",
    ok: "OK",
    clear: "Clear",
    week: "Week",
    month: "Month",
    year: "Year",
    timeSelect: "select time",
    dateSelect: "select date",
    weekSelect: "Choose a week",
    monthSelect: "Choose a month",
    yearSelect: "Choose a year",
    decadeSelect: "Choose a decade",
    previousMonth: "Previous month (PageUp)",
    nextMonth: "Next month (PageDown)",
    previousYear: "Last year (Control + left)",
    nextYear: "Next year (Control + right)",
    previousDecade: "Last decade",
    nextDecade: "Next decade",
    previousCentury: "Last century",
    nextCentury: "Next century"
  });
  const locale$1 = {
    placeholder: "Select time",
    rangePlaceholder: ["Start time", "End time"]
  };
  const locale = {
    lang: {
      placeholder: "Select date",
      yearPlaceholder: "Select year",
      quarterPlaceholder: "Select quarter",
      monthPlaceholder: "Select month",
      weekPlaceholder: "Select week",
      rangePlaceholder: ["Start date", "End date"],
      rangeYearPlaceholder: ["Start year", "End year"],
      rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
      rangeMonthPlaceholder: ["Start month", "End month"],
      rangeWeekPlaceholder: ["Start week", "End week"],
      ...locale$2
    },
    timePickerLocale: {
      ...locale$1
    }
  };
  const typeTemplate = "${label} is not a valid ${type}";
  const localeValues = {
    locale: "en",
    Pagination: locale$3,
    DatePicker: locale,
    TimePicker: locale$1,
    Calendar: locale,
    global: {
      placeholder: "Please select",
      close: "Close",
      sortable: "sortable"
    },
    Table: {
      filterTitle: "Filter menu",
      filterConfirm: "OK",
      filterReset: "Reset",
      filterEmptyText: "No filters",
      filterCheckAll: "Select all items",
      filterSearchPlaceholder: "Search in filters",
      emptyText: "No data",
      selectAll: "Select current page",
      selectInvert: "Invert current page",
      selectNone: "Clear all data",
      selectionAll: "Select all data",
      sortTitle: "Sort",
      expand: "Expand row",
      collapse: "Collapse row",
      triggerDesc: "Click to sort descending",
      triggerAsc: "Click to sort ascending",
      cancelSort: "Click to cancel sorting"
    },
    Tour: {
      Next: "Next",
      Previous: "Previous",
      Finish: "Finish"
    },
    Modal: {
      okText: "OK",
      cancelText: "Cancel",
      justOkText: "OK"
    },
    Popconfirm: {
      okText: "OK",
      cancelText: "Cancel"
    },
    Transfer: {
      titles: ["", ""],
      searchPlaceholder: "Search here",
      itemUnit: "item",
      itemsUnit: "items",
      remove: "Remove",
      selectCurrent: "Select current page",
      removeCurrent: "Remove current page",
      selectAll: "Select all data",
      deselectAll: "Deselect all data",
      removeAll: "Remove all data",
      selectInvert: "Invert current page"
    },
    Upload: {
      uploading: "Uploading...",
      removeFile: "Remove file",
      uploadError: "Upload error",
      previewFile: "Preview file",
      downloadFile: "Download file"
    },
    Empty: {
      description: "No data"
    },
    Icon: {
      icon: "icon"
    },
    Text: {
      edit: "Edit",
      copy: "Copy",
      copied: "Copied",
      expand: "Expand",
      collapse: "Collapse"
    },
    Form: {
      optional: "(optional)",
      defaultValidateMessages: {
        default: "Field validation error for ${label}",
        required: "Please enter ${label}",
        enum: "${label} must be one of [${enum}]",
        whitespace: "${label} cannot be a blank character",
        date: {
          format: "${label} date format is invalid",
          parse: "${label} cannot be converted to a date",
          invalid: "${label} is an invalid date"
        },
        types: {
          string: typeTemplate,
          method: typeTemplate,
          array: typeTemplate,
          object: typeTemplate,
          number: typeTemplate,
          date: typeTemplate,
          boolean: typeTemplate,
          integer: typeTemplate,
          float: typeTemplate,
          regexp: typeTemplate,
          email: typeTemplate,
          url: typeTemplate,
          hex: typeTemplate
        },
        string: {
          len: "${label} must be ${len} characters",
          min: "${label} must be at least ${min} characters",
          max: "${label} must be up to ${max} characters",
          range: "${label} must be between ${min}-${max} characters"
        },
        number: {
          len: "${label} must be equal to ${len}",
          min: "${label} must be minimum ${min}",
          max: "${label} must be maximum ${max}",
          range: "${label} must be between ${min}-${max}"
        },
        array: {
          len: "Must be ${len} ${label}",
          min: "At least ${min} ${label}",
          max: "At most ${max} ${label}",
          range: "The amount of ${label} must be between ${min}-${max}"
        },
        pattern: {
          mismatch: "${label} does not match the pattern ${pattern}"
        }
      }
    },
    QRCode: {
      expired: "QR code expired",
      refresh: "Refresh",
      scanned: "Scanned"
    },
    ColorPicker: {
      presetEmpty: "Empty",
      transparent: "Transparent",
      singleColor: "Single",
      gradientColor: "Gradient"
    }
  };
  let runtimeLocale = {
    ...localeValues.Modal
  };
  let localeList = [];
  const generateLocale = () => localeList.reduce((merged, locale2) => ({
    ...merged,
    ...locale2
  }), localeValues.Modal);
  function changeConfirmLocale(newLocale) {
    if (newLocale) {
      const cloneLocale = {
        ...newLocale
      };
      localeList.push(cloneLocale);
      runtimeLocale = generateLocale();
      return () => {
        localeList = localeList.filter((locale2) => locale2 !== cloneLocale);
        runtimeLocale = generateLocale();
      };
    }
    runtimeLocale = {
      ...localeValues.Modal
    };
  }
  function getConfirmLocale() {
    return runtimeLocale;
  }
  const LocaleContext = React.createContext(void 0);
  const useLocale = (componentName, defaultLocale) => {
    const fullLocale = React__namespace.useContext(LocaleContext);
    const getLocale = React__namespace.useMemo(() => {
      const locale2 = defaultLocale || localeValues[componentName];
      const localeFromContext = fullLocale?.[componentName] ?? {};
      return {
        ...typeof locale2 === "function" ? locale2() : locale2,
        ...localeFromContext || {}
      };
    }, [componentName, defaultLocale, fullLocale]);
    const getLocaleCode = React__namespace.useMemo(() => {
      const localeCode = fullLocale?.locale;
      if (fullLocale?.exist && !localeCode) {
        return localeValues.locale;
      }
      return localeCode;
    }, [fullLocale]);
    return [getLocale, getLocaleCode];
  };
  const ANT_MARK = "internalMark";
  const LocaleProvider = (props) => {
    const {
      locale: locale2 = {},
      children,
      _ANT_MARK__
    } = props;
    React__namespace.useEffect(() => {
      const clearLocale = changeConfirmLocale(locale2?.Modal);
      return clearLocale;
    }, [locale2]);
    const getMemoizedContextValue = React__namespace.useMemo(() => ({
      ...locale2,
      exist: true
    }), [locale2]);
    return React__namespace.createElement(LocaleContext.Provider, {
      value: getMemoizedContextValue
    }, children);
  };
  function mergeProps(...items) {
    const ret = {};
    items.forEach((item) => {
      if (item) {
        Object.keys(item).forEach((key) => {
          if (item[key] !== void 0) {
            ret[key] = item[key];
          }
        });
      }
    });
    return ret;
  }
  const isNonNullable$1 = (val) => {
    return val !== void 0 && val !== null;
  };
  const pickClosable = (context) => {
    if (!context) {
      return void 0;
    }
    const {
      closable,
      closeIcon
    } = context;
    return {
      closable,
      closeIcon
    };
  };
  const EmptyFallbackCloseCollection = {};
  const computeClosableConfig = (closable, closeIcon) => {
    if (!closable && (closable === false || closeIcon === false || closeIcon === null)) {
      return false;
    }
    if (closable === void 0 && closeIcon === void 0) {
      return null;
    }
    let closableConfig = {
      closeIcon: typeof closeIcon !== "boolean" && closeIcon !== null ? closeIcon : void 0
    };
    if (closable && typeof closable === "object") {
      closableConfig = {
        ...closableConfig,
        ...closable
      };
    }
    return closableConfig;
  };
  const mergeClosableConfigs = (propConfig, contextConfig, fallbackConfig) => {
    if (propConfig === false) {
      return false;
    }
    if (propConfig) {
      return mergeProps(fallbackConfig, contextConfig, propConfig);
    }
    if (contextConfig === false) {
      return false;
    }
    if (contextConfig) {
      return mergeProps(fallbackConfig, contextConfig);
    }
    return fallbackConfig.closable ? fallbackConfig : false;
  };
  const computeCloseIcon = (mergedConfig, fallbackCloseCollection, closeLabel) => {
    const {
      closeIconRender
    } = fallbackCloseCollection;
    const {
      closeIcon,
      ...restConfig
    } = mergedConfig;
    let finalCloseIcon = closeIcon;
    const ariaOrDataProps = pickAttrs(restConfig, true);
    if (isNonNullable$1(finalCloseIcon)) {
      if (closeIconRender) {
        finalCloseIcon = closeIconRender(finalCloseIcon);
      }
      finalCloseIcon = React.isValidElement(finalCloseIcon) ? React.cloneElement(finalCloseIcon, {
        "aria-label": closeLabel,
        ...finalCloseIcon.props,
        ...ariaOrDataProps
      }) : React.createElement("span", {
        "aria-label": closeLabel,
        ...ariaOrDataProps
      }, finalCloseIcon);
    }
    return [finalCloseIcon, ariaOrDataProps];
  };
  const computeClosable = (propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection, closeLabel = "Close") => {
    const propConfig = computeClosableConfig(propCloseCollection?.closable, propCloseCollection?.closeIcon);
    const contextConfig = computeClosableConfig(contextCloseCollection?.closable, contextCloseCollection?.closeIcon);
    const mergedFallback = {
      closeIcon: React.createElement(RefIcon$6, null),
      ...fallbackCloseCollection
    };
    const mergedConfig = mergeClosableConfigs(propConfig, contextConfig, mergedFallback);
    const closeBtnIsDisabled = typeof mergedConfig !== "boolean" ? !!mergedConfig?.disabled : false;
    if (mergedConfig === false) {
      return [false, null, closeBtnIsDisabled, {}];
    }
    const [closeIcon, ariaProps] = computeCloseIcon(mergedConfig, mergedFallback, closeLabel);
    return [true, closeIcon, closeBtnIsDisabled, ariaProps];
  };
  const useClosable = (propCloseCollection, contextCloseCollection, fallbackCloseCollection = EmptyFallbackCloseCollection) => {
    const [contextLocale] = useLocale("global", localeValues.global);
    return React.useMemo(() => {
      return computeClosable(propCloseCollection, contextCloseCollection, {
        closeIcon: React.createElement(RefIcon$6, null),
        ...fallbackCloseCollection
      }, contextLocale.close);
    }, [propCloseCollection, contextCloseCollection, fallbackCloseCollection, contextLocale.close]);
  };
  const useForceUpdate = () => {
    return React.useReducer((ori) => ori + 1, 0);
  };
  const normalizeMaskConfig = (mask, maskClosable) => {
    let maskConfig = {};
    if (mask && typeof mask === "object") {
      maskConfig = mask;
    }
    if (typeof mask === "boolean") {
      maskConfig = {
        enabled: mask
      };
    }
    if (maskConfig.closable === void 0 && maskClosable !== void 0) {
      maskConfig.closable = maskClosable;
    }
    return maskConfig;
  };
  const useMergedMask = (mask, contextMask, prefixCls, maskClosable) => {
    return React.useMemo(() => {
      const maskConfig = normalizeMaskConfig(mask, maskClosable);
      const contextMaskConfig = normalizeMaskConfig(contextMask);
      const mergedConfig = {
        blur: false,
        ...contextMaskConfig,
        ...maskConfig,
        closable: maskConfig.closable ?? maskClosable ?? contextMaskConfig.closable ?? true
      };
      const className = mergedConfig.blur ? `${prefixCls}-mask-blur` : void 0;
      return [mergedConfig.enabled !== false, {
        mask: className
      }, !!mergedConfig.closable];
    }, [mask, contextMask, prefixCls, maskClosable]);
  };
  const mergeClassNames = (schema, ...classNames) => {
    const mergedSchema = schema || {};
    return classNames.filter(Boolean).reduce((acc, cur) => {
      Object.keys(cur || {}).forEach((key) => {
        const keySchema = mergedSchema[key];
        const curVal = cur[key];
        if (keySchema && typeof keySchema === "object") {
          if (curVal && typeof curVal === "object") {
            acc[key] = mergeClassNames(keySchema, acc[key], curVal);
          } else {
            const {
              _default: defaultField
            } = keySchema;
            if (defaultField) {
              acc[key] = acc[key] || {};
              acc[key][defaultField] = clsx(acc[key][defaultField], curVal);
            }
          }
        } else {
          acc[key] = clsx(acc[key], curVal);
        }
      });
      return acc;
    }, {});
  };
  const useSemanticClassNames = (schema, ...classNames) => {
    return React__namespace.useMemo(() => mergeClassNames.apply(void 0, [schema].concat(classNames)), [schema].concat(classNames));
  };
  const mergeStyles = (...styles) => {
    return styles.filter(Boolean).reduce((acc, cur = {}) => {
      Object.keys(cur).forEach((key) => {
        acc[key] = {
          ...acc[key],
          ...cur[key]
        };
      });
      return acc;
    }, {});
  };
  const useSemanticStyles = (...styles) => {
    return React__namespace.useMemo(() => mergeStyles.apply(void 0, styles), [].concat(styles));
  };
  const resolveStyleOrClass = (value, info) => {
    return typeof value === "function" ? value(info) : value;
  };
  const useMergeSemantic = (classNamesList, stylesList, info, schema) => {
    const resolvedClassNamesList = classNamesList.map((classNames) => classNames ? resolveStyleOrClass(classNames, info) : void 0);
    const resolvedStylesList = stylesList.map((styles) => styles ? resolveStyleOrClass(styles, info) : void 0);
    const mergedClassNames = useSemanticClassNames.apply(void 0, [schema].concat(_toConsumableArray(resolvedClassNamesList)));
    const mergedStyles = useSemanticStyles.apply(void 0, _toConsumableArray(resolvedStylesList));
    return React__namespace.useMemo(() => {
      {
        return [mergedClassNames, mergedStyles];
      }
    }, [mergedClassNames, mergedStyles, schema]);
  };
  const isValidOrientation = (orientation) => {
    return orientation === "horizontal" || orientation === "vertical";
  };
  const useOrientation = (orientation, vertical, legacyDirection) => {
    return React.useMemo(() => {
      const validOrientation = isValidOrientation(orientation);
      let mergedOrientation;
      if (validOrientation) {
        mergedOrientation = orientation;
      } else if (typeof vertical === "boolean") {
        mergedOrientation = vertical ? "vertical" : "horizontal";
      } else {
        const validLegacyDirection = isValidOrientation(legacyDirection);
        mergedOrientation = validLegacyDirection ? legacyDirection : "horizontal";
      }
      return [mergedOrientation, mergedOrientation === "vertical"];
    }, [legacyDirection, orientation, vertical]);
  };
  const usePatchElement = () => {
    const [elements, setElements] = React__namespace.useState([]);
    const patchElement = React__namespace.useCallback((element) => {
      setElements((originElements) => [].concat(_toConsumableArray(originElements), [element]));
      return () => {
        setElements((originElements) => originElements.filter((ele) => ele !== element));
      };
    }, []);
    return [elements, patchElement];
  };
  function murmur2(str) {
    var h = 0;
    var k, i = 0, len = str.length;
    for (; len >= 4; ++i, len -= 4) {
      k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
      k =
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
      k ^=
k >>> 24;
      h =
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
    }
    switch (len) {
      case 3:
        h ^= (str.charCodeAt(i + 2) & 255) << 16;
      case 2:
        h ^= (str.charCodeAt(i + 1) & 255) << 8;
      case 1:
        h ^= str.charCodeAt(i) & 255;
        h =
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
    }
    h ^= h >>> 13;
    h =
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
    return ((h ^ h >>> 15) >>> 0).toString(36);
  }
  const SPLIT = "%";
  function pathKey(keys2) {
    return keys2.join(SPLIT);
  }
  let updateId = 0;
  class Entity {
    instanceId;
    constructor(instanceId) {
      this.instanceId = instanceId;
    }
cache = new Map();
updateTimes = new Map();
    extracted = new Set();
    get(keys2) {
      return this.opGet(pathKey(keys2));
    }
opGet(keyPathStr) {
      return this.cache.get(keyPathStr) || null;
    }
    update(keys2, valueFn) {
      return this.opUpdate(pathKey(keys2), valueFn);
    }
opUpdate(keyPathStr, valueFn) {
      const prevValue = this.cache.get(keyPathStr);
      const nextValue = valueFn(prevValue);
      if (nextValue === null) {
        this.cache.delete(keyPathStr);
        this.updateTimes.delete(keyPathStr);
      } else {
        this.cache.set(keyPathStr, nextValue);
        this.updateTimes.set(keyPathStr, updateId);
        updateId += 1;
      }
    }
  }
  const ATTR_TOKEN = "data-token-hash";
  const ATTR_MARK = "data-css-hash";
  const CSS_IN_JS_INSTANCE = "__cssinjs_instance__";
  function createCache() {
    const cssinjsInstanceId = Math.random().toString(12).slice(2);
    if (typeof document !== "undefined" && document.head && document.body) {
      const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || [];
      const {
        firstChild
      } = document.head;
      Array.from(styles).forEach((style2) => {
        style2[CSS_IN_JS_INSTANCE] ||= cssinjsInstanceId;
        if (style2[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
          document.head.insertBefore(style2, firstChild);
        }
      });
      const styleHash = {};
      Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach((style2) => {
        const hash2 = style2.getAttribute(ATTR_MARK);
        if (styleHash[hash2]) {
          if (style2[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
            style2.parentNode?.removeChild(style2);
          }
        } else {
          styleHash[hash2] = true;
        }
      });
    }
    return new Entity(cssinjsInstanceId);
  }
  const StyleContext = React__namespace.createContext({
    hashPriority: "low",
    cache: createCache(),
    defaultCache: true,
    autoPrefix: false
  });
  function sameDerivativeOption(left, right) {
    if (left.length !== right.length) {
      return false;
    }
    for (let i = 0; i < left.length; i++) {
      if (left[i] !== right[i]) {
        return false;
      }
    }
    return true;
  }
  class ThemeCache {
    static MAX_CACHE_SIZE = 20;
    static MAX_CACHE_OFFSET = 5;
    cache;
    keys;
    cacheCallTimes;
    constructor() {
      this.cache = new Map();
      this.keys = [];
      this.cacheCallTimes = 0;
    }
    size() {
      return this.keys.length;
    }
    internalGet(derivativeOption, updateCallTimes = false) {
      let cache = {
        map: this.cache
      };
      derivativeOption.forEach((derivative2) => {
        if (!cache) {
          cache = void 0;
        } else {
          cache = cache?.map?.get(derivative2);
        }
      });
      if (cache?.value && updateCallTimes) {
        cache.value[1] = this.cacheCallTimes++;
      }
      return cache?.value;
    }
    get(derivativeOption) {
      return this.internalGet(derivativeOption, true)?.[0];
    }
    has(derivativeOption) {
      return !!this.internalGet(derivativeOption);
    }
    set(derivativeOption, value) {
      if (!this.has(derivativeOption)) {
        if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
          const [targetKey] = this.keys.reduce((result, key) => {
            const [, callTimes] = result;
            if (this.internalGet(key)[1] < callTimes) {
              return [key, this.internalGet(key)[1]];
            }
            return result;
          }, [this.keys[0], this.cacheCallTimes]);
          this.delete(targetKey);
        }
        this.keys.push(derivativeOption);
      }
      let cache = this.cache;
      derivativeOption.forEach((derivative2, index) => {
        if (index === derivativeOption.length - 1) {
          cache.set(derivative2, {
            value: [value, this.cacheCallTimes++]
          });
        } else {
          const cacheValue = cache.get(derivative2);
          if (!cacheValue) {
            cache.set(derivative2, {
              map: new Map()
            });
          } else if (!cacheValue.map) {
            cacheValue.map = new Map();
          }
          cache = cache.get(derivative2).map;
        }
      });
    }
    deleteByPath(currentCache, derivatives) {
      const cache = currentCache.get(derivatives[0]);
      if (derivatives.length === 1) {
        if (!cache.map) {
          currentCache.delete(derivatives[0]);
        } else {
          currentCache.set(derivatives[0], {
            map: cache.map
          });
        }
        return cache.value?.[0];
      }
      const result = this.deleteByPath(cache.map, derivatives.slice(1));
      if ((!cache.map || cache.map.size === 0) && !cache.value) {
        currentCache.delete(derivatives[0]);
      }
      return result;
    }
    delete(derivativeOption) {
      if (this.has(derivativeOption)) {
        this.keys = this.keys.filter((item) => !sameDerivativeOption(item, derivativeOption));
        return this.deleteByPath(this.cache, derivativeOption);
      }
      return void 0;
    }
  }
  let uuid$3 = 0;
  class Theme {
    derivatives;
    id;
    constructor(derivatives) {
      this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
      this.id = uuid$3;
      if (derivatives.length === 0) {
        warning$2(derivatives.length > 0);
      }
      uuid$3 += 1;
    }
    getDerivativeToken(token2) {
      return this.derivatives.reduce((result, derivative2) => derivative2(token2, result), void 0);
    }
  }
  const cacheThemes = new ThemeCache();
  function createTheme(derivatives) {
    const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
    if (!cacheThemes.has(derivativeArr)) {
      cacheThemes.set(derivativeArr, new Theme(derivativeArr));
    }
    return cacheThemes.get(derivativeArr);
  }
  const resultCache = new WeakMap();
  const RESULT_VALUE = {};
  function memoResult(callback, deps) {
    let current = resultCache;
    for (let i = 0; i < deps.length; i += 1) {
      const dep = deps[i];
      if (!current.has(dep)) {
        current.set(dep, new WeakMap());
      }
      current = current.get(dep);
    }
    if (!current.has(RESULT_VALUE)) {
      current.set(RESULT_VALUE, callback());
    }
    return current.get(RESULT_VALUE);
  }
  const flattenTokenCache = new WeakMap();
  function flattenToken(token2) {
    let str = flattenTokenCache.get(token2) || "";
    if (!str) {
      Object.keys(token2).forEach((key) => {
        const value = token2[key];
        str += key;
        if (value instanceof Theme) {
          str += value.id;
        } else if (value && typeof value === "object") {
          str += flattenToken(value);
        } else {
          str += value;
        }
      });
      str = murmur2(str);
      flattenTokenCache.set(token2, str);
    }
    return str;
  }
  function token2key(token2, salt) {
    return murmur2(`${salt}_${flattenToken(token2)}`);
  }
  const isClientSide = canUseDom();
  function unit$1(num) {
    if (typeof num === "number") {
      return `${num}px`;
    }
    return num;
  }
  function where(options) {
    const {
      hashCls,
      hashPriority = "low"
    } = options || {};
    if (!hashCls) {
      return "";
    }
    const hashSelector = `.${hashCls}`;
    return hashPriority === "low" ? `:where(${hashSelector})` : hashSelector;
  }
  const isNonNullable = (val) => {
    return val !== void 0 && val !== null;
  };
  function injectCSPNonce(config, nonce) {
    const nonceStr = typeof nonce === "function" ? nonce() : nonce;
    if (nonceStr) {
      return {
        ...config,
        csp: {
          ...config.csp,
          nonce: nonceStr
        }
      };
    }
    return config;
  }
  const token2CSSVar = (token2, prefix2 = "") => {
    return `--${prefix2 ? `${prefix2}-` : ""}${token2}`.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g, "$1-$2").replace(/([a-z])([A-Z0-9])/g, "$1-$2").toLowerCase();
  };
  const serializeCSSVar = (cssVars, hashId, options) => {
    const {
      hashCls,
      hashPriority = "low",
      scope
    } = options || {};
    if (!Object.keys(cssVars).length) {
      return "";
    }
    const baseSelector = `${where({
    hashCls,
    hashPriority
  })}.${hashId}`;
    const scopes = [scope].flat().filter(Boolean);
    const selector = scopes.length ? scopes.map((s) => `${baseSelector}.${s}`).join(", ") : baseSelector;
    return `${selector}{${Object.entries(cssVars).map(([key, value]) => `${key}:${value};`).join("")}}`;
  };
  const transformToken = (token2, themeKey, config) => {
    const {
      hashCls,
      hashPriority = "low",
      prefix: prefix2,
      unitless: unitless2,
      ignore: ignore2,
      preserve: preserve2
    } = config || {};
    const cssVars = {};
    const result = {};
    Object.entries(token2).forEach(([key, value]) => {
      if (preserve2?.[key]) {
        result[key] = value;
      } else if ((typeof value === "string" || typeof value === "number") && !ignore2?.[key]) {
        const cssVar = token2CSSVar(key, prefix2);
        cssVars[cssVar] = typeof value === "number" && !unitless2?.[key] ? `${value}px` : String(value);
        result[key] = `var(${cssVar})`;
      }
    });
    return [result, serializeCSSVar(cssVars, themeKey, {
      scope: config?.scope,
      hashCls,
      hashPriority
    })];
  };
  const effectMap = new Map();
  function useGlobalCache(prefix2, keyPath, cacheFn, onCacheRemove, onCacheEffect) {
    const {
      cache: globalCache
    } = React__namespace.useContext(StyleContext);
    const fullPath = [prefix2, ...keyPath];
    const fullPathStr = pathKey(fullPath);
    const buildCache = (updater) => {
      globalCache.opUpdate(fullPathStr, (prevCache) => {
        const [times = 0, cache] = prevCache || [void 0, void 0];
        let tmpCache = cache;
        const mergedCache = tmpCache || cacheFn();
        const data = [times, mergedCache];
        return updater ? updater(data) : data;
      });
    };
    React__namespace.useMemo(
      () => {
        buildCache();
      },
[fullPathStr]
);
    let cacheEntity = globalCache.opGet(fullPathStr);
    const cacheContent = cacheEntity[1];
    React.useInsertionEffect(() => {
      buildCache(([times, cache]) => [times + 1, cache]);
      if (!effectMap.has(fullPathStr)) {
        onCacheEffect?.(cacheContent);
        effectMap.set(fullPathStr, true);
        Promise.resolve().then(() => {
          effectMap.delete(fullPathStr);
        });
      }
      return () => {
        globalCache.opUpdate(fullPathStr, (prevCache) => {
          const [times = 0, cache] = prevCache || [];
          const nextCount = times - 1;
          if (nextCount === 0) {
            onCacheRemove?.(cache, false);
            effectMap.delete(fullPathStr);
            return null;
          }
          return [times - 1, cache];
        });
      };
    }, [fullPathStr]);
    return cacheContent;
  }
  const EMPTY_OVERRIDE = {};
  const hashPrefix = "css";
  const tokenKeys = new Map();
  function recordCleanToken(tokenKey) {
    tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
  }
  function removeStyleTags(key, instanceId) {
    if (typeof document !== "undefined") {
      const styles = document.querySelectorAll(`style[${ATTR_TOKEN}="${key}"]`);
      styles.forEach((style2) => {
        if (style2[CSS_IN_JS_INSTANCE] === instanceId) {
          style2.parentNode?.removeChild(style2);
        }
      });
    }
  }
  const TOKEN_THRESHOLD = -1;
  function cleanTokenStyle(tokenKey, instanceId) {
    tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
    const cleanableKeyList = new Set();
    tokenKeys.forEach((value, key) => {
      if (value <= 0) cleanableKeyList.add(key);
    });
    if (tokenKeys.size - cleanableKeyList.size > TOKEN_THRESHOLD) {
      cleanableKeyList.forEach((key) => {
        removeStyleTags(key, instanceId);
        tokenKeys.delete(key);
      });
    }
  }
  const getComputedToken$1 = (originToken, overrideToken, theme, format2) => {
    const derivativeToken = theme.getDerivativeToken(originToken);
    let mergedDerivativeToken = {
      ...derivativeToken,
      ...overrideToken
    };
    if (format2) {
      mergedDerivativeToken = format2(mergedDerivativeToken);
    }
    return mergedDerivativeToken;
  };
  const TOKEN_PREFIX = "token";
  function useCacheToken(theme, tokens, option) {
    const {
      cache: {
        instanceId
      },
      container,
      hashPriority
    } = React.useContext(StyleContext);
    const {
      salt = "",
      override = EMPTY_OVERRIDE,
      formatToken: formatToken2,
      getComputedToken: compute,
      cssVar,
      nonce
    } = option;
    const mergedToken = memoResult(() => Object.assign({}, ...tokens), tokens);
    const tokenStr = flattenToken(mergedToken);
    const overrideTokenStr = flattenToken(override);
    const cssVarStr = flattenToken(cssVar);
    const cachedToken = useGlobalCache(TOKEN_PREFIX, [salt, theme.id, tokenStr, overrideTokenStr, cssVarStr], () => {
      const mergedDerivativeToken = compute ? compute(mergedToken, override, theme) : getComputedToken$1(mergedToken, override, theme, formatToken2);
      const actualToken = {
        ...mergedDerivativeToken
      };
      const mergedSalt = `${salt}_${cssVar.prefix}`;
      const hashId = murmur2(mergedSalt);
      const hashCls = `${hashPrefix}-${hashId}`;
      actualToken._tokenKey = token2key(actualToken, mergedSalt);
      const [tokenWithCssVar, cssVarsStr] = transformToken(mergedDerivativeToken, cssVar.key, {
        prefix: cssVar.prefix,
        ignore: cssVar.ignore,
        unitless: cssVar.unitless,
        preserve: cssVar.preserve,
        hashPriority,
        hashCls: cssVar.hashed ? hashCls : void 0
      });
      tokenWithCssVar._hashId = hashId;
      recordCleanToken(cssVar.key);
      return [tokenWithCssVar, hashCls, actualToken, cssVarsStr, cssVar.key];
    }, ([, , , , themeKey]) => {
      cleanTokenStyle(themeKey, instanceId);
    }, ([, , , cssVarsStr, themeKey]) => {
      if (!cssVarsStr) {
        return;
      }
      let mergedCSSConfig = {
        mark: ATTR_MARK,
        prepend: "queue",
        attachTo: container,
        priority: -999
      };
      mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
      const style2 = updateCSS(cssVarsStr, murmur2(`css-var-${themeKey}`), mergedCSSConfig);
      style2[CSS_IN_JS_INSTANCE] = instanceId;
      style2.setAttribute(ATTR_TOKEN, themeKey);
    });
    return cachedToken;
  }
  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,
fillOpacity: 1,
    floodOpacity: 1,
    stopOpacity: 1,
    strokeDasharray: 1,
    strokeDashoffset: 1,
    strokeMiterlimit: 1,
    strokeOpacity: 1,
    strokeWidth: 1
  };
  var MS = "-ms-";
  var MOZ = "-moz-";
  var WEBKIT = "-webkit-";
  var COMMENT = "comm";
  var RULESET = "rule";
  var DECLARATION = "decl";
  var IMPORT = "@import";
  var NAMESPACE = "@namespace";
  var KEYFRAMES = "@keyframes";
  var LAYER = "@layer";
  var abs = Math.abs;
  var from = String.fromCharCode;
  var assign = Object.assign;
  function hash(value, length2) {
    return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
  }
  function trim(value) {
    return value.trim();
  }
  function match(value, pattern4) {
    return (value = pattern4.exec(value)) ? value[0] : value;
  }
  function replace(value, pattern4, replacement) {
    return value.replace(pattern4, replacement);
  }
  function indexof(value, search, position2) {
    return value.indexOf(search, position2);
  }
  function charat(value, index) {
    return value.charCodeAt(index) | 0;
  }
  function substr(value, begin, end) {
    return value.slice(begin, end);
  }
  function strlen(value) {
    return value.length;
  }
  function sizeof(value) {
    return value.length;
  }
  function append(value, array4) {
    return array4.push(value), value;
  }
  function combine(array4, callback) {
    return array4.map(callback).join("");
  }
  function filter(array4, pattern4) {
    return array4.filter(function(value) {
      return !match(value, pattern4);
    });
  }
  var line = 1;
  var column = 1;
  var length = 0;
  var position = 0;
  var character = 0;
  var characters = "";
  function node(value, root, parent, type4, props, children, length2, siblings) {
    return { value, root, parent, type: type4, props, children, line, column, length: length2, return: "", siblings };
  }
  function copy(root, props) {
    return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props);
  }
  function lift(root) {
    while (root.root)
      root = copy(root.root, { children: [root] });
    append(root, root.siblings);
  }
  function char() {
    return character;
  }
  function prev() {
    character = position > 0 ? charat(characters, --position) : 0;
    if (column--, character === 10)
      column = 1, line--;
    return character;
  }
  function next() {
    character = position < length ? charat(characters, position++) : 0;
    if (column++, character === 10)
      column = 1, line++;
    return character;
  }
  function peek() {
    return charat(characters, position);
  }
  function caret() {
    return position;
  }
  function slice(begin, end) {
    return substr(characters, begin, end);
  }
  function token(type4) {
    switch (type4) {
case 0:
      case 9:
      case 10:
      case 13:
      case 32:
        return 5;
case 33:
      case 43:
      case 44:
      case 47:
      case 62:
      case 64:
      case 126:
case 59:
      case 123:
      case 125:
        return 4;
case 58:
        return 3;
case 34:
      case 39:
      case 40:
      case 91:
        return 2;
case 41:
      case 93:
        return 1;
    }
    return 0;
  }
  function alloc(value) {
    return line = column = 1, length = strlen(characters = value), position = 0, [];
  }
  function dealloc(value) {
    return characters = "", value;
  }
  function delimit(type4) {
    return trim(slice(position - 1, delimiter(type4 === 91 ? type4 + 2 : type4 === 40 ? type4 + 1 : type4)));
  }
  function whitespace2(type4) {
    while (character = peek())
      if (character < 33)
        next();
      else
        break;
    return token(type4) > 2 || token(character) > 3 ? "" : " ";
  }
  function escaping(index, count) {
    while (--count && next())
      if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
        break;
    return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
  }
  function delimiter(type4) {
    while (next())
      switch (character) {
case type4:
          return position;
case 34:
        case 39:
          if (type4 !== 34 && type4 !== 39)
            delimiter(character);
          break;
case 40:
          if (type4 === 41)
            delimiter(type4);
          break;
case 92:
          next();
          break;
      }
    return position;
  }
  function commenter(type4, index) {
    while (next())
      if (type4 + character === 47 + 10)
        break;
      else if (type4 + character === 42 + 42 && peek() === 47)
        break;
    return "/*" + slice(index, position - 1) + "*" + from(type4 === 47 ? type4 : next());
  }
  function identifier(index) {
    while (!token(peek()))
      next();
    return slice(index, position);
  }
  function compile(value) {
    return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
  }
  function parse(value, root, parent, rule, rules2, rulesets, pseudo, points, declarations) {
    var index = 0;
    var offset2 = 0;
    var length2 = pseudo;
    var atrule = 0;
    var property = 0;
    var previous = 0;
    var variable = 1;
    var scanning = 1;
    var ampersand = 1;
    var character2 = 0;
    var type4 = "";
    var props = rules2;
    var children = rulesets;
    var reference = rule;
    var characters2 = type4;
    while (scanning)
      switch (previous = character2, character2 = next()) {
case 40:
          if (previous != 108 && charat(characters2, length2 - 1) == 58) {
            if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1)
              ampersand = -1;
            break;
          }
case 34:
        case 39:
        case 91:
          characters2 += delimit(character2);
          break;
case 9:
        case 10:
        case 13:
        case 32:
          characters2 += whitespace2(previous);
          break;
case 92:
          characters2 += escaping(caret() - 1, 7);
          continue;
case 47:
          switch (peek()) {
            case 42:
            case 47:
              append(comment(commenter(next(), caret()), root, parent, declarations), declarations);
              if ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters2) && substr(characters2, -1, void 0) !== " ") characters2 += " ";
              break;
            default:
              characters2 += "/";
          }
          break;
case 123 * variable:
          points[index++] = strlen(characters2) * ampersand;
case 125 * variable:
        case 59:
        case 0:
          switch (character2) {
case 0:
            case 125:
              scanning = 0;
case 59 + offset2:
              if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
              if (property > 0 && (strlen(characters2) - length2 || variable === 0 && previous === 47))
                append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations);
              break;
case 59:
              characters2 += ";";
default:
              append(reference = ruleset(characters2, root, parent, index, offset2, rules2, points, type4, props = [], children = [], length2, rulesets), rulesets);
              if (character2 === 123)
                if (offset2 === 0)
                  parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
                else {
                  switch (atrule) {
case 99:
                      if (charat(characters2, 3) === 110) break;
case 108:
                      if (charat(characters2, 2) === 97) break;
                    default:
                      offset2 = 0;
case 100:
                    case 109:
                    case 115:
                  }
                  if (offset2) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules2, points, type4, rules2, props = [], length2, children), children), rules2, children, length2, points, rule ? props : children);
                  else parse(characters2, reference, reference, reference, [""], children, 0, points, children);
                }
          }
          index = offset2 = property = 0, variable = ampersand = 1, type4 = characters2 = "", length2 = pseudo;
          break;
case 58:
          length2 = 1 + strlen(characters2), property = previous;
        default:
          if (variable < 1) {
            if (character2 == 123)
              --variable;
            else if (character2 == 125 && variable++ == 0 && prev() == 125)
              continue;
          }
          switch (characters2 += from(character2), character2 * variable) {
case 38:
              ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1);
              break;
case 44:
              points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
              break;
case 64:
              if (peek() === 45)
                characters2 += delimit(next());
              atrule = peek(), offset2 = length2 = strlen(type4 = characters2 += identifier(caret())), character2++;
              break;
case 45:
              if (previous === 45 && strlen(characters2) == 2)
                variable = 0;
          }
      }
    return rulesets;
  }
  function ruleset(value, root, parent, index, offset2, rules2, points, type4, props, children, length2, siblings) {
    var post = offset2 - 1;
    var rule = offset2 === 0 ? rules2 : [""];
    var size = sizeof(rule);
    for (var i = 0, j = 0, k = 0; i < index; ++i)
      for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
        if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
          props[k++] = z;
    return node(value, root, parent, offset2 === 0 ? RULESET : type4, props, children, length2, siblings);
  }
  function comment(value, root, parent, siblings) {
    return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
  }
  function declaration(value, root, parent, length2, siblings) {
    return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings);
  }
  function prefix(value, length2, children) {
    switch (hash(value, length2)) {
case 5103:
        return WEBKIT + "print-" + value + value;
case 5737:
      case 4201:
      case 3177:
      case 3433:
      case 1641:
      case 4457:
      case 2921:
case 5572:
      case 6356:
      case 5844:
      case 3191:
      case 6645:
      case 3005:
case 4215:
      case 6389:
      case 5109:
      case 5365:
      case 5621:
      case 3829:
case 6391:
      case 5879:
      case 5623:
      case 6135:
      case 4599:
        return WEBKIT + value + value;
case 4855:
        return WEBKIT + value.replace("add", "source-over").replace("substract", "source-out").replace("intersect", "source-in").replace("exclude", "xor") + value;
case 4789:
        return MOZ + value + value;
case 5349:
      case 4246:
      case 4810:
      case 6968:
      case 2756:
        return WEBKIT + value + MOZ + value + MS + value + value;
case 5936:
        switch (charat(value, length2 + 11)) {
case 114:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
case 108:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
case 45:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
        }
case 6828:
      case 4268:
      case 2903:
        return WEBKIT + value + MS + value + value;
case 6165:
        return WEBKIT + value + MS + "flex-" + value + value;
case 5187:
        return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
case 5443:
        return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value;
case 4675:
        return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value;
case 5548:
        return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
case 5292:
        return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
case 6060:
        return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
case 4554:
        return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
case 6187:
        return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
case 5495:
      case 3959:
        return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
case 4968:
        return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /space-between/, "justify") + WEBKIT + value + value;
case 4200:
        if (!match(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value;
        break;
case 2592:
      case 3360:
        return MS + replace(value, "template-", "") + value;
case 4384:
      case 3616:
        if (children && children.some(function(element, index) {
          return length2 = index, match(element.props, /grid-\w+-end/);
        })) {
          return ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";";
        }
        return MS + replace(value, "-start", "") + value;
case 4896:
      case 4128:
        return children && children.some(function(element) {
          return match(element.props, /grid-\w+-start/);
        }) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value;
case 4095:
      case 3583:
      case 4068:
      case 2532:
        return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
case 8116:
      case 7059:
      case 5753:
      case 5535:
      case 5445:
      case 5701:
      case 4933:
      case 4677:
      case 5533:
      case 5789:
      case 5021:
      case 4765:
        if (strlen(value) - 1 - length2 > 6)
          switch (charat(value, length2 + 1)) {
case 109:
              if (charat(value, length2 + 4) !== 45)
                break;
case 102:
              return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
case 115:
              return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value;
          }
        break;
case 5152:
      case 5920:
        return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_, a, b, c, d, e2, f) {
          return MS + a + ":" + b + f + (c ? MS + a + "-span:" + (d ? e2 : +e2 - +b) + f : "") + value;
        });
case 4949:
        if (charat(value, length2 + 6) === 121)
          return replace(value, ":", ":" + WEBKIT) + value;
        break;
case 6444:
        switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
case 120:
            return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
case 100:
            return replace(value, ":", ":" + MS) + value;
        }
        break;
case 5719:
      case 2647:
      case 2135:
      case 3927:
      case 2391:
        return replace(value, "scroll-", "scroll-snap-") + value;
    }
    return value;
  }
  function serialize(children, callback) {
    var output = "";
    for (var i = 0; i < children.length; i++)
      output += callback(children[i], i, children, callback) || "";
    return output;
  }
  function stringify(element, index, children, callback) {
    switch (element.type) {
      case LAYER:
        if (element.children.length) break;
      case IMPORT:
      case NAMESPACE:
      case DECLARATION:
        return element.return = element.return || element.value;
      case COMMENT:
        return "";
      case KEYFRAMES:
        return element.return = element.value + "{" + serialize(element.children, callback) + "}";
      case RULESET:
        if (!strlen(element.value = element.props.join(","))) return "";
    }
    return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
  }
  function middleware(collection) {
    var length2 = sizeof(collection);
    return function(element, index, children, callback) {
      var output = "";
      for (var i = 0; i < length2; i++)
        output += collection[i](element, index, children, callback) || "";
      return output;
    };
  }
  function prefixer(element, index, children, callback) {
    if (element.length > -1) {
      if (!element.return)
        switch (element.type) {
          case DECLARATION:
            element.return = prefix(element.value, element.length, children);
            return;
          case KEYFRAMES:
            return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
          case RULESET:
            if (element.length)
              return combine(children = element.props, function(value) {
                switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {
case ":read-only":
                  case ":read-write":
                    lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] }));
                    lift(copy(element, { props: [value] }));
                    assign(element, { props: filter(children, callback) });
                    break;
case "::placeholder":
                    lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] }));
                    lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] }));
                    lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] }));
                    lift(copy(element, { props: [value] }));
                    assign(element, { props: filter(children, callback) });
                    break;
                }
                return "";
              });
        }
    }
  }
  const ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path";
  const CSS_FILE_STYLE = "_FILE_STYLE__";
  let cachePathMap;
  let fromCSSFile = true;
  function prepare() {
    if (!cachePathMap) {
      cachePathMap = {};
      if (canUseDom()) {
        const div = document.createElement("div");
        div.className = ATTR_CACHE_MAP;
        div.style.position = "fixed";
        div.style.visibility = "hidden";
        div.style.top = "-9999px";
        document.body.appendChild(div);
        let content = getComputedStyle(div).content || "";
        content = content.replace(/^"/, "").replace(/"$/, "");
        content.split(";").forEach((item) => {
          const [path, hash2] = item.split(":");
          cachePathMap[path] = hash2;
        });
        const inlineMapStyle = document.querySelector(`style[${ATTR_CACHE_MAP}]`);
        if (inlineMapStyle) {
          fromCSSFile = false;
          inlineMapStyle.parentNode?.removeChild(inlineMapStyle);
        }
        document.body.removeChild(div);
      }
    }
  }
  function existPath(path) {
    prepare();
    return !!cachePathMap[path];
  }
  function getStyleAndHash(path) {
    const hash2 = cachePathMap[path];
    let styleStr = null;
    if (hash2 && canUseDom()) {
      if (fromCSSFile) {
        styleStr = CSS_FILE_STYLE;
      } else {
        const style2 = document.querySelector(`style[${ATTR_MARK}="${cachePathMap[path]}"]`);
        if (style2) {
          styleStr = style2.innerHTML;
        } else {
          delete cachePathMap[path];
        }
      }
    }
    return [styleStr, hash2];
  }
  const SKIP_CHECK = "_skip_check_";
  const MULTI_VALUE = "_multi_value_";
  function normalizeStyle(styleStr, autoPrefix) {
    const serialized = autoPrefix ? serialize(compile(styleStr), middleware([prefixer, stringify])) : serialize(compile(styleStr), stringify);
    return serialized.replace(/\{%%%\:[^;];}/g, ";");
  }
  function isCompoundCSSProperty(value) {
    return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
  }
  function injectSelectorHash(key, hashId, hashPriority = "high") {
    if (!hashId) {
      return key;
    }
    const hashSelector = where({
      hashCls: hashId,
      hashPriority
    });
    const keys2 = key.split(",").map((k) => {
      const fullPath = k.trim().split(/\s+/);
      let firstPath = fullPath[0] || "";
      const htmlElement = firstPath.match(/^\w+/)?.[0] || "";
      firstPath = `${htmlElement}${hashSelector}${firstPath.slice(htmlElement.length)}`;
      return [firstPath, ...fullPath.slice(1)].join(" ");
    });
    return keys2.join(",");
  }
  const parseStyle = (interpolation, config = {}, {
    root,
    injectHash,
    parentSelectors
  } = {
    root: true,
    parentSelectors: []
  }) => {
    const {
      hashId,
      layer,
      path,
      hashPriority,
      transformers = [],
      linters = []
    } = config;
    let styleStr = "";
    let effectStyle = {};
    function parseKeyframes(keyframes) {
      const animationName = keyframes.getName(hashId);
      if (!effectStyle[animationName]) {
        const [parsedStr] = parseStyle(keyframes.style, config, {
          root: false,
          parentSelectors
        });
        effectStyle[animationName] = `@keyframes ${keyframes.getName(hashId)}${parsedStr}`;
      }
    }
    function flattenList(list, fullList = []) {
      list.forEach((item) => {
        if (Array.isArray(item)) {
          flattenList(item, fullList);
        } else if (item) {
          fullList.push(item);
        }
      });
      return fullList;
    }
    const flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]);
    flattenStyleList.forEach((originStyle) => {
      const style2 = typeof originStyle === "string" && !root ? {} : originStyle;
      if (typeof style2 === "string") {
        styleStr += `${style2}
`;
      } else if (style2._keyframe) {
        parseKeyframes(style2);
      } else {
        const mergedStyle = transformers.reduce((prev2, trans) => trans?.visit?.(prev2) || prev2, style2);
        Object.keys(mergedStyle).forEach((key) => {
          const value = mergedStyle[key];
          if (typeof value === "object" && value && (key !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) {
            let subInjectHash = false;
            let mergedKey = key.trim();
            let nextRoot = false;
            if ((root || injectHash) && hashId) {
              if (mergedKey.startsWith("@")) {
                subInjectHash = true;
              } else if (mergedKey === "&") {
                mergedKey = injectSelectorHash("", hashId, hashPriority);
              } else {
                mergedKey = injectSelectorHash(key, hashId, hashPriority);
              }
            } else if (root && !hashId && (mergedKey === "&" || mergedKey === "")) {
              mergedKey = "";
              nextRoot = true;
            }
            const [parsedStr, childEffectStyle] = parseStyle(value, config, {
              root: nextRoot,
              injectHash: subInjectHash,
              parentSelectors: [...parentSelectors, mergedKey]
            });
            effectStyle = {
              ...effectStyle,
              ...childEffectStyle
            };
            styleStr += `${mergedKey}${parsedStr}`;
          } else {
            let appendStyle = function(cssKey, cssValue) {
              const styleName = cssKey.replace(/[A-Z]/g, (match2) => `-${match2.toLowerCase()}`);
              let formatValue = cssValue;
              if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) {
                formatValue = `${formatValue}px`;
              }
              if (cssKey === "animationName" && cssValue?._keyframe) {
                parseKeyframes(cssValue);
                formatValue = cssValue.getName(hashId);
              }
              styleStr += `${styleName}:${formatValue};`;
            };
            const actualValue = value?.value ?? value;
            if (typeof value === "object" && value?.[MULTI_VALUE] && Array.isArray(actualValue)) {
              actualValue.forEach((item) => {
                appendStyle(key, item);
              });
            } else {
              if (isNonNullable(actualValue)) {
                appendStyle(key, actualValue);
              }
            }
          }
        });
      }
    });
    if (!root) {
      styleStr = `{${styleStr}}`;
    } else if (layer) {
      if (styleStr) {
        styleStr = `@layer ${layer.name} {${styleStr}}`;
      }
      if (layer.dependencies) {
        effectStyle[`@layer ${layer.name}`] = layer.dependencies.map((deps) => `@layer ${deps}, ${layer.name};`).join("\n");
      }
    }
    return [styleStr, effectStyle];
  };
  function uniqueHash(path, styleStr) {
    return murmur2(`${path.join("%")}${styleStr}`);
  }
  const STYLE_PREFIX = "style";
  function useStyleRegister(info, styleFn) {
    const {
      path,
      hashId,
      layer,
      nonce,
      clientOnly,
      order = 0
    } = info;
    const {
      mock,
      hashPriority,
      container,
      transformers,
      linters,
      cache,
      layer: enableLayer,
      autoPrefix
    } = React__namespace.useContext(StyleContext);
    const fullPath = [hashId || ""];
    if (enableLayer) {
      fullPath.push("layer");
    }
    fullPath.push(...path);
    let isMergedClientSide = isClientSide;
    useGlobalCache(
      STYLE_PREFIX,
      fullPath,
() => {
        const cachePath = fullPath.join("|");
        if (existPath(cachePath)) {
          const [inlineCacheStyleStr, styleHash] = getStyleAndHash(cachePath);
          if (inlineCacheStyleStr) {
            return [inlineCacheStyleStr, styleHash, {}, clientOnly, order];
          }
        }
        const styleObj = styleFn();
        const [parsedStyle, effectStyle] = parseStyle(styleObj, {
          hashId,
          hashPriority,
          layer: enableLayer ? layer : void 0,
          path: path.join("-"),
          transformers,
          linters
        });
        const styleStr = normalizeStyle(parsedStyle, autoPrefix || false);
        const styleId = uniqueHash(fullPath, styleStr);
        return [styleStr, styleId, effectStyle, clientOnly, order];
      },
(cacheValue, fromHMR) => {
        const [, styleId] = cacheValue;
        if (fromHMR && isClientSide) {
          removeCSS(styleId, {
            mark: ATTR_MARK,
            attachTo: container
          });
        }
      },
(cacheValue) => {
        const [styleStr, styleId, effectStyle, , priority] = cacheValue;
        if (isMergedClientSide && styleStr !== CSS_FILE_STYLE) {
          let mergedCSSConfig = {
            mark: ATTR_MARK,
            prepend: enableLayer ? false : "queue",
            attachTo: container,
            priority
          };
          mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
          const effectLayerKeys = [];
          const effectRestKeys = [];
          Object.keys(effectStyle).forEach((key) => {
            if (key.startsWith("@layer")) {
              effectLayerKeys.push(key);
            } else {
              effectRestKeys.push(key);
            }
          });
          effectLayerKeys.forEach((effectKey) => {
            updateCSS(normalizeStyle(effectStyle[effectKey], autoPrefix || false), `_layer-${effectKey}`, {
              ...mergedCSSConfig,
              prepend: true
            });
          });
          const style2 = updateCSS(styleStr, styleId, mergedCSSConfig);
          style2[CSS_IN_JS_INSTANCE] = cache.instanceId;
          effectRestKeys.forEach((effectKey) => {
            updateCSS(normalizeStyle(effectStyle[effectKey], autoPrefix || false), `_effect-${effectKey}`, mergedCSSConfig);
          });
        }
      }
    );
  }
  const CSS_VAR_PREFIX = "cssVar";
  const useCSSVarRegister = (config, fn) => {
    const {
      key,
      prefix: prefix2,
      unitless: unitless2,
      ignore: ignore2,
      token: token2,
      hashId,
      scope,
      nonce
    } = config;
    const {
      cache: {
        instanceId
      },
      container,
      hashPriority
    } = React.useContext(StyleContext);
    const {
      _tokenKey: tokenKey
    } = token2;
    const scopeKey = Array.isArray(scope) ? scope.join("@@") : scope;
    const stylePath = [...config.path, key, scopeKey, tokenKey];
    const cache = useGlobalCache(CSS_VAR_PREFIX, stylePath, () => {
      const originToken = fn();
      const [mergedToken, cssVarsStr] = transformToken(originToken, key, {
        prefix: prefix2,
        unitless: unitless2,
        ignore: ignore2,
        scope,
        hashPriority,
        hashCls: hashId
      });
      const styleId = uniqueHash(stylePath, cssVarsStr);
      return [mergedToken, cssVarsStr, styleId, key];
    }, ([, , styleId]) => {
      if (isClientSide) {
        removeCSS(styleId, {
          mark: ATTR_MARK,
          attachTo: container
        });
      }
    }, ([, cssVarsStr, styleId]) => {
      if (!cssVarsStr) {
        return;
      }
      let mergedCSSConfig = {
        mark: ATTR_MARK,
        prepend: "queue",
        attachTo: container,
        priority: -999
      };
      mergedCSSConfig = injectCSPNonce(mergedCSSConfig, nonce);
      const style2 = updateCSS(cssVarsStr, styleId, mergedCSSConfig);
      style2[CSS_IN_JS_INSTANCE] = instanceId;
      style2.setAttribute(ATTR_TOKEN, key);
    });
    return cache;
  };
  class Keyframe {
    name;
    style;
    constructor(name, style2) {
      this.name = name;
      this.style = style2;
    }
    getName(hashId = "") {
      return hashId ? `${hashId}-${this.name}` : this.name;
    }
    _keyframe = true;
  }
  function noSplit(list) {
    list.notSplit = true;
    return list;
  }
  ({
borderBlock: noSplit(["borderTop", "borderBottom"]),
    borderBlockStart: noSplit(["borderTop"]),
    borderBlockEnd: noSplit(["borderBottom"]),
    borderInline: noSplit(["borderLeft", "borderRight"]),
    borderInlineStart: noSplit(["borderLeft"]),
    borderInlineEnd: noSplit(["borderRight"])
  });
  const defaultPrefixCls = "ant";
  const defaultIconPrefixCls = "anticon";
  const defaultGetPrefixCls = (suffixCls, customizePrefixCls) => {
    if (customizePrefixCls) {
      return customizePrefixCls;
    }
    return suffixCls ? `${defaultPrefixCls}-${suffixCls}` : defaultPrefixCls;
  };
  const ConfigContext = React__namespace.createContext({
getPrefixCls: defaultGetPrefixCls,
    iconPrefixCls: defaultIconPrefixCls
  });
  const {
    Consumer: ConfigConsumer
  } = ConfigContext;
  const EMPTY_OBJECT = {};
  function useComponentConfig(propName) {
    const context = React__namespace.useContext(ConfigContext);
    const {
      getPrefixCls,
      direction,
      getPopupContainer,
      renderEmpty
    } = context;
    const propValue = context[propName];
    return {
      classNames: EMPTY_OBJECT,
      styles: EMPTY_OBJECT,
      ...propValue,
      getPrefixCls,
      direction,
      getPopupContainer,
      renderEmpty
    };
  }
  const version = "6.3.5";
  const defaultPresetColors = {
    blue: "#1677FF",
    purple: "#722ED1",
    cyan: "#13C2C2",
    green: "#52C41A",
    magenta: "#EB2F96",
pink: "#EB2F96",
    red: "#F5222D",
    orange: "#FA8C16",
    yellow: "#FADB14",
    volcano: "#FA541C",
    geekblue: "#2F54EB",
    gold: "#FAAD14",
    lime: "#A0D911"
  };
  const seedToken = {
...defaultPresetColors,
colorPrimary: "#1677ff",
    colorSuccess: "#52c41a",
    colorWarning: "#faad14",
    colorError: "#ff4d4f",
    colorInfo: "#1677ff",
    colorLink: "",
    colorTextBase: "",
    colorBgBase: "",
fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
    fontFamilyCode: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
    fontSize: 14,
lineWidth: 1,
    lineType: "solid",
motionUnit: 0.1,
    motionBase: 0,
    motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
    motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
    motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
    motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
    motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
    motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
    motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
    motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
borderRadius: 6,
sizeUnit: 4,
    sizeStep: 4,
    sizePopupArrow: 16,
controlHeight: 32,
zIndexBase: 0,
    zIndexPopupBase: 1e3,
opacityImage: 1,
wireframe: false,
motion: true
  };
  const PresetColors = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
  function genColorMapToken(seed, {
    generateColorPalettes: generateColorPalettes2,
    generateNeutralColorPalettes: generateNeutralColorPalettes2
  }) {
    const {
      colorSuccess: colorSuccessBase,
      colorWarning: colorWarningBase,
      colorError: colorErrorBase,
      colorInfo: colorInfoBase,
      colorPrimary: colorPrimaryBase,
      colorBgBase,
      colorTextBase
    } = seed;
    const primaryColors = generateColorPalettes2(colorPrimaryBase);
    const successColors = generateColorPalettes2(colorSuccessBase);
    const warningColors = generateColorPalettes2(colorWarningBase);
    const errorColors = generateColorPalettes2(colorErrorBase);
    const infoColors = generateColorPalettes2(colorInfoBase);
    const neutralColors = generateNeutralColorPalettes2(colorBgBase, colorTextBase);
    const colorLink = seed.colorLink || seed.colorInfo;
    const linkColors = generateColorPalettes2(colorLink);
    const colorErrorBgFilledHover = new FastColor(errorColors[1]).mix(new FastColor(errorColors[3]), 50).toHexString();
    const presetColorTokens = {};
    PresetColors.forEach((colorKey) => {
      const colorBase = seed[colorKey];
      if (colorBase) {
        const colorPalette = generateColorPalettes2(colorBase);
        presetColorTokens[`${colorKey}Hover`] = colorPalette[5];
        presetColorTokens[`${colorKey}Active`] = colorPalette[7];
      }
    });
    return {
      ...neutralColors,
      colorPrimaryBg: primaryColors[1],
      colorPrimaryBgHover: primaryColors[2],
      colorPrimaryBorder: primaryColors[3],
      colorPrimaryBorderHover: primaryColors[4],
      colorPrimaryHover: primaryColors[5],
      colorPrimary: primaryColors[6],
      colorPrimaryActive: primaryColors[7],
      colorPrimaryTextHover: primaryColors[8],
      colorPrimaryText: primaryColors[9],
      colorPrimaryTextActive: primaryColors[10],
      colorSuccessBg: successColors[1],
      colorSuccessBgHover: successColors[2],
      colorSuccessBorder: successColors[3],
      colorSuccessBorderHover: successColors[4],
      colorSuccessHover: successColors[4],
      colorSuccess: successColors[6],
      colorSuccessActive: successColors[7],
      colorSuccessTextHover: successColors[8],
      colorSuccessText: successColors[9],
      colorSuccessTextActive: successColors[10],
      colorErrorBg: errorColors[1],
      colorErrorBgHover: errorColors[2],
      colorErrorBgFilledHover,
      colorErrorBgActive: errorColors[3],
      colorErrorBorder: errorColors[3],
      colorErrorBorderHover: errorColors[4],
      colorErrorHover: errorColors[5],
      colorError: errorColors[6],
      colorErrorActive: errorColors[7],
      colorErrorTextHover: errorColors[8],
      colorErrorText: errorColors[9],
      colorErrorTextActive: errorColors[10],
      colorWarningBg: warningColors[1],
      colorWarningBgHover: warningColors[2],
      colorWarningBorder: warningColors[3],
      colorWarningBorderHover: warningColors[4],
      colorWarningHover: warningColors[4],
      colorWarning: warningColors[6],
      colorWarningActive: warningColors[7],
      colorWarningTextHover: warningColors[8],
      colorWarningText: warningColors[9],
      colorWarningTextActive: warningColors[10],
      colorInfoBg: infoColors[1],
      colorInfoBgHover: infoColors[2],
      colorInfoBorder: infoColors[3],
      colorInfoBorderHover: infoColors[4],
      colorInfoHover: infoColors[4],
      colorInfo: infoColors[6],
      colorInfoActive: infoColors[7],
      colorInfoTextHover: infoColors[8],
      colorInfoText: infoColors[9],
      colorInfoTextActive: infoColors[10],
      colorLinkHover: linkColors[4],
      colorLink: linkColors[6],
      colorLinkActive: linkColors[7],
      ...presetColorTokens,
      colorBgMask: new FastColor("#000").setA(0.45).toRgbString(),
      colorWhite: "#fff"
    };
  }
  const genRadius = (radiusBase) => {
    let radiusLG = radiusBase;
    let radiusSM = radiusBase;
    let radiusXS = radiusBase;
    let radiusOuter = radiusBase;
    if (radiusBase < 6 && radiusBase >= 5) {
      radiusLG = radiusBase + 1;
    } else if (radiusBase < 16 && radiusBase >= 6) {
      radiusLG = radiusBase + 2;
    } else if (radiusBase >= 16) {
      radiusLG = 16;
    }
    if (radiusBase < 7 && radiusBase >= 5) {
      radiusSM = 4;
    } else if (radiusBase < 8 && radiusBase >= 7) {
      radiusSM = 5;
    } else if (radiusBase < 14 && radiusBase >= 8) {
      radiusSM = 6;
    } else if (radiusBase < 16 && radiusBase >= 14) {
      radiusSM = 7;
    } else if (radiusBase >= 16) {
      radiusSM = 8;
    }
    if (radiusBase < 6 && radiusBase >= 2) {
      radiusXS = 1;
    } else if (radiusBase >= 6) {
      radiusXS = 2;
    }
    if (radiusBase > 4 && radiusBase < 8) {
      radiusOuter = 4;
    } else if (radiusBase >= 8) {
      radiusOuter = 6;
    }
    return {
      borderRadius: radiusBase,
      borderRadiusXS: radiusXS,
      borderRadiusSM: radiusSM,
      borderRadiusLG: radiusLG,
      borderRadiusOuter: radiusOuter
    };
  };
  function genCommonMapToken(token2) {
    const {
      motionUnit,
      motionBase,
      borderRadius,
      lineWidth
    } = token2;
    return {
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
      motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
      motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
lineWidthBold: lineWidth + 1,
...genRadius(borderRadius)
    };
  }
  const genControlHeight = (token2) => {
    const {
      controlHeight
    } = token2;
    return {
      controlHeightSM: controlHeight * 0.75,
      controlHeightXS: controlHeight * 0.5,
      controlHeightLG: controlHeight * 1.25
    };
  };
  function getLineHeight(fontSize) {
    return (fontSize + 8) / fontSize;
  }
  function getFontSizes(base) {
    const fontSizes = Array.from({
      length: 10
    }).map((_, index) => {
      const i = index - 1;
      const baseSize = base * Math.E ** (i / 5);
      const intSize = index > 1 ? Math.floor(baseSize) : Math.ceil(baseSize);
      return Math.floor(intSize / 2) * 2;
    });
    fontSizes[1] = base;
    return fontSizes.map((size) => ({
      size,
      lineHeight: getLineHeight(size)
    }));
  }
  const genFontMapToken = (fontSize) => {
    const fontSizePairs = getFontSizes(fontSize);
    const fontSizes = fontSizePairs.map((pair) => pair.size);
    const lineHeights = fontSizePairs.map((pair) => pair.lineHeight);
    const fontSizeMD = fontSizes[1];
    const fontSizeSM = fontSizes[0];
    const fontSizeLG = fontSizes[2];
    const lineHeight = lineHeights[1];
    const lineHeightSM = lineHeights[0];
    const lineHeightLG = lineHeights[2];
    return {
      fontSizeSM,
      fontSize: fontSizeMD,
      fontSizeLG,
      fontSizeXL: fontSizes[3],
      fontSizeHeading1: fontSizes[6],
      fontSizeHeading2: fontSizes[5],
      fontSizeHeading3: fontSizes[4],
      fontSizeHeading4: fontSizes[3],
      fontSizeHeading5: fontSizes[2],
      lineHeight,
      lineHeightLG,
      lineHeightSM,
      fontHeight: Math.round(lineHeight * fontSizeMD),
      fontHeightLG: Math.round(lineHeightLG * fontSizeLG),
      fontHeightSM: Math.round(lineHeightSM * fontSizeSM),
      lineHeightHeading1: lineHeights[6],
      lineHeightHeading2: lineHeights[5],
      lineHeightHeading3: lineHeights[4],
      lineHeightHeading4: lineHeights[3],
      lineHeightHeading5: lineHeights[2]
    };
  };
  function genSizeMapToken(token2) {
    const {
      sizeUnit,
      sizeStep
    } = token2;
    return {
      sizeXXL: sizeUnit * (sizeStep + 8),
sizeXL: sizeUnit * (sizeStep + 4),
sizeLG: sizeUnit * (sizeStep + 2),
sizeMD: sizeUnit * (sizeStep + 1),
sizeMS: sizeUnit * sizeStep,
size: sizeUnit * sizeStep,
sizeSM: sizeUnit * (sizeStep - 1),
sizeXS: sizeUnit * (sizeStep - 2),
sizeXXS: sizeUnit * (sizeStep - 3)
};
  }
  const getAlphaColor$1 = (baseColor, alpha) => new FastColor(baseColor).setA(alpha).toRgbString();
  const getSolidColor = (baseColor, brightness) => {
    const instance = new FastColor(baseColor);
    return instance.darken(brightness).toHexString();
  };
  const generateColorPalettes = (baseColor) => {
    const colors = generate$1(baseColor);
    return {
      1: colors[0],
      2: colors[1],
      3: colors[2],
      4: colors[3],
      5: colors[4],
      6: colors[5],
      7: colors[6],
      8: colors[4],
      9: colors[5],
      10: colors[6]
    };
  };
  const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
    const colorBgBase = bgBaseColor || "#fff";
    const colorTextBase = textBaseColor || "#000";
    return {
      colorBgBase,
      colorTextBase,
      colorText: getAlphaColor$1(colorTextBase, 0.88),
      colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65),
      colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45),
      colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25),
      colorFill: getAlphaColor$1(colorTextBase, 0.15),
      colorFillSecondary: getAlphaColor$1(colorTextBase, 0.06),
      colorFillTertiary: getAlphaColor$1(colorTextBase, 0.04),
      colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.02),
      colorBgSolid: getAlphaColor$1(colorTextBase, 1),
      colorBgSolidHover: getAlphaColor$1(colorTextBase, 0.75),
      colorBgSolidActive: getAlphaColor$1(colorTextBase, 0.95),
      colorBgLayout: getSolidColor(colorBgBase, 4),
      colorBgContainer: getSolidColor(colorBgBase, 0),
      colorBgElevated: getSolidColor(colorBgBase, 0),
      colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.85),
      colorBgBlur: "transparent",
      colorBorder: getSolidColor(colorBgBase, 15),
      colorBorderDisabled: getSolidColor(colorBgBase, 15),
      colorBorderSecondary: getSolidColor(colorBgBase, 6)
    };
  };
  function derivative(token2) {
    presetPrimaryColors.pink = presetPrimaryColors.magenta;
    presetPalettes.pink = presetPalettes.magenta;
    const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
      const colors = token2[colorKey] === presetPrimaryColors[colorKey] ? presetPalettes[colorKey] : generate$1(token2[colorKey]);
      return Array.from({
        length: 10
      }, () => 1).reduce((prev2, _, i) => {
        prev2[`${colorKey}-${i + 1}`] = colors[i];
        prev2[`${colorKey}${i + 1}`] = colors[i];
        return prev2;
      }, {});
    }).reduce((prev2, cur) => {
      prev2 = {
        ...prev2,
        ...cur
      };
      return prev2;
    }, {});
    return {
      ...token2,
      ...colorPalettes,
...genColorMapToken(token2, {
        generateColorPalettes,
        generateNeutralColorPalettes
      }),
...genFontMapToken(token2.fontSize),
...genSizeMapToken(token2),
...genControlHeight(token2),
...genCommonMapToken(token2)
    };
  }
  const defaultTheme = createTheme(derivative);
  const defaultConfig = {
    token: seedToken,
    override: {
      override: seedToken
    },
    hashed: true
  };
  const DesignTokenContext = React.createContext(defaultConfig);
  function isStableColor(color) {
    return color >= 0 && color <= 255;
  }
  function getAlphaColor(frontColor, backgroundColor) {
    const {
      r: fR,
      g: fG,
      b: fB,
      a: originAlpha
    } = new FastColor(frontColor).toRgb();
    if (originAlpha < 1) {
      return frontColor;
    }
    const {
      r: bR,
      g: bG,
      b: bB
    } = new FastColor(backgroundColor).toRgb();
    for (let fA = 0.01; fA <= 1; fA += 0.01) {
      const r2 = Math.round((fR - bR * (1 - fA)) / fA);
      const g = Math.round((fG - bG * (1 - fA)) / fA);
      const b = Math.round((fB - bB * (1 - fA)) / fA);
      if (isStableColor(r2) && isStableColor(g) && isStableColor(b)) {
        return new FastColor({
          r: r2,
          g,
          b,
          a: Math.round(fA * 100) / 100
        }).toRgbString();
      }
    }
    return new FastColor({
      r: fR,
      g: fG,
      b: fB,
      a: 1
    }).toRgbString();
  }
  function formatToken(derivativeToken) {
    const {
      override,
      ...restToken
    } = derivativeToken;
    const overrideTokens = {
      ...override
    };
    Object.keys(seedToken).forEach((token2) => {
      delete overrideTokens[token2];
    });
    const mergedToken = {
      ...restToken,
      ...overrideTokens
    };
    const screenXS = 480;
    const screenSM = 576;
    const screenMD = 768;
    const screenLG = 992;
    const screenXL = 1200;
    const screenXXL = 1600;
    const screenXXXL = 1920;
    if (mergedToken.motion === false) {
      const fastDuration = "0s";
      mergedToken.motionDurationFast = fastDuration;
      mergedToken.motionDurationMid = fastDuration;
      mergedToken.motionDurationSlow = fastDuration;
    }
    const aliasToken = {
      ...mergedToken,
colorFillContent: mergedToken.colorFillSecondary,
      colorFillContentHover: mergedToken.colorFill,
      colorFillAlter: mergedToken.colorFillQuaternary,
      colorBgContainerDisabled: mergedToken.colorFillTertiary,
colorBorderBg: mergedToken.colorBgContainer,
      colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
colorTextPlaceholder: mergedToken.colorTextQuaternary,
      colorTextDisabled: mergedToken.colorTextQuaternary,
      colorTextHeading: mergedToken.colorText,
      colorTextLabel: mergedToken.colorTextSecondary,
      colorTextDescription: mergedToken.colorTextTertiary,
      colorTextLightSolid: mergedToken.colorWhite,
      colorHighlight: mergedToken.colorError,
      colorBgTextHover: mergedToken.colorFillSecondary,
      colorBgTextActive: mergedToken.colorFill,
      colorIcon: mergedToken.colorTextTertiary,
      colorIconHover: mergedToken.colorText,
      colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
      colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
fontSizeIcon: mergedToken.fontSizeSM,
lineWidthFocus: mergedToken.lineWidth * 3,
lineWidth: mergedToken.lineWidth,
      controlOutlineWidth: mergedToken.lineWidth * 2,
controlInteractiveSize: mergedToken.controlHeight / 2,
      controlItemBgHover: mergedToken.colorFillTertiary,
      controlItemBgActive: mergedToken.colorPrimaryBg,
      controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
      controlItemBgActiveDisabled: mergedToken.colorFill,
      controlTmpOutline: mergedToken.colorFillQuaternary,
      controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
      lineType: mergedToken.lineType,
      borderRadius: mergedToken.borderRadius,
      borderRadiusXS: mergedToken.borderRadiusXS,
      borderRadiusSM: mergedToken.borderRadiusSM,
      borderRadiusLG: mergedToken.borderRadiusLG,
      fontWeightStrong: 600,
      opacityLoading: 0.65,
      linkDecoration: "none",
      linkHoverDecoration: "none",
      linkFocusDecoration: "none",
      controlPaddingHorizontal: 12,
      controlPaddingHorizontalSM: 8,
      paddingXXS: mergedToken.sizeXXS,
      paddingXS: mergedToken.sizeXS,
      paddingSM: mergedToken.sizeSM,
      padding: mergedToken.size,
      paddingMD: mergedToken.sizeMD,
      paddingLG: mergedToken.sizeLG,
      paddingXL: mergedToken.sizeXL,
      paddingContentHorizontalLG: mergedToken.sizeLG,
      paddingContentVerticalLG: mergedToken.sizeMS,
      paddingContentHorizontal: mergedToken.sizeMS,
      paddingContentVertical: mergedToken.sizeSM,
      paddingContentHorizontalSM: mergedToken.size,
      paddingContentVerticalSM: mergedToken.sizeXS,
      marginXXS: mergedToken.sizeXXS,
      marginXS: mergedToken.sizeXS,
      marginSM: mergedToken.sizeSM,
      margin: mergedToken.size,
      marginMD: mergedToken.sizeMD,
      marginLG: mergedToken.sizeLG,
      marginXL: mergedToken.sizeXL,
      marginXXL: mergedToken.sizeXXL,
      boxShadow: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowSecondary: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowTertiary: `
      0 1px 2px 0 rgba(0, 0, 0, 0.03),
      0 1px 6px -1px rgba(0, 0, 0, 0.02),
      0 2px 4px 0 rgba(0, 0, 0, 0.02)
    `,
      screenXS,
      screenXSMin: screenXS,
      screenXSMax: screenSM - 1,
      screenSM,
      screenSMMin: screenSM,
      screenSMMax: screenMD - 1,
      screenMD,
      screenMDMin: screenMD,
      screenMDMax: screenLG - 1,
      screenLG,
      screenLGMin: screenLG,
      screenLGMax: screenXL - 1,
      screenXL,
      screenXLMin: screenXL,
      screenXLMax: screenXXL - 1,
      screenXXL,
      screenXXLMin: screenXXL,
      screenXXLMax: screenXXXL - 1,
      screenXXXL,
      screenXXXLMin: screenXXXL,
      boxShadowPopoverArrow: "2px 2px 5px rgba(0, 0, 0, 0.05)",
      boxShadowCard: `
      0 1px 2px -2px ${new FastColor("rgba(0, 0, 0, 0.16)").toRgbString()},
      0 3px 6px 0 ${new FastColor("rgba(0, 0, 0, 0.12)").toRgbString()},
      0 5px 12px 4px ${new FastColor("rgba(0, 0, 0, 0.09)").toRgbString()}
    `,
      boxShadowDrawerRight: `
      -6px 0 16px 0 rgba(0, 0, 0, 0.08),
      -3px 0 6px -4px rgba(0, 0, 0, 0.12),
      -9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerLeft: `
      6px 0 16px 0 rgba(0, 0, 0, 0.08),
      3px 0 6px -4px rgba(0, 0, 0, 0.12),
      9px 0 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerUp: `
      0 6px 16px 0 rgba(0, 0, 0, 0.08),
      0 3px 6px -4px rgba(0, 0, 0, 0.12),
      0 9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowDrawerDown: `
      0 -6px 16px 0 rgba(0, 0, 0, 0.08),
      0 -3px 6px -4px rgba(0, 0, 0, 0.12),
      0 -9px 28px 8px rgba(0, 0, 0, 0.05)
    `,
      boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
      boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)",
...overrideTokens
    };
    return aliasToken;
  }
  const unitless = {
    lineHeight: true,
    lineHeightSM: true,
    lineHeightLG: true,
    lineHeightHeading1: true,
    lineHeightHeading2: true,
    lineHeightHeading3: true,
    lineHeightHeading4: true,
    lineHeightHeading5: true,
    opacityLoading: true,
    fontWeightStrong: true,
    zIndexPopupBase: true,
    zIndexBase: true,
    opacityImage: true
  };
  const ignore = {
    motionBase: true,
    motionUnit: true
  };
  const preserve = {
    screenXS: true,
    screenXSMin: true,
    screenXSMax: true,
    screenSM: true,
    screenSMMin: true,
    screenSMMax: true,
    screenMD: true,
    screenMDMin: true,
    screenMDMax: true,
    screenLG: true,
    screenLGMin: true,
    screenLGMax: true,
    screenXL: true,
    screenXLMin: true,
    screenXLMax: true,
    screenXXL: true,
    screenXXLMin: true,
    screenXXLMax: true,
    screenXXXL: true,
    screenXXXLMin: true
  };
  const getComputedToken = (originToken, overrideToken, theme) => {
    const derivativeToken = theme.getDerivativeToken(originToken);
    const {
      override,
      ...components
    } = overrideToken;
    let mergedDerivativeToken = {
      ...derivativeToken,
      override
    };
    mergedDerivativeToken = formatToken(mergedDerivativeToken);
    if (components) {
      Object.entries(components).forEach(([key, value]) => {
        const {
          theme: componentTheme,
          ...componentTokens
        } = value;
        let mergedComponentToken = componentTokens;
        if (componentTheme) {
          mergedComponentToken = getComputedToken({
            ...mergedDerivativeToken,
            ...componentTokens
          }, {
            override: componentTokens
          }, componentTheme);
        }
        mergedDerivativeToken[key] = mergedComponentToken;
      });
    }
    return mergedDerivativeToken;
  };
  function useToken() {
    const {
      token: rootDesignToken,
      hashed,
      theme,
      override,
      cssVar: ctxCssVar,
      zeroRuntime
    } = React.useContext(DesignTokenContext);
    const {
      csp
    } = React.useContext(ConfigContext);
    const cssVar = {
      prefix: ctxCssVar?.prefix ?? "ant",
      key: ctxCssVar?.key ?? "css-var-root"
    };
    const salt = `${version}-${hashed || ""}`;
    const mergedTheme = theme || defaultTheme;
    const [token2, hashId, realToken] = useCacheToken(mergedTheme, [seedToken, rootDesignToken], {
      salt,
      override,
      getComputedToken,
      cssVar: {
        ...cssVar,
        unitless,
        ignore,
        preserve
      },
      nonce: csp?.nonce
    });
    return [mergedTheme, realToken, hashed ? hashId : "", token2, cssVar, !!zeroRuntime];
  }
  const ZIndexContext = React.createContext(void 0);
  const CONTAINER_OFFSET = 100;
  const CONTAINER_OFFSET_MAX_COUNT = 10;
  const CONTAINER_MAX_OFFSET = CONTAINER_OFFSET * CONTAINER_OFFSET_MAX_COUNT;
  const containerBaseZIndexOffset = {
    Modal: CONTAINER_OFFSET,
    Drawer: CONTAINER_OFFSET,
    Popover: CONTAINER_OFFSET,
    Popconfirm: CONTAINER_OFFSET,
    Tooltip: CONTAINER_OFFSET,
    Tour: CONTAINER_OFFSET,
    FloatButton: CONTAINER_OFFSET
  };
  const consumerBaseZIndexOffset = {
    SelectLike: 50,
    Dropdown: 50,
    DatePicker: 50,
    Menu: 50,
    ImagePreview: 1
  };
  const isContainerType = (type4) => {
    return type4 in containerBaseZIndexOffset;
  };
  const useZIndex = (componentType, customZIndex) => {
    const [, token2] = useToken();
    const parentZIndex = React.useContext(ZIndexContext);
    const isContainer = isContainerType(componentType);
    let result;
    if (customZIndex !== void 0) {
      result = [customZIndex, customZIndex];
    } else {
      let zIndex = parentZIndex ?? 0;
      if (isContainer) {
        zIndex +=
(parentZIndex ? 0 : token2.zIndexPopupBase) +
containerBaseZIndexOffset[componentType];
      } else {
        zIndex += consumerBaseZIndexOffset[componentType];
      }
      result = [parentZIndex === void 0 ? customZIndex : zIndex, zIndex];
    }
    return result;
  };
  const DisabledContext = React__namespace.createContext(false);
  const DisabledContextProvider = ({
    children,
    disabled
  }) => {
    const originDisabled = React__namespace.useContext(DisabledContext);
    return React__namespace.createElement(DisabledContext.Provider, {
      value: disabled ?? originDisabled
    }, children);
  };
  const useCSSVarCls = (prefixCls) => `${prefixCls}-css-var`;
  const SizeContext = React__namespace.createContext(void 0);
  const SizeContextProvider = ({
    children,
    size
  }) => {
    const originSize = React__namespace.useContext(SizeContext);
    return React__namespace.createElement(SizeContext.Provider, {
      value: size || originSize
    }, children);
  };
  const useSize = (customSize) => {
    const size = React.useContext(SizeContext);
    const mergedSize = React.useMemo(() => {
      if (!customSize) {
        return size;
      }
      if (typeof customSize === "string") {
        return customSize ?? size;
      }
      if (typeof customSize === "function") {
        return customSize(size);
      }
      return size;
    }, [customSize, size]);
    return mergedSize;
  };
  const FormContext = React__namespace.createContext({
    labelAlign: "right",
    layout: "horizontal",
    itemRef: () => {
    }
  });
  const NoStyleItemContext = React__namespace.createContext(null);
  const FormProvider = (props) => {
    const providerProps = omit(props, ["prefixCls"]);
    return React__namespace.createElement(FormProvider$1, {
      ...providerProps
    });
  };
  const FormItemPrefixContext = React__namespace.createContext({
    prefixCls: ""
  });
  const FormItemInputContext = React__namespace.createContext({});
  const NoFormStyle = ({
    children,
    status,
    override
  }) => {
    const formItemInputContext = React__namespace.useContext(FormItemInputContext);
    const newFormItemInputContext = React__namespace.useMemo(() => {
      const newContext = {
        ...formItemInputContext
      };
      if (override) {
        delete newContext.isFormItemInput;
      }
      if (status) {
        delete newContext.status;
        delete newContext.hasFeedback;
        delete newContext.feedbackIcon;
      }
      return newContext;
    }, [status, override, formItemInputContext]);
    return React__namespace.createElement(FormItemInputContext.Provider, {
      value: newFormItemInputContext
    }, children);
  };
  const VariantContext = React__namespace.createContext(void 0);
  function isDOM(node2) {
    return node2 instanceof HTMLElement || node2 instanceof SVGElement;
  }
  function getDOM(node2) {
    if (node2 && typeof node2 === "object" && isDOM(node2.nativeElement)) {
      return node2.nativeElement;
    }
    if (isDOM(node2)) {
      return node2;
    }
    return null;
  }
  const t = (t2) => "object" == typeof t2 && null != t2 && 1 === t2.nodeType, e$1 = (t2, e2) => (!e2 || "hidden" !== t2) && ("visible" !== t2 && "clip" !== t2), n = (t2, n2) => {
    if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
      const o2 = getComputedStyle(t2, null);
      return e$1(o2.overflowY, n2) || e$1(o2.overflowX, n2) || ((t3) => {
        const e2 = ((t4) => {
          if (!t4.ownerDocument || !t4.ownerDocument.defaultView) return null;
          try {
            return t4.ownerDocument.defaultView.frameElement;
          } catch (t5) {
            return null;
          }
        })(t3);
        return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth);
      })(t2);
    }
    return false;
  }, o$1 = (t2, e2, n2, o2, l2, r2, i, s) => r2 < t2 && i > e2 || r2 > t2 && i < e2 ? 0 : r2 <= t2 && s <= n2 || i >= e2 && s >= n2 ? r2 - t2 - o2 : i > e2 && s < n2 || r2 < t2 && s > n2 ? i - e2 + l2 : 0, l = (t2) => {
    const e2 = t2.parentElement;
    return null == e2 ? t2.getRootNode().host || null : e2;
  }, r = (e2, r2) => {
    var i, s, d, h;
    if ("undefined" == typeof document) return [];
    const { scrollMode: c, block: f, inline: u, boundary: a, skipOverflowHiddenElements: g } = r2, p = "function" == typeof a ? a : (t2) => t2 !== a;
    if (!t(e2)) throw new TypeError("Invalid target");
    const m = document.scrollingElement || document.documentElement, w = [];
    let W = e2;
    for (; t(W) && p(W); ) {
      if (W = l(W), W === m) {
        w.push(W);
        break;
      }
      null != W && W === document.body && n(W) && !n(document.documentElement) || null != W && n(W, g) && w.push(W);
    }
    const b = null != (s = null == (i = window.visualViewport) ? void 0 : i.width) ? s : innerWidth, H = null != (h = null == (d = window.visualViewport) ? void 0 : d.height) ? h : innerHeight, { scrollX: y, scrollY: M } = window, { height: v, width: E, top: x, right: C, bottom: I, left: R } = e2.getBoundingClientRect(), { top: T, right: B, bottom: F, left: V } = ((t2) => {
      const e3 = window.getComputedStyle(t2);
      return { top: parseFloat(e3.scrollMarginTop) || 0, right: parseFloat(e3.scrollMarginRight) || 0, bottom: parseFloat(e3.scrollMarginBottom) || 0, left: parseFloat(e3.scrollMarginLeft) || 0 };
    })(e2);
    let k = "start" === f || "nearest" === f ? x - T : "end" === f ? I + F : x + v / 2 - T + F, D = "center" === u ? R + E / 2 - V + B : "end" === u ? C + B : R - V;
    const L = [];
    for (let t2 = 0; t2 < w.length; t2++) {
      const e3 = w[t2], { height: l2, width: r3, top: i2, right: s2, bottom: d2, left: h2 } = e3.getBoundingClientRect();
      if ("if-needed" === c && x >= 0 && R >= 0 && I <= H && C <= b && (e3 === m && !n(e3) || x >= i2 && I <= d2 && R >= h2 && C <= s2)) return L;
      const a2 = getComputedStyle(e3), g2 = parseInt(a2.borderLeftWidth, 10), p2 = parseInt(a2.borderTopWidth, 10), W2 = parseInt(a2.borderRightWidth, 10), T2 = parseInt(a2.borderBottomWidth, 10);
      let B2 = 0, F2 = 0;
      const V2 = "offsetWidth" in e3 ? e3.offsetWidth - e3.clientWidth - g2 - W2 : 0, S = "offsetHeight" in e3 ? e3.offsetHeight - e3.clientHeight - p2 - T2 : 0, X = "offsetWidth" in e3 ? 0 === e3.offsetWidth ? 0 : r3 / e3.offsetWidth : 0, Y = "offsetHeight" in e3 ? 0 === e3.offsetHeight ? 0 : l2 / e3.offsetHeight : 0;
      if (m === e3) B2 = "start" === f ? k : "end" === f ? k - H : "nearest" === f ? o$1(M, M + H, H, p2, T2, M + k, M + k + v, v) : k - H / 2, F2 = "start" === u ? D : "center" === u ? D - b / 2 : "end" === u ? D - b : o$1(y, y + b, b, g2, W2, y + D, y + D + E, E), B2 = Math.max(0, B2 + M), F2 = Math.max(0, F2 + y);
      else {
        B2 = "start" === f ? k - i2 - p2 : "end" === f ? k - d2 + T2 + S : "nearest" === f ? o$1(i2, d2, l2, p2, T2 + S, k, k + v, v) : k - (i2 + l2 / 2) + S / 2, F2 = "start" === u ? D - h2 - g2 : "center" === u ? D - (h2 + r3 / 2) + V2 / 2 : "end" === u ? D - s2 + W2 + V2 : o$1(h2, s2, r3, g2, W2 + V2, D, D + E, E);
        const { scrollLeft: t3, scrollTop: n2 } = e3;
        B2 = 0 === Y ? 0 : Math.max(0, Math.min(n2 + B2 / Y, e3.scrollHeight - l2 / Y + S)), F2 = 0 === X ? 0 : Math.max(0, Math.min(t3 + F2 / X, e3.scrollWidth - r3 / X + V2)), k += n2 - B2, D += t3 - F2;
      }
      L.push({ el: e3, top: B2, left: F2 });
    }
    return L;
  };
  const o = (t2) => false === t2 ? { block: "end", inline: "nearest" } : ((t3) => t3 === Object(t3) && 0 !== Object.keys(t3).length)(t2) ? t2 : { block: "start", inline: "nearest" };
  function e(e2, r$12) {
    if (!e2.isConnected || !((t2) => {
      let o2 = t2;
      for (; o2 && o2.parentNode; ) {
        if (o2.parentNode === document) return true;
        o2 = o2.parentNode instanceof ShadowRoot ? o2.parentNode.host : o2.parentNode;
      }
      return false;
    })(e2)) return;
    const n2 = ((t2) => {
      const o2 = window.getComputedStyle(t2);
      return { top: parseFloat(o2.scrollMarginTop) || 0, right: parseFloat(o2.scrollMarginRight) || 0, bottom: parseFloat(o2.scrollMarginBottom) || 0, left: parseFloat(o2.scrollMarginLeft) || 0 };
    })(e2);
    if (((t2) => "object" == typeof t2 && "function" == typeof t2.behavior)(r$12)) return r$12.behavior(r(e2, r$12));
    const l2 = "boolean" == typeof r$12 || null == r$12 ? void 0 : r$12.behavior;
    for (const { el: a, top: i, left: s } of r(e2, o(r$12))) {
      const t2 = i - n2.top + n2.bottom, o2 = s - n2.left + n2.right;
      a.scroll({ top: t2, left: o2, behavior: l2 });
    }
  }
  const formItemNameBlackList = ["parentNode"];
  const defaultItemNamePrefixCls = "form_item";
  function toArray$1(candidate) {
    if (candidate === void 0 || candidate === false) {
      return [];
    }
    return Array.isArray(candidate) ? candidate : [candidate];
  }
  function getFieldId(namePath, formName) {
    if (!namePath.length) {
      return void 0;
    }
    const mergedId = namePath.join("_");
    if (formName) {
      return `${formName}_${mergedId}`;
    }
    const isIllegalName = formItemNameBlackList.includes(mergedId);
    return isIllegalName ? `${defaultItemNamePrefixCls}_${mergedId}` : mergedId;
  }
  function getStatus(errors, warnings, meta, defaultValidateStatus, hasFeedback, validateStatus) {
    let status = defaultValidateStatus;
    if (validateStatus !== void 0) {
      status = validateStatus;
    } else if (meta.validating) {
      status = "validating";
    } else if (errors.length) {
      status = "error";
    } else if (warnings.length) {
      status = "warning";
    } else if (meta.touched || hasFeedback && meta.validated) {
      status = "success";
    }
    return status;
  }
  function toNamePathStr(name) {
    const namePath = toArray$1(name);
    return namePath.join("_");
  }
  function getFieldDOMNode(name, wrapForm) {
    const field = wrapForm.getFieldInstance(name);
    const fieldDom = getDOM(field);
    if (fieldDom) {
      return fieldDom;
    }
    const fieldId = getFieldId(toArray$1(name), wrapForm.__INTERNAL__.name);
    if (fieldId) {
      return document.getElementById(fieldId);
    }
  }
  function useForm(form) {
    const [rcForm] = useForm$1();
    const itemsRef = React__namespace.useRef({});
    const wrapForm = React__namespace.useMemo(() => form ?? {
      ...rcForm,
      __INTERNAL__: {
        itemRef: (name) => (node2) => {
          const namePathStr = toNamePathStr(name);
          if (node2) {
            itemsRef.current[namePathStr] = node2;
          } else {
            delete itemsRef.current[namePathStr];
          }
        }
      },
      scrollToField: (name, options = {}) => {
        const {
          focus,
          ...restOpt
        } = options;
        const node2 = getFieldDOMNode(name, wrapForm);
        if (node2) {
          e(node2, {
            scrollMode: "if-needed",
            block: "nearest",
            ...restOpt
          });
          if (focus) {
            wrapForm.focusField(name);
          }
        }
      },
      focusField: (name) => {
        const itemRef = wrapForm.getFieldInstance(name);
        if (typeof itemRef?.focus === "function") {
          itemRef.focus();
        } else {
          getFieldDOMNode(name, wrapForm)?.focus?.();
        }
      },
      getFieldInstance: (name) => {
        const namePathStr = toNamePathStr(name);
        return itemsRef.current[namePathStr];
      }
    }, [form, rcForm]);
    return [wrapForm];
  }
  const resetComponent = (token2, needInheritFontFamily = false) => ({
    boxSizing: "border-box",
    margin: 0,
    padding: 0,
    color: token2.colorText,
    fontSize: token2.fontSize,
lineHeight: token2.lineHeight,
    listStyle: "none",
fontFamily: needInheritFontFamily ? "inherit" : token2.fontFamily
  });
  const resetIcon = () => ({
    display: "inline-flex",
    alignItems: "center",
    color: "inherit",
    fontStyle: "normal",
    lineHeight: 0,
    textAlign: "center",
    textTransform: "none",
verticalAlign: "-0.125em",
    textRendering: "optimizeLegibility",
    "-webkit-font-smoothing": "antialiased",
    "-moz-osx-font-smoothing": "grayscale",
    "> *": {
      lineHeight: 1
    },
    svg: {
      display: "inline-block"
    }
  });
  const clearFix = () => ({
"&::before": {
      display: "table",
      content: '""'
    },
    "&::after": {
display: "table",
      clear: "both",
      content: '""'
    }
  });
  const genFocusOutline = (token2, offset2) => ({
    outline: `${unit$1(token2.lineWidthFocus)} solid ${token2.colorPrimaryBorder}`,
    outlineOffset: offset2 ?? 1,
    transition: [`outline-offset`, `outline`].map((prop) => `${prop} 0s`).join(", ")
  });
  const genFocusStyle = (token2, offset2) => ({
    "&:focus-visible": genFocusOutline(token2, offset2)
  });
  const genLinkStyle = (token2) => ({
    a: {
      color: token2.colorLink,
      textDecoration: token2.linkDecoration,
      backgroundColor: "transparent",
outline: "none",
      cursor: "pointer",
      transition: `color ${token2.motionDurationSlow}`,
      "-webkit-text-decoration-skip": "objects",
"&:hover": {
        color: token2.colorLinkHover
      },
      "&:active": {
        color: token2.colorLinkActive
      },
      "&:active, &:hover": {
        textDecoration: token2.linkHoverDecoration,
        outline: 0
      },
"&:focus": {
        textDecoration: token2.linkFocusDecoration,
        outline: 0
      },
      ...genFocusStyle(token2),
      "&[disabled]": {
        color: token2.colorTextDisabled,
        cursor: "not-allowed"
      }
    }
  });
  const genCommonStyle = (token2, componentPrefixCls, rootCls, resetFont) => {
    const prefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
    const rootPrefixSelector = rootCls ? `.${rootCls}` : prefixSelector;
    const resetStyle = {
      boxSizing: "border-box",
      "&::before, &::after": {
        boxSizing: "border-box"
      }
    };
    let resetFontStyle = {};
    if (resetFont !== false) {
      resetFontStyle = {
        fontFamily: token2.fontFamily,
        fontSize: token2.fontSize
      };
    }
    return {
      [rootPrefixSelector]: {
        ...resetFontStyle,
        ...resetStyle,
        [prefixSelector]: resetStyle
      }
    };
  };
  const genIconStyle = (iconPrefixCls) => ({
    [`.${iconPrefixCls}`]: {
      ...resetIcon(),
      [`.${iconPrefixCls} .${iconPrefixCls}-icon`]: {
        display: "block"
      }
    }
  });
  const genCollapseMotion = (token2) => {
    const {
      componentCls,
      antCls,
      motionDurationMid,
      motionEaseInOut
    } = token2;
    return {
      [componentCls]: {
[`${antCls}-motion-collapse-legacy`]: {
          overflow: "hidden",
          "&-active": {
            transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important`
          }
        },
        [`${antCls}-motion-collapse`]: {
          overflow: "hidden",
          transition: `${["height", "opacity"].map((prop) => `${prop} ${motionDurationMid} ${motionEaseInOut}`).join(", ")} !important`
        }
      }
    };
  };
  const initMotionCommon = (duration) => ({
    animationDuration: duration,
    animationFillMode: "both"
  });
  const initMotion = (motionCls, inKeyframes, outKeyframes, duration, sameLevel = false) => {
    const sameLevelPrefix = sameLevel ? "&" : "";
    return {
      [`
      ${sameLevelPrefix}${motionCls}-enter,
      ${sameLevelPrefix}${motionCls}-appear
    `]: {
        ...initMotionCommon(duration),
        animationPlayState: "paused"
      },
      [`${sameLevelPrefix}${motionCls}-leave`]: {
        ...initMotionCommon(duration),
        animationPlayState: "paused"
      },
      [`
      ${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
      ${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
    `]: {
        animationName: inKeyframes,
        animationPlayState: "running"
      },
      [`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
        animationName: outKeyframes,
        animationPlayState: "running",
        pointerEvents: "none"
      }
    };
  };
  const fadeIn = new Keyframe("antFadeIn", {
    "0%": {
      opacity: 0
    },
    "100%": {
      opacity: 1
    }
  });
  const fadeOut = new Keyframe("antFadeOut", {
    "0%": {
      opacity: 1
    },
    "100%": {
      opacity: 0
    }
  });
  const initFadeMotion = (token2, sameLevel = false) => {
    const {
      antCls
    } = token2;
    const motionCls = `${antCls}-fade`;
    const sameLevelPrefix = sameLevel ? "&" : "";
    return [initMotion(motionCls, fadeIn, fadeOut, token2.motionDurationMid, sameLevel), {
      [`
        ${sameLevelPrefix}${motionCls}-enter,
        ${sameLevelPrefix}${motionCls}-appear
      `]: {
        opacity: 0,
        animationTimingFunction: "linear"
      },
      [`${sameLevelPrefix}${motionCls}-leave`]: {
        animationTimingFunction: "linear"
      }
    }];
  };
  const genNoMotionStyle = () => {
    return {
      "@media (prefers-reduced-motion: reduce)": {
        transition: "none",
        animation: "none"
      }
    };
  };
  const zoomIn = new Keyframe("antZoomIn", {
    "0%": {
      transform: "scale(0.2)",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      opacity: 1
    }
  });
  const zoomOut = new Keyframe("antZoomOut", {
    "0%": {
      transform: "scale(1)"
    },
    "100%": {
      transform: "scale(0.2)",
      opacity: 0
    }
  });
  const zoomBigIn = new Keyframe("antZoomBigIn", {
    "0%": {
      transform: "scale(0.8)",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      opacity: 1
    }
  });
  const zoomBigOut = new Keyframe("antZoomBigOut", {
    "0%": {
      transform: "scale(1)"
    },
    "100%": {
      transform: "scale(0.8)",
      opacity: 0
    }
  });
  const zoomUpIn = new Keyframe("antZoomUpIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 0%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "50% 0%"
    }
  });
  const zoomUpOut = new Keyframe("antZoomUpOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "50% 0%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 0%",
      opacity: 0
    }
  });
  const zoomLeftIn = new Keyframe("antZoomLeftIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "0% 50%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "0% 50%"
    }
  });
  const zoomLeftOut = new Keyframe("antZoomLeftOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "0% 50%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "0% 50%",
      opacity: 0
    }
  });
  const zoomRightIn = new Keyframe("antZoomRightIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "100% 50%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "100% 50%"
    }
  });
  const zoomRightOut = new Keyframe("antZoomRightOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "100% 50%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "100% 50%",
      opacity: 0
    }
  });
  const zoomDownIn = new Keyframe("antZoomDownIn", {
    "0%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 100%",
      opacity: 0
    },
    "100%": {
      transform: "scale(1)",
      transformOrigin: "50% 100%"
    }
  });
  const zoomDownOut = new Keyframe("antZoomDownOut", {
    "0%": {
      transform: "scale(1)",
      transformOrigin: "50% 100%"
    },
    "100%": {
      transform: "scale(0.8)",
      transformOrigin: "50% 100%",
      opacity: 0
    }
  });
  const zoomMotion = {
    zoom: {
      inKeyframes: zoomIn,
      outKeyframes: zoomOut
    },
    "zoom-big": {
      inKeyframes: zoomBigIn,
      outKeyframes: zoomBigOut
    },
    "zoom-big-fast": {
      inKeyframes: zoomBigIn,
      outKeyframes: zoomBigOut
    },
    "zoom-left": {
      inKeyframes: zoomLeftIn,
      outKeyframes: zoomLeftOut
    },
    "zoom-right": {
      inKeyframes: zoomRightIn,
      outKeyframes: zoomRightOut
    },
    "zoom-up": {
      inKeyframes: zoomUpIn,
      outKeyframes: zoomUpOut
    },
    "zoom-down": {
      inKeyframes: zoomDownIn,
      outKeyframes: zoomDownOut
    }
  };
  const initZoomMotion = (token2, motionName) => {
    const {
      antCls
    } = token2;
    const motionCls = `${antCls}-${motionName}`;
    const {
      inKeyframes,
      outKeyframes
    } = zoomMotion[motionName];
    return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token2.motionDurationFast : token2.motionDurationMid), {
      [`
        ${motionCls}-enter,
        ${motionCls}-appear
      `]: {
        transform: "scale(0)",
        opacity: 0,
        animationTimingFunction: token2.motionEaseOutCirc,
        "&-prepare": {
          transform: "none"
        }
      },
      [`${motionCls}-leave`]: {
        animationTimingFunction: token2.motionEaseInOutCirc
      }
    }];
  };
  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, u, a = [], f = true, o2 = false;
      try {
        if (i = (t2 = t2.call(r2)).next, 0 === l2) {
          if (Object(t2) !== t2) return;
          f = false;
        } else for (; !(f = (e2 = i.call(t2)).done) && (a.push(e2.value), a.length !== l2); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u = t2["return"](), Object(u) !== u)) return;
        } finally {
          if (o2) 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(r2, e2) || _nonIterableRest();
  }
  var AbstractCalculator = _createClass(function AbstractCalculator2() {
    _classCallCheck(this, AbstractCalculator2);
  });
  var CALC_UNIT = "CALC_UNIT";
  var regexp3 = new RegExp(CALC_UNIT, "g");
  function unit(value) {
    if (typeof value === "number") {
      return "".concat(value).concat(CALC_UNIT);
    }
    return value;
  }
  var CSSCalculator = (function(_AbstractCalculator) {
    _inherits(CSSCalculator2, _AbstractCalculator);
    var _super = _createSuper(CSSCalculator2);
    function CSSCalculator2(num, unitlessCssVar) {
      var _this;
      _classCallCheck(this, CSSCalculator2);
      _this = _super.call(this);
      _defineProperty$1(_assertThisInitialized(_this), "result", "");
      _defineProperty$1(_assertThisInitialized(_this), "unitlessCssVar", void 0);
      _defineProperty$1(_assertThisInitialized(_this), "lowPriority", void 0);
      var numType = _typeof$1(num);
      _this.unitlessCssVar = unitlessCssVar;
      if (num instanceof CSSCalculator2) {
        _this.result = "(".concat(num.result, ")");
      } else if (numType === "number") {
        _this.result = unit(num);
      } else if (numType === "string") {
        _this.result = num;
      }
      return _this;
    }
    _createClass(CSSCalculator2, [{
      key: "add",
      value: function add(num) {
        if (num instanceof CSSCalculator2) {
          this.result = "".concat(this.result, " + ").concat(num.getResult());
        } else if (typeof num === "number" || typeof num === "string") {
          this.result = "".concat(this.result, " + ").concat(unit(num));
        }
        this.lowPriority = true;
        return this;
      }
    }, {
      key: "sub",
      value: function sub(num) {
        if (num instanceof CSSCalculator2) {
          this.result = "".concat(this.result, " - ").concat(num.getResult());
        } else if (typeof num === "number" || typeof num === "string") {
          this.result = "".concat(this.result, " - ").concat(unit(num));
        }
        this.lowPriority = true;
        return this;
      }
    }, {
      key: "mul",
      value: function mul(num) {
        if (this.lowPriority) {
          this.result = "(".concat(this.result, ")");
        }
        if (num instanceof CSSCalculator2) {
          this.result = "".concat(this.result, " * ").concat(num.getResult(true));
        } else if (typeof num === "number" || typeof num === "string") {
          this.result = "".concat(this.result, " * ").concat(num);
        }
        this.lowPriority = false;
        return this;
      }
    }, {
      key: "div",
      value: function div(num) {
        if (this.lowPriority) {
          this.result = "(".concat(this.result, ")");
        }
        if (num instanceof CSSCalculator2) {
          this.result = "".concat(this.result, " / ").concat(num.getResult(true));
        } else if (typeof num === "number" || typeof num === "string") {
          this.result = "".concat(this.result, " / ").concat(num);
        }
        this.lowPriority = false;
        return this;
      }
    }, {
      key: "getResult",
      value: function getResult(force) {
        return this.lowPriority || force ? "(".concat(this.result, ")") : this.result;
      }
    }, {
      key: "equal",
      value: function equal(options) {
        var _this2 = this;
        var _ref = options || {}, cssUnit = _ref.unit;
        var mergedUnit = true;
        if (typeof cssUnit === "boolean") {
          mergedUnit = cssUnit;
        } else if (Array.from(this.unitlessCssVar).some(function(cssVar) {
          return _this2.result.includes(cssVar);
        })) {
          mergedUnit = false;
        }
        this.result = this.result.replace(regexp3, mergedUnit ? "px" : "");
        if (typeof this.lowPriority !== "undefined") {
          return "calc(".concat(this.result, ")");
        }
        return this.result;
      }
    }]);
    return CSSCalculator2;
  })(AbstractCalculator);
  var genCalc = function genCalc2(type4, unitlessCssVar) {
    var Calculator = CSSCalculator;
    return function(num) {
      return new Calculator(num, unitlessCssVar);
    };
  };
  var getCompVarPrefix = function getCompVarPrefix2(component, prefix2) {
    return "".concat([prefix2, component.replace(/([A-Z]+)([A-Z][a-z]+)/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2")].filter(Boolean).join("-"));
  };
  function getComponentToken(component, token2, defaultToken, options) {
    var customToken = _objectSpread2({}, token2[component]);
    if (options !== null && options !== void 0 && options.deprecatedTokens) {
      var deprecatedTokens = options.deprecatedTokens;
      deprecatedTokens.forEach(function(_ref) {
        var _ref2 = _slicedToArray(_ref, 2), oldTokenKey = _ref2[0], newTokenKey = _ref2[1];
        if (customToken !== null && customToken !== void 0 && customToken[oldTokenKey] || customToken !== null && customToken !== void 0 && customToken[newTokenKey]) {
          var _customToken$newToken;
          (_customToken$newToken = customToken[newTokenKey]) !== null && _customToken$newToken !== void 0 ? _customToken$newToken : customToken[newTokenKey] = customToken === null || customToken === void 0 ? void 0 : customToken[oldTokenKey];
        }
      });
    }
    var mergedToken = _objectSpread2(_objectSpread2({}, defaultToken), customToken);
    Object.keys(mergedToken).forEach(function(key) {
      if (mergedToken[key] === token2[key]) {
        delete mergedToken[key];
      }
    });
    return mergedToken;
  }
  var enableStatistic = typeof CSSINJS_STATISTIC !== "undefined";
  var recording = true;
  function merge() {
    for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
      objs[_key] = arguments[_key];
    }
    if (!enableStatistic) {
      return Object.assign.apply(Object, [{}].concat(objs));
    }
    recording = false;
    var ret = {};
    objs.forEach(function(obj) {
      if (_typeof$1(obj) !== "object") {
        return;
      }
      var keys2 = Object.keys(obj);
      keys2.forEach(function(key) {
        Object.defineProperty(ret, key, {
          configurable: true,
          enumerable: true,
          get: function get2() {
            return obj[key];
          }
        });
      });
    });
    recording = true;
    return ret;
  }
  var statistic = {};
  function noop() {
  }
  var statisticToken = function statisticToken2(token2) {
    var tokenKeys2;
    var proxy = token2;
    var flush = noop;
    if (enableStatistic && typeof Proxy !== "undefined") {
      tokenKeys2 = new Set();
      proxy = new Proxy(token2, {
        get: function get2(obj, prop) {
          if (recording) {
            var _tokenKeys;
            (_tokenKeys = tokenKeys2) === null || _tokenKeys === void 0 || _tokenKeys.add(prop);
          }
          return obj[prop];
        }
      });
      flush = function flush2(componentName, componentToken) {
        var _statistic$componentN;
        statistic[componentName] = {
          global: Array.from(tokenKeys2),
          component: _objectSpread2(_objectSpread2({}, (_statistic$componentN = statistic[componentName]) === null || _statistic$componentN === void 0 ? void 0 : _statistic$componentN.component), componentToken)
        };
      };
    }
    return {
      token: proxy,
      keys: tokenKeys2,
      flush
    };
  };
  function getDefaultComponentToken(component, token2, getDefaultToken) {
    if (typeof getDefaultToken === "function") {
      var _token$component;
      return getDefaultToken(merge(token2, (_token$component = token2[component]) !== null && _token$component !== void 0 ? _token$component : {}));
    }
    return getDefaultToken !== null && getDefaultToken !== void 0 ? getDefaultToken : {};
  }
  function genMaxMin(type4) {
    return {
      max: function max() {
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        return "max(".concat(args.map(function(value) {
          return unit$1(value);
        }).join(","), ")");
      },
      min: function min() {
        for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          args[_key2] = arguments[_key2];
        }
        return "min(".concat(args.map(function(value) {
          return unit$1(value);
        }).join(","), ")");
      }
    };
  }
  var BEAT_LIMIT = 1e3 * 60 * 10;
  var ArrayKeyMap = (function() {
    function ArrayKeyMap2() {
      _classCallCheck(this, ArrayKeyMap2);
      _defineProperty$1(this, "map", new Map());
      _defineProperty$1(this, "objectIDMap", new WeakMap());
      _defineProperty$1(this, "nextID", 0);
      _defineProperty$1(this, "lastAccessBeat", new Map());
      _defineProperty$1(this, "accessBeat", 0);
    }
    _createClass(ArrayKeyMap2, [{
      key: "set",
      value: function set2(keys2, value) {
        this.clear();
        var compositeKey = this.getCompositeKey(keys2);
        this.map.set(compositeKey, value);
        this.lastAccessBeat.set(compositeKey, Date.now());
      }
    }, {
      key: "get",
      value: function get2(keys2) {
        var compositeKey = this.getCompositeKey(keys2);
        var cache = this.map.get(compositeKey);
        this.lastAccessBeat.set(compositeKey, Date.now());
        this.accessBeat += 1;
        return cache;
      }
    }, {
      key: "getCompositeKey",
      value: function getCompositeKey(keys2) {
        var _this = this;
        var ids = keys2.map(function(key) {
          if (key && _typeof$1(key) === "object") {
            return "obj_".concat(_this.getObjectID(key));
          }
          return "".concat(_typeof$1(key), "_").concat(key);
        });
        return ids.join("|");
      }
    }, {
      key: "getObjectID",
      value: function getObjectID(obj) {
        if (this.objectIDMap.has(obj)) {
          return this.objectIDMap.get(obj);
        }
        var id = this.nextID;
        this.objectIDMap.set(obj, id);
        this.nextID += 1;
        return id;
      }
    }, {
      key: "clear",
      value: function clear() {
        var _this2 = this;
        if (this.accessBeat > 1e4) {
          var now = Date.now();
          this.lastAccessBeat.forEach(function(beat, key) {
            if (now - beat > BEAT_LIMIT) {
              _this2.map.delete(key);
              _this2.lastAccessBeat.delete(key);
            }
          });
          this.accessBeat = 0;
        }
      }
    }]);
    return ArrayKeyMap2;
  })();
  var uniqueMap = new ArrayKeyMap();
  function useUniqueMemo(memoFn, deps) {
    return React.useMemo(function() {
      var cachedValue = uniqueMap.get(deps);
      if (cachedValue) {
        return cachedValue;
      }
      var newValue = memoFn();
      uniqueMap.set(deps, newValue);
      return newValue;
    }, deps);
  }
  var useDefaultCSP = function useDefaultCSP2() {
    return {};
  };
  function genStyleUtils(config) {
    var _config$useCSP = config.useCSP, useCSP = _config$useCSP === void 0 ? useDefaultCSP : _config$useCSP, useToken2 = config.useToken, usePrefix = config.usePrefix, getResetStyles = config.getResetStyles, getCommonStyle = config.getCommonStyle, getCompUnitless = config.getCompUnitless;
    function genStyleHooks2(component, styleFn, getDefaultToken, options) {
      var componentName = Array.isArray(component) ? component[0] : component;
      function prefixToken(key) {
        return "".concat(String(componentName)).concat(key.slice(0, 1).toUpperCase()).concat(key.slice(1));
      }
      var originUnitless = (options === null || options === void 0 ? void 0 : options.unitless) || {};
      var originCompUnitless = typeof getCompUnitless === "function" ? getCompUnitless(component) : {};
      var compUnitless = _objectSpread2(_objectSpread2({}, originCompUnitless), {}, _defineProperty$1({}, prefixToken("zIndexPopup"), true));
      Object.keys(originUnitless).forEach(function(key) {
        compUnitless[prefixToken(key)] = originUnitless[key];
      });
      var mergedOptions = _objectSpread2(_objectSpread2({}, options), {}, {
        unitless: compUnitless,
        prefixToken
      });
      var useStyle2 = genComponentStyleHook2(component, styleFn, getDefaultToken, mergedOptions);
      var useCSSVar = genCSSVarRegister(componentName, getDefaultToken, mergedOptions);
      return function(prefixCls) {
        var rootCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : prefixCls;
        var hashId = useStyle2(prefixCls, rootCls);
        var extraPrefixCls = options === null || options === void 0 ? void 0 : options.extraCssVarPrefixCls;
        var resolvedExtraPrefixCls = typeof extraPrefixCls === "function" ? extraPrefixCls({
          prefixCls,
          rootCls
        }) : extraPrefixCls;
        var cssVarCls = useCSSVar(resolvedExtraPrefixCls !== null && resolvedExtraPrefixCls !== void 0 && resolvedExtraPrefixCls.length ? [rootCls].concat(_toConsumableArray(resolvedExtraPrefixCls)) : rootCls);
        return [hashId, cssVarCls];
      };
    }
    function genCSSVarRegister(component, getDefaultToken, options) {
      var compUnitless = options.unitless, prefixToken = options.prefixToken, ignore2 = options.ignore;
      return function(rootCls) {
        var _useToken = useToken2(), cssVar = _useToken.cssVar, realToken = _useToken.realToken;
        var csp = useCSP();
        useCSSVarRegister({
          path: [component],
          prefix: cssVar.prefix,
          key: cssVar.key,
          unitless: compUnitless,
          ignore: ignore2,
          token: realToken,
          scope: rootCls,
          nonce: function nonce() {
            return csp.nonce;
          }
        }, function() {
          var defaultToken = getDefaultComponentToken(component, realToken, getDefaultToken);
          var componentToken = getComponentToken(component, realToken, defaultToken, {
            deprecatedTokens: options === null || options === void 0 ? void 0 : options.deprecatedTokens
          });
          if (defaultToken) {
            Object.keys(defaultToken).forEach(function(key) {
              componentToken[prefixToken(key)] = componentToken[key];
              delete componentToken[key];
            });
          }
          return componentToken;
        });
        return cssVar === null || cssVar === void 0 ? void 0 : cssVar.key;
      };
    }
    function genComponentStyleHook2(componentName, styleFn, getDefaultToken) {
      var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      var cells = Array.isArray(componentName) ? componentName : [componentName, componentName];
      var _cells = _slicedToArray(cells, 1), component = _cells[0];
      var concatComponent = cells.join("-");
      var mergedLayer = config.layer || {
        name: "antd"
      };
      return function(prefixCls) {
        var rootCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : prefixCls;
        var _useToken2 = useToken2(), theme = _useToken2.theme, realToken = _useToken2.realToken, hashId = _useToken2.hashId, token2 = _useToken2.token, cssVar = _useToken2.cssVar, zeroRuntime = _useToken2.zeroRuntime;
        var memoizedZeroRuntime = React.useMemo(function() {
          return zeroRuntime;
        }, []);
        if (memoizedZeroRuntime) {
          return hashId;
        }
        var _usePrefix = usePrefix(), rootPrefixCls = _usePrefix.rootPrefixCls, iconPrefixCls = _usePrefix.iconPrefixCls;
        var csp = useCSP();
        var type4 = "css";
        var calc = useUniqueMemo(function() {
          var unitlessCssVar = new Set();
          Object.keys(options.unitless || {}).forEach(function(key) {
            unitlessCssVar.add(token2CSSVar(key, cssVar.prefix));
            unitlessCssVar.add(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)));
          });
          return genCalc(type4, unitlessCssVar);
        }, [type4, component, cssVar === null || cssVar === void 0 ? void 0 : cssVar.prefix]);
        var _genMaxMin = genMaxMin(), max = _genMaxMin.max, min = _genMaxMin.min;
        var sharedConfig = {
          theme,
          token: token2,
          hashId,
          nonce: function nonce() {
            return csp.nonce;
          },
          clientOnly: options.clientOnly,
          layer: mergedLayer,
order: options.order || -999
        };
        if (typeof getResetStyles === "function") {
          useStyleRegister(_objectSpread2(_objectSpread2({}, sharedConfig), {}, {
            clientOnly: false,
            path: ["Shared", rootPrefixCls]
          }), function() {
            return getResetStyles(token2, {
              prefix: {
                rootPrefixCls,
                iconPrefixCls
              },
              csp
            });
          });
        }
        useStyleRegister(_objectSpread2(_objectSpread2({}, sharedConfig), {}, {
          path: [concatComponent, prefixCls, iconPrefixCls]
        }), function() {
          if (options.injectStyle === false) {
            return [];
          }
          var _statisticToken = statisticToken(token2), proxyToken = _statisticToken.token, flush = _statisticToken.flush;
          var defaultComponentToken = getDefaultComponentToken(component, realToken, getDefaultToken);
          var componentCls = ".".concat(prefixCls);
          var componentToken = getComponentToken(component, realToken, defaultComponentToken, {
            deprecatedTokens: options.deprecatedTokens
          });
          if (defaultComponentToken && _typeof$1(defaultComponentToken) === "object") {
            Object.keys(defaultComponentToken).forEach(function(key) {
              defaultComponentToken[key] = "var(".concat(token2CSSVar(key, getCompVarPrefix(component, cssVar.prefix)), ")");
            });
          }
          var mergedToken = merge(proxyToken, {
            componentCls,
            prefixCls,
            iconCls: ".".concat(iconPrefixCls),
            antCls: ".".concat(rootPrefixCls),
            calc,
            max,
            min
          }, defaultComponentToken);
          var styleInterpolation = styleFn(mergedToken, {
            hashId,
            prefixCls,
            rootPrefixCls,
            iconPrefixCls
          });
          flush(component, componentToken);
          var commonStyle = typeof getCommonStyle === "function" ? getCommonStyle(mergedToken, prefixCls, rootCls, options.resetFont) : null;
          return [options.resetStyle === false ? null : commonStyle, styleInterpolation];
        });
        return hashId;
      };
    }
    function genSubStyleComponent2(componentName, styleFn, getDefaultToken) {
      var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
      var useStyle2 = genComponentStyleHook2(componentName, styleFn, getDefaultToken, _objectSpread2({
        resetStyle: false,
order: -998
      }, options));
      var StyledComponent = function StyledComponent2(_ref) {
        var prefixCls = _ref.prefixCls, _ref$rootCls = _ref.rootCls, rootCls = _ref$rootCls === void 0 ? prefixCls : _ref$rootCls;
        useStyle2(prefixCls, rootCls);
        return null;
      };
      return StyledComponent;
    }
    return {
      genStyleHooks: genStyleHooks2,
      genSubStyleComponent: genSubStyleComponent2,
      genComponentStyleHook: genComponentStyleHook2
    };
  }
  const {
    genStyleHooks,
    genComponentStyleHook,
    genSubStyleComponent
  } = genStyleUtils({
    usePrefix: () => {
      const {
        getPrefixCls,
        iconPrefixCls
      } = React.useContext(ConfigContext);
      const rootPrefixCls = getPrefixCls();
      return {
        rootPrefixCls,
        iconPrefixCls
      };
    },
    useToken: () => {
      const [theme, realToken, hashId, token2, cssVar, zeroRuntime] = useToken();
      return {
        theme,
        realToken,
        hashId,
        token: token2,
        cssVar,
        zeroRuntime
      };
    },
    useCSP: () => {
      const {
        csp
      } = React.useContext(ConfigContext);
      return csp ?? {};
    },
    getResetStyles: (token2, config) => {
      const linkStyle = genLinkStyle(token2);
      return [linkStyle, {
        "&": linkStyle
      }, genIconStyle(config?.prefix.iconPrefixCls ?? defaultIconPrefixCls)];
    },
    getCommonStyle: genCommonStyle,
    getCompUnitless: () => unitless
  });
  const genCssVar = (antCls, component) => {
    const cssPrefix = `--${antCls.replace(/\./g, "")}-${component}-`;
    const varName = (name) => {
      return `${cssPrefix}${name}`;
    };
    const varRef = (name, fallback) => {
      return fallback ? `var(${cssPrefix}${name}, ${fallback})` : `var(${cssPrefix}${name})`;
    };
    return [varName, varRef];
  };
  function genPresetColor(token2, genCss) {
    return PresetColors.reduce((prev2, colorKey) => {
      const lightColor = token2[`${colorKey}1`];
      const lightBorderColor = token2[`${colorKey}3`];
      const darkColor = token2[`${colorKey}6`];
      const textColor = token2[`${colorKey}7`];
      return {
        ...prev2,
        ...genCss(colorKey, {
          lightColor,
          lightBorderColor,
          darkColor,
          textColor
        })
      };
    }, {});
  }
  const useResetIconStyle = (iconPrefixCls, csp) => {
    useToken();
    return useStyleRegister({
      hashId: "",
      path: ["ant-design-icons", iconPrefixCls],
      nonce: () => csp?.nonce,
      layer: {
        name: "antd"
      }
    }, () => genIconStyle(iconPrefixCls));
  };
  const genFormValidateMotionStyle = (token2) => {
    const {
      componentCls,
      motionDurationFast,
      motionEaseInOut
    } = token2;
    const helpCls = `${componentCls}-show-help`;
    const helpItemCls = `${componentCls}-show-help-item`;
    return {
      [helpCls]: {
transition: `opacity ${motionDurationFast} ${motionEaseInOut}`,
        "&-appear, &-enter": {
          opacity: 0,
          "&-active": {
            opacity: 1
          }
        },
        "&-leave": {
          opacity: 1,
          "&-active": {
            opacity: 0
          }
        },
[helpItemCls]: {
          overflow: "hidden",
          transition: `${["height", "opacity", "transform"].map((prop) => `${prop} ${motionDurationFast} ${motionEaseInOut}`).join(", ")} !important`,
          [`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
            transform: `translateY(-5px)`,
            opacity: 0,
            "&-active": {
              transform: "translateY(0)",
              opacity: 1
            }
          },
          [`&${helpItemCls}-leave-active`]: {
            transform: `translateY(-5px)`
          }
        }
      }
    };
  };
  const resetForm = (token2) => ({
    legend: {
      display: "block",
      width: "100%",
      marginBottom: token2.marginLG,
      padding: 0,
      color: token2.colorTextDescription,
      fontSize: token2.fontSizeLG,
      lineHeight: "inherit",
      border: 0,
      borderBottom: `${unit$1(token2.lineWidth)} ${token2.lineType} ${token2.colorBorder}`
    },
    'input[type="search"]': {
      boxSizing: "border-box"
    },
'input[type="radio"], input[type="checkbox"]': {
      lineHeight: "normal"
    },
    'input[type="file"]': {
      display: "block"
    },
'input[type="range"]': {
      display: "block",
      width: "100%"
    },
"select[multiple], select[size]": {
      height: "auto"
    },
[`input[type='file']:focus,
  input[type='radio']:focus,
  input[type='checkbox']:focus`]: {
      outline: 0,
      boxShadow: `0 0 0 ${unit$1(token2.controlOutlineWidth)} ${token2.controlOutline}`
    },
output: {
      display: "block",
      paddingTop: 15,
      color: token2.colorText,
      fontSize: token2.fontSize,
      lineHeight: token2.lineHeight
    }
  });
  const genFormSize = (token2, height) => {
    const {
      formItemCls
    } = token2;
    return {
      [formItemCls]: {
        [`${formItemCls}-label > label`]: {
          height
        },
        [`${formItemCls}-control-input`]: {
          minHeight: height
        }
      }
    };
  };
  const genFormStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: {
        ...resetComponent(token2),
        ...resetForm(token2),
        [`${componentCls}-text`]: {
          display: "inline-block",
          paddingInlineEnd: token2.paddingSM
        },


"&-small": {
          ...genFormSize(token2, token2.controlHeightSM)
        },
        "&-large": {
          ...genFormSize(token2, token2.controlHeightLG)
        }
      }
    };
  };
  const genFormItemStyle = (token2) => {
    const {
      formItemCls,
      iconCls,
      rootPrefixCls,
      antCls,
      labelRequiredMarkColor,
      labelColor,
      labelFontSize,
      labelHeight,
      labelColonMarginInlineStart,
      labelColonMarginInlineEnd,
      itemMarginBottom
    } = token2;
    const [varName] = genCssVar(antCls, "grid");
    return {
      [formItemCls]: {
        ...resetComponent(token2),
        marginBottom: itemMarginBottom,
        verticalAlign: "top",
        "&-with-help": {
          transition: "none"
        },
        [`&-hidden,
        &-hidden${antCls}-row`]: {
display: "none"
        },
        "&-has-warning": {
          [`${formItemCls}-split`]: {
            color: token2.colorError
          }
        },
        "&-has-error": {
          [`${formItemCls}-split`]: {
            color: token2.colorWarning
          }
        },


[`${formItemCls}-label`]: {
          flexGrow: 0,
          overflow: "hidden",
          whiteSpace: "nowrap",
          textAlign: "end",
          verticalAlign: "middle",
          "&-left": {
            textAlign: "start"
          },
          "&-wrap": {
            overflow: "unset",
            lineHeight: token2.lineHeight,
            whiteSpace: "unset",
            "> label": {
              verticalAlign: "middle",
              textWrap: "balance"
            }
          },
          "> label": {
            position: "relative",
            display: "inline-flex",
            alignItems: "center",
            maxWidth: "100%",
            height: labelHeight,
            color: labelColor,
            fontSize: labelFontSize,
            [`> ${iconCls}`]: {
              fontSize: token2.fontSize,
              verticalAlign: "top"
            },
            [`&${formItemCls}-required`]: {
              "&::before": {
                display: "inline-block",
                marginInlineEnd: token2.marginXXS,
                color: labelRequiredMarkColor,
                fontSize: token2.fontSize,
                fontFamily: "sans-serif",
                lineHeight: 1,
                content: '"*"'
              },
              [`&${formItemCls}-required-mark-hidden, &${formItemCls}-required-mark-optional`]: {
                "&::before": {
                  display: "none"
                }
              }
            },
[`${formItemCls}-optional`]: {
              display: "inline-block",
              marginInlineStart: token2.marginXXS,
              color: token2.colorTextDescription,
              [`&${formItemCls}-required-mark-hidden`]: {
                display: "none"
              }
            },
[`${formItemCls}-tooltip`]: {
              color: token2.colorTextDescription,
              cursor: "help",
              writingMode: "horizontal-tb",
              marginInlineStart: token2.marginXXS
            },
            "&::after": {
              content: '":"',
              position: "relative",
              marginBlock: 0,
              marginInlineStart: labelColonMarginInlineStart,
              marginInlineEnd: labelColonMarginInlineEnd
            },
            [`&${formItemCls}-no-colon::after`]: {
              content: '"\\a0"'
            }
          }
        },


[`${formItemCls}-control`]: {
          [varName("display")]: "flex",
          flexDirection: "column",
          flexGrow: 1,
          [`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: {
            width: "100%"
          },
          "&-input": {
            position: "relative",
            display: "flex",
            alignItems: "center",
            minHeight: token2.controlHeight,
            "&-content": {
              flex: "auto",
              maxWidth: "100%",

[`&:has(> ${antCls}-switch:only-child, > ${antCls}-rate:only-child)`]: {
                display: "flex",
                alignItems: "center"
              }
            }
          }
        },


[formItemCls]: {
          "&-additional": {
            display: "flex",
            flexDirection: "column"
          },
          "&-explain, &-extra": {
            clear: "both",
            color: token2.colorTextDescription,
            fontSize: token2.fontSize,
            lineHeight: token2.lineHeight
          },
          "&-explain-connected": {
            width: "100%"
          },
          "&-extra": {
            minHeight: token2.controlHeightSM,
            transition: `color ${token2.motionDurationMid} ${token2.motionEaseOut}`
},
          "&-explain": {
            "&-error": {
              color: token2.colorError
            },
            "&-warning": {
              color: token2.colorWarning
            }
          }
        },
        [`&-with-help ${formItemCls}-explain`]: {
          height: "auto",
          opacity: 1
        },


[`${formItemCls}-feedback-icon`]: {
          fontSize: token2.fontSize,
          textAlign: "center",
          visibility: "visible",
          animationName: zoomIn,
          animationDuration: token2.motionDurationMid,
          animationTimingFunction: token2.motionEaseOutBack,
          pointerEvents: "none",
          "&-success": {
            color: token2.colorSuccess
          },
          "&-error": {
            color: token2.colorError
          },
          "&-warning": {
            color: token2.colorWarning
          },
          "&-validating": {
            color: token2.colorPrimary
          }
        }
      }
    };
  };
  const makeVerticalLayoutLabel = (token2) => ({
    padding: token2.verticalLabelPadding,
    margin: token2.verticalLabelMargin,
    whiteSpace: "initial",
    textAlign: "start",
    "> label": {
      margin: 0,
      "&::after": {
visibility: "hidden"
      }
    }
  });
  const genHorizontalStyle = (token2) => {
    const {
      antCls,
      formItemCls
    } = token2;
    return {
      [`${formItemCls}-horizontal`]: {
        [`${formItemCls}-label`]: {
          flexGrow: 0
        },
        [`${formItemCls}-control`]: {
          flex: "1 1 0",

minWidth: 0
        },



[`${formItemCls}-label[class$='-24'], ${formItemCls}-label[class*='-24 ']`]: {
          [`& + ${formItemCls}-control`]: {
            minWidth: "unset"
          }
        },
        [`${antCls}-col-24${formItemCls}-label,
        ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
      }
    };
  };
  const genInlineStyle = (token2) => {
    const {
      componentCls,
      formItemCls,
      inlineItemMarginBottom
    } = token2;
    return {
      [`${componentCls}-inline`]: {
        display: "flex",
        flexWrap: "wrap",
        [`${formItemCls}-inline`]: {
          flex: "none",
          marginInlineEnd: token2.margin,
          marginBottom: inlineItemMarginBottom,
          "&-row": {
            flexWrap: "nowrap"
          },
          [`> ${formItemCls}-label,
        > ${formItemCls}-control`]: {
            display: "inline-block",
            verticalAlign: "top"
          },
          [`> ${formItemCls}-label`]: {
            flex: "none"
          },
          [`${componentCls}-text`]: {
            display: "inline-block"
          },
          [`${formItemCls}-has-feedback`]: {
            display: "inline-block"
          }
        }
      }
    };
  };
  const makeVerticalLayout = (token2) => {
    const {
      componentCls,
      formItemCls,
      rootPrefixCls
    } = token2;
    return {
      [`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token2),
[`${componentCls}:not(${componentCls}-inline)`]: {
        [formItemCls]: {
          flexWrap: "wrap",
          [`${formItemCls}-label, ${formItemCls}-control`]: {


[`&:not([class*=" ${rootPrefixCls}-col-xs"])`]: {
              flex: "0 0 100%",
              maxWidth: "100%"
            }
          }
        }
      }
    };
  };
  const genVerticalStyle = (token2) => {
    const {
      componentCls,
      formItemCls,
      antCls
    } = token2;
    return {
      [`${formItemCls}-vertical`]: {
        [`${formItemCls}-row`]: {
          flexDirection: "column"
        },
        [`${formItemCls}-label > label`]: {
          height: "auto"
        },
        [`${formItemCls}-control`]: {
          width: "100%"
        },
        [`${formItemCls}-label,
        ${antCls}-col-24${formItemCls}-label,
        ${antCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
      },
      [`@media (max-width: ${unit$1(token2.screenXSMax)})`]: [makeVerticalLayout(token2), {
        [componentCls]: {
          [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
            [`${antCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
          }
        }
      }],
      [`@media (max-width: ${unit$1(token2.screenSMMax)})`]: {
        [componentCls]: {
          [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
            [`${antCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
          }
        }
      },
      [`@media (max-width: ${unit$1(token2.screenMDMax)})`]: {
        [componentCls]: {
          [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
            [`${antCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
          }
        }
      },
      [`@media (max-width: ${unit$1(token2.screenLGMax)})`]: {
        [componentCls]: {
          [`${formItemCls}:not(${formItemCls}-horizontal)`]: {
            [`${antCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
          }
        }
      }
    };
  };
  const prepareComponentToken$6 = (token2) => ({
    labelRequiredMarkColor: token2.colorError,
    labelColor: token2.colorTextHeading,
    labelFontSize: token2.fontSize,
    labelHeight: token2.controlHeight,
    labelColonMarginInlineStart: token2.marginXXS / 2,
    labelColonMarginInlineEnd: token2.marginXS,
    itemMarginBottom: token2.marginLG,
    verticalLabelPadding: `0 0 ${token2.paddingXS}px`,
    verticalLabelMargin: 0,
    inlineItemMarginBottom: 0
  });
  const prepareToken$2 = (token2, rootPrefixCls) => {
    const formToken = merge(token2, {
      formItemCls: `${token2.componentCls}-item`,
      rootPrefixCls
    });
    return formToken;
  };
  const useStyle$7 = genStyleHooks("Form", (token2, {
    rootPrefixCls
  }) => {
    const formToken = prepareToken$2(token2, rootPrefixCls);
    return [genFormStyle(formToken), genFormItemStyle(formToken), genFormValidateMotionStyle(formToken), genHorizontalStyle(formToken), genInlineStyle(formToken), genVerticalStyle(formToken), genCollapseMotion(formToken), zoomIn];
  }, prepareComponentToken$6, {

order: -1e3
  });
  const ValidateMessagesContext = React.createContext(void 0);
  const InternalForm = (props, ref) => {
    const contextDisabled = React__namespace.useContext(DisabledContext);
    const {
      getPrefixCls,
      direction,
      requiredMark: contextRequiredMark,
      colon: contextColon,
      scrollToFirstError: contextScrollToFirstError,
      className: contextClassName,
      style: contextStyle,
      styles: contextStyles,
      classNames: contextClassNames,
      tooltip: contextTooltip
    } = useComponentConfig("form");
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      size,
      disabled = contextDisabled,
      form,
      colon,
      labelAlign,
      labelWrap,
      labelCol,
      wrapperCol,
      layout = "horizontal",
      scrollToFirstError,
      requiredMark,
      onFinishFailed,
      name,
      style: style2,
      feedbackIcons,
      variant,
      classNames,
      styles,
      tooltip,
      ...restFormProps
    } = props;
    const mergedSize = useSize(size);
    const contextValidateMessages = React__namespace.useContext(ValidateMessagesContext);
    const mergedRequiredMark = React__namespace.useMemo(() => {
      if (requiredMark !== void 0) {
        return requiredMark;
      }
      if (contextRequiredMark !== void 0) {
        return contextRequiredMark;
      }
      return true;
    }, [requiredMark, contextRequiredMark]);
    const mergedColon = colon ?? contextColon;
    const mergedTooltip = {
      ...contextTooltip,
      ...tooltip
    };
    const prefixCls = getPrefixCls("form", customizePrefixCls);
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$7(prefixCls, rootCls);
    const mergedProps = {
      ...props,
      size: mergedSize,
      disabled,
      layout,
      colon: mergedColon,
      requiredMark: mergedRequiredMark
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
      props: mergedProps
    });
    const formClassName = clsx(prefixCls, `${prefixCls}-${layout}`, {
      [`${prefixCls}-hide-required-mark`]: mergedRequiredMark === false,
[`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-large`]: mergedSize === "large",
      [`${prefixCls}-small`]: mergedSize === "small"
    }, cssVarCls, rootCls, hashId, contextClassName, className, rootClassName, mergedClassNames.root);
    const [wrapForm] = useForm(form);
    const {
      __INTERNAL__
    } = wrapForm;
    __INTERNAL__.name = name;
    const formContextValue = React__namespace.useMemo(() => ({
      name,
      labelAlign,
      labelCol,
      labelWrap,
      wrapperCol,
      layout,
      colon: mergedColon,
      requiredMark: mergedRequiredMark,
      itemRef: __INTERNAL__.itemRef,
      form: wrapForm,
      feedbackIcons,
      tooltip: mergedTooltip,
      classNames: mergedClassNames,
      styles: mergedStyles
    }), [name, labelAlign, labelCol, wrapperCol, layout, mergedColon, mergedRequiredMark, wrapForm, feedbackIcons, mergedClassNames, mergedStyles, mergedTooltip]);
    const nativeElementRef = React__namespace.useRef(null);
    React__namespace.useImperativeHandle(ref, () => ({
      ...wrapForm,
      nativeElement: nativeElementRef.current?.nativeElement
    }));
    const scrollToField = (options, fieldName) => {
      if (options) {
        let defaultScrollToFirstError = {
          block: "nearest"
        };
        if (typeof options === "object") {
          defaultScrollToFirstError = {
            ...defaultScrollToFirstError,
            ...options
          };
        }
        wrapForm.scrollToField(fieldName, defaultScrollToFirstError);
      }
    };
    const onInternalFinishFailed = (errorInfo) => {
      onFinishFailed?.(errorInfo);
      if (errorInfo.errorFields.length) {
        const fieldName = errorInfo.errorFields[0].name;
        if (scrollToFirstError !== void 0) {
          scrollToField(scrollToFirstError, fieldName);
          return;
        }
        if (contextScrollToFirstError !== void 0) {
          scrollToField(contextScrollToFirstError, fieldName);
        }
      }
    };
    return React__namespace.createElement(VariantContext.Provider, {
      value: variant
    }, React__namespace.createElement(DisabledContextProvider, {
      disabled
    }, React__namespace.createElement(SizeContext.Provider, {
      value: mergedSize
    }, React__namespace.createElement(FormProvider, {
validateMessages: contextValidateMessages
    }, React__namespace.createElement(FormContext.Provider, {
      value: formContextValue
    }, React__namespace.createElement(NoFormStyle, {
      status: true
    }, React__namespace.createElement(RefForm, {
      id: name,
      ...restFormProps,
      name,
      onFinishFailed: onInternalFinishFailed,
      form: wrapForm,
      ref: nativeElementRef,
      style: {
        ...mergedStyles?.root,
        ...contextStyle,
        ...style2
      },
      className: formClassName
    })))))));
  };
  const Form$1 = React__namespace.forwardRef(InternalForm);
  const CollectionContext = React__namespace.createContext(null);
  function Collection({
    children,
    onBatchResize
  }) {
    const resizeIdRef = React__namespace.useRef(0);
    const resizeInfosRef = React__namespace.useRef([]);
    const onCollectionResize = React__namespace.useContext(CollectionContext);
    const onResize2 = React__namespace.useCallback((size, element, data) => {
      resizeIdRef.current += 1;
      const currentId = resizeIdRef.current;
      resizeInfosRef.current.push({
        size,
        element,
        data
      });
      Promise.resolve().then(() => {
        if (currentId === resizeIdRef.current) {
          onBatchResize?.(resizeInfosRef.current);
          resizeInfosRef.current = [];
        }
      });
      onCollectionResize?.(size, element, data);
    }, [onBatchResize, onCollectionResize]);
    return React__namespace.createElement(CollectionContext.Provider, {
      value: onResize2
    }, children);
  }
  const elementListeners = new Map();
  function onResize(entities) {
    entities.forEach((entity) => {
      const {
        target
      } = entity;
      elementListeners.get(target)?.forEach((listener) => listener(target));
    });
  }
  let observer;
  function ensureResizeObserver() {
    if (!observer) {
      observer = new ResizeObserver(onResize);
    }
    return observer;
  }
  function observe(element, callback) {
    if (!elementListeners.has(element)) {
      elementListeners.set(element, new Set());
      ensureResizeObserver().observe(element);
    }
    elementListeners.get(element).add(callback);
  }
  function unobserve(element, callback) {
    if (elementListeners.has(element)) {
      elementListeners.get(element).delete(callback);
      if (!elementListeners.get(element).size) {
        ensureResizeObserver().unobserve(element);
        elementListeners.delete(element);
      }
    }
  }
  function useResizeObserver(enabled, getTarget, onDelayResize, onSyncResize) {
    const sizeRef = React__namespace.useRef({
      width: -1,
      height: -1,
      offsetWidth: -1,
      offsetHeight: -1
    });
    const onInternalResize = useEvent((target) => {
      const {
        width,
        height
      } = target.getBoundingClientRect();
      const {
        offsetWidth,
        offsetHeight
      } = target;
      const fixedWidth = Math.floor(width);
      const fixedHeight = Math.floor(height);
      if (sizeRef.current.width !== fixedWidth || sizeRef.current.height !== fixedHeight || sizeRef.current.offsetWidth !== offsetWidth || sizeRef.current.offsetHeight !== offsetHeight) {
        const size = {
          width: fixedWidth,
          height: fixedHeight,
          offsetWidth,
          offsetHeight
        };
        sizeRef.current = size;
        const mergedOffsetWidth = offsetWidth === Math.round(width) ? width : offsetWidth;
        const mergedOffsetHeight = offsetHeight === Math.round(height) ? height : offsetHeight;
        const sizeInfo = {
          ...size,
          offsetWidth: mergedOffsetWidth,
          offsetHeight: mergedOffsetHeight
        };
        onSyncResize?.(sizeInfo, target);
        Promise.resolve().then(() => {
          onDelayResize?.(sizeInfo, target);
        });
      }
    });
    const isFuncTarget = typeof getTarget === "function";
    const funcTargetIdRef = React__namespace.useRef(0);
    React__namespace.useEffect(() => {
      const target = isFuncTarget ? getTarget() : getTarget;
      if (target && enabled) {
        observe(target, onInternalResize);
      } else if (enabled && isFuncTarget) {
        funcTargetIdRef.current += 1;
      }
      return () => {
        if (target) {
          unobserve(target, onInternalResize);
        }
      };
    }, [
      enabled,

isFuncTarget ? funcTargetIdRef.current : getTarget
    ]);
  }
  function SingleObserver(props, ref) {
    const {
      children,
      disabled,
      onResize: onResize2,
      data
    } = props;
    const elementRef = React__namespace.useRef(null);
    const onCollectionResize = React__namespace.useContext(CollectionContext);
    const isRenderProps = typeof children === "function";
    const mergedChildren = isRenderProps ? children(elementRef) : children;
    const canRef = !isRenderProps && React__namespace.isValidElement(mergedChildren) && supportRef(mergedChildren);
    const originRef = canRef ? getNodeRef(mergedChildren) : null;
    const mergedRef = useComposeRef(originRef, elementRef);
    const getDomElement = () => {
      return getDOM(elementRef.current);
    };
    React__namespace.useImperativeHandle(ref, () => getDomElement());
    useResizeObserver(!disabled, getDomElement, onResize2, (sizeInfo, target) => {
      onCollectionResize?.(sizeInfo, target, data);
    });
    return canRef ? React__namespace.cloneElement(mergedChildren, {
      ref: mergedRef
    }) : mergedChildren;
  }
  const RefSingleObserver = React__namespace.forwardRef(SingleObserver);
  function _extends$j() {
    _extends$j = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$j.apply(this, arguments);
  }
  const INTERNAL_PREFIX_KEY = "rc-observer-key";
  function ResizeObserver$1(props, ref) {
    const {
      children
    } = props;
    const childNodes = typeof children === "function" ? [children] : toArray$3(children);
    return childNodes.map((child, index) => {
      const key = child?.key || `${INTERNAL_PREFIX_KEY}-${index}`;
      return React__namespace.createElement(RefSingleObserver, _extends$j({}, props, {
        key,
        ref: index === 0 ? ref : void 0
      }), child);
    });
  }
  const RefResizeObserver = React__namespace.forwardRef(ResizeObserver$1);
  RefResizeObserver.Collection = Collection;
  var CheckCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
  function _extends$i() {
    _extends$i = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$i.apply(this, arguments);
  }
  const CheckCircleFilled = (props, ref) => React__namespace.createElement(Icon, _extends$i({}, props, {
    ref,
    icon: CheckCircleFilled$1
  }));
  const RefIcon$5 = React__namespace.forwardRef(CheckCircleFilled);
  var CloseCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
  function _extends$h() {
    _extends$h = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$h.apply(this, arguments);
  }
  const CloseCircleFilled = (props, ref) => React__namespace.createElement(Icon, _extends$h({}, props, {
    ref,
    icon: CloseCircleFilled$1
  }));
  const RefIcon$4 = React__namespace.forwardRef(CloseCircleFilled);
  var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
  function _extends$g() {
    _extends$g = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$g.apply(this, arguments);
  }
  const ExclamationCircleFilled = (props, ref) => React__namespace.createElement(Icon, _extends$g({}, props, {
    ref,
    icon: ExclamationCircleFilled$1
  }));
  const RefIcon$3 = React__namespace.forwardRef(ExclamationCircleFilled);
  var InfoCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
  function _extends$f() {
    _extends$f = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$f.apply(this, arguments);
  }
  const InfoCircleFilled = (props, ref) => React__namespace.createElement(Icon, _extends$f({}, props, {
    ref,
    icon: InfoCircleFilled$1
  }));
  const RefIcon$2 = React__namespace.forwardRef(InfoCircleFilled);
  const Context = React__namespace.createContext({});
  const MotionProvider = (props) => {
    const {
      children,
      ...rest
    } = props;
    const memoizedValue = React__namespace.useMemo(() => {
      return {
        motion: rest.motion
      };
    }, [rest.motion]);
    return React__namespace.createElement(Context.Provider, {
      value: memoizedValue
    }, children);
  };
  function useSyncState(defaultValue) {
    const [, forceUpdate] = React__namespace.useReducer((x) => x + 1, 0);
    const currentValueRef = React__namespace.useRef(defaultValue);
    const getValue2 = useEvent(() => {
      return currentValueRef.current;
    });
    const setValue = useEvent((updater) => {
      currentValueRef.current = typeof updater === "function" ? updater(currentValueRef.current) : updater;
      forceUpdate();
    });
    return [getValue2, setValue];
  }
  const STATUS_NONE = "none";
  const STATUS_APPEAR = "appear";
  const STATUS_ENTER = "enter";
  const STATUS_LEAVE = "leave";
  const STEP_NONE = "none";
  const STEP_PREPARE = "prepare";
  const STEP_START = "start";
  const STEP_ACTIVE = "active";
  const STEP_ACTIVATED = "end";
  const STEP_PREPARED = "prepared";
  function makePrefixMap(styleProp, eventName) {
    const prefixes = {};
    prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
    prefixes[`Webkit${styleProp}`] = `webkit${eventName}`;
    prefixes[`Moz${styleProp}`] = `moz${eventName}`;
    prefixes[`ms${styleProp}`] = `MS${eventName}`;
    prefixes[`O${styleProp}`] = `o${eventName.toLowerCase()}`;
    return prefixes;
  }
  function getVendorPrefixes(domSupport, win) {
    const prefixes = {
      animationend: makePrefixMap("Animation", "AnimationEnd"),
      transitionend: makePrefixMap("Transition", "TransitionEnd")
    };
    if (domSupport) {
      if (!("AnimationEvent" in win)) {
        delete prefixes.animationend.animation;
      }
      if (!("TransitionEvent" in win)) {
        delete prefixes.transitionend.transition;
      }
    }
    return prefixes;
  }
  const vendorPrefixes = getVendorPrefixes(canUseDom(), typeof window !== "undefined" ? window : {});
  let style = {};
  if (canUseDom()) {
    ({
      style
    } = document.createElement("div"));
  }
  const prefixedEventNames = {};
  function getVendorPrefixedEventName(eventName) {
    if (prefixedEventNames[eventName]) {
      return prefixedEventNames[eventName];
    }
    const prefixMap = vendorPrefixes[eventName];
    if (prefixMap) {
      const stylePropList = Object.keys(prefixMap);
      const len = stylePropList.length;
      for (let i = 0; i < len; i += 1) {
        const styleProp = stylePropList[i];
        if (Object.prototype.hasOwnProperty.call(prefixMap, styleProp) && styleProp in style) {
          prefixedEventNames[eventName] = prefixMap[styleProp];
          return prefixedEventNames[eventName];
        }
      }
    }
    return "";
  }
  const internalAnimationEndName = getVendorPrefixedEventName("animationend");
  const internalTransitionEndName = getVendorPrefixedEventName("transitionend");
  const supportTransition = !!(internalAnimationEndName && internalTransitionEndName);
  const animationEndName = internalAnimationEndName || "animationend";
  const transitionEndName = internalTransitionEndName || "transitionend";
  function getTransitionName$1(transitionName, transitionType) {
    if (!transitionName) return null;
    if (typeof transitionName === "object") {
      const type4 = transitionType.replace(/-\w/g, (match2) => match2[1].toUpperCase());
      return transitionName[type4];
    }
    return `${transitionName}-${transitionType}`;
  }
  const useDomMotionEvents = ((onInternalMotionEnd) => {
    const cacheElementRef = React.useRef();
    function removeMotionEvents(element) {
      if (element) {
        element.removeEventListener(transitionEndName, onInternalMotionEnd);
        element.removeEventListener(animationEndName, onInternalMotionEnd);
      }
    }
    function patchMotionEvents(element) {
      if (cacheElementRef.current && cacheElementRef.current !== element) {
        removeMotionEvents(cacheElementRef.current);
      }
      if (element && element !== cacheElementRef.current) {
        element.addEventListener(transitionEndName, onInternalMotionEnd);
        element.addEventListener(animationEndName, onInternalMotionEnd);
        cacheElementRef.current = element;
      }
    }
    React__namespace.useEffect(() => () => {
      removeMotionEvents(cacheElementRef.current);
      cacheElementRef.current = null;
    }, []);
    return [patchMotionEvents, removeMotionEvents];
  });
  const useIsomorphicLayoutEffect = canUseDom() ? React.useLayoutEffect : React.useEffect;
  const useNextFrame = (() => {
    const nextFrameRef = React__namespace.useRef(null);
    function cancelNextFrame() {
      wrapperRaf.cancel(nextFrameRef.current);
    }
    function nextFrame(callback, delay = 2) {
      cancelNextFrame();
      const nextFrameId = wrapperRaf(() => {
        if (delay <= 1) {
          callback({
            isCanceled: () => nextFrameId !== nextFrameRef.current
          });
        } else {
          nextFrame(callback, delay - 1);
        }
      });
      nextFrameRef.current = nextFrameId;
    }
    React__namespace.useEffect(() => () => {
      cancelNextFrame();
    }, []);
    return [nextFrame, cancelNextFrame];
  });
  const FULL_STEP_QUEUE = [STEP_PREPARE, STEP_START, STEP_ACTIVE, STEP_ACTIVATED];
  const SIMPLE_STEP_QUEUE = [STEP_PREPARE, STEP_PREPARED];
  const SkipStep = false;
  const DoStep = true;
  function isActive(step) {
    return step === STEP_ACTIVE || step === STEP_ACTIVATED;
  }
  const useStepQueue = ((status, prepareOnly, callback) => {
    const [step, setStep] = useSafeState(STEP_NONE);
    const [nextFrame, cancelNextFrame] = useNextFrame();
    function startQueue() {
      setStep(STEP_PREPARE, true);
    }
    const STEP_QUEUE = prepareOnly ? SIMPLE_STEP_QUEUE : FULL_STEP_QUEUE;
    useIsomorphicLayoutEffect(() => {
      if (step !== STEP_NONE && step !== STEP_ACTIVATED) {
        const index = STEP_QUEUE.indexOf(step);
        const nextStep = STEP_QUEUE[index + 1];
        const result = callback(step);
        if (result === SkipStep) {
          setStep(nextStep, true);
        } else if (nextStep) {
          nextFrame((info) => {
            function doNext() {
              if (info.isCanceled()) return;
              setStep(nextStep, true);
            }
            if (result === true) {
              doNext();
            } else {
              Promise.resolve(result).then(doNext);
            }
          });
        }
      }
    }, [status, step]);
    React__namespace.useEffect(() => () => {
      cancelNextFrame();
    }, []);
    return [startQueue, step];
  });
  function useStatus(supportMotion, visible, getElement, {
    motionEnter = true,
    motionAppear = true,
    motionLeave = true,
    motionDeadline,
    motionLeaveImmediately,
    onAppearPrepare,
    onEnterPrepare,
    onLeavePrepare,
    onAppearStart,
    onEnterStart,
    onLeaveStart,
    onAppearActive,
    onEnterActive,
    onLeaveActive,
    onAppearEnd,
    onEnterEnd,
    onLeaveEnd,
    onVisibleChanged
  }) {
    const [asyncVisible, setAsyncVisible] = React__namespace.useState();
    const [getStatus2, setStatus] = useSyncState(STATUS_NONE);
    const [style2, setStyle] = React__namespace.useState([null, null]);
    const currentStatus = getStatus2();
    const mountedRef = React.useRef(false);
    const deadlineRef = React.useRef(null);
    function getDomElement() {
      return getElement();
    }
    const activeRef = React.useRef(false);
    function updateMotionEndStatus() {
      setStatus(STATUS_NONE);
      setStyle([null, null]);
    }
    const onInternalMotionEnd = useEvent((event) => {
      const status = getStatus2();
      if (status === STATUS_NONE) {
        return;
      }
      const element = getDomElement();
      if (event && !event.deadline && event.target !== element) {
        return;
      }
      const currentActive = activeRef.current;
      let canEnd;
      if (status === STATUS_APPEAR && currentActive) {
        canEnd = onAppearEnd?.(element, event);
      } else if (status === STATUS_ENTER && currentActive) {
        canEnd = onEnterEnd?.(element, event);
      } else if (status === STATUS_LEAVE && currentActive) {
        canEnd = onLeaveEnd?.(element, event);
      }
      if (currentActive && canEnd !== false) {
        updateMotionEndStatus();
      }
    });
    const [patchMotionEvents] = useDomMotionEvents(onInternalMotionEnd);
    const getEventHandlers = (targetStatus) => {
      switch (targetStatus) {
        case STATUS_APPEAR:
          return {
            [STEP_PREPARE]: onAppearPrepare,
            [STEP_START]: onAppearStart,
            [STEP_ACTIVE]: onAppearActive
          };
        case STATUS_ENTER:
          return {
            [STEP_PREPARE]: onEnterPrepare,
            [STEP_START]: onEnterStart,
            [STEP_ACTIVE]: onEnterActive
          };
        case STATUS_LEAVE:
          return {
            [STEP_PREPARE]: onLeavePrepare,
            [STEP_START]: onLeaveStart,
            [STEP_ACTIVE]: onLeaveActive
          };
        default:
          return {};
      }
    };
    const eventHandlers = React__namespace.useMemo(() => getEventHandlers(currentStatus), [currentStatus]);
    const [startStep, step] = useStepQueue(currentStatus, !supportMotion, (newStep) => {
      if (newStep === STEP_PREPARE) {
        const onPrepare = eventHandlers[STEP_PREPARE];
        if (!onPrepare) {
          return SkipStep;
        }
        return onPrepare(getDomElement());
      }
      if (newStep in eventHandlers) {
        setStyle([eventHandlers[newStep]?.(getDomElement(), null) || null, newStep]);
      }
      if (newStep === STEP_ACTIVE && currentStatus !== STATUS_NONE) {
        patchMotionEvents(getDomElement());
        if (motionDeadline > 0) {
          clearTimeout(deadlineRef.current);
          deadlineRef.current = setTimeout(() => {
            onInternalMotionEnd({
              deadline: true
            });
          }, motionDeadline);
        }
      }
      if (newStep === STEP_PREPARED) {
        updateMotionEndStatus();
      }
      return DoStep;
    });
    const active = isActive(step);
    activeRef.current = active;
    const visibleRef = React.useRef(null);
    useIsomorphicLayoutEffect(() => {
      if (mountedRef.current && visibleRef.current === visible) {
        return;
      }
      setAsyncVisible(visible);
      const isMounted = mountedRef.current;
      mountedRef.current = true;
      let nextStatus;
      if (!isMounted && visible && motionAppear) {
        nextStatus = STATUS_APPEAR;
      }
      if (isMounted && visible && motionEnter) {
        nextStatus = STATUS_ENTER;
      }
      if (isMounted && !visible && motionLeave || !isMounted && motionLeaveImmediately && !visible && motionLeave) {
        nextStatus = STATUS_LEAVE;
      }
      const nextEventHandlers = getEventHandlers(nextStatus);
      if (nextStatus && (supportMotion || nextEventHandlers[STEP_PREPARE])) {
        setStatus(nextStatus);
        startStep();
      } else {
        setStatus(STATUS_NONE);
      }
      visibleRef.current = visible;
    }, [visible]);
    React.useEffect(() => {
      if (
currentStatus === STATUS_APPEAR && !motionAppear ||
currentStatus === STATUS_ENTER && !motionEnter ||
currentStatus === STATUS_LEAVE && !motionLeave
      ) {
        setStatus(STATUS_NONE);
      }
    }, [motionAppear, motionEnter, motionLeave]);
    React.useEffect(() => () => {
      mountedRef.current = false;
      clearTimeout(deadlineRef.current);
    }, []);
    const firstMountChangeRef = React__namespace.useRef(false);
    React.useEffect(() => {
      if (asyncVisible) {
        firstMountChangeRef.current = true;
      }
      if (asyncVisible !== void 0 && currentStatus === STATUS_NONE) {
        if (firstMountChangeRef.current || asyncVisible) {
          onVisibleChanged?.(asyncVisible);
        }
        firstMountChangeRef.current = true;
      }
    }, [asyncVisible, currentStatus]);
    let mergedStyle = style2[0];
    if (eventHandlers[STEP_PREPARE] && step === STEP_START) {
      mergedStyle = {
        transition: "none",
        ...mergedStyle
      };
    }
    const styleStep = style2[1];
    return [
      getStatus2,
      step,
      mergedStyle,
      asyncVisible ?? visible,
!mountedRef.current && currentStatus === STATUS_NONE && supportMotion && motionAppear ? "NONE" : (
step === STEP_START || step === STEP_ACTIVE ? styleStep === step : true
      )
    ];
  }
  function isRefNotConsumed(children) {
    return children?.length < 2;
  }
  function genCSSMotion(config) {
    let transitionSupport = config;
    if (typeof config === "object") {
      ({
        transitionSupport
      } = config);
    }
    function isSupportTransition(props, contextMotion) {
      return !!(props.motionName && transitionSupport && contextMotion !== false);
    }
    const CSSMotion2 = React__namespace.forwardRef((props, ref) => {
      const {
visible = true,
        removeOnLeave = true,
        forceRender,
        children,
        motionName,
        leavedClassName,
        eventProps
      } = props;
      const {
        motion: contextMotion
      } = React__namespace.useContext(Context);
      const supportMotion = isSupportTransition(props, contextMotion);
      const nodeRef = React.useRef();
      function getDomElement() {
        return getDOM(nodeRef.current);
      }
      const [getStatus2, statusStep, statusStyle, mergedVisible, styleReady] = useStatus(supportMotion, visible, getDomElement, props);
      const status = getStatus2();
      const renderedRef = React__namespace.useRef(mergedVisible);
      if (mergedVisible) {
        renderedRef.current = true;
      }
      const refObj = React__namespace.useMemo(() => {
        const obj = {};
        Object.defineProperties(obj, {
          nativeElement: {
            enumerable: true,
            get: getDomElement
          },
          inMotion: {
            enumerable: true,
            get: () => () => getStatus2() !== STATUS_NONE
          },
          enableMotion: {
            enumerable: true,
            get: () => () => supportMotion
          }
        });
        return obj;
      }, []);
      React__namespace.useImperativeHandle(ref, () => refObj, []);
      const idRef = React__namespace.useRef(0);
      if (styleReady) {
        idRef.current += 1;
      }
      const returnNode = React__namespace.useMemo(() => {
        if (styleReady === "NONE") {
          return null;
        }
        let motionChildren;
        const mergedProps = {
          ...eventProps,
          visible
        };
        if (!children) {
          motionChildren = null;
        } else if (status === STATUS_NONE) {
          if (mergedVisible) {
            motionChildren = children({
              ...mergedProps
            }, nodeRef);
          } else if (!removeOnLeave && renderedRef.current && leavedClassName) {
            motionChildren = children({
              ...mergedProps,
              className: leavedClassName
            }, nodeRef);
          } else if (forceRender || !removeOnLeave && !leavedClassName) {
            motionChildren = children({
              ...mergedProps,
              style: {
                display: "none"
              }
            }, nodeRef);
          } else {
            motionChildren = null;
          }
        } else {
          let statusSuffix;
          if (statusStep === STEP_PREPARE) {
            statusSuffix = "prepare";
          } else if (isActive(statusStep)) {
            statusSuffix = "active";
          } else if (statusStep === STEP_START) {
            statusSuffix = "start";
          }
          const motionCls = getTransitionName$1(motionName, `${status}-${statusSuffix}`);
          motionChildren = children({
            ...mergedProps,
            className: clsx(getTransitionName$1(motionName, status), {
              [motionCls]: motionCls && statusSuffix,
              [motionName]: typeof motionName === "string"
            }),
            style: statusStyle
          }, nodeRef);
        }
        return motionChildren;
      }, [idRef.current]);
      if (isRefNotConsumed(children) && supportNodeRef(returnNode)) {
        const originNodeRef = getNodeRef(returnNode);
        if (originNodeRef !== nodeRef) {
          return React__namespace.cloneElement(returnNode, {
            ref: composeRef(originNodeRef, nodeRef)
          });
        }
      }
      return returnNode;
    });
    CSSMotion2.displayName = "CSSMotion";
    return CSSMotion2;
  }
  const CSSMotion = genCSSMotion(supportTransition);
  const STATUS_ADD = "add";
  const STATUS_KEEP = "keep";
  const STATUS_REMOVE = "remove";
  const STATUS_REMOVED = "removed";
  function wrapKeyToObject(key) {
    let keyObj;
    if (key && typeof key === "object" && "key" in key) {
      keyObj = key;
    } else {
      keyObj = {
        key
      };
    }
    return {
      ...keyObj,
      key: String(keyObj.key)
    };
  }
  function parseKeys(keys2 = []) {
    return keys2.map(wrapKeyToObject);
  }
  function diffKeys(prevKeys = [], currentKeys = []) {
    let list = [];
    let currentIndex = 0;
    const currentLen = currentKeys.length;
    const prevKeyObjects = parseKeys(prevKeys);
    const currentKeyObjects = parseKeys(currentKeys);
    prevKeyObjects.forEach((keyObj) => {
      let hit = false;
      for (let i = currentIndex; i < currentLen; i += 1) {
        const currentKeyObj = currentKeyObjects[i];
        if (currentKeyObj.key === keyObj.key) {
          if (currentIndex < i) {
            list = list.concat(currentKeyObjects.slice(currentIndex, i).map((obj) => ({
              ...obj,
              status: STATUS_ADD
            })));
            currentIndex = i;
          }
          list.push({
            ...currentKeyObj,
            status: STATUS_KEEP
          });
          currentIndex += 1;
          hit = true;
          break;
        }
      }
      if (!hit) {
        list.push({
          ...keyObj,
          status: STATUS_REMOVE
        });
      }
    });
    if (currentIndex < currentLen) {
      list = list.concat(currentKeyObjects.slice(currentIndex).map((obj) => ({
        ...obj,
        status: STATUS_ADD
      })));
    }
    const keys2 = {};
    list.forEach(({
      key
    }) => {
      keys2[key] = (keys2[key] || 0) + 1;
    });
    const duplicatedKeys = Object.keys(keys2).filter((key) => keys2[key] > 1);
    duplicatedKeys.forEach((matchKey) => {
      list = list.filter(({
        key,
        status
      }) => key !== matchKey || status !== STATUS_REMOVE);
      list.forEach((node2) => {
        if (node2.key === matchKey) {
          node2.status = STATUS_KEEP;
        }
      });
    });
    return list;
  }
  function _extends$e() {
    _extends$e = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$e.apply(this, arguments);
  }
  const MOTION_PROP_NAMES = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearPrepare", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"];
  function genCSSMotionList(transitionSupport, CSSMotion$1 = CSSMotion) {
    class CSSMotionList2 extends React__namespace.Component {
      static defaultProps = {
        component: "div"
      };
      state = {
        keyEntities: []
      };
      static getDerivedStateFromProps({
        keys: keys2
      }, {
        keyEntities
      }) {
        const parsedKeyObjects = parseKeys(keys2);
        const mixedKeyEntities = diffKeys(keyEntities, parsedKeyObjects);
        return {
          keyEntities: mixedKeyEntities.filter((entity) => {
            const prevEntity = keyEntities.find(({
              key
            }) => entity.key === key);
            if (prevEntity && prevEntity.status === STATUS_REMOVED && entity.status === STATUS_REMOVE) {
              return false;
            }
            return true;
          })
        };
      }
removeKey = (removeKey) => {
        this.setState((prevState) => {
          const nextKeyEntities = prevState.keyEntities.map((entity) => {
            if (entity.key !== removeKey) return entity;
            return {
              ...entity,
              status: STATUS_REMOVED
            };
          });
          return {
            keyEntities: nextKeyEntities
          };
        }, () => {
          const {
            keyEntities
          } = this.state;
          const restKeysCount = keyEntities.filter(({
            status
          }) => status !== STATUS_REMOVED).length;
          if (restKeysCount === 0 && this.props.onAllRemoved) {
            this.props.onAllRemoved();
          }
        });
      };
      render() {
        const {
          keyEntities
        } = this.state;
        const {
          component,
          children,
          onVisibleChanged,
          onAllRemoved,
          ...restProps
        } = this.props;
        const Component = component || React__namespace.Fragment;
        const motionProps = {};
        MOTION_PROP_NAMES.forEach((prop) => {
          motionProps[prop] = restProps[prop];
          delete restProps[prop];
        });
        delete restProps.keys;
        return React__namespace.createElement(Component, restProps, keyEntities.map(({
          status,
          ...eventProps
        }, index) => {
          const visible = status === STATUS_ADD || status === STATUS_KEEP;
          return React__namespace.createElement(CSSMotion$1, _extends$e({}, motionProps, {
            key: eventProps.key,
            visible,
            eventProps,
            onVisibleChanged: (changedVisible) => {
              onVisibleChanged?.(changedVisible, {
                key: eventProps.key
              });
              if (!changedVisible) {
                this.removeKey(eventProps.key);
              }
            }
          }), isRefNotConsumed(children) ? (props) => children({
            ...props,
            index
          }) : (props, ref) => children({
            ...props,
            index
          }, ref));
        }));
      }
    }
    return CSSMotionList2;
  }
  const CSSMotionList = genCSSMotionList();
  const OrderContext = React__namespace.createContext(null);
  let inline = false;
  function inlineMock(nextInline) {
    return inline;
  }
  const EMPTY_LIST$1 = [];
  function useDom(render2, debug) {
    const [ele] = React__namespace.useState(() => {
      if (!canUseDom()) {
        return null;
      }
      const defaultEle = document.createElement("div");
      return defaultEle;
    });
    const appendedRef = React__namespace.useRef(false);
    const queueCreate = React__namespace.useContext(OrderContext);
    const [queue, setQueue] = React__namespace.useState(EMPTY_LIST$1);
    const mergedQueueCreate = queueCreate || (appendedRef.current ? void 0 : (appendFn) => {
      setQueue((origin) => {
        const newQueue = [appendFn, ...origin];
        return newQueue;
      });
    });
    function append2() {
      if (!ele.parentElement) {
        document.body.appendChild(ele);
      }
      appendedRef.current = true;
    }
    function cleanup2() {
      ele.parentElement?.removeChild(ele);
      appendedRef.current = false;
    }
    useLayoutEffect(() => {
      if (render2) {
        if (queueCreate) {
          queueCreate(append2);
        } else {
          append2();
        }
      } else {
        cleanup2();
      }
      return cleanup2;
    }, [render2]);
    useLayoutEffect(() => {
      if (queue.length) {
        queue.forEach((appendFn) => appendFn());
        setQueue(EMPTY_LIST$1);
      }
    }, [queue]);
    return [ele, mergedQueueCreate];
  }
  function measureScrollbarSize(ele) {
    const randomId = `rc-scrollbar-measure-${Math.random().toString(36).substring(7)}`;
    const measureEle = document.createElement("div");
    measureEle.id = randomId;
    const measureStyle = measureEle.style;
    measureStyle.position = "absolute";
    measureStyle.left = "0";
    measureStyle.top = "0";
    measureStyle.width = "100px";
    measureStyle.height = "100px";
    measureStyle.overflow = "scroll";
    let fallbackWidth;
    let fallbackHeight;
    if (ele) {
      const targetStyle = getComputedStyle(ele);
      measureStyle.scrollbarColor = targetStyle.scrollbarColor;
      measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
      const webkitScrollbarStyle = getComputedStyle(ele, "::-webkit-scrollbar");
      const width = parseInt(webkitScrollbarStyle.width, 10);
      const height = parseInt(webkitScrollbarStyle.height, 10);
      try {
        const widthStyle = width ? `width: ${webkitScrollbarStyle.width};` : "";
        const heightStyle = height ? `height: ${webkitScrollbarStyle.height};` : "";
        updateCSS(`
#${randomId}::-webkit-scrollbar {
${widthStyle}
${heightStyle}
}`, randomId);
      } catch (e2) {
        console.error(e2);
        fallbackWidth = width;
        fallbackHeight = height;
      }
    }
    document.body.appendChild(measureEle);
    const scrollWidth = ele && fallbackWidth && !Number.isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
    const scrollHeight = ele && fallbackHeight && !Number.isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
    document.body.removeChild(measureEle);
    removeCSS(randomId);
    return {
      width: scrollWidth,
      height: scrollHeight
    };
  }
  function getTargetScrollBarSize(target) {
    if (typeof document === "undefined" || !target || !(target instanceof Element)) {
      return {
        width: 0,
        height: 0
      };
    }
    return measureScrollbarSize(target);
  }
  function isBodyOverflowing() {
    return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
  }
  const UNIQUE_ID = `rc-util-locker-${Date.now()}`;
  let uuid$2 = 0;
  function useScrollLocker(lock) {
    const mergedLock = !!lock;
    const [id] = React__namespace.useState(() => {
      uuid$2 += 1;
      return `${UNIQUE_ID}_${uuid$2}`;
    });
    useLayoutEffect(() => {
      if (mergedLock) {
        const scrollbarSize = getTargetScrollBarSize(document.body).width;
        const isOverflow = isBodyOverflowing();
        updateCSS(`
html body {
  overflow-y: hidden;
  ${isOverflow ? `width: calc(100% - ${scrollbarSize}px);` : ""}
}`, id);
      } else {
        removeCSS(id);
      }
      return () => {
        removeCSS(id);
      };
    }, [mergedLock, id]);
  }
  function getUseId() {
    const fullClone = {
      ...React__namespace
    };
    return fullClone.useId;
  }
  let uuid$1 = 0;
  const useOriginId = getUseId();
  const useId = useOriginId ? (
(function useId2(id) {
      const reactId = useOriginId();
      if (id) {
        return id;
      }
      return reactId;
    })
  ) : (
(function useCompatId(id) {
      const [innerId, setInnerId] = React__namespace.useState("ssr-id");
      React__namespace.useEffect(() => {
        const nextId = uuid$1;
        uuid$1 += 1;
        setInnerId(`rc_unique_${nextId}`);
      }, []);
      if (id) {
        return id;
      }
      return innerId;
    })
  );
  let stack = [];
  const IME_LOCK_DURATION = 200;
  let lastCompositionEndTime = 0;
  const onGlobalKeyDown = (event) => {
    if (event.key === "Escape" && !event.isComposing) {
      const now = Date.now();
      if (now - lastCompositionEndTime < IME_LOCK_DURATION) {
        return;
      }
      const len = stack.length;
      for (let i = len - 1; i >= 0; i -= 1) {
        stack[i].onEsc({
          top: i === len - 1,
          event
        });
      }
    }
  };
  const onGlobalCompositionEnd = () => {
    lastCompositionEndTime = Date.now();
  };
  function attachGlobalEventListeners() {
    window.addEventListener("keydown", onGlobalKeyDown);
    window.addEventListener("compositionend", onGlobalCompositionEnd);
  }
  function detachGlobalEventListeners() {
    if (stack.length === 0) {
      window.removeEventListener("keydown", onGlobalKeyDown);
      window.removeEventListener("compositionend", onGlobalCompositionEnd);
    }
  }
  function useEscKeyDown(open2, onEsc) {
    const id = useId();
    const onEventEsc = useEvent(onEsc);
    const ensure = () => {
      if (!stack.find((item) => item.id === id)) {
        stack.push({
          id,
          onEsc: onEventEsc
        });
      }
    };
    const clear = () => {
      stack = stack.filter((item) => item.id !== id);
    };
    React.useMemo(() => {
      if (open2) {
        ensure();
      } else if (!open2) {
        clear();
      }
    }, [open2]);
    React.useEffect(() => {
      if (open2) {
        ensure();
        attachGlobalEventListeners();
        return () => {
          clear();
          detachGlobalEventListeners();
        };
      }
    }, [open2]);
  }
  const getPortalContainer = (getContainer2) => {
    if (getContainer2 === false) {
      return false;
    }
    if (!canUseDom() || !getContainer2) {
      return null;
    }
    if (typeof getContainer2 === "string") {
      return document.querySelector(getContainer2);
    }
    if (typeof getContainer2 === "function") {
      return getContainer2();
    }
    return getContainer2;
  };
  const Portal = React__namespace.forwardRef((props, ref) => {
    const {
      open: open2,
      autoLock,
      getContainer: getContainer2,
      debug,
      autoDestroy = true,
      children,
      onEsc
    } = props;
    const [shouldRender, setShouldRender] = React__namespace.useState(open2);
    const mergedRender = shouldRender || open2;
    React__namespace.useEffect(() => {
      if (autoDestroy || open2) {
        setShouldRender(open2);
      }
    }, [open2, autoDestroy]);
    const [innerContainer, setInnerContainer] = React__namespace.useState(() => getPortalContainer(getContainer2));
    React__namespace.useEffect(() => {
      const customizeContainer = getPortalContainer(getContainer2);
      setInnerContainer(() => (

customizeContainer ?? null
      ));
    });
    const [defaultContainer, queueCreate] = useDom(mergedRender && !innerContainer);
    const mergedContainer = innerContainer ?? defaultContainer;
    useScrollLocker(autoLock && open2 && canUseDom() && (mergedContainer === defaultContainer || mergedContainer === document.body));
    useEscKeyDown(open2, onEsc);
    let childRef = null;
    if (children && supportRef(children) && ref) {
      childRef = getNodeRef(children);
    }
    const mergedRef = useComposeRef(childRef, ref);
    if (!mergedRender || !canUseDom() || innerContainer === void 0) {
      return null;
    }
    const renderInline = mergedContainer === false || inlineMock();
    let reffedChildren = children;
    if (ref) {
      reffedChildren = React__namespace.cloneElement(children, {
        ref: mergedRef
      });
    }
    return React__namespace.createElement(OrderContext.Provider, {
      value: queueCreate
    }, renderInline ? reffedChildren : require$$0.createPortal(reffedChildren, mergedContainer));
  });
  function Arrow(props) {
    const {
      prefixCls,
      align,
      arrow,
      arrowPos
    } = props;
    const {
      className,
      content,
      style: style2
    } = arrow || {};
    const {
      x = 0,
      y = 0
    } = arrowPos;
    const arrowRef = React__namespace.useRef(null);
    if (!align || !align.points) {
      return null;
    }
    const alignStyle = {
      position: "absolute"
    };
    if (align.autoArrow !== false) {
      const popupPoints = align.points[0];
      const targetPoints = align.points[1];
      const popupTB = popupPoints[0];
      const popupLR = popupPoints[1];
      const targetTB = targetPoints[0];
      const targetLR = targetPoints[1];
      if (popupTB === targetTB || !["t", "b"].includes(popupTB)) {
        alignStyle.top = y;
      } else if (popupTB === "t") {
        alignStyle.top = 0;
      } else {
        alignStyle.bottom = 0;
      }
      if (popupLR === targetLR || !["l", "r"].includes(popupLR)) {
        alignStyle.left = x;
      } else if (popupLR === "l") {
        alignStyle.left = 0;
      } else {
        alignStyle.right = 0;
      }
    }
    return React__namespace.createElement("div", {
      ref: arrowRef,
      className: clsx(`${prefixCls}-arrow`, className),
      style: {
        ...alignStyle,
        ...style2
      }
    }, content);
  }
  function _extends$d() {
    _extends$d = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$d.apply(this, arguments);
  }
  function Mask$1(props) {
    const {
      prefixCls,
      open: open2,
      zIndex,
      mask,
      motion,
      mobile
    } = props;
    if (!mask) {
      return null;
    }
    return React__namespace.createElement(CSSMotion, _extends$d({}, motion, {
      motionAppear: true,
      visible: open2,
      removeOnLeave: true
    }), ({
      className
    }) => React__namespace.createElement("div", {
      style: {
        zIndex
      },
      className: clsx(`${prefixCls}-mask`, mobile && `${prefixCls}-mobile-mask`, className)
    }));
  }
  const PopupContent = React__namespace.memo(({
    children
  }) => children, (_, next2) => next2.cache);
  function useOffsetStyle(isMobile, ready, open2, align, offsetR, offsetB, offsetX, offsetY) {
    const AUTO = "auto";
    const offsetStyle = isMobile ? {} : {
      left: "-1000vw",
      top: "-1000vh",
      right: AUTO,
      bottom: AUTO
    };
    if (!isMobile && (ready || !open2)) {
      const {
        points
      } = align;
      const dynamicInset = align.dynamicInset || align._experimental?.dynamicInset;
      const alignRight = dynamicInset && points[0][1] === "r";
      const alignBottom = dynamicInset && points[0][0] === "b";
      if (alignRight) {
        offsetStyle.right = offsetR;
        offsetStyle.left = AUTO;
      } else {
        offsetStyle.left = offsetX;
        offsetStyle.right = AUTO;
      }
      if (alignBottom) {
        offsetStyle.bottom = offsetB;
        offsetStyle.top = AUTO;
      } else {
        offsetStyle.top = offsetY;
        offsetStyle.bottom = AUTO;
      }
    }
    return offsetStyle;
  }
  function _extends$c() {
    _extends$c = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$c.apply(this, arguments);
  }
  const Popup$1 = React__namespace.forwardRef((props, ref) => {
    const {
      onEsc,
      popup,
      className,
      prefixCls,
      style: style2,
      target,
      onVisibleChanged,
open: open2,
      keepDom,
      fresh,
onClick,
mask,
arrow,
      arrowPos,
      align,
motion,
      maskMotion,
mobile,
forceRender,
      getPopupContainer,
      autoDestroy,
      portal: Portal2,
      children,
      zIndex,
      onMouseEnter,
      onMouseLeave,
      onPointerEnter,
      onPointerDownCapture,
      ready,
      offsetX,
      offsetY,
      offsetR,
      offsetB,
      onAlign,
      onPrepare,
onResize: onResize2,
      stretch,
      targetWidth,
      targetHeight
    } = props;
    const popupContent = typeof popup === "function" ? popup() : popup;
    const isNodeVisible = open2 || keepDom;
    const isMobile = !!mobile;
    const [mergedMask, mergedMaskMotion, mergedPopupMotion] = React__namespace.useMemo(() => {
      if (mobile) {
        return [mobile.mask, mobile.maskMotion, mobile.motion];
      }
      return [mask, maskMotion, motion];
    }, [mobile, mask, maskMotion, motion]);
    const getPopupContainerNeedParams = getPopupContainer?.length > 0;
    const [show, setShow] = React__namespace.useState(!getPopupContainer || !getPopupContainerNeedParams);
    useLayoutEffect(() => {
      if (!show && getPopupContainerNeedParams && target) {
        setShow(true);
      }
    }, [show, getPopupContainerNeedParams, target]);
    const onInternalResize = useEvent((size, ele) => {
      onResize2?.(size, ele);
      onAlign();
    });
    const offsetStyle = useOffsetStyle(isMobile, ready, open2, align, offsetR, offsetB, offsetX, offsetY);
    if (!show) {
      return null;
    }
    const miscStyle = {};
    if (stretch) {
      if (stretch.includes("height") && targetHeight) {
        miscStyle.height = targetHeight;
      } else if (stretch.includes("minHeight") && targetHeight) {
        miscStyle.minHeight = targetHeight;
      }
      if (stretch.includes("width") && targetWidth) {
        miscStyle.width = targetWidth;
      } else if (stretch.includes("minWidth") && targetWidth) {
        miscStyle.minWidth = targetWidth;
      }
    }
    if (!open2) {
      miscStyle.pointerEvents = "none";
    }
    return React__namespace.createElement(Portal2, {
      open: forceRender || isNodeVisible,
      getContainer: getPopupContainer && (() => getPopupContainer(target)),
      autoDestroy,
      onEsc
    }, React__namespace.createElement(Mask$1, {
      prefixCls,
      open: open2,
      zIndex,
      mask: mergedMask,
      motion: mergedMaskMotion,
      mobile: isMobile
    }), React__namespace.createElement(RefResizeObserver, {
      onResize: onInternalResize,
      disabled: !open2
    }, (resizeObserverRef) => {
      return React__namespace.createElement(CSSMotion, _extends$c({
        motionAppear: true,
        motionEnter: true,
        motionLeave: true,
        removeOnLeave: false,
        forceRender,
        leavedClassName: `${prefixCls}-hidden`
      }, mergedPopupMotion, {
        onAppearPrepare: onPrepare,
        onEnterPrepare: onPrepare,
        visible: open2,
        onVisibleChanged: (nextVisible) => {
          motion?.onVisibleChanged?.(nextVisible);
          onVisibleChanged(nextVisible);
        }
      }), ({
        className: motionClassName,
        style: motionStyle
      }, motionRef) => {
        const cls = clsx(prefixCls, motionClassName, className, {
          [`${prefixCls}-mobile`]: isMobile
        });
        return React__namespace.createElement("div", {
          ref: composeRef(resizeObserverRef, ref, motionRef),
          className: cls,
          style: {
            "--arrow-x": `${arrowPos.x || 0}px`,
            "--arrow-y": `${arrowPos.y || 0}px`,
            ...offsetStyle,
            ...miscStyle,
            ...motionStyle,
            boxSizing: "border-box",
            zIndex,
            ...style2
          },
          onMouseEnter,
          onMouseLeave,
          onPointerEnter,
          onClick,
          onPointerDownCapture
        }, arrow && React__namespace.createElement(Arrow, {
          prefixCls,
          arrow,
          arrowPos,
          align
        }), React__namespace.createElement(PopupContent, {
          cache: !open2 && !fresh
        }, popupContent));
      });
    }), children);
  });
  const TriggerContext = React__namespace.createContext(null);
  const UniqueContext = React__namespace.createContext(null);
  function toArray(val) {
    return val ? Array.isArray(val) ? val : [val] : [];
  }
  function useAction(action, showAction, hideAction) {
    return React__namespace.useMemo(() => {
      const mergedShowAction = toArray(showAction ?? action);
      const mergedHideAction = toArray(hideAction ?? action);
      const showActionSet = new Set(mergedShowAction);
      const hideActionSet = new Set(mergedHideAction);
      if (showActionSet.has("hover") && !showActionSet.has("click")) {
        showActionSet.add("touch");
      }
      if (hideActionSet.has("hover") && !hideActionSet.has("click")) {
        hideActionSet.add("touch");
      }
      return [showActionSet, hideActionSet];
    }, [action, showAction, hideAction]);
  }
  const isVisible = ((element) => {
    if (!element) {
      return false;
    }
    if (element instanceof Element) {
      if (element.offsetParent) {
        return true;
      }
      if (element.getBBox) {
        const {
          width,
          height
        } = element.getBBox();
        if (width || height) {
          return true;
        }
      }
      if (element.getBoundingClientRect) {
        const {
          width,
          height
        } = element.getBoundingClientRect();
        if (width || height) {
          return true;
        }
      }
    }
    return false;
  });
  function isPointsEq(a1 = [], a2 = [], isAlignPoint) {
    const getVal = (a, index) => a[index] || "";
    if (isAlignPoint) {
      return getVal(a1, 0) === getVal(a2, 0);
    }
    return getVal(a1, 0) === getVal(a2, 0) && getVal(a1, 1) === getVal(a2, 1);
  }
  function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
    const {
      points
    } = align;
    const placements2 = Object.keys(builtinPlacements);
    for (let i = 0; i < placements2.length; i += 1) {
      const placement = placements2[i];
      if (isPointsEq(builtinPlacements[placement]?.points, points, isAlignPoint)) {
        return `${prefixCls}-placement-${placement}`;
      }
    }
    return "";
  }
  function getWin(ele) {
    return ele.ownerDocument.defaultView;
  }
  function collectScroller(ele) {
    const scrollerList = [];
    let current = ele?.parentElement;
    const scrollStyle = ["hidden", "scroll", "clip", "auto"];
    while (current) {
      const {
        overflowX,
        overflowY,
        overflow
      } = getWin(current).getComputedStyle(current);
      if ([overflowX, overflowY, overflow].some((o2) => scrollStyle.includes(o2))) {
        scrollerList.push(current);
      }
      current = current.parentElement;
    }
    return scrollerList;
  }
  function toNum(num, defaultValue = 1) {
    return Number.isNaN(num) ? defaultValue : num;
  }
  function getPxValue(val) {
    return toNum(parseFloat(val), 0);
  }
  function getVisibleArea(initArea, scrollerList) {
    const visibleArea = {
      ...initArea
    };
    (scrollerList || []).forEach((ele) => {
      if (ele instanceof HTMLBodyElement || ele instanceof HTMLHtmlElement) {
        return;
      }
      const {
        overflow,
        overflowClipMargin,
        borderTopWidth,
        borderBottomWidth,
        borderLeftWidth,
        borderRightWidth
      } = getWin(ele).getComputedStyle(ele);
      const eleRect = ele.getBoundingClientRect();
      const {
        offsetHeight: eleOutHeight,
        clientHeight: eleInnerHeight,
        offsetWidth: eleOutWidth,
        clientWidth: eleInnerWidth
      } = ele;
      const borderTopNum = getPxValue(borderTopWidth);
      const borderBottomNum = getPxValue(borderBottomWidth);
      const borderLeftNum = getPxValue(borderLeftWidth);
      const borderRightNum = getPxValue(borderRightWidth);
      const scaleX = toNum(Math.round(eleRect.width / eleOutWidth * 1e3) / 1e3);
      const scaleY = toNum(Math.round(eleRect.height / eleOutHeight * 1e3) / 1e3);
      const eleScrollWidth = (eleOutWidth - eleInnerWidth - borderLeftNum - borderRightNum) * scaleX;
      const eleScrollHeight = (eleOutHeight - eleInnerHeight - borderTopNum - borderBottomNum) * scaleY;
      const scaledBorderTopWidth = borderTopNum * scaleY;
      const scaledBorderBottomWidth = borderBottomNum * scaleY;
      const scaledBorderLeftWidth = borderLeftNum * scaleX;
      const scaledBorderRightWidth = borderRightNum * scaleX;
      let clipMarginWidth = 0;
      let clipMarginHeight = 0;
      if (overflow === "clip") {
        const clipNum = getPxValue(overflowClipMargin);
        clipMarginWidth = clipNum * scaleX;
        clipMarginHeight = clipNum * scaleY;
      }
      const eleLeft = eleRect.x + scaledBorderLeftWidth - clipMarginWidth;
      const eleTop = eleRect.y + scaledBorderTopWidth - clipMarginHeight;
      const eleRight = eleLeft + eleRect.width + 2 * clipMarginWidth - scaledBorderLeftWidth - scaledBorderRightWidth - eleScrollWidth;
      const eleBottom = eleTop + eleRect.height + 2 * clipMarginHeight - scaledBorderTopWidth - scaledBorderBottomWidth - eleScrollHeight;
      visibleArea.left = Math.max(visibleArea.left, eleLeft);
      visibleArea.top = Math.max(visibleArea.top, eleTop);
      visibleArea.right = Math.min(visibleArea.right, eleRight);
      visibleArea.bottom = Math.min(visibleArea.bottom, eleBottom);
    });
    return visibleArea;
  }
  function getUnitOffset(size, offset2 = 0) {
    const offsetStr = `${offset2}`;
    const cells = offsetStr.match(/^(.*)\%$/);
    if (cells) {
      return size * (parseFloat(cells[1]) / 100);
    }
    return parseFloat(offsetStr);
  }
  function getNumberOffset(rect, offset2) {
    const [offsetX, offsetY] = offset2 || [];
    return [getUnitOffset(rect.width, offsetX), getUnitOffset(rect.height, offsetY)];
  }
  function splitPoints(points = "") {
    return [points[0], points[1]];
  }
  function getAlignPoint(rect, points) {
    const topBottom = points[0];
    const leftRight = points[1];
    let x;
    let y;
    if (topBottom === "t") {
      y = rect.y;
    } else if (topBottom === "b") {
      y = rect.y + rect.height;
    } else {
      y = rect.y + rect.height / 2;
    }
    if (leftRight === "l") {
      x = rect.x;
    } else if (leftRight === "r") {
      x = rect.x + rect.width;
    } else {
      x = rect.x + rect.width / 2;
    }
    return {
      x,
      y
    };
  }
  function reversePoints(points, index) {
    const reverseMap = {
      t: "b",
      b: "t",
      l: "r",
      r: "l"
    };
    const clone = [...points];
    clone[index] = reverseMap[points[index]] || "c";
    return clone;
  }
  function flatPoints(points) {
    return points.join("");
  }
  function useAlign(open2, popupEle, target, placement, builtinPlacements, popupAlign, onPopupAlign, mobile) {
    const [offsetInfo, setOffsetInfo] = React__namespace.useState({
      ready: false,
      offsetX: 0,
      offsetY: 0,
      offsetR: 0,
      offsetB: 0,
      arrowX: 0,
      arrowY: 0,
      scaleX: 1,
      scaleY: 1,
      align: builtinPlacements[placement] || {}
    });
    const alignCountRef = React__namespace.useRef(0);
    const scrollerList = React__namespace.useMemo(() => {
      if (!popupEle || mobile) {
        return [];
      }
      return collectScroller(popupEle);
    }, [popupEle]);
    const prevFlipRef = React__namespace.useRef({});
    const resetFlipCache = () => {
      prevFlipRef.current = {};
    };
    if (!open2) {
      resetFlipCache();
    }
    const onAlign = useEvent(() => {
      if (popupEle && target && open2 && !mobile) {
        let getIntersectionVisibleArea = function(offsetX, offsetY, area = visibleArea) {
          const l2 = popupRect.x + offsetX;
          const t2 = popupRect.y + offsetY;
          const r2 = l2 + popupWidth;
          const b = t2 + popupHeight;
          const visibleL = Math.max(l2, area.left);
          const visibleT = Math.max(t2, area.top);
          const visibleR = Math.min(r2, area.right);
          const visibleB = Math.min(b, area.bottom);
          return Math.max(0, (visibleR - visibleL) * (visibleB - visibleT));
        }, syncNextPopupPosition = function() {
          nextPopupY = popupRect.y + nextOffsetY;
          nextPopupBottom = nextPopupY + popupHeight;
          nextPopupX = popupRect.x + nextOffsetX;
          nextPopupRight = nextPopupX + popupWidth;
        };
        const popupElement = popupEle;
        const doc = popupElement.ownerDocument;
        const win = getWin(popupElement);
        const {
          position: popupPosition
        } = win.getComputedStyle(popupElement);
        const originLeft = popupElement.style.left;
        const originTop = popupElement.style.top;
        const originRight = popupElement.style.right;
        const originBottom = popupElement.style.bottom;
        const originOverflow = popupElement.style.overflow;
        const placementInfo = {
          ...builtinPlacements[placement],
          ...popupAlign
        };
        const placeholderElement = doc.createElement("div");
        popupElement.parentElement?.appendChild(placeholderElement);
        placeholderElement.style.left = `${popupElement.offsetLeft}px`;
        placeholderElement.style.top = `${popupElement.offsetTop}px`;
        placeholderElement.style.position = popupPosition;
        placeholderElement.style.height = `${popupElement.offsetHeight}px`;
        placeholderElement.style.width = `${popupElement.offsetWidth}px`;
        popupElement.style.left = "0";
        popupElement.style.top = "0";
        popupElement.style.right = "auto";
        popupElement.style.bottom = "auto";
        popupElement.style.overflow = "hidden";
        let targetRect;
        if (Array.isArray(target)) {
          targetRect = {
            x: target[0],
            y: target[1],
            width: 0,
            height: 0
          };
        } else {
          const rect = target.getBoundingClientRect();
          rect.x = rect.x ?? rect.left;
          rect.y = rect.y ?? rect.top;
          targetRect = {
            x: rect.x,
            y: rect.y,
            width: rect.width,
            height: rect.height
          };
        }
        const popupRect = popupElement.getBoundingClientRect();
        const {
          height,
          width
        } = win.getComputedStyle(popupElement);
        popupRect.x = popupRect.x ?? popupRect.left;
        popupRect.y = popupRect.y ?? popupRect.top;
        const {
          clientWidth,
          clientHeight,
          scrollWidth,
          scrollHeight,
          scrollTop,
          scrollLeft
        } = doc.documentElement;
        const popupHeight = popupRect.height;
        const popupWidth = popupRect.width;
        const targetHeight = targetRect.height;
        const targetWidth = targetRect.width;
        const visibleRegion = {
          left: 0,
          top: 0,
          right: clientWidth,
          bottom: clientHeight
        };
        const scrollRegion = {
          left: -scrollLeft,
          top: -scrollTop,
          right: scrollWidth - scrollLeft,
          bottom: scrollHeight - scrollTop
        };
        let {
          htmlRegion
        } = placementInfo;
        const VISIBLE = "visible";
        const VISIBLE_FIRST = "visibleFirst";
        if (htmlRegion !== "scroll" && htmlRegion !== VISIBLE_FIRST) {
          htmlRegion = VISIBLE;
        }
        const isVisibleFirst = htmlRegion === VISIBLE_FIRST;
        const scrollRegionArea = getVisibleArea(scrollRegion, scrollerList);
        const visibleRegionArea = getVisibleArea(visibleRegion, scrollerList);
        const visibleArea = htmlRegion === VISIBLE ? visibleRegionArea : scrollRegionArea;
        const adjustCheckVisibleArea = isVisibleFirst ? visibleRegionArea : visibleArea;
        popupElement.style.left = "auto";
        popupElement.style.top = "auto";
        popupElement.style.right = "0";
        popupElement.style.bottom = "0";
        const popupMirrorRect = popupElement.getBoundingClientRect();
        popupElement.style.left = originLeft;
        popupElement.style.top = originTop;
        popupElement.style.right = originRight;
        popupElement.style.bottom = originBottom;
        popupElement.style.overflow = originOverflow;
        popupElement.parentElement?.removeChild(placeholderElement);
        const scaleX = toNum(Math.round(popupWidth / parseFloat(width) * 1e3) / 1e3);
        const scaleY = toNum(Math.round(popupHeight / parseFloat(height) * 1e3) / 1e3);
        if (scaleX === 0 || scaleY === 0 || isDOM(target) && !isVisible(target)) {
          return;
        }
        const {
          offset: offset2,
          targetOffset: targetOffset2
        } = placementInfo;
        let [popupOffsetX, popupOffsetY] = getNumberOffset(popupRect, offset2);
        const [targetOffsetX, targetOffsetY] = getNumberOffset(targetRect, targetOffset2);
        targetRect.x -= targetOffsetX;
        targetRect.y -= targetOffsetY;
        const [popupPoint, targetPoint] = placementInfo.points || [];
        const targetPoints = splitPoints(targetPoint);
        const popupPoints = splitPoints(popupPoint);
        const targetAlignPoint = getAlignPoint(targetRect, targetPoints);
        const popupAlignPoint = getAlignPoint(popupRect, popupPoints);
        const nextAlignInfo = {
          ...placementInfo
        };
        let nextPoints = [popupPoints, targetPoints];
        let nextOffsetX = targetAlignPoint.x - popupAlignPoint.x + popupOffsetX;
        let nextOffsetY = targetAlignPoint.y - popupAlignPoint.y + popupOffsetY;
        const originIntersectionVisibleArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY);
        const originIntersectionRecommendArea = getIntersectionVisibleArea(nextOffsetX, nextOffsetY, visibleRegionArea);
        const targetAlignPointTL = getAlignPoint(targetRect, ["t", "l"]);
        const popupAlignPointTL = getAlignPoint(popupRect, ["t", "l"]);
        const targetAlignPointBR = getAlignPoint(targetRect, ["b", "r"]);
        const popupAlignPointBR = getAlignPoint(popupRect, ["b", "r"]);
        const overflow = placementInfo.overflow || {};
        const {
          adjustX,
          adjustY,
          shiftX,
          shiftY
        } = overflow;
        const supportAdjust = (val) => {
          if (typeof val === "boolean") {
            return val;
          }
          return val >= 0;
        };
        let nextPopupY;
        let nextPopupBottom;
        let nextPopupX;
        let nextPopupRight;
        syncNextPopupPosition();
        const needAdjustY = supportAdjust(adjustY);
        const sameTB = popupPoints[0] === targetPoints[0];
        if (needAdjustY && popupPoints[0] === "t" && (nextPopupBottom > adjustCheckVisibleArea.bottom || prevFlipRef.current.bt)) {
          let tmpNextOffsetY = nextOffsetY;
          if (sameTB) {
            tmpNextOffsetY -= popupHeight - targetHeight;
          } else {
            tmpNextOffsetY = targetAlignPointTL.y - popupAlignPointBR.y - popupOffsetY;
          }
          const newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
          const newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
          if (
newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
newVisibleRecommendArea >= originIntersectionRecommendArea)
          ) {
            prevFlipRef.current.bt = true;
            nextOffsetY = tmpNextOffsetY;
            popupOffsetY = -popupOffsetY;
            nextPoints = [reversePoints(nextPoints[0], 0), reversePoints(nextPoints[1], 0)];
          } else {
            prevFlipRef.current.bt = false;
          }
        }
        if (needAdjustY && popupPoints[0] === "b" && (nextPopupY < adjustCheckVisibleArea.top || prevFlipRef.current.tb)) {
          let tmpNextOffsetY = nextOffsetY;
          if (sameTB) {
            tmpNextOffsetY += popupHeight - targetHeight;
          } else {
            tmpNextOffsetY = targetAlignPointBR.y - popupAlignPointTL.y - popupOffsetY;
          }
          const newVisibleArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY);
          const newVisibleRecommendArea = getIntersectionVisibleArea(nextOffsetX, tmpNextOffsetY, visibleRegionArea);
          if (
newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
newVisibleRecommendArea >= originIntersectionRecommendArea)
          ) {
            prevFlipRef.current.tb = true;
            nextOffsetY = tmpNextOffsetY;
            popupOffsetY = -popupOffsetY;
            nextPoints = [reversePoints(nextPoints[0], 0), reversePoints(nextPoints[1], 0)];
          } else {
            prevFlipRef.current.tb = false;
          }
        }
        const needAdjustX = supportAdjust(adjustX);
        const sameLR = popupPoints[1] === targetPoints[1];
        if (needAdjustX && popupPoints[1] === "l" && (nextPopupRight > adjustCheckVisibleArea.right || prevFlipRef.current.rl)) {
          let tmpNextOffsetX = nextOffsetX;
          if (sameLR) {
            tmpNextOffsetX -= popupWidth - targetWidth;
          } else {
            tmpNextOffsetX = targetAlignPointTL.x - popupAlignPointBR.x - popupOffsetX;
          }
          const newVisibleArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
          const newVisibleRecommendArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
          if (
newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
newVisibleRecommendArea >= originIntersectionRecommendArea)
          ) {
            prevFlipRef.current.rl = true;
            nextOffsetX = tmpNextOffsetX;
            popupOffsetX = -popupOffsetX;
            nextPoints = [reversePoints(nextPoints[0], 1), reversePoints(nextPoints[1], 1)];
          } else {
            prevFlipRef.current.rl = false;
          }
        }
        if (needAdjustX && popupPoints[1] === "r" && (nextPopupX < adjustCheckVisibleArea.left || prevFlipRef.current.lr)) {
          let tmpNextOffsetX = nextOffsetX;
          if (sameLR) {
            tmpNextOffsetX += popupWidth - targetWidth;
          } else {
            tmpNextOffsetX = targetAlignPointBR.x - popupAlignPointTL.x - popupOffsetX;
          }
          const newVisibleArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY);
          const newVisibleRecommendArea = getIntersectionVisibleArea(tmpNextOffsetX, nextOffsetY, visibleRegionArea);
          if (
newVisibleArea > originIntersectionVisibleArea || newVisibleArea === originIntersectionVisibleArea && (!isVisibleFirst ||
newVisibleRecommendArea >= originIntersectionRecommendArea)
          ) {
            prevFlipRef.current.lr = true;
            nextOffsetX = tmpNextOffsetX;
            popupOffsetX = -popupOffsetX;
            nextPoints = [reversePoints(nextPoints[0], 1), reversePoints(nextPoints[1], 1)];
          } else {
            prevFlipRef.current.lr = false;
          }
        }
        nextAlignInfo.points = [flatPoints(nextPoints[0]), flatPoints(nextPoints[1])];
        syncNextPopupPosition();
        const numShiftX = shiftX === true ? 0 : shiftX;
        if (typeof numShiftX === "number") {
          if (nextPopupX < visibleRegionArea.left) {
            nextOffsetX -= nextPopupX - visibleRegionArea.left - popupOffsetX;
            if (targetRect.x + targetWidth < visibleRegionArea.left + numShiftX) {
              nextOffsetX += targetRect.x - visibleRegionArea.left + targetWidth - numShiftX;
            }
          }
          if (nextPopupRight > visibleRegionArea.right) {
            nextOffsetX -= nextPopupRight - visibleRegionArea.right - popupOffsetX;
            if (targetRect.x > visibleRegionArea.right - numShiftX) {
              nextOffsetX += targetRect.x - visibleRegionArea.right + numShiftX;
            }
          }
        }
        const numShiftY = shiftY === true ? 0 : shiftY;
        if (typeof numShiftY === "number") {
          if (nextPopupY < visibleRegionArea.top) {
            nextOffsetY -= nextPopupY - visibleRegionArea.top - popupOffsetY;
            if (targetRect.y + targetHeight < visibleRegionArea.top + numShiftY) {
              nextOffsetY += targetRect.y - visibleRegionArea.top + targetHeight - numShiftY;
            }
          }
          if (nextPopupBottom > visibleRegionArea.bottom) {
            nextOffsetY -= nextPopupBottom - visibleRegionArea.bottom - popupOffsetY;
            if (targetRect.y > visibleRegionArea.bottom - numShiftY) {
              nextOffsetY += targetRect.y - visibleRegionArea.bottom + numShiftY;
            }
          }
        }
        const popupLeft = popupRect.x + nextOffsetX;
        const popupRight = popupLeft + popupWidth;
        const popupTop = popupRect.y + nextOffsetY;
        const popupBottom = popupTop + popupHeight;
        const targetLeft = targetRect.x;
        const targetRight = targetLeft + targetWidth;
        const targetTop = targetRect.y;
        const targetBottom = targetTop + targetHeight;
        const maxLeft = Math.max(popupLeft, targetLeft);
        const minRight = Math.min(popupRight, targetRight);
        const xCenter = (maxLeft + minRight) / 2;
        const nextArrowX = xCenter - popupLeft;
        const maxTop = Math.max(popupTop, targetTop);
        const minBottom = Math.min(popupBottom, targetBottom);
        const yCenter = (maxTop + minBottom) / 2;
        const nextArrowY = yCenter - popupTop;
        onPopupAlign?.(popupEle, nextAlignInfo);
        let offsetX4Right = popupMirrorRect.right - popupRect.x - (nextOffsetX + popupRect.width);
        let offsetY4Bottom = popupMirrorRect.bottom - popupRect.y - (nextOffsetY + popupRect.height);
        if (scaleX === 1) {
          nextOffsetX = Math.floor(nextOffsetX);
          offsetX4Right = Math.floor(offsetX4Right);
        }
        if (scaleY === 1) {
          nextOffsetY = Math.floor(nextOffsetY);
          offsetY4Bottom = Math.floor(offsetY4Bottom);
        }
        const nextOffsetInfo = {
          ready: true,
          offsetX: nextOffsetX / scaleX,
          offsetY: nextOffsetY / scaleY,
          offsetR: offsetX4Right / scaleX,
          offsetB: offsetY4Bottom / scaleY,
          arrowX: nextArrowX / scaleX,
          arrowY: nextArrowY / scaleY,
          scaleX,
          scaleY,
          align: nextAlignInfo
        };
        setOffsetInfo(nextOffsetInfo);
      }
    });
    const triggerAlign = () => {
      alignCountRef.current += 1;
      const id = alignCountRef.current;
      Promise.resolve().then(() => {
        if (alignCountRef.current === id) {
          onAlign();
        }
      });
    };
    const resetReady = () => {
      setOffsetInfo((ori) => ({
        ...ori,
        ready: false
      }));
    };
    useLayoutEffect(resetReady, [placement]);
    useLayoutEffect(() => {
      if (!open2) {
        resetReady();
      }
    }, [open2]);
    return [offsetInfo.ready, offsetInfo.offsetX, offsetInfo.offsetY, offsetInfo.offsetR, offsetInfo.offsetB, offsetInfo.arrowX, offsetInfo.arrowY, offsetInfo.scaleX, offsetInfo.scaleY, offsetInfo.align, triggerAlign];
  }
  function useDelay() {
    const delayRef = React__namespace.useRef(null);
    const clearDelay = () => {
      if (delayRef.current) {
        clearTimeout(delayRef.current);
        delayRef.current = null;
      }
    };
    const delayInvoke = (callback, delay) => {
      clearDelay();
      if (delay === 0) {
        callback();
      } else {
        delayRef.current = setTimeout(() => {
          callback();
        }, delay * 1e3);
      }
    };
    React__namespace.useEffect(() => {
      return () => {
        clearDelay();
      };
    }, []);
    return delayInvoke;
  }
  function useWatch(open2, target, popup, onAlign, onScroll) {
    useLayoutEffect(() => {
      if (open2 && target && popup) {
        let notifyScroll = function() {
          onAlign();
          onScroll();
        };
        const targetElement = target;
        const popupElement = popup;
        const targetScrollList = collectScroller(targetElement);
        const popupScrollList = collectScroller(popupElement);
        const win = getWin(popupElement);
        const mergedList = new Set([win, ...targetScrollList, ...popupScrollList]);
        mergedList.forEach((scroller) => {
          scroller.addEventListener("scroll", notifyScroll, {
            passive: true
          });
        });
        win.addEventListener("resize", notifyScroll, {
          passive: true
        });
        onAlign();
        return () => {
          mergedList.forEach((scroller) => {
            scroller.removeEventListener("scroll", notifyScroll);
            win.removeEventListener("resize", notifyScroll);
          });
        };
      }
    }, [open2, target, popup]);
  }
  function useWinClick(open2, clickToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen) {
    const openRef = React__namespace.useRef(open2);
    openRef.current = open2;
    const popupPointerDownRef = React__namespace.useRef(false);
    React__namespace.useEffect(() => {
      if (clickToHide && popupEle && (!mask || maskClosable)) {
        const onPointerDown = () => {
          popupPointerDownRef.current = false;
        };
        const onTriggerClose = (e2) => {
          if (openRef.current && !inPopupOrChild(e2.composedPath?.()?.[0] || e2.target) && !popupPointerDownRef.current) {
            triggerOpen(false);
          }
        };
        const win = getWin(popupEle);
        win.addEventListener("pointerdown", onPointerDown, true);
        win.addEventListener("mousedown", onTriggerClose, true);
        win.addEventListener("contextmenu", onTriggerClose, true);
        const targetShadowRoot = getShadowRoot(targetEle);
        if (targetShadowRoot) {
          targetShadowRoot.addEventListener("mousedown", onTriggerClose, true);
          targetShadowRoot.addEventListener("contextmenu", onTriggerClose, true);
        }
        return () => {
          win.removeEventListener("pointerdown", onPointerDown, true);
          win.removeEventListener("mousedown", onTriggerClose, true);
          win.removeEventListener("contextmenu", onTriggerClose, true);
          if (targetShadowRoot) {
            targetShadowRoot.removeEventListener("mousedown", onTriggerClose, true);
            targetShadowRoot.removeEventListener("contextmenu", onTriggerClose, true);
          }
        };
      }
    }, [clickToHide, targetEle, popupEle, mask, maskClosable]);
    function onPopupPointerDown() {
      popupPointerDownRef.current = true;
    }
    return onPopupPointerDown;
  }
  function useTargetState() {
    const [options, setOptions] = React.useState(null);
    const [open2, setOpen] = React.useState(false);
    const [isAnimating, setIsAnimating] = React.useState(false);
    const pendingOptionsRef = React.useRef(null);
    const trigger = useEvent((nextOptions) => {
      if (nextOptions === false) {
        pendingOptionsRef.current = null;
        setOpen(false);
      } else {
        if (isAnimating && open2) {
          pendingOptionsRef.current = nextOptions;
        } else {
          setOpen(true);
          setOptions(nextOptions);
          pendingOptionsRef.current = null;
          if (!open2) {
            setIsAnimating(true);
          }
        }
      }
    });
    const onVisibleChanged = useEvent((visible) => {
      if (visible) {
        setIsAnimating(false);
        if (pendingOptionsRef.current) {
          setOptions(pendingOptionsRef.current);
          pendingOptionsRef.current = null;
        }
      } else {
        setIsAnimating(false);
        pendingOptionsRef.current = null;
      }
    });
    return [trigger, open2, options, onVisibleChanged];
  }
  function _extends$b() {
    _extends$b = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$b.apply(this, arguments);
  }
  const UniqueContainer = (props) => {
    const {
      prefixCls,
      isMobile,
      ready,
      open: open2,
      align,
      offsetR,
      offsetB,
      offsetX,
      offsetY,
      arrowPos,
      popupSize,
      motion,
      uniqueContainerClassName,
      uniqueContainerStyle
    } = props;
    const containerCls = `${prefixCls}-unique-container`;
    const [motionVisible, setMotionVisible] = React.useState(false);
    const offsetStyle = useOffsetStyle(isMobile, ready, open2, align, offsetR, offsetB, offsetX, offsetY);
    const cachedOffsetStyleRef = React.useRef(offsetStyle);
    if (ready) {
      cachedOffsetStyleRef.current = offsetStyle;
    }
    const sizeStyle = {};
    if (popupSize) {
      sizeStyle.width = popupSize.width;
      sizeStyle.height = popupSize.height;
    }
    return React.createElement(CSSMotion, _extends$b({
      motionAppear: true,
      motionEnter: true,
      motionLeave: true,
      removeOnLeave: false,
      leavedClassName: `${containerCls}-hidden`
    }, motion, {
      visible: open2,
      onVisibleChanged: (nextVisible) => {
        setMotionVisible(nextVisible);
      }
    }), ({
      className: motionClassName,
      style: motionStyle
    }) => {
      const cls = clsx(containerCls, motionClassName, uniqueContainerClassName, {
        [`${containerCls}-visible`]: motionVisible
      });
      return React.createElement("div", {
        className: cls,
        style: {
          "--arrow-x": `${arrowPos?.x || 0}px`,
          "--arrow-y": `${arrowPos?.y || 0}px`,
          ...cachedOffsetStyleRef.current,
          ...sizeStyle,
          ...motionStyle,
          ...uniqueContainerStyle
        }
      });
    });
  };
  const UniqueProvider$1 = ({
    children,
    postTriggerProps
  }) => {
    const [trigger, open2, options, onTargetVisibleChanged] = useTargetState();
    const mergedOptions = React__namespace.useMemo(() => {
      if (!options || !postTriggerProps) {
        return options;
      }
      return postTriggerProps(options);
    }, [options, postTriggerProps]);
    const [popupEle, setPopupEle] = React__namespace.useState(null);
    const [popupSize, setPopupSize] = React__namespace.useState(null);
    const externalPopupRef = React__namespace.useRef(null);
    const setPopupRef = useEvent((node2) => {
      externalPopupRef.current = node2;
      if (isDOM(node2) && popupEle !== node2) {
        setPopupEle(node2);
      }
    });
    const isOpenRef = React__namespace.useRef(null);
    const delayInvoke = useDelay();
    const show = useEvent((showOptions, isOpen) => {
      isOpenRef.current = isOpen;
      delayInvoke(() => {
        trigger(showOptions);
      }, showOptions.delay);
    });
    const hide = (delay) => {
      delayInvoke(() => {
        if (isOpenRef.current?.()) {
          return;
        }
        trigger(false);
      }, delay);
    };
    const onVisibleChanged = useEvent((visible) => {
      onTargetVisibleChanged(visible);
    });
    const [
      ready,
      offsetX,
      offsetY,
      offsetR,
      offsetB,
      arrowX,
      arrowY,
,
      ,
alignInfo,
      onAlign
    ] = useAlign(
      open2,
      popupEle,
      mergedOptions?.target,
      mergedOptions?.popupPlacement,
      mergedOptions?.builtinPlacements || {},
      mergedOptions?.popupAlign,
      void 0,
false
);
    const alignedClassName = React__namespace.useMemo(() => {
      if (!mergedOptions) {
        return "";
      }
      const baseClassName = getAlignPopupClassName(
        mergedOptions.builtinPlacements || {},
        mergedOptions.prefixCls || "",
        alignInfo,
        false
);
      return clsx(baseClassName, mergedOptions.getPopupClassNameFromAlign?.(alignInfo));
    }, [alignInfo, mergedOptions?.getPopupClassNameFromAlign, mergedOptions?.builtinPlacements, mergedOptions?.prefixCls]);
    const contextValue = React__namespace.useMemo(() => ({
      show,
      hide
    }), []);
    React__namespace.useEffect(() => {
      onAlign();
    }, [mergedOptions?.target]);
    const onPrepare = useEvent(() => {
      onAlign();
      return Promise.resolve();
    });
    const subPopupElements = React__namespace.useRef({});
    const parentContext = React__namespace.useContext(TriggerContext);
    const triggerContextValue = React__namespace.useMemo(() => ({
      registerSubPopup: (id, subPopupEle) => {
        subPopupElements.current[id] = subPopupEle;
        parentContext?.registerSubPopup(id, subPopupEle);
      }
    }), [parentContext]);
    const prefixCls = mergedOptions?.prefixCls;
    return React__namespace.createElement(UniqueContext.Provider, {
      value: contextValue
    }, children, mergedOptions && React__namespace.createElement(TriggerContext.Provider, {
      value: triggerContextValue
    }, React__namespace.createElement(Popup$1, {
      ref: setPopupRef,
      portal: Portal,
      onEsc: mergedOptions.onEsc,
      prefixCls,
      popup: mergedOptions.popup,
      className: clsx(mergedOptions.popupClassName, alignedClassName, `${prefixCls}-unique-controlled`),
      style: mergedOptions.popupStyle,
      target: mergedOptions.target,
      open: open2,
      keepDom: true,
      fresh: true,
      autoDestroy: false,
      onVisibleChanged,
      ready,
      offsetX,
      offsetY,
      offsetR,
      offsetB,
      onAlign,
      onPrepare,
      onResize: (size) => setPopupSize({
        width: size.offsetWidth,
        height: size.offsetHeight
      }),
      arrowPos: {
        x: arrowX,
        y: arrowY
      },
      align: alignInfo,
      zIndex: mergedOptions.zIndex,
      mask: mergedOptions.mask,
      arrow: mergedOptions.arrow,
      motion: mergedOptions.popupMotion,
      maskMotion: mergedOptions.maskMotion,
      getPopupContainer: mergedOptions.getPopupContainer
    }, React__namespace.createElement(UniqueContainer, {
      prefixCls,
      isMobile: false,
      ready,
      open: open2,
      align: alignInfo,
      offsetR,
      offsetB,
      offsetX,
      offsetY,
      arrowPos: {
        x: arrowX,
        y: arrowY
      },
      popupSize,
      motion: mergedOptions.popupMotion,
      uniqueContainerClassName: clsx(mergedOptions.uniqueContainerClassName, alignedClassName),
      uniqueContainerStyle: mergedOptions.uniqueContainerStyle
    }))));
  };
  function generateTrigger(PortalComponent = Portal) {
    const Trigger2 = React__namespace.forwardRef((props, ref) => {
      const {
        prefixCls = "rc-trigger-popup",
        children,
action = "hover",
        showAction,
        hideAction,
popupVisible,
        defaultPopupVisible,
        onOpenChange,
        afterOpenChange,
        onPopupVisibleChange,
        afterPopupVisibleChange,
mouseEnterDelay,
        mouseLeaveDelay = 0.1,
        focusDelay,
        blurDelay,
mask,
        maskClosable = true,
getPopupContainer,
        forceRender,
        autoDestroy,
popup,
        popupClassName,
        uniqueContainerClassName,
        uniqueContainerStyle,
        popupStyle,
        popupPlacement,
        builtinPlacements = {},
        popupAlign,
        zIndex,
        stretch,
        getPopupClassNameFromAlign,
        fresh,
        unique,
        alignPoint,
        onPopupClick,
        onPopupAlign,
arrow,
popupMotion,
        maskMotion,
mobile,
        ...restProps
      } = props;
      const mergedAutoDestroy = autoDestroy || false;
      const openUncontrolled = popupVisible === void 0;
      const isMobile = !!mobile;
      const subPopupElements = React__namespace.useRef({});
      const parentContext = React__namespace.useContext(TriggerContext);
      const context = React__namespace.useMemo(() => {
        return {
          registerSubPopup: (id2, subPopupEle) => {
            subPopupElements.current[id2] = subPopupEle;
            parentContext?.registerSubPopup(id2, subPopupEle);
          }
        };
      }, [parentContext]);
      const uniqueContext = React__namespace.useContext(UniqueContext);
      const id = useId();
      const [popupEle, setPopupEle] = React__namespace.useState(null);
      const externalPopupRef = React__namespace.useRef(null);
      const setPopupRef = useEvent((node2) => {
        externalPopupRef.current = node2;
        if (isDOM(node2) && popupEle !== node2) {
          setPopupEle(node2);
        }
        parentContext?.registerSubPopup(id, node2);
      });
      const [targetEle, setTargetEle] = React__namespace.useState(null);
      const externalForwardRef = React__namespace.useRef(null);
      const setTargetRef = useEvent((node2) => {
        const domNode = getDOM(node2);
        if (isDOM(domNode) && targetEle !== domNode) {
          setTargetEle(domNode);
          externalForwardRef.current = domNode;
        }
      });
      const cloneProps = {};
      const inPopupOrChild = useEvent((ele) => {
        const childDOM = targetEle;
        return childDOM?.contains(ele) || getShadowRoot(childDOM)?.host === ele || ele === childDOM || popupEle?.contains(ele) || getShadowRoot(popupEle)?.host === ele || ele === popupEle || Object.values(subPopupElements.current).some((subPopupEle) => subPopupEle?.contains(ele) || ele === subPopupEle);
      });
      const innerArrow = arrow ? {
...arrow !== true ? arrow : {}
      } : null;
      const [internalOpen, setInternalOpen] = useControlledState(defaultPopupVisible || false, popupVisible);
      const mergedOpen = internalOpen || false;
      const child = React__namespace.useMemo(() => {
        const nextChild = typeof children === "function" ? children({
          open: mergedOpen
        }) : children;
        return React__namespace.Children.only(nextChild);
      }, [children, mergedOpen]);
      const originChildProps = child?.props || {};
      const isOpen = useEvent(() => mergedOpen);
      const getUniqueOptions = useEvent((delay = 0) => ({
        popup,
        target: targetEle,
        delay,
        prefixCls,
        popupClassName,
        uniqueContainerClassName,
        uniqueContainerStyle,
        popupStyle,
        popupPlacement,
        builtinPlacements,
        popupAlign,
        zIndex,
        mask,
        maskClosable,
        popupMotion,
        maskMotion,
        arrow: innerArrow,
        getPopupContainer,
        getPopupClassNameFromAlign,
        id,
        onEsc
      }));
      useLayoutEffect(() => {
        if (uniqueContext && unique && targetEle && !openUncontrolled && !parentContext) {
          if (mergedOpen) {
            uniqueContext.show(getUniqueOptions(mouseEnterDelay), isOpen);
          } else {
            uniqueContext.hide(mouseLeaveDelay);
          }
        }
      }, [mergedOpen, targetEle]);
      const openRef = React__namespace.useRef(mergedOpen);
      openRef.current = mergedOpen;
      const internalTriggerOpen = useEvent((nextOpen) => {
        require$$0.flushSync(() => {
          if (mergedOpen !== nextOpen) {
            setInternalOpen(nextOpen);
            onOpenChange?.(nextOpen);
            onPopupVisibleChange?.(nextOpen);
          }
        });
      });
      const delayInvoke = useDelay();
      const triggerOpen = (nextOpen, delay = 0) => {
        if (popupVisible !== void 0) {
          delayInvoke(() => {
            internalTriggerOpen(nextOpen);
          }, delay);
          return;
        }
        if (uniqueContext && unique && openUncontrolled && !parentContext) {
          if (nextOpen) {
            uniqueContext.show(getUniqueOptions(delay), isOpen);
          } else {
            uniqueContext.hide(delay);
          }
          return;
        }
        delayInvoke(() => {
          internalTriggerOpen(nextOpen);
        }, delay);
      };
      function onEsc({
        top
      }) {
        if (top) {
          triggerOpen(false);
        }
      }
      const [inMotion, setInMotion] = React__namespace.useState(false);
      useLayoutEffect((firstMount) => {
        if (!firstMount || mergedOpen) {
          setInMotion(true);
        }
      }, [mergedOpen]);
      const [motionPrepareResolve, setMotionPrepareResolve] = React__namespace.useState(null);
      const [mousePos, setMousePos] = React__namespace.useState(null);
      const setMousePosByEvent = (event) => {
        setMousePos([event.clientX, event.clientY]);
      };
      const [ready, offsetX, offsetY, offsetR, offsetB, arrowX, arrowY, scaleX, scaleY, alignInfo, onAlign] = useAlign(mergedOpen, popupEle, alignPoint && mousePos !== null ? mousePos : targetEle, popupPlacement, builtinPlacements, popupAlign, onPopupAlign, isMobile);
      const [showActions, hideActions] = useAction(action, showAction, hideAction);
      const clickToShow = showActions.has("click");
      const clickToHide = hideActions.has("click") || hideActions.has("contextMenu");
      const triggerAlign = useEvent(() => {
        if (!inMotion) {
          onAlign();
        }
      });
      const onScroll = () => {
        if (openRef.current && alignPoint && clickToHide) {
          triggerOpen(false);
        }
      };
      useWatch(mergedOpen, targetEle, popupEle, triggerAlign, onScroll);
      useLayoutEffect(() => {
        triggerAlign();
      }, [mousePos, popupPlacement]);
      useLayoutEffect(() => {
        if (mergedOpen && !builtinPlacements?.[popupPlacement]) {
          triggerAlign();
        }
      }, [JSON.stringify(popupAlign)]);
      const alignedClassName = React__namespace.useMemo(() => {
        const baseClassName = getAlignPopupClassName(builtinPlacements, prefixCls, alignInfo, alignPoint);
        return clsx(baseClassName, getPopupClassNameFromAlign?.(alignInfo));
      }, [alignInfo, getPopupClassNameFromAlign, builtinPlacements, prefixCls, alignPoint]);
      React__namespace.useImperativeHandle(ref, () => ({
        nativeElement: externalForwardRef.current,
        popupElement: externalPopupRef.current,
        forceAlign: triggerAlign
      }));
      const [targetWidth, setTargetWidth] = React__namespace.useState(0);
      const [targetHeight, setTargetHeight] = React__namespace.useState(0);
      const syncTargetSize = () => {
        if (stretch && targetEle) {
          const rect = targetEle.getBoundingClientRect();
          setTargetWidth(rect.width);
          setTargetHeight(rect.height);
        }
      };
      const onTargetResize = () => {
        syncTargetSize();
        triggerAlign();
      };
      const onVisibleChanged = (visible) => {
        setInMotion(false);
        onAlign();
        afterOpenChange?.(visible);
        afterPopupVisibleChange?.(visible);
      };
      const onPrepare = () => new Promise((resolve) => {
        syncTargetSize();
        setMotionPrepareResolve(() => resolve);
      });
      useLayoutEffect(() => {
        if (motionPrepareResolve) {
          onAlign();
          motionPrepareResolve();
          setMotionPrepareResolve(null);
        }
      }, [motionPrepareResolve]);
      function wrapperAction(eventName, nextOpen, delay, callback, ignoreCheck) {
        cloneProps[eventName] = (event, ...args) => {
          if (!ignoreCheck || !ignoreCheck()) {
            callback?.(event);
            triggerOpen(nextOpen, delay);
          }
          originChildProps[eventName]?.(event, ...args);
        };
      }
      const touchToShow = showActions.has("touch");
      const touchToHide = hideActions.has("touch");
      const touchedRef = React__namespace.useRef(false);
      if (touchToShow || touchToHide) {
        cloneProps.onTouchStart = (...args) => {
          touchedRef.current = true;
          if (openRef.current && touchToHide) {
            triggerOpen(false);
          } else if (!openRef.current && touchToShow) {
            triggerOpen(true);
          }
          originChildProps.onTouchStart?.(...args);
        };
      }
      if (clickToShow || clickToHide) {
        cloneProps.onClick = (event, ...args) => {
          if (openRef.current && clickToHide) {
            triggerOpen(false);
          } else if (!openRef.current && clickToShow) {
            setMousePosByEvent(event);
            triggerOpen(true);
          }
          originChildProps.onClick?.(event, ...args);
          touchedRef.current = false;
        };
      }
      const onPopupPointerDown = useWinClick(mergedOpen, clickToHide || touchToHide, targetEle, popupEle, mask, maskClosable, inPopupOrChild, triggerOpen);
      const hoverToShow = showActions.has("hover");
      const hoverToHide = hideActions.has("hover");
      let onPopupMouseEnter;
      let onPopupMouseLeave;
      const ignoreMouseTrigger = () => {
        return touchedRef.current;
      };
      if (hoverToShow) {
        const onMouseEnterCallback = (event) => {
          setMousePosByEvent(event);
        };
        wrapperAction("onMouseEnter", true, mouseEnterDelay, onMouseEnterCallback, ignoreMouseTrigger);
        wrapperAction("onPointerEnter", true, mouseEnterDelay, onMouseEnterCallback, ignoreMouseTrigger);
        onPopupMouseEnter = (event) => {
          if ((mergedOpen || inMotion) && popupEle?.contains(event.target)) {
            triggerOpen(true, mouseEnterDelay);
          }
        };
        if (alignPoint) {
          cloneProps.onMouseMove = (event) => {
            originChildProps.onMouseMove?.(event);
          };
        }
      }
      if (hoverToHide) {
        wrapperAction("onMouseLeave", false, mouseLeaveDelay, void 0, ignoreMouseTrigger);
        wrapperAction("onPointerLeave", false, mouseLeaveDelay, void 0, ignoreMouseTrigger);
        onPopupMouseLeave = () => {
          triggerOpen(false, mouseLeaveDelay);
        };
      }
      if (showActions.has("focus")) {
        wrapperAction("onFocus", true, focusDelay);
      }
      if (hideActions.has("focus")) {
        wrapperAction("onBlur", false, blurDelay);
      }
      if (showActions.has("contextMenu")) {
        cloneProps.onContextMenu = (event, ...args) => {
          if (openRef.current && hideActions.has("contextMenu")) {
            triggerOpen(false);
          } else {
            setMousePosByEvent(event);
            triggerOpen(true);
          }
          event.preventDefault();
          originChildProps.onContextMenu?.(event, ...args);
        };
      }
      const rendedRef = React__namespace.useRef(false);
      rendedRef.current ||= forceRender || mergedOpen || inMotion;
      const mergedChildrenProps = {
        ...originChildProps,
        ...cloneProps
      };
      const passedProps = {};
      const passedEventList = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
      passedEventList.forEach((eventName) => {
        if (restProps[eventName]) {
          passedProps[eventName] = (...args) => {
            mergedChildrenProps[eventName]?.(...args);
            restProps[eventName](...args);
          };
        }
      });
      const arrowPos = {
        x: arrowX,
        y: arrowY
      };
      useResizeObserver(mergedOpen, targetEle, onTargetResize);
      const mergedRef = useComposeRef(setTargetRef, getNodeRef(child));
      const triggerNode = React__namespace.cloneElement(child, {
        ...mergedChildrenProps,
        ...passedProps,
        ref: mergedRef
      });
      return React__namespace.createElement(React__namespace.Fragment, null, triggerNode, rendedRef.current && (!uniqueContext || !unique) && React__namespace.createElement(TriggerContext.Provider, {
        value: context
      }, React__namespace.createElement(Popup$1, {
        portal: PortalComponent,
        ref: setPopupRef,
        prefixCls,
        popup,
        className: clsx(popupClassName, !isMobile && alignedClassName),
        style: popupStyle,
        target: targetEle,
        onMouseEnter: onPopupMouseEnter,
        onMouseLeave: onPopupMouseLeave,
        onPointerEnter: onPopupMouseEnter,
        zIndex,
        open: mergedOpen,
        keepDom: inMotion,
        fresh,
        onClick: onPopupClick,
        onPointerDownCapture: onPopupPointerDown,
        mask,
        motion: popupMotion,
        maskMotion,
        onVisibleChanged,
        onPrepare,
        forceRender,
        autoDestroy: mergedAutoDestroy,
        getPopupContainer,
        onEsc,
        align: alignInfo,
        arrow: innerArrow,
        arrowPos,
        ready,
        offsetX,
        offsetY,
        offsetR,
        offsetB,
        onAlign: triggerAlign,
        stretch,
        targetWidth: targetWidth / scaleX,
        targetHeight: targetHeight / scaleY,
        mobile
      })));
    });
    return Trigger2;
  }
  const Trigger = generateTrigger(Portal);
  function isFragment(child) {
    return child && React.isValidElement(child) && child.type === React.Fragment;
  }
  const replaceElement = (element, replacement, props) => {
    if (! React.isValidElement(element)) {
      return replacement;
    }
    return React.cloneElement(element, typeof props === "function" ? props(element.props || {}) : props);
  };
  function cloneElement(element, props) {
    return replaceElement(element, element, props);
  }
  const MotionContent = ({
    children
  }) => {
    const {
      getPrefixCls
    } = React.useContext(ConfigContext);
    const rootPrefixCls = getPrefixCls();
    if (! React.isValidElement(children)) {
      return children;
    }
    return React.createElement(CSSMotion, {
      visible: true,
      motionName: `${rootPrefixCls}-fade`,
      motionAppear: true,
      motionEnter: true,
      motionLeave: false,
      removeOnLeave: false
    }, ({
      style: motionStyle,
      className: motionClassName
    }) => {
      return cloneElement(children, (oriProps) => ({
        className: clsx(oriProps.className, motionClassName),
        style: {
          ...oriProps.style,
          ...motionStyle
        }
      }));
    });
  };
  const cachedPlacements = [null, null];
  function uniqueBuiltinPlacements(ori) {
    if (cachedPlacements[0] !== ori) {
      const target = {};
      Object.keys(ori).forEach((placement) => {
        target[placement] = {
          ...ori[placement],
          dynamicInset: false
        };
      });
      cachedPlacements[0] = ori;
      cachedPlacements[1] = target;
    }
    return cachedPlacements[1];
  }
  const UniqueProvider = ({
    children
  }) => {
    const renderPopup = (options) => {
      const {
        id,
        builtinPlacements,
        popup
      } = options;
      const popupEle = typeof popup === "function" ? popup() : popup;
      const parsedPlacements = uniqueBuiltinPlacements(builtinPlacements);
      return {
        ...options,
        getPopupContainer: null,
        arrow: false,
        popup: React.createElement(MotionContent, {
          key: id
        }, popupEle),
        builtinPlacements: parsedPlacements
      };
    };
    return React.createElement(UniqueProvider$1, {
      postTriggerProps: renderPopup
    }, children);
  };
  function useConfig() {
    const componentDisabled = React.useContext(DisabledContext);
    const componentSize = React.useContext(SizeContext);
    return {
      componentDisabled,
      componentSize
    };
  }
  function useTheme(theme, parentTheme, config) {
    const themeConfig = theme || {};
    const parentThemeConfig = themeConfig.inherit === false || !parentTheme ? {
      ...defaultConfig,
      hashed: parentTheme?.hashed ?? defaultConfig.hashed,
      cssVar: parentTheme?.cssVar
    } : parentTheme;
    const themeKey = React.useId();
    return useMemo(() => {
      if (!theme) {
        return parentTheme;
      }
      const mergedComponents = {
        ...parentThemeConfig.components
      };
      Object.keys(theme.components || {}).forEach((componentName) => {
        mergedComponents[componentName] = {
          ...mergedComponents[componentName],
          ...theme.components[componentName]
        };
      });
      const cssVarKey = `css-var-${themeKey.replace(/:/g, "")}`;
      const mergedCssVar = {
        prefix: config?.prefixCls,
...parentThemeConfig.cssVar,
        ...themeConfig.cssVar,
        key: themeConfig.cssVar?.key || cssVarKey
      };
      return {
        ...parentThemeConfig,
        ...themeConfig,
        token: {
          ...parentThemeConfig.token,
          ...themeConfig.token
        },
        components: mergedComponents,
        cssVar: mergedCssVar
      };
    }, [themeConfig, parentThemeConfig], (prev2, next2) => prev2.some((prevTheme, index) => {
      const nextTheme = next2[index];
      return !isEqual(prevTheme, nextTheme, true);
    }));
  }
  const MotionCacheContext = React__namespace.createContext(true);
  function MotionWrapper(props) {
    const parentMotion = React__namespace.useContext(MotionCacheContext);
    const {
      children
    } = props;
    const [, token2] = useToken();
    const {
      motion
    } = token2;
    const needWrapMotionProviderRef = React__namespace.useRef(false);
    needWrapMotionProviderRef.current || (needWrapMotionProviderRef.current = parentMotion !== motion);
    if (needWrapMotionProviderRef.current) {
      return React__namespace.createElement(MotionCacheContext.Provider, {
        value: motion
      }, React__namespace.createElement(MotionProvider, {
        motion
      }, children));
    }
    return children;
  }
  const PropWarning = () => null;
  const IconStyle = ({
    iconPrefixCls,
    csp
  }) => {
    useResetIconStyle(iconPrefixCls, csp);
    return null;
  };
  const PASSED_PROPS = ["getTargetContainer", "getPopupContainer", "renderEmpty", "input", "pagination", "form", "select", "button"];
  let globalPrefixCls;
  let globalIconPrefixCls;
  let globalTheme;
  let globalHolderRender;
  function getGlobalPrefixCls() {
    return globalPrefixCls || defaultPrefixCls;
  }
  function getGlobalIconPrefixCls() {
    return globalIconPrefixCls || defaultIconPrefixCls;
  }
  const setGlobalConfig = (props) => {
    const {
      prefixCls,
      iconPrefixCls,
      theme,
      holderRender
    } = props;
    if (prefixCls !== void 0) {
      globalPrefixCls = prefixCls;
    }
    if (iconPrefixCls !== void 0) {
      globalIconPrefixCls = iconPrefixCls;
    }
    if ("holderRender" in props) {
      globalHolderRender = holderRender;
    }
    if (theme) {
      globalTheme = theme;
    }
  };
  const globalConfig = () => ({
    getPrefixCls: (suffixCls, customizePrefixCls) => {
      if (customizePrefixCls) {
        return customizePrefixCls;
      }
      return suffixCls ? `${getGlobalPrefixCls()}-${suffixCls}` : getGlobalPrefixCls();
    },
    getIconPrefixCls: getGlobalIconPrefixCls,
    getRootPrefixCls: () => {
      if (globalPrefixCls) {
        return globalPrefixCls;
      }
      return getGlobalPrefixCls();
    },
    getTheme: () => globalTheme,
    holderRender: globalHolderRender
  });
  const ProviderChildren = (props) => {
    const {
      children,
      csp: customCsp,
      autoInsertSpaceInButton,
      alert,
      affix,
      anchor,
      app,
      form,
      locale: locale2,
      componentSize,
      direction,
      space,
      splitter,
      virtual,
      dropdownMatchSelectWidth,
      popupMatchSelectWidth,
      popupOverflow,
      legacyLocale,
      parentContext,
      iconPrefixCls: customIconPrefixCls,
      theme,
      componentDisabled,
      segmented,
      statistic: statistic2,
      spin,
      calendar,
      carousel,
      cascader,
      collapse,
      typography,
      checkbox,
      descriptions,
      divider,
      drawer,
      skeleton,
      steps,
      image,
      layout,
      list,
      mentions,
      modal,
      progress,
      result,
      slider,
      breadcrumb,
      masonry,
      menu,
      pagination,
      input,
      textArea,
      otp,
      empty,
      badge,
      radio,
      rate,
      ribbon,
      switch: SWITCH,
      transfer,
      avatar,
      message: message2,
      tag,
      table,
      card,
      cardMeta,
      tabs,
      timeline,
      timePicker,
      upload,
      notification,
      tree,
      colorPicker,
      datePicker,
      rangePicker,
      flex,
      wave,
      dropdown,
      warning: warningConfig,
      tour,
      tooltip,
      popover,
      popconfirm,
      qrcode,
      floatButton,
      floatButtonGroup,
      variant,
      inputNumber,
      treeSelect,
      watermark
    } = props;
    const getPrefixCls = React__namespace.useCallback((suffixCls, customizePrefixCls) => {
      const {
        prefixCls
      } = props;
      if (customizePrefixCls) {
        return customizePrefixCls;
      }
      const mergedPrefixCls = prefixCls || parentContext.getPrefixCls("");
      return suffixCls ? `${mergedPrefixCls}-${suffixCls}` : mergedPrefixCls;
    }, [parentContext.getPrefixCls, props.prefixCls]);
    const iconPrefixCls = customIconPrefixCls || parentContext.iconPrefixCls || defaultIconPrefixCls;
    const csp = customCsp || parentContext.csp;
    const mergedTheme = useTheme(theme, parentContext.theme, {
      prefixCls: getPrefixCls("")
    });
    const baseConfig = {
      csp,
      autoInsertSpaceInButton,
      alert,
      affix,
      anchor,
      app,
      locale: locale2 || legacyLocale,
      direction,
      space,
      splitter,
      virtual,
      popupMatchSelectWidth: popupMatchSelectWidth ?? dropdownMatchSelectWidth,
      popupOverflow,
      getPrefixCls,
      iconPrefixCls,
      theme: mergedTheme,
      segmented,
      statistic: statistic2,
      spin,
      calendar,
      carousel,
      cascader,
      collapse,
      typography,
      checkbox,
      descriptions,
      divider,
      drawer,
      skeleton,
      steps,
      image,
      input,
      textArea,
      otp,
      layout,
      list,
      mentions,
      modal,
      progress,
      result,
      slider,
      breadcrumb,
      masonry,
      menu,
      pagination,
      empty,
      badge,
      radio,
      rate,
      ribbon,
      switch: SWITCH,
      transfer,
      avatar,
      message: message2,
      tag,
      table,
      card,
      cardMeta,
      tabs,
      timeline,
      timePicker,
      upload,
      notification,
      tree,
      colorPicker,
      datePicker,
      rangePicker,
      flex,
      wave,
      dropdown,
      warning: warningConfig,
      tour,
      tooltip,
      popover,
      popconfirm,
      qrcode,
      floatButton,
      floatButtonGroup,
      variant,
      inputNumber,
      treeSelect,
      watermark
    };
    const config = {
      ...parentContext
    };
    Object.keys(baseConfig).forEach((key) => {
      if (baseConfig[key] !== void 0) {
        config[key] = baseConfig[key];
      }
    });
    PASSED_PROPS.forEach((propName) => {
      const propValue = props[propName];
      if (propValue) {
        config[propName] = propValue;
      }
    });
    if (typeof autoInsertSpaceInButton !== "undefined") {
      config.button = {
        autoInsertSpace: autoInsertSpaceInButton,
        ...config.button
      };
    }
    const memoedConfig = useMemo(() => config, config, (prevConfig, currentConfig) => {
      const prevKeys = Object.keys(prevConfig);
      const currentKeys = Object.keys(currentConfig);
      return prevKeys.length !== currentKeys.length || prevKeys.some((key) => prevConfig[key] !== currentConfig[key]);
    });
    const {
      layer
    } = React__namespace.useContext(StyleContext);
    const memoIconContextValue = React__namespace.useMemo(() => ({
      prefixCls: iconPrefixCls,
      csp,
      layer: layer ? "antd" : void 0
    }), [iconPrefixCls, csp, layer]);
    let childNode = React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(IconStyle, {
      iconPrefixCls,
      csp
    }), React__namespace.createElement(PropWarning, {
      dropdownMatchSelectWidth
    }), children);
    const validateMessages = React__namespace.useMemo(() => merge$1(localeValues.Form?.defaultValidateMessages || {}, memoedConfig.locale?.Form?.defaultValidateMessages || {}, memoedConfig.form?.validateMessages || {}, form?.validateMessages || {}), [memoedConfig, form?.validateMessages]);
    if (Object.keys(validateMessages).length > 0) {
      childNode = React__namespace.createElement(ValidateMessagesContext.Provider, {
        value: validateMessages
      }, childNode);
    }
    if (locale2) {
      childNode = React__namespace.createElement(LocaleProvider, {
        locale: locale2,
        _ANT_MARK__: ANT_MARK
      }, childNode);
    }
    {
      childNode = React__namespace.createElement(IconContext.Provider, {
        value: memoIconContextValue
      }, childNode);
    }
    if (componentSize) {
      childNode = React__namespace.createElement(SizeContextProvider, {
        size: componentSize
      }, childNode);
    }
    childNode = React__namespace.createElement(MotionWrapper, null, childNode);
    if (tooltip?.unique) {
      childNode = React__namespace.createElement(UniqueProvider, null, childNode);
    }
    const memoTheme = React__namespace.useMemo(() => {
      const {
        algorithm,
        token: token2,
        components,
        cssVar,
        ...rest
      } = mergedTheme || {};
      const themeObj = algorithm && (!Array.isArray(algorithm) || algorithm.length > 0) ? createTheme(algorithm) : defaultTheme;
      const parsedComponents = {};
      Object.entries(components || {}).forEach(([componentName, componentToken]) => {
        const parsedToken = {
          ...componentToken
        };
        if ("algorithm" in parsedToken) {
          if (parsedToken.algorithm === true) {
            parsedToken.theme = themeObj;
          } else if (Array.isArray(parsedToken.algorithm) || typeof parsedToken.algorithm === "function") {
            parsedToken.theme = createTheme(parsedToken.algorithm);
          }
          delete parsedToken.algorithm;
        }
        parsedComponents[componentName] = parsedToken;
      });
      const mergedToken = {
        ...seedToken,
        ...token2
      };
      return {
        ...rest,
        theme: themeObj,
        token: mergedToken,
        components: parsedComponents,
        override: {
          override: mergedToken,
          ...parsedComponents
        },
        cssVar
      };
    }, [mergedTheme]);
    if (theme) {
      childNode = React__namespace.createElement(DesignTokenContext.Provider, {
        value: memoTheme
      }, childNode);
    }
    if (memoedConfig.warning) {
      childNode = React__namespace.createElement(WarningContext.Provider, {
        value: memoedConfig.warning
      }, childNode);
    }
    if (componentDisabled !== void 0) {
      childNode = React__namespace.createElement(DisabledContextProvider, {
        disabled: componentDisabled
      }, childNode);
    }
    return React__namespace.createElement(ConfigContext.Provider, {
      value: memoedConfig
    }, childNode);
  };
  const ConfigProvider = (props) => {
    const context = React__namespace.useContext(ConfigContext);
    const antLocale = React__namespace.useContext(LocaleContext);
    return React__namespace.createElement(ProviderChildren, {
      parentContext: context,
      legacyLocale: antLocale,
      ...props
    });
  };
  ConfigProvider.ConfigContext = ConfigContext;
  ConfigProvider.SizeContext = SizeContext;
  ConfigProvider.config = setGlobalConfig;
  ConfigProvider.useConfig = useConfig;
  Object.defineProperty(ConfigProvider, "SizeContext", {
    get: () => {
      return SizeContext;
    }
  });
  const KeyCode = {

ENTER: 13
  };
  function _extends$a() {
    _extends$a = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$a.apply(this, arguments);
  }
  const Notify = React__namespace.forwardRef((props, ref) => {
    const {
      prefixCls,
      style: style2,
      className,
      duration = 4.5,
      showProgress,
      pauseOnHover = true,
      eventKey,
      content,
      closable,
      props: divProps,
      onClick,
      onNoticeClose,
      times,
      hovering: forcedHovering
    } = props;
    const [hovering, setHovering] = React__namespace.useState(false);
    const [percent, setPercent] = React__namespace.useState(0);
    const [spentTime, setSpentTime] = React__namespace.useState(0);
    const mergedHovering = forcedHovering || hovering;
    const mergedDuration = typeof duration === "number" ? duration : 0;
    const mergedShowProgress = mergedDuration > 0 && showProgress;
    const onInternalClose = () => {
      onNoticeClose(eventKey);
    };
    const onCloseKeyDown = (e2) => {
      if (e2.key === "Enter" || e2.code === "Enter" || e2.keyCode === KeyCode.ENTER) {
        onInternalClose();
      }
    };
    React__namespace.useEffect(() => {
      if (!mergedHovering && mergedDuration > 0) {
        const start = Date.now() - spentTime;
        const timeout = setTimeout(() => {
          onInternalClose();
        }, mergedDuration * 1e3 - spentTime);
        return () => {
          if (pauseOnHover) {
            clearTimeout(timeout);
          }
          setSpentTime(Date.now() - start);
        };
      }
    }, [mergedDuration, mergedHovering, times]);
    React__namespace.useEffect(() => {
      if (!mergedHovering && mergedShowProgress && (pauseOnHover || spentTime === 0)) {
        const start = performance.now();
        let animationFrame;
        const calculate = () => {
          cancelAnimationFrame(animationFrame);
          animationFrame = requestAnimationFrame((timestamp) => {
            const runtime = timestamp + spentTime - start;
            const progress = Math.min(runtime / (mergedDuration * 1e3), 1);
            setPercent(progress * 100);
            if (progress < 1) {
              calculate();
            }
          });
        };
        calculate();
        return () => {
          if (pauseOnHover) {
            cancelAnimationFrame(animationFrame);
          }
        };
      }
    }, [mergedDuration, spentTime, mergedHovering, mergedShowProgress, times]);
    const closableObj = React__namespace.useMemo(() => {
      if (typeof closable === "object" && closable !== null) {
        return closable;
      }
      return {};
    }, [closable]);
    const ariaProps = pickAttrs(closableObj, true);
    const validPercent = 100 - (!percent || percent < 0 ? 0 : percent > 100 ? 100 : percent);
    const noticePrefixCls = `${prefixCls}-notice`;
    return React__namespace.createElement("div", _extends$a({}, divProps, {
      ref,
      className: clsx(noticePrefixCls, className, {
        [`${noticePrefixCls}-closable`]: closable
      }),
      style: style2,
      onMouseEnter: (e2) => {
        setHovering(true);
        divProps?.onMouseEnter?.(e2);
      },
      onMouseLeave: (e2) => {
        setHovering(false);
        divProps?.onMouseLeave?.(e2);
      },
      onClick
    }), React__namespace.createElement("div", {
      className: `${noticePrefixCls}-content`
    }, content), closable && React__namespace.createElement("button", _extends$a({
      className: `${noticePrefixCls}-close`,
      onKeyDown: onCloseKeyDown,
      "aria-label": "Close"
    }, ariaProps, {
      onClick: (e2) => {
        e2.preventDefault();
        e2.stopPropagation();
        onInternalClose();
      }
    }), closableObj.closeIcon ?? "x"), mergedShowProgress && React__namespace.createElement("progress", {
      className: `${noticePrefixCls}-progress`,
      max: "100",
      value: validPercent
    }, validPercent + "%"));
  });
  const NotificationContext = React.createContext({});
  const NotificationProvider = ({
    children,
    classNames
  }) => {
    return React.createElement(NotificationContext.Provider, {
      value: {
        classNames
      }
    }, children);
  };
  const DEFAULT_OFFSET$1 = 8;
  const DEFAULT_THRESHOLD = 3;
  const DEFAULT_GAP = 16;
  const useStack = (config) => {
    const result = {
      offset: DEFAULT_OFFSET$1,
      threshold: DEFAULT_THRESHOLD,
      gap: DEFAULT_GAP
    };
    if (config && typeof config === "object") {
      result.offset = config.offset ?? DEFAULT_OFFSET$1;
      result.threshold = config.threshold ?? DEFAULT_THRESHOLD;
      result.gap = config.gap ?? DEFAULT_GAP;
    }
    return [!!config, result];
  };
  function _extends$9() {
    _extends$9 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$9.apply(this, arguments);
  }
  const NoticeList = (props) => {
    const {
      configList,
      placement,
      prefixCls,
      className,
      style: style2,
      motion,
      onAllNoticeRemoved,
      onNoticeClose,
      stack: stackConfig
    } = props;
    const {
      classNames: ctxCls
    } = React.useContext(NotificationContext);
    const dictRef = React.useRef({});
    const [latestNotice, setLatestNotice] = React.useState(null);
    const [hoverKeys, setHoverKeys] = React.useState([]);
    const keys2 = configList.map((config) => ({
      config,
      key: String(config.key)
    }));
    const [stack2, {
      offset: offset2,
      threshold,
      gap
    }] = useStack(stackConfig);
    const expanded = stack2 && (hoverKeys.length > 0 || keys2.length <= threshold);
    const placementMotion = typeof motion === "function" ? motion(placement) : motion;
    React.useEffect(() => {
      if (stack2 && hoverKeys.length > 1) {
        setHoverKeys((prev2) => prev2.filter((key) => keys2.some(({
          key: dataKey
        }) => key === dataKey)));
      }
    }, [hoverKeys, keys2, stack2]);
    React.useEffect(() => {
      if (stack2 && dictRef.current[keys2[keys2.length - 1]?.key]) {
        setLatestNotice(dictRef.current[keys2[keys2.length - 1]?.key]);
      }
    }, [keys2, stack2]);
    return React.createElement(CSSMotionList, _extends$9({
      key: placement,
      className: clsx(prefixCls, `${prefixCls}-${placement}`, ctxCls?.list, className, {
        [`${prefixCls}-stack`]: !!stack2,
        [`${prefixCls}-stack-expanded`]: expanded
      }),
      style: style2,
      keys: keys2,
      motionAppear: true
    }, placementMotion, {
      onAllRemoved: () => {
        onAllNoticeRemoved(placement);
      }
    }), ({
      config,
      className: motionClassName,
      style: motionStyle,
      index: motionIndex
    }, nodeRef) => {
      const {
        key,
        times
      } = config;
      const strKey = String(key);
      const {
        className: configClassName,
        style: configStyle,
        classNames: configClassNames,
        styles: configStyles,
        ...restConfig
      } = config;
      const dataIndex = keys2.findIndex((item) => item.key === strKey);
      const stackStyle = {};
      if (stack2) {
        const index = keys2.length - 1 - (dataIndex > -1 ? dataIndex : motionIndex - 1);
        const transformX = placement === "top" || placement === "bottom" ? "-50%" : "0";
        if (index > 0) {
          stackStyle.height = expanded ? dictRef.current[strKey]?.offsetHeight : latestNotice?.offsetHeight;
          let verticalOffset = 0;
          for (let i = 0; i < index; i++) {
            verticalOffset += dictRef.current[keys2[keys2.length - 1 - i].key]?.offsetHeight + gap;
          }
          const transformY = (expanded ? verticalOffset : index * offset2) * (placement.startsWith("top") ? 1 : -1);
          const scaleX = !expanded && latestNotice?.offsetWidth && dictRef.current[strKey]?.offsetWidth ? (latestNotice?.offsetWidth - offset2 * 2 * (index < 3 ? index : 3)) / dictRef.current[strKey]?.offsetWidth : 1;
          stackStyle.transform = `translate3d(${transformX}, ${transformY}px, 0) scaleX(${scaleX})`;
        } else {
          stackStyle.transform = `translate3d(${transformX}, 0, 0)`;
        }
      }
      return React.createElement("div", {
        ref: nodeRef,
        className: clsx(`${prefixCls}-notice-wrapper`, motionClassName, configClassNames?.wrapper),
        style: {
          ...motionStyle,
          ...stackStyle,
          ...configStyles?.wrapper
        },
        onMouseEnter: () => setHoverKeys((prev2) => prev2.includes(strKey) ? prev2 : [...prev2, strKey]),
        onMouseLeave: () => setHoverKeys((prev2) => prev2.filter((k) => k !== strKey))
      }, React.createElement(Notify, _extends$9({}, restConfig, {
        ref: (node2) => {
          if (dataIndex > -1) {
            dictRef.current[strKey] = node2;
          } else {
            delete dictRef.current[strKey];
          }
        },
        prefixCls,
        classNames: configClassNames,
        styles: configStyles,
        className: clsx(configClassName, ctxCls?.notice),
        style: configStyle,
        times,
        key,
        eventKey: key,
        onNoticeClose,
        hovering: stack2 && hoverKeys.length > 0
      })));
    });
  };
  const Notifications = React__namespace.forwardRef((props, ref) => {
    const {
      prefixCls = "rc-notification",
      container,
      motion,
      maxCount,
      className,
      style: style2,
      onAllRemoved,
      stack: stack2,
      renderNotifications: renderNotifications2
    } = props;
    const [configList, setConfigList] = React__namespace.useState([]);
    const onNoticeClose = (key) => {
      const config = configList.find((item) => item.key === key);
      const closable = config?.closable;
      const closableObj = closable && typeof closable === "object" ? closable : {};
      const {
        onClose: closableOnClose
      } = closableObj;
      closableOnClose?.();
      config?.onClose?.();
      setConfigList((list) => list.filter((item) => item.key !== key));
    };
    React__namespace.useImperativeHandle(ref, () => ({
      open: (config) => {
        setConfigList((list) => {
          let clone = [...list];
          const index = clone.findIndex((item) => item.key === config.key);
          const innerConfig = {
            ...config
          };
          if (index >= 0) {
            innerConfig.times = (list[index]?.times || 0) + 1;
            clone[index] = innerConfig;
          } else {
            innerConfig.times = 0;
            clone.push(innerConfig);
          }
          if (maxCount > 0 && clone.length > maxCount) {
            clone = clone.slice(-maxCount);
          }
          return clone;
        });
      },
      close: (key) => {
        onNoticeClose(key);
      },
      destroy: () => {
        setConfigList([]);
      }
    }));
    const [placements2, setPlacements] = React__namespace.useState({});
    React__namespace.useEffect(() => {
      const nextPlacements = {};
      configList.forEach((config) => {
        const {
          placement = "topRight"
        } = config;
        if (placement) {
          nextPlacements[placement] = nextPlacements[placement] || [];
          nextPlacements[placement].push(config);
        }
      });
      Object.keys(placements2).forEach((placement) => {
        nextPlacements[placement] = nextPlacements[placement] || [];
      });
      setPlacements(nextPlacements);
    }, [configList]);
    const onAllNoticeRemoved = (placement) => {
      setPlacements((originPlacements) => {
        const clone = {
          ...originPlacements
        };
        const list = clone[placement] || [];
        if (!list.length) {
          delete clone[placement];
        }
        return clone;
      });
    };
    const emptyRef = React__namespace.useRef(false);
    React__namespace.useEffect(() => {
      if (Object.keys(placements2).length > 0) {
        emptyRef.current = true;
      } else if (emptyRef.current) {
        onAllRemoved?.();
        emptyRef.current = false;
      }
    }, [placements2]);
    if (!container) {
      return null;
    }
    const placementList = Object.keys(placements2);
    return require$$0.createPortal( React__namespace.createElement(React__namespace.Fragment, null, placementList.map((placement) => {
      const placementConfigList = placements2[placement];
      const list = React__namespace.createElement(NoticeList, {
        key: placement,
        configList: placementConfigList,
        placement,
        prefixCls,
        className: className?.(placement),
        style: style2?.(placement),
        motion,
        onNoticeClose,
        onAllNoticeRemoved,
        stack: stack2
      });
      return renderNotifications2 ? renderNotifications2(list, {
        prefixCls,
        key: placement
      }) : list;
    })), container);
  });
  const defaultGetContainer = () => document.body;
  let uniqueKey = 0;
  function mergeConfig(...objList) {
    const clone = {};
    objList.forEach((obj) => {
      if (obj) {
        Object.keys(obj).forEach((key) => {
          const val = obj[key];
          if (val !== void 0) {
            clone[key] = val;
          }
        });
      }
    });
    return clone;
  }
  function useNotification(rootConfig = {}) {
    const {
      getContainer: getContainer2 = defaultGetContainer,
      motion,
      prefixCls,
      maxCount,
      className,
      style: style2,
      onAllRemoved,
      stack: stack2,
      renderNotifications: renderNotifications2,
      ...shareConfig
    } = rootConfig;
    const [container, setContainer] = React__namespace.useState();
    const notificationsRef = React__namespace.useRef();
    const contextHolder = React__namespace.createElement(Notifications, {
      container,
      ref: notificationsRef,
      prefixCls,
      motion,
      maxCount,
      className,
      style: style2,
      onAllRemoved,
      stack: stack2,
      renderNotifications: renderNotifications2
    });
    const [taskQueue2, setTaskQueue] = React__namespace.useState([]);
    const open2 = useEvent((config) => {
      const mergedConfig = mergeConfig(shareConfig, config);
      if (mergedConfig.key === null || mergedConfig.key === void 0) {
        mergedConfig.key = `rc-notification-${uniqueKey}`;
        uniqueKey += 1;
      }
      setTaskQueue((queue) => [...queue, {
        type: "open",
        config: mergedConfig
      }]);
    });
    const api2 = React__namespace.useMemo(() => ({
      open: open2,
      close: (key) => {
        setTaskQueue((queue) => [...queue, {
          type: "close",
          key
        }]);
      },
      destroy: () => {
        setTaskQueue((queue) => [...queue, {
          type: "destroy"
        }]);
      }
    }), []);
    React__namespace.useEffect(() => {
      setContainer(getContainer2());
    });
    React__namespace.useEffect(() => {
      if (notificationsRef.current && taskQueue2.length) {
        taskQueue2.forEach((task) => {
          switch (task.type) {
            case "open":
              notificationsRef.current.open(task.config);
              break;
            case "close":
              notificationsRef.current.close(task.key);
              break;
            case "destroy":
              notificationsRef.current.destroy();
              break;
          }
        });
        let oriTaskQueue;
        let tgtTaskQueue;
        setTaskQueue((oriQueue) => {
          if (oriTaskQueue !== oriQueue || !tgtTaskQueue) {
            oriTaskQueue = oriQueue;
            tgtTaskQueue = oriQueue.filter((task) => !taskQueue2.includes(task));
          }
          return tgtTaskQueue;
        });
      }
    }, [taskQueue2]);
    return [api2, contextHolder];
  }
  var LoadingOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
  function _extends$8() {
    _extends$8 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$8.apply(this, arguments);
  }
  const LoadingOutlined = (props, ref) => React__namespace.createElement(Icon, _extends$8({}, props, {
    ref,
    icon: LoadingOutlined$1
  }));
  const RefIcon$1 = React__namespace.forwardRef(LoadingOutlined);
  const genMessageStyle = (token2) => {
    const {
      componentCls,
      iconCls,
      boxShadow,
      colorText,
      colorSuccess,
      colorError,
      colorWarning,
      colorInfo,
      fontSizeLG,
      motionEaseInOutCirc,
      motionDurationSlow,
      marginXS,
      paddingXS,
      borderRadiusLG,
      zIndexPopup,
contentPadding,
      contentBg
    } = token2;
    const noticeCls = `${componentCls}-notice`;
    const messageMoveIn = new Keyframe("MessageMoveIn", {
      "0%": {
        padding: 0,
        transform: "translateY(-100%)",
        opacity: 0
      },
      "100%": {
        padding: paddingXS,
        transform: "translateY(0)",
        opacity: 1
      }
    });
    const messageMoveOut = new Keyframe("MessageMoveOut", {
      "0%": {
        maxHeight: token2.height,
        padding: paddingXS,
        opacity: 1
      },
      "100%": {
        maxHeight: 0,
        padding: 0,
        opacity: 0
      }
    });
    const noticeStyle = {
      padding: paddingXS,
      textAlign: "center",
      [`${componentCls}-custom-content`]: {
        display: "flex",
        alignItems: "center"
      },
      [`${componentCls}-custom-content > ${iconCls}`]: {
        marginInlineEnd: marginXS,
fontSize: fontSizeLG
      },
      [`${noticeCls}-content`]: {
        display: "inline-block",
        padding: contentPadding,
        background: contentBg,
        borderRadius: borderRadiusLG,
        boxShadow,
        pointerEvents: "all"
      },
      [`${componentCls}-success > ${iconCls}`]: {
        color: colorSuccess
      },
      [`${componentCls}-error > ${iconCls}`]: {
        color: colorError
      },
      [`${componentCls}-warning > ${iconCls}`]: {
        color: colorWarning
      },
      [`${componentCls}-info > ${iconCls},
      ${componentCls}-loading > ${iconCls}`]: {
        color: colorInfo
      }
    };
    return [
{
        [componentCls]: {
          ...resetComponent(token2),
          color: colorText,
          position: "fixed",
          top: marginXS,
          width: "100%",
          pointerEvents: "none",
          zIndex: zIndexPopup,
          [`${componentCls}-move-up`]: {
            animationFillMode: "forwards"
          },
          [`
        ${componentCls}-move-up-appear,
        ${componentCls}-move-up-enter
      `]: {
            animationName: messageMoveIn,
            animationDuration: motionDurationSlow,
            animationPlayState: "paused",
            animationTimingFunction: motionEaseInOutCirc
          },
          [`
        ${componentCls}-move-up-appear${componentCls}-move-up-appear-active,
        ${componentCls}-move-up-enter${componentCls}-move-up-enter-active
      `]: {
            animationPlayState: "running"
          },
          [`${componentCls}-move-up-leave`]: {
            animationName: messageMoveOut,
            animationDuration: motionDurationSlow,
            animationPlayState: "paused",
            animationTimingFunction: motionEaseInOutCirc
          },
          [`${componentCls}-move-up-leave${componentCls}-move-up-leave-active`]: {
            animationPlayState: "running"
          },
          "&-rtl": {
            direction: "rtl",
            span: {
              direction: "rtl"
            }
          }
        }
      },
{
        [componentCls]: {
          [`${noticeCls}-wrapper`]: {
            ...noticeStyle
          }
        }
      },
{
        [`${componentCls}-notice-pure-panel`]: {
          ...noticeStyle,
          padding: 0,
          textAlign: "start"
        }
      }
    ];
  };
  const prepareComponentToken$5 = (token2) => ({
    zIndexPopup: token2.zIndexPopupBase + CONTAINER_MAX_OFFSET + 10,
    contentBg: token2.colorBgElevated,
    contentPadding: `${(token2.controlHeightLG - token2.fontSize * token2.lineHeight) / 2}px ${token2.paddingSM}px`
  });
  const useStyle$6 = genStyleHooks("Message", (token2) => {
    const combinedToken = merge(token2, {
      height: 150
    });
    return genMessageStyle(combinedToken);
  }, prepareComponentToken$5);
  const TypeIcon = {
    info: React__namespace.createElement(RefIcon$2, null),
    success: React__namespace.createElement(RefIcon$5, null),
    error: React__namespace.createElement(RefIcon$4, null),
    warning: React__namespace.createElement(RefIcon$3, null),
    loading: React__namespace.createElement(RefIcon$1, null)
  };
  const PureContent = (props) => {
    const {
      prefixCls,
      type: type4,
      icon,
      children,
      classNames: pureContentClassNames,
      styles
    } = props;
    const iconElement = icon || type4 && TypeIcon[type4];
    const iconNode = cloneElement(iconElement, (currentProps) => {
      const mergedStyle = {
        ...currentProps?.style,
        ...styles?.icon
      };
      return {
        className: clsx(currentProps.className, pureContentClassNames?.icon),
        style: mergedStyle
      };
    });
    return React__namespace.createElement("div", {
      className: clsx(`${prefixCls}-custom-content`, `${prefixCls}-${type4}`)
    }, iconNode, React__namespace.createElement("span", {
      className: pureContentClassNames?.content,
      style: styles?.content
    }, children));
  };
  const PurePanel$3 = (props) => {
    const {
      prefixCls: staticPrefixCls,
      className,
      style: style2,
      type: type4,
      icon,
      content,
      classNames: messageClassNames,
      styles,
      ...restProps
    } = props;
    const {
      getPrefixCls,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles
    } = useComponentConfig("message");
    const prefixCls = staticPrefixCls || getPrefixCls("message");
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$6(prefixCls, rootCls);
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, messageClassNames], [contextStyles, styles], {
      props
    });
    return React__namespace.createElement(Notify, {
      ...restProps,
      prefixCls,
      className: clsx(contextClassName, mergedClassNames.root, className, hashId, `${prefixCls}-notice-pure-panel`, cssVarCls, rootCls),
      style: {
        ...mergedStyles.root,
        ...contextStyle,
        ...style2
      },
      eventKey: "pure",
      duration: null,
      content: React__namespace.createElement(PureContent, {
        prefixCls,
        type: type4,
        icon,
        classNames: mergedClassNames,
        styles: mergedStyles
      }, content)
    });
  };
  function getMotion(prefixCls, transitionName) {
    return {
      motionName: transitionName ?? `${prefixCls}-move-up`
    };
  }
  function wrapPromiseFn(openFn) {
    let closeFn;
    const closePromise = new Promise((resolve) => {
      closeFn = openFn(() => {
        resolve(true);
      });
    });
    const result = () => {
      closeFn?.();
    };
    result.then = (filled, rejected) => closePromise.then(filled, rejected);
    result.promise = closePromise;
    return result;
  }
  const DEFAULT_OFFSET = 8;
  const DEFAULT_DURATION = 3;
  const Wrapper = ({
    children,
    prefixCls
  }) => {
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$6(prefixCls, rootCls);
    return React__namespace.createElement(NotificationProvider, {
      classNames: {
        list: clsx(hashId, cssVarCls, rootCls)
      }
    }, children);
  };
  const renderNotifications = (node2, {
    prefixCls,
    key
  }) => React__namespace.createElement(Wrapper, {
    prefixCls,
    key
  }, node2);
  const Holder = React__namespace.forwardRef((props, ref) => {
    const {
      top,
      prefixCls: staticPrefixCls,
      getContainer: staticGetContainer,
      maxCount,
      duration = DEFAULT_DURATION,
      rtl,
      transitionName,
      onAllRemoved,
      pauseOnHover = true
    } = props;
    const {
      getPrefixCls,
      direction,
      getPopupContainer
    } = useComponentConfig("message");
    const {
      message: message2
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = staticPrefixCls || getPrefixCls("message");
    const getStyle = () => ({
      left: "50%",
      transform: "translateX(-50%)",
      top: top ?? DEFAULT_OFFSET
    });
    const getClassName = () => clsx({
      [`${prefixCls}-rtl`]: rtl ?? direction === "rtl"
    });
    const getNotificationMotion = () => getMotion(prefixCls, transitionName);
    const [mergedClassNames, mergedStyles] = useMergeSemantic([props?.classNames, message2?.classNames], [props?.styles, message2?.styles], {
      props
    });
    const [api2, holder] = useNotification({
      prefixCls,
      style: getStyle,
      className: getClassName,
      motion: getNotificationMotion,
closable: false,
      duration,
      getContainer: () => staticGetContainer?.() || getPopupContainer?.() || document.body,
      maxCount,
      onAllRemoved,
      renderNotifications,
      pauseOnHover
    });
    React__namespace.useImperativeHandle(ref, () => ({
      ...api2,
      prefixCls,
      message: message2,
      classNames: mergedClassNames,
      styles: mergedStyles
    }));
    return holder;
  });
  let keyIndex = 0;
  function useInternalMessage(messageConfig) {
    const holderRef = React__namespace.useRef(null);
    const wrapAPI = React__namespace.useMemo(() => {
      const close = (key) => {
        holderRef.current?.close(key);
      };
      const open2 = (config) => {
        if (!holderRef.current) {
          const fakeResult = () => {
          };
          fakeResult.then = () => {
          };
          return fakeResult;
        }
        const {
          open: originOpen,
          prefixCls,
          message: message2,
          classNames: originClassNames,
          styles: originStyles
        } = holderRef.current;
        const contextClassName = message2?.className || {};
        const contextStyle = message2?.style || {};
        const rawContextClassNames = message2?.classNames || {};
        const rawContextStyles = message2?.styles || {};
        const noticePrefixCls = `${prefixCls}-notice`;
        const {
          content,
          icon,
          type: type4,
          key,
          className,
          style: style2,
          onClose,
          classNames: configClassNames = {},
          styles = {},
          ...restConfig
        } = config;
        let mergedKey = key;
        if (!isNonNullable$1(mergedKey)) {
          keyIndex += 1;
          mergedKey = `antd-message-${keyIndex}`;
        }
        const contextConfig = {
          ...messageConfig,
          ...config
        };
        const contextClassNames = resolveStyleOrClass(rawContextClassNames, {
          props: contextConfig
        });
        const semanticClassNames = resolveStyleOrClass(configClassNames, {
          props: contextConfig
        });
        const contextStyles = resolveStyleOrClass(rawContextStyles, {
          props: contextConfig
        });
        const semanticStyles = resolveStyleOrClass(styles, {
          props: contextConfig
        });
        const mergedClassNames = mergeClassNames(void 0, contextClassNames, semanticClassNames, originClassNames);
        const mergedStyles = mergeStyles(contextStyles, semanticStyles, originStyles);
        return wrapPromiseFn((resolve) => {
          originOpen({
            ...restConfig,
            key: mergedKey,
            content: React__namespace.createElement(PureContent, {
              prefixCls,
              type: type4,
              icon,
              classNames: mergedClassNames,
              styles: mergedStyles
            }, content),
            placement: "top",
            className: clsx({
              [`${noticePrefixCls}-${type4}`]: type4
            }, className, contextClassName, mergedClassNames.root),
            style: {
              ...mergedStyles.root,
              ...contextStyle,
              ...style2
            },
            onClose: () => {
              onClose?.();
              resolve();
            }
          });
          return () => {
            close(mergedKey);
          };
        });
      };
      const destroy2 = (key) => {
        if (key !== void 0) {
          close(key);
        } else {
          holderRef.current?.destroy();
        }
      };
      const clone = {
        open: open2,
        destroy: destroy2
      };
      const keys2 = ["info", "success", "warning", "error", "loading"];
      keys2.forEach((type4) => {
        const typeOpen2 = (jointContent, duration, onClose) => {
          let config;
          if (jointContent && typeof jointContent === "object" && "content" in jointContent) {
            config = jointContent;
          } else {
            config = {
              content: jointContent
            };
          }
          let mergedDuration;
          let mergedOnClose;
          if (typeof duration === "function") {
            mergedOnClose = duration;
          } else {
            mergedDuration = duration;
            mergedOnClose = onClose;
          }
          const mergedConfig = {
            onClose: mergedOnClose,
            duration: mergedDuration,
            ...config,
            type: type4
          };
          return open2(mergedConfig);
        };
        clone[type4] = typeOpen2;
      });
      return clone;
    }, []);
    return [wrapAPI, React__namespace.createElement(Holder, {
      key: "message-holder",
      ...messageConfig,
      ref: holderRef
    })];
  }
  function useMessage(messageConfig) {
    return useInternalMessage(messageConfig);
  }
  const MARK = "__rc_react_root__";
  function render(node2, container) {
    const root = container[MARK] || clientExports.createRoot(container);
    root.render(node2);
    container[MARK] = root;
  }
  async function unmount(container) {
    return Promise.resolve().then(() => {
      container[MARK]?.unmount();
      delete container[MARK];
    });
  }
  const getCollapsedHeight = () => ({
    height: 0,
    opacity: 0
  });
  const getRealHeight = (node2) => {
    const {
      scrollHeight
    } = node2;
    return {
      height: scrollHeight,
      opacity: 1
    };
  };
  const getCurrentHeight = (node2) => ({
    height: node2 ? node2.offsetHeight : 0
  });
  const skipOpacityTransition = (_, event) => event?.deadline === true || event.propertyName === "height";
  const initCollapseMotion = (rootCls = defaultPrefixCls) => ({
    motionName: `${rootCls}-motion-collapse`,
    onAppearStart: getCollapsedHeight,
    onEnterStart: getCollapsedHeight,
    onAppearActive: getRealHeight,
    onEnterActive: getRealHeight,
    onLeaveStart: getCurrentHeight,
    onLeaveActive: getCollapsedHeight,
    onAppearEnd: skipOpacityTransition,
    onEnterEnd: skipOpacityTransition,
    onLeaveEnd: skipOpacityTransition,
    motionDeadline: 500
  });
  const getTransitionName = (rootPrefixCls, motion, transitionName) => {
    if (transitionName !== void 0) {
      return transitionName;
    }
    return `${rootPrefixCls}-${motion}`;
  };
  const genWaveStyle = (token2) => {
    const {
      componentCls,
      colorPrimary,
      motionDurationSlow,
      motionEaseInOut,
      motionEaseOutCirc,
      antCls
    } = token2;
    const [, varRef] = genCssVar(antCls, "wave");
    return {
      [componentCls]: {
        position: "absolute",
        background: "transparent",
        pointerEvents: "none",
        boxSizing: "border-box",
        color: varRef("color", colorPrimary),
        boxShadow: `0 0 0 0 currentcolor`,
        opacity: 0.2,
"&.wave-motion-appear": {
          transition: [`box-shadow 0.4s`, `opacity 2s`].map((prop) => `${prop} ${motionEaseOutCirc}`).join(","),
          "&-active": {
            boxShadow: `0 0 0 6px currentcolor`,
            opacity: 0
          },
          "&.wave-quick": {
            transition: [`box-shadow`, `opacity`].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",")
          }
        }
      }
    };
  };
  const useStyle$5 = genComponentStyleHook("Wave", genWaveStyle);
  const TARGET_CLS = `${defaultPrefixCls}-wave-target`;
  function isValidWaveColor(color) {
    return color && typeof color === "string" && color !== "#fff" && color !== "#ffffff" && color !== "rgb(255, 255, 255)" && color !== "rgba(255, 255, 255, 1)" && !/rgba\((?:\d*, ){3}0\)/.test(color) &&
color !== "transparent" && color !== "canvastext";
  }
  function getTargetWaveColor(node2, colorSource = null) {
    const style2 = getComputedStyle(node2);
    const {
      borderTopColor,
      borderColor,
      backgroundColor
    } = style2;
    if (colorSource && isValidWaveColor(style2[colorSource])) {
      return style2[colorSource];
    }
    return [borderTopColor, borderColor, backgroundColor].find(isValidWaveColor) ?? null;
  }
  function validateNum(value) {
    return Number.isNaN(value) ? 0 : value;
  }
  const WaveEffect = (props) => {
    const {
      className,
      target,
      component,
      colorSource
    } = props;
    const divRef = React__namespace.useRef(null);
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const rootPrefixCls = getPrefixCls();
    const [varName] = genCssVar(rootPrefixCls, "wave");
    const [waveColor, setWaveColor] = React__namespace.useState(null);
    const [borderRadius, setBorderRadius] = React__namespace.useState([]);
    const [left, setLeft] = React__namespace.useState(0);
    const [top, setTop] = React__namespace.useState(0);
    const [width, setWidth] = React__namespace.useState(0);
    const [height, setHeight] = React__namespace.useState(0);
    const [enabled, setEnabled] = React__namespace.useState(false);
    const waveStyle = {
      left,
      top,
      width,
      height,
      borderRadius: borderRadius.map((radius) => `${radius}px`).join(" ")
    };
    if (waveColor) {
      waveStyle[varName("color")] = waveColor;
    }
    function syncPos() {
      const nodeStyle = getComputedStyle(target);
      setWaveColor(getTargetWaveColor(target, colorSource));
      const isStatic = nodeStyle.position === "static";
      const {
        borderLeftWidth,
        borderTopWidth
      } = nodeStyle;
      setLeft(isStatic ? target.offsetLeft : validateNum(-Number.parseFloat(borderLeftWidth)));
      setTop(isStatic ? target.offsetTop : validateNum(-Number.parseFloat(borderTopWidth)));
      setWidth(target.offsetWidth);
      setHeight(target.offsetHeight);
      const {
        borderTopLeftRadius,
        borderTopRightRadius,
        borderBottomLeftRadius,
        borderBottomRightRadius
      } = nodeStyle;
      setBorderRadius([borderTopLeftRadius, borderTopRightRadius, borderBottomRightRadius, borderBottomLeftRadius].map((radius) => validateNum(Number.parseFloat(radius))));
    }
    React__namespace.useEffect(() => {
      if (target) {
        const id = wrapperRaf(() => {
          syncPos();
          setEnabled(true);
        });
        let resizeObserver;
        if (typeof ResizeObserver !== "undefined") {
          resizeObserver = new ResizeObserver(syncPos);
          resizeObserver.observe(target);
        }
        return () => {
          wrapperRaf.cancel(id);
          resizeObserver?.disconnect();
        };
      }
    }, [target]);
    if (!enabled) {
      return null;
    }
    const isSmallComponent = (component === "Checkbox" || component === "Radio") && target?.classList.contains(TARGET_CLS);
    return React__namespace.createElement(CSSMotion, {
      visible: true,
      motionAppear: true,
      motionName: "wave-motion",
      motionDeadline: 5e3,
      onAppearEnd: (_, event) => {
        if (event.deadline || event.propertyName === "opacity") {
          const holder = divRef.current?.parentElement;
          unmount(holder).then(() => {
            holder?.remove();
          });
        }
        return false;
      }
    }, ({
      className: motionClassName
    }, ref) => React__namespace.createElement("div", {
      ref: composeRef(divRef, ref),
      className: clsx(className, motionClassName, {
        "wave-quick": isSmallComponent
      }),
      style: waveStyle
    }));
  };
  const showWaveEffect = (target, info) => {
    const {
      component
    } = info;
    if (component === "Checkbox" && !target.querySelector("input")?.checked) {
      return;
    }
    const holder = document.createElement("div");
    holder.style.position = "absolute";
    holder.style.left = "0px";
    holder.style.top = "0px";
    target?.insertBefore(holder, target?.firstChild);
    render( React__namespace.createElement(WaveEffect, {
      ...info,
      target
    }), holder);
  };
  const useWave = (nodeRef, className, component, colorSource) => {
    const {
      wave
    } = React__namespace.useContext(ConfigContext);
    const [, token2, hashId] = useToken();
    const showWave = useEvent((event) => {
      const node2 = nodeRef.current;
      if (wave?.disabled || !node2) {
        return;
      }
      const targetNode = node2.querySelector(`.${TARGET_CLS}`) || node2;
      const {
        showEffect
      } = wave || {};
      (showEffect || showWaveEffect)(targetNode, {
        className,
        token: token2,
        component,
        event,
        hashId,
        colorSource
      });
    });
    const rafIdRef = React__namespace.useRef(null);
    React__namespace.useEffect(() => () => {
      wrapperRaf.cancel(rafIdRef.current);
    }, []);
    const showDebounceWave = (event) => {
      wrapperRaf.cancel(rafIdRef.current);
      rafIdRef.current = wrapperRaf(() => {
        showWave(event);
      });
    };
    return showDebounceWave;
  };
  const Wave = (props) => {
    const {
      children,
      disabled,
      component,
      colorSource
    } = props;
    const {
      getPrefixCls
    } = React.useContext(ConfigContext);
    const containerRef = React.useRef(null);
    const prefixCls = getPrefixCls("wave");
    const hashId = useStyle$5(prefixCls);
    const showWave = useWave(containerRef, clsx(prefixCls, hashId), component, colorSource);
    React.useEffect(() => {
      const node2 = containerRef.current;
      if (!node2 || node2.nodeType !== window.Node.ELEMENT_NODE || disabled) {
        return;
      }
      const onClick = (e2) => {
        if (!isVisible(e2.target) ||
!node2.getAttribute || node2.getAttribute("disabled") || node2.disabled || node2.className.includes("disabled") && !node2.className.includes("disabled:") || node2.getAttribute("aria-disabled") === "true" || node2.className.includes("-leave")) {
          return;
        }
        showWave(e2);
      };
      node2.addEventListener("click", onClick, true);
      return () => {
        node2.removeEventListener("click", onClick, true);
      };
    }, [disabled]);
    if (! React.isValidElement(children)) {
      return children ?? null;
    }
    const ref = supportRef(children) ? composeRef(getNodeRef(children), containerRef) : containerRef;
    return cloneElement(children, {
      ref
    });
  };
  const SpaceCompactItemContext = React__namespace.createContext(null);
  const useCompactItemContext = (prefixCls, direction) => {
    const compactItemContext = React__namespace.useContext(SpaceCompactItemContext);
    const compactItemClassnames = React__namespace.useMemo(() => {
      if (!compactItemContext) {
        return "";
      }
      const {
        compactDirection,
        isFirstItem,
        isLastItem
      } = compactItemContext;
      const separator = compactDirection === "vertical" ? "-vertical-" : "-";
      return clsx(`${prefixCls}-compact${separator}item`, {
        [`${prefixCls}-compact${separator}first-item`]: isFirstItem,
        [`${prefixCls}-compact${separator}last-item`]: isLastItem,
        [`${prefixCls}-compact${separator}item-rtl`]: direction === "rtl"
      });
    }, [prefixCls, direction, compactItemContext]);
    return {
      compactSize: compactItemContext?.compactSize,
      compactDirection: compactItemContext?.compactDirection,
      compactItemClassnames
    };
  };
  const NoCompactStyle = (props) => {
    const {
      children
    } = props;
    return React__namespace.createElement(SpaceCompactItemContext.Provider, {
      value: null
    }, children);
  };
  const GroupSizeContext = React__namespace.createContext(void 0);
  const ButtonGroup = (props) => {
    const {
      getPrefixCls,
      direction
    } = React__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      size,
      className,
      ...others
    } = props;
    const prefixCls = getPrefixCls("btn-group", customizePrefixCls);
    const [, , hashId] = useToken();
    const sizeCls = React__namespace.useMemo(() => {
      switch (size) {
        case "large":
          return "lg";
        case "small":
          return "sm";
        default:
          return "";
      }
    }, [size]);
    const classes = clsx(prefixCls, {
      [`${prefixCls}-${sizeCls}`]: sizeCls,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, className, hashId);
    return React__namespace.createElement(GroupSizeContext.Provider, {
      value: size
    }, React__namespace.createElement("div", {
      ...others,
      className: classes
    }));
  };
  const rxTwoCNChar = /^[\u4E00-\u9FA5]{2}$/;
  const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
  function convertLegacyProps(type4) {
    if (type4 === "danger") {
      return {
        danger: true
      };
    }
    return {
      type: type4
    };
  }
  function isString(str) {
    return typeof str === "string";
  }
  function isUnBorderedButtonVariant(type4) {
    return type4 === "text" || type4 === "link";
  }
  function splitCNCharsBySpace(child, needInserted, style2, className) {
    if (!isNonNullable$1(child) || child === "") {
      return;
    }
    const SPACE = needInserted ? " " : "";
    if (typeof child !== "string" && typeof child !== "number" && isString(child.type) && isTwoCNChar(child.props.children)) {
      return cloneElement(child, (oriProps) => {
        const mergedCls = clsx(oriProps.className, className) || void 0;
        const mergedStyle = {
          ...style2,
          ...oriProps.style
        };
        return {
          ...oriProps,
          children: oriProps.children.split("").join(SPACE),
          className: mergedCls,
          style: mergedStyle
        };
      });
    }
    if (isString(child)) {
      return React.createElement("span", {
        className,
        style: style2
      }, isTwoCNChar(child) ? child.split("").join(SPACE) : child);
    }
    if (isFragment(child)) {
      return React.createElement("span", {
        className,
        style: style2
      }, child);
    }
    return cloneElement(child, (oriProps) => ({
      ...oriProps,
      className: clsx(oriProps.className, className) || void 0,
      style: {
        ...oriProps.style,
        ...style2
      }
    }));
  }
  function spaceChildren(children, needInserted, style2, className) {
    let isPrevChildPure = false;
    const childList = [];
    React.Children.forEach(children, (child) => {
      const type4 = typeof child;
      const isCurrentChildPure = type4 === "string" || type4 === "number";
      if (isPrevChildPure && isCurrentChildPure) {
        const lastIndex = childList.length - 1;
        const lastChild = childList[lastIndex];
        childList[lastIndex] = `${lastChild}${child}`;
      } else {
        childList.push(child);
      }
      isPrevChildPure = isCurrentChildPure;
    });
    return React.Children.map(childList, (child) => splitCNCharsBySpace(child, needInserted, style2, className));
  }
  ["default", "primary", "danger"].concat(_toConsumableArray(PresetColors));
  const IconWrapper = React.forwardRef((props, ref) => {
    const {
      className,
      style: style2,
      children,
      prefixCls
    } = props;
    const iconWrapperCls = clsx(`${prefixCls}-icon`, className);
    return React.createElement("span", {
      ref,
      className: iconWrapperCls,
      style: style2
    }, children);
  });
  const InnerLoadingIcon = React.forwardRef((props, ref) => {
    const {
      prefixCls,
      className,
      style: style2,
      iconClassName
    } = props;
    const mergedIconCls = clsx(`${prefixCls}-loading-icon`, className);
    return React.createElement(IconWrapper, {
      prefixCls,
      className: mergedIconCls,
      style: style2,
      ref
    }, React.createElement(RefIcon$1, {
      className: iconClassName
    }));
  });
  const getCollapsedWidth = () => ({
    width: 0,
    opacity: 0,
    transform: "scale(0)"
  });
  const getRealWidth = (node2) => ({
    width: node2.scrollWidth,
    opacity: 1,
    transform: "scale(1)"
  });
  const DefaultLoadingIcon = (props) => {
    const {
      prefixCls,
      loading,
      existIcon,
      className,
      style: style2,
      mount
    } = props;
    const visible = !!loading;
    if (existIcon) {
      return React.createElement(InnerLoadingIcon, {
        prefixCls,
        className,
        style: style2
      });
    }
    return React.createElement(CSSMotion, {
      visible,
motionName: `${prefixCls}-loading-icon-motion`,
      motionAppear: !mount,
      motionEnter: !mount,
      motionLeave: !mount,
      removeOnLeave: true,
      onAppearStart: getCollapsedWidth,
      onAppearActive: getRealWidth,
      onEnterStart: getCollapsedWidth,
      onEnterActive: getRealWidth,
      onLeaveStart: getRealWidth,
      onLeaveActive: getCollapsedWidth
    }, ({
      className: motionCls,
      style: motionStyle
    }, ref) => {
      const mergedStyle = {
        ...style2,
        ...motionStyle
      };
      return React.createElement(InnerLoadingIcon, {
        prefixCls,
        className: clsx(className, motionCls),
        style: mergedStyle,
        ref
      });
    });
  };
  const genButtonBorderStyle = (buttonTypeCls, borderColor) => ({
[`> span, > ${buttonTypeCls}`]: {
      "&:not(:last-child)": {
        [`&, & > ${buttonTypeCls}`]: {
          "&:not(:disabled)": {
            borderInlineEndColor: borderColor
          }
        }
      },
      "&:not(:first-child)": {
        [`&, & > ${buttonTypeCls}`]: {
          "&:not(:disabled)": {
            borderInlineStartColor: borderColor
          }
        }
      }
    }
  });
  const genGroupStyle = (token2) => {
    const {
      componentCls,
      fontSize,
      lineWidth,
      groupBorderColor,
      colorErrorHover
    } = token2;
    return {
      [`${componentCls}-group`]: [
        {
          position: "relative",
          display: "inline-flex",
[`> span, > ${componentCls}`]: {
            "&:not(:last-child)": {
              [`&, & > ${componentCls}`]: {
                borderStartEndRadius: 0,
                borderEndEndRadius: 0
              }
            },
            "&:not(:first-child)": {
              marginInlineStart: token2.calc(lineWidth).mul(-1).equal(),
              [`&, & > ${componentCls}`]: {
                borderStartStartRadius: 0,
                borderEndStartRadius: 0
              }
            }
          },
          [componentCls]: {
            position: "relative",
            zIndex: 1,
            "&:hover, &:focus, &:active": {
              zIndex: 2
            },
            "&[disabled]": {
              zIndex: 0
            }
          },
          [`${componentCls}-icon-only`]: {
            fontSize
          }
        },
genButtonBorderStyle(`${componentCls}-primary`, groupBorderColor),
        genButtonBorderStyle(`${componentCls}-danger`, colorErrorHover)
      ]
    };
  };
  const getRoundNumber = (value) => Math.round(Number(value || 0));
  const convertHsb2Hsv = (color) => {
    if (color instanceof FastColor) {
      return color;
    }
    if (color && typeof color === "object" && "h" in color && "b" in color) {
      const {
        b,
        ...resets
      } = color;
      return {
        ...resets,
        v: b
      };
    }
    if (typeof color === "string" && /hsb/.test(color)) {
      return color.replace(/hsb/, "hsv");
    }
    return color;
  };
  class Color extends FastColor {
    constructor(color) {
      super(convertHsb2Hsv(color));
    }
    toHsbString() {
      const hsb = this.toHsb();
      const saturation = getRoundNumber(hsb.s * 100);
      const lightness = getRoundNumber(hsb.b * 100);
      const hue = getRoundNumber(hsb.h);
      const alpha = hsb.a;
      const hsbString = `hsb(${hue}, ${saturation}%, ${lightness}%)`;
      const hsbaString = `hsba(${hue}, ${saturation}%, ${lightness}%, ${alpha.toFixed(alpha === 0 ? 0 : 2)})`;
      return alpha === 1 ? hsbString : hsbaString;
    }
    toHsb() {
      const {
        v,
        ...resets
      } = this.toHsv();
      return {
        ...resets,
        b: v,
        a: this.a
      };
    }
  }
  const generateColor$1 = (color) => {
    if (color instanceof Color) {
      return color;
    }
    return new Color(color);
  };
  generateColor$1("#1677ff");
  const toHexFormat = (value, alpha) => value?.replace(/[^0-9a-f]/gi, "").slice(0, alpha ? 8 : 6) || "";
  const getHex = (value, alpha) => value ? toHexFormat(value, alpha) : "";
  let AggregationColor = (function() {
    function AggregationColor2(color) {
      _classCallCheck(this, AggregationColor2);
      this.cleared = false;
      if (color instanceof AggregationColor2) {
        this.metaColor = color.metaColor.clone();
        this.colors = color.colors?.map((info) => ({
          color: new AggregationColor2(info.color),
          percent: info.percent
        }));
        this.cleared = color.cleared;
        return;
      }
      const isArray = Array.isArray(color);
      if (isArray && color.length) {
        this.colors = color.map(({
          color: c,
          percent
        }) => ({
          color: new AggregationColor2(c),
          percent
        }));
        this.metaColor = new Color(this.colors[0].color.metaColor);
      } else {
        this.metaColor = new Color(isArray ? "" : color);
      }
      if (!color || isArray && !this.colors) {
        this.metaColor = this.metaColor.setA(0);
        this.cleared = true;
      }
    }
    return _createClass(AggregationColor2, [{
      key: "toHsb",
      value: function toHsb() {
        return this.metaColor.toHsb();
      }
    }, {
      key: "toHsbString",
      value: function toHsbString() {
        return this.metaColor.toHsbString();
      }
    }, {
      key: "toHex",
      value: function toHex() {
        return getHex(this.toHexString(), this.metaColor.a < 1);
      }
    }, {
      key: "toHexString",
      value: function toHexString() {
        return this.metaColor.toHexString();
      }
    }, {
      key: "toRgb",
      value: function toRgb() {
        return this.metaColor.toRgb();
      }
    }, {
      key: "toRgbString",
      value: function toRgbString() {
        return this.metaColor.toRgbString();
      }
    }, {
      key: "isGradient",
      value: function isGradient() {
        return !!this.colors && !this.cleared;
      }
    }, {
      key: "getColors",
      value: function getColors() {
        return this.colors || [{
          color: this,
          percent: 0
        }];
      }
    }, {
      key: "toCssString",
      value: function toCssString() {
        const {
          colors
        } = this;
        if (colors) {
          const colorsStr = colors.map((c) => `${c.color.toRgbString()} ${c.percent}%`).join(", ");
          return `linear-gradient(90deg, ${colorsStr})`;
        }
        return this.metaColor.toRgbString();
      }
    }, {
      key: "equals",
      value: function equals(color) {
        if (!color || this.isGradient() !== color.isGradient()) {
          return false;
        }
        if (!this.isGradient()) {
          return this.toHexString() === color.toHexString();
        }
        return this.colors.length === color.colors.length && this.colors.every((c, i) => {
          const target = color.colors[i];
          return c.percent === target.percent && c.color.equals(target.color);
        });
      }
    }]);
  })();
  const generateColor = (color) => {
    if (color instanceof AggregationColor) {
      return color;
    }
    return new AggregationColor(color);
  };
  const isBright = (value, bgColorToken) => {
    const {
      r: r2,
      g,
      b,
      a
    } = value.toRgb();
    const hsv = new Color(value.toRgbString()).onBackground(bgColorToken).toHsv();
    if (a <= 0.5) {
      return hsv.v > 0.5;
    }
    return r2 * 0.299 + g * 0.587 + b * 0.114 > 192;
  };
  const prepareToken$1 = (token2) => {
    const {
      paddingInline,
      onlyIconSize,
      borderColorDisabled
    } = token2;
    const buttonToken = merge(token2, {
      buttonPaddingHorizontal: paddingInline,
      buttonPaddingVertical: 0,
      buttonIconOnlyFontSize: onlyIconSize,
      colorBorderDisabled: borderColorDisabled
    });
    return buttonToken;
  };
  const prepareComponentToken$4 = (token2) => {
    const contentFontSize = token2.contentFontSize ?? token2.fontSize;
    const contentFontSizeSM = token2.contentFontSizeSM ?? token2.fontSize;
    const contentFontSizeLG = token2.contentFontSizeLG ?? token2.fontSizeLG;
    const contentLineHeight = token2.contentLineHeight ?? getLineHeight(contentFontSize);
    const contentLineHeightSM = token2.contentLineHeightSM ?? getLineHeight(contentFontSizeSM);
    const contentLineHeightLG = token2.contentLineHeightLG ?? getLineHeight(contentFontSizeLG);
    const solidTextColor = isBright(new AggregationColor(token2.colorBgSolid), "#fff") ? "#000" : "#fff";
    const shadowColorTokens = PresetColors.reduce((prev2, colorKey) => ({
      ...prev2,
      [`${colorKey}ShadowColor`]: `0 ${unit$1(token2.controlOutlineWidth)} 0 ${getAlphaColor(token2[`${colorKey}1`], token2.colorBgContainer)}`
    }), {});
    const defaultBgDisabled = token2.colorBgContainerDisabled;
    const dashedBgDisabled = token2.colorBgContainerDisabled;
    return {
      ...shadowColorTokens,
      fontWeight: 400,
      iconGap: token2.marginXS,
      defaultShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlTmpOutline}`,
      primaryShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.controlOutline}`,
      dangerShadow: `0 ${token2.controlOutlineWidth}px 0 ${token2.colorErrorOutline}`,
      primaryColor: token2.colorTextLightSolid,
      dangerColor: token2.colorTextLightSolid,
      borderColorDisabled: token2.colorBorderDisabled,
      defaultGhostColor: token2.colorBgContainer,
      ghostBg: "transparent",
      defaultGhostBorderColor: token2.colorBgContainer,
      paddingInline: token2.paddingContentHorizontal - token2.lineWidth,
      paddingInlineLG: token2.paddingContentHorizontal - token2.lineWidth,
      paddingInlineSM: 8 - token2.lineWidth,
      onlyIconSize: "inherit",
      onlyIconSizeSM: "inherit",
      onlyIconSizeLG: "inherit",
      groupBorderColor: token2.colorPrimaryHover,
      linkHoverBg: "transparent",
      textTextColor: token2.colorText,
      textTextHoverColor: token2.colorText,
      textTextActiveColor: token2.colorText,
      textHoverBg: token2.colorFillTertiary,
      defaultColor: token2.colorText,
      defaultBg: token2.colorBgContainer,
      defaultBorderColor: token2.colorBorder,
      defaultBorderColorDisabled: token2.colorBorder,
      defaultHoverBg: token2.colorBgContainer,
      defaultHoverColor: token2.colorPrimaryHover,
      defaultHoverBorderColor: token2.colorPrimaryHover,
      defaultActiveBg: token2.colorBgContainer,
      defaultActiveColor: token2.colorPrimaryActive,
      defaultActiveBorderColor: token2.colorPrimaryActive,
      solidTextColor,
      contentFontSize,
      contentFontSizeSM,
      contentFontSizeLG,
      contentLineHeight,
      contentLineHeightSM,
      contentLineHeightLG,
      paddingBlock: Math.max((token2.controlHeight - contentFontSize * contentLineHeight) / 2 - token2.lineWidth, 0),
      paddingBlockSM: Math.max((token2.controlHeightSM - contentFontSizeSM * contentLineHeightSM) / 2 - token2.lineWidth, 0),
      paddingBlockLG: Math.max((token2.controlHeightLG - contentFontSizeLG * contentLineHeightLG) / 2 - token2.lineWidth, 0),
      defaultBgDisabled,
      dashedBgDisabled
    };
  };
  const genVariantStyle = (token2) => {
    const {
      componentCls,
      antCls,
      lineWidth
    } = token2;
    const [varName, varRef] = genCssVar(antCls, "btn");
    return {
      [componentCls]: [


{
[varName("border-width")]: lineWidth,
          [varName("border-color")]: "#000",
          [varName("border-color-hover")]: varRef("border-color"),
          [varName("border-color-active")]: varRef("border-color"),
          [varName("border-color-disabled")]: varRef("border-color"),
          [varName("border-style")]: "solid",
[varName("text-color")]: "#000",
          [varName("text-color-hover")]: varRef("text-color"),
          [varName("text-color-active")]: varRef("text-color"),
          [varName("text-color-disabled")]: varRef("text-color"),
[varName("bg-color")]: "#ddd",
          [varName("bg-color-hover")]: varRef("bg-color"),
          [varName("bg-color-active")]: varRef("bg-color"),
          [varName("bg-color-disabled")]: token2.colorBgContainerDisabled,
          [varName("bg-color-container")]: token2.colorBgContainer,
[varName("shadow")]: "none"
        },


{
border: [varRef("border-width"), varRef("border-style"), varRef("border-color")].join(" "),
          color: varRef("text-color"),
          backgroundColor: varRef("bg-color"),
[`&:not(:disabled):not(${componentCls}-disabled)`]: {
"&:hover": {
              border: [varRef("border-width"), varRef("border-style"), varRef("border-color-hover")].join(" "),
              color: varRef("text-color-hover"),
              backgroundColor: varRef("bg-color-hover")
            },
"&:active": {
              border: [varRef("border-width"), varRef("border-style"), varRef("border-color-active")].join(" "),
              color: varRef("text-color-active"),
              backgroundColor: varRef("bg-color-active")
            }
          }
        },


{
[`&${componentCls}-variant-solid`]: {
[varName("solid-bg-color")]: varRef("color-base"),
            [varName("solid-bg-color-hover")]: varRef("color-hover"),
            [varName("solid-bg-color-active")]: varRef("color-active"),
[varName("border-color")]: "transparent",
            [varName("text-color")]: token2.colorTextLightSolid,
            [varName("bg-color")]: varRef("solid-bg-color"),
            [varName("bg-color-hover")]: varRef("solid-bg-color-hover"),
            [varName("bg-color-active")]: varRef("solid-bg-color-active"),
boxShadow: varRef("shadow")
          },
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
            [varName("border-color")]: varRef("color-base"),
            [varName("border-color-hover")]: varRef("color-hover"),
            [varName("border-color-active")]: varRef("color-active"),
            [varName("bg-color")]: varRef("bg-color-container"),
            [varName("text-color")]: varRef("color-base"),
            [varName("text-color-hover")]: varRef("color-hover"),
            [varName("text-color-active")]: varRef("color-active"),
boxShadow: varRef("shadow")
          },
[`&${componentCls}-variant-dashed`]: {
            [varName("border-style")]: "dashed",
            [varName("bg-color-disabled")]: token2.dashedBgDisabled
          },
[`&${componentCls}-variant-filled`]: {
            [varName("border-color")]: "transparent",
            [varName("text-color")]: varRef("color-base"),
            [varName("bg-color")]: varRef("color-light"),
            [varName("bg-color-hover")]: varRef("color-light-hover"),
            [varName("bg-color-active")]: varRef("color-light-active")
          },
[`&${componentCls}-variant-text, &${componentCls}-variant-link`]: {
            [varName("border-color")]: "transparent",
            [varName("text-color")]: varRef("color-base"),
            [varName("text-color-hover")]: varRef("color-hover"),
            [varName("text-color-active")]: varRef("color-active"),
            [varName("bg-color")]: "transparent",
            [varName("bg-color-hover")]: "transparent",
            [varName("bg-color-active")]: "transparent",
            [`&:disabled, &${token2.componentCls}-disabled`]: {
              background: "transparent",
              borderColor: "transparent"
            }
          },
[`&${componentCls}-variant-text`]: {
            [varName("bg-color-hover")]: varRef("color-light"),
            [varName("bg-color-active")]: varRef("color-light-active")
          }
        },


{

[`&${componentCls}-variant-link`]: {
            [varName("color-base")]: token2.colorLink,
            [varName("color-hover")]: token2.colorLinkHover,
            [varName("color-active")]: token2.colorLinkActive,
            [varName("bg-color-hover")]: token2.linkHoverBg
          },

[`&${componentCls}-color-primary`]: {
            [varName("color-base")]: token2.colorPrimary,
            [varName("color-hover")]: token2.colorPrimaryHover,
            [varName("color-active")]: token2.colorPrimaryActive,
            [varName("color-light")]: token2.colorPrimaryBg,
            [varName("color-light-hover")]: token2.colorPrimaryBgHover,
            [varName("color-light-active")]: token2.colorPrimaryBorder,
            [varName("shadow")]: token2.primaryShadow,
            [`&${componentCls}-variant-solid`]: {
              [varName("text-color")]: token2.primaryColor,
              [varName("text-color-hover")]: varRef("text-color"),
              [varName("text-color-active")]: varRef("text-color")
            }
          },
[`&${componentCls}-color-dangerous`]: {
            [varName("color-base")]: token2.colorError,
            [varName("color-hover")]: token2.colorErrorHover,
            [varName("color-active")]: token2.colorErrorActive,
            [varName("color-light")]: token2.colorErrorBg,
            [varName("color-light-hover")]: token2.colorErrorBgFilledHover,
            [varName("color-light-active")]: token2.colorErrorBgActive,
            [varName("shadow")]: token2.dangerShadow,
            [`&${componentCls}-variant-solid`]: {
              [varName("text-color")]: token2.dangerColor,
              [varName("text-color-hover")]: varRef("text-color"),
              [varName("text-color-active")]: varRef("text-color")
            }
          },
[`&${componentCls}-color-default`]: {
            [varName("solid-bg-color")]: token2.colorBgSolid,
            [varName("solid-bg-color-hover")]: token2.colorBgSolidHover,
            [varName("solid-bg-color-active")]: token2.colorBgSolidActive,
            [varName("color-base")]: token2.defaultBorderColor,
            [varName("color-hover")]: token2.defaultHoverBorderColor,
            [varName("color-active")]: token2.defaultActiveBorderColor,
            [varName("color-light")]: token2.colorFillTertiary,
            [varName("color-light-hover")]: token2.colorFillSecondary,
            [varName("color-light-active")]: token2.colorFill,
            [varName("text-color")]: token2.defaultColor,
            [varName("text-color-hover")]: token2.defaultHoverColor,
            [varName("text-color-active")]: token2.defaultActiveColor,
            [varName("shadow")]: token2.defaultShadow,
            [`&${componentCls}-variant-outlined`]: {
              [varName("bg-color-disabled")]: token2.defaultBgDisabled
            },
            [`&${componentCls}-variant-solid`]: {
              [varName("text-color")]: token2.solidTextColor,
              [varName("text-color-hover")]: varRef("text-color"),
              [varName("text-color-active")]: varRef("text-color")
            },
            [`&${componentCls}-variant-filled, &${componentCls}-variant-text`]: {
              [varName("text-color-hover")]: varRef("text-color"),
              [varName("text-color-active")]: varRef("text-color")
            },
            [`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
              [varName("text-color")]: token2.defaultColor,
              [varName("text-color-hover")]: token2.defaultHoverColor,
              [varName("text-color-active")]: token2.defaultActiveColor,
              [varName("bg-color-container")]: token2.defaultBg,
              [varName("bg-color-hover")]: token2.defaultHoverBg,
              [varName("bg-color-active")]: token2.defaultActiveBg
            },
            [`&${componentCls}-variant-text`]: {
              [varName("text-color")]: token2.textTextColor,
              [varName("text-color-hover")]: token2.textTextHoverColor,
              [varName("text-color-active")]: token2.textTextActiveColor,
              [varName("bg-color-hover")]: token2.textHoverBg
            },
            [`&${componentCls}-background-ghost`]: {
              [`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
                [varName("text-color")]: token2.defaultGhostColor,
                [varName("border-color")]: token2.defaultGhostBorderColor
              }
            }
          }
        },
PresetColors.map((colorKey) => {
          const darkColor = token2[`${colorKey}6`];
          const lightColor = token2[`${colorKey}1`];
          const hoverColor = token2[`${colorKey}Hover`];
          const lightHoverColor = token2[`${colorKey}2`];
          const lightActiveColor = token2[`${colorKey}3`];
          const activeColor = token2[`${colorKey}Active`];
          const shadowColor = token2[`${colorKey}ShadowColor`];
          return {
            [`&${componentCls}-color-${colorKey}`]: {
              [varName("color-base")]: darkColor,
              [varName("color-hover")]: hoverColor,
              [varName("color-active")]: activeColor,
              [varName("color-light")]: lightColor,
              [varName("color-light-hover")]: lightHoverColor,
              [varName("color-light-active")]: lightActiveColor,
              [varName("shadow")]: shadowColor
            }
          };
        }),


{
[`&:disabled, &${token2.componentCls}-disabled`]: {
            cursor: "not-allowed",
            borderColor: token2.colorBorderDisabled,
            background: varRef("bg-color-disabled"),
            color: token2.colorTextDisabled,
            boxShadow: "none"
          }
        },


{
[`&${componentCls}-background-ghost`]: {
            [varName("bg-color")]: token2.ghostBg,
            [varName("bg-color-hover")]: token2.ghostBg,
            [varName("bg-color-active")]: token2.ghostBg,
            [varName("shadow")]: "none",
            [`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
              [varName("bg-color-hover")]: token2.ghostBg,
              [varName("bg-color-active")]: token2.ghostBg
            }
          }
        }
      ]
    };
  };
  const genSharedButtonStyle = (token2) => {
    const {
      componentCls,
      iconCls,
      fontWeight,
      opacityLoading,
      motionDurationSlow,
      motionEaseInOut,
      iconGap,
      calc
    } = token2;
    return {
      [componentCls]: {
        outline: "none",
        position: "relative",
        display: "inline-flex",
        gap: iconGap,
        alignItems: "center",
        justifyContent: "center",
        fontWeight,
        whiteSpace: "nowrap",
        textAlign: "center",
        backgroundImage: "none",
        cursor: "pointer",
        transition: `all ${token2.motionDurationMid} ${token2.motionEaseInOut}`,
        userSelect: "none",
        touchAction: "manipulation",
        ...genNoMotionStyle(),
        "&:disabled > *": {
          pointerEvents: "none"
        },
[`${componentCls}-icon > svg`]: resetIcon(),
        "> a": {
          color: "currentColor"
        },
        "&:not(:disabled)": genFocusStyle(token2),
        [`&${componentCls}-two-chinese-chars::first-letter`]: {
          letterSpacing: "0.34em"
        },
        [`&${componentCls}-two-chinese-chars > *:not(${iconCls})`]: {
          marginInlineEnd: "-0.34em",
          letterSpacing: "0.34em"
        },
        [`&${componentCls}-icon-only`]: {
          paddingInline: 0,
[`&${componentCls}-compact-item`]: {
            flex: "none"
          }
        },
[`&${componentCls}-loading`]: {
          opacity: opacityLoading,
          cursor: "default"
        },
        [`${componentCls}-loading-icon`]: {
          transition: ["width", "opacity", "margin"].map((prop) => `${prop} ${motionDurationSlow} ${motionEaseInOut}`).join(",")
        },
[`&:not(${componentCls}-icon-end)`]: {
          [`${componentCls}-loading-icon-motion`]: {
            "&-appear-start, &-enter-start": {
              marginInlineEnd: calc(iconGap).mul(-1).equal()
            },
            "&-appear-active, &-enter-active": {
              marginInlineEnd: 0
            },
            "&-leave-start": {
              marginInlineEnd: 0
            },
            "&-leave-active": {
              marginInlineEnd: calc(iconGap).mul(-1).equal()
            }
          }
        },
        "&-icon-end": {
          flexDirection: "row-reverse",
          [`${componentCls}-loading-icon-motion`]: {
            "&-appear-start, &-enter-start": {
              marginInlineStart: calc(iconGap).mul(-1).equal()
            },
            "&-appear-active, &-enter-active": {
              marginInlineStart: 0
            },
            "&-leave-start": {
              marginInlineStart: 0
            },
            "&-leave-active": {
              marginInlineStart: calc(iconGap).mul(-1).equal()
            }
          }
        }
      }
    };
  };
  const genCircleButtonStyle = (token2) => ({
    minWidth: token2.controlHeight,
    paddingInline: 0,
    borderRadius: "50%"
  });
  const genButtonStyle = (token2, prefixCls = "") => {
    const {
      componentCls,
      controlHeight,
      fontSize,
      borderRadius,
      buttonPaddingHorizontal,
      iconCls,
      buttonPaddingVertical,
      buttonIconOnlyFontSize
    } = token2;
    return [
      {
        [prefixCls]: {
          fontSize,
          height: controlHeight,
          padding: `${unit$1(buttonPaddingVertical)} ${unit$1(buttonPaddingHorizontal)}`,
          borderRadius,
          [`&${componentCls}-icon-only`]: {
            width: controlHeight,
            [iconCls]: {
              fontSize: buttonIconOnlyFontSize
            }
          }
        }
      },
{
        [`${componentCls}${componentCls}-circle${prefixCls}`]: genCircleButtonStyle(token2)
      },
      {
        [`${componentCls}${componentCls}-round${prefixCls}`]: {
          borderRadius: token2.controlHeight,
          [`&:not(${componentCls}-icon-only)`]: {
            paddingInline: token2.buttonPaddingHorizontal
          }
        }
      }
    ];
  };
  const genSizeBaseButtonStyle = (token2) => {
    const baseToken = merge(token2, {
      fontSize: token2.contentFontSize
    });
    return genButtonStyle(baseToken, token2.componentCls);
  };
  const genSizeSmallButtonStyle = (token2) => {
    const smallToken = merge(token2, {
      controlHeight: token2.controlHeightSM,
      fontSize: token2.contentFontSizeSM,
      padding: token2.paddingXS,
      buttonPaddingHorizontal: token2.paddingInlineSM,
      buttonPaddingVertical: 0,
      borderRadius: token2.borderRadiusSM,
      buttonIconOnlyFontSize: token2.onlyIconSizeSM
    });
    return genButtonStyle(smallToken, `${token2.componentCls}-sm`);
  };
  const genSizeLargeButtonStyle = (token2) => {
    const largeToken = merge(token2, {
      controlHeight: token2.controlHeightLG,
      fontSize: token2.contentFontSizeLG,
      buttonPaddingHorizontal: token2.paddingInlineLG,
      buttonPaddingVertical: 0,
      borderRadius: token2.borderRadiusLG,
      buttonIconOnlyFontSize: token2.onlyIconSizeLG
    });
    return genButtonStyle(largeToken, `${token2.componentCls}-lg`);
  };
  const genBlockButtonStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [componentCls]: {
        [`&${componentCls}-block`]: {
          width: "100%"
        }
      }
    };
  };
  const useStyle$4 = genStyleHooks("Button", (token2) => {
    const buttonToken = prepareToken$1(token2);
    return [
genSharedButtonStyle(buttonToken),
genSizeBaseButtonStyle(buttonToken),
      genSizeSmallButtonStyle(buttonToken),
      genSizeLargeButtonStyle(buttonToken),
genBlockButtonStyle(buttonToken),
genVariantStyle(buttonToken),
genGroupStyle(buttonToken)
    ];
  }, prepareComponentToken$4, {
    unitless: {
      fontWeight: true,
      contentLineHeight: true,
      contentLineHeightSM: true,
      contentLineHeightLG: true
    }
  });
  function compactItemBorder(token2, parentCls, options, prefixCls) {
    const {
      focusElCls,
      focus,
      borderElCls
    } = options;
    const childCombinator = borderElCls ? "> *" : "";
    const hoverEffects = ["hover", focus ? "focus" : null, "active"].filter(Boolean).map((n2) => `&:${n2} ${childCombinator}`).join(",");
    return {
      [`&-item:not(${parentCls}-last-item)`]: {
        marginInlineEnd: token2.calc(token2.lineWidth).mul(-1).equal()
      },
      [`&-item:not(${prefixCls}-status-success)`]: {
        zIndex: 2
      },
      "&-item": {
        [hoverEffects]: {
          zIndex: 3
        },
        ...focusElCls ? {
          [`&${focusElCls}`]: {
            zIndex: 3
          }
        } : {},
        [`&[disabled] ${childCombinator}`]: {
          zIndex: 0
        }
      }
    };
  }
  function compactItemBorderRadius(prefixCls, parentCls, options) {
    const {
      borderElCls
    } = options;
    const childCombinator = borderElCls ? `> ${borderElCls}` : "";
    return {
      [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item) ${childCombinator}`]: {
        borderRadius: 0
      },
      [`&-item:not(${parentCls}-last-item)${parentCls}-first-item`]: {
        [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
          borderStartEndRadius: 0,
          borderEndEndRadius: 0
        }
      },
      [`&-item:not(${parentCls}-first-item)${parentCls}-last-item`]: {
        [`& ${childCombinator}, &${prefixCls}-sm ${childCombinator}, &${prefixCls}-lg ${childCombinator}`]: {
          borderStartStartRadius: 0,
          borderEndStartRadius: 0
        }
      }
    };
  }
  function genCompactItemStyle(token2, options = {
    focus: true
  }) {
    const {
      componentCls
    } = token2;
    const {
      componentCls: customizePrefixCls
    } = options;
    const mergedComponentCls = customizePrefixCls || componentCls;
    const compactCls = `${mergedComponentCls}-compact`;
    return {
      [compactCls]: {
        ...compactItemBorder(token2, compactCls, options, mergedComponentCls),
        ...compactItemBorderRadius(mergedComponentCls, compactCls, options)
      }
    };
  }
  function compactItemVerticalBorder(token2, parentCls, prefixCls) {
    return {
[`&-item:not(${parentCls}-last-item)`]: {
        marginBottom: token2.calc(token2.lineWidth).mul(-1).equal()
      },
      [`&-item:not(${prefixCls}-status-success)`]: {
        zIndex: 2
      },
      "&-item": {
        "&:hover,&:focus,&:active": {
          zIndex: 3
        },
        "&[disabled]": {
          zIndex: 0
        }
      }
    };
  }
  function compactItemBorderVerticalRadius(prefixCls, parentCls) {
    return {
      [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
        borderRadius: 0
      },
      [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
        [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
          borderEndEndRadius: 0,
          borderEndStartRadius: 0
        }
      },
      [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
        [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
          borderStartStartRadius: 0,
          borderStartEndRadius: 0
        }
      }
    };
  }
  function genCompactItemVerticalStyle(token2) {
    const compactCls = `${token2.componentCls}-compact-vertical`;
    return {
      [compactCls]: {
        ...compactItemVerticalBorder(token2, compactCls, token2.componentCls),
        ...compactItemBorderVerticalRadius(token2.componentCls, compactCls)
      }
    };
  }
  const genButtonCompactStyle = (token2) => {
    const {
      antCls,
      componentCls,
      lineWidth,
      calc,
      colorBgContainer
    } = token2;
    const solidSelector = `${componentCls}-variant-solid:not([disabled])`;
    const insetOffset = calc(lineWidth).mul(-1).equal();
    const [varName, varRef] = genCssVar(antCls, "btn");
    const getCompactBorderStyle = (vertical) => {
      const itemCls = `${componentCls}-compact${vertical ? "-vertical" : ""}-item`;
      return {
[itemCls]: {
          [varName("compact-connect-border-color")]: varRef("bg-color-hover"),
          [`&${solidSelector}`]: {
            transition: `none`,
            [`& + ${solidSelector}:before`]: [{
              position: "absolute",
              backgroundColor: varRef("compact-connect-border-color"),
              content: '""'
            }, vertical ? {
              top: insetOffset,
              insetInline: insetOffset,
              height: lineWidth
            } : {
              insetBlock: insetOffset,
              insetInlineStart: insetOffset,
              width: lineWidth
            }],
            "&:hover:before": {
              display: "none"
            }
          }
        }
      };
    };
    return [getCompactBorderStyle(), getCompactBorderStyle(true), {
      [`${solidSelector}${componentCls}-color-default`]: {
        [varName("compact-connect-border-color")]: `color-mix(in srgb, ${varRef("bg-color-hover")} 75%, ${colorBgContainer})`
      }
    }];
  };
  const Compact = genSubStyleComponent(["Button", "compact"], (token2) => {
    const buttonToken = prepareToken$1(token2);
    return [
genCompactItemStyle(buttonToken),
      genCompactItemVerticalStyle(buttonToken),
      genButtonCompactStyle(buttonToken)
    ];
  }, prepareComponentToken$4);
  function getLoadingConfig(loading) {
    if (typeof loading === "object" && loading) {
      let delay = loading?.delay;
      delay = !Number.isNaN(delay) && typeof delay === "number" ? delay : 0;
      return {
        loading: delay <= 0,
        delay
      };
    }
    return {
      loading: !!loading,
      delay: 0
    };
  }
  const ButtonTypeMap = {
    default: ["default", "outlined"],
    primary: ["primary", "solid"],
    dashed: ["default", "dashed"],
link: ["link", "link"],
    text: ["default", "text"]
  };
  const InternalCompoundedButton = React.forwardRef((props, ref) => {
    const {
      _skipSemantic,
      loading = false,
      prefixCls: customizePrefixCls,
      color,
      variant,
      type: type4,
      danger = false,
      shape: customizeShape,
      size: customizeSize,
      disabled: customDisabled,
      className,
      rootClassName,
      children,
      icon,
      iconPosition,
      iconPlacement,
      ghost = false,
      block = false,
htmlType = "button",
      classNames,
      styles,
      style: style2,
      autoInsertSpace,
      autoFocus,
      ...rest
    } = props;
    const childNodes = toArray$3(children);
    const mergedType = type4 || "default";
    const {
      getPrefixCls,
      direction,
      autoInsertSpace: contextAutoInsertSpace,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles,
      loadingIcon: contextLoadingIcon,
      shape: contextShape,
      color: contextColor,
      variant: contextVariant
    } = useComponentConfig("button");
    const mergedShape = customizeShape || contextShape || "default";
    const [parsedColor, parsedVariant] = React.useMemo(() => {
      if (color && variant) {
        return [color, variant];
      }
      if (type4 || danger) {
        const colorVariantPair = ButtonTypeMap[mergedType] || [];
        if (danger) {
          return ["danger", colorVariantPair[1]];
        }
        return colorVariantPair;
      }
      if (contextColor && contextVariant) {
        return [contextColor, contextVariant];
      }
      return ["default", "outlined"];
    }, [color, variant, type4, danger, contextColor, contextVariant, mergedType]);
    const [mergedColor, mergedVariant] = React.useMemo(() => {
      if (ghost && parsedVariant === "solid") {
        return [parsedColor, "outlined"];
      }
      return [parsedColor, parsedVariant];
    }, [parsedColor, parsedVariant, ghost]);
    const isDanger = mergedColor === "danger";
    const mergedColorText = isDanger ? "dangerous" : mergedColor;
    const mergedInsertSpace = autoInsertSpace ?? contextAutoInsertSpace ?? true;
    const prefixCls = getPrefixCls("btn", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$4(prefixCls);
    const disabled = React.useContext(DisabledContext);
    const mergedDisabled = customDisabled ?? disabled;
    const groupSize = React.useContext(GroupSizeContext);
    const loadingOrDelay = React.useMemo(() => getLoadingConfig(loading), [loading]);
    const [innerLoading, setInnerLoading] = React.useState(loadingOrDelay.loading);
    const [hasTwoCNChar, setHasTwoCNChar] = React.useState(false);
    const buttonRef = React.useRef(null);
    const mergedRef = useComposeRef(ref, buttonRef);
    const needInserted = childNodes.length === 1 && !icon && !isUnBorderedButtonVariant(mergedVariant);
    const isMountRef = React.useRef(true);
    React.useEffect(() => {
      isMountRef.current = false;
      return () => {
        isMountRef.current = true;
      };
    }, []);
    useLayoutEffect(() => {
      let delayTimer = null;
      if (loadingOrDelay.delay > 0) {
        delayTimer = setTimeout(() => {
          delayTimer = null;
          setInnerLoading(true);
        }, loadingOrDelay.delay);
      } else {
        setInnerLoading(loadingOrDelay.loading);
      }
      function cleanupTimer() {
        if (delayTimer) {
          clearTimeout(delayTimer);
          delayTimer = null;
        }
      }
      return cleanupTimer;
    }, [loadingOrDelay.delay, loadingOrDelay.loading]);
    React.useEffect(() => {
      if (!buttonRef.current || !mergedInsertSpace) {
        return;
      }
      const buttonText = buttonRef.current.textContent || "";
      if (needInserted && isTwoCNChar(buttonText)) {
        if (!hasTwoCNChar) {
          setHasTwoCNChar(true);
        }
      } else if (hasTwoCNChar) {
        setHasTwoCNChar(false);
      }
    });
    React.useEffect(() => {
      if (autoFocus && buttonRef.current) {
        buttonRef.current.focus();
      }
    }, []);
    const handleClick = React.useCallback((e2) => {
      if (innerLoading || mergedDisabled) {
        e2.preventDefault();
        return;
      }
      props.onClick?.("href" in props ? e2 : e2);
    }, [props.onClick, innerLoading, mergedDisabled]);
    const {
      compactSize,
      compactItemClassnames
    } = useCompactItemContext(prefixCls, direction);
    const sizeFullName = useSize((ctxSize) => customizeSize ?? compactSize ?? groupSize ?? ctxSize);
    const iconType = innerLoading ? "loading" : icon;
    const mergedIconPlacement = iconPlacement ?? iconPosition ?? "start";
    const linkButtonRestProps = omit(rest, ["navigate"]);
    const mergedProps = {
      ...props,
      type: mergedType,
      color: mergedColor,
      variant: mergedVariant,
      danger: isDanger,
      shape: mergedShape,
      size: sizeFullName,
      disabled: mergedDisabled,
      loading: innerLoading,
      iconPlacement: mergedIconPlacement
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([_skipSemantic ? void 0 : contextClassNames, classNames], [_skipSemantic ? void 0 : contextStyles, styles], {
      props: mergedProps
    });
    const classes = clsx(prefixCls, hashId, cssVarCls, {
      [`${prefixCls}-${mergedShape}`]: mergedShape !== "default" && mergedShape !== "square" && mergedShape,
[`${prefixCls}-${mergedType}`]: mergedType,
      [`${prefixCls}-dangerous`]: danger,
      [`${prefixCls}-color-${mergedColorText}`]: mergedColorText,
      [`${prefixCls}-variant-${mergedVariant}`]: mergedVariant,
      [`${prefixCls}-lg`]: sizeFullName === "large",
      [`${prefixCls}-sm`]: sizeFullName === "small",
      [`${prefixCls}-icon-only`]: !children && children !== 0 && !!iconType,
      [`${prefixCls}-background-ghost`]: ghost && !isUnBorderedButtonVariant(mergedVariant),
      [`${prefixCls}-loading`]: innerLoading,
      [`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && mergedInsertSpace && !innerLoading,
      [`${prefixCls}-block`]: block,
      [`${prefixCls}-rtl`]: direction === "rtl",
      [`${prefixCls}-icon-end`]: mergedIconPlacement === "end"
    }, compactItemClassnames, className, rootClassName, contextClassName, mergedClassNames.root);
    const fullStyle = {
      ...mergedStyles.root,
      ...contextStyle,
      ...style2
    };
    const iconSharedProps = {
      className: mergedClassNames.icon,
      style: mergedStyles.icon
    };
    const iconWrapperElement = (child) => React.createElement(IconWrapper, {
      prefixCls,
      ...iconSharedProps
    }, child);
    const defaultLoadingIconElement = React.createElement(DefaultLoadingIcon, {
      existIcon: !!icon,
      prefixCls,
      loading: innerLoading,
      mount: isMountRef.current,
      ...iconSharedProps
    });
    const mergedLoadingIcon = loading && typeof loading === "object" ? loading.icon || contextLoadingIcon : contextLoadingIcon;
    let iconNode;
    if (icon && !innerLoading) {
      iconNode = iconWrapperElement(icon);
    } else if (loading && mergedLoadingIcon) {
      iconNode = iconWrapperElement(mergedLoadingIcon);
    } else {
      iconNode = defaultLoadingIconElement;
    }
    const contentNode = isNonNullable$1(children) ? spaceChildren(children, needInserted && mergedInsertSpace, mergedStyles.content, mergedClassNames.content) : null;
    if (linkButtonRestProps.href !== void 0) {
      return React.createElement("a", {
        ...linkButtonRestProps,
        className: clsx(classes, {
          [`${prefixCls}-disabled`]: mergedDisabled
        }),
        href: mergedDisabled ? void 0 : linkButtonRestProps.href,
        style: fullStyle,
        onClick: handleClick,
        ref: mergedRef,
        tabIndex: mergedDisabled ? -1 : 0,
        "aria-disabled": mergedDisabled
      }, iconNode, contentNode);
    }
    let buttonNode = React.createElement("button", {
      ...rest,
      type: htmlType,
      className: classes,
      style: fullStyle,
      onClick: handleClick,
      disabled: mergedDisabled,
      ref: mergedRef
    }, iconNode, contentNode, compactItemClassnames && React.createElement(Compact, {
      prefixCls
    }));
    if (!isUnBorderedButtonVariant(mergedVariant)) {
      buttonNode = React.createElement(Wave, {
        component: "Button",
        disabled: innerLoading
      }, buttonNode);
    }
    return buttonNode;
  });
  const Button$1 = InternalCompoundedButton;
  Button$1.Group = ButtonGroup;
  Button$1.__ANT_BUTTON = true;
  const isThenable = (thing) => {
    return typeof thing?.then === "function";
  };
  const ActionButton = (props) => {
    const {
      type: type4,
      children,
      prefixCls,
      buttonProps,
      close,
      autoFocus,
      emitEvent,
      isSilent,
      quitOnNullishReturnValue,
      actionFn
    } = props;
    const clickedRef = React__namespace.useRef(false);
    const buttonRef = React__namespace.useRef(null);
    const [loading, setLoading] = useSafeState(false);
    const onInternalClose = (...args) => {
      close?.(...args);
    };
    React__namespace.useEffect(() => {
      let timeoutId = null;
      if (autoFocus) {
        timeoutId = setTimeout(() => {
          buttonRef.current?.focus({
            preventScroll: true
          });
        });
      }
      return () => {
        if (timeoutId) {
          clearTimeout(timeoutId);
        }
      };
    }, [autoFocus]);
    const handlePromiseOnOk = (returnValueOfOnOk) => {
      if (!isThenable(returnValueOfOnOk)) {
        return;
      }
      setLoading(true);
      returnValueOfOnOk.then((...args) => {
        setLoading(false, true);
        onInternalClose.apply(void 0, args);
        clickedRef.current = false;
      }, (e2) => {
        setLoading(false, true);
        clickedRef.current = false;
        if (isSilent?.()) {
          return;
        }
        return Promise.reject(e2);
      });
    };
    const onClick = (e2) => {
      if (clickedRef.current) {
        return;
      }
      clickedRef.current = true;
      if (!actionFn) {
        onInternalClose();
        return;
      }
      let returnValueOfOnOk;
      if (emitEvent) {
        returnValueOfOnOk = actionFn(e2);
        if (quitOnNullishReturnValue && !isThenable(returnValueOfOnOk)) {
          clickedRef.current = false;
          onInternalClose(e2);
          return;
        }
      } else if (actionFn.length) {
        returnValueOfOnOk = actionFn(close);
        clickedRef.current = false;
      } else {
        returnValueOfOnOk = actionFn();
        if (!isThenable(returnValueOfOnOk)) {
          onInternalClose();
          return;
        }
      }
      handlePromiseOnOk(returnValueOfOnOk);
    };
    return React__namespace.createElement(Button$1, {
      ...convertLegacyProps(type4),
      onClick,
      loading,
      prefixCls,
      ...buttonProps,
      ref: buttonRef
    }, children);
  };
  const ModalContext = React.createContext({});
  const {
    Provider: ModalContextProvider
  } = ModalContext;
  const ConfirmCancelBtn = () => {
    const {
      autoFocusButton,
      cancelButtonProps,
      cancelTextLocale,
      isSilent,
      mergedOkCancel,
      rootPrefixCls,
      close,
      onCancel,
      onConfirm,
      onClose
    } = React.useContext(ModalContext);
    return mergedOkCancel ? React.createElement(ActionButton, {
      isSilent,
      actionFn: onCancel,
      close: (...args) => {
        close?.(...args);
        onConfirm?.(false);
        onClose?.();
      },
      autoFocus: autoFocusButton === "cancel",
      buttonProps: cancelButtonProps,
      prefixCls: `${rootPrefixCls}-btn`
    }, cancelTextLocale) : null;
  };
  const ConfirmOkBtn = () => {
    const {
      autoFocusButton,
      close,
      isSilent,
      okButtonProps,
      rootPrefixCls,
      okTextLocale,
      okType,
      onConfirm,
      onOk,
      onClose
    } = React.useContext(ModalContext);
    return React.createElement(ActionButton, {
      isSilent,
      type: okType || "primary",
      actionFn: onOk,
      close: (...args) => {
        close?.(...args);
        onConfirm?.(true);
        onClose?.();
      },
      autoFocus: autoFocusButton === "ok",
      buttonProps: okButtonProps,
      prefixCls: `${rootPrefixCls}-btn`
    }, okTextLocale);
  };
  const RefContext = React__namespace.createContext({});
  function getMotionName(prefixCls, transitionName, animationName) {
    let motionName = transitionName;
    if (!motionName && animationName) {
      motionName = `${prefixCls}-${animationName}`;
    }
    return motionName;
  }
  function getScroll(w, top) {
    let ret = w[`page${top ? "Y" : "X"}Offset`];
    const method4 = `scroll${top ? "Top" : "Left"}`;
    if (typeof ret !== "number") {
      const d = w.document;
      ret = d.documentElement[method4];
      if (typeof ret !== "number") {
        ret = d.body[method4];
      }
    }
    return ret;
  }
  function offset(el) {
    const rect = el.getBoundingClientRect();
    const pos = {
      left: rect.left,
      top: rect.top
    };
    const doc = el.ownerDocument;
    const w = doc.defaultView || doc.parentWindow;
    pos.left += getScroll(w);
    pos.top += getScroll(w, true);
    return pos;
  }
  function focusable(node2, includePositive = false) {
    if (isVisible(node2)) {
      const nodeName = node2.nodeName.toLowerCase();
      const isFocusableElement = (
["input", "select", "textarea", "button"].includes(nodeName) ||
node2.isContentEditable ||
nodeName === "a" && !!node2.getAttribute("href")
      );
      const tabIndexAttr = node2.getAttribute("tabindex");
      const tabIndexNum = Number(tabIndexAttr);
      let tabIndex = null;
      if (tabIndexAttr && !Number.isNaN(tabIndexNum)) {
        tabIndex = tabIndexNum;
      } else if (isFocusableElement && tabIndex === null) {
        tabIndex = 0;
      }
      if (isFocusableElement && node2.disabled) {
        tabIndex = null;
      }
      return tabIndex !== null && (tabIndex >= 0 || includePositive && tabIndex < 0);
    }
    return false;
  }
  function getFocusNodeList(node2, includePositive = false) {
    const res = [...node2.querySelectorAll("*")].filter((child) => {
      return focusable(child, includePositive);
    });
    if (focusable(node2, includePositive)) {
      res.unshift(node2);
    }
    return res;
  }
  let lastFocusElement = null;
  let focusElements = [];
  const idToElementMap = new Map();
  const ignoredElementMap = new Map();
  function getLastElement() {
    return focusElements[focusElements.length - 1];
  }
  function isIgnoredElement(element) {
    const lastElement = getLastElement();
    if (element && lastElement) {
      let lockId;
      for (const [id, ele] of idToElementMap.entries()) {
        if (ele === lastElement) {
          lockId = id;
          break;
        }
      }
      const ignoredEle = ignoredElementMap.get(lockId);
      return !!ignoredEle && (ignoredEle === element || ignoredEle.contains(element));
    }
    return false;
  }
  function hasFocus(element) {
    const {
      activeElement
    } = document;
    return element === activeElement || element.contains(activeElement);
  }
  function syncFocus() {
    const lastElement = getLastElement();
    const {
      activeElement
    } = document;
    if (isIgnoredElement(activeElement)) {
      return;
    }
    if (lastElement && !hasFocus(lastElement)) {
      const focusableList = getFocusNodeList(lastElement);
      const matchElement = focusableList.includes(lastFocusElement) ? lastFocusElement : focusableList[0];
      matchElement?.focus({
        preventScroll: true
      });
    } else {
      lastFocusElement = activeElement;
    }
  }
  function onWindowKeyDown(e2) {
    if (e2.key === "Tab") {
      const {
        activeElement
      } = document;
      const lastElement = getLastElement();
      const focusableList = getFocusNodeList(lastElement);
      const last = focusableList[focusableList.length - 1];
      if (e2.shiftKey && activeElement === focusableList[0]) {
        lastFocusElement = last;
      } else if (!e2.shiftKey && activeElement === last) {
        lastFocusElement = focusableList[0];
      }
    }
  }
  function lockFocus(element, id) {
    if (element) {
      idToElementMap.set(id, element);
      focusElements = focusElements.filter((ele) => ele !== element);
      focusElements.push(element);
      window.addEventListener("focusin", syncFocus);
      window.addEventListener("keydown", onWindowKeyDown, true);
      syncFocus();
    }
    return () => {
      lastFocusElement = null;
      focusElements = focusElements.filter((ele) => ele !== element);
      idToElementMap.delete(id);
      ignoredElementMap.delete(id);
      if (focusElements.length === 0) {
        window.removeEventListener("focusin", syncFocus);
        window.removeEventListener("keydown", onWindowKeyDown, true);
      }
    };
  }
  function useLockFocus(lock, getElement) {
    const id = useId();
    React.useEffect(() => {
      if (lock) {
        const element = getElement();
        if (element) {
          return lockFocus(element, id);
        }
      }
    }, [lock, id]);
    const ignoreElement = (ele) => {
      if (ele) {
        ignoredElementMap.set(id, ele);
      }
    };
    return [ignoreElement];
  }
  const MemoChildren = React__namespace.memo(({
    children
  }) => children, (_, {
    shouldUpdate
  }) => !shouldUpdate);
  function _extends$7() {
    _extends$7 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$7.apply(this, arguments);
  }
  const Panel = React.forwardRef((props, ref) => {
    const {
      prefixCls,
      className,
      style: style2,
      title,
      ariaId,
      footer,
      closable,
      closeIcon,
      onClose,
      children,
      bodyStyle,
      bodyProps,
      modalRender,
      onMouseDown,
      onMouseUp,
      holderRef,
      visible,
      forceRender,
      width,
      height,
      classNames: modalClassNames,
      styles: modalStyles,
      isFixedPos,
      focusTrap
    } = props;
    const {
      panel: panelRef
    } = React.useContext(RefContext);
    const internalRef = React.useRef(null);
    const mergedRef = useComposeRef(holderRef, panelRef, internalRef);
    const [ignoreElement] = useLockFocus(visible && isFixedPos && focusTrap !== false, () => internalRef.current);
    React.useImperativeHandle(ref, () => ({
      focus: () => {
        internalRef.current?.focus({
          preventScroll: true
        });
      }
    }));
    const contentStyle = {};
    if (width !== void 0) {
      contentStyle.width = width;
    }
    if (height !== void 0) {
      contentStyle.height = height;
    }
    const footerNode = footer ? React.createElement("div", {
      className: clsx(`${prefixCls}-footer`, modalClassNames?.footer),
      style: {
        ...modalStyles?.footer
      }
    }, footer) : null;
    const headerNode = title ? React.createElement("div", {
      className: clsx(`${prefixCls}-header`, modalClassNames?.header),
      style: {
        ...modalStyles?.header
      }
    }, React.createElement("div", {
      className: clsx(`${prefixCls}-title`, modalClassNames?.title),
      id: ariaId,
      style: {
        ...modalStyles?.title
      }
    }, title)) : null;
    const closableObj = React.useMemo(() => {
      if (typeof closable === "object" && closable !== null) {
        return closable;
      }
      if (closable) {
        return {
          closeIcon: closeIcon ?? React.createElement("span", {
            className: `${prefixCls}-close-x`
          })
        };
      }
      return {};
    }, [closable, closeIcon, prefixCls]);
    const ariaProps = pickAttrs(closableObj, true);
    const closeBtnIsDisabled = typeof closable === "object" && closable.disabled;
    const closerNode = closable ? React.createElement("button", _extends$7({
      type: "button",
      onClick: onClose,
      "aria-label": "Close"
    }, ariaProps, {
      className: `${prefixCls}-close`,
      disabled: closeBtnIsDisabled
    }), closableObj.closeIcon) : null;
    const content = React.createElement("div", {
      className: clsx(`${prefixCls}-container`, modalClassNames?.container),
      style: modalStyles?.container
    }, closerNode, headerNode, React.createElement("div", _extends$7({
      className: clsx(`${prefixCls}-body`, modalClassNames?.body),
      style: {
        ...bodyStyle,
        ...modalStyles?.body
      }
    }, bodyProps), children), footerNode);
    return React.createElement("div", {
      key: "dialog-element",
      role: "dialog",
      "aria-labelledby": title ? ariaId : null,
      "aria-modal": "true",
      ref: mergedRef,
      style: {
        ...style2,
        ...contentStyle
      },
      className: clsx(prefixCls, className),
      onMouseDown,
      onMouseUp,
      tabIndex: -1,
      onFocus: (e2) => {
        ignoreElement(e2.target);
      }
    }, React.createElement(MemoChildren, {
      shouldUpdate: visible || forceRender
    }, modalRender ? modalRender(content) : content));
  });
  function _extends$6() {
    _extends$6 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$6.apply(this, arguments);
  }
  const Content = React__namespace.forwardRef((props, ref) => {
    const {
      prefixCls,
      title,
      style: style2,
      className,
      visible,
      forceRender,
      destroyOnHidden,
      motionName,
      ariaId,
      onVisibleChanged,
      mousePosition: mousePosition2
    } = props;
    const dialogRef = React.useRef(null);
    const panelRef = React.useRef(null);
    React__namespace.useImperativeHandle(ref, () => ({
      ...panelRef.current,
      inMotion: dialogRef.current.inMotion,
      enableMotion: dialogRef.current.enableMotion
    }));
    const [transformOrigin, setTransformOrigin] = React__namespace.useState();
    const contentStyle = {};
    if (transformOrigin) {
      contentStyle.transformOrigin = transformOrigin;
    }
    function onPrepare() {
      if (!dialogRef.current?.nativeElement) {
        return;
      }
      const elementOffset = offset(dialogRef.current.nativeElement);
      setTransformOrigin(mousePosition2 && (mousePosition2.x || mousePosition2.y) ? `${mousePosition2.x - elementOffset.left}px ${mousePosition2.y - elementOffset.top}px` : "");
    }
    return React__namespace.createElement(CSSMotion, {
      visible,
      onVisibleChanged,
      onAppearPrepare: onPrepare,
      onEnterPrepare: onPrepare,
      forceRender,
      motionName,
      removeOnLeave: destroyOnHidden,
      ref: dialogRef
    }, ({
      className: motionClassName,
      style: motionStyle
    }, motionRef) => React__namespace.createElement(Panel, _extends$6({}, props, {
      ref: panelRef,
      title,
      ariaId,
      prefixCls,
      holderRef: motionRef,
      style: {
        ...motionStyle,
        ...style2,
        ...contentStyle
      },
      className: clsx(className, motionClassName)
    })));
  });
  function _extends$5() {
    _extends$5 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$5.apply(this, arguments);
  }
  const Mask = (props) => {
    const {
      prefixCls,
      style: style2,
      visible,
      maskProps,
      motionName,
      className
    } = props;
    return React__namespace.createElement(CSSMotion, {
      key: "mask",
      visible,
      motionName,
      leavedClassName: `${prefixCls}-mask-hidden`
    }, ({
      className: motionClassName,
      style: motionStyle
    }, ref) => React__namespace.createElement("div", _extends$5({
      ref,
      style: {
        ...motionStyle,
        ...style2
      },
      className: clsx(`${prefixCls}-mask`, motionClassName, className)
    }, maskProps)));
  };
  function _extends$4() {
    _extends$4 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$4.apply(this, arguments);
  }
  const Dialog = (props) => {
    const {
      prefixCls = "rc-dialog",
      zIndex,
      visible = false,
      focusTriggerAfterClose = true,
      wrapStyle,
      wrapClassName,
      wrapProps,
      onClose,
      afterOpenChange,
      afterClose,
transitionName,
      animation,
      closable = true,
mask = true,
      maskTransitionName,
      maskAnimation,
      maskClosable = true,
      maskStyle,
      maskProps,
      rootClassName,
      rootStyle,
      classNames: modalClassNames,
      styles: modalStyles
    } = props;
    const lastOutSideActiveElementRef = React.useRef(null);
    const wrapperRef = React.useRef(null);
    const contentRef = React.useRef(null);
    const [animatedVisible, setAnimatedVisible] = React__namespace.useState(visible);
    const [isFixedPos, setIsFixedPos] = React__namespace.useState(false);
    const ariaId = useId();
    function saveLastOutSideActiveElementRef() {
      if (!contains(wrapperRef.current, document.activeElement)) {
        lastOutSideActiveElementRef.current = document.activeElement;
      }
    }
    function focusDialogContent() {
      if (!contains(wrapperRef.current, document.activeElement)) {
        contentRef.current?.focus();
      }
    }
    function doClose() {
      setAnimatedVisible(false);
      if (mask && lastOutSideActiveElementRef.current && focusTriggerAfterClose) {
        try {
          lastOutSideActiveElementRef.current.focus({
            preventScroll: true
          });
        } catch (e2) {
        }
        lastOutSideActiveElementRef.current = null;
      }
      if (animatedVisible) {
        afterClose?.();
      }
    }
    function onDialogVisibleChanged(newVisible) {
      if (newVisible) {
        focusDialogContent();
      } else {
        doClose();
      }
      afterOpenChange?.(newVisible);
    }
    function onInternalClose(e2) {
      onClose?.(e2);
    }
    const mouseDownOnMaskRef = React.useRef(false);
    let onWrapperClick = null;
    if (maskClosable) {
      onWrapperClick = (e2) => {
        if (wrapperRef.current === e2.target && mouseDownOnMaskRef.current) {
          onInternalClose(e2);
        }
      };
    }
    function onWrapperMouseDown(e2) {
      mouseDownOnMaskRef.current = e2.target === wrapperRef.current;
    }
    React.useEffect(() => {
      if (visible) {
        mouseDownOnMaskRef.current = false;
        setAnimatedVisible(true);
        saveLastOutSideActiveElementRef();
        if (wrapperRef.current) {
          const computedWrapStyle = getComputedStyle(wrapperRef.current);
          setIsFixedPos(computedWrapStyle.position === "fixed");
        }
      } else if (animatedVisible && contentRef.current.enableMotion() && !contentRef.current.inMotion()) {
        doClose();
      }
    }, [visible]);
    const mergedStyle = {
      zIndex,
      ...wrapStyle,
      ...modalStyles?.wrapper,
      display: !animatedVisible ? "none" : null
    };
    return React__namespace.createElement("div", _extends$4({
      className: clsx(`${prefixCls}-root`, rootClassName),
      style: rootStyle
    }, pickAttrs(props, {
      data: true
    })), React__namespace.createElement(Mask, {
      prefixCls,
      visible: mask && visible,
      motionName: getMotionName(prefixCls, maskTransitionName, maskAnimation),
      style: {
        zIndex,
        ...maskStyle,
        ...modalStyles?.mask
      },
      maskProps,
      className: modalClassNames?.mask
    }), React__namespace.createElement("div", _extends$4({
      className: clsx(`${prefixCls}-wrap`, wrapClassName, modalClassNames?.wrapper),
      ref: wrapperRef,
      onClick: onWrapperClick,
      onMouseDown: onWrapperMouseDown,
      style: mergedStyle
    }, wrapProps), React__namespace.createElement(Content, _extends$4({}, props, {
      isFixedPos,
      ref: contentRef,
      closable,
      ariaId,
      prefixCls,
      visible: visible && animatedVisible,
      onClose: onInternalClose,
      onVisibleChanged: onDialogVisibleChanged,
      motionName: getMotionName(prefixCls, transitionName, animation)
    }))));
  };
  function _extends$3() {
    _extends$3 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$3.apply(this, arguments);
  }
  const DialogWrap = (props) => {
    const {
      visible,
      getContainer: getContainer2,
      forceRender,
      destroyOnHidden = false,
      afterClose,
      closable,
      panelRef,
      keyboard = true,
      onClose
    } = props;
    const [animatedVisible, setAnimatedVisible] = React__namespace.useState(visible);
    const refContext = React__namespace.useMemo(() => ({
      panel: panelRef
    }), [panelRef]);
    const onEsc = ({
      top,
      event
    }) => {
      if (top && keyboard) {
        event.stopPropagation();
        onClose?.(event);
        return;
      }
    };
    React__namespace.useEffect(() => {
      if (visible) {
        setAnimatedVisible(true);
      }
    }, [visible]);
    if (!forceRender && destroyOnHidden && !animatedVisible) {
      return null;
    }
    return React__namespace.createElement(RefContext.Provider, {
      value: refContext
    }, React__namespace.createElement(Portal, {
      open: visible || forceRender || animatedVisible,
      onEsc,
      autoDestroy: false,
      getContainer: getContainer2,
      autoLock: visible || animatedVisible
    }, React__namespace.createElement(Dialog, _extends$3({}, props, {
      destroyOnHidden,
      afterClose: () => {
        const closableObj = closable && typeof closable === "object" ? closable : {};
        const {
          afterClose: closableAfterClose
        } = closableObj || {};
        closableAfterClose?.();
        afterClose?.();
        setAnimatedVisible(false);
      }
    }))));
  };
  const ContextIsolator = (props) => {
    const {
      space,
      form,
      children
    } = props;
    if (!isNonNullable$1(children)) {
      return null;
    }
    let result = children;
    if (form) {
      result = React.createElement(NoFormStyle, {
        override: true,
        status: true
      }, result);
    }
    if (space) {
      result = React.createElement(NoCompactStyle, null, result);
    }
    return result;
  };
  const canUseDocElement = () => canUseDom() && window.document.documentElement;
  function useFocusable(focusable2, defaultTrap, legacyFocusTriggerAfterClose) {
    return React.useMemo(() => {
      const ret = {
        trap: defaultTrap ?? true,
        focusTriggerAfterClose: legacyFocusTriggerAfterClose ?? true
      };
      return {
        ...ret,
        ...focusable2
      };
    }, [focusable2, defaultTrap, legacyFocusTriggerAfterClose]);
  }
  const Element$1 = (props) => {
    const {
      prefixCls,
      className,
      style: style2,
      size,
      shape
    } = props;
    const sizeCls = clsx({
      [`${prefixCls}-lg`]: size === "large",
      [`${prefixCls}-sm`]: size === "small"
    });
    const shapeCls = clsx({
      [`${prefixCls}-circle`]: shape === "circle",
      [`${prefixCls}-square`]: shape === "square",
      [`${prefixCls}-round`]: shape === "round"
    });
    const sizeStyle = React__namespace.useMemo(() => typeof size === "number" ? {
      width: size,
      height: size,
      lineHeight: `${size}px`
    } : {}, [size]);
    return React__namespace.createElement("span", {
      className: clsx(prefixCls, sizeCls, shapeCls, className),
      style: {
        ...sizeStyle,
        ...style2
      }
    });
  };
  const skeletonClsLoading = new Keyframe(`ant-skeleton-loading`, {
    "0%": {
      backgroundPosition: "100% 50%"
    },
    "100%": {
      backgroundPosition: "0 50%"
    }
  });
  const genSkeletonElementCommonSize = (size) => ({
    height: size,
    lineHeight: unit$1(size)
  });
  const genSkeletonElementSize = (size) => ({
    width: size,
    ...genSkeletonElementCommonSize(size)
  });
  const genSkeletonColor = (token2) => ({
    background: token2.skeletonLoadingBackground,
    backgroundSize: "400% 100%",
    animationName: skeletonClsLoading,
    animationDuration: token2.skeletonLoadingMotionDuration,
    animationTimingFunction: "ease",
    animationIterationCount: "infinite"
  });
  const genSkeletonElementInputSize = (size, calc) => ({
    width: calc(size).mul(5).equal(),
    minWidth: calc(size).mul(5).equal(),
    ...genSkeletonElementCommonSize(size)
  });
  const genSkeletonElementAvatar = (token2) => {
    const {
      skeletonAvatarCls,
      gradientFromColor,
      controlHeight,
      controlHeightLG,
      controlHeightSM
    } = token2;
    return {
      [skeletonAvatarCls]: {
        display: "inline-block",
        verticalAlign: "top",
        background: gradientFromColor,
        ...genSkeletonElementSize(controlHeight)
      },
      [`${skeletonAvatarCls}${skeletonAvatarCls}-circle`]: {
        borderRadius: "50%"
      },
      [`${skeletonAvatarCls}${skeletonAvatarCls}-lg`]: {
        ...genSkeletonElementSize(controlHeightLG)
      },
      [`${skeletonAvatarCls}${skeletonAvatarCls}-sm`]: {
        ...genSkeletonElementSize(controlHeightSM)
      }
    };
  };
  const genSkeletonElementInput = (token2) => {
    const {
      controlHeight,
      borderRadiusSM,
      skeletonInputCls,
      controlHeightLG,
      controlHeightSM,
      gradientFromColor,
      calc
    } = token2;
    return {
      [skeletonInputCls]: {
        display: "inline-block",
        verticalAlign: "top",
        background: gradientFromColor,
        borderRadius: borderRadiusSM,
        ...genSkeletonElementInputSize(controlHeight, calc)
      },
      [`${skeletonInputCls}-lg`]: {
        ...genSkeletonElementInputSize(controlHeightLG, calc)
      },
      [`${skeletonInputCls}-sm`]: {
        ...genSkeletonElementInputSize(controlHeightSM, calc)
      }
    };
  };
  const genSkeletonElementShape = (token2) => {
    const {
      gradientFromColor,
      borderRadiusSM,
      imageSizeBase,
      calc
    } = token2;
    return {
      display: "inline-flex",
      alignItems: "center",
      justifyContent: "center",
      verticalAlign: "middle",
      background: gradientFromColor,
      borderRadius: borderRadiusSM,
      ...genSkeletonElementSize(calc(imageSizeBase).mul(2).equal())
    };
  };
  const genSkeletonElementNode = (token2) => {
    return {
      [token2.skeletonNodeCls]: {
        ...genSkeletonElementShape(token2)
      }
    };
  };
  const genSkeletonElementImage = (token2) => {
    const {
      skeletonImageCls,
      imageSizeBase,
      calc
    } = token2;
    return {
      [skeletonImageCls]: {
        ...genSkeletonElementShape(token2),
        [`${skeletonImageCls}-path`]: {
          fill: "#bfbfbf"
        },
        [`${skeletonImageCls}-svg`]: {
          ...genSkeletonElementSize(imageSizeBase),
          maxWidth: calc(imageSizeBase).mul(4).equal(),
          maxHeight: calc(imageSizeBase).mul(4).equal()
        },
        [`${skeletonImageCls}-svg${skeletonImageCls}-svg-circle`]: {
          borderRadius: "50%"
        }
      },
      [`${skeletonImageCls}${skeletonImageCls}-circle`]: {
        borderRadius: "50%"
      }
    };
  };
  const genSkeletonElementButtonShape = (token2, size, buttonCls) => {
    const {
      skeletonButtonCls
    } = token2;
    return {
      [`${buttonCls}${skeletonButtonCls}-circle`]: {
        width: size,
        minWidth: size,
        borderRadius: "50%"
      },
      [`${buttonCls}${skeletonButtonCls}-round`]: {
        borderRadius: size
      }
    };
  };
  const genSkeletonElementButtonSize = (size, calc) => ({
    width: calc(size).mul(2).equal(),
    minWidth: calc(size).mul(2).equal(),
    ...genSkeletonElementCommonSize(size)
  });
  const genSkeletonElementButton = (token2) => {
    const {
      borderRadiusSM,
      skeletonButtonCls,
      controlHeight,
      controlHeightLG,
      controlHeightSM,
      gradientFromColor,
      calc
    } = token2;
    return {
      [skeletonButtonCls]: {
        display: "inline-block",
        verticalAlign: "top",
        background: gradientFromColor,
        borderRadius: borderRadiusSM,
        width: calc(controlHeight).mul(2).equal(),
        minWidth: calc(controlHeight).mul(2).equal(),
        ...genSkeletonElementButtonSize(controlHeight, calc)
      },
      ...genSkeletonElementButtonShape(token2, controlHeight, skeletonButtonCls),
      [`${skeletonButtonCls}-lg`]: {
        ...genSkeletonElementButtonSize(controlHeightLG, calc)
      },
      ...genSkeletonElementButtonShape(token2, controlHeightLG, `${skeletonButtonCls}-lg`),
      [`${skeletonButtonCls}-sm`]: {
        ...genSkeletonElementButtonSize(controlHeightSM, calc)
      },
      ...genSkeletonElementButtonShape(token2, controlHeightSM, `${skeletonButtonCls}-sm`)
    };
  };
  const genBaseStyle = (token2) => {
    const {
      componentCls,
      skeletonAvatarCls,
      skeletonTitleCls,
      skeletonParagraphCls,
      skeletonButtonCls,
      skeletonInputCls,
      skeletonNodeCls,
      skeletonImageCls,
      controlHeight,
      controlHeightLG,
      controlHeightSM,
      gradientFromColor,
      padding,
      marginSM,
      borderRadius,
      titleHeight,
      blockRadius,
      paragraphLiHeight,
      controlHeightXS,
      paragraphMarginTop
    } = token2;
    return {
      [componentCls]: {
        display: "table",
        width: "100%",
        [`${componentCls}-header`]: {
          display: "table-cell",
          paddingInlineEnd: padding,
          verticalAlign: "top",
[skeletonAvatarCls]: {
            display: "inline-block",
            verticalAlign: "top",
            background: gradientFromColor,
            ...genSkeletonElementSize(controlHeight)
          },
          [`${skeletonAvatarCls}-circle`]: {
            borderRadius: "50%"
          },
          [`${skeletonAvatarCls}-lg`]: {
            ...genSkeletonElementSize(controlHeightLG)
          },
          [`${skeletonAvatarCls}-sm`]: {
            ...genSkeletonElementSize(controlHeightSM)
          }
        },
        [`${componentCls}-section`]: {
          display: "table-cell",
          width: "100%",
          verticalAlign: "top",
[skeletonTitleCls]: {
            width: "100%",
            height: titleHeight,
            background: gradientFromColor,
            borderRadius: blockRadius,
            [`+ ${skeletonParagraphCls}`]: {
              marginBlockStart: controlHeightSM
            }
          },
[skeletonParagraphCls]: {
            padding: 0,
            "> li": {
              width: "100%",
              height: paragraphLiHeight,
              listStyle: "none",
              background: gradientFromColor,
              borderRadius: blockRadius,
              "+ li": {
                marginBlockStart: controlHeightXS
              }
            }
          },
          [`${skeletonParagraphCls}> li:last-child:not(:first-child):not(:nth-child(2))`]: {
            width: "61%"
          }
        },
        [`&-round ${componentCls}-section`]: {
          [`${skeletonTitleCls}, ${skeletonParagraphCls} > li`]: {
            borderRadius
          }
        }
      },
      [`${componentCls}-with-avatar ${componentCls}-section`]: {
[skeletonTitleCls]: {
          marginBlockStart: marginSM,
          [`+ ${skeletonParagraphCls}`]: {
            marginBlockStart: paragraphMarginTop
          }
        }
      },
[`${componentCls}${componentCls}-element`]: {
        display: "inline-block",
        width: "auto",
        ...genSkeletonElementButton(token2),
        ...genSkeletonElementAvatar(token2),
        ...genSkeletonElementInput(token2),
        ...genSkeletonElementNode(token2),
        ...genSkeletonElementImage(token2)
      },
[`${componentCls}${componentCls}-block`]: {
        width: "100%",
        [skeletonButtonCls]: {
          width: "100%"
        },
        [skeletonInputCls]: {
          width: "100%"
        }
      },
[`${componentCls}${componentCls}-active`]: {
        [`
        ${skeletonTitleCls},
        ${skeletonParagraphCls} > li,
        ${skeletonAvatarCls},
        ${skeletonButtonCls},
        ${skeletonInputCls},
        ${skeletonNodeCls},
        ${skeletonImageCls}
      `]: {
          ...genSkeletonColor(token2)
        }
      }
    };
  };
  const prepareComponentToken$3 = (token2) => {
    const {
      colorFillContent,
      colorFill
    } = token2;
    const gradientFromColor = colorFillContent;
    const gradientToColor = colorFill;
    return {
      color: gradientFromColor,
      colorGradientEnd: gradientToColor,
      gradientFromColor,
      gradientToColor,
      titleHeight: token2.controlHeight / 2,
      blockRadius: token2.borderRadiusSM,
      paragraphMarginTop: token2.marginLG + token2.marginXXS,
      paragraphLiHeight: token2.controlHeight / 2
    };
  };
  const useStyle$3 = genStyleHooks("Skeleton", (token2) => {
    const {
      componentCls,
      calc
    } = token2;
    const skeletonToken = merge(token2, {
      skeletonAvatarCls: `${componentCls}-avatar`,
      skeletonTitleCls: `${componentCls}-title`,
      skeletonParagraphCls: `${componentCls}-paragraph`,
      skeletonButtonCls: `${componentCls}-button`,
      skeletonInputCls: `${componentCls}-input`,
      skeletonNodeCls: `${componentCls}-node`,
      skeletonImageCls: `${componentCls}-image`,
      imageSizeBase: calc(token2.controlHeight).mul(1.5).equal(),
      borderRadius: 100,
skeletonLoadingBackground: `linear-gradient(90deg, ${token2.gradientFromColor} 25%, ${token2.gradientToColor} 37%, ${token2.gradientFromColor} 63%)`,
      skeletonLoadingMotionDuration: "1.4s"
    });
    return genBaseStyle(skeletonToken);
  }, prepareComponentToken$3, {
    deprecatedTokens: [["color", "gradientFromColor"], ["colorGradientEnd", "gradientToColor"]]
  });
  const SkeletonAvatar = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      classNames,
      rootClassName,
      active,
      style: style2,
      styles,
      shape = "circle",
      size: customSize,
      ...rest
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$3(prefixCls);
    const mergedSize = useSize((ctx) => customSize ?? ctx);
    const cls = clsx(prefixCls, `${prefixCls}-element`, {
      [`${prefixCls}-active`]: active
    }, classNames?.root, className, rootClassName, hashId, cssVarCls);
    return React__namespace.createElement("div", {
      className: cls,
      style: styles?.root
    }, React__namespace.createElement(Element$1, {
      prefixCls: `${prefixCls}-avatar`,
      className: classNames?.content,
      style: {
        ...styles?.content,
        ...style2
      },
      shape,
      size: mergedSize,
      ...rest
    }));
  };
  const SkeletonButton = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      classNames,
      active,
      style: style2,
      styles,
      block = false,
      size: customSize,
      ...rest
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$3(prefixCls);
    const mergedSize = useSize((ctx) => customSize ?? ctx);
    const cls = clsx(prefixCls, `${prefixCls}-element`, {
      [`${prefixCls}-active`]: active,
      [`${prefixCls}-block`]: block
    }, classNames?.root, className, rootClassName, hashId, cssVarCls);
    return React__namespace.createElement("div", {
      className: cls,
      style: styles?.root
    }, React__namespace.createElement(Element$1, {
      prefixCls: `${prefixCls}-button`,
      className: classNames?.content,
      style: {
        ...styles?.content,
        ...style2
      },
      size: mergedSize,
      ...rest
    }));
  };
  const SkeletonNode = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      classNames,
      rootClassName,
      internalClassName,
      style: style2,
      styles,
      active,
      children
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$3(prefixCls);
    const cls = clsx(prefixCls, `${prefixCls}-element`, {
      [`${prefixCls}-active`]: active
    }, hashId, classNames?.root, className, rootClassName, cssVarCls);
    return React__namespace.createElement("div", {
      className: cls,
      style: styles?.root
    }, React__namespace.createElement("div", {
      className: clsx(classNames?.content, internalClassName || `${prefixCls}-node`),
      style: {
        ...styles?.content,
        ...style2
      }
    }, children));
  };
  const SkeletonImage = (props) => {
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("skeleton", props.prefixCls);
    return React__namespace.createElement(SkeletonNode, {
      ...props,
      internalClassName: `${prefixCls}-image`
    }, React__namespace.createElement("svg", {
      viewBox: "0 0 1098 1024",
      xmlns: "http://www.w3.org/2000/svg",
      className: `${prefixCls}-image-svg`
    }, React__namespace.createElement("title", null, "Image placeholder"), React__namespace.createElement("path", {
      d: "M365.7 329.1q0 45.8-32 77.7t-77.7 32-77.7-32-32-77.7 32-77.6 77.7-32 77.7 32 32 77.6M951 548.6v256H146.3V694.9L329 512l91.5 91.4L713 311zm54.8-402.3H91.4q-7.4 0-12.8 5.4T73 164.6v694.8q0 7.5 5.5 12.9t12.8 5.4h914.3q7.5 0 12.9-5.4t5.4-12.9V164.6q0-7.5-5.4-12.9t-12.9-5.4m91.4 18.3v694.8q0 37.8-26.8 64.6t-64.6 26.9H91.4q-37.7 0-64.6-26.9T0 859.4V164.6q0-37.8 26.8-64.6T91.4 73h914.3q37.8 0 64.6 26.9t26.8 64.6",
      className: `${prefixCls}-image-path`
    })));
  };
  const SkeletonInput = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      classNames,
      rootClassName,
      active,
      block,
      style: style2,
      styles,
      size: customSize,
      ...rest
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$3(prefixCls);
    const mergedSize = useSize((ctx) => customSize ?? ctx);
    const cls = clsx(prefixCls, `${prefixCls}-element`, {
      [`${prefixCls}-active`]: active,
      [`${prefixCls}-block`]: block
    }, classNames?.root, className, rootClassName, hashId, cssVarCls);
    return React__namespace.createElement("div", {
      className: cls,
      style: styles?.root
    }, React__namespace.createElement(Element$1, {
      prefixCls: `${prefixCls}-input`,
      className: classNames?.content,
      style: {
        ...styles?.content,
        ...style2
      },
      size: mergedSize,
      ...rest
    }));
  };
  const getWidth = (index, props) => {
    const {
      width,
      rows = 2
    } = props;
    if (Array.isArray(width)) {
      return width[index];
    }
    if (rows - 1 === index) {
      return width;
    }
    return void 0;
  };
  const Paragraph = (props) => {
    const {
      prefixCls,
      className,
      style: style2,
      rows = 0
    } = props;
    const rowList = Array.from({
      length: rows
    }).map((_, index) => React__namespace.createElement("li", {
      key: index,
      style: {
        width: getWidth(index, props)
      }
    }));
    return React__namespace.createElement("ul", {
      className: clsx(prefixCls, className),
      style: style2
    }, rowList);
  };
  const Title = ({
    prefixCls,
    className,
    width,
    style: style2
  }) => React__namespace.createElement("h3", {
    className: clsx(prefixCls, className),
    style: {
      width,
      ...style2
    }
  });
  function getComponentProps(prop) {
    if (prop && typeof prop === "object") {
      return prop;
    }
    return {};
  }
  function getAvatarBasicProps(hasTitle, hasParagraph) {
    if (hasTitle && !hasParagraph) {
      return {
        size: "large",
        shape: "square"
      };
    }
    return {
      size: "large",
      shape: "circle"
    };
  }
  function getTitleBasicProps(hasAvatar, hasParagraph) {
    if (!hasAvatar && hasParagraph) {
      return {
        width: "38%"
      };
    }
    if (hasAvatar && hasParagraph) {
      return {
        width: "50%"
      };
    }
    return {};
  }
  function getParagraphBasicProps(hasAvatar, hasTitle) {
    const basicProps = {};
    if (!hasAvatar || !hasTitle) {
      basicProps.width = "61%";
    }
    if (!hasAvatar && hasTitle) {
      basicProps.rows = 3;
    } else {
      basicProps.rows = 2;
    }
    return basicProps;
  }
  const Skeleton = (props) => {
    const {
      prefixCls: customizePrefixCls,
      loading,
      className,
      rootClassName,
      classNames,
      style: style2,
      styles,
      children,
      avatar = false,
      title = true,
      paragraph = true,
      active,
      round: round2
    } = props;
    const {
      getPrefixCls,
      direction,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles
    } = useComponentConfig("skeleton");
    const prefixCls = getPrefixCls("skeleton", customizePrefixCls);
    const [hashId, cssVarCls] = useStyle$3(prefixCls);
    const mergedProps = {
      ...props,
      avatar,
      title,
      paragraph
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
      props: mergedProps
    });
    if (loading || !("loading" in props)) {
      const hasAvatar = !!avatar;
      const hasTitle = !!title;
      const hasParagraph = !!paragraph;
      let avatarNode;
      if (hasAvatar) {
        const avatarProps = {
          className: mergedClassNames.avatar,
          prefixCls: `${prefixCls}-avatar`,
          ...getAvatarBasicProps(hasTitle, hasParagraph),
          ...getComponentProps(avatar),
          style: mergedStyles.avatar
        };
        avatarNode = React__namespace.createElement("div", {
          className: clsx(mergedClassNames.header, `${prefixCls}-header`),
          style: mergedStyles.header
        }, React__namespace.createElement(Element$1, {
          ...avatarProps
        }));
      }
      let contentNode;
      if (hasTitle || hasParagraph) {
        let $title;
        if (hasTitle) {
          const titleProps = {
            className: mergedClassNames.title,
            prefixCls: `${prefixCls}-title`,
            ...getTitleBasicProps(hasAvatar, hasParagraph),
            ...getComponentProps(title),
            style: mergedStyles.title
          };
          $title = React__namespace.createElement(Title, {
            ...titleProps
          });
        }
        let paragraphNode;
        if (hasParagraph) {
          const paragraphProps = {
            className: mergedClassNames.paragraph,
            prefixCls: `${prefixCls}-paragraph`,
            ...getParagraphBasicProps(hasAvatar, hasTitle),
            ...getComponentProps(paragraph),
            style: mergedStyles.paragraph
          };
          paragraphNode = React__namespace.createElement(Paragraph, {
            ...paragraphProps
          });
        }
        contentNode = React__namespace.createElement("div", {
          className: clsx(mergedClassNames.section, `${prefixCls}-section`),
          style: mergedStyles.section
        }, $title, paragraphNode);
      }
      const cls = clsx(prefixCls, {
        [`${prefixCls}-with-avatar`]: hasAvatar,
        [`${prefixCls}-active`]: active,
        [`${prefixCls}-rtl`]: direction === "rtl",
        [`${prefixCls}-round`]: round2
      }, mergedClassNames.root, contextClassName, className, rootClassName, hashId, cssVarCls);
      return React__namespace.createElement("div", {
        className: cls,
        style: {
          ...mergedStyles.root,
          ...contextStyle,
          ...style2
        }
      }, avatarNode, contentNode);
    }
    return children ?? null;
  };
  Skeleton.Button = SkeletonButton;
  Skeleton.Avatar = SkeletonAvatar;
  Skeleton.Input = SkeletonInput;
  Skeleton.Image = SkeletonImage;
  Skeleton.Node = SkeletonNode;
  function voidFunc() {
  }
  const WatermarkContext = React__namespace.createContext({
    add: voidFunc,
    remove: voidFunc
  });
  function usePanelRef(panelSelector) {
    const watermark = React__namespace.useContext(WatermarkContext);
    const panelEleRef = React__namespace.useRef(null);
    const panelRef = useEvent((ele) => {
      if (ele) {
        const innerContentEle = panelSelector ? ele.querySelector(panelSelector) : ele;
        if (innerContentEle) {
          watermark.add(innerContentEle);
          panelEleRef.current = innerContentEle;
        }
      } else {
        watermark.remove(panelEleRef.current);
      }
    });
    return panelRef;
  }
  const NormalCancelBtn = () => {
    const {
      cancelButtonProps,
      cancelTextLocale,
      onCancel
    } = React.useContext(ModalContext);
    return React.createElement(Button$1, {
      onClick: onCancel,
      ...cancelButtonProps
    }, cancelTextLocale);
  };
  const NormalOkBtn = () => {
    const {
      confirmLoading,
      okButtonProps,
      okType,
      okTextLocale,
      onOk
    } = React.useContext(ModalContext);
    return React.createElement(Button$1, {
      ...convertLegacyProps(okType),
      loading: confirmLoading,
      onClick: onOk,
      ...okButtonProps
    }, okTextLocale);
  };
  function renderCloseIcon(prefixCls, closeIcon) {
    return React.createElement("span", {
      className: `${prefixCls}-close-x`
    }, closeIcon || React.createElement(RefIcon$6, {
      className: `${prefixCls}-close-icon`
    }));
  }
  const Footer = (props) => {
    const {
      okText,
      okType = "primary",
      cancelText,
      confirmLoading,
      onOk,
      onCancel,
      okButtonProps,
      cancelButtonProps,
      footer
    } = props;
    const [locale2] = useLocale("Modal", getConfirmLocale());
    const okTextLocale = okText || locale2?.okText;
    const cancelTextLocale = cancelText || locale2?.cancelText;
    const memoizedValue = React.useMemo(() => {
      return {
        confirmLoading,
        okButtonProps,
        cancelButtonProps,
        okTextLocale,
        cancelTextLocale,
        okType,
        onOk,
        onCancel
      };
    }, [confirmLoading, okButtonProps, cancelButtonProps, okTextLocale, cancelTextLocale, okType, onOk, onCancel]);
    let footerNode;
    if (typeof footer === "function" || typeof footer === "undefined") {
      footerNode = React.createElement(React.Fragment, null, React.createElement(NormalCancelBtn, null), React.createElement(NormalOkBtn, null));
      if (typeof footer === "function") {
        footerNode = footer(footerNode, {
          OkBtn: NormalOkBtn,
          CancelBtn: NormalCancelBtn
        });
      }
      footerNode = React.createElement(ModalContextProvider, {
        value: memoizedValue
      }, footerNode);
    } else {
      footerNode = footer;
    }
    return React.createElement(DisabledContextProvider, {
      disabled: false
    }, footerNode);
  };
  const genGridRowStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
[componentCls]: {
        display: "flex",
        flexFlow: "row wrap",
        minWidth: 0,
        "&::before, &::after": {
          display: "flex"
        },
        "&-no-wrap": {
          flexWrap: "nowrap"
        },
"&-start": {
          justifyContent: "flex-start"
        },
"&-center": {
          justifyContent: "center"
        },
"&-end": {
          justifyContent: "flex-end"
        },
        "&-space-between": {
          justifyContent: "space-between"
        },
        "&-space-around": {
          justifyContent: "space-around"
        },
        "&-space-evenly": {
          justifyContent: "space-evenly"
        },
"&-top": {
          alignItems: "flex-start"
        },
"&-middle": {
          alignItems: "center"
        },
        "&-bottom": {
          alignItems: "flex-end"
        }
      }
    };
  };
  const genGridColStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
[componentCls]: {
        position: "relative",
        maxWidth: "100%",
minHeight: 1
      }
    };
  };
  const genLoopGridColumnsStyle = (token2, sizeCls) => {
    const {
      componentCls,
      gridColumns,
      antCls
    } = token2;
    const [gridVarName, gridVarRef] = genCssVar(antCls, "grid");
    const [, colVarRef] = genCssVar(antCls, "col");
    const gridColumnsStyle = {};
    for (let i = gridColumns; i >= 0; i--) {
      if (i === 0) {
        gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = {
          display: "none"
        };
        gridColumnsStyle[`${componentCls}-push-${i}`] = {
          insetInlineStart: "auto"
        };
        gridColumnsStyle[`${componentCls}-pull-${i}`] = {
          insetInlineEnd: "auto"
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = {
          insetInlineStart: "auto"
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = {
          insetInlineEnd: "auto"
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = {
          marginInlineStart: 0
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = {
          order: 0
        };
      } else {
        gridColumnsStyle[`${componentCls}${sizeCls}-${i}`] = [


{
            [gridVarName("display")]: "block",
display: "block"
          },
          {
            display: gridVarRef("display"),
            flex: `0 0 ${i / gridColumns * 100}%`,
            maxWidth: `${i / gridColumns * 100}%`
          }
        ];
        gridColumnsStyle[`${componentCls}${sizeCls}-push-${i}`] = {
          insetInlineStart: `${i / gridColumns * 100}%`
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i}`] = {
          insetInlineEnd: `${i / gridColumns * 100}%`
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i}`] = {
          marginInlineStart: `${i / gridColumns * 100}%`
        };
        gridColumnsStyle[`${componentCls}${sizeCls}-order-${i}`] = {
          order: i
        };
      }
    }
    gridColumnsStyle[`${componentCls}${sizeCls}-flex`] = {
      flex: colVarRef(`${sizeCls.replace(/-/, "")}-flex`)
    };
    return gridColumnsStyle;
  };
  const genGridStyle = (token2, sizeCls) => genLoopGridColumnsStyle(token2, sizeCls);
  const genGridMediaStyle = (token2, screenSize, sizeCls) => ({
    [`@media (min-width: ${unit$1(screenSize)})`]: {
      ...genGridStyle(token2, sizeCls)
    }
  });
  const prepareRowComponentToken = () => ({});
  const prepareColComponentToken = () => ({});
  const useRowStyle = genStyleHooks("Grid", genGridRowStyle, prepareRowComponentToken);
  const getMediaSize = (token2) => {
    const mediaSizesMap = {
      xs: token2.screenXSMin,
      sm: token2.screenSMMin,
      md: token2.screenMDMin,
      lg: token2.screenLGMin,
      xl: token2.screenXLMin,
      xxl: token2.screenXXLMin,
      xxxl: token2.screenXXXLMin
    };
    return mediaSizesMap;
  };
  const useColStyle = genStyleHooks("Grid", (token2) => {
    const gridToken = merge(token2, {
      gridColumns: 24
});
    const gridMediaSizesMap = getMediaSize(gridToken);
    delete gridMediaSizesMap.xs;
    return [genGridColStyle(gridToken), genGridStyle(gridToken, ""), genGridStyle(gridToken, "-xs"), Object.keys(gridMediaSizesMap).map((key) => genGridMediaStyle(gridToken, gridMediaSizesMap[key], `-${key}`)).reduce((pre, cur) => ({
      ...pre,
      ...cur
    }), {})];
  }, prepareColComponentToken);
  function box(position2) {
    return {
      position: position2,
      inset: 0
    };
  }
  const genModalMaskStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    return [{
      [`${componentCls}-root`]: {
        [`${componentCls}${antCls}-zoom-enter, ${componentCls}${antCls}-zoom-appear`]: {
transform: "none",
          opacity: 0,
          animationDuration: token2.motionDurationSlow,
userSelect: "none"
        },

[`${componentCls}${antCls}-zoom-leave ${componentCls}-container`]: {
          pointerEvents: "none"
        },
        [`${componentCls}-mask`]: {
          ...box("fixed"),
          zIndex: token2.zIndexPopupBase,
          height: "100%",
          backgroundColor: token2.colorBgMask,
          pointerEvents: "none",
          [`&${componentCls}-mask-blur`]: {
            backdropFilter: "blur(4px)"
          },
          [`${componentCls}-hidden`]: {
            display: "none"
          }
        },
        [`${componentCls}-wrap`]: {
          ...box("fixed"),
          zIndex: token2.zIndexPopupBase,
          overflow: "auto",
          outline: 0,
          WebkitOverflowScrolling: "touch"
        }
      }
    }, {
      [`${componentCls}-root`]: initFadeMotion(token2)
    }];
  };
  const genModalStyle = (token2) => {
    const {
      componentCls,
      motionDurationMid
    } = token2;
    return [
{
        [`${componentCls}-root`]: {
          [`${componentCls}-wrap-rtl`]: {
            direction: "rtl"
          },
          [`${componentCls}-centered`]: {
            textAlign: "center",
            "&::before": {
              display: "inline-block",
              width: 0,
              height: "100%",
              verticalAlign: "middle",
              content: '""'
            },
            [componentCls]: {
              top: 0,
              display: "inline-block",
              paddingBottom: 0,
              textAlign: "start",
              verticalAlign: "middle"
            }
          },
          [`@media (max-width: ${token2.screenSMMax}px)`]: {
            [componentCls]: {
              maxWidth: "calc(100vw - 16px)",
              margin: `${unit$1(token2.marginXS)} auto`
            },
            [`${componentCls}-centered`]: {
              [componentCls]: {
                flex: 1
              }
            }
          }
        }
      },
{
        [componentCls]: {
          ...resetComponent(token2),
          pointerEvents: "none",
          position: "relative",
          top: 100,
          width: "auto",
          maxWidth: `calc(100vw - ${unit$1(token2.calc(token2.margin).mul(2).equal())})`,
          margin: "0 auto",
          "&:focus-visible": {
            borderRadius: token2.borderRadiusLG,
            ...genFocusOutline(token2)
          },
          [`${componentCls}-title`]: {
            margin: 0,
            color: token2.titleColor,
            fontWeight: token2.fontWeightStrong,
            fontSize: token2.titleFontSize,
            lineHeight: token2.titleLineHeight,
            wordWrap: "break-word"
          },
          [`${componentCls}-container`]: {
            position: "relative",
            backgroundColor: token2.contentBg,
            backgroundClip: "padding-box",
            border: 0,
            borderRadius: token2.borderRadiusLG,
            boxShadow: token2.boxShadow,
            pointerEvents: "auto",
            padding: token2.contentPadding
          },
          [`${componentCls}-close`]: {
            position: "absolute",
            top: token2.calc(token2.modalHeaderHeight).sub(token2.modalCloseBtnSize).div(2).equal(),
            insetInlineEnd: token2.calc(token2.modalHeaderHeight).sub(token2.modalCloseBtnSize).div(2).equal(),
            zIndex: token2.calc(token2.zIndexPopupBase).add(10).equal(),
            padding: 0,
            color: token2.modalCloseIconColor,
            fontWeight: token2.fontWeightStrong,
            lineHeight: 1,
            textDecoration: "none",
            background: "transparent",
            borderRadius: token2.borderRadiusSM,
            width: token2.modalCloseBtnSize,
            height: token2.modalCloseBtnSize,
            border: 0,
            outline: 0,
            cursor: "pointer",
            transition: ["color", "background-color"].map((prop) => `${prop} ${motionDurationMid}`).join(", "),
            "&-x": {
              display: "flex",
              fontSize: token2.fontSizeLG,
              fontStyle: "normal",
              lineHeight: unit$1(token2.modalCloseBtnSize),
              justifyContent: "center",
              textTransform: "none",
              textRendering: "auto"
            },
            "&:disabled": {
              pointerEvents: "none"
            },
            "&:hover": {
              color: token2.modalCloseIconHoverColor,
              backgroundColor: token2.colorBgTextHover,
              textDecoration: "none"
            },
            "&:active": {
              backgroundColor: token2.colorBgTextActive
            },
            ...genFocusStyle(token2)
          },
          [`${componentCls}-header`]: {
            color: token2.colorText,
            background: token2.headerBg,
            borderRadius: `${unit$1(token2.borderRadiusLG)} ${unit$1(token2.borderRadiusLG)} 0 0`,
            marginBottom: token2.headerMarginBottom,
            padding: token2.headerPadding,
            borderBottom: token2.headerBorderBottom
          },
          [`${componentCls}-body`]: {
            fontSize: token2.fontSize,
            lineHeight: token2.lineHeight,
            wordWrap: "break-word",
            padding: token2.bodyPadding,
            [`${componentCls}-body-skeleton`]: {
              width: "100%",
              height: "100%",
              display: "flex",
              justifyContent: "center",
              alignItems: "center",
              margin: `${unit$1(token2.margin)} auto`
            }
          },
          [`${componentCls}-footer`]: {
            textAlign: "end",
            background: token2.footerBg,
            marginTop: token2.footerMarginTop,
            padding: token2.footerPadding,
            borderTop: token2.footerBorderTop,
            borderRadius: token2.footerBorderRadius,
            [`> ${token2.antCls}-btn + ${token2.antCls}-btn`]: {
              marginInlineStart: token2.marginXS
            }
          },
          [`${componentCls}-open`]: {
            overflow: "hidden"
          }
        }
      },
{
        [`${componentCls}-pure-panel`]: {
          top: "auto",
          padding: 0,
          display: "flex",
          flexDirection: "column",
          [`${componentCls}-container,
          ${componentCls}-body,
          ${componentCls}-confirm-body-wrapper`]: {
            display: "flex",
            flexDirection: "column",
            flex: "auto"
          },
          [`${componentCls}-confirm-body`]: {
            marginBottom: "auto"
          }
        }
      }
    ];
  };
  const genRTLStyle = (token2) => {
    const {
      componentCls
    } = token2;
    return {
      [`${componentCls}-root`]: {
        [`${componentCls}-wrap-rtl`]: {
          direction: "rtl",
          [`${componentCls}-confirm-body`]: {
            direction: "rtl"
          }
        }
      }
    };
  };
  const genResponsiveWidthStyle = (token2) => {
    const {
      componentCls
    } = token2;
    const oriGridMediaSizesMap = getMediaSize(token2);
    const gridMediaSizesMap = {
      ...oriGridMediaSizesMap
    };
    delete gridMediaSizesMap.xs;
    const cssVarPrefix = `--${componentCls.replace(".", "")}-`;
    const responsiveStyles = Object.keys(gridMediaSizesMap).map((key) => ({
      [`@media (min-width: ${unit$1(gridMediaSizesMap[key])})`]: {
        width: `var(${cssVarPrefix}${key}-width)`
      }
    }));
    return {
      [`${componentCls}-root`]: {
        [componentCls]: [].concat(_toConsumableArray(Object.keys(oriGridMediaSizesMap).map((currentKey, index) => {
          const previousKey = Object.keys(oriGridMediaSizesMap)[index - 1];
          return previousKey ? {
            [`${cssVarPrefix}${currentKey}-width`]: `var(${cssVarPrefix}${previousKey}-width)`
          } : null;
        })), [{
          width: `var(${cssVarPrefix}xs-width)`
        }], _toConsumableArray(responsiveStyles))
      }
    };
  };
  const prepareToken = (token2) => {
    const headerPaddingVertical = token2.padding;
    const headerFontSize = token2.fontSizeHeading5;
    const headerLineHeight = token2.lineHeightHeading5;
    const modalToken = merge(token2, {
      modalHeaderHeight: token2.calc(token2.calc(headerLineHeight).mul(headerFontSize).equal()).add(token2.calc(headerPaddingVertical).mul(2).equal()).equal(),
      modalFooterBorderColorSplit: token2.colorSplit,
      modalFooterBorderStyle: token2.lineType,
      modalFooterBorderWidth: token2.lineWidth,
      modalCloseIconColor: token2.colorIcon,
      modalCloseIconHoverColor: token2.colorIconHover,
      modalCloseBtnSize: token2.controlHeight,
      modalConfirmIconSize: token2.fontHeight,
      modalTitleHeight: token2.calc(token2.titleFontSize).mul(token2.titleLineHeight).equal()
    });
    return modalToken;
  };
  const prepareComponentToken$2 = (token2) => ({
    footerBg: "transparent",
    headerBg: "transparent",
    titleLineHeight: token2.lineHeightHeading5,
    titleFontSize: token2.fontSizeHeading5,
    contentBg: token2.colorBgElevated,
    titleColor: token2.colorTextHeading,
contentPadding: token2.wireframe ? 0 : `${unit$1(token2.paddingMD)} ${unit$1(token2.paddingContentHorizontalLG)}`,
    headerPadding: token2.wireframe ? `${unit$1(token2.padding)} ${unit$1(token2.paddingLG)}` : 0,
    headerBorderBottom: token2.wireframe ? `${unit$1(token2.lineWidth)} ${token2.lineType} ${token2.colorSplit}` : "none",
    headerMarginBottom: token2.wireframe ? 0 : token2.marginXS,
    bodyPadding: token2.wireframe ? token2.paddingLG : 0,
    footerPadding: token2.wireframe ? `${unit$1(token2.paddingXS)} ${unit$1(token2.padding)}` : 0,
    footerBorderTop: token2.wireframe ? `${unit$1(token2.lineWidth)} ${token2.lineType} ${token2.colorSplit}` : "none",
    footerBorderRadius: token2.wireframe ? `0 0 ${unit$1(token2.borderRadiusLG)} ${unit$1(token2.borderRadiusLG)}` : 0,
    footerMarginTop: token2.wireframe ? 0 : token2.marginSM,
    confirmBodyPadding: token2.wireframe ? `${unit$1(token2.padding * 2)} ${unit$1(token2.padding * 2)} ${unit$1(token2.paddingLG)}` : 0,
    confirmIconMarginInlineEnd: token2.wireframe ? token2.margin : token2.marginSM,
    confirmBtnsMarginTop: token2.wireframe ? token2.marginLG : token2.marginSM,
    mask: true
  });
  const useStyle$2 = genStyleHooks("Modal", (token2) => {
    const modalToken = prepareToken(token2);
    return [genModalStyle(modalToken), genRTLStyle(modalToken), genModalMaskStyle(modalToken), initZoomMotion(modalToken, "zoom"), genResponsiveWidthStyle(modalToken)];
  }, prepareComponentToken$2, {
    unitless: {
      titleLineHeight: true
    }
  });
  let mousePosition;
  const getClickPosition = (e2) => {
    mousePosition = {
      x: e2.pageX,
      y: e2.pageY
    };
    setTimeout(() => {
      mousePosition = null;
    }, 100);
  };
  if (canUseDocElement()) {
    document.documentElement.addEventListener("click", getClickPosition, true);
  }
  const Modal$1 = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      open: open2,
      wrapClassName,
      centered,
      getContainer: getContainer2,
      style: style2,
      width = 520,
      footer,
      classNames,
      styles,
      children,
      loading,
      confirmLoading,
      zIndex: customizeZIndex,
      mousePosition: customizeMousePosition,
      onOk,
      onCancel,
      okButtonProps,
      cancelButtonProps,
      destroyOnHidden,
      destroyOnClose,
      panelRef = null,
      closable,
      mask: modalMask,
      modalRender,
      maskClosable,
focusTriggerAfterClose,
      focusable: focusable2,
      ...restProps
    } = props;
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      direction,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles,
      centered: contextCentered,
      cancelButtonProps: contextCancelButtonProps,
      okButtonProps: contextOkButtonProps,
      mask: contextMask
    } = useComponentConfig("modal");
    const {
      modal: modalContext
    } = React__namespace.useContext(ConfigContext);
    const [closableAfterClose, onClose] = React__namespace.useMemo(() => {
      if (typeof closable === "boolean") {
        return [void 0, void 0];
      }
      return [closable?.afterClose, closable?.onClose];
    }, [closable]);
    const prefixCls = getPrefixCls("modal", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const [mergedMask, maskBlurClassName, mergeMaskClosable] = useMergedMask(modalMask, contextMask, prefixCls, maskClosable);
    const mergedFocusable = useFocusable(focusable2, mergedMask, focusTriggerAfterClose);
    const handleCancel = (e2) => {
      if (confirmLoading) {
        return;
      }
      onCancel?.(e2);
      onClose?.();
    };
    const handleOk = (e2) => {
      onOk?.(e2);
      onClose?.();
    };
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
    const wrapClassNameExtended = clsx(wrapClassName, {
      [`${prefixCls}-centered`]: centered ?? contextCentered,
      [`${prefixCls}-wrap-rtl`]: direction === "rtl"
    });
    const dialogFooter = footer !== null && !loading ? React__namespace.createElement(Footer, {
      ...props,
      okButtonProps: {
        ...contextOkButtonProps,
        ...okButtonProps
      },
      onOk: handleOk,
      cancelButtonProps: {
        ...contextCancelButtonProps,
        ...cancelButtonProps
      },
      onCancel: handleCancel
    }) : null;
    const [rawClosable, mergedCloseIcon, closeBtnIsDisabled, ariaProps] = useClosable(pickClosable(props), pickClosable(modalContext), {
      closable: true,
      closeIcon: React__namespace.createElement(RefIcon$6, {
        className: `${prefixCls}-close-icon`
      }),
      closeIconRender: (icon) => renderCloseIcon(prefixCls, icon)
    });
    const mergedClosable = rawClosable ? {
      disabled: closeBtnIsDisabled,
      closeIcon: mergedCloseIcon,
      afterClose: closableAfterClose,
      ...ariaProps
    } : false;
    const mergedModalRender = modalRender ? (node2) => React__namespace.createElement("div", {
      className: `${prefixCls}-render`
    }, modalRender(node2)) : void 0;
    const panelClassName = `.${prefixCls}-${modalRender ? "render" : "container"}`;
    const innerPanelRef = usePanelRef(panelClassName);
    const mergedPanelRef = composeRef(panelRef, innerPanelRef);
    const [zIndex, contextZIndex] = useZIndex("Modal", customizeZIndex);
    const mergedProps = {
      ...props,
      width,
      panelRef,
      focusTriggerAfterClose: mergedFocusable.focusTriggerAfterClose,
      focusable: mergedFocusable,
      mask: mergedMask,
      maskClosable: mergeMaskClosable,
      zIndex
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames, maskBlurClassName], [contextStyles, styles], {
      props: mergedProps
    });
    const [numWidth, responsiveWidth] = React__namespace.useMemo(() => {
      if (width && typeof width === "object") {
        return [void 0, width];
      }
      return [width, void 0];
    }, [width]);
    const responsiveWidthVars = React__namespace.useMemo(() => {
      const vars = {};
      if (responsiveWidth) {
        Object.keys(responsiveWidth).forEach((breakpoint) => {
          const breakpointWidth = responsiveWidth[breakpoint];
          if (breakpointWidth !== void 0) {
            vars[`--${prefixCls}-${breakpoint}-width`] = typeof breakpointWidth === "number" ? `${breakpointWidth}px` : breakpointWidth;
          }
        });
      }
      return vars;
    }, [prefixCls, responsiveWidth]);
    return React__namespace.createElement(ContextIsolator, {
      form: true,
      space: true
    }, React__namespace.createElement(ZIndexContext.Provider, {
      value: contextZIndex
    }, React__namespace.createElement(DialogWrap, {
      width: numWidth,
      ...restProps,
      zIndex,
      getContainer: getContainer2 === void 0 ? getContextPopupContainer : getContainer2,
      prefixCls,
      rootClassName: clsx(hashId, rootClassName, cssVarCls, rootCls, mergedClassNames.root),
      rootStyle: mergedStyles.root,
      footer: dialogFooter,
      visible: open2,
      mousePosition: customizeMousePosition ?? mousePosition,
      onClose: handleCancel,
      closable: mergedClosable,
      closeIcon: mergedCloseIcon,
      transitionName: getTransitionName(rootPrefixCls, "zoom", props.transitionName),
      maskTransitionName: getTransitionName(rootPrefixCls, "fade", props.maskTransitionName),
      mask: mergedMask,
      maskClosable: mergeMaskClosable,
      className: clsx(hashId, className, contextClassName),
      style: {
        ...contextStyle,
        ...style2,
        ...responsiveWidthVars
      },
      classNames: {
        ...mergedClassNames,
        wrapper: clsx(mergedClassNames.wrapper, wrapClassNameExtended)
      },
      styles: mergedStyles,
      panelRef: mergedPanelRef,
      destroyOnHidden: destroyOnHidden ?? destroyOnClose,
      modalRender: mergedModalRender,
focusTriggerAfterClose: mergedFocusable.focusTriggerAfterClose,
      focusTrap: mergedFocusable.trap
    }, loading ? React__namespace.createElement(Skeleton, {
      active: true,
      title: false,
      paragraph: {
        rows: 4
      },
      className: `${prefixCls}-body-skeleton`
    }) : children)));
  };
  const genModalConfirmStyle = (token2) => {
    const {
      componentCls,
      titleFontSize,
      titleLineHeight,
      modalConfirmIconSize,
      fontSize,
      lineHeight,
      modalTitleHeight,
      fontHeight,
      confirmBodyPadding
    } = token2;
    const confirmComponentCls = `${componentCls}-confirm`;
    return {
      [confirmComponentCls]: {
        "&-rtl": {
          direction: "rtl"
        },
        [`${token2.antCls}-modal-header`]: {
          display: "none"
        },
        [`${confirmComponentCls}-body-wrapper`]: {
          ...clearFix()
        },
        [`&${componentCls} ${componentCls}-body`]: {
          padding: confirmBodyPadding
        },
[`${confirmComponentCls}-body`]: {
          display: "flex",
          flexWrap: "nowrap",
          alignItems: "start",
          [`> ${token2.iconCls}`]: {
            flex: "none",
            fontSize: modalConfirmIconSize,
            marginInlineEnd: token2.confirmIconMarginInlineEnd,
            marginTop: token2.calc(token2.calc(fontHeight).sub(modalConfirmIconSize).equal()).div(2).equal()
          },
          [`&-has-title > ${token2.iconCls}`]: {
            marginTop: token2.calc(token2.calc(modalTitleHeight).sub(modalConfirmIconSize).equal()).div(2).equal()
          }
        },
        [`${confirmComponentCls}-paragraph`]: {
          display: "flex",
          flexDirection: "column",
          flex: "auto",
          rowGap: token2.marginXS,
maxWidth: `calc(100% - ${unit$1(token2.marginSM)})`
        },
        [`${confirmComponentCls}-body-no-icon ${confirmComponentCls}-paragraph`]: {
          maxWidth: "100%"
        },
[`${token2.iconCls} + ${confirmComponentCls}-paragraph`]: {
          maxWidth: `calc(100% - ${unit$1(token2.calc(token2.modalConfirmIconSize).add(token2.marginSM).equal())})`
        },
        [`${confirmComponentCls}-title`]: {
          color: token2.colorTextHeading,
          fontWeight: token2.fontWeightStrong,
          fontSize: titleFontSize,
          lineHeight: titleLineHeight
        },
        [`${confirmComponentCls}-container`]: {
          color: token2.colorText,
          fontSize,
          lineHeight
        },
[`${confirmComponentCls}-btns`]: {
          textAlign: "end",
          marginTop: token2.confirmBtnsMarginTop,
          [`${token2.antCls}-btn + ${token2.antCls}-btn`]: {
            marginBottom: 0,
            marginInlineStart: token2.marginXS
          }
        }
      },
      [`${confirmComponentCls}-error ${confirmComponentCls}-body > ${token2.iconCls}`]: {
        color: token2.colorError
      },
      [`${confirmComponentCls}-warning ${confirmComponentCls}-body > ${token2.iconCls},
        ${confirmComponentCls}-confirm ${confirmComponentCls}-body > ${token2.iconCls}`]: {
        color: token2.colorWarning
      },
      [`${confirmComponentCls}-info ${confirmComponentCls}-body > ${token2.iconCls}`]: {
        color: token2.colorInfo
      },
      [`${confirmComponentCls}-success ${confirmComponentCls}-body > ${token2.iconCls}`]: {
        color: token2.colorSuccess
      }
    };
  };
  const Confirm = genSubStyleComponent(["Modal", "confirm"], (token2) => {
    const modalToken = prepareToken(token2);
    return genModalConfirmStyle(modalToken);
  }, prepareComponentToken$2, {
order: -1e3
  });
  const ConfirmContent = (props) => {
    const {
      prefixCls,
      icon,
      okText,
      cancelText,
      confirmPrefixCls,
      type: type4,
      okCancel,
      footer,
locale: staticLocale,
      autoFocusButton,
      focusable: focusable2,
      ...restProps
    } = props;
    let mergedIcon = icon;
    if (!icon && icon !== null) {
      switch (type4) {
        case "info":
          mergedIcon = React__namespace.createElement(RefIcon$2, null);
          break;
        case "success":
          mergedIcon = React__namespace.createElement(RefIcon$5, null);
          break;
        case "error":
          mergedIcon = React__namespace.createElement(RefIcon$4, null);
          break;
        default:
          mergedIcon = React__namespace.createElement(RefIcon$3, null);
      }
    }
    const mergedOkCancel = okCancel ?? type4 === "confirm";
    const mergedAutoFocusButton = React__namespace.useMemo(() => {
      const base = focusable2?.autoFocusButton || autoFocusButton;
      return base || base === null ? base : "ok";
    }, [autoFocusButton, focusable2?.autoFocusButton]);
    const [locale2] = useLocale("Modal");
    const mergedLocale = staticLocale || locale2;
    const okTextLocale = okText || (mergedOkCancel ? mergedLocale?.okText : mergedLocale?.justOkText);
    const cancelTextLocale = cancelText || mergedLocale?.cancelText;
    const {
      closable
    } = restProps;
    const {
      onClose
    } = closable && typeof closable === "object" ? closable : {};
    const memoizedValue = React__namespace.useMemo(() => {
      return {
        autoFocusButton: mergedAutoFocusButton,
        cancelTextLocale,
        okTextLocale,
        mergedOkCancel,
        onClose,
        ...restProps
      };
    }, [mergedAutoFocusButton, cancelTextLocale, okTextLocale, mergedOkCancel, onClose, restProps]);
    const footerOriginNode = React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(ConfirmCancelBtn, null), React__namespace.createElement(ConfirmOkBtn, null));
    const hasTitle = isNonNullable$1(props.title) && props.title !== "";
    const hasIcon = isNonNullable$1(mergedIcon);
    const bodyCls = `${confirmPrefixCls}-body`;
    return React__namespace.createElement("div", {
      className: `${confirmPrefixCls}-body-wrapper`
    }, React__namespace.createElement("div", {
      className: clsx(bodyCls, {
        [`${bodyCls}-has-title`]: hasTitle,
        [`${bodyCls}-no-icon`]: !hasIcon
      })
    }, mergedIcon, React__namespace.createElement("div", {
      className: `${confirmPrefixCls}-paragraph`
    }, hasTitle && React__namespace.createElement("span", {
      className: `${confirmPrefixCls}-title`
    }, props.title), React__namespace.createElement("div", {
      className: `${confirmPrefixCls}-content`
    }, props.content))), footer === void 0 || typeof footer === "function" ? React__namespace.createElement(ModalContextProvider, {
      value: memoizedValue
    }, React__namespace.createElement("div", {
      className: `${confirmPrefixCls}-btns`
    }, typeof footer === "function" ? footer(footerOriginNode, {
      OkBtn: ConfirmOkBtn,
      CancelBtn: ConfirmCancelBtn
    }) : footerOriginNode)) : footer, React__namespace.createElement(Confirm, {
      prefixCls
    }));
  };
  const ConfirmDialog = (props) => {
    const {
      close,
      zIndex,
      maskStyle,
      direction,
      prefixCls,
      wrapClassName,
      rootPrefixCls,
      bodyStyle,
      closable = false,
      onConfirm,
      styles,
      title,
      mask,
      maskClosable,
      okButtonProps,
      cancelButtonProps
    } = props;
    const {
      cancelButtonProps: contextCancelButtonProps,
      okButtonProps: contextOkButtonProps
    } = useComponentConfig("modal");
    const confirmPrefixCls = `${prefixCls}-confirm`;
    const width = props.width || 416;
    const style2 = props.style || {};
    const classString = clsx(confirmPrefixCls, `${confirmPrefixCls}-${props.type}`, {
      [`${confirmPrefixCls}-rtl`]: direction === "rtl"
    }, props.className);
    const mergedMask = React__namespace.useMemo(() => {
      const nextMaskConfig = normalizeMaskConfig(mask, maskClosable);
      nextMaskConfig.closable ?? (nextMaskConfig.closable = false);
      return nextMaskConfig;
    }, [mask, maskClosable]);
    const [, token2] = useToken();
    const mergedZIndex = React__namespace.useMemo(() => {
      if (zIndex !== void 0) {
        return zIndex;
      }
      return token2.zIndexPopupBase + CONTAINER_MAX_OFFSET;
    }, [zIndex, token2]);
    return React__namespace.createElement(Modal$1, {
      ...props,
      className: classString,
      wrapClassName: clsx({
        [`${confirmPrefixCls}-centered`]: !!props.centered
      }, wrapClassName),
      onCancel: () => {
        close?.({
          triggerCancel: true
        });
        onConfirm?.(false);
      },
      title,
      footer: null,
      transitionName: getTransitionName(rootPrefixCls || "", "zoom", props.transitionName),
      maskTransitionName: getTransitionName(rootPrefixCls || "", "fade", props.maskTransitionName),
      mask: mergedMask,
      style: style2,
      styles: {
        body: bodyStyle,
        mask: maskStyle,
        ...styles
      },
      width,
      zIndex: mergedZIndex,
      closable
    }, React__namespace.createElement(ConfirmContent, {
      ...props,
      confirmPrefixCls,
      okButtonProps: {
        ...contextOkButtonProps,
        ...okButtonProps
      },
      cancelButtonProps: {
        ...contextCancelButtonProps,
        ...cancelButtonProps
      }
    }));
  };
  const ConfirmDialogWrapper$1 = (props) => {
    const {
      rootPrefixCls,
      iconPrefixCls,
      direction,
      theme
    } = props;
    return React__namespace.createElement(ConfigProvider, {
      prefixCls: rootPrefixCls,
      iconPrefixCls,
      direction,
      theme
    }, React__namespace.createElement(ConfirmDialog, {
      ...props
    }));
  };
  const destroyFns = [];
  let defaultRootPrefixCls = "";
  function getRootPrefixCls() {
    return defaultRootPrefixCls;
  }
  const ConfirmDialogWrapper = (props) => {
    const {
      prefixCls: customizePrefixCls,
      getContainer: getContainer2,
      direction
    } = props;
    const runtimeLocale2 = getConfirmLocale();
    const config = React.useContext(ConfigContext);
    const rootPrefixCls = getRootPrefixCls() || config.getPrefixCls();
    const prefixCls = customizePrefixCls || `${rootPrefixCls}-modal`;
    let mergedGetContainer = getContainer2;
    if (mergedGetContainer === false) {
      mergedGetContainer = void 0;
    }
    return React.createElement(ConfirmDialogWrapper$1, {
      ...props,
      rootPrefixCls,
      prefixCls,
      iconPrefixCls: config.iconPrefixCls,
      theme: config.theme,
      direction: direction ?? config.direction,
      locale: config.locale?.Modal ?? runtimeLocale2,
      getContainer: mergedGetContainer
    });
  };
  function confirm(config) {
    const global = globalConfig();
    const container = document.createDocumentFragment();
    let currentConfig = {
      ...config,
      close,
      open: true
    };
    let timeoutId;
    function destroy2(...args) {
      const triggerCancel = args.some((param) => param?.triggerCancel);
      if (triggerCancel) {
        config.onCancel?.(() => {
        }, ...args.slice(1));
      }
      for (let i = 0; i < destroyFns.length; i++) {
        const fn = destroyFns[i];
        if (fn === close) {
          destroyFns.splice(i, 1);
          break;
        }
      }
      unmount(container).then(() => {
      });
    }
    const scheduleRender = (props) => {
      clearTimeout(timeoutId);
      timeoutId = setTimeout(() => {
        const rootPrefixCls = global.getPrefixCls(void 0, getRootPrefixCls());
        const iconPrefixCls = global.getIconPrefixCls();
        const theme = global.getTheme();
        const dom = React.createElement(ConfirmDialogWrapper, {
          ...props
        });
        render( React.createElement(ConfigProvider, {
          prefixCls: rootPrefixCls,
          iconPrefixCls,
          theme
        }, typeof global.holderRender === "function" ? global.holderRender(dom) : dom), container);
      });
    };
    function close(...args) {
      currentConfig = {
        ...currentConfig,
        open: false,
        afterClose: () => {
          if (typeof config.afterClose === "function") {
            config.afterClose();
          }
          destroy2.apply(this, args);
        }
      };
      scheduleRender(currentConfig);
    }
    function update(configUpdate) {
      if (typeof configUpdate === "function") {
        currentConfig = configUpdate(currentConfig);
      } else {
        currentConfig = {
          ...currentConfig,
          ...configUpdate
        };
      }
      scheduleRender(currentConfig);
    }
    scheduleRender(currentConfig);
    destroyFns.push(close);
    return {
      destroy: close,
      update
    };
  }
  function withWarn(props) {
    return {
      ...props,
      type: "warning"
    };
  }
  function withInfo(props) {
    return {
      ...props,
      type: "info"
    };
  }
  function withSuccess(props) {
    return {
      ...props,
      type: "success"
    };
  }
  function withError(props) {
    return {
      ...props,
      type: "error"
    };
  }
  function withConfirm(props) {
    return {
      ...props,
      type: "confirm"
    };
  }
  function modalGlobalConfig({
    rootPrefixCls
  }) {
    defaultRootPrefixCls = rootPrefixCls;
  }
  const HookModal = React__namespace.forwardRef((props, ref) => {
    const {
      afterClose: hookAfterClose,
      config,
      ...restProps
    } = props;
    const [open2, setOpen] = React__namespace.useState(true);
    const [innerConfig, setInnerConfig] = React__namespace.useState(config);
    const {
      direction,
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("modal");
    const rootPrefixCls = getPrefixCls();
    const afterClose = () => {
      hookAfterClose();
      innerConfig.afterClose?.();
    };
    const close = (...args) => {
      setOpen(false);
      const triggerCancel = args.some((param) => param?.triggerCancel);
      if (triggerCancel) {
        innerConfig.onCancel?.(() => {
        }, ...args.slice(1));
      }
    };
    React__namespace.useImperativeHandle(ref, () => ({
      destroy: close,
      update: (newConfig) => {
        setInnerConfig((originConfig) => {
          const nextConfig = typeof newConfig === "function" ? newConfig(originConfig) : newConfig;
          return {
            ...originConfig,
            ...nextConfig
          };
        });
      }
    }));
    const mergedOkCancel = innerConfig.okCancel ?? innerConfig.type === "confirm";
    const [contextLocale] = useLocale("Modal", localeValues.Modal);
    return React__namespace.createElement(ConfirmDialogWrapper$1, {
      prefixCls,
      rootPrefixCls,
      ...innerConfig,
      close,
      open: open2,
      afterClose,
      okText: innerConfig.okText || (mergedOkCancel ? contextLocale?.okText : contextLocale?.justOkText),
      direction: innerConfig.direction || direction,
      cancelText: innerConfig.cancelText || contextLocale?.cancelText,
      ...restProps
    });
  });
  let uuid = 0;
  const ElementsHolder = React__namespace.memo( React__namespace.forwardRef((_props, ref) => {
    const [elements, patchElement] = usePatchElement();
    React__namespace.useImperativeHandle(ref, () => ({
      patchElement
    }), [patchElement]);
    return React__namespace.createElement(React__namespace.Fragment, null, elements);
  }));
  function useModal() {
    const holderRef = React__namespace.useRef(null);
    const [actionQueue, setActionQueue] = React__namespace.useState([]);
    React__namespace.useEffect(() => {
      if (actionQueue.length) {
        const cloneQueue = _toConsumableArray(actionQueue);
        cloneQueue.forEach((action) => {
          action();
        });
        setActionQueue([]);
      }
    }, [actionQueue]);
    const getConfirmFunc = React__namespace.useCallback((withFunc) => function hookConfirm(config) {
      uuid += 1;
      const modalRef = React__namespace.createRef();
      let resolvePromise;
      const promise = new Promise((resolve) => {
        resolvePromise = resolve;
      });
      let silent = false;
      let closeFunc;
      const modal = React__namespace.createElement(HookModal, {
        key: `modal-${uuid}`,
        config: withFunc(config),
        ref: modalRef,
        afterClose: () => {
          closeFunc?.();
        },
        isSilent: () => silent,
        onConfirm: (confirmed) => {
          resolvePromise(confirmed);
        }
      });
      closeFunc = holderRef.current?.patchElement(modal);
      if (closeFunc) {
        destroyFns.push(closeFunc);
      }
      const instance = {
        destroy: () => {
          function destroyAction() {
            modalRef.current?.destroy();
          }
          if (modalRef.current) {
            destroyAction();
          } else {
            setActionQueue((prev2) => [].concat(_toConsumableArray(prev2), [destroyAction]));
          }
        },
        update: (newConfig) => {
          function updateAction() {
            modalRef.current?.update(newConfig);
          }
          if (modalRef.current) {
            updateAction();
          } else {
            setActionQueue((prev2) => [].concat(_toConsumableArray(prev2), [updateAction]));
          }
        },
        then: (resolve) => {
          silent = true;
          return promise.then(resolve);
        }
      };
      return instance;
    }, []);
    const fns = React__namespace.useMemo(() => ({
      info: getConfirmFunc(withInfo),
      success: getConfirmFunc(withSuccess),
      error: getConfirmFunc(withError),
      warning: getConfirmFunc(withWarn),
      confirm: getConfirmFunc(withConfirm)
    }), [getConfirmFunc]);
    return [fns, React__namespace.createElement(ElementsHolder, {
      key: "modal-holder",
      ref: holderRef
    })];
  }
  const AppConfigContext = React.createContext({});
  function withPureRenderTheme(Component) {
    return (props) => React__namespace.createElement(ConfigProvider, {
      theme: {
        token: {
          motion: false,
          zIndexPopupBase: 0
        }
      }
    }, React__namespace.createElement(Component, {
      ...props
    }));
  }
  const responsiveArray = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"];
  const responsiveArrayReversed = [].concat(responsiveArray).reverse();
  const getResponsiveMap = (token2) => ({
    xs: `(max-width: ${token2.screenXSMax}px)`,
    sm: `(min-width: ${token2.screenSM}px)`,
    md: `(min-width: ${token2.screenMD}px)`,
    lg: `(min-width: ${token2.screenLG}px)`,
    xl: `(min-width: ${token2.screenXL}px)`,
    xxl: `(min-width: ${token2.screenXXL}px)`,
    xxxl: `(min-width: ${token2.screenXXXL}px)`
  });
  const validateBreakpoints = (token2) => {
    const indexableToken = token2;
    const revBreakpoints = [].concat(responsiveArray).reverse();
    revBreakpoints.forEach((breakpoint, i) => {
      const breakpointUpper = breakpoint.toUpperCase();
      const screenMin = `screen${breakpointUpper}Min`;
      const screen = `screen${breakpointUpper}`;
      if (!(indexableToken[screenMin] <= indexableToken[screen])) {
        throw new Error(`${screenMin}<=${screen} fails : !(${indexableToken[screenMin]}<=${indexableToken[screen]})`);
      }
      if (i < revBreakpoints.length - 1) {
        const screenMax = `screen${breakpointUpper}Max`;
        if (!(indexableToken[screen] <= indexableToken[screenMax])) {
          throw new Error(`${screen}<=${screenMax} fails : !(${indexableToken[screen]}<=${indexableToken[screenMax]})`);
        }
        const nextBreakpointUpperMin = revBreakpoints[i + 1].toUpperCase();
        const nextScreenMin = `screen${nextBreakpointUpperMin}Min`;
        if (!(indexableToken[screenMax] <= indexableToken[nextScreenMin])) {
          throw new Error(`${screenMax}<=${nextScreenMin} fails : !(${indexableToken[screenMax]}<=${indexableToken[nextScreenMin]})`);
        }
      }
    });
    return token2;
  };
  const useResponsiveObserver = () => {
    const [, token2] = useToken();
    const responsiveMap = getResponsiveMap(validateBreakpoints(token2));
    return React.useMemo(() => {
      const subscribers = new Map();
      let subUid = -1;
      let screens = {};
      return {
        responsiveMap,
        matchHandlers: {},
        dispatch(pointMap) {
          screens = pointMap;
          subscribers.forEach((func) => {
            func(screens);
          });
          return subscribers.size >= 1;
        },
        subscribe(func) {
          if (!subscribers.size) {
            this.register();
          }
          subUid += 1;
          subscribers.set(subUid, func);
          func(screens);
          return subUid;
        },
        unsubscribe(paramToken) {
          subscribers.delete(paramToken);
          if (!subscribers.size) {
            this.unregister();
          }
        },
        register() {
          Object.entries(responsiveMap).forEach(([screen, mediaQuery]) => {
            const listener = ({
              matches
            }) => {
              this.dispatch({
                ...screens,
                [screen]: matches
              });
            };
            const mql = window.matchMedia(mediaQuery);
            if (typeof mql?.addEventListener === "function") {
              mql.addEventListener("change", listener);
            }
            this.matchHandlers[mediaQuery] = {
              mql,
              listener
            };
            listener(mql);
          });
        },
        unregister() {
          Object.values(responsiveMap).forEach((mediaQuery) => {
            const handler = this.matchHandlers[mediaQuery];
            if (typeof handler?.mql?.removeEventListener === "function") {
              handler.mql.removeEventListener("change", handler?.listener);
            }
          });
          subscribers.clear();
        }
      };
    }, [responsiveMap]);
  };
  function useBreakpoint(refreshOnChange = true, defaultScreens = {}) {
    const screensRef = React.useRef(defaultScreens);
    const [, forceUpdate] = useForceUpdate();
    const responsiveObserver = useResponsiveObserver();
    useLayoutEffect(() => {
      const token2 = responsiveObserver.subscribe((supportScreens) => {
        screensRef.current = supportScreens;
        if (refreshOnChange) {
          forceUpdate();
        }
      });
      return () => responsiveObserver.unsubscribe(token2);
    }, []);
    return screensRef.current;
  }
  const Popup = (props) => {
    const {
      children,
      prefixCls,
      id,
      classNames,
      styles,
      className,
      style: style2
    } = props;
    return React__namespace.createElement("div", {
      id,
      className: clsx(`${prefixCls}-container`, classNames?.container, className),
      style: {
        ...styles?.container,
        ...style2
      },
      role: "tooltip"
    }, typeof children === "function" ? children() : children);
  };
  const autoAdjustOverflowTopBottom = {
    shiftX: 64,
    adjustY: 1
  };
  const autoAdjustOverflowLeftRight = {
    adjustX: 1,
    shiftY: true
  };
  const targetOffset = [0, 0];
  const placements = {
    left: {
      points: ["cr", "cl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset
    },
    right: {
      points: ["cl", "cr"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset
    },
    top: {
      points: ["bc", "tc"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset
    },
    bottom: {
      points: ["tc", "bc"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset
    },
    topLeft: {
      points: ["bl", "tl"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset
    },
    leftTop: {
      points: ["tr", "tl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset
    },
    topRight: {
      points: ["br", "tr"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, -4],
      targetOffset
    },
    rightTop: {
      points: ["tl", "tr"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset
    },
    bottomRight: {
      points: ["tr", "br"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset
    },
    rightBottom: {
      points: ["bl", "br"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [4, 0],
      targetOffset
    },
    bottomLeft: {
      points: ["tl", "bl"],
      overflow: autoAdjustOverflowTopBottom,
      offset: [0, 4],
      targetOffset
    },
    leftBottom: {
      points: ["br", "bl"],
      overflow: autoAdjustOverflowLeftRight,
      offset: [-4, 0],
      targetOffset
    }
  };
  function _extends$2() {
    _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$2.apply(this, arguments);
  }
  const Tooltip$1 = React__namespace.forwardRef((props, ref) => {
    const {
      trigger = ["hover"],
      mouseEnterDelay = 0,
      mouseLeaveDelay = 0.1,
      prefixCls = "rc-tooltip",
      children,
      onVisibleChange,
      afterVisibleChange,
      motion,
      placement = "right",
      align = {},
      destroyOnHidden = false,
      defaultVisible,
      getTooltipContainer,
      arrowContent,
      overlay,
      id,
      showArrow = true,
      classNames,
      styles,
      ...restProps
    } = props;
    const mergedId = useId(id);
    const triggerRef = React.useRef(null);
    React.useImperativeHandle(ref, () => triggerRef.current);
    const extraProps = {
      ...restProps
    };
    if ("visible" in props) {
      extraProps.popupVisible = props.visible;
    }
    const mergedArrow = React__namespace.useMemo(() => {
      if (!showArrow) {
        return false;
      }
      const arrowConfig = showArrow === true ? {} : showArrow;
      return {
        ...arrowConfig,
        className: clsx(arrowConfig.className, classNames?.arrow),
        style: {
          ...arrowConfig.style,
          ...styles?.arrow
        },
        content: arrowConfig.content ?? arrowContent
      };
    }, [showArrow, classNames?.arrow, styles?.arrow, arrowContent]);
    const getChildren = ({
      open: open2
    }) => {
      const child = React__namespace.Children.only(children);
      const ariaProps = {
        "aria-describedby": overlay && open2 ? mergedId : void 0
      };
      return React__namespace.cloneElement(child, ariaProps);
    };
    return React__namespace.createElement(Trigger, _extends$2({
      popupClassName: classNames?.root,
      prefixCls,
      popup: React__namespace.createElement(Popup, {
        key: "content",
        prefixCls,
        id: mergedId,
        classNames,
        styles
      }, overlay),
      action: trigger,
      builtinPlacements: placements,
      popupPlacement: placement,
      ref: triggerRef,
      popupAlign: align,
      getPopupContainer: getTooltipContainer,
      onOpenChange: onVisibleChange,
      afterOpenChange: afterVisibleChange,
      popupMotion: motion,
      defaultPopupVisible: defaultVisible,
      autoDestroy: destroyOnHidden,
      mouseLeaveDelay,
      popupStyle: styles?.root,
      mouseEnterDelay,
      arrow: mergedArrow,
      uniqueContainerClassName: classNames?.uniqueContainer,
      uniqueContainerStyle: styles?.uniqueContainer
    }, extraProps), getChildren);
  });
  function getArrowToken(token2) {
    const {
      sizePopupArrow,
      borderRadiusXS,
      borderRadiusOuter
    } = token2;
    const unitWidth = sizePopupArrow / 2;
    const ax = 0;
    const ay = unitWidth;
    const bx = borderRadiusOuter * 1 / Math.sqrt(2);
    const by = unitWidth - borderRadiusOuter * (1 - 1 / Math.sqrt(2));
    const cx = unitWidth - borderRadiusXS * (1 / Math.sqrt(2));
    const cy = borderRadiusOuter * (Math.sqrt(2) - 1) + borderRadiusXS * (1 / Math.sqrt(2));
    const dx = 2 * unitWidth - cx;
    const dy = cy;
    const ex = 2 * unitWidth - bx;
    const ey = by;
    const fx = 2 * unitWidth - ax;
    const fy = ay;
    const shadowWidth = unitWidth * Math.sqrt(2) + borderRadiusOuter * (Math.sqrt(2) - 2);
    const polygonOffset = borderRadiusOuter * (Math.sqrt(2) - 1);
    const arrowPolygon = `polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`;
    const arrowPath = `path('M ${ax} ${ay} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${borderRadiusXS} ${borderRadiusXS} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${borderRadiusOuter} ${borderRadiusOuter} 0 0 0 ${fx} ${fy} Z')`;
    return {
      arrowShadowWidth: shadowWidth,
      arrowPath,
      arrowPolygon
    };
  }
  const genRoundedArrow = (token2, bgColor, boxShadow) => {
    const {
      sizePopupArrow,
      arrowPolygon,
      arrowPath,
      arrowShadowWidth,
      borderRadiusXS,
      calc
    } = token2;
    return {
      pointerEvents: "none",
      width: sizePopupArrow,
      height: sizePopupArrow,
      overflow: "hidden",
      "&::before": {
        position: "absolute",
        bottom: 0,
        insetInlineStart: 0,
        width: sizePopupArrow,
        height: calc(sizePopupArrow).div(2).equal(),
        background: bgColor,
        clipPath: {
          _multi_value_: true,
          value: [arrowPolygon, arrowPath]
        },
        content: '""'
      },
      "&::after": {
        content: '""',
        position: "absolute",
        width: arrowShadowWidth,
        height: arrowShadowWidth,
        bottom: 0,
        insetInline: 0,
        margin: "auto",
        borderRadius: {
          _skip_check_: true,
          value: `0 0 ${unit$1(borderRadiusXS)} 0`
        },
        transform: "translateY(50%) rotate(-135deg)",
        boxShadow,
        zIndex: 0,
        background: "transparent"
      }
    };
  };
  const MAX_VERTICAL_CONTENT_RADIUS = 8;
  function getArrowOffsetToken(options) {
    const {
      contentRadius,
      limitVerticalRadius
    } = options;
    const arrowOffset = contentRadius > 12 ? contentRadius + 2 : 12;
    const arrowOffsetVertical = limitVerticalRadius ? MAX_VERTICAL_CONTENT_RADIUS : arrowOffset;
    return {
      arrowOffsetHorizontal: arrowOffset,
      arrowOffsetVertical
    };
  }
  function isInject(valid, code) {
    if (!valid) {
      return {};
    }
    return code;
  }
  const getArrowStyle = (token2, colorBg, options) => {
    const {
      componentCls,
      boxShadowPopoverArrow,
      arrowOffsetVertical,
      arrowOffsetHorizontal,
      antCls
    } = token2;
    const [varName] = genCssVar(antCls, "tooltip");
    const {
      arrowDistance = 0,
      arrowPlacement = {
        left: true,
        right: true,
        top: true,
        bottom: true
      }
    } = {};
    return {
      [componentCls]: {
[`${componentCls}-arrow`]: [{
          position: "absolute",
          zIndex: 1,
display: "block",
          ...genRoundedArrow(token2, colorBg, boxShadowPopoverArrow),
          "&:before": {
            background: colorBg
          }
        }],


...isInject(!!arrowPlacement.top, {
          [[`&-placement-top > ${componentCls}-arrow`, `&-placement-topLeft > ${componentCls}-arrow`, `&-placement-topRight > ${componentCls}-arrow`].join(",")]: {
            bottom: arrowDistance,
            transform: "translateY(100%) rotate(180deg)"
          },
          [`&-placement-top > ${componentCls}-arrow`]: {
            left: {
              _skip_check_: true,
              value: "50%"
            },
            transform: "translateX(-50%) translateY(100%) rotate(180deg)"
          },
          "&-placement-topLeft": {
            [varName("arrow-offset-x")]: arrowOffsetHorizontal,
            [`> ${componentCls}-arrow`]: {
              left: {
                _skip_check_: true,
                value: arrowOffsetHorizontal
              }
            }
          },
          "&-placement-topRight": {
            [varName("arrow-offset-x")]: `calc(100% - ${unit$1(arrowOffsetHorizontal)})`,
            [`> ${componentCls}-arrow`]: {
              right: {
                _skip_check_: true,
                value: arrowOffsetHorizontal
              }
            }
          }
        }),
...isInject(!!arrowPlacement.bottom, {
          [[`&-placement-bottom > ${componentCls}-arrow`, `&-placement-bottomLeft > ${componentCls}-arrow`, `&-placement-bottomRight > ${componentCls}-arrow`].join(",")]: {
            top: arrowDistance,
            transform: `translateY(-100%)`
          },
          [`&-placement-bottom > ${componentCls}-arrow`]: {
            left: {
              _skip_check_: true,
              value: "50%"
            },
            transform: `translateX(-50%) translateY(-100%)`
          },
          "&-placement-bottomLeft": {
            [varName("arrow-offset-x")]: arrowOffsetHorizontal,
            [`> ${componentCls}-arrow`]: {
              left: {
                _skip_check_: true,
                value: arrowOffsetHorizontal
              }
            }
          },
          "&-placement-bottomRight": {
            [varName("arrow-offset-x")]: `calc(100% - ${unit$1(arrowOffsetHorizontal)})`,
            [`> ${componentCls}-arrow`]: {
              right: {
                _skip_check_: true,
                value: arrowOffsetHorizontal
              }
            }
          }
        }),
...isInject(!!arrowPlacement.left, {
          [[`&-placement-left > ${componentCls}-arrow`, `&-placement-leftTop > ${componentCls}-arrow`, `&-placement-leftBottom > ${componentCls}-arrow`].join(",")]: {
            right: {
              _skip_check_: true,
              value: arrowDistance
            },
            transform: "translateX(100%) rotate(90deg)"
          },
          [`&-placement-left > ${componentCls}-arrow`]: {
            top: {
              _skip_check_: true,
              value: "50%"
            },
            transform: "translateY(-50%) translateX(100%) rotate(90deg)"
          },
          [`&-placement-leftTop > ${componentCls}-arrow`]: {
            top: arrowOffsetVertical
          },
          [`&-placement-leftBottom > ${componentCls}-arrow`]: {
            bottom: arrowOffsetVertical
          }
        }),
...isInject(!!arrowPlacement.right, {
          [[`&-placement-right > ${componentCls}-arrow`, `&-placement-rightTop > ${componentCls}-arrow`, `&-placement-rightBottom > ${componentCls}-arrow`].join(",")]: {
            left: {
              _skip_check_: true,
              value: arrowDistance
            },
            transform: "translateX(-100%) rotate(-90deg)"
          },
          [`&-placement-right > ${componentCls}-arrow`]: {
            top: {
              _skip_check_: true,
              value: "50%"
            },
            transform: "translateY(-50%) translateX(-100%) rotate(-90deg)"
          },
          [`&-placement-rightTop > ${componentCls}-arrow`]: {
            top: arrowOffsetVertical
          },
          [`&-placement-rightBottom > ${componentCls}-arrow`]: {
            bottom: arrowOffsetVertical
          }
        })
      }
    };
  };
  function getOverflowOptions(placement, arrowOffset, arrowWidth, autoAdjustOverflow) {
    if (autoAdjustOverflow === false) {
      return {
        adjustX: false,
        adjustY: false
      };
    }
    const overflow = autoAdjustOverflow && typeof autoAdjustOverflow === "object" ? autoAdjustOverflow : {};
    const baseOverflow = {};
    switch (placement) {
      case "top":
      case "bottom":
        baseOverflow.shiftX = arrowOffset.arrowOffsetHorizontal * 2 + arrowWidth;
        baseOverflow.shiftY = true;
        baseOverflow.adjustY = true;
        break;
      case "left":
      case "right":
        baseOverflow.shiftY = arrowOffset.arrowOffsetVertical * 2 + arrowWidth;
        baseOverflow.shiftX = true;
        baseOverflow.adjustX = true;
        break;
    }
    const mergedOverflow = {
      ...baseOverflow,
      ...overflow
    };
    if (!mergedOverflow.shiftX) {
      mergedOverflow.adjustX = true;
    }
    if (!mergedOverflow.shiftY) {
      mergedOverflow.adjustY = true;
    }
    return mergedOverflow;
  }
  const PlacementAlignMap = {
    left: {
      points: ["cr", "cl"]
    },
    right: {
      points: ["cl", "cr"]
    },
    top: {
      points: ["bc", "tc"]
    },
    bottom: {
      points: ["tc", "bc"]
    },
    topLeft: {
      points: ["bl", "tl"]
    },
    leftTop: {
      points: ["tr", "tl"]
    },
    topRight: {
      points: ["br", "tr"]
    },
    rightTop: {
      points: ["tl", "tr"]
    },
    bottomRight: {
      points: ["tr", "br"]
    },
    rightBottom: {
      points: ["bl", "br"]
    },
    bottomLeft: {
      points: ["tl", "bl"]
    },
    leftBottom: {
      points: ["br", "bl"]
    }
  };
  const ArrowCenterPlacementAlignMap = {
    topLeft: {
      points: ["bl", "tc"]
    },
    leftTop: {
      points: ["tr", "cl"]
    },
    topRight: {
      points: ["br", "tc"]
    },
    rightTop: {
      points: ["tl", "cr"]
    },
    bottomRight: {
      points: ["tr", "bc"]
    },
    rightBottom: {
      points: ["bl", "cr"]
    },
    bottomLeft: {
      points: ["tl", "bc"]
    },
    leftBottom: {
      points: ["br", "cl"]
    }
  };
  const DisableAutoArrowList = new Set(["topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]);
  function getPlacements(config) {
    const {
      arrowWidth,
      autoAdjustOverflow,
      arrowPointAtCenter,
      offset: offset2,
      borderRadius
    } = config;
    const halfArrowWidth = arrowWidth / 2;
    const placementMap = {};
    const arrowOffset = getArrowOffsetToken({
      contentRadius: borderRadius,
      limitVerticalRadius: true
    });
    Object.keys(PlacementAlignMap).forEach((key) => {
      const template = arrowPointAtCenter && ArrowCenterPlacementAlignMap[key] || PlacementAlignMap[key];
      const placementInfo = {
        ...template,
        offset: [0, 0],
        dynamicInset: true
      };
      placementMap[key] = placementInfo;
      if (DisableAutoArrowList.has(key)) {
        placementInfo.autoArrow = false;
      }
      switch (key) {
        case "top":
        case "topLeft":
        case "topRight":
          placementInfo.offset[1] = -halfArrowWidth - offset2;
          break;
        case "bottom":
        case "bottomLeft":
        case "bottomRight":
          placementInfo.offset[1] = halfArrowWidth + offset2;
          break;
        case "left":
        case "leftTop":
        case "leftBottom":
          placementInfo.offset[0] = -halfArrowWidth - offset2;
          break;
        case "right":
        case "rightTop":
        case "rightBottom":
          placementInfo.offset[0] = halfArrowWidth + offset2;
          break;
      }
      if (arrowPointAtCenter) {
        switch (key) {
          case "topLeft":
          case "bottomLeft":
            placementInfo.offset[0] = -arrowOffset.arrowOffsetHorizontal - halfArrowWidth;
            break;
          case "topRight":
          case "bottomRight":
            placementInfo.offset[0] = arrowOffset.arrowOffsetHorizontal + halfArrowWidth;
            break;
          case "leftTop":
          case "rightTop":
            placementInfo.offset[1] = -arrowOffset.arrowOffsetHorizontal * 2 + halfArrowWidth;
            break;
          case "leftBottom":
          case "rightBottom":
            placementInfo.offset[1] = arrowOffset.arrowOffsetHorizontal * 2 - halfArrowWidth;
            break;
        }
      }
      placementInfo.overflow = getOverflowOptions(key, arrowOffset, arrowWidth, autoAdjustOverflow);
      {
        placementInfo.htmlRegion = "visibleFirst";
      }
    });
    return placementMap;
  }
  const TableMeasureRowContext = React.createContext(false);
  const useMergedArrow = (providedArrow, providedContextArrow) => {
    const toConfig = (arrow) => typeof arrow === "boolean" ? {
      show: arrow
    } : arrow || {};
    return React.useMemo(() => {
      const arrowConfig = toConfig(providedArrow);
      const contextArrowConfig = toConfig(providedContextArrow);
      return {
        ...contextArrowConfig,
        ...arrowConfig,
        show: arrowConfig.show ?? contextArrowConfig.show ?? true
      };
    }, [providedArrow, providedContextArrow]);
  };
  const FALL_BACK_ORIGIN = "50%";
  const genTooltipStyle = (token2) => {
    const {
      calc,
      componentCls,
tooltipMaxWidth,
      tooltipColor,
      tooltipBg,
      tooltipBorderRadius,
      zIndexPopup,
      controlHeight,
      boxShadowSecondary,
      paddingSM,
      paddingXS,
      arrowOffsetHorizontal,
      sizePopupArrow,
      antCls
    } = token2;
    const [varName, varRef] = genCssVar(antCls, "tooltip");
    const edgeAlignMinWidth = calc(tooltipBorderRadius).add(sizePopupArrow).add(arrowOffsetHorizontal).equal();
    const centerAlignMinWidth = calc(tooltipBorderRadius).mul(2).add(sizePopupArrow).equal();
    const sharedBodyStyle = {
      minWidth: centerAlignMinWidth,
      minHeight: controlHeight,
      padding: `${unit$1(token2.calc(paddingSM).div(2).equal())} ${unit$1(paddingXS)}`,
      color: varRef("overlay-color", tooltipColor),
      textAlign: "start",
      textDecoration: "none",
      wordWrap: "break-word",
      backgroundColor: tooltipBg,
      borderRadius: tooltipBorderRadius,
      boxShadow: boxShadowSecondary,
      boxSizing: "border-box"
    };
    const sharedTransformOrigin = {
[varName("valid-offset-x")]: varRef("arrow-offset-x", "var(--arrow-x)"),
      transformOrigin: [varRef("valid-offset-x", FALL_BACK_ORIGIN), `var(--arrow-y, ${FALL_BACK_ORIGIN})`].join(" ")
    };
    return [
      {
        [componentCls]: {
          ...resetComponent(token2),
          position: "absolute",
          zIndex: zIndexPopup,
          display: "block",
          width: "max-content",
          maxWidth: tooltipMaxWidth,
          visibility: "visible",
          ...sharedTransformOrigin,
          "&-hidden": {
            display: "none"
          },
          [varName("arrow-background-color")]: tooltipBg,
[`${componentCls}-container`]: [sharedBodyStyle, initFadeMotion(token2, true)],
          [`&:has(~ ${componentCls}-unique-container)`]: {
            [`${componentCls}-container`]: {
              border: "none",
              background: "transparent",
              boxShadow: "none"
            }
          },
[[`&-placement-topLeft`, `&-placement-topRight`, `&-placement-bottomLeft`, `&-placement-bottomRight`].join(",")]: {
            minWidth: edgeAlignMinWidth
          },
[[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(",")]: {
            [`${componentCls}-inner`]: {
              borderRadius: token2.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)
            }
          },
          [`${componentCls}-content`]: {
            position: "relative"
          },
...genPresetColor(token2, (colorKey, {
            darkColor
          }) => ({
            [`&${componentCls}-${colorKey}`]: {
              [`${componentCls}-container`]: {
                backgroundColor: darkColor
              },
              [`${componentCls}-arrow`]: {
                [varName("arrow-background-color")]: darkColor
              }
            }
          })),
"&-rtl": {
            direction: "rtl"
          }
        }
      },
getArrowStyle(token2, varRef("arrow-background-color")),
{
        [`${componentCls}-pure`]: {
          position: "relative",
          maxWidth: "none",
          margin: token2.sizePopupArrow
        }
      },
{
        [`${componentCls}-unique-container`]: {
          ...sharedBodyStyle,
          ...sharedTransformOrigin,
          position: "absolute",
          zIndex: calc(zIndexPopup).sub(1).equal(),
          "&-hidden": {
            display: "none"
          },
          "&-visible": {
            transition: `all ${token2.motionDurationSlow}`
          }
        }
      }
    ];
  };
  const prepareComponentToken$1 = (token2) => ({
    zIndexPopup: token2.zIndexPopupBase + 70,
    maxWidth: 250,
    ...getArrowOffsetToken({
      contentRadius: token2.borderRadius,
      limitVerticalRadius: true
    }),
    ...getArrowToken(merge(token2, {
      borderRadiusOuter: Math.min(token2.borderRadiusOuter, 4)
    }))
  });
  const useStyle$1 = (prefixCls, rootCls, injectStyle = true) => {
    const useStyle2 = genStyleHooks("Tooltip", (token2) => {
      const {
        borderRadius,
        colorTextLightSolid,
        colorBgSpotlight,
        maxWidth
      } = token2;
      const TooltipToken = merge(token2, {
tooltipMaxWidth: maxWidth,
        tooltipColor: colorTextLightSolid,
        tooltipBorderRadius: borderRadius,
        tooltipBg: colorBgSpotlight
      });
      return [genTooltipStyle(TooltipToken), initZoomMotion(token2, "zoom-big-fast")];
    }, prepareComponentToken$1, {
      resetStyle: false,
injectStyle
    });
    return useStyle2(prefixCls, rootCls);
  };
  const inverseColors = PresetColors.map((color) => `${color}-inverse`);
  function isPresetColor(color, includeInverse = true) {
    if (includeInverse) {
      return [].concat(_toConsumableArray(inverseColors), _toConsumableArray(PresetColors)).includes(color);
    }
    return PresetColors.includes(color);
  }
  const parseColor = (rootPrefixCls, prefixCls, color) => {
    const isInternalColor = isPresetColor(color);
    const [varName] = genCssVar(rootPrefixCls, "tooltip");
    const className = clsx({
      [`${prefixCls}-${color}`]: color && isInternalColor
    });
    const overlayStyle = {};
    const arrowStyle = {};
    const rgb = generateColor(color).toRgb();
    const luminance = (0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b) / 255;
    const textColor = luminance < 0.5 ? "#FFF" : "#000";
    if (color && !isInternalColor) {
      overlayStyle.background = color;
      overlayStyle[varName("overlay-color")] = textColor;
      arrowStyle[varName("arrow-background-color")] = color;
    }
    return {
      className,
      overlayStyle,
      arrowStyle
    };
  };
  const PurePanel$2 = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      placement = "top",
      title,
      color,
      overlayInnerStyle,
      classNames,
      styles
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$1(prefixCls, rootCls);
    const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
    const arrowContentStyle = colorInfo.arrowStyle;
    const innerStyles = React__namespace.useMemo(() => {
      const mergedStyle = {
        ...overlayInnerStyle,
        ...colorInfo.overlayStyle
      };
      return {
        container: mergedStyle
      };
    }, [overlayInnerStyle, colorInfo.overlayStyle]);
    const mergedProps = {
      ...props,
      placement
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([classNames], [innerStyles, styles], {
      props: mergedProps
    });
    const rootClassName = clsx(rootCls, hashId, cssVarCls, prefixCls, `${prefixCls}-pure`, `${prefixCls}-placement-${placement}`, className, colorInfo.className);
    return React__namespace.createElement("div", {
      className: rootClassName,
      style: arrowContentStyle
    }, React__namespace.createElement("div", {
      className: `${prefixCls}-arrow`
    }), React__namespace.createElement(Popup, {
      ...props,
      className: hashId,
      prefixCls,
      classNames: mergedClassNames,
      styles: mergedStyles
    }, title));
  };
  const InternalTooltip = React__namespace.forwardRef((props, ref) => {
    const {
      prefixCls: customizePrefixCls,
      openClassName,
      getTooltipContainer,
      color,
      children,
      afterOpenChange,
      arrow: tooltipArrow,
      destroyTooltipOnHide,
      destroyOnHidden,
      title,
      overlay,
      trigger,
      builtinPlacements,
      autoAdjustOverflow = true,
      motion,
      getPopupContainer,
      placement = "top",
      mouseEnterDelay = 0.1,
      mouseLeaveDelay = 0.1,
      rootClassName,
      styles,
      classNames,
      onOpenChange,
overlayInnerStyle,
      overlayStyle,
      overlayClassName,
      ...restProps
    } = props;
    const [, token2] = useToken();
    const {
      getPopupContainer: getContextPopupContainer,
      getPrefixCls,
      direction,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles,
      arrow: contextArrow,
      trigger: contextTrigger
    } = useComponentConfig("tooltip");
    const mergedArrow = useMergedArrow(tooltipArrow, contextArrow);
    const mergedShowArrow = mergedArrow.show;
    const mergedTrigger = trigger || contextTrigger || "hover";
    const mergedGetPopupContainer = getPopupContainer || getContextPopupContainer;
    const mergedDestroyOnHidden = destroyOnHidden ?? !!destroyTooltipOnHide;
    const inTableMeasureRow = React__namespace.useContext(TableMeasureRowContext);
    const tooltipRef = React__namespace.useRef(null);
    const forceAlign = () => {
      tooltipRef.current?.forceAlign();
    };
    React__namespace.useImperativeHandle(ref, () => ({
      forceAlign,
      nativeElement: tooltipRef.current?.nativeElement,
      popupElement: tooltipRef.current?.popupElement
    }));
    const [open2, setOpen] = useControlledState(props.defaultOpen ?? false, props.open);
    const noTitle = !title && !overlay && title !== 0;
    const onInternalOpenChange = (vis) => {
      setOpen(noTitle ? false : vis);
      if (!noTitle && onOpenChange) {
        onOpenChange(vis);
      }
    };
    const tooltipPlacements = React__namespace.useMemo(() => {
      return builtinPlacements || getPlacements({
        arrowPointAtCenter: mergedArrow?.pointAtCenter ?? false,
        autoAdjustOverflow,
        arrowWidth: mergedShowArrow ? token2.sizePopupArrow : 0,
        borderRadius: token2.borderRadius,
        offset: token2.marginXXS
      });
    }, [mergedArrow, builtinPlacements, token2, mergedShowArrow, autoAdjustOverflow]);
    const memoOverlay = React__namespace.useMemo(() => {
      if (title === 0) {
        return title;
      }
      return overlay || title || "";
    }, [overlay, title]);
    const memoOverlayWrapper = React__namespace.createElement(ContextIsolator, {
      space: true,
      form: true
    }, typeof memoOverlay === "function" ? memoOverlay() : memoOverlay);
    const mergedProps = {
      ...props,
      trigger: mergedTrigger,
      builtinPlacements: tooltipPlacements,
      getPopupContainer: mergedGetPopupContainer,
      destroyOnHidden: mergedDestroyOnHidden
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
      props: mergedProps
    });
    const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const injectFromPopover = props["data-popover-inject"];
    let tempOpen = open2;
    if (!("open" in props) && noTitle || inTableMeasureRow) {
      tempOpen = false;
    }
    const child = React__namespace.isValidElement(children) && !isFragment(children) ? children : React__namespace.createElement("span", null, children);
    const childProps = child.props;
    const childCls = !childProps.className || typeof childProps.className === "string" ? clsx(childProps.className, openClassName || `${prefixCls}-open`) : childProps.className;
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$1(prefixCls, rootCls, !injectFromPopover);
    const colorInfo = parseColor(rootPrefixCls, prefixCls, color);
    const arrowContentStyle = colorInfo.arrowStyle;
    const themeCls = clsx(rootCls, hashId, cssVarCls);
    const rootClassNames = clsx(overlayClassName, {
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, colorInfo.className, rootClassName, themeCls, contextClassName, mergedClassNames.root);
    const [zIndex, contextZIndex] = useZIndex("Tooltip", restProps.zIndex);
    const containerStyle = {
      ...mergedStyles.container,
      ...overlayInnerStyle,
      ...colorInfo.overlayStyle
    };
    const content = React__namespace.createElement(Tooltip$1, {
      unique: true,
      ...restProps,
      zIndex,
      showArrow: mergedShowArrow,
      placement,
      mouseEnterDelay,
      mouseLeaveDelay,
      prefixCls,
      classNames: {
        root: rootClassNames,
        container: mergedClassNames.container,
        arrow: mergedClassNames.arrow,
        uniqueContainer: clsx(themeCls, mergedClassNames.container)
      },
      styles: {
        root: {
          ...arrowContentStyle,
          ...mergedStyles.root,
          ...contextStyle,
          ...overlayStyle
        },
        container: containerStyle,
        uniqueContainer: containerStyle,
        arrow: mergedStyles.arrow
      },
      ref: tooltipRef,
      overlay: memoOverlayWrapper,
      visible: tempOpen,
      onVisibleChange: onInternalOpenChange,
      afterVisibleChange: afterOpenChange,
      arrowContent: React__namespace.createElement("span", {
        className: `${prefixCls}-arrow-content`
      }),
      motion: {
        motionName: getTransitionName(rootPrefixCls, "zoom-big-fast", typeof motion?.motionName === "string" ? motion?.motionName : void 0),
        motionDeadline: 1e3
      },
      trigger: mergedTrigger,
      builtinPlacements: tooltipPlacements,
      getTooltipContainer: mergedGetPopupContainer,
      destroyOnHidden: mergedDestroyOnHidden
    }, tempOpen ? cloneElement(child, {
      className: childCls
    }) : child);
    return React__namespace.createElement(ZIndexContext.Provider, {
      value: contextZIndex
    }, content);
  });
  const Tooltip = InternalTooltip;
  Tooltip._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$2;
  Tooltip.UniqueProvider = UniqueProvider;
  const RadioGroupContext = React__namespace.createContext(void 0);
  const RadioGroupContextProvider = RadioGroupContext.Provider;
  const RadioOptionTypeContext = React__namespace.createContext(void 0);
  const RadioOptionTypeContextProvider = RadioOptionTypeContext.Provider;
  function _extends$1() {
    _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$1.apply(this, arguments);
  }
  const Checkbox = React.forwardRef((props, ref) => {
    const {
      prefixCls = "rc-checkbox",
      className,
      style: style2,
      checked,
      disabled,
      defaultChecked = false,
      type: type4 = "checkbox",
      title,
      onChange,
      ...inputProps
    } = props;
    const inputRef = React.useRef(null);
    const holderRef = React.useRef(null);
    const [rawValue, setRawValue] = useControlledState(defaultChecked, checked);
    React.useImperativeHandle(ref, () => ({
      focus: (options) => {
        inputRef.current?.focus(options);
      },
      blur: () => {
        inputRef.current?.blur();
      },
      input: inputRef.current,
      nativeElement: holderRef.current
    }));
    const classString = clsx(prefixCls, className, {
      [`${prefixCls}-checked`]: rawValue,
      [`${prefixCls}-disabled`]: disabled
    });
    const handleChange = (e2) => {
      if (disabled) {
        return;
      }
      if (!("checked" in props)) {
        setRawValue(e2.target.checked);
      }
      onChange?.({
        target: {
          ...props,
          type: type4,
          checked: e2.target.checked
        },
        stopPropagation() {
          e2.stopPropagation();
        },
        preventDefault() {
          e2.preventDefault();
        },
        nativeEvent: e2.nativeEvent
      });
    };
    return React__namespace.createElement("span", {
      className: classString,
      title,
      style: style2,
      ref: holderRef
    }, React__namespace.createElement("input", _extends$1({}, inputProps, {
      className: `${prefixCls}-input`,
      ref: inputRef,
      onChange: handleChange,
      disabled,
      checked: !!rawValue,
      type: type4
    })));
  });
  function useBubbleLock(onOriginInputClick) {
    const labelClickLockRef = React.useRef(null);
    const clearLock = () => {
      wrapperRaf.cancel(labelClickLockRef.current);
      labelClickLockRef.current = null;
    };
    const onLabelClick = () => {
      clearLock();
      labelClickLockRef.current = wrapperRaf(() => {
        labelClickLockRef.current = null;
      });
    };
    const onInputClick = (e2) => {
      if (labelClickLockRef.current) {
        e2.stopPropagation();
        clearLock();
      }
      onOriginInputClick?.(e2);
    };
    return [onLabelClick, onInputClick];
  }
  const getGroupRadioStyle = (token2) => {
    const {
      componentCls,
      antCls
    } = token2;
    const groupPrefixCls = `${componentCls}-group`;
    return {
      [groupPrefixCls]: {
        ...resetComponent(token2),
        display: "inline-block",
        fontSize: 0,
[`&${groupPrefixCls}-rtl`]: {
          direction: "rtl"
        },
        [`&${groupPrefixCls}-block`]: {
          display: "flex"
        },
        [`${antCls}-badge ${antCls}-badge-count`]: {
          zIndex: 1
        },
        [`> ${antCls}-badge:not(:first-child) > ${antCls}-button-wrapper`]: {
          borderInlineStart: "none"
        },
        "&-vertical": {
          display: "flex",
          flexDirection: "column",
          rowGap: token2.marginXS,
          [`${componentCls}-wrapper`]: {
            marginInlineEnd: 0
          }
        }
      }
    };
  };
  const getRadioBasicStyle = (token2) => {
    const {
      componentCls,
      wrapperMarginInlineEnd,
      colorPrimary,
      colorPrimaryHover,
      radioSize,
      motionDurationSlow,
      motionDurationMid,
      motionEaseInOutCirc,
      colorBgContainer,
      colorBorder,
      lineWidth,
      colorBgContainerDisabled,
      colorTextDisabled,
      paddingXS,
      dotColorDisabled,
      dotSize,
      lineType,
      radioColor,
      radioBgColor
    } = token2;
    return {
      [`${componentCls}-wrapper`]: {
        ...resetComponent(token2),
        display: "inline-flex",
        alignItems: "baseline",
        marginInlineStart: 0,
        marginInlineEnd: wrapperMarginInlineEnd,
        cursor: "pointer",
        "&:last-child": {
          marginInlineEnd: 0
        },
[`&${componentCls}-wrapper-rtl`]: {
          direction: "rtl"
        },
        "&-disabled": {
          cursor: "not-allowed",
          color: token2.colorTextDisabled
        },
        "&::after": {
          display: "inline-block",
          width: 0,
          overflow: "hidden",
          content: '"\\a0"'
        },
        "&-block": {
          flex: 1,
          justifyContent: "center"
        },
[componentCls]: {
          ...resetComponent(token2),
          position: "relative",
          whiteSpace: "nowrap",
          lineHeight: 1,
          cursor: "pointer",
          alignSelf: "center",
boxSizing: "border-box",
          display: "block",
          width: `calc(${radioSize} * 1px)`,
          height: `calc(${radioSize} * 1px)`,
          backgroundColor: colorBgContainer,
          border: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
          borderRadius: "50%",
          transition: `all ${motionDurationMid}`,
          flex: "none",
"&:after": {
            content: '""',
            position: "absolute",
            top: "50%",
            left: "50%",
            transform: "translate(-50%, -50%) scale(0)",
            width: `calc(${dotSize} * 1px)`,
            height: `calc(${dotSize} * 1px)`,
            backgroundColor: radioColor,
            borderRadius: "50%",
            transformOrigin: "50% 50%",
            opacity: 0,
            transition: `all ${motionDurationSlow} ${motionEaseInOutCirc}`
          },
[`${componentCls}-input`]: {
            position: "absolute",
            inset: 0,
            zIndex: 1,
            cursor: "pointer",
            opacity: 0,
            margin: 0
          },
[`&:has(${componentCls}-input:focus-visible)`]: genFocusOutline(token2)
        },
[`&:hover ${componentCls}`]: {
          borderColor: colorPrimary
        },
        [`&:hover ${componentCls}-checked:not(${componentCls}-disabled)`]: {
          backgroundColor: colorPrimaryHover,
          borderColor: "transparent"
        },
[`${componentCls}-checked`]: {
          backgroundColor: radioBgColor,
          borderColor: colorPrimary,
          "&::after": {
            transform: `translate(-50%, -50%)`,
            opacity: 1
          }
        },
[`${componentCls}-disabled`]: {
[`&, ${componentCls}-input`]: {
            cursor: "not-allowed",
pointerEvents: "none"
          },
background: colorBgContainerDisabled,
          borderColor: colorBorder,
          "&::after": {
            backgroundColor: dotColorDisabled
          }
        },
        [`${componentCls}-disabled + span`]: {
          color: colorTextDisabled,
          cursor: "not-allowed"
        },
        [`span${componentCls} + *`]: {
          paddingInlineStart: paddingXS,
          paddingInlineEnd: paddingXS
        }
      }
    };
  };
  const getRadioButtonStyle = (token2) => {
    const {
      buttonColor,
      controlHeight,
      componentCls,
      lineWidth,
      lineType,
      colorBorder,
      motionDurationMid,
      buttonPaddingInline,
      fontSize,
      buttonBg,
      fontSizeLG,
      controlHeightLG,
      controlHeightSM,
      paddingXS,
      borderRadius,
      borderRadiusSM,
      borderRadiusLG,
      buttonCheckedBg,
      buttonSolidCheckedColor,
      colorTextDisabled,
      colorBgContainerDisabled,
      buttonCheckedBgDisabled,
      buttonCheckedColorDisabled,
      colorPrimary,
      colorPrimaryHover,
      colorPrimaryActive,
      buttonSolidCheckedBg,
      buttonSolidCheckedHoverBg,
      buttonSolidCheckedActiveBg,
      calc
    } = token2;
    return {
      [`${componentCls}-button-wrapper`]: {
        position: "relative",
        display: "inline-block",
        height: controlHeight,
        margin: 0,
        paddingInline: buttonPaddingInline,
        paddingBlock: 0,
        color: buttonColor,
        fontSize,
        lineHeight: unit$1(calc(controlHeight).sub(calc(lineWidth).mul(2)).equal()),
        background: buttonBg,
        border: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,

borderBlockStartWidth: calc(lineWidth).add(0.02).equal(),
        borderInlineEndWidth: lineWidth,
        cursor: "pointer",
        transition: [`color`, `background-color`, `box-shadow`].map((prop) => `${prop} ${motionDurationMid}`).join(","),
        a: {
          color: buttonColor
        },
        [`> ${componentCls}-button`]: {
          position: "absolute",
          insetBlockStart: 0,
          insetInlineStart: 0,
          zIndex: -1,
          width: "100%",
          height: "100%"
        },
        "&:not(:last-child)": {
          marginInlineEnd: calc(lineWidth).mul(-1).equal()
        },
        "&:first-child": {
          borderInlineStart: `${unit$1(lineWidth)} ${lineType} ${colorBorder}`,
          borderStartStartRadius: borderRadius,
          borderEndStartRadius: borderRadius
        },
        "&:last-child": {
          borderStartEndRadius: borderRadius,
          borderEndEndRadius: borderRadius
        },
        "&:first-child:last-child": {
          borderRadius
        },
        [`${componentCls}-group-large &`]: {
          height: controlHeightLG,
          fontSize: fontSizeLG,
          lineHeight: unit$1(calc(controlHeightLG).sub(calc(lineWidth).mul(2)).equal()),
          "&:first-child": {
            borderStartStartRadius: borderRadiusLG,
            borderEndStartRadius: borderRadiusLG
          },
          "&:last-child": {
            borderStartEndRadius: borderRadiusLG,
            borderEndEndRadius: borderRadiusLG
          }
        },
        [`${componentCls}-group-small &`]: {
          height: controlHeightSM,
          paddingInline: calc(paddingXS).sub(lineWidth).equal(),
          paddingBlock: 0,
          lineHeight: unit$1(calc(controlHeightSM).sub(calc(lineWidth).mul(2)).equal()),
          "&:first-child": {
            borderStartStartRadius: borderRadiusSM,
            borderEndStartRadius: borderRadiusSM
          },
          "&:last-child": {
            borderStartEndRadius: borderRadiusSM,
            borderEndEndRadius: borderRadiusSM
          }
        },
        "&:hover": {
          position: "relative",
          color: colorPrimary
        },
        "&:has(:focus-visible)": genFocusOutline(token2),
        [`${componentCls}, input[type='checkbox'], input[type='radio']`]: {
          width: 0,
          height: 0,
          opacity: 0,
          pointerEvents: "none"
        },
        [`&-checked:not(${componentCls}-button-wrapper-disabled)`]: {
          zIndex: 1,
          color: colorPrimary,
          background: buttonCheckedBg,
          borderColor: colorPrimary,
          "&::before": {
            backgroundColor: colorPrimary
          },
          "&:first-child": {
            borderColor: colorPrimary
          },
          "&:hover": {
            color: colorPrimaryHover,
            borderColor: colorPrimaryHover,
            "&::before": {
              backgroundColor: colorPrimaryHover
            }
          },
          "&:active": {
            color: colorPrimaryActive,
            borderColor: colorPrimaryActive,
            "&::before": {
              backgroundColor: colorPrimaryActive
            }
          }
        },
        [`${componentCls}-group-solid &-checked:not(${componentCls}-button-wrapper-disabled)`]: {
          color: buttonSolidCheckedColor,
          background: buttonSolidCheckedBg,
          borderColor: buttonSolidCheckedBg,
          "&:hover": {
            color: buttonSolidCheckedColor,
            background: buttonSolidCheckedHoverBg,
            borderColor: buttonSolidCheckedHoverBg
          },
          "&:active": {
            color: buttonSolidCheckedColor,
            background: buttonSolidCheckedActiveBg,
            borderColor: buttonSolidCheckedActiveBg
          }
        },
        "&-disabled": {
          color: colorTextDisabled,
          backgroundColor: colorBgContainerDisabled,
          borderColor: colorBorder,
          cursor: "not-allowed",
          "&:first-child, &:hover": {
            color: colorTextDisabled,
            backgroundColor: colorBgContainerDisabled,
            borderColor: colorBorder
          }
        },
        [`&-disabled${componentCls}-button-wrapper-checked`]: {
          color: buttonCheckedColorDisabled,
          backgroundColor: buttonCheckedBgDisabled,
          borderColor: colorBorder,
          boxShadow: "none"
        },
        "&-block": {
          flex: 1,
          textAlign: "center"
        }
      }
    };
  };
  const prepareComponentToken = (token2) => {
    const {
      wireframe,
      padding,
      marginXS,
      lineWidth,
      fontSizeLG,
      colorText,
      colorBgContainer,
      colorTextDisabled,
      controlItemBgActiveDisabled,
      colorTextLightSolid,
      colorPrimary,
      colorPrimaryHover,
      colorPrimaryActive,
      colorWhite
    } = token2;
    const dotPadding = 4;
    const radioSize = fontSizeLG;
    const radioDotSize = wireframe ? radioSize - dotPadding * 2 : radioSize - (dotPadding + lineWidth) * 2;
    return {
radioSize,
      dotSize: radioDotSize,
      dotColorDisabled: colorTextDisabled,
buttonSolidCheckedColor: colorTextLightSolid,
      buttonSolidCheckedBg: colorPrimary,
      buttonSolidCheckedHoverBg: colorPrimaryHover,
      buttonSolidCheckedActiveBg: colorPrimaryActive,
      buttonBg: colorBgContainer,
      buttonCheckedBg: colorBgContainer,
      buttonColor: colorText,
      buttonCheckedBgDisabled: controlItemBgActiveDisabled,
      buttonCheckedColorDisabled: colorTextDisabled,
      buttonPaddingInline: padding - lineWidth,
      wrapperMarginInlineEnd: marginXS,
radioColor: wireframe ? colorPrimary : colorWhite,
      radioBgColor: wireframe ? colorBgContainer : colorPrimary
    };
  };
  const useStyle = genStyleHooks("Radio", (token2) => {
    const {
      controlOutline,
      controlOutlineWidth
    } = token2;
    const radioFocusShadow = `0 0 0 ${unit$1(controlOutlineWidth)} ${controlOutline}`;
    const radioButtonFocusShadow = radioFocusShadow;
    const radioToken = merge(token2, {
      radioFocusShadow,
      radioButtonFocusShadow
    });
    return [getGroupRadioStyle(radioToken), getRadioBasicStyle(radioToken), getRadioButtonStyle(radioToken)];
  }, prepareComponentToken, {
    unitless: {
      radioSize: true,
      dotSize: true
    }
  });
  const InternalRadio = (props, ref) => {
    const groupContext = React__namespace.useContext(RadioGroupContext);
    const radioOptionTypeContext = React__namespace.useContext(RadioOptionTypeContext);
    const {
      getPrefixCls,
      direction,
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles
    } = useComponentConfig("radio");
    const innerRef = React__namespace.useRef(null);
    const mergedRef = composeRef(ref, innerRef);
    const {
      isFormItemInput
    } = React__namespace.useContext(FormItemInputContext);
    const onChange = (e2) => {
      props.onChange?.(e2);
      groupContext?.onChange?.(e2);
    };
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      children,
      style: style2,
      title,
      classNames,
      styles,
      ...restProps
    } = props;
    const radioPrefixCls = getPrefixCls("radio", customizePrefixCls);
    const isButtonType = (groupContext?.optionType || radioOptionTypeContext) === "button";
    const prefixCls = isButtonType ? `${radioPrefixCls}-button` : radioPrefixCls;
    const rootCls = useCSSVarCls(radioPrefixCls);
    const [hashId, cssVarCls] = useStyle(radioPrefixCls, rootCls);
    const radioProps = {
      ...restProps
    };
    const disabled = React__namespace.useContext(DisabledContext);
    let mergedChecked = radioProps.checked;
    if (groupContext) {
      radioProps.name = groupContext.name;
      radioProps.onChange = onChange;
      mergedChecked = props.value === groupContext.value;
      radioProps.disabled = radioProps.disabled ?? groupContext.disabled;
    }
    radioProps.disabled = radioProps.disabled ?? disabled;
    const mergedProps = {
      ...props,
      ...radioProps,
      checked: mergedChecked
    };
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
      props: mergedProps
    });
    const wrapperClassString = clsx(`${prefixCls}-wrapper`, {
      [`${prefixCls}-wrapper-checked`]: mergedChecked,
      [`${prefixCls}-wrapper-disabled`]: radioProps.disabled,
      [`${prefixCls}-wrapper-rtl`]: direction === "rtl",
      [`${prefixCls}-wrapper-in-form-item`]: isFormItemInput,
      [`${prefixCls}-wrapper-block`]: !!groupContext?.block
    }, contextClassName, className, rootClassName, mergedClassNames.root, hashId, cssVarCls, rootCls);
    const [onLabelClick, onInputClick] = useBubbleLock(radioProps.onClick);
    return React__namespace.createElement(Wave, {
      component: "Radio",
      disabled: radioProps.disabled
    }, React__namespace.createElement("label", {
      className: wrapperClassString,
      style: {
        ...mergedStyles.root,
        ...contextStyle,
        ...style2
      },
      onMouseEnter: props.onMouseEnter,
      onMouseLeave: props.onMouseLeave,
      title,
      onClick: onLabelClick
    }, React__namespace.createElement(Checkbox, {
      ...radioProps,
      checked: mergedChecked,
      className: clsx(mergedClassNames.icon, {
        [TARGET_CLS]: !isButtonType
      }),
      style: mergedStyles.icon,
      type: "radio",
      prefixCls,
      ref: mergedRef,
      onClick: onInputClick
    }), children !== void 0 ? React__namespace.createElement("span", {
      className: clsx(`${prefixCls}-label`, mergedClassNames.label),
      style: mergedStyles.label
    }, children) : null));
  };
  const Radio$1 = React__namespace.forwardRef(InternalRadio);
  const RadioGroup = React__namespace.forwardRef((props, ref) => {
    const {
      getPrefixCls,
      direction
    } = React__namespace.useContext(ConfigContext);
    const {
      name: formItemName
    } = React__namespace.useContext(FormItemInputContext);
    const defaultName = useId(toNamePathStr(formItemName));
    const {
      prefixCls: customizePrefixCls,
      className,
      rootClassName,
      options,
      buttonStyle = "outline",
      disabled,
      children,
      size: customizeSize,
      style: style2,
      id,
      optionType,
      name = defaultName,
      defaultValue,
      value: customizedValue,
      block = false,
      onChange,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur,
      orientation,
      vertical,
      role = "radiogroup"
    } = props;
    const [value, setValue] = useControlledState(defaultValue, customizedValue);
    const onRadioChange = React__namespace.useCallback((event) => {
      const lastValue = value;
      const val = event.target.value;
      if (!("value" in props)) {
        setValue(val);
      }
      if (val !== lastValue) {
        onChange?.(event);
      }
    }, [value, setValue, onChange]);
    const prefixCls = getPrefixCls("radio", customizePrefixCls);
    const groupPrefixCls = `${prefixCls}-group`;
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle(prefixCls, rootCls);
    let childrenToRender = children;
    if (options && options.length > 0) {
      childrenToRender = options.map((option) => {
        if (typeof option === "string" || typeof option === "number") {
          return React__namespace.createElement(Radio$1, {
            key: option.toString(),
            prefixCls,
            disabled,
            value: option,
            checked: value === option
          }, option);
        }
        return React__namespace.createElement(Radio$1, {
          key: `radio-group-value-options-${option.value}`,
          prefixCls,
          disabled: option.disabled || disabled,
          value: option.value,
          checked: value === option.value,
          title: option.title,
          style: option.style,
          className: option.className,
          id: option.id,
          required: option.required
        }, option.label);
      });
    }
    const mergedSize = useSize(customizeSize);
    const [, mergedVertical] = useOrientation(orientation, vertical);
    const classString = clsx(groupPrefixCls, `${groupPrefixCls}-${buttonStyle}`, {
      [`${groupPrefixCls}-large`]: mergedSize === "large",
      [`${groupPrefixCls}-small`]: mergedSize === "small",
      [`${groupPrefixCls}-rtl`]: direction === "rtl",
      [`${groupPrefixCls}-block`]: block
    }, className, rootClassName, hashId, cssVarCls, rootCls);
    const memoizedValue = React__namespace.useMemo(() => ({
      onChange: onRadioChange,
      value,
      disabled,
      name,
      optionType,
      block
    }), [onRadioChange, value, disabled, name, optionType, block]);
    return React__namespace.createElement("div", {
      ...pickAttrs(props, {
        aria: true,
        data: true
      }),
      role,
      className: clsx(classString, {
        [`${prefixCls}-group-vertical`]: mergedVertical
      }),
      style: style2,
      onMouseEnter,
      onMouseLeave,
      onFocus,
      onBlur,
      id,
      ref
    }, React__namespace.createElement(RadioGroupContextProvider, {
      value: memoizedValue
    }, childrenToRender));
  });
  const Group = React__namespace.memo(RadioGroup);
  const RadioButton = (props, ref) => {
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const {
      prefixCls: customizePrefixCls,
      ...radioProps
    } = props;
    const prefixCls = getPrefixCls("radio", customizePrefixCls);
    return React__namespace.createElement(RadioOptionTypeContextProvider, {
      value: "button"
    }, React__namespace.createElement(Radio$1, {
      prefixCls,
      ...radioProps,
      type: "radio",
      ref
    }));
  };
  const Button = React__namespace.forwardRef(RadioButton);
  const Radio = Radio$1;
  Radio.Button = Button;
  Radio.Group = Group;
  Radio.__ANT_RADIO = true;
  const RowContext = React.createContext({});
  const isNumber = (value) => {
    return typeof value === "number" && !Number.isNaN(value);
  };
  function parseFlex(flex) {
    if (flex === "auto") {
      return "1 1 auto";
    }
    if (isNumber(flex)) {
      return `${flex} ${flex} auto`;
    }
    if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
      return `0 0 ${flex}`;
    }
    return flex;
  }
  const Col = React__namespace.forwardRef((props, ref) => {
    const {
      getPrefixCls,
      direction
    } = React__namespace.useContext(ConfigContext);
    const {
      gutter,
      wrap
    } = React__namespace.useContext(RowContext);
    const {
      prefixCls: customizePrefixCls,
      span,
      order,
      offset: offset2,
      push,
      pull,
      className,
      children,
      flex,
      style: style2,
      ...others
    } = props;
    const prefixCls = getPrefixCls("col", customizePrefixCls);
    const rootPrefixCls = getPrefixCls();
    const [hashId, cssVarCls] = useColStyle(prefixCls);
    const [varName] = genCssVar(rootPrefixCls, "col");
    const sizeStyle = {};
    let sizeClassObj = {};
    responsiveArrayReversed.forEach((size) => {
      let sizeProps = {};
      const propSize = props[size];
      if (typeof propSize === "number") {
        sizeProps.span = propSize;
      } else if (typeof propSize === "object") {
        sizeProps = propSize || {};
      }
      delete others[size];
      sizeClassObj = {
        ...sizeClassObj,
        [`${prefixCls}-${size}-${sizeProps.span}`]: sizeProps.span !== void 0,
        [`${prefixCls}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
        [`${prefixCls}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
        [`${prefixCls}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
        [`${prefixCls}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
        [`${prefixCls}-rtl`]: direction === "rtl"
      };
      if (sizeProps.flex) {
        sizeClassObj[`${prefixCls}-${size}-flex`] = true;
        sizeStyle[varName(`${size}-flex`)] = parseFlex(sizeProps.flex);
      }
    });
    const classes = clsx(prefixCls, {
      [`${prefixCls}-${span}`]: span !== void 0,
      [`${prefixCls}-order-${order}`]: order,
      [`${prefixCls}-offset-${offset2}`]: offset2,
      [`${prefixCls}-push-${push}`]: push,
      [`${prefixCls}-pull-${pull}`]: pull
    }, className, sizeClassObj, hashId, cssVarCls);
    const mergedStyle = {};
    if (gutter?.[0]) {
      const horizontalGutter = typeof gutter[0] === "number" ? `${gutter[0] / 2}px` : `calc(${gutter[0]} / 2)`;
      mergedStyle.paddingInline = horizontalGutter;
    }
    if (flex) {
      mergedStyle.flex = parseFlex(flex);
      if (wrap === false && !mergedStyle.minWidth) {
        mergedStyle.minWidth = 0;
      }
    }
    return React__namespace.createElement("div", {
      ...others,
      style: {
        ...mergedStyle,
        ...style2,
        ...sizeStyle
      },
      className: classes,
      ref
    }, children);
  });
  function useGutter(gutter, screens) {
    const results = [void 0, void 0];
    const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, void 0];
    const mergedScreens = screens || {
      xs: true,
      sm: true,
      md: true,
      lg: true,
      xl: true,
      xxl: true,
      xxxl: true
    };
    normalizedGutter.forEach((g, index) => {
      if (typeof g === "object" && g !== null) {
        for (let i = 0; i < responsiveArray.length; i++) {
          const breakpoint = responsiveArray[i];
          if (mergedScreens[breakpoint] && g[breakpoint] !== void 0) {
            results[index] = g[breakpoint];
            break;
          }
        }
      } else {
        results[index] = g;
      }
    });
    return results;
  }
  function useMergedPropByScreen(oriProp, screen) {
    const [prop, setProp] = React__namespace.useState(typeof oriProp === "string" ? oriProp : "");
    const calcMergedAlignOrJustify = () => {
      if (typeof oriProp === "string") {
        setProp(oriProp);
      }
      if (typeof oriProp !== "object") {
        return;
      }
      for (let i = 0; i < responsiveArray.length; i++) {
        const breakpoint = responsiveArray[i];
        if (!screen || !screen[breakpoint]) {
          continue;
        }
        const curVal = oriProp[breakpoint];
        if (curVal !== void 0) {
          setProp(curVal);
          return;
        }
      }
    };
    React__namespace.useEffect(() => {
      calcMergedAlignOrJustify();
    }, [JSON.stringify(oriProp), screen]);
    return prop;
  }
  const Row = React__namespace.forwardRef((props, ref) => {
    const {
      prefixCls: customizePrefixCls,
      justify,
      align,
      className,
      style: style2,
      children,
      gutter = 0,
      wrap,
      ...others
    } = props;
    const {
      getPrefixCls,
      direction
    } = React__namespace.useContext(ConfigContext);
    const screens = useBreakpoint(true, null);
    const mergedAlign = useMergedPropByScreen(align, screens);
    const mergedJustify = useMergedPropByScreen(justify, screens);
    const prefixCls = getPrefixCls("row", customizePrefixCls);
    const [hashId, cssVarCls] = useRowStyle(prefixCls);
    const gutters = useGutter(gutter, screens);
    const classes = clsx(prefixCls, {
      [`${prefixCls}-no-wrap`]: wrap === false,
      [`${prefixCls}-${mergedJustify}`]: mergedJustify,
      [`${prefixCls}-${mergedAlign}`]: mergedAlign,
      [`${prefixCls}-rtl`]: direction === "rtl"
    }, className, hashId, cssVarCls);
    const rowStyle = {};
    if (gutters?.[0]) {
      const horizontalGutter = typeof gutters[0] === "number" ? `${gutters[0] / -2}px` : `calc(${gutters[0]} / -2)`;
      rowStyle.marginInline = horizontalGutter;
    }
    const [gutterH, gutterV] = gutters;
    rowStyle.rowGap = gutterV;
    const rowContext = React__namespace.useMemo(() => ({
      gutter: [gutterH, gutterV],
      wrap
    }), [gutterH, gutterV, wrap]);
    return React__namespace.createElement(RowContext.Provider, {
      value: rowContext
    }, React__namespace.createElement("div", {
      ...others,
      className: classes,
      style: {
        ...rowStyle,
        ...style2
      },
      ref
    }, children));
  });
  const convertToTooltipProps = (tooltip, context) => {
    if (!isNonNullable$1(tooltip)) {
      return null;
    }
    if (typeof tooltip === "object" && ! React.isValidElement(tooltip)) {
      return {
        ...context,
        ...tooltip
      };
    }
    return {
      ...context,
      title: tooltip
    };
  };
  function useDebounce(value) {
    const [cacheValue, setCacheValue] = React__namespace.useState(value);
    React__namespace.useEffect(() => {
      const timeout = setTimeout(() => {
        setCacheValue(value);
      }, value.length ? 0 : 10);
      return () => {
        clearTimeout(timeout);
      };
    }, [value]);
    return cacheValue;
  }
  const EMPTY_LIST = [];
  function toErrorEntity(error, prefix2, errorStatus, index = 0) {
    return {
      key: typeof error === "string" ? error : `${prefix2}-${index}`,
      error,
      errorStatus
    };
  }
  const ErrorList = ({
    help,
    helpStatus,
    errors = EMPTY_LIST,
    warnings = EMPTY_LIST,
    className: rootClassName,
    fieldId,
    onVisibleChanged
  }) => {
    const {
      prefixCls
    } = React__namespace.useContext(FormItemPrefixContext);
    const baseClassName = `${prefixCls}-item-explain`;
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$7(prefixCls, rootCls);
    const collapseMotion = React__namespace.useMemo(() => initCollapseMotion(prefixCls), [prefixCls]);
    const debounceErrors = useDebounce(errors);
    const debounceWarnings = useDebounce(warnings);
    const fullKeyList = React__namespace.useMemo(() => {
      if (isNonNullable$1(help)) {
        return [toErrorEntity(help, "help", helpStatus)];
      }
      return [].concat(_toConsumableArray(debounceErrors.map((error, index) => toErrorEntity(error, "error", "error", index))), _toConsumableArray(debounceWarnings.map((warning3, index) => toErrorEntity(warning3, "warning", "warning", index))));
    }, [help, helpStatus, debounceErrors, debounceWarnings]);
    const filledKeyFullKeyList = React__namespace.useMemo(() => {
      const keysCount = {};
      fullKeyList.forEach(({
        key
      }) => {
        keysCount[key] = (keysCount[key] || 0) + 1;
      });
      return fullKeyList.map((entity, index) => ({
        ...entity,
        key: keysCount[entity.key] > 1 ? `${entity.key}-fallback-${index}` : entity.key
      }));
    }, [fullKeyList]);
    const helpProps = {};
    if (fieldId) {
      helpProps.id = `${fieldId}_help`;
    }
    return React__namespace.createElement(CSSMotion, {
      motionDeadline: collapseMotion.motionDeadline,
      motionName: `${prefixCls}-show-help`,
      visible: !!filledKeyFullKeyList.length,
      onVisibleChanged
    }, (holderProps) => {
      const {
        className: holderClassName,
        style: holderStyle
      } = holderProps;
      return React__namespace.createElement("div", {
        ...helpProps,
        className: clsx(baseClassName, holderClassName, cssVarCls, rootCls, rootClassName, hashId),
        style: holderStyle
      }, React__namespace.createElement(CSSMotionList, {
        keys: filledKeyFullKeyList,
        ...initCollapseMotion(prefixCls),
        motionName: `${prefixCls}-show-help-item`,
        component: false
      }, (itemProps) => {
        const {
          key,
          error,
          errorStatus,
          className: itemClassName,
          style: itemStyle
        } = itemProps;
        return React__namespace.createElement("div", {
          key,
          className: clsx(itemClassName, {
            [`${baseClassName}-${errorStatus}`]: errorStatus
          }),
          style: itemStyle
        }, error);
      }));
    });
  };
  function useChildren(children) {
    if (typeof children === "function") {
      return children;
    }
    const childList = toArray$3(children);
    return childList.length <= 1 ? childList[0] : childList;
  }
  const useFormItemStatus = () => {
    const {
      status,
      errors = [],
      warnings = []
    } = React__namespace.useContext(FormItemInputContext);
    return {
      status,
      errors,
      warnings
    };
  };
  useFormItemStatus.Context = FormItemInputContext;
  function useFrameState(defaultValue) {
    const [value, setValue] = React__namespace.useState(defaultValue);
    const frameRef = React__namespace.useRef(null);
    const batchRef = React__namespace.useRef([]);
    const destroyRef = React__namespace.useRef(false);
    React__namespace.useEffect(() => {
      destroyRef.current = false;
      return () => {
        destroyRef.current = true;
        wrapperRaf.cancel(frameRef.current);
        frameRef.current = null;
      };
    }, []);
    function setFrameValue(updater) {
      if (destroyRef.current) {
        return;
      }
      if (frameRef.current === null) {
        batchRef.current = [];
        frameRef.current = wrapperRaf(() => {
          frameRef.current = null;
          setValue((prevValue) => {
            let current = prevValue;
            batchRef.current.forEach((func) => {
              current = func(current);
            });
            return current;
          });
        });
      }
      batchRef.current.push(updater);
    }
    return [value, setFrameValue];
  }
  function useItemRef() {
    const {
      itemRef
    } = React__namespace.useContext(FormContext);
    const cacheRef = React__namespace.useRef({});
    function getRef(name, children) {
      const childrenRef = children && typeof children === "object" && getNodeRef(children);
      const nameStr = name.join("_");
      if (cacheRef.current.name !== nameStr || cacheRef.current.originRef !== childrenRef) {
        cacheRef.current.name = nameStr;
        cacheRef.current.originRef = childrenRef;
        cacheRef.current.ref = composeRef(itemRef(name), childrenRef);
      }
      return cacheRef.current.ref;
    }
    return getRef;
  }
  const genFallbackStyle = (token2) => {
    const {
      formItemCls
    } = token2;
    return {
      "@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)": {
[`${formItemCls}-control`]: {
          display: "flex"
        }
      }
    };
  };
  const FallbackCmp = genSubStyleComponent(["Form", "item-item"], (token2, {
    rootPrefixCls
  }) => {
    const formToken = prepareToken$2(token2, rootPrefixCls);
    return genFallbackStyle(formToken);
  });
  const GRID_MAX = 24;
  const FormItemInput = (props) => {
    const {
      prefixCls,
      status,
      labelCol,
      wrapperCol,
      children,
      errors,
      warnings,
      _internalItemRender: formItemRender,
      extra,
      help,
      fieldId,
      marginBottom,
      onErrorVisibleChanged,
      label
    } = props;
    const baseClassName = `${prefixCls}-item`;
    const formContext = React__namespace.useContext(FormContext);
    const {
      classNames: contextClassNames,
      styles: contextStyles
    } = formContext;
    const mergedWrapperCol = React__namespace.useMemo(() => {
      let mergedWrapper = {
        ...wrapperCol || formContext.wrapperCol || {}
      };
      if (label === null && !labelCol && !wrapperCol && formContext.labelCol) {
        const list = [void 0].concat(_toConsumableArray(responsiveArrayReversed));
        list.forEach((size) => {
          const _size = size ? [size] : [];
          const formLabel = get(formContext.labelCol, _size);
          const formLabelObj = typeof formLabel === "object" ? formLabel : {};
          const wrapper = get(mergedWrapper, _size);
          const wrapperObj = typeof wrapper === "object" ? wrapper : {};
          if ("span" in formLabelObj && !("offset" in wrapperObj) && formLabelObj.span < GRID_MAX) {
            mergedWrapper = set(mergedWrapper, [].concat(_size, ["offset"]), formLabelObj.span);
          }
        });
      }
      return mergedWrapper;
    }, [wrapperCol, formContext.wrapperCol, formContext.labelCol, label, labelCol]);
    const className = clsx(`${baseClassName}-control`, mergedWrapperCol.className);
    const subFormContext = React__namespace.useMemo(() => {
      const {
        labelCol: _labelCol,
        wrapperCol: _wrapperCol,
        ...rest
      } = formContext;
      return rest;
    }, [formContext]);
    const extraRef = React__namespace.useRef(null);
    const [extraHeight, setExtraHeight] = React__namespace.useState(0);
    useLayoutEffect(() => {
      if (extra && extraRef.current) {
        setExtraHeight(extraRef.current.clientHeight);
      } else {
        setExtraHeight(0);
      }
    }, [extra]);
    const inputDom = React__namespace.createElement("div", {
      className: `${baseClassName}-control-input`
    }, React__namespace.createElement("div", {
      className: clsx(`${baseClassName}-control-input-content`, contextClassNames?.content),
      style: contextStyles?.content
    }, children));
    const formItemContext = React__namespace.useMemo(() => ({
      prefixCls,
      status
    }), [prefixCls, status]);
    const errorListDom = marginBottom !== null || errors.length || warnings.length ? React__namespace.createElement(FormItemPrefixContext.Provider, {
      value: formItemContext
    }, React__namespace.createElement(ErrorList, {
      fieldId,
      errors,
      warnings,
      help,
      helpStatus: status,
      className: `${baseClassName}-explain-connected`,
      onVisibleChanged: onErrorVisibleChanged
    })) : null;
    const extraProps = {};
    if (fieldId) {
      extraProps.id = `${fieldId}_extra`;
    }
    const extraDom = extra ? React__namespace.createElement("div", {
      ...extraProps,
      className: `${baseClassName}-extra`,
      ref: extraRef
    }, extra) : null;
    const additionalDom = errorListDom || extraDom ? React__namespace.createElement("div", {
      className: `${baseClassName}-additional`,
      style: marginBottom ? {
        minHeight: marginBottom + extraHeight
      } : {}
    }, errorListDom, extraDom) : null;
    const dom = formItemRender && formItemRender.mark === "pro_table_render" && formItemRender.render ? formItemRender.render(props, {
      input: inputDom,
      errorList: errorListDom,
      extra: extraDom
    }) : React__namespace.createElement(React__namespace.Fragment, null, inputDom, additionalDom);
    return React__namespace.createElement(FormContext.Provider, {
      value: subFormContext
    }, React__namespace.createElement(Col, {
      ...mergedWrapperCol,
      className
    }, dom), React__namespace.createElement(FallbackCmp, {
      prefixCls
    }));
  };
  var QuestionCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, "name": "question-circle", "theme": "outlined" };
  function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  const QuestionCircleOutlined = (props, ref) => React__namespace.createElement(Icon, _extends({}, props, {
    ref,
    icon: QuestionCircleOutlined$1
  }));
  const RefIcon = React__namespace.forwardRef(QuestionCircleOutlined);
  const FormItemLabel = ({
    prefixCls,
    label,
    htmlFor,
    labelCol,
    labelAlign,
    colon,
    required: required4,
    requiredMark,
    tooltip,
    vertical
  }) => {
    const [formLocale] = useLocale("Form");
    const {
      labelAlign: contextLabelAlign,
      labelCol: contextLabelCol,
      labelWrap,
      colon: contextColon,
      classNames: contextClassNames,
      styles: contextStyles,
      tooltip: contextTooltip
    } = React__namespace.useContext(FormContext);
    if (!label) {
      return null;
    }
    const mergedLabelCol = labelCol || contextLabelCol || {};
    const mergedLabelAlign = labelAlign || contextLabelAlign;
    const labelClsBasic = `${prefixCls}-item-label`;
    const labelColClassName = clsx(labelClsBasic, mergedLabelAlign === "left" && `${labelClsBasic}-left`, mergedLabelCol.className, {
      [`${labelClsBasic}-wrap`]: !!labelWrap
    });
    let labelChildren = label;
    const computedColon = colon === true || contextColon !== false && colon !== false;
    const haveColon = computedColon && !vertical;
    if (haveColon && typeof label === "string" && label.trim()) {
      labelChildren = label.replace(/[:|:]\s*$/, "");
    }
    const tooltipProps = convertToTooltipProps(tooltip, contextTooltip);
    if (tooltipProps) {
      const tooltipNode = React__namespace.createElement(Tooltip, {
        ...tooltipProps
      }, React__namespace.createElement("span", {
        className: `${prefixCls}-item-tooltip`,
        onClick: (e2) => {
          e2.preventDefault();
        },
        tabIndex: -1
      }, tooltipProps.icon || tooltipProps.children || React__namespace.createElement(RefIcon, null)));
      labelChildren = React__namespace.createElement(React__namespace.Fragment, null, labelChildren, tooltipNode);
    }
    const isOptionalMark = requiredMark === "optional";
    const isRenderMark = typeof requiredMark === "function";
    const hideRequiredMark = requiredMark === false;
    if (isRenderMark) {
      labelChildren = requiredMark(labelChildren, {
        required: !!required4
      });
    } else if (isOptionalMark && !required4) {
      labelChildren = React__namespace.createElement(React__namespace.Fragment, null, labelChildren, React__namespace.createElement("span", {
        className: `${prefixCls}-item-optional`,
        title: ""
      }, formLocale?.optional || localeValues.Form?.optional));
    }
    let markType;
    if (hideRequiredMark) {
      markType = "hidden";
    } else if (isOptionalMark || isRenderMark) {
      markType = "optional";
    }
    const labelClassName = clsx(contextClassNames?.label, {
      [`${prefixCls}-item-required`]: required4,
      [`${prefixCls}-item-required-mark-${markType}`]: markType,
      [`${prefixCls}-item-no-colon`]: !computedColon
    });
    return React__namespace.createElement(Col, {
      ...mergedLabelCol,
      className: labelColClassName
    }, React__namespace.createElement("label", {
      htmlFor,
      className: labelClassName,
      style: contextStyles?.label,
      title: typeof label === "string" ? label : ""
    }, labelChildren));
  };
  const iconMap = {
    success: RefIcon$5,
    warning: RefIcon$3,
    error: RefIcon$4,
    validating: RefIcon$1
  };
  function StatusProvider({
    children,
    errors,
    warnings,
    hasFeedback,
    validateStatus,
    prefixCls,
    meta,
    noStyle,
    name
  }) {
    const itemPrefixCls = `${prefixCls}-item`;
    const {
      feedbackIcons
    } = React__namespace.useContext(FormContext);
    const mergedValidateStatus = getStatus(errors, warnings, meta, null, !!hasFeedback, validateStatus);
    const {
      isFormItemInput: parentIsFormItemInput,
      status: parentStatus,
      hasFeedback: parentHasFeedback,
      feedbackIcon: parentFeedbackIcon,
      name: parentName
    } = React__namespace.useContext(FormItemInputContext);
    const formItemStatusContext = React__namespace.useMemo(() => {
      let feedbackIcon;
      if (hasFeedback) {
        const customIcons = hasFeedback !== true && hasFeedback.icons || feedbackIcons;
        const customIconNode = mergedValidateStatus && customIcons?.({
          status: mergedValidateStatus,
          errors,
          warnings
        })?.[mergedValidateStatus];
        const IconNode = mergedValidateStatus ? iconMap[mergedValidateStatus] : null;
        feedbackIcon = customIconNode !== false && IconNode ? React__namespace.createElement("span", {
          className: clsx(`${itemPrefixCls}-feedback-icon`, `${itemPrefixCls}-feedback-icon-${mergedValidateStatus}`)
        }, customIconNode || React__namespace.createElement(IconNode, null)) : null;
      }
      const context = {
        status: mergedValidateStatus || "",
        errors,
        warnings,
        hasFeedback: !!hasFeedback,
        feedbackIcon,
        isFormItemInput: true,
        name
      };
      if (noStyle) {
        context.status = (mergedValidateStatus ?? parentStatus) || "";
        context.isFormItemInput = parentIsFormItemInput;
        context.hasFeedback = !!(hasFeedback ?? parentHasFeedback);
        context.feedbackIcon = hasFeedback !== void 0 ? context.feedbackIcon : parentFeedbackIcon;
        context.name = name ?? parentName;
      }
      return context;
    }, [mergedValidateStatus, hasFeedback, noStyle, parentIsFormItemInput, parentStatus]);
    return React__namespace.createElement(FormItemInputContext.Provider, {
      value: formItemStatusContext
    }, children);
  }
  function ItemHolder(props) {
    const {
      prefixCls,
      className,
      rootClassName,
      style: style2,
      help,
      errors,
      warnings,
      validateStatus,
      meta,
      hasFeedback,
      hidden,
      children,
      fieldId,
      required: required4,
      isRequired,
      onSubItemMetaChange,
      layout: propsLayout,
      name,
      ...restProps
    } = props;
    const itemPrefixCls = `${prefixCls}-item`;
    const {
      requiredMark,
      layout: formLayout
    } = React__namespace.useContext(FormContext);
    const layout = propsLayout || formLayout;
    const vertical = layout === "vertical";
    const itemRef = React__namespace.useRef(null);
    const debounceErrors = useDebounce(errors);
    const debounceWarnings = useDebounce(warnings);
    const hasHelp = isNonNullable$1(help);
    const hasError = !!(hasHelp || errors.length || warnings.length);
    const isOnScreen = !!itemRef.current && isVisible(itemRef.current);
    const [marginBottom, setMarginBottom] = React__namespace.useState(null);
    useLayoutEffect(() => {
      if (hasError && itemRef.current) {
        const itemStyle = getComputedStyle(itemRef.current);
        setMarginBottom(Number.parseInt(itemStyle.marginBottom, 10));
      }
    }, [hasError, isOnScreen]);
    const onErrorVisibleChanged = (nextVisible) => {
      if (!nextVisible) {
        setMarginBottom(null);
      }
    };
    const getValidateState = (isDebounce = false) => {
      const _errors = isDebounce ? debounceErrors : meta.errors;
      const _warnings = isDebounce ? debounceWarnings : meta.warnings;
      return getStatus(_errors, _warnings, meta, "", !!hasFeedback, validateStatus);
    };
    const mergedValidateStatus = getValidateState();
    const itemClassName = clsx(itemPrefixCls, className, rootClassName, {
      [`${itemPrefixCls}-with-help`]: hasHelp || debounceErrors.length || debounceWarnings.length,
[`${itemPrefixCls}-has-feedback`]: mergedValidateStatus && hasFeedback,
      [`${itemPrefixCls}-has-success`]: mergedValidateStatus === "success",
      [`${itemPrefixCls}-has-warning`]: mergedValidateStatus === "warning",
      [`${itemPrefixCls}-has-error`]: mergedValidateStatus === "error",
      [`${itemPrefixCls}-is-validating`]: mergedValidateStatus === "validating",
      [`${itemPrefixCls}-hidden`]: hidden,
[`${itemPrefixCls}-${layout}`]: layout
    });
    return React__namespace.createElement("div", {
      className: itemClassName,
      style: style2,
      ref: itemRef
    }, React__namespace.createElement(Row, {
      className: `${itemPrefixCls}-row`,
      ...omit(restProps, [
        "_internalItemRender",
        "colon",
        "dependencies",
        "extra",
        "fieldKey",
        "getValueFromEvent",
        "getValueProps",
        "htmlFor",
        "id",
"initialValue",
        "isListField",
        "label",
        "labelAlign",
        "labelCol",
        "labelWrap",
        "messageVariables",
        "name",
        "normalize",
        "noStyle",
        "preserve",
        "requiredMark",
        "rules",
        "shouldUpdate",
        "trigger",
        "tooltip",
        "validateFirst",
        "validateTrigger",
        "valuePropName",
        "wrapperCol",
        "validateDebounce"
      ])
    }, React__namespace.createElement(FormItemLabel, {
      htmlFor: fieldId,
      ...props,
      requiredMark,
      required: required4 ?? isRequired,
      prefixCls,
      vertical
    }), React__namespace.createElement(FormItemInput, {
      ...props,
      ...meta,
      errors: debounceErrors,
      warnings: debounceWarnings,
      prefixCls,
      status: mergedValidateStatus,
      help,
      marginBottom,
      onErrorVisibleChanged
    }, React__namespace.createElement(NoStyleItemContext.Provider, {
      value: onSubItemMetaChange
    }, React__namespace.createElement(StatusProvider, {
      prefixCls,
      meta,
      errors: meta.errors,
      warnings: meta.warnings,
      hasFeedback,
validateStatus: mergedValidateStatus,
      name
    }, children)))), !!marginBottom && React__namespace.createElement("div", {
      className: `${itemPrefixCls}-margin-offset`,
      style: {
        marginBottom: -marginBottom
      }
    }));
  }
  const NAME_SPLIT = "__SPLIT__";
  function isSimilarControl(a, b) {
    const keysA = Object.keys(a);
    const keysB = Object.keys(b);
    return keysA.length === keysB.length && keysA.every((key) => {
      const propValueA = a[key];
      const propValueB = b[key];
      return propValueA === propValueB || typeof propValueA === "function" || typeof propValueB === "function";
    });
  }
  const MemoInput = React__namespace.memo((props) => props.children, (prev2, next2) => isSimilarControl(prev2.control, next2.control) && prev2.update === next2.update && prev2.childProps.length === next2.childProps.length && prev2.childProps.every((value, index) => value === next2.childProps[index]));
  function genEmptyMeta() {
    return {
      errors: [],
      warnings: [],
      touched: false,
      validating: false,
      name: [],
      validated: false
    };
  }
  function InternalFormItem(props) {
    const {
      name,
      noStyle,
      className,
      dependencies,
      prefixCls: customizePrefixCls,
      shouldUpdate,
      rules: rules2,
      children,
      required: required4,
      label,
      messageVariables,
      trigger = "onChange",
      validateTrigger,
      hidden,
      help,
      layout
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const {
      name: formName
    } = React__namespace.useContext(FormContext);
    const mergedChildren = useChildren(children);
    const isRenderProps = typeof mergedChildren === "function";
    const notifyParentMetaChange = React__namespace.useContext(NoStyleItemContext);
    const {
      validateTrigger: contextValidateTrigger
    } = React__namespace.useContext(Context$1);
    const mergedValidateTrigger = isNonNullable$1(validateTrigger) ? validateTrigger : contextValidateTrigger;
    const hasName = isNonNullable$1(name);
    const prefixCls = getPrefixCls("form", customizePrefixCls);
    const rootCls = useCSSVarCls(prefixCls);
    const [hashId, cssVarCls] = useStyle$7(prefixCls, rootCls);
    const listContext = React__namespace.useContext(ListContext);
    const fieldKeyPathRef = React__namespace.useRef(null);
    const [subFieldErrors, setSubFieldErrors] = useFrameState({});
    const [meta, setMeta] = useSafeState(() => genEmptyMeta());
    const onMetaChange = (nextMeta) => {
      const keyInfo = listContext?.getKey(nextMeta.name);
      setMeta(nextMeta.destroy ? genEmptyMeta() : nextMeta, true);
      if (noStyle && help !== false && notifyParentMetaChange) {
        let namePath = nextMeta.name;
        if (!nextMeta.destroy) {
          if (keyInfo !== void 0) {
            const [fieldKey, restPath] = keyInfo;
            namePath = [fieldKey].concat(_toConsumableArray(restPath));
            fieldKeyPathRef.current = namePath;
          }
        } else {
          namePath = fieldKeyPathRef.current || namePath;
        }
        notifyParentMetaChange(nextMeta, namePath);
      }
    };
    const onSubItemMetaChange = (subMeta, uniqueKeys) => {
      setSubFieldErrors((prevSubFieldErrors) => {
        const clone = {
          ...prevSubFieldErrors
        };
        const mergedNamePath = [].concat(_toConsumableArray(subMeta.name.slice(0, -1)), _toConsumableArray(uniqueKeys));
        const mergedNameKey = mergedNamePath.join(NAME_SPLIT);
        if (subMeta.destroy) {
          delete clone[mergedNameKey];
        } else {
          clone[mergedNameKey] = subMeta;
        }
        return clone;
      });
    };
    const [mergedErrors, mergedWarnings] = React__namespace.useMemo(() => {
      const errorList = _toConsumableArray(meta.errors);
      const warningList = _toConsumableArray(meta.warnings);
      Object.values(subFieldErrors).forEach((subFieldError) => {
        errorList.push.apply(errorList, _toConsumableArray(subFieldError.errors || []));
        warningList.push.apply(warningList, _toConsumableArray(subFieldError.warnings || []));
      });
      return [errorList, warningList];
    }, [subFieldErrors, meta.errors, meta.warnings]);
    const getItemRef = useItemRef();
    function renderLayout(baseChildren, fieldId, isRequired) {
      if (noStyle && !hidden) {
        return React__namespace.createElement(StatusProvider, {
          prefixCls,
          hasFeedback: props.hasFeedback,
          validateStatus: props.validateStatus,
          meta,
          errors: mergedErrors,
          warnings: mergedWarnings,
          noStyle: true,
          name
        }, baseChildren);
      }
      return React__namespace.createElement(ItemHolder, {
        key: "row",
        ...props,
        className: clsx(className, cssVarCls, rootCls, hashId),
        prefixCls,
        fieldId,
        isRequired,
        errors: mergedErrors,
        warnings: mergedWarnings,
        meta,
        onSubItemMetaChange,
        layout,
        name
      }, baseChildren);
    }
    if (!hasName && !isRenderProps && !dependencies) {
      return renderLayout(mergedChildren);
    }
    let variables = {};
    if (typeof label === "string") {
      variables.label = label;
    } else if (name) {
      variables.label = String(name);
    }
    if (messageVariables) {
      variables = {
        ...variables,
        ...messageVariables
      };
    }
    return React__namespace.createElement(WrapperField, {
      ...props,
      messageVariables: variables,
      trigger,
      validateTrigger: mergedValidateTrigger,
      onMetaChange
    }, (control, renderMeta, context) => {
      const mergedName = toArray$1(name).length && renderMeta ? renderMeta.name : [];
      const fieldId = getFieldId(mergedName, formName);
      const isRequired = required4 !== void 0 ? required4 : !!rules2?.some((rule) => {
        if (rule && typeof rule === "object" && rule.required && !rule.warningOnly) {
          return true;
        }
        if (typeof rule === "function") {
          const ruleEntity = rule(context);
          return ruleEntity?.required && !ruleEntity?.warningOnly;
        }
        return false;
      });
      const mergedControl = {
        ...control
      };
      let childNode = null;
      if (Array.isArray(mergedChildren) && hasName) {
        childNode = mergedChildren;
      } else if (isRenderProps && (!(shouldUpdate || dependencies) || hasName)) ;
      else if (dependencies && !isRenderProps && !hasName) ;
      else if ( React__namespace.isValidElement(mergedChildren)) {
        const childProps = {
          ...mergedChildren.props,
          ...mergedControl
        };
        if (!childProps.id) {
          childProps.id = fieldId;
        }
        if (help || mergedErrors.length > 0 || mergedWarnings.length > 0 || props.extra) {
          const describedbyArr = [];
          if (help || mergedErrors.length > 0) {
            describedbyArr.push(`${fieldId}_help`);
          }
          if (props.extra) {
            describedbyArr.push(`${fieldId}_extra`);
          }
          childProps["aria-describedby"] = describedbyArr.join(" ");
        }
        if (mergedErrors.length > 0) {
          childProps["aria-invalid"] = "true";
        }
        if (isRequired) {
          childProps["aria-required"] = "true";
        }
        if (supportRef(mergedChildren)) {
          childProps.ref = getItemRef(mergedName, mergedChildren);
        }
        const triggers = new Set([].concat(_toConsumableArray(toArray$1(trigger)), _toConsumableArray(toArray$1(mergedValidateTrigger))));
        triggers.forEach((eventName) => {
          childProps[eventName] = (...args) => {
            mergedControl[eventName]?.(...args);
            mergedChildren.props[eventName]?.(...args);
          };
        });
        const watchingChildProps = [childProps["aria-required"], childProps["aria-invalid"], childProps["aria-describedby"]];
        childNode = React__namespace.createElement(MemoInput, {
          control: mergedControl,
          update: mergedChildren,
          childProps: watchingChildProps
        }, cloneElement(mergedChildren, childProps));
      } else if (isRenderProps && (shouldUpdate || dependencies) && !hasName) {
        childNode = mergedChildren(context);
      } else {
        childNode = mergedChildren;
      }
      return renderLayout(childNode, fieldId, isRequired);
    });
  }
  const FormItem = InternalFormItem;
  FormItem.useStatus = useFormItemStatus;
  const FormList = ({
    prefixCls: customizePrefixCls,
    children,
    ...props
  }) => {
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const prefixCls = getPrefixCls("form", customizePrefixCls);
    const contextValue = React__namespace.useMemo(() => ({
      prefixCls,
      status: "error"
    }), [prefixCls]);
    return React__namespace.createElement(List, {
      ...props
    }, (fields, operation, meta) => React__namespace.createElement(FormItemPrefixContext.Provider, {
      value: contextValue
    }, children(fields.map((field) => ({
      ...field,
      fieldKey: field.key
    })), operation, {
      errors: meta.errors,
      warnings: meta.warnings
    })));
  };
  function useFormInstance() {
    const {
      form
    } = React__namespace.useContext(FormContext);
    return form;
  }
  const Form = Form$1;
  Form.Item = FormItem;
  Form.List = FormList;
  Form.ErrorList = ErrorList;
  Form.useForm = useForm;
  Form.useFormInstance = useFormInstance;
  Form.useWatch = useWatch$1;
  Form.Provider = FormProvider;
  let message = null;
  let act = (callback) => callback();
  let taskQueue = [];
  let defaultGlobalConfig = {};
  function getGlobalContext() {
    const {
      getContainer: getContainer2,
      duration,
      rtl,
      maxCount,
      top
    } = defaultGlobalConfig;
    const mergedContainer = getContainer2?.() || document.body;
    return {
      getContainer: () => mergedContainer,
      duration,
      rtl,
      maxCount,
      top
    };
  }
  const GlobalHolder = React.forwardRef((props, ref) => {
    const {
      messageConfig,
      sync
    } = props;
    const {
      getPrefixCls
    } = React.useContext(ConfigContext);
    const prefixCls = defaultGlobalConfig.prefixCls || getPrefixCls("message");
    const appConfig = React.useContext(AppConfigContext);
    const [api2, holder] = useInternalMessage({
      ...messageConfig,
      prefixCls,
      ...appConfig.message
    });
    React.useImperativeHandle(ref, () => {
      const instance = {
        ...api2
      };
      Object.keys(instance).forEach((method4) => {
        instance[method4] = (...args) => {
          sync();
          return api2[method4].apply(api2, args);
        };
      });
      return {
        instance,
        sync
      };
    });
    return holder;
  });
  const GlobalHolderWrapper = React.forwardRef((_, ref) => {
    const [messageConfig, setMessageConfig] = React.useState(getGlobalContext);
    const sync = () => {
      setMessageConfig(getGlobalContext);
    };
    React.useEffect(sync, []);
    const global = globalConfig();
    const rootPrefixCls = global.getRootPrefixCls();
    const rootIconPrefixCls = global.getIconPrefixCls();
    const theme = global.getTheme();
    const dom = React.createElement(GlobalHolder, {
      ref,
      sync,
      messageConfig
    });
    return React.createElement(ConfigProvider, {
      prefixCls: rootPrefixCls,
      iconPrefixCls: rootIconPrefixCls,
      theme
    }, global.holderRender ? global.holderRender(dom) : dom);
  });
  const flushMessageQueue = () => {
    if (!message) {
      const holderFragment = document.createDocumentFragment();
      const newMessage = {
        fragment: holderFragment
      };
      message = newMessage;
      act(() => {
        render( React.createElement(GlobalHolderWrapper, {
          ref: (node2) => {
            const {
              instance,
              sync
            } = node2 || {};
            Promise.resolve().then(() => {
              if (!newMessage.instance && instance) {
                newMessage.instance = instance;
                newMessage.sync = sync;
                flushMessageQueue();
              }
            });
          }
        }), holderFragment);
      });
      return;
    }
    if (!message.instance) {
      return;
    }
    taskQueue.forEach((task) => {
      const {
        type: type4,
        skipped
      } = task;
      if (!skipped) {
        switch (type4) {
          case "open": {
            act(() => {
              const closeFn = message.instance.open({
                ...defaultGlobalConfig,
                ...task.config
              });
              closeFn?.then(task.resolve);
              task.setCloseFn(closeFn);
            });
            break;
          }
          case "destroy":
            act(() => {
              message?.instance.destroy(task.key);
            });
            break;
default: {
            act(() => {
              var _message$instance;
              const closeFn = (_message$instance = message.instance)[type4].apply(_message$instance, _toConsumableArray(task.args));
              closeFn?.then(task.resolve);
              task.setCloseFn(closeFn);
            });
          }
        }
      }
    });
    taskQueue = [];
  };
  function setMessageGlobalConfig(config) {
    defaultGlobalConfig = {
      ...defaultGlobalConfig,
      ...config
    };
    act(() => {
      message?.sync?.();
    });
  }
  function open(config) {
    const result = wrapPromiseFn((resolve) => {
      let closeFn;
      const task = {
        type: "open",
        config,
        resolve,
        setCloseFn: (fn) => {
          closeFn = fn;
        }
      };
      taskQueue.push(task);
      return () => {
        if (closeFn) {
          act(() => {
            closeFn();
          });
        } else {
          task.skipped = true;
        }
      };
    });
    flushMessageQueue();
    return result;
  }
  function typeOpen(type4, args) {
    const result = wrapPromiseFn((resolve) => {
      let closeFn;
      const task = {
        type: type4,
        args,
        resolve,
        setCloseFn: (fn) => {
          closeFn = fn;
        }
      };
      taskQueue.push(task);
      return () => {
        if (closeFn) {
          act(() => {
            closeFn();
          });
        } else {
          task.skipped = true;
        }
      };
    });
    flushMessageQueue();
    return result;
  }
  const destroy = (key) => {
    taskQueue.push({
      type: "destroy",
      key
    });
    flushMessageQueue();
  };
  const methods = ["success", "info", "warning", "error", "loading"];
  const baseStaticMethods = {
    open,
    destroy,
    config: setMessageGlobalConfig,
    useMessage,
    _InternalPanelDoNotUseOrYouWillBeFired: PurePanel$3
  };
  const staticMethods = baseStaticMethods;
  methods.forEach((type4) => {
    staticMethods[type4] = (...args) => typeOpen(type4, args);
  });
  const PurePanel = (props) => {
    const {
      prefixCls: customizePrefixCls,
      className,
      closeIcon,
      closable,
      type: type4,
      title,
      children,
      footer,
      classNames,
      styles,
      ...restProps
    } = props;
    const {
      getPrefixCls
    } = React__namespace.useContext(ConfigContext);
    const {
      className: contextClassName,
      style: contextStyle,
      classNames: contextClassNames,
      styles: contextStyles
    } = useComponentConfig("modal");
    const rootPrefixCls = getPrefixCls();
    const prefixCls = customizePrefixCls || getPrefixCls("modal");
    const rootCls = useCSSVarCls(rootPrefixCls);
    const [hashId, cssVarCls] = useStyle$2(prefixCls, rootCls);
    const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
      props
    });
    const confirmPrefixCls = `${prefixCls}-confirm`;
    let additionalProps = {};
    if (type4) {
      additionalProps = {
        closable: closable ?? false,
        title: "",
        footer: "",
        children: React__namespace.createElement(ConfirmContent, {
          ...props,
          prefixCls,
          confirmPrefixCls,
          rootPrefixCls,
          content: children
        })
      };
    } else {
      additionalProps = {
        closable: closable ?? true,
        title,
        footer: footer !== null && React__namespace.createElement(Footer, {
          ...props
        }),
        children
      };
    }
    return React__namespace.createElement(Panel, {
      prefixCls,
      className: clsx(hashId, `${prefixCls}-pure-panel`, type4 && confirmPrefixCls, type4 && `${confirmPrefixCls}-${type4}`, className, contextClassName, cssVarCls, rootCls, mergedClassNames.root),
      style: {
        ...contextStyle,
        ...mergedStyles.root
      },
      ...restProps,
      closeIcon: renderCloseIcon(prefixCls, closeIcon),
      closable,
      classNames: mergedClassNames,
      styles: mergedStyles,
      ...additionalProps
    });
  };
  const PurePanel$1 = withPureRenderTheme(PurePanel);
  function modalWarn(props) {
    return confirm(withWarn(props));
  }
  const Modal = Modal$1;
  Modal.useModal = useModal;
  Modal.info = function infoFn(props) {
    return confirm(withInfo(props));
  };
  Modal.success = function successFn(props) {
    return confirm(withSuccess(props));
  };
  Modal.error = function errorFn(props) {
    return confirm(withError(props));
  };
  Modal.warning = modalWarn;
  Modal.warn = modalWarn;
  Modal.confirm = function confirmFn(props) {
    return confirm(withConfirm(props));
  };
  Modal.destroyAll = function destroyAllFn() {
    while (destroyFns.length) {
      const close = destroyFns.pop();
      if (close) {
        close();
      }
    }
  };
  Modal.config = modalGlobalConfig;
  Modal._InternalPanelDoNotUseOrYouWillBeFired = PurePanel$1;
  const bilibot = "data:image/svg+xml,%3csvg%20data-v-3486c952=''%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20class='video-ai-assistant-icon%20video-toolbar-item-icon'%3e%3cg%20clip-path='url(%23clip0_8665_4990)'%3e%3cg%20filter='url(%23filter0_f_8665_4990)'%3e%3cpath%20d='M19%208.0058C19%2010.2183%2016.0821%2016.9998%2011.94%2016.9998C7.79788%2016.9998%204%2010.2183%204%208.0058C4%205.79333%207.35786%203.99977%2011.5%203.99977C15.6421%203.99977%2019%205.79333%2019%208.0058Z'%20fill='white'%20fill-opacity='0.61'%3e%3c/path%3e%3c/g%3e%3cg%20opacity='0.6'%20filter='url(%23filter1_f_8665_4990)'%3e%3cpath%20d='M21.5994%2014.6024C21.5994%2020.0163%2017.3013%2021.5998%2011.9994%2021.5998C6.69748%2021.5998%202.39941%2020.0163%202.39941%2014.6024C2.39941%209.18859%203.13788%204.7998%2011.9994%204.7998C21.2302%204.7998%2021.5994%209.18859%2021.5994%2014.6024Z'%20fill='url(%23paint0_linear_8665_4990)'%3e%3c/path%3e%3c/g%3e%3cg%20filter='url(%23filter2_d_8665_4990)'%3e%3cpath%20d='M21.2301%2015.234C21.2301%2020.5883%2017.0973%2022.1544%2011.9993%2022.1544C6.90131%2022.1544%202.76855%2020.5883%202.76855%2015.234C2.76855%209.87962%203.47861%205.53906%2011.9993%205.53906C20.8751%205.53906%2021.2301%209.87962%2021.2301%2015.234Z'%20fill='%23D9D9D9'%3e%3c/path%3e%3c/g%3e%3cg%20filter='url(%23filter3_d_8665_4990)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.03142%201.87875C6.54055%201.45447%207.29723%201.52326%207.72151%202.03239L9.72151%204.43239C10.1458%204.94153%2010.077%205.6982%209.56786%206.12248C9.05873%206.54676%208.30205%206.47797%207.87777%205.96884L5.87777%203.56884C5.4535%203.0597%205.52229%202.30303%206.03142%201.87875Z'%20fill='url(%23paint1_linear_8665_4990)'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M6.03142%201.87875C6.54055%201.45447%207.29723%201.52326%207.72151%202.03239L9.72151%204.43239C10.1458%204.94153%2010.077%205.6982%209.56786%206.12248C9.05873%206.54676%208.30205%206.47797%207.87777%205.96884L5.87777%203.56884C5.4535%203.0597%205.52229%202.30303%206.03142%201.87875Z'%20fill='%231E1E29'%3e%3c/path%3e%3c/g%3e%3cg%20filter='url(%23filter4_d_8665_4990)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.5682%201.87875C17.0591%201.45447%2016.3024%201.52326%2015.8781%202.03239L13.8781%204.43239C13.4538%204.94153%2013.5226%205.6982%2014.0317%206.12248C14.5409%206.54676%2015.2976%206.47797%2015.7218%205.96884L17.7218%203.56884C18.1461%203.0597%2018.0773%202.30303%2017.5682%201.87875Z'%20fill='url(%23paint2_linear_8665_4990)'%3e%3c/path%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.5682%201.87875C17.0591%201.45447%2016.3024%201.52326%2015.8781%202.03239L13.8781%204.43239C13.4538%204.94153%2013.5226%205.6982%2014.0317%206.12248C14.5409%206.54676%2015.2976%206.47797%2015.7218%205.96884L17.7218%203.56884C18.1461%203.0597%2018.0773%202.30303%2017.5682%201.87875Z'%20fill='%231E1E29'%3e%3c/path%3e%3c/g%3e%3cg%20filter='url(%23filter5_ii_8665_4990)'%3e%3cpath%20d='M22.4045%2015.1648C22.4045%2021.3304%2017.7483%2022.4057%2012.0045%2022.4057C6.26073%2022.4057%201.60449%2021.3304%201.60449%2015.1648C1.60449%208.00566%202.40449%204.80566%2012.0045%204.80566C22.0045%204.80566%2022.4045%208.00566%2022.4045%2015.1648Z'%20fill='url(%23paint3_linear_8665_4990)'%3e%3c/path%3e%3c/g%3e%3cpath%20d='M3.83203%2011.3712C3.83203%209.54498%205.159%207.97354%206.97224%207.75614C10.5687%207.32495%2013.4174%207.30903%2017.0537%207.74864C18.8589%207.96688%2020.1749%209.53494%2020.1749%2011.3533V15.3575C20.1749%2017.0701%2019.0072%2018.5846%2017.3193%2018.8746C13.5256%2019.5264%2010.5395%2019.4008%206.85061%2018.8149C5.09301%2018.5357%203.83203%2016.9898%203.83203%2015.2101V11.3712Z'%20fill='%23191924'%3e%3c/path%3e%3cpath%20d='M15.7178%2012.2539L15.7178%2014.4825'%20stroke='%232CFFFF'%20stroke-width='1.92'%20stroke-linecap='round'%3e%3c/path%3e%3cpath%20d='M8.31152%2012.2539L8.31152%2014.4825'%20stroke='%232CFFFF'%20stroke-width='1.92'%20stroke-linecap='round'%3e%3c/path%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_f_8665_4990'%20x='-2.2'%20y='-2.2'%20width='27.4'%20height='25.4'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'%3e%3c/feBlend%3e%3cfeGaussianBlur%20stdDeviation='3.1'%20result='effect1_foregroundBlur_8665_4990'%3e%3c/feGaussianBlur%3e%3c/filter%3e%3cfilter%20id='filter1_f_8665_4990'%20x='-1.60059'%20y='0.799805'%20width='27.2002'%20height='24.7998'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'%3e%3c/feBlend%3e%3cfeGaussianBlur%20stdDeviation='2'%20result='effect1_foregroundBlur_8665_4990'%3e%3c/feGaussianBlur%3e%3c/filter%3e%3cfilter%20id='filter2_d_8665_4990'%20x='-0.000676155'%20y='2.76983'%20width='24.0004'%20height='22.1537'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%3e%3c/feColorMatrix%3e%3cfeOffset%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='1.38462'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%3e%3c/feComposite%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.039545%200%200%200%200%200.0845023%200%200%200%200%200.200107%200%200%200%200.7%200'%3e%3c/feColorMatrix%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_8665_4990'%3e%3c/feBlend%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_8665_4990'%20result='shape'%3e%3c/feBlend%3e%3c/filter%3e%3cfilter%20id='filter3_d_8665_4990'%20x='3.59961'%20y='-0.399414'%20width='8.40039'%20height='8.80029'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%3e%3c/feColorMatrix%3e%3cfeOffset%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%3e%3c/feComposite%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.855057%200%200%200%200%200.963764%200%200%200%200%201%200%200%200%200.8%200'%3e%3c/feColorMatrix%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_8665_4990'%3e%3c/feBlend%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_8665_4990'%20result='shape'%3e%3c/feBlend%3e%3c/filter%3e%3cfilter%20id='filter4_d_8665_4990'%20x='11.5996'%20y='-0.399414'%20width='8.40039'%20height='8.80029'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%3e%3c/feColorMatrix%3e%3cfeOffset%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='1'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%3e%3c/feComposite%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.855057%200%200%200%200%200.963764%200%200%200%200%201%200%200%200%200.8%200'%3e%3c/feColorMatrix%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_8665_4990'%3e%3c/feBlend%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_8665_4990'%20result='shape'%3e%3c/feBlend%3e%3c/filter%3e%3cfilter%20id='filter5_ii_8665_4990'%20x='0.00449228'%20y='3.31995'%20width='24.6284'%20height='21.3144'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%3e%3c/feFlood%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'%3e%3c/feBlend%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%3e%3c/feColorMatrix%3e%3cfeOffset%20dx='2.22857'%20dy='2.97143'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='1.11429'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in2='hardAlpha'%20operator='arithmetic'%20k2='-1'%20k3='1'%3e%3c/feComposite%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200%200%200%200.25%200'%3e%3c/feColorMatrix%3e%3cfeBlend%20mode='normal'%20in2='shape'%20result='effect1_innerShadow_8665_4990'%3e%3c/feBlend%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%3e%3c/feColorMatrix%3e%3cfeOffset%20dx='-1.6'%20dy='-1.48571'%3e%3c/feOffset%3e%3cfeGaussianBlur%20stdDeviation='1.48571'%3e%3c/feGaussianBlur%3e%3cfeComposite%20in2='hardAlpha'%20operator='arithmetic'%20k2='-1'%20k3='1'%3e%3c/feComposite%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200.15445%200%200%200%200%200.454264%200%200%200%200.11%200'%3e%3c/feColorMatrix%3e%3cfeBlend%20mode='normal'%20in2='effect1_innerShadow_8665_4990'%20result='effect2_innerShadow_8665_4990'%3e%3c/feBlend%3e%3c/filter%3e%3clinearGradient%20id='paint0_linear_8665_4990'%20x1='4.15362'%20y1='6.9227'%20x2='27.6921'%20y2='26.7689'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239DE3FA'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%231C29A0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_8665_4990'%20x1='5.443'%20y1='2.28'%20x2='7.21478'%20y2='6.6384'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23393946'%3e%3c/stop%3e%3cstop%20offset='0.401159'%20stop-color='%2323232E'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23191924'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_8665_4990'%20x1='18.1566'%20y1='2.28'%20x2='16.3848'%20y2='6.6384'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23393946'%3e%3c/stop%3e%3cstop%20offset='0.401159'%20stop-color='%2323232E'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23191924'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_8665_4990'%20x1='6.14122'%20y1='8.65113'%20x2='15.9492'%20y2='23.2761'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F4FCFF'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23EAF5F9'%3e%3c/stop%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_8665_4990'%3e%3crect%20width='24'%20height='24'%20fill='white'%3e%3c/rect%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const reportCategoryOptions = Object.entries(redundantTypeConfig).filter((entry) => {
    return ![RedundantType.FULL, RedundantType.UNKNOWN, RedundantType.PADDING].includes(entry[0]);
  }).map(([k, v]) => {
    return {
      label: jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
jsxRuntimeExports.jsx("span", { className: "segment-category-label", style: { backgroundColor: v.color } }),
jsxRuntimeExports.jsx("span", { children: v.name })
      ] }),
      value: k
    };
  });
  const ReportSegmentModal = (props) => {
    const [modalOpen, setModalOpen] = React.useState(false);
    const [loading, setLoading] = React.useState(false);
    const [reportForm] = useForm();
    const reset = () => {
      setModalOpen(false);
      props.handleChangeStartTime(true);
      props.handleChangeEndTime(true);
      reportForm.resetFields();
    };
    const reportSegments = async () => {
      if (props.endTime - props.startTime < 10) {
        staticMethods.error("片段时长至少10s");
        return;
      }
      try {
        setLoading(true);
        const userId = await getHashBySHA256(String(props.userId));
        const redundantType = reportForm.getFieldValue("category");
        const result = await postSegments({
          videoID: props.bvId,
          cid: String(props.chapterId),
          userID: userId,
          userAgent: window.navigator.userAgent,
          videoDuration: props.videoDuration,
          segments: [
            {
              segment: [props.startTime, props.endTime],
              actionType: "skip",
              category: redundantType
            }
          ]
        });
        if (result) {
          console.log(`[BC] reported segment ${props.bvId} ${props.chapterId} ${formatTime(props.startTime)} - ${formatTime(props.endTime)}`);
          staticMethods.success("上报片段成功");
          reset();
          props.updateSegments({
            start: props.startTime,
            end: props.endTime,
            redundantType,
            opacity: redundantTypeConfig[redundantType].opacity,
            color: redundantTypeConfig[redundantType].color,
            skip: true
          });
        } else {
          console.error(`[BC] report segment ${props.bvId} ${props.chapterId} ${formatTime(props.startTime)} - ${formatTime(props.endTime)} failed, returned false`);
          staticMethods.error("上报分段失败");
        }
      } catch (e2) {
        console.error(`[BC] report segment ${props.bvId} ${props.chapterId} ${formatTime(props.startTime)} - ${formatTime(props.endTime)} failed, ${e2}`);
      } finally {
        setLoading(false);
      }
    };
    return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
jsxRuntimeExports.jsxs(
        "div",
        {
          id: "report-segment-button",
          className: "report-segment-button",
          onClick: () => {
            if (props.startTime) {
              props.handleChangeEndTime();
              setModalOpen(true);
            } else {
              props.handleChangeStartTime();
            }
          },
          children: [
jsxRuntimeExports.jsx("img", { src: bilibot, alt: "bilibot", className: "report-segment-button-icon" }),
jsxRuntimeExports.jsx(Tooltip, { title: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
              "1.首次点击将当前时间记为片段起点",
jsxRuntimeExports.jsx("br", {}),
              "2.再次点击记录终点并打开弹窗",
jsxRuntimeExports.jsx("br", {})
            ] }), children: jsxRuntimeExports.jsx(
              "span",
              {
                style: {
                  fontSize: "14px",
                  color: "#00AEEC"
                },
                children: props.startTime ? props.endTime ? "记录片段终点" : "记录片段终点" : "记录片段起点"
              }
            ) }),
jsxRuntimeExports.jsx("div", { className: "report-segment-button-border" })
          ]
        }
      ),
jsxRuntimeExports.jsx(
        Modal,
        {
          className: "report-segment-modal",
          title: "仅支持标记为跳过",
          open: modalOpen,
          closable: false,
          cancelText: "重置",
          onCancel: reset,
          cancelButtonProps: {
            loading
          },
          okText: "提交",
          onOk: reportSegments,
          okButtonProps: {
            loading
          },
          width: "20vw",
          mask: {
            closable: false,
            blur: true
          },
          getContainer: props.container,
          centered: true,
          children: jsxRuntimeExports.jsxs(
            Form,
            {
              form: reportForm,
              initialValues: { category: reportCategoryOptions[0].value },
              style: {
                paddingTop: "1em"
              },
              children: [
jsxRuntimeExports.jsx(
                  FormItem,
                  {
                    label: "时间范围",
                    children: jsxRuntimeExports.jsx("span", { children: `${formatTime(props.startTime)} -> ${formatTime(props.endTime)}` })
                  }
                ),
jsxRuntimeExports.jsx(
                  FormItem,
                  {
                    label: "片段类型",
                    name: "category",
                    required: true,
                    style: { marginBottom: "12px" },
                    children: jsxRuntimeExports.jsx(Radio.Group, { options: reportCategoryOptions })
                  }
                )
              ]
            }
          )
        }
      )
    ] });
  };
  const BEEP_BASE64 = "data:audio/ogg;base64,T2dnUwACAAAAAAAAAABhbuxSAAAAANtsoBcBHgF2b3JiaXMAAAAAAsBdAAAAAAAAz58CAAAAAACpAU9nZ1MAAAAAAAAAAAAAYW7sUgEAAACbyYbyDjv///////////////+iA3ZvcmJpcysAAABYaXBoLk9yZyBsaWJWb3JiaXMgSSAyMDEyMDIwMyAoT21uaXByZXNlbnQpAAAAAAEFdm9yYmlzJEJDVgEAQAAAGEIQKgWtY446yBUhjBmioELKKccdQtAhoyRDiDrGNccYY0e5ZIpCyYHQkFUAAEAAAKQcV1BySS3nnHOjGFfMcegg55xz5SBnzHEJJeecc44555JyjjHnnHOjGFcOcikt55xzgRRHinGnGOecc6QcR4pxqBjnnHNtMbeScs4555xz5iCHUnKuNeecc6QYZw5yCyXnnHPGIGfMcesg55xzjDW31HLOOeecc84555xzzjnnnHOMMeecc84555xzbjHnFnOuOeecc8455xxzzjnnnHMgNGQVAJAAAKChKIriKA4QGrIKAMgAABBAcRRHkRRLsRzL0SQNCA1ZBQAAAQAIAACgSIakSIqlWI5maZ4meqIomqIqq7JpyrIsy7Lrui4QGrIKAEgAAFBRFMVwFAcIDVkFAGQAAAhgKIqjOI7kWJKlWZ4HhIasAgCAAAAEAABQDEexFE3xJM/yPM/zPM/zPM/zPM/zPM/zPM/zPA0IDVkFACAAAACCKGQYA0JDVgEAQAAACCEaGUOdUhJcChZCHBFDHULOQ6mlg+AphSVj0lOsQQghfO89995774HQkFUAABAAAGEUOIiBxyQIIYRiFCdEcaYgCCGE5SRYynnoJAjdgxBCuJx7y7n33nsgNGQVAAAIAMAghBBCCCGEEEIIKaSUUkgppphiiinHHHPMMccggwwy6KCTTjrJpJJOOsoko45Saym1FFNMseUWY6211pxzr0EpY4wxxhhjjDHGGGOMMcYYIwgNWQUAgAAAEAYZZJBBCCGEFFJIKaaYcswxxxwDQkNWAQCAAAACAAAAHEVSJEdyJEeSJMmSLEmTPMuzPMuzPE3URE0VVdVVbdf2bV/2bd/VZd/2ZdvVZV2WZd21bV3WXV3XdV3XdV3XdV3XdV3XdV3XgdCQVQCABACAjuQ4juQ4juRIjqRIChAasgoAkAEAEACAoziK40iO5FiOJVmSJmmWZ3mWp3maqIkeEBqyCgAABAAQAAAAAACAoiiKoziOJFmWpmmep3qiKJqqqoqmqaqqapqmaZqmaZqmaZqmaZqmaZqmaZqmaZqmaZqmaZqmaZqmaQKhIasAAAkAAB3HcRxHcRzHcSRHkiQgNGQVACADACAAAENRHEVyLMeSNEuzPMvTRM/0XFE2dVNXbSA0ZBUAAAgAIAAAAAAAAMdzPMdzPMmTPMtzPMeTPEnTNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE3TNE0DQkNWAgBkAACYtNRi7kWXzjkoLdZgMsaYk5aLyRhCyknMJVPIGAUtp4whQwyj2ELHkDFIYkopZAghaLHFVjrHINZaa0yplBgIDVkRAEQBABgUBXAkCXAkCQAAAAAAAAAEAAAEOAAABFgIhYasCADiBAAcjqNp8Dx4HjwPnuc4jqfB8+B5EEWIouM4mgfPg+dBFCGKmueZIlwVqgtbhm1rnieaUF2oKmwbtg0AAAAAAAAAAADP81QVrgrXhexClj3PU1WoKlwXsgxZBgAAAAAAAAAAgCd6rgrXhatCliHLnuepLlQXqgvZhiwDAAAAAAAAAADAE0XbhixDliG7kGVPFG0bsgxZhitDlgEAAAAAAAAAAOCJom1DliHLkGXIrieKtg1ZhixDluG6AgAABhwAAAJMKAOFhqwEAKIAAAyKIkma5nmwLM8TRViW54kiNM0TTROaJoqmCc8TRVWFpomiqgIAIAAAoMABACDABk2JxQEKDVkJAIQEADgURZIsy7I0zfM8TxRhWZrmeZ4niqapmrAsTfM8zxNF0zRNWJbniaIomqaqqio0y/NEURRNU1VVFZrmeaJomqqqqq4LTfM8UTRNVVVV14XmeZ4omqaquq4sA88TRdNUVdeVZQAAAAAAAAAAAAAAAAAAAAAAAQAABw4AAAFG0ElGlUXYaMKFB6DQkBUBQBQAAGAMYkwxZpSSVEpJjVJSUkklkhJaKq1lUlprLcaMSmqtxVhRKa2l1jIqLcbWWiapxdhaKwAA7MABAOzAQig0ZCUAkAcAQBCilFKMMUalVIox55yTUirFmHPOUUoZc845CCmlijnnHISUUsacc845SiljzjkHIaXUOeecc45SSqlzzjlnKaXUOeecs5RSyphzzgkAACpwAAAIsFFkc4KRoEJDVgIAqQAABsexLE/zPFE0TUmSNE0URVFVXdeSJE0TRVNUVdelaZomiqapqq5L0zRNFE1TVV2Xqnqeaaqq68oy1xVF01RV15VlAAAAAAAAAAAAQAAAeIIDAFCBDasjnBSNBRYashIAyAAAIAhBSCmFkFIKIaUUQkophAQAAAw4AAAEmFAGCg1ZCQCkAgAAxjDmnHMSSokQYgxCKam0VCHEGIRSUmqtaYwxCKWk1FrTGGMQUmmptaZS56Sk1FqMzbXOQUiptRibk6aUklJrMUYpTSklpdZijFLamlJrMcYapfQ5pZZirDVKKaWMrcVYa5RSShlbi7HWAgAQGhwAwA5sWB3hpGgssNCQlQBAHgAAYYxSjDHGGIRQMcYYcw5CqBRjjDkHIWSMMeecgxAyxphzzkEIGWPMOecghIwxxphzEELGnGPMOQghhM4x5hyEEELnGHMOQgghY4w5JwAAqMABACDARpHNCUaCCg1ZCQCEAwAAxijFGGPOQSilUso5CJ2DUEpKFUKOQegchFJSap5zDkIIpaTSUvOccxBCKCWl1pprIZRSSkqtxdZkDKGUUlJqLcbmnAghlJJSa7E150QInZSWWouxOSdjKSm1FmOMzTkZS0mlpRhrbc45p1JKrcVYa3POOVVSiinGWpuTUtqaWowx1hqllFLnlmKrMdcCAEweHACgEmycYSXprHA0uNCQlQBAbgAAYYxSjDnnnHPOOeecc5RSxpxzDkIIIYQQQggllYw55xyEEEIIIYQQUkqdcw5CCCGEEEIIIaSUOucchBBCCKGEUkpJKXUOQgghhFBKKaWUklLqHIQQQgillFJKKSWlFEIIIYRQSimllFJKSimlEEIIoZRSSimllJRSSiGEUEoppZRSSikppZRCCKGUUkoppZRSUkoplVBKKaWUUkoppaSUUkqplFJKKaWUUkpJKaWUUimllFJKKaWUklJKKaVSSimllFJKKSWllFJKpZRSSimllFJKSimllFIqpZRSSimllJRSSimlVEoppZRSSikppZRSSqmUUkoppZRSUkoppZRSKaWUUkoppaSUUkoppZRKKaWUUkopAADowAEAIMCISgux04wrj8ARhQwTUKEhKwGAkAAAwBDppJRSSimllFJJKaWUUkoppZRSKgmllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUgBgdIYDYPSEEXSSUWURNppw4QEoNGQlAJAWAAAYwxhjjDknIZWYaqyUcs45x6CjEFNtNUZKOeeccxBSiqnGnIPnnIMQOgqtxFRbjcFzzkEIoZSUYoy15+Ba5yCUklJLscVWY2+tcxBKSam1GGvNOQghQggptdZijL3WGoQQHXRUWoux1px7D0K4VkpqLcYac649ByFcK52F2GrNNffegxBCqNRarbXnnnsOQgghVGglplx7D77nIIQQOrdWa+499x6EEEIIW1upKbfgcw8+CCGEEDLWWnsQPgghhBBCCBliy7H3IIQQQgghhA625t6DDz4IIYQQQggbc+/BByEMAMiNcABAXDCSkDrLsNKIG0/AEIEUGrIKAIgBABgCgCAQMAAAMMEBACDACnZlllZtFDd1khd9EPiEjtiMDLmUipmcCHqkhlqsBDu0ghu8ACw0ZCUAQAYAwDAIoYMSe2SQYsxB6xVCiDEoLWcKGaQclNgxhhBiUFrGmEJIMWmdc4whpCB1EDqnFHJUUmsphA5arDnX1lKKAQAAEAQACAgJADBAUDADAAwOEEYOBDoCCBzaAAADETITGBRCg4NMAHiAiJAKABITFKULXRBCBOkiyOKBCyduPHHDCR3aQAAAAAAAQADgAwAgoQAiopmZq7C4wMjQ2ODo8PgACREZEQAAAAAAIAD4AABISICIaGbmKiwuMDI0Njg6PD5AQkRGAgAAAQQAAAAAQAABCAgIAAAAAAAEAAAACAhPZ2dTAATAEgAAAAAAAGFu7FICAAAAZH63Uw42PTIyOf3/AjgzNCZW3AShPdBf8RyE9kB/xTOaHF1kdAuVhmoJAAAAAEAAAMlEOuV0mIyiOCkFdrJxNyzOLooNiqA0ANoourDun+rtJs072Y2iC+v+qd5u0ryTLYo9gNAkAQAAAAAAAICKqsXeyR07i5pqAPS4XTGJLhSDYjAyuwDeGDq07h9he8jL7GQ3hg6t+0fYHvIyO9nsMgChIQAAAAAAAAAAACie7rauIIDzrp+8HZ74ObzuH/H0kJfZyU78HF73j3h6yMvsZLMLAJEVlgEAAAAAAAAAAACnXVFDAOcb57EANti5uDn+gW8Pae6QPdi5uDn+gW8Pae6QzV0CoFioQAAAAAAAAAAAAFBFLeq0AOvaWiwsZyuwAQAAPLOZKRfrZzYz5WJtbGPPM88zk8wKBDJT0bacZ4qiqKioKGRZrVbL5LRt7Hlq29Z5ntG2rfM8tW3rPM9o29Z5prYN55nRtuE8U9uG88xo23CeOW0be56ZadvY88xp29jzzFQURskAW4l0KhKGzelErKYTq9NhcziTViKdTKZTQZiOpMAxxmCiA1YkJpxylAhIk1YYh0FSaQeBwoRThCFRHCStgDgKE4QhURzFRAHJII4IrVQYxUhOKxlhB2knYoswpWSECdIkYkOcIB1hoiSpGBwnSAeYKKlUCE4mnA4wUVLpEDkZORUAURykLTkZhSnZSsRB0kFAMgoThCGJGByv00TmYn28ThOZi/WxyEhAZENwxHRkD7qO44jputwcR0zX2eMwXWdzHLqucxyHruscOULXpeMIXZeOHKHr0nGErktHjtB16ThC16UjR+i6dBwxXZd72Hs6Obs5WTFsHZwdLbYuioJ0Mko7HQfJdEScSiQTqdCJVBzE6UDpGJQM4zhMxCSCRKAwUNrJEBGnSUWYKKF0CIpjpwJwIgpSISgZh2mBU0GQMATpME4GKE4rShhHKcfJwIrTihKhHCWIk4GDZJJEIpQTCZLJwEEySSIRKkwkSCblIBk7kQgVpiKlYzlIxk5FVpiKlI5FkI6diqwwFQXpGIJ0GKYDCFNBkAoBmhjK4xpssJMPQmIoj2uwwU4+CKgGQEZjY5GpAAAAAAAAAAAgiiiYDoanq6OLhunAAAAA0HJoHAGeCJLDwQGwkh6wSQTJ4eAAWEkP2KBKAgBgAAAAAAAAAACoZIKmcUAABQRQYEXPlyFKSQBW6Mlrdt1gJf+ITaEnr9l1g5X8IzaoCgDVZiJiAAAAAAAAAEABQN3xtNoamOsoK0kEAAAA9JyehIWOPacnYaGjqQJAVJpUAQAAAAAAACqGmmKAk52dzcoEAAD0nNaeASw2e05rzwAWm0cDAEgAAAgQCDAw0ACQUZuyERhAgCCA0xIBQxAAVpQM+EF01v1Z92ddqR/Rx/oRXZo2vRn8rvyu/K78Lr8r3/K7XMcZ13HGGdyWT4bAoMBt+WQIDAqcAZBFXa00AABMIh3T7THdHtPtEZ1D59A5dA4Rbtg7ONoYjg5WsThY3fEwDdO0WA2xWlQNqwGpRIp0nFI6SDpFECTtMAoIknacQlEKx2kHUSII42QYJBJRmIzjKBEl4mSYTMzFNObQMWWOdsxkjnbMZLloF8uR5WJ2sTqyXJnO8oS8kJKVZuQlxSyUluWxpDwLpWW5S8ozFctyF0ozFUtystKMvCQnK83ICzlZMSMt5EqKmdNCrqSYOS3kSoqZYyFXyFc6V1YzVlfmXFkdYxU=";
  const videoSelectors = [".bpx-player-video-area video", ".bilibili-player video", "video"];
  const progressBarSelector = ".bpx-player-progress";
  const shadowProgressBarSelector = ".bpx-player-shadow-progress-area";
  const videoToolbarRightSelector = ".video-toolbar-right";
  const SkipSegment = () => {
    const [segments, setSegments] = React.useState([]);
    const { bvId, chapterId } = useVideo();
    const userId = useUserId();
    const [playerElement, setPlayerElement] = React.useState(null);
    const [progressBarElement, setProgressBarElement] = React.useState(null);
    const [shadowProgressBarElement, setShadowProgressBarElement] = React.useState(null);
    const [videoToolbarElement, setVideoToolbarElement] = React.useState(null);
    const [videoToolbarContainer, setVideoToolbarContainer] = React.useState(null);
    const [startTime, setStartTime] = React.useState(0);
    const [endTime, setEndTime] = React.useState(0);
    const lastCheckTime = React.useRef(0);
    const playBeep = (volume) => {
      const onEnded = () => {
        navigator.mediaSession.metadata = null;
        setTimeout(() => {
          navigator.mediaSession.metadata = oldMetadata;
          beep.removeEventListener("ended", onEnded);
          beep.remove();
        }, 0);
      };
      const beep = new Audio(BEEP_BASE64);
      beep.volume = volume;
      const oldMetadata = navigator.mediaSession.metadata;
      beep.addEventListener("ended", onEnded);
      void beep.play();
    };
    React.useEffect(() => {
      if (!bvId || !chapterId) return;
      const initializer = async () => {
        try {
          setPlayerElement(null);
          setProgressBarElement(null);
          setShadowProgressBarElement(null);
          setVideoToolbarElement(null);
          const [elements, data] = await Promise.all([
            Promise.all([
              waitForElement(videoSelectors, HTMLVideoElement),
              waitForElement([progressBarSelector], HTMLDivElement),
              waitForElement([shadowProgressBarSelector], HTMLDivElement),
              waitForElement([videoToolbarRightSelector], HTMLDivElement)
            ]),
            getSegments(bvId, chapterId)
          ]);
          const [player, progressBar, shadowProgressBar, videoToolbar] = elements;
          setPlayerElement(player);
          setProgressBarElement(progressBar);
          setShadowProgressBarElement(shadowProgressBar);
          setVideoToolbarElement(videoToolbar);
          console.log("[BC] player, progress bar, shadow progress bar, right video toolbar got");
          setSegments(data);
          if (data.length) console.log(`[BC] bv=${bvId} chapterId=${chapterId} segments loaded: ${data.map((y) => `[${formatTime(y.start)}-${formatTime(y.end)}]`).join(", ")}`);
        } catch (error) {
          console.error(`[BC] initialization failed: ${error}`);
        }
      };
      void initializer();
    }, [bvId, chapterId]);
    React.useEffect(() => {
      if (!segments.length || !playerElement) return;
      const handleTimeUpdate = () => {
        const now = Date.now();
        if (playerElement.paused || playerElement.ended || playerElement.readyState < 2 || now - lastCheckTime.current < 300) return;
        lastCheckTime.current = now;
        for (const segment of segments) {
          const { start, end } = segment;
          if (end - start >= 3 && playerElement.currentTime >= start && playerElement.currentTime < end && end <= playerElement.duration) {
            console.log(`[BC] skip from ${formatTime(playerElement.currentTime)} to ${formatTime(end)}`);
            playerElement.currentTime = end;
            playBeep(playerElement.volume / 10);
            break;
          }
        }
      };
      playerElement.addEventListener("timeupdate", handleTimeUpdate);
      return () => {
        playerElement.removeEventListener("timeupdate", handleTimeUpdate);
        lastCheckTime.current = 0;
      };
    }, [segments, playerElement]);
    React.useEffect(() => {
      if (!playerElement || !videoToolbarElement || !bvId || !chapterId || !userId) return;
      const target = document.createElement("div");
      videoToolbarElement.prepend(target);
      setVideoToolbarContainer(target);
      return () => {
        target.remove();
      };
    }, [videoToolbarElement, bvId, chapterId, userId]);
    return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      progressBarElement && playerElement && require$$0.createPortal(
jsxRuntimeExports.jsx(SegmentBar, { isShadow: false, segments, duration: playerElement.duration }),
        progressBarElement
      ),
      shadowProgressBarElement && playerElement && require$$0.createPortal(
jsxRuntimeExports.jsx(SegmentBar, { isShadow: true, segments, duration: playerElement.duration }),
        shadowProgressBarElement
      ),
      videoToolbarElement && playerElement && videoToolbarContainer && bvId && chapterId && userId && require$$0.createPortal(
jsxRuntimeExports.jsx(
          ReportSegmentModal,
          {
            bvId,
            chapterId,
            userId,
            videoDuration: playerElement.duration,
            startTime,
            endTime,
            handleChangeStartTime: (reset = false) => {
              setStartTime(reset ? 0 : Number(playerElement.currentTime.toFixed(2)));
            },
            handleChangeEndTime: (reset = false) => {
              setEndTime(reset ? 0 : Number(playerElement.currentTime.toFixed(2)));
            },
            container: videoToolbarContainer,
            updateSegments: (newSegment) => setSegments([...segments, newSegment])
          }
        ),
        videoToolbarContainer
      )
    ] });
  };
  const playRateSelector = ".bpx-player-ctrl-playbackrate-result";
  const playRateMenuItem = "bpx-player-ctrl-playbackrate-menu-item";
  const MorePlayRate = () => {
    const { chapterId } = useVideo();
    React.useEffect(() => {
      if (!chapterId) return;
      waitForElement([playRateSelector], HTMLDivElement).then(() => {
        const playRateItems = document.getElementsByClassName(playRateMenuItem);
        console.log("[3x play] get playrate options length: " + playRateItems.length);
        for (const playRate of playRateItems) {
          if (playRate.getAttribute("data-value") === "0.75") {
            playRate.setAttribute("data-value", "3");
            playRate.innerText = "3.0x";
            console.log("[3x play] set 3x playrate successfully");
            return;
          }
        }
        console.log("[3x play] 0.75 playrate not found");
      }).catch((reason) => console.error(reason));
    }, [chapterId]);
    return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
  };
  ReactDOM.createRoot(
    (() => {
      const app = document.createElement("div", {});
      app.id = "bilicleaner-root";
      console.log("[BC] bilicleaner loading");
      document.body.append(app);
      return app;
    })()
  ).render(
jsxRuntimeExports.jsxs(React.StrictMode, { children: [
jsxRuntimeExports.jsx(SkipSegment, {}),
jsxRuntimeExports.jsx(MorePlayRate, {})
    ] })
  );

})(React, ReactDOM, dayjs);