115+

为115网盘添加一些功能

Fra og med 19.05.2024. Se den nyeste version.

// ==UserScript==
// @name         115+
// @namespace    npm/vite-plugin-monkey
// @version      1.0.0
// @author       monkey
// @description  为115网盘添加一些功能
// @license      MIT
// @icon         https://115.com/favicon.ico
// @match        https://115.com/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.prod.js
// @grant        GM_addStyle
// @grant        GM_getValue
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// ==/UserScript==

(e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const t=document.createElement("style");t.textContent=e,document.head.append(t)})(" .main[data-v-8fb240a8]{border-right:1px solid #edeeef;height:100%} ");

(function (vue) {
  'use strict';

  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var require_main_001 = __commonJS({
    "main-BzOViHoL.js"(exports, module) {
      let onceCbs = [];
      const paramsMap = /* @__PURE__ */ new WeakMap();
      function flushOnceCallbacks() {
        onceCbs.forEach((cb) => cb(...paramsMap.get(cb)));
        onceCbs = [];
      }
      function beforeNextFrameOnce(cb, ...params) {
        paramsMap.set(cb, params);
        if (onceCbs.includes(cb))
          return;
        onceCbs.push(cb) === 1 && requestAnimationFrame(flushOnceCallbacks);
      }
      function happensIn(e, dataSetPropName) {
        let { target } = e;
        while (target) {
          if (target.dataset) {
            if (target.dataset[dataSetPropName] !== void 0)
              return true;
          }
          target = target.parentElement;
        }
        return false;
      }
      function getPreciseEventTarget(event) {
        return event.composedPath()[0] || null;
      }
      function depx(value) {
        if (typeof value === "string") {
          if (value.endsWith("px")) {
            return Number(value.slice(0, value.length - 2));
          }
          return Number(value);
        }
        return value;
      }
      function getMargin(value, position) {
        const parts = value.trim().split(/\s+/g);
        const margin = {
          top: parts[0]
        };
        switch (parts.length) {
          case 1:
            margin.right = parts[0];
            margin.bottom = parts[0];
            margin.left = parts[0];
            break;
          case 2:
            margin.right = parts[1];
            margin.left = parts[1];
            margin.bottom = parts[0];
            break;
          case 3:
            margin.right = parts[1];
            margin.bottom = parts[2];
            margin.left = parts[1];
            break;
          case 4:
            margin.right = parts[1];
            margin.bottom = parts[2];
            margin.left = parts[3];
            break;
          default:
            throw new Error("[seemly/getMargin]:" + value + " is not a valid value.");
        }
        return margin;
      }
      const colors = {
        black: "#000",
        silver: "#C0C0C0",
        gray: "#808080",
        white: "#FFF",
        maroon: "#800000",
        red: "#F00",
        purple: "#800080",
        fuchsia: "#F0F",
        green: "#008000",
        lime: "#0F0",
        olive: "#808000",
        yellow: "#FF0",
        navy: "#000080",
        blue: "#00F",
        teal: "#008080",
        aqua: "#0FF",
        transparent: "#0000"
      };
      const prefix$1 = "^\\s*";
      const suffix = "\\s*$";
      const float = "\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*";
      const hex = "([0-9A-Fa-f])";
      const dhex = "([0-9A-Fa-f]{2})";
      const rgbRegex = new RegExp(`${prefix$1}rgb\\s*\\(${float},${float},${float}\\)${suffix}`);
      const rgbaRegex = new RegExp(`${prefix$1}rgba\\s*\\(${float},${float},${float},${float}\\)${suffix}`);
      const sHexRegex = new RegExp(`${prefix$1}#${hex}${hex}${hex}${suffix}`);
      const hexRegex = new RegExp(`${prefix$1}#${dhex}${dhex}${dhex}${suffix}`);
      const sHexaRegex = new RegExp(`${prefix$1}#${hex}${hex}${hex}${hex}${suffix}`);
      const hexaRegex = new RegExp(`${prefix$1}#${dhex}${dhex}${dhex}${dhex}${suffix}`);
      function parseHex(value) {
        return parseInt(value, 16);
      }
      function rgba(color) {
        try {
          let i;
          if (i = hexRegex.exec(color)) {
            return [parseHex(i[1]), parseHex(i[2]), parseHex(i[3]), 1];
          } else if (i = rgbRegex.exec(color)) {
            return [roundChannel(i[1]), roundChannel(i[5]), roundChannel(i[9]), 1];
          } else if (i = rgbaRegex.exec(color)) {
            return [
              roundChannel(i[1]),
              roundChannel(i[5]),
              roundChannel(i[9]),
              roundAlpha(i[13])
            ];
          } else if (i = sHexRegex.exec(color)) {
            return [
              parseHex(i[1] + i[1]),
              parseHex(i[2] + i[2]),
              parseHex(i[3] + i[3]),
              1
            ];
          } else if (i = hexaRegex.exec(color)) {
            return [
              parseHex(i[1]),
              parseHex(i[2]),
              parseHex(i[3]),
              roundAlpha(parseHex(i[4]) / 255)
            ];
          } else if (i = sHexaRegex.exec(color)) {
            return [
              parseHex(i[1] + i[1]),
              parseHex(i[2] + i[2]),
              parseHex(i[3] + i[3]),
              roundAlpha(parseHex(i[4] + i[4]) / 255)
            ];
          } else if (color in colors) {
            return rgba(colors[color]);
          }
          throw new Error(`[seemly/rgba]: Invalid color value ${color}.`);
        } catch (e) {
          throw e;
        }
      }
      function normalizeAlpha(alphaValue) {
        return alphaValue > 1 ? 1 : alphaValue < 0 ? 0 : alphaValue;
      }
      function stringifyRgba(r, g, b, a) {
        return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${normalizeAlpha(a)})`;
      }
      function compositeChannel(v1, a1, v2, a2, a) {
        return roundChannel((v1 * a1 * (1 - a2) + v2 * a2) / a);
      }
      function composite(background, overlay2) {
        if (!Array.isArray(background))
          background = rgba(background);
        if (!Array.isArray(overlay2))
          overlay2 = rgba(overlay2);
        const a1 = background[3];
        const a2 = overlay2[3];
        const alpha = roundAlpha(a1 + a2 - a1 * a2);
        return stringifyRgba(compositeChannel(background[0], a1, overlay2[0], a2, alpha), compositeChannel(background[1], a1, overlay2[1], a2, alpha), compositeChannel(background[2], a1, overlay2[2], a2, alpha), alpha);
      }
      function changeColor(base2, options) {
        const [r, g, b, a = 1] = Array.isArray(base2) ? base2 : rgba(base2);
        if (options.alpha) {
          return stringifyRgba(r, g, b, options.alpha);
        }
        return stringifyRgba(r, g, b, a);
      }
      function scaleColor(base2, options) {
        const [r, g, b, a = 1] = Array.isArray(base2) ? base2 : rgba(base2);
        const { lightness = 1, alpha = 1 } = options;
        return toRgbaString([r * lightness, g * lightness, b * lightness, a * alpha]);
      }
      function roundAlpha(value) {
        const v = Math.round(Number(value) * 100) / 100;
        if (v > 1)
          return 1;
        if (v < 0)
          return 0;
        return v;
      }
      function roundChannel(value) {
        const v = Math.round(Number(value));
        if (v > 255)
          return 255;
        if (v < 0)
          return 0;
        return v;
      }
      function toRgbaString(base2) {
        const [r, g, b] = base2;
        if (3 in base2) {
          return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, ${roundAlpha(base2[3])})`;
        }
        return `rgba(${roundChannel(r)}, ${roundChannel(g)}, ${roundChannel(b)}, 1)`;
      }
      function createId(length = 8) {
        return Math.random().toString(16).slice(2, 2 + length);
      }
      function keep(object, keys2 = [], rest) {
        const keepedObject = {};
        keys2.forEach((key) => {
          keepedObject[key] = object[key];
        });
        return Object.assign(keepedObject, rest);
      }
      function flatten$2(vNodes, filterCommentNode = true, result = []) {
        vNodes.forEach((vNode) => {
          if (vNode === null)
            return;
          if (typeof vNode !== "object") {
            if (typeof vNode === "string" || typeof vNode === "number") {
              result.push(vue.createTextVNode(String(vNode)));
            }
            return;
          }
          if (Array.isArray(vNode)) {
            flatten$2(vNode, filterCommentNode, result);
            return;
          }
          if (vNode.type === vue.Fragment) {
            if (vNode.children === null)
              return;
            if (Array.isArray(vNode.children)) {
              flatten$2(vNode.children, filterCommentNode, result);
            }
          } else {
            if (vNode.type === vue.Comment && filterCommentNode)
              return;
            result.push(vNode);
          }
        });
        return result;
      }
      function call(funcs, ...args) {
        if (Array.isArray(funcs)) {
          funcs.forEach((func) => call(func, ...args));
        } else
          return funcs(...args);
      }
      function keysOf(obj) {
        return Object.keys(obj);
      }
      const render$1 = (r, ...args) => {
        if (typeof r === "function") {
          return r(...args);
        } else if (typeof r === "string") {
          return vue.createTextVNode(r);
        } else if (typeof r === "number") {
          return vue.createTextVNode(String(r));
        } else {
          return null;
        }
      };
      function warn$2(location, message) {
        console.error(`[naive/${location}]: ${message}`);
      }
      function throwError(location, message) {
        throw new Error(`[naive/${location}]: ${message}`);
      }
      function getFirstSlotVNode(slots, slotName = "default", props = void 0) {
        const slot = slots[slotName];
        if (!slot) {
          warn$2("getFirstSlotVNode", `slot[${slotName}] is empty`);
          return null;
        }
        const slotContent = flatten$2(slot(props));
        if (slotContent.length === 1) {
          return slotContent[0];
        } else {
          warn$2("getFirstSlotVNode", `slot[${slotName}] should have exactly one child`);
          return null;
        }
      }
      function createRefSetter(ref2) {
        return (inst) => {
          if (inst) {
            ref2.value = inst.$el;
          } else {
            ref2.value = null;
          }
        };
      }
      function createInjectionKey(key) {
        return key;
      }
      function ensureValidVNode(vnodes) {
        return vnodes.some((child) => {
          if (!vue.isVNode(child)) {
            return true;
          }
          if (child.type === vue.Comment) {
            return false;
          }
          if (child.type === vue.Fragment && !ensureValidVNode(child.children)) {
            return false;
          }
          return true;
        }) ? vnodes : null;
      }
      function resolveWrappedSlot(slot, wrapper) {
        const children = slot && ensureValidVNode(slot());
        return wrapper(children || null);
      }
      function isSlotEmpty(slot) {
        return !(slot && ensureValidVNode(slot()));
      }
      const Wrapper = vue.defineComponent({
        render() {
          var _a, _b;
          return (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a);
        }
      });
      const pureNumberRegex = /^(\d|\.)+$/;
      const numberRegex = /(\d|\.)+/;
      function formatLength(length, {
        c: c2 = 1,
        offset = 0,
        attachPx = true
      } = {}) {
        if (typeof length === "number") {
          const result = (length + offset) * c2;
          if (result === 0)
            return "0";
          return `${result}px`;
        } else if (typeof length === "string") {
          if (pureNumberRegex.test(length)) {
            const result = (Number(length) + offset) * c2;
            if (attachPx) {
              if (result === 0)
                return "0";
              return `${result}px`;
            } else {
              return `${result}`;
            }
          } else {
            const result = numberRegex.exec(length);
            if (!result)
              return length;
            return length.replace(numberRegex, String((Number(result[0]) + offset) * c2));
          }
        }
        return length;
      }
      function rtlInset(inset) {
        const {
          left,
          right,
          top,
          bottom
        } = getMargin(inset);
        return `${top} ${right} ${bottom} ${left}`;
      }
      function ampCount(selector) {
        let cnt = 0;
        for (let i = 0; i < selector.length; ++i) {
          if (selector[i] === "&")
            ++cnt;
        }
        return cnt;
      }
      const separatorRegex = /\s*,(?![^(]*\))\s*/g;
      const extraSpaceRegex = /\s+/g;
      function resolveSelectorWithAmp(amp, selector) {
        const nextAmp = [];
        selector.split(separatorRegex).forEach((partialSelector) => {
          let round = ampCount(partialSelector);
          if (!round) {
            amp.forEach((partialAmp) => {
              nextAmp.push(
                // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
                (partialAmp && partialAmp + " ") + partialSelector
              );
            });
            return;
          } else if (round === 1) {
            amp.forEach((partialAmp) => {
              nextAmp.push(partialSelector.replace("&", partialAmp));
            });
            return;
          }
          let partialNextAmp = [
            partialSelector
          ];
          while (round--) {
            const nextPartialNextAmp = [];
            partialNextAmp.forEach((selectorItr) => {
              amp.forEach((partialAmp) => {
                nextPartialNextAmp.push(selectorItr.replace("&", partialAmp));
              });
            });
            partialNextAmp = nextPartialNextAmp;
          }
          partialNextAmp.forEach((part) => nextAmp.push(part));
        });
        return nextAmp;
      }
      function resolveSelector(amp, selector) {
        const nextAmp = [];
        selector.split(separatorRegex).forEach((partialSelector) => {
          amp.forEach((partialAmp) => {
            nextAmp.push((partialAmp && partialAmp + " ") + partialSelector);
          });
        });
        return nextAmp;
      }
      function parseSelectorPath(selectorPaths) {
        let amp = [""];
        selectorPaths.forEach((selector) => {
          selector = selector && selector.trim();
          if (
            // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
            !selector
          ) {
            return;
          }
          if (selector.includes("&")) {
            amp = resolveSelectorWithAmp(amp, selector);
          } else {
            amp = resolveSelector(amp, selector);
          }
        });
        return amp.join(", ").replace(extraSpaceRegex, " ");
      }
      function removeElement(el) {
        if (!el)
          return;
        const parentElement = el.parentElement;
        if (parentElement)
          parentElement.removeChild(el);
      }
      function queryElement(id, parent) {
        return (parent !== null && parent !== void 0 ? parent : document.head).querySelector(`style[cssr-id="${id}"]`);
      }
      function createElement(id) {
        const el = document.createElement("style");
        el.setAttribute("cssr-id", id);
        return el;
      }
      function isMediaOrSupports(selector) {
        if (!selector)
          return false;
        return /^\s*@(s|m)/.test(selector);
      }
      const kebabRegex = /[A-Z]/g;
      function kebabCase(pattern) {
        return pattern.replace(kebabRegex, (match) => "-" + match.toLowerCase());
      }
      function unwrapProperty(prop, indent = "  ") {
        if (typeof prop === "object" && prop !== null) {
          return " {\n" + Object.entries(prop).map((v) => {
            return indent + `  ${kebabCase(v[0])}: ${v[1]};`;
          }).join("\n") + "\n" + indent + "}";
        }
        return `: ${prop};`;
      }
      function unwrapProperties(props, instance, params) {
        if (typeof props === "function") {
          return props({
            context: instance.context,
            props: params
          });
        }
        return props;
      }
      function createStyle(selector, props, instance, params) {
        if (!props)
          return "";
        const unwrappedProps = unwrapProperties(props, instance, params);
        if (!unwrappedProps)
          return "";
        if (typeof unwrappedProps === "string") {
          return `${selector} {
${unwrappedProps}
}`;
        }
        const propertyNames = Object.keys(unwrappedProps);
        if (propertyNames.length === 0) {
          if (instance.config.keepEmptyBlock)
            return selector + " {\n}";
          return "";
        }
        const statements = selector ? [
          selector + " {"
        ] : [];
        propertyNames.forEach((propertyName) => {
          const property2 = unwrappedProps[propertyName];
          if (propertyName === "raw") {
            statements.push("\n" + property2 + "\n");
            return;
          }
          propertyName = kebabCase(propertyName);
          if (property2 !== null && property2 !== void 0) {
            statements.push(`  ${propertyName}${unwrapProperty(property2)}`);
          }
        });
        if (selector) {
          statements.push("}");
        }
        return statements.join("\n");
      }
      function loopCNodeListWithCallback(children, options, callback) {
        if (!children)
          return;
        children.forEach((child) => {
          if (Array.isArray(child)) {
            loopCNodeListWithCallback(child, options, callback);
          } else if (typeof child === "function") {
            const grandChildren = child(options);
            if (Array.isArray(grandChildren)) {
              loopCNodeListWithCallback(grandChildren, options, callback);
            } else if (grandChildren) {
              callback(grandChildren);
            }
          } else if (child) {
            callback(child);
          }
        });
      }
      function traverseCNode(node, selectorPaths, styles, instance, params) {
        const $ = node.$;
        let blockSelector = "";
        if (!$ || typeof $ === "string") {
          if (isMediaOrSupports($)) {
            blockSelector = $;
          } else {
            selectorPaths.push($);
          }
        } else if (typeof $ === "function") {
          const selector2 = $({
            context: instance.context,
            props: params
          });
          if (isMediaOrSupports(selector2)) {
            blockSelector = selector2;
          } else {
            selectorPaths.push(selector2);
          }
        } else {
          if ($.before)
            $.before(instance.context);
          if (!$.$ || typeof $.$ === "string") {
            if (isMediaOrSupports($.$)) {
              blockSelector = $.$;
            } else {
              selectorPaths.push($.$);
            }
          } else if ($.$) {
            const selector2 = $.$({
              context: instance.context,
              props: params
            });
            if (isMediaOrSupports(selector2)) {
              blockSelector = selector2;
            } else {
              selectorPaths.push(selector2);
            }
          }
        }
        const selector = parseSelectorPath(selectorPaths);
        const style2 = createStyle(selector, node.props, instance, params);
        if (blockSelector) {
          styles.push(`${blockSelector} {`);
        } else if (style2.length) {
          styles.push(style2);
        }
        if (node.children) {
          loopCNodeListWithCallback(node.children, {
            context: instance.context,
            props: params
          }, (childNode) => {
            if (typeof childNode === "string") {
              const style3 = createStyle(selector, { raw: childNode }, instance, params);
              styles.push(style3);
            } else {
              traverseCNode(childNode, selectorPaths, styles, instance, params);
            }
          });
        }
        selectorPaths.pop();
        if (blockSelector) {
          styles.push("}");
        }
        if ($ && $.after)
          $.after(instance.context);
      }
      function render(node, instance, props) {
        const styles = [];
        traverseCNode(node, [], styles, instance, props);
        return styles.join("\n\n");
      }
      function murmur2(str) {
        var h2 = 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 = /* Math.imul(k, m): */
          (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
          k ^= /* k >>> r: */
          k >>> 24;
          h2 = /* Math.imul(k, m): */
          (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
          (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
        }
        switch (len) {
          case 3:
            h2 ^= (str.charCodeAt(i + 2) & 255) << 16;
          case 2:
            h2 ^= (str.charCodeAt(i + 1) & 255) << 8;
          case 1:
            h2 ^= str.charCodeAt(i) & 255;
            h2 = /* Math.imul(h, m): */
            (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
        }
        h2 ^= h2 >>> 13;
        h2 = /* Math.imul(h, m): */
        (h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
        return ((h2 ^ h2 >>> 15) >>> 0).toString(36);
      }
      if (typeof window !== "undefined") {
        window.__cssrContext = {};
      }
      function unmount(instance, node, id, parent) {
        const { els } = node;
        if (id === void 0) {
          els.forEach(removeElement);
          node.els = [];
        } else {
          const target = queryElement(id, parent);
          if (target && els.includes(target)) {
            removeElement(target);
            node.els = els.filter((el) => el !== target);
          }
        }
      }
      function addElementToList(els, target) {
        els.push(target);
      }
      function mount(instance, node, id, props, head, force, anchorMetaName, parent, ssrAdapter2) {
        let style2;
        if (id === void 0) {
          style2 = node.render(props);
          id = murmur2(style2);
        }
        if (ssrAdapter2) {
          ssrAdapter2.adapter(id, style2 !== null && style2 !== void 0 ? style2 : node.render(props));
          return;
        }
        if (parent === void 0) {
          parent = document.head;
        }
        const queriedTarget = queryElement(id, parent);
        if (queriedTarget !== null && !force) {
          return queriedTarget;
        }
        const target = queriedTarget !== null && queriedTarget !== void 0 ? queriedTarget : createElement(id);
        if (style2 === void 0)
          style2 = node.render(props);
        target.textContent = style2;
        if (queriedTarget !== null)
          return queriedTarget;
        if (anchorMetaName) {
          const anchorMetaEl = parent.querySelector(`meta[name="${anchorMetaName}"]`);
          if (anchorMetaEl) {
            parent.insertBefore(target, anchorMetaEl);
            addElementToList(node.els, target);
            return target;
          }
        }
        if (head) {
          parent.insertBefore(target, parent.querySelector("style, link"));
        } else {
          parent.appendChild(target);
        }
        addElementToList(node.els, target);
        return target;
      }
      function wrappedRender(props) {
        return render(this, this.instance, props);
      }
      function wrappedMount(options = {}) {
        const { id, ssr, props, head = false, force = false, anchorMetaName, parent } = options;
        const targetElement = mount(this.instance, this, id, props, head, force, anchorMetaName, parent, ssr);
        return targetElement;
      }
      function wrappedUnmount(options = {}) {
        const { id, parent } = options;
        unmount(this.instance, this, id, parent);
      }
      const createCNode = function(instance, $, props, children) {
        return {
          instance,
          $,
          props,
          children,
          els: [],
          render: wrappedRender,
          mount: wrappedMount,
          unmount: wrappedUnmount
        };
      };
      const c$2 = function(instance, $, props, children) {
        if (Array.isArray($)) {
          return createCNode(instance, { $: null }, null, $);
        } else if (Array.isArray(props)) {
          return createCNode(instance, $, null, props);
        } else if (Array.isArray(children)) {
          return createCNode(instance, $, props, children);
        } else {
          return createCNode(instance, $, props, null);
        }
      };
      function CssRender(config = {}) {
        const cssr2 = {
          c: (...args) => c$2(cssr2, ...args),
          use: (plugin2, ...args) => plugin2.install(cssr2, ...args),
          find: queryElement,
          context: {},
          config
        };
        return cssr2;
      }
      function exists(id, ssr) {
        if (id === void 0)
          return false;
        if (ssr) {
          const { context: { ids } } = ssr;
          return ids.has(id);
        }
        return queryElement(id) !== null;
      }
      function plugin$1(options) {
        let _bPrefix = ".";
        let _ePrefix = "__";
        let _mPrefix = "--";
        let c2;
        if (options) {
          let t = options.blockPrefix;
          if (t) {
            _bPrefix = t;
          }
          t = options.elementPrefix;
          if (t) {
            _ePrefix = t;
          }
          t = options.modifierPrefix;
          if (t) {
            _mPrefix = t;
          }
        }
        const _plugin = {
          install(instance) {
            c2 = instance.c;
            const ctx2 = instance.context;
            ctx2.bem = {};
            ctx2.bem.b = null;
            ctx2.bem.els = null;
          }
        };
        function b(arg) {
          let memorizedB;
          let memorizedE;
          return {
            before(ctx2) {
              memorizedB = ctx2.bem.b;
              memorizedE = ctx2.bem.els;
              ctx2.bem.els = null;
            },
            after(ctx2) {
              ctx2.bem.b = memorizedB;
              ctx2.bem.els = memorizedE;
            },
            $({ context, props }) {
              arg = typeof arg === "string" ? arg : arg({ context, props });
              context.bem.b = arg;
              return `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}`;
            }
          };
        }
        function e(arg) {
          let memorizedE;
          return {
            before(ctx2) {
              memorizedE = ctx2.bem.els;
            },
            after(ctx2) {
              ctx2.bem.els = memorizedE;
            },
            $({ context, props }) {
              arg = typeof arg === "string" ? arg : arg({ context, props });
              context.bem.els = arg.split(",").map((v) => v.trim());
              return context.bem.els.map((el) => `${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${_ePrefix}${el}`).join(", ");
            }
          };
        }
        function m(arg) {
          return {
            $({ context, props }) {
              arg = typeof arg === "string" ? arg : arg({ context, props });
              const modifiers = arg.split(",").map((v) => v.trim());
              function elementToSelector(el) {
                return modifiers.map((modifier) => `&${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${el !== void 0 ? `${_ePrefix}${el}` : ""}${_mPrefix}${modifier}`).join(", ");
              }
              const els = context.bem.els;
              if (els !== null) {
                return elementToSelector(els[0]);
              } else {
                return elementToSelector();
              }
            }
          };
        }
        function notM(arg) {
          return {
            $({ context, props }) {
              arg = typeof arg === "string" ? arg : arg({ context, props });
              const els = context.bem.els;
              return `&:not(${(props === null || props === void 0 ? void 0 : props.bPrefix) || _bPrefix}${context.bem.b}${els !== null && els.length > 0 ? `${_ePrefix}${els[0]}` : ""}${_mPrefix}${arg})`;
            }
          };
        }
        const cB2 = (...args) => c2(b(args[0]), args[1], args[2]);
        const cE2 = (...args) => c2(e(args[0]), args[1], args[2]);
        const cM2 = (...args) => c2(m(args[0]), args[1], args[2]);
        const cNotM2 = (...args) => c2(notM(args[0]), args[1], args[2]);
        Object.assign(_plugin, {
          cB: cB2,
          cE: cE2,
          cM: cM2,
          cNotM: cNotM2
        });
        return _plugin;
      }
      const namespace = "n";
      const prefix = `.${namespace}-`;
      const elementPrefix = "__";
      const modifierPrefix = "--";
      const cssr = CssRender();
      const plugin = plugin$1({
        blockPrefix: prefix,
        elementPrefix,
        modifierPrefix
      });
      cssr.use(plugin);
      const {
        c: c$1,
        find
      } = cssr;
      const {
        cB,
        cE,
        cM,
        cNotM
      } = plugin;
      const cCB = (...args) => {
        return c$1(">", [cB(...args)]);
      };
      function createKey(prefix2, suffix2) {
        return prefix2 + (suffix2 === "default" ? "" : suffix2.replace(/^[a-z]/, (startChar) => startChar.toUpperCase()));
      }
      let _isJsdom;
      function isJsdom() {
        if (_isJsdom === void 0) {
          _isJsdom = navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom");
        }
        return _isJsdom;
      }
      function useDeferredTrue(valueRef, delay, shouldDelayRef) {
        const delayedRef = vue.ref(valueRef.value);
        let timerId = null;
        vue.watch(valueRef, (value) => {
          if (timerId !== null)
            window.clearTimeout(timerId);
          if (value === true) {
            if (shouldDelayRef && !shouldDelayRef.value) {
              delayedRef.value = true;
            } else {
              timerId = window.setTimeout(() => {
                delayedRef.value = true;
              }, delay);
            }
          } else {
            delayedRef.value = false;
          }
        });
        return delayedRef;
      }
      function useFalseUntilTruthy(originalRef) {
        const currentRef = vue.ref(!!originalRef.value);
        if (currentRef.value)
          return vue.readonly(currentRef);
        const stop = vue.watch(originalRef, (value) => {
          if (value) {
            currentRef.value = true;
            stop();
          }
        });
        return vue.readonly(currentRef);
      }
      function useMemo(getterOrOptions) {
        const computedValueRef = vue.computed(getterOrOptions);
        const valueRef = vue.ref(computedValueRef.value);
        vue.watch(computedValueRef, (value) => {
          valueRef.value = value;
        });
        if (typeof getterOrOptions === "function") {
          return valueRef;
        } else {
          return {
            __v_isRef: true,
            get value() {
              return valueRef.value;
            },
            set value(v) {
              getterOrOptions.set(v);
            }
          };
        }
      }
      function hasInstance() {
        return vue.getCurrentInstance() !== null;
      }
      const isBrowser$1 = typeof window !== "undefined";
      let fontsReady;
      let isFontReady;
      const init = () => {
        var _a, _b;
        fontsReady = isBrowser$1 ? (_b = (_a = document) === null || _a === void 0 ? void 0 : _a.fonts) === null || _b === void 0 ? void 0 : _b.ready : void 0;
        isFontReady = false;
        if (fontsReady !== void 0) {
          void fontsReady.then(() => {
            isFontReady = true;
          });
        } else {
          isFontReady = true;
        }
      };
      init();
      function onFontsReady(cb) {
        if (isFontReady)
          return;
        let deactivated = false;
        vue.onMounted(() => {
          if (!isFontReady) {
            fontsReady === null || fontsReady === void 0 ? void 0 : fontsReady.then(() => {
              if (deactivated)
                return;
              cb();
            });
          }
        });
        vue.onBeforeUnmount(() => {
          deactivated = true;
        });
      }
      function getEventTarget(e) {
        const path = e.composedPath();
        return path[0];
      }
      const traps = {
        mousemoveoutside: /* @__PURE__ */ new WeakMap(),
        clickoutside: /* @__PURE__ */ new WeakMap()
      };
      function createTrapHandler(name, el, originalHandler) {
        if (name === "mousemoveoutside") {
          const moveHandler = (e) => {
            if (el.contains(getEventTarget(e)))
              return;
            originalHandler(e);
          };
          return {
            mousemove: moveHandler,
            touchstart: moveHandler
          };
        } else if (name === "clickoutside") {
          let mouseDownOutside = false;
          const downHandler = (e) => {
            mouseDownOutside = !el.contains(getEventTarget(e));
          };
          const upHanlder = (e) => {
            if (!mouseDownOutside)
              return;
            if (el.contains(getEventTarget(e)))
              return;
            originalHandler(e);
          };
          return {
            mousedown: downHandler,
            mouseup: upHanlder,
            touchstart: downHandler,
            touchend: upHanlder
          };
        }
        console.error(
          // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
          `[evtd/create-trap-handler]: name \`${name}\` is invalid. This could be a bug of evtd.`
        );
        return {};
      }
      function ensureTrapHandlers(name, el, handler) {
        const handlers = traps[name];
        let elHandlers = handlers.get(el);
        if (elHandlers === void 0) {
          handlers.set(el, elHandlers = /* @__PURE__ */ new WeakMap());
        }
        let trapHandler = elHandlers.get(handler);
        if (trapHandler === void 0) {
          elHandlers.set(handler, trapHandler = createTrapHandler(name, el, handler));
        }
        return trapHandler;
      }
      function trapOn(name, el, handler, options) {
        if (name === "mousemoveoutside" || name === "clickoutside") {
          const trapHandlers = ensureTrapHandlers(name, el, handler);
          Object.keys(trapHandlers).forEach((key) => {
            on(key, document, trapHandlers[key], options);
          });
          return true;
        }
        return false;
      }
      function trapOff(name, el, handler, options) {
        if (name === "mousemoveoutside" || name === "clickoutside") {
          const trapHandlers = ensureTrapHandlers(name, el, handler);
          Object.keys(trapHandlers).forEach((key) => {
            off(key, document, trapHandlers[key], options);
          });
          return true;
        }
        return false;
      }
      function createDelegate() {
        if (typeof window === "undefined") {
          return {
            on: () => {
            },
            off: () => {
            }
          };
        }
        const propagationStopped = /* @__PURE__ */ new WeakMap();
        const immediatePropagationStopped = /* @__PURE__ */ new WeakMap();
        function trackPropagation() {
          propagationStopped.set(this, true);
        }
        function trackImmediate() {
          propagationStopped.set(this, true);
          immediatePropagationStopped.set(this, true);
        }
        function spy(event, propName, fn) {
          const source = event[propName];
          event[propName] = function() {
            fn.apply(event, arguments);
            return source.apply(event, arguments);
          };
          return event;
        }
        function unspy(event, propName) {
          event[propName] = Event.prototype[propName];
        }
        const currentTargets = /* @__PURE__ */ new WeakMap();
        const currentTargetDescriptor = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
        function getCurrentTarget() {
          var _a;
          return (_a = currentTargets.get(this)) !== null && _a !== void 0 ? _a : null;
        }
        function defineCurrentTarget(event, getter) {
          if (currentTargetDescriptor === void 0)
            return;
          Object.defineProperty(event, "currentTarget", {
            configurable: true,
            enumerable: true,
            get: getter !== null && getter !== void 0 ? getter : currentTargetDescriptor.get
          });
        }
        const phaseToTypeToElToHandlers = {
          bubble: {},
          capture: {}
        };
        const typeToWindowEventHandlers = {};
        function createUnifiedHandler() {
          const delegeteHandler = function(e) {
            const { type, eventPhase, bubbles } = e;
            const target = getEventTarget(e);
            if (eventPhase === 2)
              return;
            const phase = eventPhase === 1 ? "capture" : "bubble";
            let cursor = target;
            const path = [];
            while (true) {
              if (cursor === null)
                cursor = window;
              path.push(cursor);
              if (cursor === window) {
                break;
              }
              cursor = cursor.parentNode || null;
            }
            const captureElToHandlers = phaseToTypeToElToHandlers.capture[type];
            const bubbleElToHandlers = phaseToTypeToElToHandlers.bubble[type];
            spy(e, "stopPropagation", trackPropagation);
            spy(e, "stopImmediatePropagation", trackImmediate);
            defineCurrentTarget(e, getCurrentTarget);
            if (phase === "capture") {
              if (captureElToHandlers === void 0)
                return;
              for (let i = path.length - 1; i >= 0; --i) {
                if (propagationStopped.has(e))
                  break;
                const target2 = path[i];
                const handlers = captureElToHandlers.get(target2);
                if (handlers !== void 0) {
                  currentTargets.set(e, target2);
                  for (const handler of handlers) {
                    if (immediatePropagationStopped.has(e))
                      break;
                    handler(e);
                  }
                }
                if (i === 0 && !bubbles && bubbleElToHandlers !== void 0) {
                  const bubbleHandlers = bubbleElToHandlers.get(target2);
                  if (bubbleHandlers !== void 0) {
                    for (const handler of bubbleHandlers) {
                      if (immediatePropagationStopped.has(e))
                        break;
                      handler(e);
                    }
                  }
                }
              }
            } else if (phase === "bubble") {
              if (bubbleElToHandlers === void 0)
                return;
              for (let i = 0; i < path.length; ++i) {
                if (propagationStopped.has(e))
                  break;
                const target2 = path[i];
                const handlers = bubbleElToHandlers.get(target2);
                if (handlers !== void 0) {
                  currentTargets.set(e, target2);
                  for (const handler of handlers) {
                    if (immediatePropagationStopped.has(e))
                      break;
                    handler(e);
                  }
                }
              }
            }
            unspy(e, "stopPropagation");
            unspy(e, "stopImmediatePropagation");
            defineCurrentTarget(e);
          };
          delegeteHandler.displayName = "evtdUnifiedHandler";
          return delegeteHandler;
        }
        function createUnifiedWindowEventHandler() {
          const delegateHandler = function(e) {
            const { type, eventPhase } = e;
            if (eventPhase !== 2)
              return;
            const handlers = typeToWindowEventHandlers[type];
            if (handlers === void 0)
              return;
            handlers.forEach((handler) => handler(e));
          };
          delegateHandler.displayName = "evtdUnifiedWindowEventHandler";
          return delegateHandler;
        }
        const unifiedHandler = createUnifiedHandler();
        const unfiendWindowEventHandler = createUnifiedWindowEventHandler();
        function ensureElToHandlers(phase, type) {
          const phaseHandlers = phaseToTypeToElToHandlers[phase];
          if (phaseHandlers[type] === void 0) {
            phaseHandlers[type] = /* @__PURE__ */ new Map();
            window.addEventListener(type, unifiedHandler, phase === "capture");
          }
          return phaseHandlers[type];
        }
        function ensureWindowEventHandlers(type) {
          const windowEventHandlers = typeToWindowEventHandlers[type];
          if (windowEventHandlers === void 0) {
            typeToWindowEventHandlers[type] = /* @__PURE__ */ new Set();
            window.addEventListener(type, unfiendWindowEventHandler);
          }
          return typeToWindowEventHandlers[type];
        }
        function ensureHandlers(elToHandlers, el) {
          let elHandlers = elToHandlers.get(el);
          if (elHandlers === void 0) {
            elToHandlers.set(el, elHandlers = /* @__PURE__ */ new Set());
          }
          return elHandlers;
        }
        function handlerExist(el, phase, type, handler) {
          const elToHandlers = phaseToTypeToElToHandlers[phase][type];
          if (elToHandlers !== void 0) {
            const handlers = elToHandlers.get(el);
            if (handlers !== void 0) {
              if (handlers.has(handler))
                return true;
            }
          }
          return false;
        }
        function windowEventHandlerExist(type, handler) {
          const handlers = typeToWindowEventHandlers[type];
          if (handlers !== void 0) {
            if (handlers.has(handler)) {
              return true;
            }
          }
          return false;
        }
        function on2(type, el, handler, options) {
          let mergedHandler;
          if (typeof options === "object" && options.once === true) {
            mergedHandler = (e) => {
              off2(type, el, mergedHandler, options);
              handler(e);
            };
          } else {
            mergedHandler = handler;
          }
          const trapped = trapOn(type, el, mergedHandler, options);
          if (trapped)
            return;
          const phase = options === true || typeof options === "object" && options.capture === true ? "capture" : "bubble";
          const elToHandlers = ensureElToHandlers(phase, type);
          const handlers = ensureHandlers(elToHandlers, el);
          if (!handlers.has(mergedHandler))
            handlers.add(mergedHandler);
          if (el === window) {
            const windowEventHandlers = ensureWindowEventHandlers(type);
            if (!windowEventHandlers.has(mergedHandler)) {
              windowEventHandlers.add(mergedHandler);
            }
          }
        }
        function off2(type, el, handler, options) {
          const trapped = trapOff(type, el, handler, options);
          if (trapped)
            return;
          const capture = options === true || typeof options === "object" && options.capture === true;
          const phase = capture ? "capture" : "bubble";
          const elToHandlers = ensureElToHandlers(phase, type);
          const handlers = ensureHandlers(elToHandlers, el);
          if (el === window) {
            const mirrorPhase = capture ? "bubble" : "capture";
            if (!handlerExist(el, mirrorPhase, type, handler) && windowEventHandlerExist(type, handler)) {
              const windowEventHandlers = typeToWindowEventHandlers[type];
              windowEventHandlers.delete(handler);
              if (windowEventHandlers.size === 0) {
                window.removeEventListener(type, unfiendWindowEventHandler);
                typeToWindowEventHandlers[type] = void 0;
              }
            }
          }
          if (handlers.has(handler))
            handlers.delete(handler);
          if (handlers.size === 0) {
            elToHandlers.delete(el);
          }
          if (elToHandlers.size === 0) {
            window.removeEventListener(type, unifiedHandler, phase === "capture");
            phaseToTypeToElToHandlers[phase][type] = void 0;
          }
        }
        return {
          on: on2,
          off: off2
        };
      }
      const { on, off } = createDelegate();
      function useMergedState(controlledStateRef, uncontrolledStateRef) {
        vue.watch(controlledStateRef, (value) => {
          if (value !== void 0) {
            uncontrolledStateRef.value = value;
          }
        });
        return vue.computed(() => {
          if (controlledStateRef.value === void 0) {
            return uncontrolledStateRef.value;
          }
          return controlledStateRef.value;
        });
      }
      function isMounted() {
        const isMounted2 = vue.ref(false);
        vue.onMounted(() => {
          isMounted2.value = true;
        });
        return vue.readonly(isMounted2);
      }
      function useCompitable(reactive2, keys2) {
        return vue.computed(() => {
          for (const key of keys2) {
            if (reactive2[key] !== void 0)
              return reactive2[key];
          }
          return reactive2[keys2[keys2.length - 1]];
        });
      }
      const isIos = (typeof window === "undefined" ? false : /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
      !window.MSStream;
      function useIsIos() {
        return isIos;
      }
      function useKeyboard(options = {}, enabledRef) {
        const state = vue.reactive({
          ctrl: false,
          command: false,
          win: false,
          shift: false,
          tab: false
        });
        const { keydown, keyup } = options;
        const keydownHandler = (e) => {
          switch (e.key) {
            case "Control":
              state.ctrl = true;
              break;
            case "Meta":
              state.command = true;
              state.win = true;
              break;
            case "Shift":
              state.shift = true;
              break;
            case "Tab":
              state.tab = true;
              break;
          }
          if (keydown !== void 0) {
            Object.keys(keydown).forEach((key) => {
              if (key !== e.key)
                return;
              const handler = keydown[key];
              if (typeof handler === "function") {
                handler(e);
              } else {
                const { stop = false, prevent = false } = handler;
                if (stop)
                  e.stopPropagation();
                if (prevent)
                  e.preventDefault();
                handler.handler(e);
              }
            });
          }
        };
        const keyupHandler = (e) => {
          switch (e.key) {
            case "Control":
              state.ctrl = false;
              break;
            case "Meta":
              state.command = false;
              state.win = false;
              break;
            case "Shift":
              state.shift = false;
              break;
            case "Tab":
              state.tab = false;
              break;
          }
          if (keyup !== void 0) {
            Object.keys(keyup).forEach((key) => {
              if (key !== e.key)
                return;
              const handler = keyup[key];
              if (typeof handler === "function") {
                handler(e);
              } else {
                const { stop = false, prevent = false } = handler;
                if (stop)
                  e.stopPropagation();
                if (prevent)
                  e.preventDefault();
                handler.handler(e);
              }
            });
          }
        };
        const setup = () => {
          if (enabledRef === void 0 || enabledRef.value) {
            on("keydown", document, keydownHandler);
            on("keyup", document, keyupHandler);
          }
          if (enabledRef !== void 0) {
            vue.watch(enabledRef, (value) => {
              if (value) {
                on("keydown", document, keydownHandler);
                on("keyup", document, keyupHandler);
              } else {
                off("keydown", document, keydownHandler);
                off("keyup", document, keyupHandler);
              }
            });
          }
        };
        if (hasInstance()) {
          vue.onBeforeMount(setup);
          vue.onBeforeUnmount(() => {
            if (enabledRef === void 0 || enabledRef.value) {
              off("keydown", document, keydownHandler);
              off("keyup", document, keyupHandler);
            }
          });
        } else {
          setup();
        }
        return vue.readonly(state);
      }
      const internalSelectionMenuBodyInjectionKey = createInjectionKey("n-internal-select-menu-body");
      const modalBodyInjectionKey = createInjectionKey("n-modal-body");
      const drawerBodyInjectionKey = createInjectionKey("n-drawer-body");
      const popoverBodyInjectionKey = createInjectionKey("n-popover-body");
      const teleportDisabled = "__disabled__";
      function useAdjustedTo(props) {
        const modal = vue.inject(modalBodyInjectionKey, null);
        const drawer = vue.inject(drawerBodyInjectionKey, null);
        const popover = vue.inject(popoverBodyInjectionKey, null);
        const selectMenu = vue.inject(internalSelectionMenuBodyInjectionKey, null);
        const fullscreenElementRef = vue.ref();
        if (typeof document !== "undefined") {
          fullscreenElementRef.value = document.fullscreenElement;
          const handleFullscreenChange = () => {
            fullscreenElementRef.value = document.fullscreenElement;
          };
          vue.onMounted(() => {
            on("fullscreenchange", document, handleFullscreenChange);
          });
          vue.onBeforeUnmount(() => {
            off("fullscreenchange", document, handleFullscreenChange);
          });
        }
        return useMemo(() => {
          var _a;
          const {
            to
          } = props;
          if (to !== void 0) {
            if (to === false)
              return teleportDisabled;
            if (to === true)
              return fullscreenElementRef.value || "body";
            return to;
          }
          if (modal === null || modal === void 0 ? void 0 : modal.value) {
            return (_a = modal.value.$el) !== null && _a !== void 0 ? _a : modal.value;
          }
          if (drawer === null || drawer === void 0 ? void 0 : drawer.value)
            return drawer.value;
          if (popover === null || popover === void 0 ? void 0 : popover.value)
            return popover.value;
          if (selectMenu === null || selectMenu === void 0 ? void 0 : selectMenu.value)
            return selectMenu.value;
          return to !== null && to !== void 0 ? to : fullscreenElementRef.value || "body";
        });
      }
      useAdjustedTo.tdkey = teleportDisabled;
      useAdjustedTo.propTo = {
        type: [String, Object, Boolean],
        default: void 0
      };
      function getSlot(scope, slots, slotName = "default") {
        const slot = slots[slotName];
        if (slot === void 0) {
          throw new Error(`[vueuc/${scope}]: slot[${slotName}] is empty.`);
        }
        return slot();
      }
      function flatten$1(vNodes, filterCommentNode = true, result = []) {
        vNodes.forEach((vNode) => {
          if (vNode === null)
            return;
          if (typeof vNode !== "object") {
            if (typeof vNode === "string" || typeof vNode === "number") {
              result.push(vue.createTextVNode(String(vNode)));
            }
            return;
          }
          if (Array.isArray(vNode)) {
            flatten$1(vNode, filterCommentNode, result);
            return;
          }
          if (vNode.type === vue.Fragment) {
            if (vNode.children === null)
              return;
            if (Array.isArray(vNode.children)) {
              flatten$1(vNode.children, filterCommentNode, result);
            }
          } else if (vNode.type !== vue.Comment) {
            result.push(vNode);
          }
        });
        return result;
      }
      function getFirstVNode(scope, slots, slotName = "default") {
        const slot = slots[slotName];
        if (slot === void 0) {
          throw new Error(`[vueuc/${scope}]: slot[${slotName}] is empty.`);
        }
        const content = flatten$1(slot());
        if (content.length === 1) {
          return content[0];
        } else {
          throw new Error(`[vueuc/${scope}]: slot[${slotName}] should have exactly one child.`);
        }
      }
      let viewMeasurer = null;
      function ensureViewBoundingRect() {
        if (viewMeasurer === null) {
          viewMeasurer = document.getElementById("v-binder-view-measurer");
          if (viewMeasurer === null) {
            viewMeasurer = document.createElement("div");
            viewMeasurer.id = "v-binder-view-measurer";
            const { style: style2 } = viewMeasurer;
            style2.position = "fixed";
            style2.left = "0";
            style2.right = "0";
            style2.top = "0";
            style2.bottom = "0";
            style2.pointerEvents = "none";
            style2.visibility = "hidden";
            document.body.appendChild(viewMeasurer);
          }
        }
        return viewMeasurer.getBoundingClientRect();
      }
      function getPointRect(x, y) {
        const viewRect = ensureViewBoundingRect();
        return {
          top: y,
          left: x,
          height: 0,
          width: 0,
          right: viewRect.width - x,
          bottom: viewRect.height - y
        };
      }
      function getRect(el) {
        const elRect = el.getBoundingClientRect();
        const viewRect = ensureViewBoundingRect();
        return {
          left: elRect.left - viewRect.left,
          top: elRect.top - viewRect.top,
          bottom: viewRect.height + viewRect.top - elRect.bottom,
          right: viewRect.width + viewRect.left - elRect.right,
          width: elRect.width,
          height: elRect.height
        };
      }
      function getParentNode(node) {
        if (node.nodeType === 9) {
          return null;
        }
        return node.parentNode;
      }
      function getScrollParent(node) {
        if (node === null)
          return null;
        const parentNode = getParentNode(node);
        if (parentNode === null) {
          return null;
        }
        if (parentNode.nodeType === 9) {
          return document;
        }
        if (parentNode.nodeType === 1) {
          const { overflow, overflowX, overflowY } = getComputedStyle(parentNode);
          if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
            return parentNode;
          }
        }
        return getScrollParent(parentNode);
      }
      const Binder = vue.defineComponent({
        name: "Binder",
        props: {
          syncTargetWithParent: Boolean,
          syncTarget: {
            type: Boolean,
            default: true
          }
        },
        setup(props) {
          var _a;
          vue.provide("VBinder", (_a = vue.getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
          const VBinder = vue.inject("VBinder", null);
          const targetRef = vue.ref(null);
          const setTargetRef = (el) => {
            targetRef.value = el;
            if (VBinder && props.syncTargetWithParent) {
              VBinder.setTargetRef(el);
            }
          };
          let scrollableNodes = [];
          const ensureScrollListener = () => {
            let cursor = targetRef.value;
            while (true) {
              cursor = getScrollParent(cursor);
              if (cursor === null)
                break;
              scrollableNodes.push(cursor);
            }
            for (const el of scrollableNodes) {
              on("scroll", el, onScroll, true);
            }
          };
          const removeScrollListeners = () => {
            for (const el of scrollableNodes) {
              off("scroll", el, onScroll, true);
            }
            scrollableNodes = [];
          };
          const followerScrollListeners = /* @__PURE__ */ new Set();
          const addScrollListener = (listener) => {
            if (followerScrollListeners.size === 0) {
              ensureScrollListener();
            }
            if (!followerScrollListeners.has(listener)) {
              followerScrollListeners.add(listener);
            }
          };
          const removeScrollListener = (listener) => {
            if (followerScrollListeners.has(listener)) {
              followerScrollListeners.delete(listener);
            }
            if (followerScrollListeners.size === 0) {
              removeScrollListeners();
            }
          };
          const onScroll = () => {
            beforeNextFrameOnce(onScrollRaf);
          };
          const onScrollRaf = () => {
            followerScrollListeners.forEach((listener) => listener());
          };
          const followerResizeListeners = /* @__PURE__ */ new Set();
          const addResizeListener = (listener) => {
            if (followerResizeListeners.size === 0) {
              on("resize", window, onResize);
            }
            if (!followerResizeListeners.has(listener)) {
              followerResizeListeners.add(listener);
            }
          };
          const removeResizeListener = (listener) => {
            if (followerResizeListeners.has(listener)) {
              followerResizeListeners.delete(listener);
            }
            if (followerResizeListeners.size === 0) {
              off("resize", window, onResize);
            }
          };
          const onResize = () => {
            followerResizeListeners.forEach((listener) => listener());
          };
          vue.onBeforeUnmount(() => {
            off("resize", window, onResize);
            removeScrollListeners();
          });
          return {
            targetRef,
            setTargetRef,
            addScrollListener,
            removeScrollListener,
            addResizeListener,
            removeResizeListener
          };
        },
        render() {
          return getSlot("binder", this.$slots);
        }
      });
      const VTarget = vue.defineComponent({
        name: "Target",
        setup() {
          const { setTargetRef, syncTarget } = vue.inject("VBinder");
          const setTargetDirective = {
            mounted: setTargetRef,
            updated: setTargetRef
          };
          return {
            syncTarget,
            setTargetDirective
          };
        },
        render() {
          const { syncTarget, setTargetDirective } = this;
          if (syncTarget) {
            return vue.withDirectives(getFirstVNode("follower", this.$slots), [
              [setTargetDirective]
            ]);
          }
          return getFirstVNode("follower", this.$slots);
        }
      });
      const ctxKey$1 = "@@mmoContext";
      const mousemoveoutside = {
        mounted(el, { value }) {
          el[ctxKey$1] = {
            handler: void 0
          };
          if (typeof value === "function") {
            el[ctxKey$1].handler = value;
            on("mousemoveoutside", el, value);
          }
        },
        updated(el, { value }) {
          const ctx2 = el[ctxKey$1];
          if (typeof value === "function") {
            if (ctx2.handler) {
              if (ctx2.handler !== value) {
                off("mousemoveoutside", el, ctx2.handler);
                ctx2.handler = value;
                on("mousemoveoutside", el, value);
              }
            } else {
              el[ctxKey$1].handler = value;
              on("mousemoveoutside", el, value);
            }
          } else {
            if (ctx2.handler) {
              off("mousemoveoutside", el, ctx2.handler);
              ctx2.handler = void 0;
            }
          }
        },
        unmounted(el) {
          const { handler } = el[ctxKey$1];
          if (handler) {
            off("mousemoveoutside", el, handler);
          }
          el[ctxKey$1].handler = void 0;
        }
      };
      const ctxKey = "@@coContext";
      const clickoutside = {
        mounted(el, { value, modifiers }) {
          el[ctxKey] = {
            handler: void 0
          };
          if (typeof value === "function") {
            el[ctxKey].handler = value;
            on("clickoutside", el, value, {
              capture: modifiers.capture
            });
          }
        },
        updated(el, { value, modifiers }) {
          const ctx2 = el[ctxKey];
          if (typeof value === "function") {
            if (ctx2.handler) {
              if (ctx2.handler !== value) {
                off("clickoutside", el, ctx2.handler, {
                  capture: modifiers.capture
                });
                ctx2.handler = value;
                on("clickoutside", el, value, {
                  capture: modifiers.capture
                });
              }
            } else {
              el[ctxKey].handler = value;
              on("clickoutside", el, value, {
                capture: modifiers.capture
              });
            }
          } else {
            if (ctx2.handler) {
              off("clickoutside", el, ctx2.handler, {
                capture: modifiers.capture
              });
              ctx2.handler = void 0;
            }
          }
        },
        unmounted(el, { modifiers }) {
          const { handler } = el[ctxKey];
          if (handler) {
            off("clickoutside", el, handler, {
              capture: modifiers.capture
            });
          }
          el[ctxKey].handler = void 0;
        }
      };
      function warn$1(location, message) {
        console.error(`[vdirs/${location}]: ${message}`);
      }
      class ZIndexManager {
        constructor() {
          this.elementZIndex = /* @__PURE__ */ new Map();
          this.nextZIndex = 2e3;
        }
        get elementCount() {
          return this.elementZIndex.size;
        }
        ensureZIndex(el, zIndex) {
          const { elementZIndex } = this;
          if (zIndex !== void 0) {
            el.style.zIndex = `${zIndex}`;
            elementZIndex.delete(el);
            return;
          }
          const { nextZIndex } = this;
          if (elementZIndex.has(el)) {
            const currentZIndex = elementZIndex.get(el);
            if (currentZIndex + 1 === this.nextZIndex)
              return;
          }
          el.style.zIndex = `${nextZIndex}`;
          elementZIndex.set(el, nextZIndex);
          this.nextZIndex = nextZIndex + 1;
          this.squashState();
        }
        unregister(el, zIndex) {
          const { elementZIndex } = this;
          if (elementZIndex.has(el)) {
            elementZIndex.delete(el);
          } else if (zIndex === void 0) {
            warn$1("z-index-manager/unregister-element", "Element not found when unregistering.");
          }
          this.squashState();
        }
        squashState() {
          const { elementCount } = this;
          if (!elementCount) {
            this.nextZIndex = 2e3;
          }
          if (this.nextZIndex - elementCount > 2500)
            this.rearrange();
        }
        rearrange() {
          const elementZIndexPair = Array.from(this.elementZIndex.entries());
          elementZIndexPair.sort((pair1, pair2) => {
            return pair1[1] - pair2[1];
          });
          this.nextZIndex = 2e3;
          elementZIndexPair.forEach((pair) => {
            const el = pair[0];
            const zIndex = this.nextZIndex++;
            if (`${zIndex}` !== el.style.zIndex)
              el.style.zIndex = `${zIndex}`;
          });
        }
      }
      const zIndexManager = new ZIndexManager();
      const ctx = "@@ziContext";
      const zindexable = {
        mounted(el, bindings) {
          const { value = {} } = bindings;
          const { zIndex, enabled } = value;
          el[ctx] = {
            enabled: !!enabled,
            initialized: false
          };
          if (enabled) {
            zIndexManager.ensureZIndex(el, zIndex);
            el[ctx].initialized = true;
          }
        },
        updated(el, bindings) {
          const { value = {} } = bindings;
          const { zIndex, enabled } = value;
          const cachedEnabled = el[ctx].enabled;
          if (enabled && !cachedEnabled) {
            zIndexManager.ensureZIndex(el, zIndex);
            el[ctx].initialized = true;
          }
          el[ctx].enabled = !!enabled;
        },
        unmounted(el, bindings) {
          if (!el[ctx].initialized)
            return;
          const { value = {} } = bindings;
          const { zIndex } = value;
          zIndexManager.unregister(el, zIndex);
        }
      };
      const ssrContextKey = "@css-render/vue3-ssr";
      function createStyleString(id, style2) {
        return `<style cssr-id="${id}">
${style2}
</style>`;
      }
      function ssrAdapter(id, style2, ssrContext) {
        const { styles, ids } = ssrContext;
        if (ids.has(id))
          return;
        if (styles !== null) {
          ids.add(id);
          styles.push(createStyleString(id, style2));
        }
      }
      const isBrowser = typeof document !== "undefined";
      function useSsrAdapter() {
        if (isBrowser)
          return void 0;
        const context = vue.inject(ssrContextKey, null);
        if (context === null)
          return void 0;
        return {
          adapter: (id, style2) => ssrAdapter(id, style2, context),
          context
        };
      }
      function warn(location, message) {
        console.error(`[vueuc/${location}]: ${message}`);
      }
      const { c } = CssRender();
      const cssrAnchorMetaName$1 = "vueuc-style";
      function resolveTo(selector) {
        if (typeof selector === "string") {
          return document.querySelector(selector);
        }
        return selector();
      }
      const LazyTeleport = vue.defineComponent({
        name: "LazyTeleport",
        props: {
          to: {
            type: [String, Object],
            default: void 0
          },
          disabled: Boolean,
          show: {
            type: Boolean,
            required: true
          }
        },
        setup(props) {
          return {
            showTeleport: useFalseUntilTruthy(vue.toRef(props, "show")),
            mergedTo: vue.computed(() => {
              const { to } = props;
              return to !== null && to !== void 0 ? to : "body";
            })
          };
        },
        render() {
          return this.showTeleport ? this.disabled ? getSlot("lazy-teleport", this.$slots) : vue.h(vue.Teleport, {
            disabled: this.disabled,
            to: this.mergedTo
          }, getSlot("lazy-teleport", this.$slots)) : null;
        }
      });
      const oppositionPositions = {
        top: "bottom",
        bottom: "top",
        left: "right",
        right: "left"
      };
      const oppositeAligns = {
        start: "end",
        center: "center",
        end: "start"
      };
      const propToCompare = {
        top: "height",
        bottom: "height",
        left: "width",
        right: "width"
      };
      const transformOrigins = {
        "bottom-start": "top left",
        bottom: "top center",
        "bottom-end": "top right",
        "top-start": "bottom left",
        top: "bottom center",
        "top-end": "bottom right",
        "right-start": "top left",
        right: "center left",
        "right-end": "bottom left",
        "left-start": "top right",
        left: "center right",
        "left-end": "bottom right"
      };
      const overlapTransformOrigin = {
        "bottom-start": "bottom left",
        bottom: "bottom center",
        "bottom-end": "bottom right",
        "top-start": "top left",
        top: "top center",
        "top-end": "top right",
        "right-start": "top right",
        right: "center right",
        "right-end": "bottom right",
        "left-start": "top left",
        left: "center left",
        "left-end": "bottom left"
      };
      const oppositeAlignCssPositionProps = {
        "bottom-start": "right",
        "bottom-end": "left",
        "top-start": "right",
        "top-end": "left",
        "right-start": "bottom",
        "right-end": "top",
        "left-start": "bottom",
        "left-end": "top"
      };
      const keepOffsetDirection = {
        top: true,
        bottom: false,
        left: true,
        right: false
        // left--
      };
      const cssPositionToOppositeAlign = {
        top: "end",
        bottom: "start",
        left: "end",
        right: "start"
      };
      function getPlacementAndOffsetOfFollower(placement, targetRect, followerRect, shift, flip, overlap) {
        if (!flip || overlap) {
          return { placement, top: 0, left: 0 };
        }
        const [position, align] = placement.split("-");
        let properAlign = align !== null && align !== void 0 ? align : "center";
        let properOffset = {
          top: 0,
          left: 0
        };
        const deriveOffset = (oppositeAlignCssSizeProp, alignCssPositionProp, offsetVertically2) => {
          let left = 0;
          let top = 0;
          const diff = followerRect[oppositeAlignCssSizeProp] - targetRect[alignCssPositionProp] - targetRect[oppositeAlignCssSizeProp];
          if (diff > 0 && shift) {
            if (offsetVertically2) {
              top = keepOffsetDirection[alignCssPositionProp] ? diff : -diff;
            } else {
              left = keepOffsetDirection[alignCssPositionProp] ? diff : -diff;
            }
          }
          return {
            left,
            top
          };
        };
        const offsetVertically = position === "left" || position === "right";
        if (properAlign !== "center") {
          const oppositeAlignCssPositionProp = oppositeAlignCssPositionProps[placement];
          const currentAlignCssPositionProp = oppositionPositions[oppositeAlignCssPositionProp];
          const oppositeAlignCssSizeProp = propToCompare[oppositeAlignCssPositionProp];
          if (followerRect[oppositeAlignCssSizeProp] > targetRect[oppositeAlignCssSizeProp]) {
            if (
              // current space is not enough
              // ----------[ target ]---------|
              // -------[     follower        ]
              targetRect[oppositeAlignCssPositionProp] + targetRect[oppositeAlignCssSizeProp] < followerRect[oppositeAlignCssSizeProp]
            ) {
              const followerOverTargetSize = (followerRect[oppositeAlignCssSizeProp] - targetRect[oppositeAlignCssSizeProp]) / 2;
              if (targetRect[oppositeAlignCssPositionProp] < followerOverTargetSize || targetRect[currentAlignCssPositionProp] < followerOverTargetSize) {
                if (targetRect[oppositeAlignCssPositionProp] < targetRect[currentAlignCssPositionProp]) {
                  properAlign = oppositeAligns[align];
                  properOffset = deriveOffset(oppositeAlignCssSizeProp, currentAlignCssPositionProp, offsetVertically);
                } else {
                  properOffset = deriveOffset(oppositeAlignCssSizeProp, oppositeAlignCssPositionProp, offsetVertically);
                }
              } else {
                properAlign = "center";
              }
            }
          } else if (followerRect[oppositeAlignCssSizeProp] < targetRect[oppositeAlignCssSizeProp]) {
            if (targetRect[currentAlignCssPositionProp] < 0 && // opposite align has larger space
            // ------------[   target   ]
            // ----------------[follower]
            targetRect[oppositeAlignCssPositionProp] > targetRect[currentAlignCssPositionProp]) {
              properAlign = oppositeAligns[align];
            }
          }
        } else {
          const possibleAlternativeAlignCssPositionProp1 = position === "bottom" || position === "top" ? "left" : "top";
          const possibleAlternativeAlignCssPositionProp2 = oppositionPositions[possibleAlternativeAlignCssPositionProp1];
          const alternativeAlignCssSizeProp = propToCompare[possibleAlternativeAlignCssPositionProp1];
          const followerOverTargetSize = (followerRect[alternativeAlignCssSizeProp] - targetRect[alternativeAlignCssSizeProp]) / 2;
          if (
            // center is not enough
            // ----------- [ target ]--|
            // -------[     follower     ]
            targetRect[possibleAlternativeAlignCssPositionProp1] < followerOverTargetSize || targetRect[possibleAlternativeAlignCssPositionProp2] < followerOverTargetSize
          ) {
            if (targetRect[possibleAlternativeAlignCssPositionProp1] > targetRect[possibleAlternativeAlignCssPositionProp2]) {
              properAlign = cssPositionToOppositeAlign[possibleAlternativeAlignCssPositionProp1];
              properOffset = deriveOffset(alternativeAlignCssSizeProp, possibleAlternativeAlignCssPositionProp1, offsetVertically);
            } else {
              properAlign = cssPositionToOppositeAlign[possibleAlternativeAlignCssPositionProp2];
              properOffset = deriveOffset(alternativeAlignCssSizeProp, possibleAlternativeAlignCssPositionProp2, offsetVertically);
            }
          }
        }
        let properPosition = position;
        if (
          // space is not enough
          targetRect[position] < followerRect[propToCompare[position]] && // opposite position's space is larger
          targetRect[position] < targetRect[oppositionPositions[position]]
        ) {
          properPosition = oppositionPositions[position];
        }
        return {
          placement: properAlign !== "center" ? `${properPosition}-${properAlign}` : properPosition,
          left: properOffset.left,
          top: properOffset.top
        };
      }
      function getProperTransformOrigin(placement, overlap) {
        if (overlap)
          return overlapTransformOrigin[placement];
        return transformOrigins[placement];
      }
      function getOffset(placement, offsetRect, targetRect, offsetTopToStandardPlacement, offsetLeftToStandardPlacement, overlap) {
        if (overlap) {
          switch (placement) {
            case "bottom-start":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left)}px`,
                transform: "translateY(-100%)"
              };
            case "bottom-end":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
                transform: "translateX(-100%) translateY(-100%)"
              };
            case "top-start":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left)}px`,
                transform: ""
              };
            case "top-end":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
                transform: "translateX(-100%)"
              };
            case "right-start":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
                transform: "translateX(-100%)"
              };
            case "right-end":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
                transform: "translateX(-100%) translateY(-100%)"
              };
            case "left-start":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left)}px`,
                transform: ""
              };
            case "left-end":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left)}px`,
                transform: "translateY(-100%)"
              };
            case "top":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2)}px`,
                transform: "translateX(-50%)"
              };
            case "right":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width)}px`,
                transform: "translateX(-100%) translateY(-50%)"
              };
            case "left":
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left)}px`,
                transform: "translateY(-50%)"
              };
            case "bottom":
            default:
              return {
                top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height)}px`,
                left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2)}px`,
                transform: "translateX(-50%) translateY(-100%)"
              };
          }
        }
        switch (placement) {
          case "bottom-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
              transform: ""
            };
          case "bottom-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
              transform: "translateX(-100%)"
            };
          case "top-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
              transform: "translateY(-100%)"
            };
          case "top-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
              transform: "translateX(-100%) translateY(-100%)"
            };
          case "right-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
              transform: ""
            };
          case "right-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
              transform: "translateY(-100%)"
            };
          case "left-start":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
              transform: "translateX(-100%)"
            };
          case "left-end":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
              transform: "translateX(-100%) translateY(-100%)"
            };
          case "top":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2 + offsetLeftToStandardPlacement)}px`,
              transform: "translateY(-100%) translateX(-50%)"
            };
          case "right":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2 + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width + offsetLeftToStandardPlacement)}px`,
              transform: "translateY(-50%)"
            };
          case "left":
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height / 2 + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + offsetLeftToStandardPlacement)}px`,
              transform: "translateY(-50%) translateX(-100%)"
            };
          case "bottom":
          default:
            return {
              top: `${Math.round(targetRect.top - offsetRect.top + targetRect.height + offsetTopToStandardPlacement)}px`,
              left: `${Math.round(targetRect.left - offsetRect.left + targetRect.width / 2 + offsetLeftToStandardPlacement)}px`,
              transform: "translateX(-50%)"
            };
        }
      }
      const style$7 = c([
        c(".v-binder-follower-container", {
          position: "absolute",
          left: "0",
          right: "0",
          top: "0",
          height: "0",
          pointerEvents: "none",
          zIndex: "auto"
        }),
        c(".v-binder-follower-content", {
          position: "absolute",
          zIndex: "auto"
        }, [
          c("> *", {
            pointerEvents: "all"
          })
        ])
      ]);
      const VFollower = vue.defineComponent({
        name: "Follower",
        inheritAttrs: false,
        props: {
          show: Boolean,
          enabled: {
            type: Boolean,
            default: void 0
          },
          placement: {
            type: String,
            default: "bottom"
          },
          syncTrigger: {
            type: Array,
            default: ["resize", "scroll"]
          },
          to: [String, Object],
          flip: {
            type: Boolean,
            default: true
          },
          internalShift: Boolean,
          x: Number,
          y: Number,
          width: String,
          minWidth: String,
          containerClass: String,
          teleportDisabled: Boolean,
          zindexable: {
            type: Boolean,
            default: true
          },
          zIndex: Number,
          overlap: Boolean
        },
        setup(props) {
          const VBinder = vue.inject("VBinder");
          const mergedEnabledRef = useMemo(() => {
            return props.enabled !== void 0 ? props.enabled : props.show;
          });
          const followerRef = vue.ref(null);
          const offsetContainerRef = vue.ref(null);
          const ensureListeners = () => {
            const { syncTrigger } = props;
            if (syncTrigger.includes("scroll")) {
              VBinder.addScrollListener(syncPosition);
            }
            if (syncTrigger.includes("resize")) {
              VBinder.addResizeListener(syncPosition);
            }
          };
          const removeListeners = () => {
            VBinder.removeScrollListener(syncPosition);
            VBinder.removeResizeListener(syncPosition);
          };
          vue.onMounted(() => {
            if (mergedEnabledRef.value) {
              syncPosition();
              ensureListeners();
            }
          });
          const ssrAdapter2 = useSsrAdapter();
          style$7.mount({
            id: "vueuc/binder",
            head: true,
            anchorMetaName: cssrAnchorMetaName$1,
            ssr: ssrAdapter2
          });
          vue.onBeforeUnmount(() => {
            removeListeners();
          });
          onFontsReady(() => {
            if (mergedEnabledRef.value) {
              syncPosition();
            }
          });
          const syncPosition = () => {
            if (!mergedEnabledRef.value) {
              return;
            }
            const follower = followerRef.value;
            if (follower === null)
              return;
            const target = VBinder.targetRef;
            const { x, y, overlap } = props;
            const targetRect = x !== void 0 && y !== void 0 ? getPointRect(x, y) : getRect(target);
            follower.style.setProperty("--v-target-width", `${Math.round(targetRect.width)}px`);
            follower.style.setProperty("--v-target-height", `${Math.round(targetRect.height)}px`);
            const { width, minWidth, placement, internalShift, flip } = props;
            follower.setAttribute("v-placement", placement);
            if (overlap) {
              follower.setAttribute("v-overlap", "");
            } else {
              follower.removeAttribute("v-overlap");
            }
            const { style: style2 } = follower;
            if (width === "target") {
              style2.width = `${targetRect.width}px`;
            } else if (width !== void 0) {
              style2.width = width;
            } else {
              style2.width = "";
            }
            if (minWidth === "target") {
              style2.minWidth = `${targetRect.width}px`;
            } else if (minWidth !== void 0) {
              style2.minWidth = minWidth;
            } else {
              style2.minWidth = "";
            }
            const followerRect = getRect(follower);
            const offsetContainerRect = getRect(offsetContainerRef.value);
            const { left: offsetLeftToStandardPlacement, top: offsetTopToStandardPlacement, placement: properPlacement } = getPlacementAndOffsetOfFollower(placement, targetRect, followerRect, internalShift, flip, overlap);
            const properTransformOrigin = getProperTransformOrigin(properPlacement, overlap);
            const { left, top, transform } = getOffset(properPlacement, offsetContainerRect, targetRect, offsetTopToStandardPlacement, offsetLeftToStandardPlacement, overlap);
            follower.setAttribute("v-placement", properPlacement);
            follower.style.setProperty("--v-offset-left", `${Math.round(offsetLeftToStandardPlacement)}px`);
            follower.style.setProperty("--v-offset-top", `${Math.round(offsetTopToStandardPlacement)}px`);
            follower.style.transform = `translateX(${left}) translateY(${top}) ${transform}`;
            follower.style.setProperty("--v-transform-origin", properTransformOrigin);
            follower.style.transformOrigin = properTransformOrigin;
          };
          vue.watch(mergedEnabledRef, (value) => {
            if (value) {
              ensureListeners();
              syncOnNextTick();
            } else {
              removeListeners();
            }
          });
          const syncOnNextTick = () => {
            vue.nextTick().then(syncPosition).catch((e) => console.error(e));
          };
          [
            "placement",
            "x",
            "y",
            "internalShift",
            "flip",
            "width",
            "overlap",
            "minWidth"
          ].forEach((prop) => {
            vue.watch(vue.toRef(props, prop), syncPosition);
          });
          ["teleportDisabled"].forEach((prop) => {
            vue.watch(vue.toRef(props, prop), syncOnNextTick);
          });
          vue.watch(vue.toRef(props, "syncTrigger"), (value) => {
            if (!value.includes("resize")) {
              VBinder.removeResizeListener(syncPosition);
            } else {
              VBinder.addResizeListener(syncPosition);
            }
            if (!value.includes("scroll")) {
              VBinder.removeScrollListener(syncPosition);
            } else {
              VBinder.addScrollListener(syncPosition);
            }
          });
          const isMountedRef = isMounted();
          const mergedToRef = useMemo(() => {
            const { to } = props;
            if (to !== void 0)
              return to;
            if (isMountedRef.value) {
              return void 0;
            }
            return void 0;
          });
          return {
            VBinder,
            mergedEnabled: mergedEnabledRef,
            offsetContainerRef,
            followerRef,
            mergedTo: mergedToRef,
            syncPosition
          };
        },
        render() {
          return vue.h(LazyTeleport, {
            show: this.show,
            to: this.mergedTo,
            disabled: this.teleportDisabled
          }, {
            default: () => {
              var _a, _b;
              const vNode = vue.h("div", {
                class: ["v-binder-follower-container", this.containerClass],
                ref: "offsetContainerRef"
              }, [
                vue.h("div", {
                  class: "v-binder-follower-content",
                  ref: "followerRef"
                }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a))
              ]);
              if (this.zindexable) {
                return vue.withDirectives(vNode, [
                  [
                    zindexable,
                    {
                      enabled: this.mergedEnabled,
                      zIndex: this.zIndex
                    }
                  ]
                ]);
              }
              return vNode;
            }
          });
        }
      });
      var resizeObservers = [];
      var hasActiveObservations = function() {
        return resizeObservers.some(function(ro) {
          return ro.activeTargets.length > 0;
        });
      };
      var hasSkippedObservations = function() {
        return resizeObservers.some(function(ro) {
          return ro.skippedTargets.length > 0;
        });
      };
      var msg = "ResizeObserver loop completed with undelivered notifications.";
      var deliverResizeLoopError = function() {
        var event;
        if (typeof ErrorEvent === "function") {
          event = new ErrorEvent("error", {
            message: msg
          });
        } else {
          event = document.createEvent("Event");
          event.initEvent("error", false, false);
          event.message = msg;
        }
        window.dispatchEvent(event);
      };
      var ResizeObserverBoxOptions;
      (function(ResizeObserverBoxOptions2) {
        ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box";
        ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box";
        ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box";
      })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
      var freeze = function(obj) {
        return Object.freeze(obj);
      };
      var ResizeObserverSize = /* @__PURE__ */ function() {
        function ResizeObserverSize2(inlineSize, blockSize) {
          this.inlineSize = inlineSize;
          this.blockSize = blockSize;
          freeze(this);
        }
        return ResizeObserverSize2;
      }();
      var DOMRectReadOnly = function() {
        function DOMRectReadOnly2(x, y, width, height) {
          this.x = x;
          this.y = y;
          this.width = width;
          this.height = height;
          this.top = this.y;
          this.left = this.x;
          this.bottom = this.top + this.height;
          this.right = this.left + this.width;
          return freeze(this);
        }
        DOMRectReadOnly2.prototype.toJSON = function() {
          var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height;
          return { x, y, top, right, bottom, left, width, height };
        };
        DOMRectReadOnly2.fromRect = function(rectangle) {
          return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
        };
        return DOMRectReadOnly2;
      }();
      var isSVG = function(target) {
        return target instanceof SVGElement && "getBBox" in target;
      };
      var isHidden = function(target) {
        if (isSVG(target)) {
          var _a = target.getBBox(), width = _a.width, height = _a.height;
          return !width && !height;
        }
        var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight;
        return !(offsetWidth || offsetHeight || target.getClientRects().length);
      };
      var isElement = function(obj) {
        var _a;
        if (obj instanceof Element) {
          return true;
        }
        var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
        return !!(scope && obj instanceof scope.Element);
      };
      var isReplacedElement = function(target) {
        switch (target.tagName) {
          case "INPUT":
            if (target.type !== "image") {
              break;
            }
          case "VIDEO":
          case "AUDIO":
          case "EMBED":
          case "OBJECT":
          case "CANVAS":
          case "IFRAME":
          case "IMG":
            return true;
        }
        return false;
      };
      var global$1 = typeof window !== "undefined" ? window : {};
      var cache = /* @__PURE__ */ new WeakMap();
      var scrollRegexp = /auto|scroll/;
      var verticalRegexp = /^tb|vertical/;
      var IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent);
      var parseDimension = function(pixel) {
        return parseFloat(pixel || "0");
      };
      var size = function(inlineSize, blockSize, switchSizes) {
        if (inlineSize === void 0) {
          inlineSize = 0;
        }
        if (blockSize === void 0) {
          blockSize = 0;
        }
        if (switchSizes === void 0) {
          switchSizes = false;
        }
        return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
      };
      var zeroBoxes = freeze({
        devicePixelContentBoxSize: size(),
        borderBoxSize: size(),
        contentBoxSize: size(),
        contentRect: new DOMRectReadOnly(0, 0, 0, 0)
      });
      var calculateBoxSizes = function(target, forceRecalculation) {
        if (forceRecalculation === void 0) {
          forceRecalculation = false;
        }
        if (cache.has(target) && !forceRecalculation) {
          return cache.get(target);
        }
        if (isHidden(target)) {
          cache.set(target, zeroBoxes);
          return zeroBoxes;
        }
        var cs = getComputedStyle(target);
        var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
        var removePadding = !IE && cs.boxSizing === "border-box";
        var switchSizes = verticalRegexp.test(cs.writingMode || "");
        var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || "");
        var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || "");
        var paddingTop = svg ? 0 : parseDimension(cs.paddingTop);
        var paddingRight = svg ? 0 : parseDimension(cs.paddingRight);
        var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom);
        var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft);
        var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth);
        var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth);
        var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth);
        var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth);
        var horizontalPadding = paddingLeft + paddingRight;
        var verticalPadding = paddingTop + paddingBottom;
        var horizontalBorderArea = borderLeft + borderRight;
        var verticalBorderArea = borderTop + borderBottom;
        var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;
        var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;
        var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;
        var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;
        var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;
        var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;
        var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;
        var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;
        var boxes = freeze({
          devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
          borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes),
          contentBoxSize: size(contentWidth, contentHeight, switchSizes),
          contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)
        });
        cache.set(target, boxes);
        return boxes;
      };
      var calculateBoxSize = function(target, observedBox, forceRecalculation) {
        var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
        switch (observedBox) {
          case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
            return devicePixelContentBoxSize;
          case ResizeObserverBoxOptions.BORDER_BOX:
            return borderBoxSize;
          default:
            return contentBoxSize;
        }
      };
      var ResizeObserverEntry = /* @__PURE__ */ function() {
        function ResizeObserverEntry2(target) {
          var boxes = calculateBoxSizes(target);
          this.target = target;
          this.contentRect = boxes.contentRect;
          this.borderBoxSize = freeze([boxes.borderBoxSize]);
          this.contentBoxSize = freeze([boxes.contentBoxSize]);
          this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
        }
        return ResizeObserverEntry2;
      }();
      var calculateDepthForNode = function(node) {
        if (isHidden(node)) {
          return Infinity;
        }
        var depth = 0;
        var parent = node.parentNode;
        while (parent) {
          depth += 1;
          parent = parent.parentNode;
        }
        return depth;
      };
      var broadcastActiveObservations = function() {
        var shallowestDepth = Infinity;
        var callbacks2 = [];
        resizeObservers.forEach(function processObserver(ro) {
          if (ro.activeTargets.length === 0) {
            return;
          }
          var entries = [];
          ro.activeTargets.forEach(function processTarget(ot) {
            var entry = new ResizeObserverEntry(ot.target);
            var targetDepth = calculateDepthForNode(ot.target);
            entries.push(entry);
            ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
            if (targetDepth < shallowestDepth) {
              shallowestDepth = targetDepth;
            }
          });
          callbacks2.push(function resizeObserverCallback() {
            ro.callback.call(ro.observer, entries, ro.observer);
          });
          ro.activeTargets.splice(0, ro.activeTargets.length);
        });
        for (var _i = 0, callbacks_1 = callbacks2; _i < callbacks_1.length; _i++) {
          var callback = callbacks_1[_i];
          callback();
        }
        return shallowestDepth;
      };
      var gatherActiveObservationsAtDepth = function(depth) {
        resizeObservers.forEach(function processObserver(ro) {
          ro.activeTargets.splice(0, ro.activeTargets.length);
          ro.skippedTargets.splice(0, ro.skippedTargets.length);
          ro.observationTargets.forEach(function processTarget(ot) {
            if (ot.isActive()) {
              if (calculateDepthForNode(ot.target) > depth) {
                ro.activeTargets.push(ot);
              } else {
                ro.skippedTargets.push(ot);
              }
            }
          });
        });
      };
      var process = function() {
        var depth = 0;
        gatherActiveObservationsAtDepth(depth);
        while (hasActiveObservations()) {
          depth = broadcastActiveObservations();
          gatherActiveObservationsAtDepth(depth);
        }
        if (hasSkippedObservations()) {
          deliverResizeLoopError();
        }
        return depth > 0;
      };
      var trigger;
      var callbacks = [];
      var notify = function() {
        return callbacks.splice(0).forEach(function(cb) {
          return cb();
        });
      };
      var queueMicroTask = function(callback) {
        if (!trigger) {
          var toggle_1 = 0;
          var el_1 = document.createTextNode("");
          var config = { characterData: true };
          new MutationObserver(function() {
            return notify();
          }).observe(el_1, config);
          trigger = function() {
            el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
          };
        }
        callbacks.push(callback);
        trigger();
      };
      var queueResizeObserver = function(cb) {
        queueMicroTask(function ResizeObserver2() {
          requestAnimationFrame(cb);
        });
      };
      var watching = 0;
      var isWatching = function() {
        return !!watching;
      };
      var CATCH_PERIOD = 250;
      var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };
      var events = [
        "resize",
        "load",
        "transitionend",
        "animationend",
        "animationstart",
        "animationiteration",
        "keyup",
        "keydown",
        "mouseup",
        "mousedown",
        "mouseover",
        "mouseout",
        "blur",
        "focus"
      ];
      var time = function(timeout) {
        if (timeout === void 0) {
          timeout = 0;
        }
        return Date.now() + timeout;
      };
      var scheduled = false;
      var Scheduler = function() {
        function Scheduler2() {
          var _this = this;
          this.stopped = true;
          this.listener = function() {
            return _this.schedule();
          };
        }
        Scheduler2.prototype.run = function(timeout) {
          var _this = this;
          if (timeout === void 0) {
            timeout = CATCH_PERIOD;
          }
          if (scheduled) {
            return;
          }
          scheduled = true;
          var until = time(timeout);
          queueResizeObserver(function() {
            var elementsHaveResized = false;
            try {
              elementsHaveResized = process();
            } finally {
              scheduled = false;
              timeout = until - time();
              if (!isWatching()) {
                return;
              }
              if (elementsHaveResized) {
                _this.run(1e3);
              } else if (timeout > 0) {
                _this.run(timeout);
              } else {
                _this.start();
              }
            }
          });
        };
        Scheduler2.prototype.schedule = function() {
          this.stop();
          this.run();
        };
        Scheduler2.prototype.observe = function() {
          var _this = this;
          var cb = function() {
            return _this.observer && _this.observer.observe(document.body, observerConfig);
          };
          document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
        };
        Scheduler2.prototype.start = function() {
          var _this = this;
          if (this.stopped) {
            this.stopped = false;
            this.observer = new MutationObserver(this.listener);
            this.observe();
            events.forEach(function(name) {
              return global$1.addEventListener(name, _this.listener, true);
            });
          }
        };
        Scheduler2.prototype.stop = function() {
          var _this = this;
          if (!this.stopped) {
            this.observer && this.observer.disconnect();
            events.forEach(function(name) {
              return global$1.removeEventListener(name, _this.listener, true);
            });
            this.stopped = true;
          }
        };
        return Scheduler2;
      }();
      var scheduler = new Scheduler();
      var updateCount = function(n) {
        !watching && n > 0 && scheduler.start();
        watching += n;
        !watching && scheduler.stop();
      };
      var skipNotifyOnElement = function(target) {
        return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
      };
      var ResizeObservation = function() {
        function ResizeObservation2(target, observedBox) {
          this.target = target;
          this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;
          this.lastReportedSize = {
            inlineSize: 0,
            blockSize: 0
          };
        }
        ResizeObservation2.prototype.isActive = function() {
          var size2 = calculateBoxSize(this.target, this.observedBox, true);
          if (skipNotifyOnElement(this.target)) {
            this.lastReportedSize = size2;
          }
          if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) {
            return true;
          }
          return false;
        };
        return ResizeObservation2;
      }();
      var ResizeObserverDetail = /* @__PURE__ */ function() {
        function ResizeObserverDetail2(resizeObserver, callback) {
          this.activeTargets = [];
          this.skippedTargets = [];
          this.observationTargets = [];
          this.observer = resizeObserver;
          this.callback = callback;
        }
        return ResizeObserverDetail2;
      }();
      var observerMap = /* @__PURE__ */ new WeakMap();
      var getObservationIndex = function(observationTargets, target) {
        for (var i = 0; i < observationTargets.length; i += 1) {
          if (observationTargets[i].target === target) {
            return i;
          }
        }
        return -1;
      };
      var ResizeObserverController = function() {
        function ResizeObserverController2() {
        }
        ResizeObserverController2.connect = function(resizeObserver, callback) {
          var detail = new ResizeObserverDetail(resizeObserver, callback);
          observerMap.set(resizeObserver, detail);
        };
        ResizeObserverController2.observe = function(resizeObserver, target, options) {
          var detail = observerMap.get(resizeObserver);
          var firstObservation = detail.observationTargets.length === 0;
          if (getObservationIndex(detail.observationTargets, target) < 0) {
            firstObservation && resizeObservers.push(detail);
            detail.observationTargets.push(new ResizeObservation(target, options && options.box));
            updateCount(1);
            scheduler.schedule();
          }
        };
        ResizeObserverController2.unobserve = function(resizeObserver, target) {
          var detail = observerMap.get(resizeObserver);
          var index = getObservationIndex(detail.observationTargets, target);
          var lastObservation = detail.observationTargets.length === 1;
          if (index >= 0) {
            lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
            detail.observationTargets.splice(index, 1);
            updateCount(-1);
          }
        };
        ResizeObserverController2.disconnect = function(resizeObserver) {
          var _this = this;
          var detail = observerMap.get(resizeObserver);
          detail.observationTargets.slice().forEach(function(ot) {
            return _this.unobserve(resizeObserver, ot.target);
          });
          detail.activeTargets.splice(0, detail.activeTargets.length);
        };
        return ResizeObserverController2;
      }();
      var ResizeObserver = function() {
        function ResizeObserver2(callback) {
          if (arguments.length === 0) {
            throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
          }
          if (typeof callback !== "function") {
            throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
          }
          ResizeObserverController.connect(this, callback);
        }
        ResizeObserver2.prototype.observe = function(target, options) {
          if (arguments.length === 0) {
            throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
          }
          if (!isElement(target)) {
            throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
          }
          ResizeObserverController.observe(this, target, options);
        };
        ResizeObserver2.prototype.unobserve = function(target) {
          if (arguments.length === 0) {
            throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
          }
          if (!isElement(target)) {
            throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
          }
          ResizeObserverController.unobserve(this, target);
        };
        ResizeObserver2.prototype.disconnect = function() {
          ResizeObserverController.disconnect(this);
        };
        ResizeObserver2.toString = function() {
          return "function ResizeObserver () { [polyfill code] }";
        };
        return ResizeObserver2;
      }();
      class ResizeObserverDelegate {
        constructor() {
          this.handleResize = this.handleResize.bind(this);
          this.observer = new (typeof window !== "undefined" && window.ResizeObserver || ResizeObserver)(this.handleResize);
          this.elHandlersMap = /* @__PURE__ */ new Map();
        }
        handleResize(entries) {
          for (const entry of entries) {
            const handler = this.elHandlersMap.get(entry.target);
            if (handler !== void 0) {
              handler(entry);
            }
          }
        }
        registerHandler(el, handler) {
          this.elHandlersMap.set(el, handler);
          this.observer.observe(el);
        }
        unregisterHandler(el) {
          if (!this.elHandlersMap.has(el)) {
            return;
          }
          this.elHandlersMap.delete(el);
          this.observer.unobserve(el);
        }
      }
      const resizeObserverManager = new ResizeObserverDelegate();
      const VResizeObserver = vue.defineComponent({
        name: "ResizeObserver",
        props: {
          onResize: Function
        },
        setup(props) {
          let registered = false;
          const proxy = vue.getCurrentInstance().proxy;
          function handleResize(entry) {
            const { onResize } = props;
            if (onResize !== void 0)
              onResize(entry);
          }
          vue.onMounted(() => {
            const el = proxy.$el;
            if (el === void 0) {
              warn("resize-observer", "$el does not exist.");
              return;
            }
            if (el.nextElementSibling !== el.nextSibling) {
              if (el.nodeType === 3 && el.nodeValue !== "") {
                warn("resize-observer", "$el can not be observed (it may be a text node).");
                return;
              }
            }
            if (el.nextElementSibling !== null) {
              resizeObserverManager.registerHandler(el.nextElementSibling, handleResize);
              registered = true;
            }
          });
          vue.onBeforeUnmount(() => {
            if (registered) {
              resizeObserverManager.unregisterHandler(proxy.$el.nextElementSibling);
            }
          });
        },
        render() {
          return vue.renderSlot(this.$slots, "default");
        }
      });
      const hiddenAttr = "v-hidden";
      const style$6 = c("[v-hidden]", {
        display: "none!important"
      });
      const VOverflow = vue.defineComponent({
        name: "Overflow",
        props: {
          getCounter: Function,
          getTail: Function,
          updateCounter: Function,
          onUpdateCount: Function,
          onUpdateOverflow: Function
        },
        setup(props, { slots }) {
          const selfRef = vue.ref(null);
          const counterRef = vue.ref(null);
          function deriveCounter(options) {
            const { value: self2 } = selfRef;
            const { getCounter, getTail } = props;
            let counter;
            if (getCounter !== void 0)
              counter = getCounter();
            else {
              counter = counterRef.value;
            }
            if (!self2 || !counter)
              return;
            if (counter.hasAttribute(hiddenAttr)) {
              counter.removeAttribute(hiddenAttr);
            }
            const { children } = self2;
            if (options.showAllItemsBeforeCalculate) {
              for (const child of children) {
                if (child.hasAttribute(hiddenAttr)) {
                  child.removeAttribute(hiddenAttr);
                }
              }
            }
            const containerWidth = self2.offsetWidth;
            const childWidths = [];
            const tail = slots.tail ? getTail === null || getTail === void 0 ? void 0 : getTail() : null;
            let childWidthSum = tail ? tail.offsetWidth : 0;
            let overflow = false;
            const len = self2.children.length - (slots.tail ? 1 : 0);
            for (let i = 0; i < len - 1; ++i) {
              if (i < 0)
                continue;
              const child = children[i];
              if (overflow) {
                if (!child.hasAttribute(hiddenAttr)) {
                  child.setAttribute(hiddenAttr, "");
                }
                continue;
              } else if (child.hasAttribute(hiddenAttr)) {
                child.removeAttribute(hiddenAttr);
              }
              const childWidth = child.offsetWidth;
              childWidthSum += childWidth;
              childWidths[i] = childWidth;
              if (childWidthSum > containerWidth) {
                const { updateCounter } = props;
                for (let j = i; j >= 0; --j) {
                  const restCount = len - 1 - j;
                  if (updateCounter !== void 0) {
                    updateCounter(restCount);
                  } else {
                    counter.textContent = `${restCount}`;
                  }
                  const counterWidth = counter.offsetWidth;
                  childWidthSum -= childWidths[j];
                  if (childWidthSum + counterWidth <= containerWidth || j === 0) {
                    overflow = true;
                    i = j - 1;
                    if (tail) {
                      if (i === -1) {
                        tail.style.maxWidth = `${containerWidth - counterWidth}px`;
                        tail.style.boxSizing = "border-box";
                      } else {
                        tail.style.maxWidth = "";
                      }
                    }
                    const { onUpdateCount } = props;
                    if (onUpdateCount)
                      onUpdateCount(restCount);
                    break;
                  }
                }
              }
            }
            const { onUpdateOverflow } = props;
            if (!overflow) {
              if (onUpdateOverflow !== void 0) {
                onUpdateOverflow(false);
              }
              counter.setAttribute(hiddenAttr, "");
            } else {
              if (onUpdateOverflow !== void 0) {
                onUpdateOverflow(true);
              }
            }
          }
          const ssrAdapter2 = useSsrAdapter();
          style$6.mount({
            id: "vueuc/overflow",
            head: true,
            anchorMetaName: cssrAnchorMetaName$1,
            ssr: ssrAdapter2
          });
          vue.onMounted(() => deriveCounter({
            showAllItemsBeforeCalculate: false
          }));
          return {
            selfRef,
            counterRef,
            sync: deriveCounter
          };
        },
        render() {
          const { $slots } = this;
          vue.nextTick(() => this.sync({
            showAllItemsBeforeCalculate: false
          }));
          return vue.h("div", {
            class: "v-overflow",
            ref: "selfRef"
          }, [
            vue.renderSlot($slots, "default"),
            // $slots.counter should only has 1 element
            $slots.counter ? $slots.counter() : vue.h("span", {
              style: {
                display: "inline-block"
              },
              ref: "counterRef"
            }),
            // $slots.tail should only has 1 element
            $slots.tail ? $slots.tail() : null
          ]);
        }
      });
      function isHTMLElement(node) {
        return node instanceof HTMLElement;
      }
      function focusFirstDescendant(node) {
        for (let i = 0; i < node.childNodes.length; i++) {
          const child = node.childNodes[i];
          if (isHTMLElement(child)) {
            if (attemptFocus(child) || focusFirstDescendant(child)) {
              return true;
            }
          }
        }
        return false;
      }
      function focusLastDescendant(element) {
        for (let i = element.childNodes.length - 1; i >= 0; i--) {
          const child = element.childNodes[i];
          if (isHTMLElement(child)) {
            if (attemptFocus(child) || focusLastDescendant(child)) {
              return true;
            }
          }
        }
        return false;
      }
      function attemptFocus(element) {
        if (!isFocusable(element)) {
          return false;
        }
        try {
          element.focus({ preventScroll: true });
        } catch (e) {
        }
        return document.activeElement === element;
      }
      function isFocusable(element) {
        if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
          return true;
        }
        if (element.getAttribute("disabled")) {
          return false;
        }
        switch (element.nodeName) {
          case "A":
            return !!element.href && element.rel !== "ignore";
          case "INPUT":
            return element.type !== "hidden" && element.type !== "file";
          case "BUTTON":
          case "SELECT":
          case "TEXTAREA":
            return true;
          default:
            return false;
        }
      }
      let stack = [];
      const FocusTrap = vue.defineComponent({
        name: "FocusTrap",
        props: {
          disabled: Boolean,
          active: Boolean,
          autoFocus: {
            type: Boolean,
            default: true
          },
          onEsc: Function,
          initialFocusTo: String,
          finalFocusTo: String,
          returnFocusOnDeactivated: {
            type: Boolean,
            default: true
          }
        },
        setup(props) {
          const id = createId();
          const focusableStartRef = vue.ref(null);
          const focusableEndRef = vue.ref(null);
          let activated = false;
          let ignoreInternalFocusChange = false;
          const lastFocusedElement = typeof document === "undefined" ? null : document.activeElement;
          function isCurrentActive() {
            const currentActiveId = stack[stack.length - 1];
            return currentActiveId === id;
          }
          function handleDocumentKeydown(e) {
            var _a;
            if (e.code === "Escape") {
              if (isCurrentActive()) {
                (_a = props.onEsc) === null || _a === void 0 ? void 0 : _a.call(props, e);
              }
            }
          }
          vue.onMounted(() => {
            vue.watch(() => props.active, (value) => {
              if (value) {
                activate();
                on("keydown", document, handleDocumentKeydown);
              } else {
                off("keydown", document, handleDocumentKeydown);
                if (activated) {
                  deactivate();
                }
              }
            }, {
              immediate: true
            });
          });
          vue.onBeforeUnmount(() => {
            off("keydown", document, handleDocumentKeydown);
            if (activated)
              deactivate();
          });
          function handleDocumentFocus(e) {
            if (ignoreInternalFocusChange)
              return;
            if (isCurrentActive()) {
              const mainEl = getMainEl();
              if (mainEl === null)
                return;
              if (mainEl.contains(getPreciseEventTarget(e)))
                return;
              resetFocusTo("first");
            }
          }
          function getMainEl() {
            const focusableStartEl = focusableStartRef.value;
            if (focusableStartEl === null)
              return null;
            let mainEl = focusableStartEl;
            while (true) {
              mainEl = mainEl.nextSibling;
              if (mainEl === null)
                break;
              if (mainEl instanceof Element && mainEl.tagName === "DIV") {
                break;
              }
            }
            return mainEl;
          }
          function activate() {
            var _a;
            if (props.disabled)
              return;
            stack.push(id);
            if (props.autoFocus) {
              const { initialFocusTo } = props;
              if (initialFocusTo === void 0) {
                resetFocusTo("first");
              } else {
                (_a = resolveTo(initialFocusTo)) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
              }
            }
            activated = true;
            document.addEventListener("focus", handleDocumentFocus, true);
          }
          function deactivate() {
            var _a;
            if (props.disabled)
              return;
            document.removeEventListener("focus", handleDocumentFocus, true);
            stack = stack.filter((idInStack) => idInStack !== id);
            if (isCurrentActive())
              return;
            const { finalFocusTo } = props;
            if (finalFocusTo !== void 0) {
              (_a = resolveTo(finalFocusTo)) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
            } else if (props.returnFocusOnDeactivated) {
              if (lastFocusedElement instanceof HTMLElement) {
                ignoreInternalFocusChange = true;
                lastFocusedElement.focus({ preventScroll: true });
                ignoreInternalFocusChange = false;
              }
            }
          }
          function resetFocusTo(target) {
            if (!isCurrentActive())
              return;
            if (props.active) {
              const focusableStartEl = focusableStartRef.value;
              const focusableEndEl = focusableEndRef.value;
              if (focusableStartEl !== null && focusableEndEl !== null) {
                const mainEl = getMainEl();
                if (mainEl == null || mainEl === focusableEndEl) {
                  ignoreInternalFocusChange = true;
                  focusableStartEl.focus({ preventScroll: true });
                  ignoreInternalFocusChange = false;
                  return;
                }
                ignoreInternalFocusChange = true;
                const focused = target === "first" ? focusFirstDescendant(mainEl) : focusLastDescendant(mainEl);
                ignoreInternalFocusChange = false;
                if (!focused) {
                  ignoreInternalFocusChange = true;
                  focusableStartEl.focus({ preventScroll: true });
                  ignoreInternalFocusChange = false;
                }
              }
            }
          }
          function handleStartFocus(e) {
            if (ignoreInternalFocusChange)
              return;
            const mainEl = getMainEl();
            if (mainEl === null)
              return;
            if (e.relatedTarget !== null && mainEl.contains(e.relatedTarget)) {
              resetFocusTo("last");
            } else {
              resetFocusTo("first");
            }
          }
          function handleEndFocus(e) {
            if (ignoreInternalFocusChange)
              return;
            if (e.relatedTarget !== null && e.relatedTarget === focusableStartRef.value) {
              resetFocusTo("last");
            } else {
              resetFocusTo("first");
            }
          }
          return {
            focusableStartRef,
            focusableEndRef,
            focusableStyle: "position: absolute; height: 0; width: 0;",
            handleStartFocus,
            handleEndFocus
          };
        },
        render() {
          const { default: defaultSlot } = this.$slots;
          if (defaultSlot === void 0)
            return null;
          if (this.disabled)
            return defaultSlot();
          const { active, focusableStyle } = this;
          return vue.h(vue.Fragment, null, [
            vue.h("div", {
              "aria-hidden": "true",
              tabindex: active ? "0" : "-1",
              ref: "focusableStartRef",
              style: focusableStyle,
              onFocus: this.handleStartFocus
            }),
            defaultSlot(),
            vue.h("div", {
              "aria-hidden": "true",
              style: focusableStyle,
              ref: "focusableEndRef",
              tabindex: active ? "0" : "-1",
              onFocus: this.handleEndFocus
            })
          ]);
        }
      });
      function useReactivated(callback) {
        const isDeactivatedRef = {
          isDeactivated: false
        };
        let activateStateInitialized = false;
        vue.onActivated(() => {
          isDeactivatedRef.isDeactivated = false;
          if (!activateStateInitialized) {
            activateStateInitialized = true;
            return;
          }
          callback();
        });
        vue.onDeactivated(() => {
          isDeactivatedRef.isDeactivated = true;
          if (!activateStateInitialized) {
            activateStateInitialized = true;
          }
        });
        return isDeactivatedRef;
      }
      var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
      var freeSelf = typeof self == "object" && self && self.Object === Object && self;
      var root = freeGlobal || freeSelf || Function("return this")();
      var Symbol$1 = root.Symbol;
      var objectProto$e = Object.prototype;
      var hasOwnProperty$b = objectProto$e.hasOwnProperty;
      var nativeObjectToString$1 = objectProto$e.toString;
      var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
      function getRawTag(value) {
        var isOwn = hasOwnProperty$b.call(value, symToStringTag$1), tag = value[symToStringTag$1];
        try {
          value[symToStringTag$1] = void 0;
          var unmasked = true;
        } catch (e) {
        }
        var result = nativeObjectToString$1.call(value);
        if (unmasked) {
          if (isOwn) {
            value[symToStringTag$1] = tag;
          } else {
            delete value[symToStringTag$1];
          }
        }
        return result;
      }
      var objectProto$d = Object.prototype;
      var nativeObjectToString = objectProto$d.toString;
      function objectToString(value) {
        return nativeObjectToString.call(value);
      }
      var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
      var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
      function baseGetTag(value) {
        if (value == null) {
          return value === void 0 ? undefinedTag : nullTag;
        }
        return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
      }
      function isObjectLike(value) {
        return value != null && typeof value == "object";
      }
      var symbolTag$1 = "[object Symbol]";
      function isSymbol(value) {
        return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
      }
      function arrayMap(array, iteratee) {
        var index = -1, length = array == null ? 0 : array.length, result = Array(length);
        while (++index < length) {
          result[index] = iteratee(array[index], index, array);
        }
        return result;
      }
      var isArray = Array.isArray;
      var INFINITY$1 = 1 / 0;
      var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
      function baseToString(value) {
        if (typeof value == "string") {
          return value;
        }
        if (isArray(value)) {
          return arrayMap(value, baseToString) + "";
        }
        if (isSymbol(value)) {
          return symbolToString ? symbolToString.call(value) : "";
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
      }
      function isObject(value) {
        var type = typeof value;
        return value != null && (type == "object" || type == "function");
      }
      function identity(value) {
        return value;
      }
      var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
      function isFunction(value) {
        if (!isObject(value)) {
          return false;
        }
        var tag = baseGetTag(value);
        return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
      }
      var coreJsData = root["__core-js_shared__"];
      var maskSrcKey = function() {
        var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
        return uid ? "Symbol(src)_1." + uid : "";
      }();
      function isMasked(func) {
        return !!maskSrcKey && maskSrcKey in func;
      }
      var funcProto$2 = Function.prototype;
      var funcToString$2 = funcProto$2.toString;
      function toSource(func) {
        if (func != null) {
          try {
            return funcToString$2.call(func);
          } catch (e) {
          }
          try {
            return func + "";
          } catch (e) {
          }
        }
        return "";
      }
      var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
      var reIsHostCtor = /^\[object .+?Constructor\]$/;
      var funcProto$1 = Function.prototype, objectProto$c = Object.prototype;
      var funcToString$1 = funcProto$1.toString;
      var hasOwnProperty$a = objectProto$c.hasOwnProperty;
      var reIsNative = RegExp(
        "^" + funcToString$1.call(hasOwnProperty$a).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      );
      function baseIsNative(value) {
        if (!isObject(value) || isMasked(value)) {
          return false;
        }
        var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
        return pattern.test(toSource(value));
      }
      function getValue(object, key) {
        return object == null ? void 0 : object[key];
      }
      function getNative(object, key) {
        var value = getValue(object, key);
        return baseIsNative(value) ? value : void 0;
      }
      var WeakMap$1 = getNative(root, "WeakMap");
      var objectCreate = Object.create;
      var baseCreate = /* @__PURE__ */ function() {
        function object() {
        }
        return function(proto) {
          if (!isObject(proto)) {
            return {};
          }
          if (objectCreate) {
            return objectCreate(proto);
          }
          object.prototype = proto;
          var result = new object();
          object.prototype = void 0;
          return result;
        };
      }();
      function apply(func, thisArg, args) {
        switch (args.length) {
          case 0:
            return func.call(thisArg);
          case 1:
            return func.call(thisArg, args[0]);
          case 2:
            return func.call(thisArg, args[0], args[1]);
          case 3:
            return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
      }
      function copyArray(source, array) {
        var index = -1, length = source.length;
        array || (array = Array(length));
        while (++index < length) {
          array[index] = source[index];
        }
        return array;
      }
      var HOT_COUNT = 800, HOT_SPAN = 16;
      var nativeNow = Date.now;
      function shortOut(func) {
        var count = 0, lastCalled = 0;
        return function() {
          var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
          lastCalled = stamp;
          if (remaining > 0) {
            if (++count >= HOT_COUNT) {
              return arguments[0];
            }
          } else {
            count = 0;
          }
          return func.apply(void 0, arguments);
        };
      }
      function constant(value) {
        return function() {
          return value;
        };
      }
      var defineProperty = function() {
        try {
          var func = getNative(Object, "defineProperty");
          func({}, "", {});
          return func;
        } catch (e) {
        }
      }();
      var baseSetToString = !defineProperty ? identity : function(func, string) {
        return defineProperty(func, "toString", {
          "configurable": true,
          "enumerable": false,
          "value": constant(string),
          "writable": true
        });
      };
      var setToString = shortOut(baseSetToString);
      var MAX_SAFE_INTEGER$1 = 9007199254740991;
      var reIsUint = /^(?:0|[1-9]\d*)$/;
      function isIndex(value, length) {
        var type = typeof value;
        length = length == null ? MAX_SAFE_INTEGER$1 : length;
        return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
      }
      function baseAssignValue(object, key, value) {
        if (key == "__proto__" && defineProperty) {
          defineProperty(object, key, {
            "configurable": true,
            "enumerable": true,
            "value": value,
            "writable": true
          });
        } else {
          object[key] = value;
        }
      }
      function eq(value, other) {
        return value === other || value !== value && other !== other;
      }
      var objectProto$b = Object.prototype;
      var hasOwnProperty$9 = objectProto$b.hasOwnProperty;
      function assignValue(object, key, value) {
        var objValue = object[key];
        if (!(hasOwnProperty$9.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      function copyObject(source, props, object, customizer) {
        var isNew = !object;
        object || (object = {});
        var index = -1, length = props.length;
        while (++index < length) {
          var key = props[index];
          var newValue = void 0;
          if (newValue === void 0) {
            newValue = source[key];
          }
          if (isNew) {
            baseAssignValue(object, key, newValue);
          } else {
            assignValue(object, key, newValue);
          }
        }
        return object;
      }
      var nativeMax = Math.max;
      function overRest(func, start, transform) {
        start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
        return function() {
          var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
          while (++index < length) {
            array[index] = args[start + index];
          }
          index = -1;
          var otherArgs = Array(start + 1);
          while (++index < start) {
            otherArgs[index] = args[index];
          }
          otherArgs[start] = transform(array);
          return apply(func, this, otherArgs);
        };
      }
      function baseRest(func, start) {
        return setToString(overRest(func, start, identity), func + "");
      }
      var MAX_SAFE_INTEGER = 9007199254740991;
      function isLength(value) {
        return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
      }
      function isArrayLike(value) {
        return value != null && isLength(value.length) && !isFunction(value);
      }
      function isIterateeCall(value, index, object) {
        if (!isObject(object)) {
          return false;
        }
        var type = typeof index;
        if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
          return eq(object[index], value);
        }
        return false;
      }
      function createAssigner(assigner) {
        return baseRest(function(object, sources) {
          var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
          customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            customizer = length < 3 ? void 0 : customizer;
            length = 1;
          }
          object = Object(object);
          while (++index < length) {
            var source = sources[index];
            if (source) {
              assigner(object, source, index, customizer);
            }
          }
          return object;
        });
      }
      var objectProto$a = Object.prototype;
      function isPrototype(value) {
        var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$a;
        return value === proto;
      }
      function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while (++index < n) {
          result[index] = iteratee(index);
        }
        return result;
      }
      var argsTag$2 = "[object Arguments]";
      function baseIsArguments(value) {
        return isObjectLike(value) && baseGetTag(value) == argsTag$2;
      }
      var objectProto$9 = Object.prototype;
      var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
      var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
      var isArguments = baseIsArguments(/* @__PURE__ */ function() {
        return arguments;
      }()) ? baseIsArguments : function(value) {
        return isObjectLike(value) && hasOwnProperty$8.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
      };
      function stubFalse() {
        return false;
      }
      var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
      var Buffer$1 = moduleExports$2 ? root.Buffer : void 0;
      var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
      var isBuffer = nativeIsBuffer || stubFalse;
      var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$3 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
      var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
      var typedArrayTags = {};
      typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
      typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$3] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
      function baseIsTypedArray(value) {
        return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
      }
      function baseUnary(func) {
        return function(value) {
          return func(value);
        };
      }
      var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
      var freeProcess = moduleExports$1 && freeGlobal.process;
      var nodeUtil = function() {
        try {
          var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
          if (types) {
            return types;
          }
          return freeProcess && freeProcess.binding && freeProcess.binding("util");
        } catch (e) {
        }
      }();
      var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
      var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
      var objectProto$8 = Object.prototype;
      var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
      function arrayLikeKeys(value, inherited) {
        var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
        for (var key in value) {
          if ((inherited || hasOwnProperty$7.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
          (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
          isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
          isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
          isIndex(key, length)))) {
            result.push(key);
          }
        }
        return result;
      }
      function overArg(func, transform) {
        return function(arg) {
          return func(transform(arg));
        };
      }
      var nativeKeys = overArg(Object.keys, Object);
      var objectProto$7 = Object.prototype;
      var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
      function baseKeys(object) {
        if (!isPrototype(object)) {
          return nativeKeys(object);
        }
        var result = [];
        for (var key in Object(object)) {
          if (hasOwnProperty$6.call(object, key) && key != "constructor") {
            result.push(key);
          }
        }
        return result;
      }
      function keys(object) {
        return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
      }
      function nativeKeysIn(object) {
        var result = [];
        if (object != null) {
          for (var key in Object(object)) {
            result.push(key);
          }
        }
        return result;
      }
      var objectProto$6 = Object.prototype;
      var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
      function baseKeysIn(object) {
        if (!isObject(object)) {
          return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result = [];
        for (var key in object) {
          if (!(key == "constructor" && (isProto || !hasOwnProperty$5.call(object, key)))) {
            result.push(key);
          }
        }
        return result;
      }
      function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
      }
      var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
      function isKey(value, object) {
        if (isArray(value)) {
          return false;
        }
        var type = typeof value;
        if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
          return true;
        }
        return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
      }
      var nativeCreate = getNative(Object, "create");
      function hashClear() {
        this.__data__ = nativeCreate ? nativeCreate(null) : {};
        this.size = 0;
      }
      function hashDelete(key) {
        var result = this.has(key) && delete this.__data__[key];
        this.size -= result ? 1 : 0;
        return result;
      }
      var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
      var objectProto$5 = Object.prototype;
      var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
      function hashGet(key) {
        var data = this.__data__;
        if (nativeCreate) {
          var result = data[key];
          return result === HASH_UNDEFINED$2 ? void 0 : result;
        }
        return hasOwnProperty$4.call(data, key) ? data[key] : void 0;
      }
      var objectProto$4 = Object.prototype;
      var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
      function hashHas(key) {
        var data = this.__data__;
        return nativeCreate ? data[key] !== void 0 : hasOwnProperty$3.call(data, key);
      }
      var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
      function hashSet(key, value) {
        var data = this.__data__;
        this.size += this.has(key) ? 0 : 1;
        data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
        return this;
      }
      function Hash(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      Hash.prototype.clear = hashClear;
      Hash.prototype["delete"] = hashDelete;
      Hash.prototype.get = hashGet;
      Hash.prototype.has = hashHas;
      Hash.prototype.set = hashSet;
      function listCacheClear() {
        this.__data__ = [];
        this.size = 0;
      }
      function assocIndexOf(array, key) {
        var length = array.length;
        while (length--) {
          if (eq(array[length][0], key)) {
            return length;
          }
        }
        return -1;
      }
      var arrayProto = Array.prototype;
      var splice = arrayProto.splice;
      function listCacheDelete(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          return false;
        }
        var lastIndex = data.length - 1;
        if (index == lastIndex) {
          data.pop();
        } else {
          splice.call(data, index, 1);
        }
        --this.size;
        return true;
      }
      function listCacheGet(key) {
        var data = this.__data__, index = assocIndexOf(data, key);
        return index < 0 ? void 0 : data[index][1];
      }
      function listCacheHas(key) {
        return assocIndexOf(this.__data__, key) > -1;
      }
      function listCacheSet(key, value) {
        var data = this.__data__, index = assocIndexOf(data, key);
        if (index < 0) {
          ++this.size;
          data.push([key, value]);
        } else {
          data[index][1] = value;
        }
        return this;
      }
      function ListCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      ListCache.prototype.clear = listCacheClear;
      ListCache.prototype["delete"] = listCacheDelete;
      ListCache.prototype.get = listCacheGet;
      ListCache.prototype.has = listCacheHas;
      ListCache.prototype.set = listCacheSet;
      var Map$1 = getNative(root, "Map");
      function mapCacheClear() {
        this.size = 0;
        this.__data__ = {
          "hash": new Hash(),
          "map": new (Map$1 || ListCache)(),
          "string": new Hash()
        };
      }
      function isKeyable(value) {
        var type = typeof value;
        return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
      }
      function getMapData(map2, key) {
        var data = map2.__data__;
        return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
      }
      function mapCacheDelete(key) {
        var result = getMapData(this, key)["delete"](key);
        this.size -= result ? 1 : 0;
        return result;
      }
      function mapCacheGet(key) {
        return getMapData(this, key).get(key);
      }
      function mapCacheHas(key) {
        return getMapData(this, key).has(key);
      }
      function mapCacheSet(key, value) {
        var data = getMapData(this, key), size2 = data.size;
        data.set(key, value);
        this.size += data.size == size2 ? 0 : 1;
        return this;
      }
      function MapCache(entries) {
        var index = -1, length = entries == null ? 0 : entries.length;
        this.clear();
        while (++index < length) {
          var entry = entries[index];
          this.set(entry[0], entry[1]);
        }
      }
      MapCache.prototype.clear = mapCacheClear;
      MapCache.prototype["delete"] = mapCacheDelete;
      MapCache.prototype.get = mapCacheGet;
      MapCache.prototype.has = mapCacheHas;
      MapCache.prototype.set = mapCacheSet;
      var FUNC_ERROR_TEXT = "Expected a function";
      function memoize(func, resolver) {
        if (typeof func != "function" || resolver != null && typeof resolver != "function") {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        var memoized = function() {
          var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
          if (cache2.has(key)) {
            return cache2.get(key);
          }
          var result = func.apply(this, args);
          memoized.cache = cache2.set(key, result) || cache2;
          return result;
        };
        memoized.cache = new (memoize.Cache || MapCache)();
        return memoized;
      }
      memoize.Cache = MapCache;
      var MAX_MEMOIZE_SIZE = 500;
      function memoizeCapped(func) {
        var result = memoize(func, function(key) {
          if (cache2.size === MAX_MEMOIZE_SIZE) {
            cache2.clear();
          }
          return key;
        });
        var cache2 = result.cache;
        return result;
      }
      var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
      var reEscapeChar = /\\(\\)?/g;
      var stringToPath = memoizeCapped(function(string) {
        var result = [];
        if (string.charCodeAt(0) === 46) {
          result.push("");
        }
        string.replace(rePropName, function(match, number, quote, subString) {
          result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
        });
        return result;
      });
      function toString(value) {
        return value == null ? "" : baseToString(value);
      }
      function castPath(value, object) {
        if (isArray(value)) {
          return value;
        }
        return isKey(value, object) ? [value] : stringToPath(toString(value));
      }
      var INFINITY = 1 / 0;
      function toKey(value) {
        if (typeof value == "string" || isSymbol(value)) {
          return value;
        }
        var result = value + "";
        return result == "0" && 1 / value == -INFINITY ? "-0" : result;
      }
      function baseGet(object, path) {
        path = castPath(path, object);
        var index = 0, length = path.length;
        while (object != null && index < length) {
          object = object[toKey(path[index++])];
        }
        return index && index == length ? object : void 0;
      }
      function get(object, path, defaultValue) {
        var result = object == null ? void 0 : baseGet(object, path);
        return result === void 0 ? defaultValue : result;
      }
      function arrayPush(array, values) {
        var index = -1, length = values.length, offset = array.length;
        while (++index < length) {
          array[offset + index] = values[index];
        }
        return array;
      }
      var getPrototype = overArg(Object.getPrototypeOf, Object);
      var objectTag$2 = "[object Object]";
      var funcProto = Function.prototype, objectProto$3 = Object.prototype;
      var funcToString = funcProto.toString;
      var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
      var objectCtorString = funcToString.call(Object);
      function isPlainObject(value) {
        if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) {
          return false;
        }
        var proto = getPrototype(value);
        if (proto === null) {
          return true;
        }
        var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor;
        return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
      }
      function stackClear() {
        this.__data__ = new ListCache();
        this.size = 0;
      }
      function stackDelete(key) {
        var data = this.__data__, result = data["delete"](key);
        this.size = data.size;
        return result;
      }
      function stackGet(key) {
        return this.__data__.get(key);
      }
      function stackHas(key) {
        return this.__data__.has(key);
      }
      var LARGE_ARRAY_SIZE = 200;
      function stackSet(key, value) {
        var data = this.__data__;
        if (data instanceof ListCache) {
          var pairs = data.__data__;
          if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
            pairs.push([key, value]);
            this.size = ++data.size;
            return this;
          }
          data = this.__data__ = new MapCache(pairs);
        }
        data.set(key, value);
        this.size = data.size;
        return this;
      }
      function Stack(entries) {
        var data = this.__data__ = new ListCache(entries);
        this.size = data.size;
      }
      Stack.prototype.clear = stackClear;
      Stack.prototype["delete"] = stackDelete;
      Stack.prototype.get = stackGet;
      Stack.prototype.has = stackHas;
      Stack.prototype.set = stackSet;
      var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
      var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
      var moduleExports = freeModule && freeModule.exports === freeExports;
      var Buffer2 = moduleExports ? root.Buffer : void 0;
      Buffer2 ? Buffer2.allocUnsafe : void 0;
      function cloneBuffer(buffer, isDeep) {
        {
          return buffer.slice();
        }
      }
      function arrayFilter(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
        while (++index < length) {
          var value = array[index];
          if (predicate(value, index, array)) {
            result[resIndex++] = value;
          }
        }
        return result;
      }
      function stubArray() {
        return [];
      }
      var objectProto$2 = Object.prototype;
      var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
      var nativeGetSymbols = Object.getOwnPropertySymbols;
      var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
        if (object == null) {
          return [];
        }
        object = Object(object);
        return arrayFilter(nativeGetSymbols(object), function(symbol) {
          return propertyIsEnumerable.call(object, symbol);
        });
      };
      function baseGetAllKeys(object, keysFunc, symbolsFunc) {
        var result = keysFunc(object);
        return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
      }
      function getAllKeys(object) {
        return baseGetAllKeys(object, keys, getSymbols);
      }
      var DataView = getNative(root, "DataView");
      var Promise$1 = getNative(root, "Promise");
      var Set$1 = getNative(root, "Set");
      var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
      var dataViewTag$1 = "[object DataView]";
      var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
      var getTag = baseGetTag;
      if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$1 || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag) {
        getTag = function(value) {
          var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
          if (ctorString) {
            switch (ctorString) {
              case dataViewCtorString:
                return dataViewTag$1;
              case mapCtorString:
                return mapTag$1;
              case promiseCtorString:
                return promiseTag;
              case setCtorString:
                return setTag$1;
              case weakMapCtorString:
                return weakMapTag;
            }
          }
          return result;
        };
      }
      var Uint8Array2 = root.Uint8Array;
      function cloneArrayBuffer(arrayBuffer) {
        var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
        new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
        return result;
      }
      function cloneTypedArray(typedArray, isDeep) {
        var buffer = cloneArrayBuffer(typedArray.buffer);
        return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
      }
      function initCloneObject(object) {
        return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
      }
      var HASH_UNDEFINED = "__lodash_hash_undefined__";
      function setCacheAdd(value) {
        this.__data__.set(value, HASH_UNDEFINED);
        return this;
      }
      function setCacheHas(value) {
        return this.__data__.has(value);
      }
      function SetCache(values) {
        var index = -1, length = values == null ? 0 : values.length;
        this.__data__ = new MapCache();
        while (++index < length) {
          this.add(values[index]);
        }
      }
      SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
      SetCache.prototype.has = setCacheHas;
      function arraySome(array, predicate) {
        var index = -1, length = array == null ? 0 : array.length;
        while (++index < length) {
          if (predicate(array[index], index, array)) {
            return true;
          }
        }
        return false;
      }
      function cacheHas(cache2, key) {
        return cache2.has(key);
      }
      var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
      function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
        if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
          return false;
        }
        var arrStacked = stack2.get(array);
        var othStacked = stack2.get(other);
        if (arrStacked && othStacked) {
          return arrStacked == other && othStacked == array;
        }
        var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
        stack2.set(array, other);
        stack2.set(other, array);
        while (++index < arrLength) {
          var arrValue = array[index], othValue = other[index];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack2) : customizer(arrValue, othValue, index, array, other, stack2);
          }
          if (compared !== void 0) {
            if (compared) {
              continue;
            }
            result = false;
            break;
          }
          if (seen) {
            if (!arraySome(other, function(othValue2, othIndex) {
              if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
                return seen.push(othIndex);
              }
            })) {
              result = false;
              break;
            }
          } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
            result = false;
            break;
          }
        }
        stack2["delete"](array);
        stack2["delete"](other);
        return result;
      }
      function mapToArray(map2) {
        var index = -1, result = Array(map2.size);
        map2.forEach(function(value, key) {
          result[++index] = [key, value];
        });
        return result;
      }
      function setToArray(set) {
        var index = -1, result = Array(set.size);
        set.forEach(function(value) {
          result[++index] = value;
        });
        return result;
      }
      var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
      var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
      var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
      var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
      function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) {
        switch (tag) {
          case dataViewTag:
            if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
              return false;
            }
            object = object.buffer;
            other = other.buffer;
          case arrayBufferTag:
            if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
              return false;
            }
            return true;
          case boolTag:
          case dateTag:
          case numberTag:
            return eq(+object, +other);
          case errorTag:
            return object.name == other.name && object.message == other.message;
          case regexpTag:
          case stringTag:
            return object == other + "";
          case mapTag:
            var convert = mapToArray;
          case setTag:
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
            convert || (convert = setToArray);
            if (object.size != other.size && !isPartial) {
              return false;
            }
            var stacked = stack2.get(object);
            if (stacked) {
              return stacked == other;
            }
            bitmask |= COMPARE_UNORDERED_FLAG$2;
            stack2.set(object, other);
            var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
            stack2["delete"](object);
            return result;
          case symbolTag:
            if (symbolValueOf) {
              return symbolValueOf.call(object) == symbolValueOf.call(other);
            }
        }
        return false;
      }
      var COMPARE_PARTIAL_FLAG$3 = 1;
      var objectProto$1 = Object.prototype;
      var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
      function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
        if (objLength != othLength && !isPartial) {
          return false;
        }
        var index = objLength;
        while (index--) {
          var key = objProps[index];
          if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
            return false;
          }
        }
        var objStacked = stack2.get(object);
        var othStacked = stack2.get(other);
        if (objStacked && othStacked) {
          return objStacked == other && othStacked == object;
        }
        var result = true;
        stack2.set(object, other);
        stack2.set(other, object);
        var skipCtor = isPartial;
        while (++index < objLength) {
          key = objProps[index];
          var objValue = object[key], othValue = other[key];
          if (customizer) {
            var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2);
          }
          if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
            result = false;
            break;
          }
          skipCtor || (skipCtor = key == "constructor");
        }
        if (result && !skipCtor) {
          var objCtor = object.constructor, othCtor = other.constructor;
          if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
            result = false;
          }
        }
        stack2["delete"](object);
        stack2["delete"](other);
        return result;
      }
      var COMPARE_PARTIAL_FLAG$2 = 1;
      var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
        var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
        objTag = objTag == argsTag ? objectTag : objTag;
        othTag = othTag == argsTag ? objectTag : othTag;
        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
        if (isSameTag && isBuffer(object)) {
          if (!isBuffer(other)) {
            return false;
          }
          objIsArr = true;
          objIsObj = false;
        }
        if (isSameTag && !objIsObj) {
          stack2 || (stack2 = new Stack());
          return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
        }
        if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
          var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
          if (objIsWrapped || othIsWrapped) {
            var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
            stack2 || (stack2 = new Stack());
            return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2);
          }
        }
        if (!isSameTag) {
          return false;
        }
        stack2 || (stack2 = new Stack());
        return equalObjects(object, other, bitmask, customizer, equalFunc, stack2);
      }
      function baseIsEqual(value, other, bitmask, customizer, stack2) {
        if (value === other) {
          return true;
        }
        if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
          return value !== value && other !== other;
        }
        return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2);
      }
      var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
      function baseIsMatch(object, source, matchData, customizer) {
        var index = matchData.length, length = index;
        if (object == null) {
          return !length;
        }
        object = Object(object);
        while (index--) {
          var data = matchData[index];
          if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
            return false;
          }
        }
        while (++index < length) {
          data = matchData[index];
          var key = data[0], objValue = object[key], srcValue = data[1];
          if (data[2]) {
            if (objValue === void 0 && !(key in object)) {
              return false;
            }
          } else {
            var stack2 = new Stack();
            var result;
            if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack2) : result)) {
              return false;
            }
          }
        }
        return true;
      }
      function isStrictComparable(value) {
        return value === value && !isObject(value);
      }
      function getMatchData(object) {
        var result = keys(object), length = result.length;
        while (length--) {
          var key = result[length], value = object[key];
          result[length] = [key, value, isStrictComparable(value)];
        }
        return result;
      }
      function matchesStrictComparable(key, srcValue) {
        return function(object) {
          if (object == null) {
            return false;
          }
          return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
        };
      }
      function baseMatches(source) {
        var matchData = getMatchData(source);
        if (matchData.length == 1 && matchData[0][2]) {
          return matchesStrictComparable(matchData[0][0], matchData[0][1]);
        }
        return function(object) {
          return object === source || baseIsMatch(object, source, matchData);
        };
      }
      function baseHasIn(object, key) {
        return object != null && key in Object(object);
      }
      function hasPath(object, path, hasFunc) {
        path = castPath(path, object);
        var index = -1, length = path.length, result = false;
        while (++index < length) {
          var key = toKey(path[index]);
          if (!(result = object != null && hasFunc(object, key))) {
            break;
          }
          object = object[key];
        }
        if (result || ++index != length) {
          return result;
        }
        length = object == null ? 0 : object.length;
        return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
      }
      function hasIn(object, path) {
        return object != null && hasPath(object, path, baseHasIn);
      }
      var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
      function baseMatchesProperty(path, srcValue) {
        if (isKey(path) && isStrictComparable(srcValue)) {
          return matchesStrictComparable(toKey(path), srcValue);
        }
        return function(object) {
          var objValue = get(object, path);
          return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
        };
      }
      function baseProperty(key) {
        return function(object) {
          return object == null ? void 0 : object[key];
        };
      }
      function basePropertyDeep(path) {
        return function(object) {
          return baseGet(object, path);
        };
      }
      function property(path) {
        return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
      }
      function baseIteratee(value) {
        if (typeof value == "function") {
          return value;
        }
        if (value == null) {
          return identity;
        }
        if (typeof value == "object") {
          return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
        }
        return property(value);
      }
      function createBaseFor(fromRight) {
        return function(object, iteratee, keysFunc) {
          var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
          while (length--) {
            var key = props[++index];
            if (iteratee(iterable[key], key, iterable) === false) {
              break;
            }
          }
          return object;
        };
      }
      var baseFor = createBaseFor();
      function baseForOwn(object, iteratee) {
        return object && baseFor(object, iteratee, keys);
      }
      function createBaseEach(eachFunc, fromRight) {
        return function(collection, iteratee) {
          if (collection == null) {
            return collection;
          }
          if (!isArrayLike(collection)) {
            return eachFunc(collection, iteratee);
          }
          var length = collection.length, index = -1, iterable = Object(collection);
          while (++index < length) {
            if (iteratee(iterable[index], index, iterable) === false) {
              break;
            }
          }
          return collection;
        };
      }
      var baseEach = createBaseEach(baseForOwn);
      function assignMergeValue(object, key, value) {
        if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
          baseAssignValue(object, key, value);
        }
      }
      function isArrayLikeObject(value) {
        return isObjectLike(value) && isArrayLike(value);
      }
      function safeGet(object, key) {
        if (key === "constructor" && typeof object[key] === "function") {
          return;
        }
        if (key == "__proto__") {
          return;
        }
        return object[key];
      }
      function toPlainObject(value) {
        return copyObject(value, keysIn(value));
      }
      function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) {
        var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue);
        if (stacked) {
          assignMergeValue(object, key, stacked);
          return;
        }
        var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : void 0;
        var isCommon = newValue === void 0;
        if (isCommon) {
          var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
          newValue = srcValue;
          if (isArr || isBuff || isTyped) {
            if (isArray(objValue)) {
              newValue = objValue;
            } else if (isArrayLikeObject(objValue)) {
              newValue = copyArray(objValue);
            } else if (isBuff) {
              isCommon = false;
              newValue = cloneBuffer(srcValue);
            } else if (isTyped) {
              isCommon = false;
              newValue = cloneTypedArray(srcValue);
            } else {
              newValue = [];
            }
          } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
            newValue = objValue;
            if (isArguments(objValue)) {
              newValue = toPlainObject(objValue);
            } else if (!isObject(objValue) || isFunction(objValue)) {
              newValue = initCloneObject(srcValue);
            }
          } else {
            isCommon = false;
          }
        }
        if (isCommon) {
          stack2.set(srcValue, newValue);
          mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
          stack2["delete"](srcValue);
        }
        assignMergeValue(object, key, newValue);
      }
      function baseMerge(object, source, srcIndex, customizer, stack2) {
        if (object === source) {
          return;
        }
        baseFor(source, function(srcValue, key) {
          stack2 || (stack2 = new Stack());
          if (isObject(srcValue)) {
            baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
          } else {
            var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : void 0;
            if (newValue === void 0) {
              newValue = srcValue;
            }
            assignMergeValue(object, key, newValue);
          }
        }, keysIn);
      }
      function baseMap(collection, iteratee) {
        var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
        baseEach(collection, function(value, key, collection2) {
          result[++index] = iteratee(value, key, collection2);
        });
        return result;
      }
      function map(collection, iteratee) {
        var func = isArray(collection) ? arrayMap : baseMap;
        return func(collection, baseIteratee(iteratee));
      }
      var merge$1 = createAssigner(function(object, source, srcIndex) {
        baseMerge(object, source, srcIndex);
      });
      const commonVariables$2 = {
        fontFamily: 'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
        fontFamilyMono: "v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",
        fontWeight: "400",
        fontWeightStrong: "500",
        cubicBezierEaseInOut: "cubic-bezier(.4, 0, .2, 1)",
        cubicBezierEaseOut: "cubic-bezier(0, 0, .2, 1)",
        cubicBezierEaseIn: "cubic-bezier(.4, 0, 1, 1)",
        borderRadius: "3px",
        borderRadiusSmall: "2px",
        fontSize: "14px",
        fontSizeMini: "12px",
        fontSizeTiny: "12px",
        fontSizeSmall: "14px",
        fontSizeMedium: "14px",
        fontSizeLarge: "15px",
        fontSizeHuge: "16px",
        lineHeight: "1.6",
        heightMini: "16px",
        // private now, it's too small
        heightTiny: "22px",
        heightSmall: "28px",
        heightMedium: "34px",
        heightLarge: "40px",
        heightHuge: "46px"
      };
      const {
        fontSize,
        fontFamily,
        lineHeight
      } = commonVariables$2;
      const globalStyle = c$1("body", `
 margin: 0;
 font-size: ${fontSize};
 font-family: ${fontFamily};
 line-height: ${lineHeight};
 -webkit-text-size-adjust: 100%;
 -webkit-tap-highlight-color: transparent;
`, [c$1("input", `
 font-family: inherit;
 font-size: inherit;
 `)]);
      const configProviderInjectionKey = createInjectionKey("n-config-provider");
      const cssrAnchorMetaName = "naive-ui-style";
      function createTheme(theme) {
        return theme;
      }
      function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
        const ssrAdapter2 = useSsrAdapter();
        const NConfigProvider = vue.inject(configProviderInjectionKey, null);
        if (style2) {
          const mountStyle = () => {
            const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
            style2.mount({
              id: clsPrefix === void 0 ? mountId : clsPrefix + mountId,
              head: true,
              props: {
                bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
              },
              anchorMetaName: cssrAnchorMetaName,
              ssr: ssrAdapter2
            });
            if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
              globalStyle.mount({
                id: "n-global",
                head: true,
                anchorMetaName: cssrAnchorMetaName,
                ssr: ssrAdapter2
              });
            }
          };
          if (ssrAdapter2) {
            mountStyle();
          } else {
            vue.onBeforeMount(mountStyle);
          }
        }
        const mergedThemeRef = vue.computed(() => {
          var _a;
          const {
            theme: {
              common: selfCommon,
              self: self2,
              peers = {}
            } = {},
            themeOverrides: selfOverrides = {},
            builtinThemeOverrides: builtinOverrides = {}
          } = props;
          const {
            common: selfCommonOverrides,
            peers: peersOverrides
          } = selfOverrides;
          const {
            common: globalCommon = void 0,
            [resolveId]: {
              common: globalSelfCommon = void 0,
              self: globalSelf = void 0,
              peers: globalPeers = {}
            } = {}
          } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeRef.value) || {};
          const {
            common: globalCommonOverrides = void 0,
            [resolveId]: globalSelfOverrides = {}
          } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeOverridesRef.value) || {};
          const {
            common: globalSelfCommonOverrides,
            peers: globalPeersOverrides = {}
          } = globalSelfOverrides;
          const mergedCommon = merge$1({}, selfCommon || globalSelfCommon || globalCommon || defaultTheme.common, globalCommonOverrides, globalSelfCommonOverrides, selfCommonOverrides);
          const mergedSelf = merge$1(
            // {}, executed every time, no need for empty obj
            (_a = self2 || globalSelf || defaultTheme.self) === null || _a === void 0 ? void 0 : _a(mergedCommon),
            builtinOverrides,
            globalSelfOverrides,
            selfOverrides
          );
          return {
            common: mergedCommon,
            self: mergedSelf,
            peers: merge$1({}, defaultTheme.peers, globalPeers, peers),
            peerOverrides: merge$1({}, builtinOverrides.peers, globalPeersOverrides, peersOverrides)
          };
        });
        return mergedThemeRef;
      }
      useTheme.props = {
        theme: Object,
        themeOverrides: Object,
        builtinThemeOverrides: Object
      };
      const defaultClsPrefix = "n";
      function useConfig(props = {}, options = {
        defaultBordered: true
      }) {
        const NConfigProvider = vue.inject(configProviderInjectionKey, null);
        return {
          // NConfigProvider,
          inlineThemeDisabled: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.inlineThemeDisabled,
          mergedRtlRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef,
          mergedComponentPropsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedComponentPropsRef,
          mergedBreakpointsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBreakpointsRef,
          mergedBorderedRef: vue.computed(() => {
            var _a, _b;
            const {
              bordered
            } = props;
            if (bordered !== void 0)
              return bordered;
            return (_b = (_a = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBorderedRef.value) !== null && _a !== void 0 ? _a : options.defaultBordered) !== null && _b !== void 0 ? _b : true;
          }),
          mergedClsPrefixRef: NConfigProvider ? NConfigProvider.mergedClsPrefixRef : vue.shallowRef(defaultClsPrefix),
          namespaceRef: vue.computed(() => NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedNamespaceRef.value)
        };
      }
      function useStyle(mountId, style2, clsPrefixRef) {
        if (!style2) {
          return;
        }
        const ssrAdapter2 = useSsrAdapter();
        const NConfigProvider = vue.inject(configProviderInjectionKey, null);
        const mountStyle = () => {
          const clsPrefix = clsPrefixRef.value;
          style2.mount({
            id: clsPrefix === void 0 ? mountId : clsPrefix + mountId,
            head: true,
            anchorMetaName: cssrAnchorMetaName,
            props: {
              bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
            },
            ssr: ssrAdapter2
          });
          if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
            globalStyle.mount({
              id: "n-global",
              head: true,
              anchorMetaName: cssrAnchorMetaName,
              ssr: ssrAdapter2
            });
          }
        };
        if (ssrAdapter2) {
          mountStyle();
        } else {
          vue.onBeforeMount(mountStyle);
        }
      }
      function useThemeClass(componentName, hashRef, cssVarsRef, props) {
        var _a;
        if (!cssVarsRef)
          throwError("useThemeClass", "cssVarsRef is not passed");
        const mergedThemeHashRef = (_a = vue.inject(configProviderInjectionKey, null)) === null || _a === void 0 ? void 0 : _a.mergedThemeHashRef;
        const themeClassRef = vue.ref("");
        const ssrAdapter2 = useSsrAdapter();
        let renderCallback;
        const hashClassPrefix = `__${componentName}`;
        const mountStyle = () => {
          let finalThemeHash = hashClassPrefix;
          const hashValue = hashRef ? hashRef.value : void 0;
          const themeHash = mergedThemeHashRef === null || mergedThemeHashRef === void 0 ? void 0 : mergedThemeHashRef.value;
          if (themeHash)
            finalThemeHash += "-" + themeHash;
          if (hashValue)
            finalThemeHash += "-" + hashValue;
          const {
            themeOverrides,
            builtinThemeOverrides
          } = props;
          if (themeOverrides) {
            finalThemeHash += "-" + murmur2(JSON.stringify(themeOverrides));
          }
          if (builtinThemeOverrides) {
            finalThemeHash += "-" + murmur2(JSON.stringify(builtinThemeOverrides));
          }
          themeClassRef.value = finalThemeHash;
          renderCallback = () => {
            const cssVars = cssVarsRef.value;
            let style2 = "";
            for (const key in cssVars) {
              style2 += `${key}: ${cssVars[key]};`;
            }
            c$1(`.${finalThemeHash}`, style2).mount({
              id: finalThemeHash,
              ssr: ssrAdapter2
            });
            renderCallback = void 0;
          };
        };
        vue.watchEffect(() => {
          mountStyle();
        });
        return {
          themeClass: themeClassRef,
          onRender: () => {
            renderCallback === null || renderCallback === void 0 ? void 0 : renderCallback();
          }
        };
      }
      function useRtl(mountId, rtlStateRef, clsPrefixRef) {
        if (!rtlStateRef)
          return void 0;
        const ssrAdapter2 = useSsrAdapter();
        const componentRtlStateRef = vue.computed(() => {
          const {
            value: rtlState
          } = rtlStateRef;
          if (!rtlState) {
            return void 0;
          }
          const componentRtlState = rtlState[mountId];
          if (!componentRtlState) {
            return void 0;
          }
          return componentRtlState;
        });
        const mountStyle = () => {
          vue.watchEffect(() => {
            const {
              value: clsPrefix
            } = clsPrefixRef;
            const id = `${clsPrefix}${mountId}Rtl`;
            if (exists(id, ssrAdapter2))
              return;
            const {
              value: componentRtlState
            } = componentRtlStateRef;
            if (!componentRtlState)
              return;
            componentRtlState.style.mount({
              id,
              head: true,
              anchorMetaName: cssrAnchorMetaName,
              props: {
                bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
              },
              ssr: ssrAdapter2
            });
          });
        };
        if (ssrAdapter2) {
          mountStyle();
        } else {
          vue.onBeforeMount(mountStyle);
        }
        return componentRtlStateRef;
      }
      const ChevronRightIcon = vue.defineComponent({
        name: "ChevronRight",
        render() {
          return vue.h("svg", {
            viewBox: "0 0 16 16",
            fill: "none",
            xmlns: "http://www.w3.org/2000/svg"
          }, vue.h("path", {
            d: "M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",
            fill: "currentColor"
          }));
        }
      });
      const ChevronDownFilledIcon = vue.defineComponent({
        name: "ChevronDownFilled",
        render() {
          return vue.h("svg", {
            viewBox: "0 0 16 16",
            fill: "none",
            xmlns: "http://www.w3.org/2000/svg"
          }, vue.h("path", {
            d: "M3.20041 5.73966C3.48226 5.43613 3.95681 5.41856 4.26034 5.70041L8 9.22652L11.7397 5.70041C12.0432 5.41856 12.5177 5.43613 12.7996 5.73966C13.0815 6.0432 13.0639 6.51775 12.7603 6.7996L8.51034 10.7996C8.22258 11.0668 7.77743 11.0668 7.48967 10.7996L3.23966 6.7996C2.93613 6.51775 2.91856 6.0432 3.20041 5.73966Z",
            fill: "currentColor"
          }));
        }
      });
      const NFadeInExpandTransition = vue.defineComponent({
        name: "FadeInExpandTransition",
        props: {
          appear: Boolean,
          group: Boolean,
          mode: String,
          onLeave: Function,
          onAfterLeave: Function,
          onAfterEnter: Function,
          width: Boolean,
          // reverse mode is only used in tree
          // it make it from expanded to collapsed after mounted
          reverse: Boolean
        },
        setup(props, {
          slots
        }) {
          function handleBeforeLeave(el) {
            if (props.width) {
              el.style.maxWidth = `${el.offsetWidth}px`;
            } else {
              el.style.maxHeight = `${el.offsetHeight}px`;
            }
            void el.offsetWidth;
          }
          function handleLeave(el) {
            if (props.width) {
              el.style.maxWidth = "0";
            } else {
              el.style.maxHeight = "0";
            }
            void el.offsetWidth;
            const {
              onLeave
            } = props;
            if (onLeave)
              onLeave();
          }
          function handleAfterLeave(el) {
            if (props.width) {
              el.style.maxWidth = "";
            } else {
              el.style.maxHeight = "";
            }
            const {
              onAfterLeave
            } = props;
            if (onAfterLeave)
              onAfterLeave();
          }
          function handleEnter(el) {
            el.style.transition = "none";
            if (props.width) {
              const memorizedWidth = el.offsetWidth;
              el.style.maxWidth = "0";
              void el.offsetWidth;
              el.style.transition = "";
              el.style.maxWidth = `${memorizedWidth}px`;
            } else {
              if (props.reverse) {
                el.style.maxHeight = `${el.offsetHeight}px`;
                void el.offsetHeight;
                el.style.transition = "";
                el.style.maxHeight = "0";
              } else {
                const memorizedHeight = el.offsetHeight;
                el.style.maxHeight = "0";
                void el.offsetWidth;
                el.style.transition = "";
                el.style.maxHeight = `${memorizedHeight}px`;
              }
            }
            void el.offsetWidth;
          }
          function handleAfterEnter(el) {
            var _a;
            if (props.width) {
              el.style.maxWidth = "";
            } else {
              if (!props.reverse) {
                el.style.maxHeight = "";
              }
            }
            (_a = props.onAfterEnter) === null || _a === void 0 ? void 0 : _a.call(props);
          }
          return () => {
            const {
              group,
              width,
              appear,
              mode
            } = props;
            const type = group ? vue.TransitionGroup : vue.Transition;
            const resolvedProps = {
              name: width ? "fade-in-width-expand-transition" : "fade-in-height-expand-transition",
              appear,
              onEnter: handleEnter,
              onAfterEnter: handleAfterEnter,
              onBeforeLeave: handleBeforeLeave,
              onLeave: handleLeave,
              onAfterLeave: handleAfterLeave
            };
            if (!group) {
              resolvedProps.mode = mode;
            }
            return vue.h(type, resolvedProps, slots);
          };
        }
      });
      const style$5 = cB("base-icon", `
 height: 1em;
 width: 1em;
 line-height: 1em;
 text-align: center;
 display: inline-block;
 position: relative;
 fill: currentColor;
 transform: translateZ(0);
`, [c$1("svg", `
 height: 1em;
 width: 1em;
 `)]);
      const NBaseIcon = vue.defineComponent({
        name: "BaseIcon",
        props: {
          role: String,
          ariaLabel: String,
          ariaDisabled: {
            type: Boolean,
            default: void 0
          },
          ariaHidden: {
            type: Boolean,
            default: void 0
          },
          clsPrefix: {
            type: String,
            required: true
          },
          onClick: Function,
          onMousedown: Function,
          onMouseup: Function
        },
        setup(props) {
          useStyle("-base-icon", style$5, vue.toRef(props, "clsPrefix"));
        },
        render() {
          return vue.h("i", {
            class: `${this.clsPrefix}-base-icon`,
            onClick: this.onClick,
            onMousedown: this.onMousedown,
            onMouseup: this.onMouseup,
            role: this.role,
            "aria-label": this.ariaLabel,
            "aria-hidden": this.ariaHidden,
            "aria-disabled": this.ariaDisabled
          }, this.$slots);
        }
      });
      function toArray(arg) {
        if (Array.isArray(arg))
          return arg;
        return [arg];
      }
      const TRAVERSE_COMMAND = {
        STOP: "STOP"
      };
      function traverseWithCb(treeNode, callback) {
        const command = callback(treeNode);
        if (treeNode.children !== void 0 && command !== TRAVERSE_COMMAND.STOP) {
          treeNode.children.forEach((childNode) => traverseWithCb(childNode, callback));
        }
      }
      function getNonLeafKeys(treeNodes, options = {}) {
        const { preserveGroup = false } = options;
        const keys2 = [];
        const cb = preserveGroup ? (node) => {
          if (!node.isLeaf) {
            keys2.push(node.key);
            traverse(node.children);
          }
        } : (node) => {
          if (!node.isLeaf) {
            if (!node.isGroup)
              keys2.push(node.key);
            traverse(node.children);
          }
        };
        function traverse(nodes) {
          nodes.forEach(cb);
        }
        traverse(treeNodes);
        return keys2;
      }
      function isLeaf(rawNode, getChildren) {
        const { isLeaf: isLeaf2 } = rawNode;
        if (isLeaf2 !== void 0)
          return isLeaf2;
        else if (!getChildren(rawNode))
          return true;
        return false;
      }
      function defaultGetChildren(node) {
        return node.children;
      }
      function defaultGetKey(node) {
        return node.key;
      }
      function isIgnored() {
        return false;
      }
      function isShallowLoaded(rawNode, getChildren) {
        const { isLeaf: isLeaf2 } = rawNode;
        if (isLeaf2 === false && !Array.isArray(getChildren(rawNode)))
          return false;
        return true;
      }
      function isDisabled(rawNode) {
        return rawNode.disabled === true;
      }
      function isExpilicitlyNotLoaded(rawNode, getChildren) {
        return rawNode.isLeaf === false && !Array.isArray(getChildren(rawNode));
      }
      function unwrapCheckedKeys(result) {
        var _a;
        if (result === void 0 || result === null)
          return [];
        if (Array.isArray(result))
          return result;
        return (_a = result.checkedKeys) !== null && _a !== void 0 ? _a : [];
      }
      function unwrapIndeterminateKeys(result) {
        var _a;
        if (result === void 0 || result === null || Array.isArray(result)) {
          return [];
        }
        return (_a = result.indeterminateKeys) !== null && _a !== void 0 ? _a : [];
      }
      function merge(originalKeys, keysToAdd) {
        const set = new Set(originalKeys);
        keysToAdd.forEach((key) => {
          if (!set.has(key)) {
            set.add(key);
          }
        });
        return Array.from(set);
      }
      function minus(originalKeys, keysToRemove) {
        const set = new Set(originalKeys);
        keysToRemove.forEach((key) => {
          if (set.has(key)) {
            set.delete(key);
          }
        });
        return Array.from(set);
      }
      function isGroup(rawNode) {
        return (rawNode === null || rawNode === void 0 ? void 0 : rawNode.type) === "group";
      }
      class SubtreeNotLoadedError extends Error {
        constructor() {
          super();
          this.message = "SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.";
        }
      }
      function getExtendedCheckedKeySetAfterCheck(checkKeys, currentCheckedKeys, treeMate, allowNotLoaded) {
        return getExtendedCheckedKeySet(currentCheckedKeys.concat(checkKeys), treeMate, allowNotLoaded, false);
      }
      function getAvailableAscendantNodeSet(uncheckedKeys, treeMate) {
        const visitedKeys = /* @__PURE__ */ new Set();
        uncheckedKeys.forEach((uncheckedKey) => {
          const uncheckedTreeNode = treeMate.treeNodeMap.get(uncheckedKey);
          if (uncheckedTreeNode !== void 0) {
            let nodeCursor = uncheckedTreeNode.parent;
            while (nodeCursor !== null) {
              if (nodeCursor.disabled)
                break;
              if (visitedKeys.has(nodeCursor.key))
                break;
              else {
                visitedKeys.add(nodeCursor.key);
              }
              nodeCursor = nodeCursor.parent;
            }
          }
        });
        return visitedKeys;
      }
      function getExtendedCheckedKeySetAfterUncheck(uncheckedKeys, currentCheckedKeys, treeMate, allowNotLoaded) {
        const extendedCheckedKeySet = getExtendedCheckedKeySet(currentCheckedKeys, treeMate, allowNotLoaded, false);
        const extendedKeySetToUncheck = getExtendedCheckedKeySet(uncheckedKeys, treeMate, allowNotLoaded, true);
        const ascendantKeySet = getAvailableAscendantNodeSet(uncheckedKeys, treeMate);
        const keysToRemove = [];
        extendedCheckedKeySet.forEach((key) => {
          if (extendedKeySetToUncheck.has(key) || ascendantKeySet.has(key)) {
            keysToRemove.push(key);
          }
        });
        keysToRemove.forEach((key) => extendedCheckedKeySet.delete(key));
        return extendedCheckedKeySet;
      }
      function getCheckedKeys(options, treeMate) {
        const { checkedKeys, keysToCheck, keysToUncheck, indeterminateKeys, cascade, leafOnly, checkStrategy, allowNotLoaded } = options;
        if (!cascade) {
          if (keysToCheck !== void 0) {
            return {
              checkedKeys: merge(checkedKeys, keysToCheck),
              indeterminateKeys: Array.from(indeterminateKeys)
            };
          } else if (keysToUncheck !== void 0) {
            return {
              checkedKeys: minus(checkedKeys, keysToUncheck),
              indeterminateKeys: Array.from(indeterminateKeys)
            };
          } else {
            return {
              checkedKeys: Array.from(checkedKeys),
              indeterminateKeys: Array.from(indeterminateKeys)
            };
          }
        }
        const { levelTreeNodeMap } = treeMate;
        let extendedCheckedKeySet;
        if (keysToUncheck !== void 0) {
          extendedCheckedKeySet = getExtendedCheckedKeySetAfterUncheck(keysToUncheck, checkedKeys, treeMate, allowNotLoaded);
        } else if (keysToCheck !== void 0) {
          extendedCheckedKeySet = getExtendedCheckedKeySetAfterCheck(keysToCheck, checkedKeys, treeMate, allowNotLoaded);
        } else {
          extendedCheckedKeySet = getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, false);
        }
        const checkStrategyIsParent = checkStrategy === "parent";
        const checkStrategyIsChild = checkStrategy === "child" || leafOnly;
        const syntheticCheckedKeySet = extendedCheckedKeySet;
        const syntheticIndeterminateKeySet = /* @__PURE__ */ new Set();
        const maxLevel = Math.max.apply(null, Array.from(levelTreeNodeMap.keys()));
        for (let level = maxLevel; level >= 0; level -= 1) {
          const levelIsZero = level === 0;
          const levelTreeNodes = levelTreeNodeMap.get(level);
          for (const levelTreeNode of levelTreeNodes) {
            if (levelTreeNode.isLeaf)
              continue;
            const { key: levelTreeNodeKey, shallowLoaded } = levelTreeNode;
            if (checkStrategyIsChild && shallowLoaded) {
              levelTreeNode.children.forEach((v) => {
                if (!v.disabled && !v.isLeaf && v.shallowLoaded && syntheticCheckedKeySet.has(v.key)) {
                  syntheticCheckedKeySet.delete(v.key);
                }
              });
            }
            if (levelTreeNode.disabled || !shallowLoaded) {
              continue;
            }
            let fullyChecked = true;
            let partialChecked = false;
            let allDisabled = true;
            for (const childNode of levelTreeNode.children) {
              const childKey = childNode.key;
              if (childNode.disabled)
                continue;
              if (allDisabled)
                allDisabled = false;
              if (syntheticCheckedKeySet.has(childKey)) {
                partialChecked = true;
              } else if (syntheticIndeterminateKeySet.has(childKey)) {
                partialChecked = true;
                fullyChecked = false;
                break;
              } else {
                fullyChecked = false;
                if (partialChecked) {
                  break;
                }
              }
            }
            if (fullyChecked && !allDisabled) {
              if (checkStrategyIsParent) {
                levelTreeNode.children.forEach((v) => {
                  if (!v.disabled && syntheticCheckedKeySet.has(v.key)) {
                    syntheticCheckedKeySet.delete(v.key);
                  }
                });
              }
              syntheticCheckedKeySet.add(levelTreeNodeKey);
            } else if (partialChecked) {
              syntheticIndeterminateKeySet.add(levelTreeNodeKey);
            }
            if (levelIsZero && checkStrategyIsChild && syntheticCheckedKeySet.has(levelTreeNodeKey)) {
              syntheticCheckedKeySet.delete(levelTreeNodeKey);
            }
          }
        }
        return {
          checkedKeys: Array.from(syntheticCheckedKeySet),
          indeterminateKeys: Array.from(syntheticIndeterminateKeySet)
        };
      }
      function getExtendedCheckedKeySet(checkedKeys, treeMate, allowNotLoaded, isUnchecking) {
        const { treeNodeMap, getChildren } = treeMate;
        const visitedKeySet = /* @__PURE__ */ new Set();
        const extendedKeySet = new Set(checkedKeys);
        checkedKeys.forEach((checkedKey) => {
          const checkedTreeNode = treeNodeMap.get(checkedKey);
          if (checkedTreeNode !== void 0) {
            traverseWithCb(checkedTreeNode, (treeNode) => {
              if (treeNode.disabled) {
                return TRAVERSE_COMMAND.STOP;
              }
              const { key } = treeNode;
              if (visitedKeySet.has(key))
                return;
              visitedKeySet.add(key);
              extendedKeySet.add(key);
              if (isExpilicitlyNotLoaded(treeNode.rawNode, getChildren)) {
                if (isUnchecking) {
                  return TRAVERSE_COMMAND.STOP;
                } else if (!allowNotLoaded) {
                  throw new SubtreeNotLoadedError();
                }
              }
            });
          }
        });
        return extendedKeySet;
      }
      function getPath(key, { includeGroup = false, includeSelf = true }, treeMate) {
        var _a;
        const treeNodeMap = treeMate.treeNodeMap;
        let treeNode = key === null || key === void 0 ? null : (_a = treeNodeMap.get(key)) !== null && _a !== void 0 ? _a : null;
        const mergedPath = {
          keyPath: [],
          treeNodePath: [],
          treeNode
        };
        if (treeNode === null || treeNode === void 0 ? void 0 : treeNode.ignored) {
          mergedPath.treeNode = null;
          return mergedPath;
        }
        while (treeNode) {
          if (!treeNode.ignored && (includeGroup || !treeNode.isGroup)) {
            mergedPath.treeNodePath.push(treeNode);
          }
          treeNode = treeNode.parent;
        }
        mergedPath.treeNodePath.reverse();
        if (!includeSelf)
          mergedPath.treeNodePath.pop();
        mergedPath.keyPath = mergedPath.treeNodePath.map((treeNode2) => treeNode2.key);
        return mergedPath;
      }
      function getFirstAvailableNode(nodes) {
        if (nodes.length === 0)
          return null;
        const node = nodes[0];
        if (node.isGroup || node.ignored || node.disabled) {
          return node.getNext();
        }
        return node;
      }
      function rawGetNext(node, loop) {
        const sibs = node.siblings;
        const l = sibs.length;
        const { index } = node;
        if (loop) {
          return sibs[(index + 1) % l];
        } else {
          if (index === sibs.length - 1)
            return null;
          return sibs[index + 1];
        }
      }
      function move(fromNode, dir, { loop = false, includeDisabled = false } = {}) {
        const iterate = dir === "prev" ? rawGetPrev : rawGetNext;
        const getChildOptions = {
          reverse: dir === "prev"
        };
        let meet = false;
        let endNode = null;
        function traverse(node) {
          if (node === null)
            return;
          if (node === fromNode) {
            if (!meet) {
              meet = true;
            } else if (!fromNode.disabled && !fromNode.isGroup) {
              endNode = fromNode;
              return;
            }
          } else {
            if ((!node.disabled || includeDisabled) && !node.ignored && !node.isGroup) {
              endNode = node;
              return;
            }
          }
          if (node.isGroup) {
            const child = getChild(node, getChildOptions);
            if (child !== null) {
              endNode = child;
            } else {
              traverse(iterate(node, loop));
            }
          } else {
            const nextNode = iterate(node, false);
            if (nextNode !== null) {
              traverse(nextNode);
            } else {
              const parent = rawGetParent(node);
              if (parent === null || parent === void 0 ? void 0 : parent.isGroup) {
                traverse(iterate(parent, loop));
              } else if (loop) {
                traverse(iterate(node, true));
              }
            }
          }
        }
        traverse(fromNode);
        return endNode;
      }
      function rawGetPrev(node, loop) {
        const sibs = node.siblings;
        const l = sibs.length;
        const { index } = node;
        if (loop) {
          return sibs[(index - 1 + l) % l];
        } else {
          if (index === 0)
            return null;
          return sibs[index - 1];
        }
      }
      function rawGetParent(node) {
        return node.parent;
      }
      function getChild(node, options = {}) {
        const { reverse = false } = options;
        const { children } = node;
        if (children) {
          const { length } = children;
          const start = reverse ? length - 1 : 0;
          const end = reverse ? -1 : length;
          const delta = reverse ? -1 : 1;
          for (let i = start; i !== end; i += delta) {
            const child = children[i];
            if (!child.disabled && !child.ignored) {
              if (child.isGroup) {
                const childInGroup = getChild(child, options);
                if (childInGroup !== null)
                  return childInGroup;
              } else {
                return child;
              }
            }
          }
        }
        return null;
      }
      const moveMethods = {
        getChild() {
          if (this.ignored)
            return null;
          return getChild(this);
        },
        getParent() {
          const { parent } = this;
          if (parent === null || parent === void 0 ? void 0 : parent.isGroup) {
            return parent.getParent();
          }
          return parent;
        },
        getNext(options = {}) {
          return move(this, "next", options);
        },
        getPrev(options = {}) {
          return move(this, "prev", options);
        }
      };
      function flatten(treeNodes, expandedKeys) {
        const expandedKeySet = expandedKeys ? new Set(expandedKeys) : void 0;
        const flattenedNodes = [];
        function traverse(treeNodes2) {
          treeNodes2.forEach((treeNode) => {
            flattenedNodes.push(treeNode);
            if (treeNode.isLeaf || !treeNode.children || treeNode.ignored)
              return;
            if (treeNode.isGroup) {
              traverse(treeNode.children);
            } else if (
              // normal non-leaf node
              expandedKeySet === void 0 || expandedKeySet.has(treeNode.key)
            ) {
              traverse(treeNode.children);
            }
          });
        }
        traverse(treeNodes);
        return flattenedNodes;
      }
      function contains(parent, child) {
        const parentKey = parent.key;
        while (child) {
          if (child.key === parentKey)
            return true;
          child = child.parent;
        }
        return false;
      }
      function createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren, parent = null, level = 0) {
        const treeNodes = [];
        rawNodes.forEach((rawNode, index) => {
          var _a;
          const treeNode = Object.create(nodeProto);
          treeNode.rawNode = rawNode;
          treeNode.siblings = treeNodes;
          treeNode.level = level;
          treeNode.index = index;
          treeNode.isFirstChild = index === 0;
          treeNode.isLastChild = index + 1 === rawNodes.length;
          treeNode.parent = parent;
          if (!treeNode.ignored) {
            const rawChildren = getChildren(rawNode);
            if (Array.isArray(rawChildren)) {
              treeNode.children = createTreeNodes(rawChildren, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren, treeNode, level + 1);
            }
          }
          treeNodes.push(treeNode);
          treeNodeMap.set(treeNode.key, treeNode);
          if (!levelTreeNodeMap.has(level))
            levelTreeNodeMap.set(level, []);
          (_a = levelTreeNodeMap.get(level)) === null || _a === void 0 ? void 0 : _a.push(treeNode);
        });
        return treeNodes;
      }
      function createTreeMate(rawNodes, options = {}) {
        var _a;
        const treeNodeMap = /* @__PURE__ */ new Map();
        const levelTreeNodeMap = /* @__PURE__ */ new Map();
        const { getDisabled = isDisabled, getIgnored = isIgnored, getIsGroup = isGroup, getKey = defaultGetKey } = options;
        const _getChildren = (_a = options.getChildren) !== null && _a !== void 0 ? _a : defaultGetChildren;
        const getChildren = options.ignoreEmptyChildren ? (node) => {
          const children = _getChildren(node);
          if (Array.isArray(children)) {
            if (!children.length)
              return null;
            return children;
          }
          return children;
        } : _getChildren;
        const nodeProto = Object.assign({
          get key() {
            return getKey(this.rawNode);
          },
          get disabled() {
            return getDisabled(this.rawNode);
          },
          get isGroup() {
            return getIsGroup(this.rawNode);
          },
          get isLeaf() {
            return isLeaf(this.rawNode, getChildren);
          },
          get shallowLoaded() {
            return isShallowLoaded(this.rawNode, getChildren);
          },
          get ignored() {
            return getIgnored(this.rawNode);
          },
          contains(node) {
            return contains(this, node);
          }
        }, moveMethods);
        const treeNodes = createTreeNodes(rawNodes, treeNodeMap, levelTreeNodeMap, nodeProto, getChildren);
        function getNode(key) {
          if (key === null || key === void 0)
            return null;
          const tmNode = treeNodeMap.get(key);
          if (tmNode && !tmNode.isGroup && !tmNode.ignored) {
            return tmNode;
          }
          return null;
        }
        function _getNode(key) {
          if (key === null || key === void 0)
            return null;
          const tmNode = treeNodeMap.get(key);
          if (tmNode && !tmNode.ignored) {
            return tmNode;
          }
          return null;
        }
        function getPrev(key, options2) {
          const node = _getNode(key);
          if (!node)
            return null;
          return node.getPrev(options2);
        }
        function getNext(key, options2) {
          const node = _getNode(key);
          if (!node)
            return null;
          return node.getNext(options2);
        }
        function getParent(key) {
          const node = _getNode(key);
          if (!node)
            return null;
          return node.getParent();
        }
        function getChild2(key) {
          const node = _getNode(key);
          if (!node)
            return null;
          return node.getChild();
        }
        const treemate = {
          treeNodes,
          treeNodeMap,
          levelTreeNodeMap,
          maxLevel: Math.max(...levelTreeNodeMap.keys()),
          getChildren,
          getFlattenedNodes(expandedKeys) {
            return flatten(treeNodes, expandedKeys);
          },
          getNode,
          getPrev,
          getNext,
          getParent,
          getChild: getChild2,
          getFirstAvailableNode() {
            return getFirstAvailableNode(treeNodes);
          },
          getPath(key, options2 = {}) {
            return getPath(key, options2, treemate);
          },
          getCheckedKeys(checkedKeys, options2 = {}) {
            const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
            return getCheckedKeys({
              checkedKeys: unwrapCheckedKeys(checkedKeys),
              indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
              cascade,
              leafOnly,
              checkStrategy,
              allowNotLoaded
            }, treemate);
          },
          check(keysToCheck, checkedKeys, options2 = {}) {
            const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
            return getCheckedKeys({
              checkedKeys: unwrapCheckedKeys(checkedKeys),
              indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
              keysToCheck: keysToCheck === void 0 || keysToCheck === null ? [] : toArray(keysToCheck),
              cascade,
              leafOnly,
              checkStrategy,
              allowNotLoaded
            }, treemate);
          },
          uncheck(keysToUncheck, checkedKeys, options2 = {}) {
            const { cascade = true, leafOnly = false, checkStrategy = "all", allowNotLoaded = false } = options2;
            return getCheckedKeys({
              checkedKeys: unwrapCheckedKeys(checkedKeys),
              indeterminateKeys: unwrapIndeterminateKeys(checkedKeys),
              keysToUncheck: keysToUncheck === null || keysToUncheck === void 0 ? [] : toArray(keysToUncheck),
              cascade,
              leafOnly,
              checkStrategy,
              allowNotLoaded
            }, treemate);
          },
          getNonLeafKeys(options2 = {}) {
            return getNonLeafKeys(treeNodes, options2);
          }
        };
        return treemate;
      }
      const base = {
        neutralBase: "#FFF",
        neutralInvertBase: "#000",
        neutralTextBase: "#000",
        neutralPopover: "#fff",
        neutralCard: "#fff",
        neutralModal: "#fff",
        neutralBody: "#fff",
        alpha1: "0.82",
        alpha2: "0.72",
        alpha3: "0.38",
        alpha4: "0.24",
        // disabled text, placeholder, icon
        alpha5: "0.18",
        // disabled placeholder
        alphaClose: "0.6",
        alphaDisabled: "0.5",
        alphaDisabledInput: "0.02",
        alphaPending: "0.05",
        alphaTablePending: "0.02",
        alphaPressed: "0.07",
        alphaAvatar: "0.2",
        alphaRail: "0.14",
        alphaProgressRail: ".08",
        alphaBorder: "0.12",
        alphaDivider: "0.06",
        alphaInput: "0",
        alphaAction: "0.02",
        alphaTab: "0.04",
        alphaScrollbar: "0.25",
        alphaScrollbarHover: "0.4",
        alphaCode: "0.05",
        alphaTag: "0.02",
        // primary
        primaryHover: "#36ad6a",
        primaryDefault: "#18a058",
        primaryActive: "#0c7a43",
        primarySuppl: "#36ad6a",
        // info
        infoHover: "#4098fc",
        infoDefault: "#2080f0",
        infoActive: "#1060c9",
        infoSuppl: "#4098fc",
        // error
        errorHover: "#de576d",
        errorDefault: "#d03050",
        errorActive: "#ab1f3f",
        errorSuppl: "#de576d",
        // warning
        warningHover: "#fcb040",
        warningDefault: "#f0a020",
        warningActive: "#c97c10",
        warningSuppl: "#fcb040",
        // success
        successHover: "#36ad6a",
        successDefault: "#18a058",
        successActive: "#0c7a43",
        successSuppl: "#36ad6a"
      };
      const baseBackgroundRgb = rgba(base.neutralBase);
      const baseInvertBackgroundRgb = rgba(base.neutralInvertBase);
      const overlayPrefix = "rgba(" + baseInvertBackgroundRgb.slice(0, 3).join(", ") + ", ";
      function overlay(alpha) {
        return overlayPrefix + String(alpha) + ")";
      }
      function neutral(alpha) {
        const overlayRgba = Array.from(baseInvertBackgroundRgb);
        overlayRgba[3] = Number(alpha);
        return composite(baseBackgroundRgb, overlayRgba);
      }
      const derived = Object.assign(Object.assign({
        name: "common"
      }, commonVariables$2), {
        baseColor: base.neutralBase,
        // primary color
        primaryColor: base.primaryDefault,
        primaryColorHover: base.primaryHover,
        primaryColorPressed: base.primaryActive,
        primaryColorSuppl: base.primarySuppl,
        // info color
        infoColor: base.infoDefault,
        infoColorHover: base.infoHover,
        infoColorPressed: base.infoActive,
        infoColorSuppl: base.infoSuppl,
        // success color
        successColor: base.successDefault,
        successColorHover: base.successHover,
        successColorPressed: base.successActive,
        successColorSuppl: base.successSuppl,
        // warning color
        warningColor: base.warningDefault,
        warningColorHover: base.warningHover,
        warningColorPressed: base.warningActive,
        warningColorSuppl: base.warningSuppl,
        // error color
        errorColor: base.errorDefault,
        errorColorHover: base.errorHover,
        errorColorPressed: base.errorActive,
        errorColorSuppl: base.errorSuppl,
        // text color
        textColorBase: base.neutralTextBase,
        textColor1: "rgb(31, 34, 37)",
        textColor2: "rgb(51, 54, 57)",
        textColor3: "rgb(118, 124, 130)",
        // textColor4: neutral(base.alpha4), // disabled, placeholder, icon
        // textColor5: neutral(base.alpha5),
        textColorDisabled: neutral(base.alpha4),
        placeholderColor: neutral(base.alpha4),
        placeholderColorDisabled: neutral(base.alpha5),
        iconColor: neutral(base.alpha4),
        iconColorHover: scaleColor(neutral(base.alpha4), {
          lightness: 0.75
        }),
        iconColorPressed: scaleColor(neutral(base.alpha4), {
          lightness: 0.9
        }),
        iconColorDisabled: neutral(base.alpha5),
        opacity1: base.alpha1,
        opacity2: base.alpha2,
        opacity3: base.alpha3,
        opacity4: base.alpha4,
        opacity5: base.alpha5,
        dividerColor: "rgb(239, 239, 245)",
        borderColor: "rgb(224, 224, 230)",
        // close
        closeIconColor: neutral(Number(base.alphaClose)),
        closeIconColorHover: neutral(Number(base.alphaClose)),
        closeIconColorPressed: neutral(Number(base.alphaClose)),
        closeColorHover: "rgba(0, 0, 0, .09)",
        closeColorPressed: "rgba(0, 0, 0, .13)",
        // clear
        clearColor: neutral(base.alpha4),
        clearColorHover: scaleColor(neutral(base.alpha4), {
          lightness: 0.75
        }),
        clearColorPressed: scaleColor(neutral(base.alpha4), {
          lightness: 0.9
        }),
        scrollbarColor: overlay(base.alphaScrollbar),
        scrollbarColorHover: overlay(base.alphaScrollbarHover),
        scrollbarWidth: "5px",
        scrollbarHeight: "5px",
        scrollbarBorderRadius: "5px",
        progressRailColor: neutral(base.alphaProgressRail),
        railColor: "rgb(219, 219, 223)",
        popoverColor: base.neutralPopover,
        tableColor: base.neutralCard,
        cardColor: base.neutralCard,
        modalColor: base.neutralModal,
        bodyColor: base.neutralBody,
        tagColor: "#eee",
        avatarColor: neutral(base.alphaAvatar),
        invertedColor: "rgb(0, 20, 40)",
        inputColor: neutral(base.alphaInput),
        codeColor: "rgb(244, 244, 248)",
        tabColor: "rgb(247, 247, 250)",
        actionColor: "rgb(250, 250, 252)",
        tableHeaderColor: "rgb(250, 250, 252)",
        hoverColor: "rgb(243, 243, 245)",
        // use color with alpha since it can be nested with header filter & sorter effect
        tableColorHover: "rgba(0, 0, 100, 0.03)",
        tableColorStriped: "rgba(0, 0, 100, 0.02)",
        pressedColor: "rgb(237, 237, 239)",
        opacityDisabled: base.alphaDisabled,
        inputColorDisabled: "rgb(250, 250, 252)",
        // secondary button color
        // can also be used in tertiary button & quaternary button
        buttonColor2: "rgba(46, 51, 56, .05)",
        buttonColor2Hover: "rgba(46, 51, 56, .09)",
        buttonColor2Pressed: "rgba(46, 51, 56, .13)",
        boxShadow1: "0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",
        boxShadow2: "0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",
        boxShadow3: "0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"
      });
      const commonVars$1 = {
        railInsetHorizontal: "auto 2px 4px 2px",
        railInsetVertical: "2px 4px 2px auto",
        railColor: "transparent"
      };
      const self$6 = (vars) => {
        const {
          scrollbarColor,
          scrollbarColorHover,
          scrollbarHeight,
          scrollbarWidth,
          scrollbarBorderRadius
        } = vars;
        return Object.assign(Object.assign({}, commonVars$1), {
          height: scrollbarHeight,
          width: scrollbarWidth,
          borderRadius: scrollbarBorderRadius,
          color: scrollbarColor,
          colorHover: scrollbarColorHover
        });
      };
      const scrollbarLight = {
        name: "Scrollbar",
        common: derived,
        self: self$6
      };
      const {
        cubicBezierEaseInOut: cubicBezierEaseInOut$1
      } = commonVariables$2;
      function fadeInTransition({
        name = "fade-in",
        enterDuration = "0.2s",
        leaveDuration = "0.2s",
        enterCubicBezier = cubicBezierEaseInOut$1,
        leaveCubicBezier = cubicBezierEaseInOut$1
      } = {}) {
        return [c$1(`&.${name}-transition-enter-active`, {
          transition: `all ${enterDuration} ${enterCubicBezier}!important`
        }), c$1(`&.${name}-transition-leave-active`, {
          transition: `all ${leaveDuration} ${leaveCubicBezier}!important`
        }), c$1(`&.${name}-transition-enter-from, &.${name}-transition-leave-to`, {
          opacity: 0
        }), c$1(`&.${name}-transition-leave-from, &.${name}-transition-enter-to`, {
          opacity: 1
        })];
      }
      const style$4 = cB("scrollbar", `
 overflow: hidden;
 position: relative;
 z-index: auto;
 height: 100%;
 width: 100%;
`, [c$1(">", [cB("scrollbar-container", `
 width: 100%;
 overflow: scroll;
 height: 100%;
 min-height: inherit;
 max-height: inherit;
 scrollbar-width: none;
 `, [c$1("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb", `
 width: 0;
 height: 0;
 display: none;
 `), c$1(">", [
        // We can't set overflow hidden since it affects positioning.
        cB("scrollbar-content", `
 box-sizing: border-box;
 min-width: 100%;
 `)
      ])])]), c$1(">, +", [cB("scrollbar-rail", `
 position: absolute;
 pointer-events: none;
 user-select: none;
 background: var(--n-scrollbar-rail-color);
 -webkit-user-select: none;
 `, [cM("horizontal", `
 inset: var(--n-scrollbar-rail-inset-horizontal);
 height: var(--n-scrollbar-height);
 `, [c$1(">", [cE("scrollbar", `
 height: var(--n-scrollbar-height);
 border-radius: var(--n-scrollbar-border-radius);
 right: 0;
 `)])]), cM("vertical", `
 inset: var(--n-scrollbar-rail-inset-vertical);
 width: var(--n-scrollbar-width);
 `, [c$1(">", [cE("scrollbar", `
 width: var(--n-scrollbar-width);
 border-radius: var(--n-scrollbar-border-radius);
 bottom: 0;
 `)])]), cM("disabled", [c$1(">", [cE("scrollbar", "pointer-events: none;")])]), c$1(">", [cE("scrollbar", `
 z-index: 1;
 position: absolute;
 cursor: pointer;
 pointer-events: all;
 background-color: var(--n-scrollbar-color);
 transition: background-color .2s var(--n-scrollbar-bezier);
 `, [fadeInTransition(), c$1("&:hover", "background-color: var(--n-scrollbar-color-hover);")])])])])]);
      const scrollbarProps = Object.assign(Object.assign({}, useTheme.props), {
        duration: {
          type: Number,
          default: 0
        },
        scrollable: {
          type: Boolean,
          default: true
        },
        xScrollable: Boolean,
        trigger: {
          type: String,
          default: "hover"
        },
        useUnifiedContainer: Boolean,
        triggerDisplayManually: Boolean,
        // If container is set, resize observer won't not attached
        container: Function,
        content: Function,
        containerClass: String,
        containerStyle: [String, Object],
        contentClass: [String, Array],
        contentStyle: [String, Object],
        horizontalRailStyle: [String, Object],
        verticalRailStyle: [String, Object],
        onScroll: Function,
        onWheel: Function,
        onResize: Function,
        internalOnUpdateScrollLeft: Function,
        internalHoistYRail: Boolean
      });
      const Scrollbar = vue.defineComponent({
        name: "Scrollbar",
        props: scrollbarProps,
        inheritAttrs: false,
        setup(props) {
          const {
            mergedClsPrefixRef,
            inlineThemeDisabled,
            mergedRtlRef
          } = useConfig(props);
          const rtlEnabledRef = useRtl("Scrollbar", mergedRtlRef, mergedClsPrefixRef);
          const wrapperRef = vue.ref(null);
          const containerRef = vue.ref(null);
          const contentRef = vue.ref(null);
          const yRailRef = vue.ref(null);
          const xRailRef = vue.ref(null);
          const contentHeightRef = vue.ref(null);
          const contentWidthRef = vue.ref(null);
          const containerHeightRef = vue.ref(null);
          const containerWidthRef = vue.ref(null);
          const yRailSizeRef = vue.ref(null);
          const xRailSizeRef = vue.ref(null);
          const containerScrollTopRef = vue.ref(0);
          const containerScrollLeftRef = vue.ref(0);
          const isShowXBarRef = vue.ref(false);
          const isShowYBarRef = vue.ref(false);
          let yBarPressed = false;
          let xBarPressed = false;
          let xBarVanishTimerId;
          let yBarVanishTimerId;
          let memoYTop = 0;
          let memoXLeft = 0;
          let memoMouseX = 0;
          let memoMouseY = 0;
          const isIos2 = useIsIos();
          const themeRef = useTheme("Scrollbar", "-scrollbar", style$4, scrollbarLight, props, mergedClsPrefixRef);
          const yBarSizeRef = vue.computed(() => {
            const {
              value: containerHeight
            } = containerHeightRef;
            const {
              value: contentHeight
            } = contentHeightRef;
            const {
              value: yRailSize
            } = yRailSizeRef;
            if (containerHeight === null || contentHeight === null || yRailSize === null) {
              return 0;
            } else {
              return Math.min(containerHeight, yRailSize * containerHeight / contentHeight + depx(themeRef.value.self.width) * 1.5);
            }
          });
          const yBarSizePxRef = vue.computed(() => {
            return `${yBarSizeRef.value}px`;
          });
          const xBarSizeRef = vue.computed(() => {
            const {
              value: containerWidth
            } = containerWidthRef;
            const {
              value: contentWidth
            } = contentWidthRef;
            const {
              value: xRailSize
            } = xRailSizeRef;
            if (containerWidth === null || contentWidth === null || xRailSize === null) {
              return 0;
            } else {
              return xRailSize * containerWidth / contentWidth + depx(themeRef.value.self.height) * 1.5;
            }
          });
          const xBarSizePxRef = vue.computed(() => {
            return `${xBarSizeRef.value}px`;
          });
          const yBarTopRef = vue.computed(() => {
            const {
              value: containerHeight
            } = containerHeightRef;
            const {
              value: containerScrollTop
            } = containerScrollTopRef;
            const {
              value: contentHeight
            } = contentHeightRef;
            const {
              value: yRailSize
            } = yRailSizeRef;
            if (containerHeight === null || contentHeight === null || yRailSize === null) {
              return 0;
            } else {
              const heightDiff = contentHeight - containerHeight;
              if (!heightDiff)
                return 0;
              return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
            }
          });
          const yBarTopPxRef = vue.computed(() => {
            return `${yBarTopRef.value}px`;
          });
          const xBarLeftRef = vue.computed(() => {
            const {
              value: containerWidth
            } = containerWidthRef;
            const {
              value: containerScrollLeft
            } = containerScrollLeftRef;
            const {
              value: contentWidth
            } = contentWidthRef;
            const {
              value: xRailSize
            } = xRailSizeRef;
            if (containerWidth === null || contentWidth === null || xRailSize === null) {
              return 0;
            } else {
              const widthDiff = contentWidth - containerWidth;
              if (!widthDiff)
                return 0;
              return containerScrollLeft / widthDiff * (xRailSize - xBarSizeRef.value);
            }
          });
          const xBarLeftPxRef = vue.computed(() => {
            return `${xBarLeftRef.value}px`;
          });
          const needYBarRef = vue.computed(() => {
            const {
              value: containerHeight
            } = containerHeightRef;
            const {
              value: contentHeight
            } = contentHeightRef;
            return containerHeight !== null && contentHeight !== null && contentHeight > containerHeight;
          });
          const needXBarRef = vue.computed(() => {
            const {
              value: containerWidth
            } = containerWidthRef;
            const {
              value: contentWidth
            } = contentWidthRef;
            return containerWidth !== null && contentWidth !== null && contentWidth > containerWidth;
          });
          const mergedShowXBarRef = vue.computed(() => {
            const {
              trigger: trigger2
            } = props;
            return trigger2 === "none" || isShowXBarRef.value;
          });
          const mergedShowYBarRef = vue.computed(() => {
            const {
              trigger: trigger2
            } = props;
            return trigger2 === "none" || isShowYBarRef.value;
          });
          const mergedContainerRef = vue.computed(() => {
            const {
              container
            } = props;
            if (container)
              return container();
            return containerRef.value;
          });
          const mergedContentRef = vue.computed(() => {
            const {
              content
            } = props;
            if (content)
              return content();
            return contentRef.value;
          });
          const activateState = useReactivated(() => {
            if (!props.container) {
              scrollTo({
                top: containerScrollTopRef.value,
                left: containerScrollLeftRef.value
              });
            }
          });
          const handleContentResize = () => {
            if (activateState.isDeactivated)
              return;
            sync();
          };
          const handleContainerResize = (e) => {
            if (activateState.isDeactivated)
              return;
            const {
              onResize
            } = props;
            if (onResize)
              onResize(e);
            sync();
          };
          const scrollTo = (options, y) => {
            if (!props.scrollable)
              return;
            if (typeof options === "number") {
              scrollToPosition(options, y !== null && y !== void 0 ? y : 0, 0, false, "auto");
              return;
            }
            const {
              left,
              top,
              index,
              elSize,
              position,
              behavior,
              el,
              debounce = true
            } = options;
            if (left !== void 0 || top !== void 0) {
              scrollToPosition(left !== null && left !== void 0 ? left : 0, top !== null && top !== void 0 ? top : 0, 0, false, behavior);
            }
            if (el !== void 0) {
              scrollToPosition(0, el.offsetTop, el.offsetHeight, debounce, behavior);
            } else if (index !== void 0 && elSize !== void 0) {
              scrollToPosition(0, index * elSize, elSize, debounce, behavior);
            } else if (position === "bottom") {
              scrollToPosition(0, Number.MAX_SAFE_INTEGER, 0, false, behavior);
            } else if (position === "top") {
              scrollToPosition(0, 0, 0, false, behavior);
            }
          };
          const scrollBy = (options, y) => {
            if (!props.scrollable)
              return;
            const {
              value: container
            } = mergedContainerRef;
            if (!container)
              return;
            if (typeof options === "object") {
              container.scrollBy(options);
            } else {
              container.scrollBy(options, y || 0);
            }
          };
          function scrollToPosition(left, top, elSize, debounce, behavior) {
            const {
              value: container
            } = mergedContainerRef;
            if (!container)
              return;
            if (debounce) {
              const {
                scrollTop,
                offsetHeight
              } = container;
              if (top > scrollTop) {
                if (top + elSize <= scrollTop + offsetHeight)
                  ;
                else {
                  container.scrollTo({
                    left,
                    top: top + elSize - offsetHeight,
                    behavior
                  });
                }
                return;
              }
            }
            container.scrollTo({
              left,
              top,
              behavior
            });
          }
          function handleMouseEnterWrapper() {
            showXBar();
            showYBar();
            sync();
          }
          function handleMouseLeaveWrapper() {
            hideBar();
          }
          function hideBar() {
            hideYBar();
            hideXBar();
          }
          function hideYBar() {
            if (yBarVanishTimerId !== void 0) {
              window.clearTimeout(yBarVanishTimerId);
            }
            yBarVanishTimerId = window.setTimeout(() => {
              isShowYBarRef.value = false;
            }, props.duration);
          }
          function hideXBar() {
            if (xBarVanishTimerId !== void 0) {
              window.clearTimeout(xBarVanishTimerId);
            }
            xBarVanishTimerId = window.setTimeout(() => {
              isShowXBarRef.value = false;
            }, props.duration);
          }
          function showXBar() {
            if (xBarVanishTimerId !== void 0) {
              window.clearTimeout(xBarVanishTimerId);
            }
            isShowXBarRef.value = true;
          }
          function showYBar() {
            if (yBarVanishTimerId !== void 0) {
              window.clearTimeout(yBarVanishTimerId);
            }
            isShowYBarRef.value = true;
          }
          function handleScroll(e) {
            const {
              onScroll
            } = props;
            if (onScroll)
              onScroll(e);
            syncScrollState();
          }
          function syncScrollState() {
            const {
              value: container
            } = mergedContainerRef;
            if (container) {
              containerScrollTopRef.value = container.scrollTop;
              containerScrollLeftRef.value = container.scrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
            }
          }
          function syncPositionState() {
            const {
              value: content
            } = mergedContentRef;
            if (content) {
              contentHeightRef.value = content.offsetHeight;
              contentWidthRef.value = content.offsetWidth;
            }
            const {
              value: container
            } = mergedContainerRef;
            if (container) {
              containerHeightRef.value = container.offsetHeight;
              containerWidthRef.value = container.offsetWidth;
            }
            const {
              value: xRailEl
            } = xRailRef;
            const {
              value: yRailEl
            } = yRailRef;
            if (xRailEl) {
              xRailSizeRef.value = xRailEl.offsetWidth;
            }
            if (yRailEl) {
              yRailSizeRef.value = yRailEl.offsetHeight;
            }
          }
          function syncUnifiedContainer() {
            const {
              value: container
            } = mergedContainerRef;
            if (container) {
              containerScrollTopRef.value = container.scrollTop;
              containerScrollLeftRef.value = container.scrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
              containerHeightRef.value = container.offsetHeight;
              containerWidthRef.value = container.offsetWidth;
              contentHeightRef.value = container.scrollHeight;
              contentWidthRef.value = container.scrollWidth;
            }
            const {
              value: xRailEl
            } = xRailRef;
            const {
              value: yRailEl
            } = yRailRef;
            if (xRailEl) {
              xRailSizeRef.value = xRailEl.offsetWidth;
            }
            if (yRailEl) {
              yRailSizeRef.value = yRailEl.offsetHeight;
            }
          }
          function sync() {
            if (!props.scrollable)
              return;
            if (props.useUnifiedContainer) {
              syncUnifiedContainer();
            } else {
              syncPositionState();
              syncScrollState();
            }
          }
          function isMouseUpAway(e) {
            var _a;
            return !((_a = wrapperRef.value) === null || _a === void 0 ? void 0 : _a.contains(getPreciseEventTarget(e)));
          }
          function handleXScrollMouseDown(e) {
            e.preventDefault();
            e.stopPropagation();
            xBarPressed = true;
            on("mousemove", window, handleXScrollMouseMove, true);
            on("mouseup", window, handleXScrollMouseUp, true);
            memoXLeft = containerScrollLeftRef.value;
            memoMouseX = (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? window.innerWidth - e.clientX : e.clientX;
          }
          function handleXScrollMouseMove(e) {
            if (!xBarPressed)
              return;
            if (xBarVanishTimerId !== void 0) {
              window.clearTimeout(xBarVanishTimerId);
            }
            if (yBarVanishTimerId !== void 0) {
              window.clearTimeout(yBarVanishTimerId);
            }
            const {
              value: containerWidth
            } = containerWidthRef;
            const {
              value: contentWidth
            } = contentWidthRef;
            const {
              value: xBarSize
            } = xBarSizeRef;
            if (containerWidth === null || contentWidth === null)
              return;
            const dX = (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? window.innerWidth - e.clientX - memoMouseX : e.clientX - memoMouseX;
            const dScrollLeft = dX * (contentWidth - containerWidth) / (containerWidth - xBarSize);
            const toScrollLeftUpperBound = contentWidth - containerWidth;
            let toScrollLeft = memoXLeft + dScrollLeft;
            toScrollLeft = Math.min(toScrollLeftUpperBound, toScrollLeft);
            toScrollLeft = Math.max(toScrollLeft, 0);
            const {
              value: container
            } = mergedContainerRef;
            if (container) {
              container.scrollLeft = toScrollLeft * ((rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? -1 : 1);
              const {
                internalOnUpdateScrollLeft
              } = props;
              if (internalOnUpdateScrollLeft)
                internalOnUpdateScrollLeft(toScrollLeft);
            }
          }
          function handleXScrollMouseUp(e) {
            e.preventDefault();
            e.stopPropagation();
            off("mousemove", window, handleXScrollMouseMove, true);
            off("mouseup", window, handleXScrollMouseUp, true);
            xBarPressed = false;
            sync();
            if (isMouseUpAway(e)) {
              hideBar();
            }
          }
          function handleYScrollMouseDown(e) {
            e.preventDefault();
            e.stopPropagation();
            yBarPressed = true;
            on("mousemove", window, handleYScrollMouseMove, true);
            on("mouseup", window, handleYScrollMouseUp, true);
            memoYTop = containerScrollTopRef.value;
            memoMouseY = e.clientY;
          }
          function handleYScrollMouseMove(e) {
            if (!yBarPressed)
              return;
            if (xBarVanishTimerId !== void 0) {
              window.clearTimeout(xBarVanishTimerId);
            }
            if (yBarVanishTimerId !== void 0) {
              window.clearTimeout(yBarVanishTimerId);
            }
            const {
              value: containerHeight
            } = containerHeightRef;
            const {
              value: contentHeight
            } = contentHeightRef;
            const {
              value: yBarSize
            } = yBarSizeRef;
            if (containerHeight === null || contentHeight === null)
              return;
            const dY = e.clientY - memoMouseY;
            const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
            const toScrollTopUpperBound = contentHeight - containerHeight;
            let toScrollTop = memoYTop + dScrollTop;
            toScrollTop = Math.min(toScrollTopUpperBound, toScrollTop);
            toScrollTop = Math.max(toScrollTop, 0);
            const {
              value: container
            } = mergedContainerRef;
            if (container) {
              container.scrollTop = toScrollTop;
            }
          }
          function handleYScrollMouseUp(e) {
            e.preventDefault();
            e.stopPropagation();
            off("mousemove", window, handleYScrollMouseMove, true);
            off("mouseup", window, handleYScrollMouseUp, true);
            yBarPressed = false;
            sync();
            if (isMouseUpAway(e)) {
              hideBar();
            }
          }
          vue.watchEffect(() => {
            const {
              value: needXBar
            } = needXBarRef;
            const {
              value: needYBar
            } = needYBarRef;
            const {
              value: mergedClsPrefix
            } = mergedClsPrefixRef;
            const {
              value: xRailEl
            } = xRailRef;
            const {
              value: yRailEl
            } = yRailRef;
            if (xRailEl) {
              if (!needXBar) {
                xRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
              } else {
                xRailEl.classList.remove(`${mergedClsPrefix}-scrollbar-rail--disabled`);
              }
            }
            if (yRailEl) {
              if (!needYBar) {
                yRailEl.classList.add(`${mergedClsPrefix}-scrollbar-rail--disabled`);
              } else {
                yRailEl.classList.remove(`${mergedClsPrefix}-scrollbar-rail--disabled`);
              }
            }
          });
          vue.onMounted(() => {
            if (props.container)
              return;
            sync();
          });
          vue.onBeforeUnmount(() => {
            if (xBarVanishTimerId !== void 0) {
              window.clearTimeout(xBarVanishTimerId);
            }
            if (yBarVanishTimerId !== void 0) {
              window.clearTimeout(yBarVanishTimerId);
            }
            off("mousemove", window, handleYScrollMouseMove, true);
            off("mouseup", window, handleYScrollMouseUp, true);
          });
          const cssVarsRef = vue.computed(() => {
            const {
              common: {
                cubicBezierEaseInOut: cubicBezierEaseInOut2
              },
              self: {
                color,
                colorHover,
                height,
                width,
                borderRadius,
                railInsetHorizontal,
                railInsetVertical,
                railColor
              }
            } = themeRef.value;
            return {
              "--n-scrollbar-bezier": cubicBezierEaseInOut2,
              "--n-scrollbar-color": color,
              "--n-scrollbar-color-hover": colorHover,
              "--n-scrollbar-border-radius": borderRadius,
              "--n-scrollbar-width": width,
              "--n-scrollbar-height": height,
              "--n-scrollbar-rail-inset-horizontal": railInsetHorizontal,
              "--n-scrollbar-rail-inset-vertical": (rtlEnabledRef === null || rtlEnabledRef === void 0 ? void 0 : rtlEnabledRef.value) ? rtlInset(railInsetVertical) : railInsetVertical,
              "--n-scrollbar-rail-color": railColor
            };
          });
          const themeClassHandle = inlineThemeDisabled ? useThemeClass("scrollbar", void 0, cssVarsRef, props) : void 0;
          const exposedMethods = {
            scrollTo,
            scrollBy,
            sync,
            syncUnifiedContainer,
            handleMouseEnterWrapper,
            handleMouseLeaveWrapper
          };
          return Object.assign(Object.assign({}, exposedMethods), {
            mergedClsPrefix: mergedClsPrefixRef,
            rtlEnabled: rtlEnabledRef,
            containerScrollTop: containerScrollTopRef,
            wrapperRef,
            containerRef,
            contentRef,
            yRailRef,
            xRailRef,
            needYBar: needYBarRef,
            needXBar: needXBarRef,
            yBarSizePx: yBarSizePxRef,
            xBarSizePx: xBarSizePxRef,
            yBarTopPx: yBarTopPxRef,
            xBarLeftPx: xBarLeftPxRef,
            isShowXBar: mergedShowXBarRef,
            isShowYBar: mergedShowYBarRef,
            isIos: isIos2,
            handleScroll,
            handleContentResize,
            handleContainerResize,
            handleYScrollMouseDown,
            handleXScrollMouseDown,
            cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
            themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
            onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
          });
        },
        render() {
          var _a;
          const {
            $slots,
            mergedClsPrefix,
            triggerDisplayManually,
            rtlEnabled,
            internalHoistYRail
          } = this;
          if (!this.scrollable)
            return (_a = $slots.default) === null || _a === void 0 ? void 0 : _a.call($slots);
          const triggerIsNone = this.trigger === "none";
          const createYRail = (className, style2) => {
            return vue.h("div", {
              ref: "yRailRef",
              class: [`${mergedClsPrefix}-scrollbar-rail`, `${mergedClsPrefix}-scrollbar-rail--vertical`, className],
              "data-scrollbar-rail": true,
              style: [style2 || "", this.verticalRailStyle],
              "aria-hidden": true
            }, vue.h(
              // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
              triggerIsNone ? Wrapper : vue.Transition,
              triggerIsNone ? null : {
                name: "fade-in-transition"
              },
              {
                default: () => this.needYBar && this.isShowYBar && !this.isIos ? vue.h("div", {
                  class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
                  style: {
                    height: this.yBarSizePx,
                    top: this.yBarTopPx
                  },
                  onMousedown: this.handleYScrollMouseDown
                }) : null
              }
            ));
          };
          const createChildren = () => {
            var _a2, _b;
            (_a2 = this.onRender) === null || _a2 === void 0 ? void 0 : _a2.call(this);
            return vue.h("div", vue.mergeProps(this.$attrs, {
              role: "none",
              ref: "wrapperRef",
              class: [`${mergedClsPrefix}-scrollbar`, this.themeClass, rtlEnabled && `${mergedClsPrefix}-scrollbar--rtl`],
              style: this.cssVars,
              onMouseenter: triggerDisplayManually ? void 0 : this.handleMouseEnterWrapper,
              onMouseleave: triggerDisplayManually ? void 0 : this.handleMouseLeaveWrapper
            }), [this.container ? (_b = $slots.default) === null || _b === void 0 ? void 0 : _b.call($slots) : vue.h("div", {
              role: "none",
              ref: "containerRef",
              class: [`${mergedClsPrefix}-scrollbar-container`, this.containerClass],
              style: this.containerStyle,
              onScroll: this.handleScroll,
              onWheel: this.onWheel
            }, vue.h(VResizeObserver, {
              onResize: this.handleContentResize
            }, {
              default: () => vue.h("div", {
                ref: "contentRef",
                role: "none",
                style: [{
                  width: this.xScrollable ? "fit-content" : null
                }, this.contentStyle],
                class: [`${mergedClsPrefix}-scrollbar-content`, this.contentClass]
              }, $slots)
            })), internalHoistYRail ? null : createYRail(void 0, void 0), this.xScrollable && vue.h("div", {
              ref: "xRailRef",
              class: [`${mergedClsPrefix}-scrollbar-rail`, `${mergedClsPrefix}-scrollbar-rail--horizontal`],
              style: this.horizontalRailStyle,
              "data-scrollbar-rail": true,
              "aria-hidden": true
            }, vue.h(
              // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
              triggerIsNone ? Wrapper : vue.Transition,
              triggerIsNone ? null : {
                name: "fade-in-transition"
              },
              {
                default: () => this.needXBar && this.isShowXBar && !this.isIos ? vue.h("div", {
                  class: `${mergedClsPrefix}-scrollbar-rail__scrollbar`,
                  style: {
                    width: this.xBarSizePx,
                    right: rtlEnabled ? this.xBarLeftPx : void 0,
                    left: rtlEnabled ? void 0 : this.xBarLeftPx
                  },
                  onMousedown: this.handleXScrollMouseDown
                }) : null
              }
            ))]);
          };
          const scrollbarNode = this.container ? createChildren() : vue.h(VResizeObserver, {
            onResize: this.handleContainerResize
          }, {
            default: createChildren
          });
          if (internalHoistYRail) {
            return vue.h(vue.Fragment, null, scrollbarNode, createYRail(this.themeClass, this.cssVars));
          } else {
            return scrollbarNode;
          }
        }
      });
      const XScrollbar = Scrollbar;
      const {
        cubicBezierEaseIn: cubicBezierEaseIn$1,
        cubicBezierEaseOut: cubicBezierEaseOut$1
      } = commonVariables$2;
      function fadeInScaleUpTransition({
        transformOrigin = "inherit",
        duration = ".2s",
        enterScale = ".9",
        originalTransform = "",
        originalTransition = ""
      } = {}) {
        return [c$1("&.fade-in-scale-up-transition-leave-active", {
          transformOrigin,
          transition: `opacity ${duration} ${cubicBezierEaseIn$1}, transform ${duration} ${cubicBezierEaseIn$1} ${originalTransition && "," + originalTransition}`
        }), c$1("&.fade-in-scale-up-transition-enter-active", {
          transformOrigin,
          transition: `opacity ${duration} ${cubicBezierEaseOut$1}, transform ${duration} ${cubicBezierEaseOut$1} ${originalTransition && "," + originalTransition}`
        }), c$1("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to", {
          opacity: 0,
          transform: `${originalTransform} scale(${enterScale})`
        }), c$1("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to", {
          opacity: 1,
          transform: `${originalTransform} scale(1)`
        })];
      }
      const commonVariables$1 = {
        space: "6px",
        spaceArrow: "10px",
        arrowOffset: "10px",
        arrowOffsetVertical: "10px",
        arrowHeight: "6px",
        padding: "8px 14px"
      };
      const self$5 = (vars) => {
        const {
          boxShadow2,
          popoverColor,
          textColor2,
          borderRadius,
          fontSize: fontSize2,
          dividerColor
        } = vars;
        return Object.assign(Object.assign({}, commonVariables$1), {
          fontSize: fontSize2,
          borderRadius,
          color: popoverColor,
          dividerColor,
          textColor: textColor2,
          boxShadow: boxShadow2
        });
      };
      const popoverLight = {
        name: "Popover",
        common: derived,
        self: self$5
      };
      const oppositePlacement = {
        top: "bottom",
        bottom: "top",
        left: "right",
        right: "left"
      };
      const arrowSize = "var(--n-arrow-height) * 1.414";
      const style$3 = c$1([cB("popover", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 position: relative;
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 box-shadow: var(--n-box-shadow);
 word-break: break-word;
 `, [c$1(">", [cB("scrollbar", `
 height: inherit;
 max-height: inherit;
 `)]), cNotM("raw", `
 background-color: var(--n-color);
 border-radius: var(--n-border-radius);
 `, [cNotM("scrollable", [cNotM("show-header-or-footer", "padding: var(--n-padding);")])]), cE("header", `
 padding: var(--n-padding);
 border-bottom: 1px solid var(--n-divider-color);
 transition: border-color .3s var(--n-bezier);
 `), cE("footer", `
 padding: var(--n-padding);
 border-top: 1px solid var(--n-divider-color);
 transition: border-color .3s var(--n-bezier);
 `), cM("scrollable, show-header-or-footer", [cE("content", `
 padding: var(--n-padding);
 `)])]), cB("popover-shared", `
 transform-origin: inherit;
 `, [
        cB("popover-arrow-wrapper", `
 position: absolute;
 overflow: hidden;
 pointer-events: none;
 `, [cB("popover-arrow", `
 transition: background-color .3s var(--n-bezier);
 position: absolute;
 display: block;
 width: calc(${arrowSize});
 height: calc(${arrowSize});
 box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
 transform: rotate(45deg);
 background-color: var(--n-color);
 pointer-events: all;
 `)]),
        // body transition
        c$1("&.popover-transition-enter-from, &.popover-transition-leave-to", `
 opacity: 0;
 transform: scale(.85);
 `),
        c$1("&.popover-transition-enter-to, &.popover-transition-leave-from", `
 transform: scale(1);
 opacity: 1;
 `),
        c$1("&.popover-transition-enter-active", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .15s var(--n-bezier-ease-out),
 transform .15s var(--n-bezier-ease-out);
 `),
        c$1("&.popover-transition-leave-active", `
 transition:
 box-shadow .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier),
 opacity .15s var(--n-bezier-ease-in),
 transform .15s var(--n-bezier-ease-in);
 `)
      ]), placementStyle("top-start", `
 top: calc(${arrowSize} / -2);
 left: calc(${getArrowOffset("top-start")} - var(--v-offset-left));
 `), placementStyle("top", `
 top: calc(${arrowSize} / -2);
 transform: translateX(calc(${arrowSize} / -2)) rotate(45deg);
 left: 50%;
 `), placementStyle("top-end", `
 top: calc(${arrowSize} / -2);
 right: calc(${getArrowOffset("top-end")} + var(--v-offset-left));
 `), placementStyle("bottom-start", `
 bottom: calc(${arrowSize} / -2);
 left: calc(${getArrowOffset("bottom-start")} - var(--v-offset-left));
 `), placementStyle("bottom", `
 bottom: calc(${arrowSize} / -2);
 transform: translateX(calc(${arrowSize} / -2)) rotate(45deg);
 left: 50%;
 `), placementStyle("bottom-end", `
 bottom: calc(${arrowSize} / -2);
 right: calc(${getArrowOffset("bottom-end")} + var(--v-offset-left));
 `), placementStyle("left-start", `
 left: calc(${arrowSize} / -2);
 top: calc(${getArrowOffset("left-start")} - var(--v-offset-top));
 `), placementStyle("left", `
 left: calc(${arrowSize} / -2);
 transform: translateY(calc(${arrowSize} / -2)) rotate(45deg);
 top: 50%;
 `), placementStyle("left-end", `
 left: calc(${arrowSize} / -2);
 bottom: calc(${getArrowOffset("left-end")} + var(--v-offset-top));
 `), placementStyle("right-start", `
 right: calc(${arrowSize} / -2);
 top: calc(${getArrowOffset("right-start")} - var(--v-offset-top));
 `), placementStyle("right", `
 right: calc(${arrowSize} / -2);
 transform: translateY(calc(${arrowSize} / -2)) rotate(45deg);
 top: 50%;
 `), placementStyle("right-end", `
 right: calc(${arrowSize} / -2);
 bottom: calc(${getArrowOffset("right-end")} + var(--v-offset-top));
 `), ...map({
        top: ["right-start", "left-start"],
        right: ["top-end", "bottom-end"],
        bottom: ["right-end", "left-end"],
        left: ["top-start", "bottom-start"]
      }, (placements, direction) => {
        const isVertical = ["right", "left"].includes(direction);
        const sizeType = isVertical ? "width" : "height";
        return placements.map((placement) => {
          const isReverse = placement.split("-")[1] === "end";
          const targetSize = `var(--v-target-${sizeType}, 0px)`;
          const centerOffset = `calc((${targetSize} - ${arrowSize}) / 2)`;
          const offset = getArrowOffset(placement);
          return c$1(`[v-placement="${placement}"] >`, [cB("popover-shared", [cM("center-arrow", [cB("popover-arrow", `${direction}: calc(max(${centerOffset}, ${offset}) ${isReverse ? "+" : "-"} var(--v-offset-${isVertical ? "left" : "top"}));`)])])]);
        });
      })]);
      function getArrowOffset(placement) {
        return ["top", "bottom"].includes(placement.split("-")[0]) ? "var(--n-arrow-offset)" : "var(--n-arrow-offset-vertical)";
      }
      function placementStyle(placement, arrowStyleLiteral) {
        const position = placement.split("-")[0];
        const sizeStyle = ["top", "bottom"].includes(position) ? "height: var(--n-space-arrow);" : "width: var(--n-space-arrow);";
        return c$1(`[v-placement="${placement}"] >`, [cB("popover-shared", `
 margin-${oppositePlacement[position]}: var(--n-space);
 `, [cM("show-arrow", `
 margin-${oppositePlacement[position]}: var(--n-space-arrow);
 `), cM("overlap", `
 margin: 0;
 `), cCB("popover-arrow-wrapper", `
 right: 0;
 left: 0;
 top: 0;
 bottom: 0;
 ${position}: 100%;
 ${oppositePlacement[position]}: auto;
 ${sizeStyle}
 `, [cB("popover-arrow", arrowStyleLiteral)])])]);
      }
      const popoverBodyProps = Object.assign(Object.assign({}, useTheme.props), {
        to: useAdjustedTo.propTo,
        show: Boolean,
        trigger: String,
        showArrow: Boolean,
        delay: Number,
        duration: Number,
        raw: Boolean,
        arrowPointToCenter: Boolean,
        arrowClass: String,
        arrowStyle: [String, Object],
        arrowWrapperClass: String,
        arrowWrapperStyle: [String, Object],
        displayDirective: String,
        x: Number,
        y: Number,
        flip: Boolean,
        overlap: Boolean,
        placement: String,
        width: [Number, String],
        keepAliveOnHover: Boolean,
        scrollable: Boolean,
        contentClass: String,
        contentStyle: [Object, String],
        headerClass: String,
        headerStyle: [Object, String],
        footerClass: String,
        footerStyle: [Object, String],
        // private
        internalDeactivateImmediately: Boolean,
        animated: Boolean,
        onClickoutside: Function,
        internalTrapFocus: Boolean,
        internalOnAfterLeave: Function,
        // deprecated
        minWidth: Number,
        maxWidth: Number
      });
      const renderArrow = ({
        arrowClass,
        arrowStyle,
        arrowWrapperClass,
        arrowWrapperStyle,
        clsPrefix
      }) => {
        return vue.h("div", {
          key: "__popover-arrow__",
          style: arrowWrapperStyle,
          class: [`${clsPrefix}-popover-arrow-wrapper`, arrowWrapperClass]
        }, vue.h("div", {
          class: [`${clsPrefix}-popover-arrow`, arrowClass],
          style: arrowStyle
        }));
      };
      const NPopoverBody = vue.defineComponent({
        name: "PopoverBody",
        inheritAttrs: false,
        props: popoverBodyProps,
        setup(props, {
          slots,
          attrs
        }) {
          const {
            namespaceRef,
            mergedClsPrefixRef,
            inlineThemeDisabled
          } = useConfig(props);
          const themeRef = useTheme("Popover", "-popover", style$3, popoverLight, props, mergedClsPrefixRef);
          const followerRef = vue.ref(null);
          const NPopover2 = vue.inject("NPopover");
          const bodyRef = vue.ref(null);
          const followerEnabledRef = vue.ref(props.show);
          const displayedRef = vue.ref(false);
          vue.watchEffect(() => {
            const {
              show
            } = props;
            if (show && !isJsdom() && !props.internalDeactivateImmediately) {
              displayedRef.value = true;
            }
          });
          const directivesRef = vue.computed(() => {
            const {
              trigger: trigger2,
              onClickoutside
            } = props;
            const directives = [];
            const {
              positionManuallyRef: {
                value: positionManually
              }
            } = NPopover2;
            if (!positionManually) {
              if (trigger2 === "click" && !onClickoutside) {
                directives.push([clickoutside, handleClickOutside, void 0, {
                  capture: true
                }]);
              }
              if (trigger2 === "hover") {
                directives.push([mousemoveoutside, handleMouseMoveOutside]);
              }
            }
            if (onClickoutside) {
              directives.push([clickoutside, handleClickOutside, void 0, {
                capture: true
              }]);
            }
            if (props.displayDirective === "show" || props.animated && displayedRef.value) {
              directives.push([vue.vShow, props.show]);
            }
            return directives;
          });
          const styleRef = vue.computed(() => {
            const width = props.width === "trigger" ? void 0 : formatLength(props.width);
            const style2 = [];
            if (width) {
              style2.push({
                width
              });
            }
            const {
              maxWidth,
              minWidth
            } = props;
            if (maxWidth) {
              style2.push({
                maxWidth: formatLength(maxWidth)
              });
            }
            if (minWidth) {
              style2.push({
                maxWidth: formatLength(minWidth)
              });
            }
            if (!inlineThemeDisabled) {
              style2.push(cssVarsRef.value);
            }
            return style2;
          });
          const cssVarsRef = vue.computed(() => {
            const {
              common: {
                cubicBezierEaseInOut: cubicBezierEaseInOut2,
                cubicBezierEaseIn: cubicBezierEaseIn2,
                cubicBezierEaseOut: cubicBezierEaseOut2
              },
              self: {
                space,
                spaceArrow,
                padding,
                fontSize: fontSize2,
                textColor,
                dividerColor,
                color,
                boxShadow,
                borderRadius,
                arrowHeight,
                arrowOffset,
                arrowOffsetVertical
              }
            } = themeRef.value;
            return {
              "--n-box-shadow": boxShadow,
              "--n-bezier": cubicBezierEaseInOut2,
              "--n-bezier-ease-in": cubicBezierEaseIn2,
              "--n-bezier-ease-out": cubicBezierEaseOut2,
              "--n-font-size": fontSize2,
              "--n-text-color": textColor,
              "--n-color": color,
              "--n-divider-color": dividerColor,
              "--n-border-radius": borderRadius,
              "--n-arrow-height": arrowHeight,
              "--n-arrow-offset": arrowOffset,
              "--n-arrow-offset-vertical": arrowOffsetVertical,
              "--n-padding": padding,
              "--n-space": space,
              "--n-space-arrow": spaceArrow
            };
          });
          const themeClassHandle = inlineThemeDisabled ? useThemeClass("popover", void 0, cssVarsRef, props) : void 0;
          NPopover2.setBodyInstance({
            syncPosition
          });
          vue.onBeforeUnmount(() => {
            NPopover2.setBodyInstance(null);
          });
          vue.watch(vue.toRef(props, "show"), (value) => {
            if (props.animated)
              return;
            if (value) {
              followerEnabledRef.value = true;
            } else {
              followerEnabledRef.value = false;
            }
          });
          function syncPosition() {
            var _a;
            (_a = followerRef.value) === null || _a === void 0 ? void 0 : _a.syncPosition();
          }
          function handleMouseEnter(e) {
            if (props.trigger === "hover" && props.keepAliveOnHover && props.show) {
              NPopover2.handleMouseEnter(e);
            }
          }
          function handleMouseLeave(e) {
            if (props.trigger === "hover" && props.keepAliveOnHover) {
              NPopover2.handleMouseLeave(e);
            }
          }
          function handleMouseMoveOutside(e) {
            if (props.trigger === "hover" && !getTriggerElement().contains(getPreciseEventTarget(e))) {
              NPopover2.handleMouseMoveOutside(e);
            }
          }
          function handleClickOutside(e) {
            if (props.trigger === "click" && !getTriggerElement().contains(getPreciseEventTarget(e)) || props.onClickoutside) {
              NPopover2.handleClickOutside(e);
            }
          }
          function getTriggerElement() {
            return NPopover2.getTriggerElement();
          }
          vue.provide(popoverBodyInjectionKey, bodyRef);
          vue.provide(drawerBodyInjectionKey, null);
          vue.provide(modalBodyInjectionKey, null);
          function renderContentNode() {
            themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender();
            const shouldRenderDom = props.displayDirective === "show" || props.show || props.animated && displayedRef.value;
            if (!shouldRenderDom) {
              return null;
            }
            let contentNode;
            const renderBody = NPopover2.internalRenderBodyRef.value;
            const {
              value: mergedClsPrefix
            } = mergedClsPrefixRef;
            if (!renderBody) {
              const {
                value: extraClass
              } = NPopover2.extraClassRef;
              const {
                internalTrapFocus
              } = props;
              const hasHeaderOrFooter = !isSlotEmpty(slots.header) || !isSlotEmpty(slots.footer);
              const renderContentInnerNode = () => {
                var _a, _b;
                const body = hasHeaderOrFooter ? vue.h(vue.Fragment, null, resolveWrappedSlot(slots.header, (children) => {
                  return children ? vue.h("div", {
                    class: [`${mergedClsPrefix}-popover__header`, props.headerClass],
                    style: props.headerStyle
                  }, children) : null;
                }), resolveWrappedSlot(slots.default, (children) => {
                  return children ? vue.h("div", {
                    class: [`${mergedClsPrefix}-popover__content`, props.contentClass],
                    style: props.contentStyle
                  }, slots) : null;
                }), resolveWrappedSlot(slots.footer, (children) => {
                  return children ? vue.h("div", {
                    class: [`${mergedClsPrefix}-popover__footer`, props.footerClass],
                    style: props.footerStyle
                  }, children) : null;
                })) : props.scrollable ? (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots) : vue.h("div", {
                  class: [`${mergedClsPrefix}-popover__content`, props.contentClass],
                  style: props.contentStyle
                }, slots);
                const maybeScrollableBody = props.scrollable ? vue.h(XScrollbar, {
                  contentClass: hasHeaderOrFooter ? void 0 : `${mergedClsPrefix}-popover__content ${(_b = props.contentClass) !== null && _b !== void 0 ? _b : ""}`,
                  contentStyle: hasHeaderOrFooter ? void 0 : props.contentStyle
                }, {
                  default: () => body
                }) : body;
                const arrow = props.showArrow ? renderArrow({
                  arrowClass: props.arrowClass,
                  arrowStyle: props.arrowStyle,
                  arrowWrapperClass: props.arrowWrapperClass,
                  arrowWrapperStyle: props.arrowWrapperStyle,
                  clsPrefix: mergedClsPrefix
                }) : null;
                return [maybeScrollableBody, arrow];
              };
              contentNode = vue.h("div", vue.mergeProps({
                class: [`${mergedClsPrefix}-popover`, `${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, extraClass.map((v) => `${mergedClsPrefix}-${v}`), {
                  [`${mergedClsPrefix}-popover--scrollable`]: props.scrollable,
                  [`${mergedClsPrefix}-popover--show-header-or-footer`]: hasHeaderOrFooter,
                  [`${mergedClsPrefix}-popover--raw`]: props.raw,
                  [`${mergedClsPrefix}-popover-shared--overlap`]: props.overlap,
                  [`${mergedClsPrefix}-popover-shared--show-arrow`]: props.showArrow,
                  [`${mergedClsPrefix}-popover-shared--center-arrow`]: props.arrowPointToCenter
                }],
                ref: bodyRef,
                style: styleRef.value,
                onKeydown: NPopover2.handleKeydown,
                onMouseenter: handleMouseEnter,
                onMouseleave: handleMouseLeave
              }, attrs), internalTrapFocus ? vue.h(FocusTrap, {
                active: props.show,
                autoFocus: true
              }, {
                default: renderContentInnerNode
              }) : renderContentInnerNode());
            } else {
              contentNode = renderBody(
                // The popover class and overlap class must exists, they will be used
                // to place the body & transition animation.
                // Shadow class exists for reuse box-shadow.
                [`${mergedClsPrefix}-popover-shared`, themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass.value, props.overlap && `${mergedClsPrefix}-popover-shared--overlap`, props.showArrow && `${mergedClsPrefix}-popover-shared--show-arrow`, props.arrowPointToCenter && `${mergedClsPrefix}-popover-shared--center-arrow`],
                bodyRef,
                styleRef.value,
                handleMouseEnter,
                handleMouseLeave
              );
            }
            return vue.withDirectives(contentNode, directivesRef.value);
          }
          return {
            displayed: displayedRef,
            namespace: namespaceRef,
            isMounted: NPopover2.isMountedRef,
            zIndex: NPopover2.zIndexRef,
            followerRef,
            adjustedTo: useAdjustedTo(props),
            followerEnabled: followerEnabledRef,
            renderContentNode
          };
        },
        render() {
          return vue.h(VFollower, {
            ref: "followerRef",
            zIndex: this.zIndex,
            show: this.show,
            enabled: this.followerEnabled,
            to: this.adjustedTo,
            x: this.x,
            y: this.y,
            flip: this.flip,
            placement: this.placement,
            containerClass: this.namespace,
            overlap: this.overlap,
            width: this.width === "trigger" ? "target" : void 0,
            teleportDisabled: this.adjustedTo === useAdjustedTo.tdkey
          }, {
            default: () => {
              return this.animated ? vue.h(vue.Transition, {
                name: "popover-transition",
                appear: this.isMounted,
                // Don't use watch to enable follower, since the transition may
                // make position sync timing very subtle and buggy.
                onEnter: () => {
                  this.followerEnabled = true;
                },
                onAfterLeave: () => {
                  var _a;
                  (_a = this.internalOnAfterLeave) === null || _a === void 0 ? void 0 : _a.call(this);
                  this.followerEnabled = false;
                  this.displayed = false;
                }
              }, {
                default: this.renderContentNode
              }) : this.renderContentNode();
            }
          });
        }
      });
      const bodyPropKeys = Object.keys(popoverBodyProps);
      const triggerEventMap = {
        focus: ["onFocus", "onBlur"],
        click: ["onClick"],
        hover: ["onMouseenter", "onMouseleave"],
        manual: [],
        nested: ["onFocus", "onBlur", "onMouseenter", "onMouseleave", "onClick"]
      };
      function appendEvents(vNode, trigger2, events2) {
        triggerEventMap[trigger2].forEach((eventName) => {
          if (!vNode.props)
            vNode.props = {};
          else {
            vNode.props = Object.assign({}, vNode.props);
          }
          const originalHandler = vNode.props[eventName];
          const handler = events2[eventName];
          if (!originalHandler)
            vNode.props[eventName] = handler;
          else {
            vNode.props[eventName] = (...args) => {
              originalHandler(...args);
              handler(...args);
            };
          }
        });
      }
      const popoverBaseProps = {
        show: {
          type: Boolean,
          default: void 0
        },
        defaultShow: Boolean,
        showArrow: {
          type: Boolean,
          default: true
        },
        trigger: {
          type: String,
          default: "hover"
        },
        delay: {
          type: Number,
          default: 100
        },
        duration: {
          type: Number,
          default: 100
        },
        raw: Boolean,
        placement: {
          type: String,
          default: "top"
        },
        x: Number,
        y: Number,
        arrowPointToCenter: Boolean,
        disabled: Boolean,
        getDisabled: Function,
        displayDirective: {
          type: String,
          default: "if"
        },
        arrowClass: String,
        arrowStyle: [String, Object],
        arrowWrapperClass: String,
        arrowWrapperStyle: [String, Object],
        flip: {
          type: Boolean,
          default: true
        },
        animated: {
          type: Boolean,
          default: true
        },
        width: {
          type: [Number, String],
          default: void 0
        },
        overlap: Boolean,
        keepAliveOnHover: {
          type: Boolean,
          default: true
        },
        zIndex: Number,
        to: useAdjustedTo.propTo,
        scrollable: Boolean,
        contentClass: String,
        contentStyle: [Object, String],
        headerClass: String,
        headerStyle: [Object, String],
        footerClass: String,
        footerStyle: [Object, String],
        // events
        onClickoutside: Function,
        "onUpdate:show": [Function, Array],
        onUpdateShow: [Function, Array],
        // internal
        internalDeactivateImmediately: Boolean,
        internalSyncTargetWithParent: Boolean,
        internalInheritedEventHandlers: {
          type: Array,
          default: () => []
        },
        internalTrapFocus: Boolean,
        internalExtraClass: {
          type: Array,
          default: () => []
        },
        // deprecated
        onShow: [Function, Array],
        onHide: [Function, Array],
        arrow: {
          type: Boolean,
          default: void 0
        },
        minWidth: Number,
        maxWidth: Number
      };
      const popoverProps = Object.assign(Object.assign(Object.assign({}, useTheme.props), popoverBaseProps), {
        internalOnAfterLeave: Function,
        internalRenderBody: Function
      });
      const NPopover = vue.defineComponent({
        name: "Popover",
        inheritAttrs: false,
        props: popoverProps,
        __popover__: true,
        setup(props) {
          const isMountedRef = isMounted();
          const binderInstRef = vue.ref(null);
          const controlledShowRef = vue.computed(() => props.show);
          const uncontrolledShowRef = vue.ref(props.defaultShow);
          const mergedShowWithoutDisabledRef = useMergedState(controlledShowRef, uncontrolledShowRef);
          const mergedShowConsideringDisabledPropRef = useMemo(() => {
            if (props.disabled)
              return false;
            return mergedShowWithoutDisabledRef.value;
          });
          const getMergedDisabled = () => {
            if (props.disabled)
              return true;
            const {
              getDisabled
            } = props;
            if (getDisabled === null || getDisabled === void 0 ? void 0 : getDisabled())
              return true;
            return false;
          };
          const getMergedShow = () => {
            if (getMergedDisabled())
              return false;
            return mergedShowWithoutDisabledRef.value;
          };
          const compatibleShowArrowRef = useCompitable(props, ["arrow", "showArrow"]);
          const mergedShowArrowRef = vue.computed(() => {
            if (props.overlap)
              return false;
            return compatibleShowArrowRef.value;
          });
          let bodyInstance = null;
          const showTimerIdRef = vue.ref(null);
          const hideTimerIdRef = vue.ref(null);
          const positionManuallyRef = useMemo(() => {
            return props.x !== void 0 && props.y !== void 0;
          });
          function doUpdateShow(value) {
            const {
              "onUpdate:show": _onUpdateShow,
              onUpdateShow,
              onShow,
              onHide
            } = props;
            uncontrolledShowRef.value = value;
            if (_onUpdateShow) {
              call(_onUpdateShow, value);
            }
            if (onUpdateShow) {
              call(onUpdateShow, value);
            }
            if (value && onShow) {
              call(onShow, true);
            }
            if (value && onHide) {
              call(onHide, false);
            }
          }
          function syncPosition() {
            if (bodyInstance) {
              bodyInstance.syncPosition();
            }
          }
          function clearShowTimer() {
            const {
              value: showTimerId
            } = showTimerIdRef;
            if (showTimerId) {
              window.clearTimeout(showTimerId);
              showTimerIdRef.value = null;
            }
          }
          function clearHideTimer() {
            const {
              value: hideTimerId
            } = hideTimerIdRef;
            if (hideTimerId) {
              window.clearTimeout(hideTimerId);
              hideTimerIdRef.value = null;
            }
          }
          function handleFocus() {
            const mergedDisabled = getMergedDisabled();
            if (props.trigger === "focus" && !mergedDisabled) {
              if (getMergedShow())
                return;
              doUpdateShow(true);
            }
          }
          function handleBlur() {
            const mergedDisabled = getMergedDisabled();
            if (props.trigger === "focus" && !mergedDisabled) {
              if (!getMergedShow())
                return;
              doUpdateShow(false);
            }
          }
          function handleMouseEnter() {
            const mergedDisabled = getMergedDisabled();
            if (props.trigger === "hover" && !mergedDisabled) {
              clearHideTimer();
              if (showTimerIdRef.value !== null)
                return;
              if (getMergedShow())
                return;
              const delayCallback = () => {
                doUpdateShow(true);
                showTimerIdRef.value = null;
              };
              const {
                delay
              } = props;
              if (delay === 0) {
                delayCallback();
              } else {
                showTimerIdRef.value = window.setTimeout(delayCallback, delay);
              }
            }
          }
          function handleMouseLeave() {
            const mergedDisabled = getMergedDisabled();
            if (props.trigger === "hover" && !mergedDisabled) {
              clearShowTimer();
              if (hideTimerIdRef.value !== null)
                return;
              if (!getMergedShow())
                return;
              const delayedCallback = () => {
                doUpdateShow(false);
                hideTimerIdRef.value = null;
              };
              const {
                duration
              } = props;
              if (duration === 0) {
                delayedCallback();
              } else {
                hideTimerIdRef.value = window.setTimeout(delayedCallback, duration);
              }
            }
          }
          function handleMouseMoveOutside() {
            handleMouseLeave();
          }
          function handleClickOutside(e) {
            var _a;
            if (!getMergedShow())
              return;
            if (props.trigger === "click") {
              clearShowTimer();
              clearHideTimer();
              doUpdateShow(false);
            }
            (_a = props.onClickoutside) === null || _a === void 0 ? void 0 : _a.call(props, e);
          }
          function handleClick() {
            if (props.trigger === "click" && !getMergedDisabled()) {
              clearShowTimer();
              clearHideTimer();
              const nextShow = !getMergedShow();
              doUpdateShow(nextShow);
            }
          }
          function handleKeydown(e) {
            if (!props.internalTrapFocus)
              return;
            if (e.key === "Escape") {
              clearShowTimer();
              clearHideTimer();
              doUpdateShow(false);
            }
          }
          function setShow(value) {
            uncontrolledShowRef.value = value;
          }
          function getTriggerElement() {
            var _a;
            return (_a = binderInstRef.value) === null || _a === void 0 ? void 0 : _a.targetRef;
          }
          function setBodyInstance(value) {
            bodyInstance = value;
          }
          vue.provide("NPopover", {
            getTriggerElement,
            handleKeydown,
            handleMouseEnter,
            handleMouseLeave,
            handleClickOutside,
            handleMouseMoveOutside,
            setBodyInstance,
            positionManuallyRef,
            isMountedRef,
            zIndexRef: vue.toRef(props, "zIndex"),
            extraClassRef: vue.toRef(props, "internalExtraClass"),
            internalRenderBodyRef: vue.toRef(props, "internalRenderBody")
          });
          vue.watchEffect(() => {
            if (mergedShowWithoutDisabledRef.value && getMergedDisabled()) {
              doUpdateShow(false);
            }
          });
          const returned = {
            binderInstRef,
            positionManually: positionManuallyRef,
            mergedShowConsideringDisabledProp: mergedShowConsideringDisabledPropRef,
            // if to show popover body
            uncontrolledShow: uncontrolledShowRef,
            mergedShowArrow: mergedShowArrowRef,
            getMergedShow,
            setShow,
            handleClick,
            handleMouseEnter,
            handleMouseLeave,
            handleFocus,
            handleBlur,
            syncPosition
          };
          return returned;
        },
        render() {
          var _a;
          const {
            positionManually,
            $slots: slots
          } = this;
          let triggerVNode;
          let popoverInside = false;
          if (!positionManually) {
            if (slots.activator) {
              triggerVNode = getFirstSlotVNode(slots, "activator");
            } else {
              triggerVNode = getFirstSlotVNode(slots, "trigger");
            }
            if (triggerVNode) {
              triggerVNode = vue.cloneVNode(triggerVNode);
              triggerVNode = triggerVNode.type === vue.Text ? vue.h("span", [triggerVNode]) : triggerVNode;
              const handlers = {
                onClick: this.handleClick,
                onMouseenter: this.handleMouseEnter,
                onMouseleave: this.handleMouseLeave,
                onFocus: this.handleFocus,
                onBlur: this.handleBlur
              };
              if ((_a = triggerVNode.type) === null || _a === void 0 ? void 0 : _a.__popover__) {
                popoverInside = true;
                if (!triggerVNode.props) {
                  triggerVNode.props = {
                    internalSyncTargetWithParent: true,
                    internalInheritedEventHandlers: []
                  };
                }
                triggerVNode.props.internalSyncTargetWithParent = true;
                if (!triggerVNode.props.internalInheritedEventHandlers) {
                  triggerVNode.props.internalInheritedEventHandlers = [handlers];
                } else {
                  triggerVNode.props.internalInheritedEventHandlers = [handlers, ...triggerVNode.props.internalInheritedEventHandlers];
                }
              } else {
                const {
                  internalInheritedEventHandlers
                } = this;
                const ascendantAndCurrentHandlers = [handlers, ...internalInheritedEventHandlers];
                const mergedHandlers = {
                  onBlur: (e) => {
                    ascendantAndCurrentHandlers.forEach((_handlers) => {
                      _handlers.onBlur(e);
                    });
                  },
                  onFocus: (e) => {
                    ascendantAndCurrentHandlers.forEach((_handlers) => {
                      _handlers.onFocus(e);
                    });
                  },
                  onClick: (e) => {
                    ascendantAndCurrentHandlers.forEach((_handlers) => {
                      _handlers.onClick(e);
                    });
                  },
                  onMouseenter: (e) => {
                    ascendantAndCurrentHandlers.forEach((_handlers) => {
                      _handlers.onMouseenter(e);
                    });
                  },
                  onMouseleave: (e) => {
                    ascendantAndCurrentHandlers.forEach((_handlers) => {
                      _handlers.onMouseleave(e);
                    });
                  }
                };
                appendEvents(triggerVNode, internalInheritedEventHandlers ? "nested" : positionManually ? "manual" : this.trigger, mergedHandlers);
              }
            }
          }
          return vue.h(Binder, {
            ref: "binderInstRef",
            syncTarget: !popoverInside,
            syncTargetWithParent: this.internalSyncTargetWithParent
          }, {
            default: () => {
              void this.mergedShowConsideringDisabledProp;
              const mergedShow = this.getMergedShow();
              return [this.internalTrapFocus && mergedShow ? vue.withDirectives(vue.h("div", {
                style: {
                  position: "fixed",
                  inset: 0
                }
              }), [[zindexable, {
                enabled: mergedShow,
                zIndex: this.zIndex
              }]]) : null, positionManually ? null : vue.h(VTarget, null, {
                default: () => triggerVNode
              }), vue.h(NPopoverBody, keep(this.$props, bodyPropKeys, Object.assign(Object.assign({}, this.$attrs), {
                showArrow: this.mergedShowArrow,
                show: mergedShow
              })), {
                default: () => {
                  var _a2, _b;
                  return (_b = (_a2 = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a2);
                },
                header: () => {
                  var _a2, _b;
                  return (_b = (_a2 = this.$slots).header) === null || _b === void 0 ? void 0 : _b.call(_a2);
                },
                footer: () => {
                  var _a2, _b;
                  return (_b = (_a2 = this.$slots).footer) === null || _b === void 0 ? void 0 : _b.call(_a2);
                }
              })];
            }
          });
        }
      });
      const {
        cubicBezierEaseInOut,
        cubicBezierEaseOut,
        cubicBezierEaseIn
      } = commonVariables$2;
      function fadeInHeightExpandTransition({
        overflow = "hidden",
        duration = ".3s",
        originalTransition = "",
        leavingDelay = "0s",
        foldPadding = false,
        enterToProps = void 0,
        leaveToProps = void 0,
        reverse = false
      } = {}) {
        const enterClass = reverse ? "leave" : "enter";
        const leaveClass = reverse ? "enter" : "leave";
        return [c$1(`&.fade-in-height-expand-transition-${leaveClass}-from,
 &.fade-in-height-expand-transition-${enterClass}-to`, Object.assign(Object.assign({}, enterToProps), {
          opacity: 1
        })), c$1(`&.fade-in-height-expand-transition-${leaveClass}-to,
 &.fade-in-height-expand-transition-${enterClass}-from`, Object.assign(Object.assign({}, leaveToProps), {
          opacity: 0,
          marginTop: "0 !important",
          marginBottom: "0 !important",
          paddingTop: foldPadding ? "0 !important" : void 0,
          paddingBottom: foldPadding ? "0 !important" : void 0
        })), c$1(`&.fade-in-height-expand-transition-${leaveClass}-active`, `
 overflow: ${overflow};
 transition:
 max-height ${duration} ${cubicBezierEaseInOut} ${leavingDelay},
 opacity ${duration} ${cubicBezierEaseOut} ${leavingDelay},
 margin-top ${duration} ${cubicBezierEaseInOut} ${leavingDelay},
 margin-bottom ${duration} ${cubicBezierEaseInOut} ${leavingDelay},
 padding-top ${duration} ${cubicBezierEaseInOut} ${leavingDelay},
 padding-bottom ${duration} ${cubicBezierEaseInOut} ${leavingDelay}
 ${originalTransition ? "," + originalTransition : ""}
 `), c$1(`&.fade-in-height-expand-transition-${enterClass}-active`, `
 overflow: ${overflow};
 transition:
 max-height ${duration} ${cubicBezierEaseInOut},
 opacity ${duration} ${cubicBezierEaseIn},
 margin-top ${duration} ${cubicBezierEaseInOut},
 margin-bottom ${duration} ${cubicBezierEaseInOut},
 padding-top ${duration} ${cubicBezierEaseInOut},
 padding-bottom ${duration} ${cubicBezierEaseInOut}
 ${originalTransition ? "," + originalTransition : ""}
 `)];
      }
      const commonVars = {
        padding: "8px 14px"
      };
      const self$4 = (vars) => {
        const {
          borderRadius,
          boxShadow2,
          baseColor
        } = vars;
        return Object.assign(Object.assign({}, commonVars), {
          borderRadius,
          boxShadow: boxShadow2,
          color: composite(baseColor, "rgba(0, 0, 0, .85)"),
          textColor: baseColor
        });
      };
      const tooltipLight = createTheme({
        name: "Tooltip",
        common: derived,
        peers: {
          Popover: popoverLight
        },
        self: self$4
      });
      const commonVariables = {
        padding: "4px 0",
        optionIconSizeSmall: "14px",
        optionIconSizeMedium: "16px",
        optionIconSizeLarge: "16px",
        optionIconSizeHuge: "18px",
        optionSuffixWidthSmall: "14px",
        optionSuffixWidthMedium: "14px",
        optionSuffixWidthLarge: "16px",
        optionSuffixWidthHuge: "16px",
        optionIconSuffixWidthSmall: "32px",
        optionIconSuffixWidthMedium: "32px",
        optionIconSuffixWidthLarge: "36px",
        optionIconSuffixWidthHuge: "36px",
        optionPrefixWidthSmall: "14px",
        optionPrefixWidthMedium: "14px",
        optionPrefixWidthLarge: "16px",
        optionPrefixWidthHuge: "16px",
        optionIconPrefixWidthSmall: "36px",
        optionIconPrefixWidthMedium: "36px",
        optionIconPrefixWidthLarge: "40px",
        optionIconPrefixWidthHuge: "40px"
      };
      const self$3 = (vars) => {
        const {
          primaryColor,
          textColor2,
          dividerColor,
          hoverColor,
          popoverColor,
          invertedColor,
          borderRadius,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          fontSizeHuge,
          heightSmall,
          heightMedium,
          heightLarge,
          heightHuge,
          textColor3,
          opacityDisabled
        } = vars;
        return Object.assign(Object.assign({}, commonVariables), {
          optionHeightSmall: heightSmall,
          optionHeightMedium: heightMedium,
          optionHeightLarge: heightLarge,
          optionHeightHuge: heightHuge,
          borderRadius,
          fontSizeSmall,
          fontSizeMedium,
          fontSizeLarge,
          fontSizeHuge,
          // non-inverted
          optionTextColor: textColor2,
          optionTextColorHover: textColor2,
          optionTextColorActive: primaryColor,
          optionTextColorChildActive: primaryColor,
          color: popoverColor,
          dividerColor,
          suffixColor: textColor2,
          prefixColor: textColor2,
          optionColorHover: hoverColor,
          optionColorActive: changeColor(primaryColor, {
            alpha: 0.1
          }),
          groupHeaderTextColor: textColor3,
          // inverted
          optionTextColorInverted: "#BBB",
          optionTextColorHoverInverted: "#FFF",
          optionTextColorActiveInverted: "#FFF",
          optionTextColorChildActiveInverted: "#FFF",
          colorInverted: invertedColor,
          dividerColorInverted: "#BBB",
          suffixColorInverted: "#BBB",
          prefixColorInverted: "#BBB",
          optionColorHoverInverted: primaryColor,
          optionColorActiveInverted: primaryColor,
          groupHeaderTextColorInverted: "#AAA",
          optionOpacityDisabled: opacityDisabled
        });
      };
      const dropdownLight = createTheme({
        name: "Dropdown",
        common: derived,
        peers: {
          Popover: popoverLight
        },
        self: self$3
      });
      const tooltipProps = Object.assign(Object.assign({}, popoverBaseProps), useTheme.props);
      const NTooltip = vue.defineComponent({
        name: "Tooltip",
        props: tooltipProps,
        __popover__: true,
        setup(props) {
          const {
            mergedClsPrefixRef
          } = useConfig(props);
          const themeRef = useTheme("Tooltip", "-tooltip", void 0, tooltipLight, props, mergedClsPrefixRef);
          const popoverRef = vue.ref(null);
          const tooltipExposedMethod = {
            syncPosition() {
              popoverRef.value.syncPosition();
            },
            setShow(show) {
              popoverRef.value.setShow(show);
            }
          };
          return Object.assign(Object.assign({}, tooltipExposedMethod), {
            popoverRef,
            mergedTheme: themeRef,
            popoverThemeOverrides: vue.computed(() => {
              return themeRef.value.self;
            })
          });
        },
        render() {
          const {
            mergedTheme,
            internalExtraClass
          } = this;
          return vue.h(NPopover, Object.assign(Object.assign({}, this.$props), {
            theme: mergedTheme.peers.Popover,
            themeOverrides: mergedTheme.peerOverrides.Popover,
            builtinThemeOverrides: this.popoverThemeOverrides,
            internalExtraClass: internalExtraClass.concat("tooltip"),
            ref: "popoverRef"
          }), this.$slots);
        }
      });
      const NDropdownDivider = vue.defineComponent({
        name: "DropdownDivider",
        props: {
          clsPrefix: {
            type: String,
            required: true
          }
        },
        render() {
          return vue.h("div", {
            class: `${this.clsPrefix}-dropdown-divider`
          });
        }
      });
      const self$2 = (vars) => {
        const {
          textColorBase,
          opacity1,
          opacity2,
          opacity3,
          opacity4,
          opacity5
        } = vars;
        return {
          color: textColorBase,
          opacity1Depth: opacity1,
          opacity2Depth: opacity2,
          opacity3Depth: opacity3,
          opacity4Depth: opacity4,
          opacity5Depth: opacity5
        };
      };
      const iconLight = {
        name: "Icon",
        common: derived,
        self: self$2
      };
      const style$2 = cB("icon", `
 height: 1em;
 width: 1em;
 line-height: 1em;
 text-align: center;
 display: inline-block;
 position: relative;
 fill: currentColor;
 transform: translateZ(0);
`, [cM("color-transition", {
        transition: "color .3s var(--n-bezier)"
      }), cM("depth", {
        color: "var(--n-color)"
      }, [c$1("svg", {
        opacity: "var(--n-opacity)",
        transition: "opacity .3s var(--n-bezier)"
      })]), c$1("svg", {
        height: "1em",
        width: "1em"
      })]);
      const iconProps = Object.assign(Object.assign({}, useTheme.props), {
        depth: [String, Number],
        size: [Number, String],
        color: String,
        component: Object
      });
      const NIcon = vue.defineComponent({
        _n_icon__: true,
        name: "Icon",
        inheritAttrs: false,
        props: iconProps,
        setup(props) {
          const {
            mergedClsPrefixRef,
            inlineThemeDisabled
          } = useConfig(props);
          const themeRef = useTheme("Icon", "-icon", style$2, iconLight, props, mergedClsPrefixRef);
          const cssVarsRef = vue.computed(() => {
            const {
              depth
            } = props;
            const {
              common: {
                cubicBezierEaseInOut: cubicBezierEaseInOut2
              },
              self: self2
            } = themeRef.value;
            if (depth !== void 0) {
              const {
                color,
                [`opacity${depth}Depth`]: opacity
              } = self2;
              return {
                "--n-bezier": cubicBezierEaseInOut2,
                "--n-color": color,
                "--n-opacity": opacity
              };
            }
            return {
              "--n-bezier": cubicBezierEaseInOut2,
              "--n-color": "",
              "--n-opacity": ""
            };
          });
          const themeClassHandle = inlineThemeDisabled ? useThemeClass("icon", vue.computed(() => `${props.depth || "d"}`), cssVarsRef, props) : void 0;
          return {
            mergedClsPrefix: mergedClsPrefixRef,
            mergedStyle: vue.computed(() => {
              const {
                size: size2,
                color
              } = props;
              return {
                fontSize: formatLength(size2),
                color
              };
            }),
            cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
            themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
            onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
          };
        },
        render() {
          var _a;
          const {
            $parent,
            depth,
            mergedClsPrefix,
            component,
            onRender,
            themeClass
          } = this;
          if ((_a = $parent === null || $parent === void 0 ? void 0 : $parent.$options) === null || _a === void 0 ? void 0 : _a._n_icon__) {
            warn$2("icon", "don't wrap `n-icon` inside `n-icon`");
          }
          onRender === null || onRender === void 0 ? void 0 : onRender();
          return vue.h("i", vue.mergeProps(this.$attrs, {
            role: "img",
            class: [`${mergedClsPrefix}-icon`, themeClass, {
              [`${mergedClsPrefix}-icon--depth`]: depth,
              [`${mergedClsPrefix}-icon--color-transition`]: depth !== void 0
            }],
            style: [this.cssVars, this.mergedStyle]
          }), component ? vue.h(component) : this.$slots);
        }
      });
      const dropdownMenuInjectionKey = createInjectionKey("n-dropdown-menu");
      const dropdownInjectionKey = createInjectionKey("n-dropdown");
      const dropdownOptionInjectionKey = createInjectionKey("n-dropdown-option");
      function isSubmenuNode(rawNode, childrenField) {
        return rawNode.type === "submenu" || rawNode.type === void 0 && rawNode[childrenField] !== void 0;
      }
      function isGroupNode(rawNode) {
        return rawNode.type === "group";
      }
      function isDividerNode$1(rawNode) {
        return rawNode.type === "divider";
      }
      function isRenderNode(rawNode) {
        return rawNode.type === "render";
      }
      const NDropdownOption = vue.defineComponent({
        name: "DropdownOption",
        props: {
          clsPrefix: {
            type: String,
            required: true
          },
          tmNode: {
            type: Object,
            required: true
          },
          parentKey: {
            type: [String, Number],
            default: null
          },
          placement: {
            type: String,
            default: "right-start"
          },
          props: Object,
          scrollable: Boolean
        },
        setup(props) {
          const NDropdown2 = vue.inject(dropdownInjectionKey);
          const {
            hoverKeyRef,
            keyboardKeyRef,
            lastToggledSubmenuKeyRef,
            pendingKeyPathRef,
            activeKeyPathRef,
            animatedRef,
            mergedShowRef,
            renderLabelRef,
            renderIconRef,
            labelFieldRef,
            childrenFieldRef,
            renderOptionRef,
            nodePropsRef,
            menuPropsRef
          } = NDropdown2;
          const NDropdownOption2 = vue.inject(dropdownOptionInjectionKey, null);
          const NDropdownMenu2 = vue.inject(dropdownMenuInjectionKey);
          const NPopoverBody2 = vue.inject(popoverBodyInjectionKey);
          const rawNodeRef = vue.computed(() => props.tmNode.rawNode);
          const hasSubmenuRef = vue.computed(() => {
            const {
              value: childrenField
            } = childrenFieldRef;
            return isSubmenuNode(props.tmNode.rawNode, childrenField);
          });
          const mergedDisabledRef = vue.computed(() => {
            const {
              disabled
            } = props.tmNode;
            return disabled;
          });
          const showSubmenuRef = vue.computed(() => {
            if (!hasSubmenuRef.value)
              return false;
            const {
              key,
              disabled
            } = props.tmNode;
            if (disabled)
              return false;
            const {
              value: hoverKey
            } = hoverKeyRef;
            const {
              value: keyboardKey
            } = keyboardKeyRef;
            const {
              value: lastToggledSubmenuKey
            } = lastToggledSubmenuKeyRef;
            const {
              value: pendingKeyPath
            } = pendingKeyPathRef;
            if (hoverKey !== null)
              return pendingKeyPath.includes(key);
            if (keyboardKey !== null) {
              return pendingKeyPath.includes(key) && pendingKeyPath[pendingKeyPath.length - 1] !== key;
            }
            if (lastToggledSubmenuKey !== null)
              return pendingKeyPath.includes(key);
            return false;
          });
          const shouldDelayRef = vue.computed(() => {
            return keyboardKeyRef.value === null && !animatedRef.value;
          });
          const deferredShowSubmenuRef = useDeferredTrue(showSubmenuRef, 300, shouldDelayRef);
          const parentEnteringSubmenuRef = vue.computed(() => {
            return !!(NDropdownOption2 === null || NDropdownOption2 === void 0 ? void 0 : NDropdownOption2.enteringSubmenuRef.value);
          });
          const enteringSubmenuRef = vue.ref(false);
          vue.provide(dropdownOptionInjectionKey, {
            enteringSubmenuRef
          });
          function handleSubmenuBeforeEnter() {
            enteringSubmenuRef.value = true;
          }
          function handleSubmenuAfterEnter() {
            enteringSubmenuRef.value = false;
          }
          function handleMouseEnter() {
            const {
              parentKey,
              tmNode
            } = props;
            if (tmNode.disabled)
              return;
            if (!mergedShowRef.value)
              return;
            lastToggledSubmenuKeyRef.value = parentKey;
            keyboardKeyRef.value = null;
            hoverKeyRef.value = tmNode.key;
          }
          function handleMouseMove() {
            const {
              tmNode
            } = props;
            if (tmNode.disabled)
              return;
            if (!mergedShowRef.value)
              return;
            if (hoverKeyRef.value === tmNode.key)
              return;
            handleMouseEnter();
          }
          function handleMouseLeave(e) {
            if (props.tmNode.disabled)
              return;
            if (!mergedShowRef.value)
              return;
            const {
              relatedTarget
            } = e;
            if (relatedTarget && !happensIn({
              target: relatedTarget
            }, "dropdownOption") && !happensIn({
              target: relatedTarget
            }, "scrollbarRail")) {
              hoverKeyRef.value = null;
            }
          }
          function handleClick() {
            const {
              value: hasSubmenu
            } = hasSubmenuRef;
            const {
              tmNode
            } = props;
            if (!mergedShowRef.value)
              return;
            if (!hasSubmenu && !tmNode.disabled) {
              NDropdown2.doSelect(tmNode.key, tmNode.rawNode);
              NDropdown2.doUpdateShow(false);
            }
          }
          return {
            labelField: labelFieldRef,
            renderLabel: renderLabelRef,
            renderIcon: renderIconRef,
            siblingHasIcon: NDropdownMenu2.showIconRef,
            siblingHasSubmenu: NDropdownMenu2.hasSubmenuRef,
            menuProps: menuPropsRef,
            popoverBody: NPopoverBody2,
            animated: animatedRef,
            mergedShowSubmenu: vue.computed(() => {
              return deferredShowSubmenuRef.value && !parentEnteringSubmenuRef.value;
            }),
            rawNode: rawNodeRef,
            hasSubmenu: hasSubmenuRef,
            pending: useMemo(() => {
              const {
                value: pendingKeyPath
              } = pendingKeyPathRef;
              const {
                key
              } = props.tmNode;
              return pendingKeyPath.includes(key);
            }),
            childActive: useMemo(() => {
              const {
                value: activeKeyPath
              } = activeKeyPathRef;
              const {
                key
              } = props.tmNode;
              const index = activeKeyPath.findIndex((k) => key === k);
              if (index === -1)
                return false;
              return index < activeKeyPath.length - 1;
            }),
            active: useMemo(() => {
              const {
                value: activeKeyPath
              } = activeKeyPathRef;
              const {
                key
              } = props.tmNode;
              const index = activeKeyPath.findIndex((k) => key === k);
              if (index === -1)
                return false;
              return index === activeKeyPath.length - 1;
            }),
            mergedDisabled: mergedDisabledRef,
            renderOption: renderOptionRef,
            nodeProps: nodePropsRef,
            handleClick,
            handleMouseMove,
            handleMouseEnter,
            handleMouseLeave,
            handleSubmenuBeforeEnter,
            handleSubmenuAfterEnter
          };
        },
        render() {
          var _a, _b;
          const {
            animated,
            rawNode,
            mergedShowSubmenu,
            clsPrefix,
            siblingHasIcon,
            siblingHasSubmenu,
            renderLabel,
            renderIcon,
            renderOption,
            nodeProps,
            props,
            scrollable
          } = this;
          let submenuVNode = null;
          if (mergedShowSubmenu) {
            const submenuNodeProps = (_a = this.menuProps) === null || _a === void 0 ? void 0 : _a.call(this, rawNode, rawNode.children);
            submenuVNode = vue.h(NDropdownMenu, Object.assign({}, submenuNodeProps, {
              clsPrefix,
              scrollable: this.scrollable,
              tmNodes: this.tmNode.children,
              parentKey: this.tmNode.key
            }));
          }
          const builtinProps = {
            class: [`${clsPrefix}-dropdown-option-body`, this.pending && `${clsPrefix}-dropdown-option-body--pending`, this.active && `${clsPrefix}-dropdown-option-body--active`, this.childActive && `${clsPrefix}-dropdown-option-body--child-active`, this.mergedDisabled && `${clsPrefix}-dropdown-option-body--disabled`],
            onMousemove: this.handleMouseMove,
            onMouseenter: this.handleMouseEnter,
            onMouseleave: this.handleMouseLeave,
            onClick: this.handleClick
          };
          const optionNodeProps = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode);
          const node = vue.h("div", Object.assign({
            class: [`${clsPrefix}-dropdown-option`, optionNodeProps === null || optionNodeProps === void 0 ? void 0 : optionNodeProps.class],
            "data-dropdown-option": true
          }, optionNodeProps), vue.h("div", vue.mergeProps(builtinProps, props), [vue.h("div", {
            class: [`${clsPrefix}-dropdown-option-body__prefix`, siblingHasIcon && `${clsPrefix}-dropdown-option-body__prefix--show-icon`]
          }, [renderIcon ? renderIcon(rawNode) : render$1(rawNode.icon)]), vue.h("div", {
            "data-dropdown-option": true,
            class: `${clsPrefix}-dropdown-option-body__label`
          }, renderLabel ? renderLabel(rawNode) : render$1((_b = rawNode[this.labelField]) !== null && _b !== void 0 ? _b : rawNode.title)), vue.h("div", {
            "data-dropdown-option": true,
            class: [`${clsPrefix}-dropdown-option-body__suffix`, siblingHasSubmenu && `${clsPrefix}-dropdown-option-body__suffix--has-submenu`]
          }, this.hasSubmenu ? vue.h(NIcon, null, {
            default: () => vue.h(ChevronRightIcon, null)
          }) : null)]), this.hasSubmenu ? vue.h(Binder, null, {
            default: () => [vue.h(VTarget, null, {
              default: () => vue.h("div", {
                class: `${clsPrefix}-dropdown-offset-container`
              }, vue.h(VFollower, {
                show: this.mergedShowSubmenu,
                placement: this.placement,
                to: scrollable ? this.popoverBody || void 0 : void 0,
                teleportDisabled: !scrollable
              }, {
                default: () => {
                  return vue.h("div", {
                    class: `${clsPrefix}-dropdown-menu-wrapper`
                  }, animated ? vue.h(vue.Transition, {
                    onBeforeEnter: this.handleSubmenuBeforeEnter,
                    onAfterEnter: this.handleSubmenuAfterEnter,
                    name: "fade-in-scale-up-transition",
                    appear: true
                  }, {
                    default: () => submenuVNode
                  }) : submenuVNode);
                }
              }))
            })]
          }) : null);
          if (renderOption) {
            return renderOption({
              node,
              option: rawNode
            });
          }
          return node;
        }
      });
      const NDropdownGroupHeader = vue.defineComponent({
        name: "DropdownGroupHeader",
        props: {
          clsPrefix: {
            type: String,
            required: true
          },
          tmNode: {
            type: Object,
            required: true
          }
        },
        setup() {
          const {
            showIconRef,
            hasSubmenuRef
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
          } = vue.inject(dropdownMenuInjectionKey);
          const {
            renderLabelRef,
            labelFieldRef,
            nodePropsRef,
            renderOptionRef
          } = (
            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
            vue.inject(dropdownInjectionKey)
          );
          return {
            labelField: labelFieldRef,
            showIcon: showIconRef,
            hasSubmenu: hasSubmenuRef,
            renderLabel: renderLabelRef,
            nodeProps: nodePropsRef,
            renderOption: renderOptionRef
          };
        },
        render() {
          var _a;
          const {
            clsPrefix,
            hasSubmenu,
            showIcon,
            nodeProps,
            renderLabel,
            renderOption
          } = this;
          const {
            rawNode
          } = this.tmNode;
          const node = vue.h("div", Object.assign({
            class: `${clsPrefix}-dropdown-option`
          }, nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(rawNode)), vue.h("div", {
            class: `${clsPrefix}-dropdown-option-body ${clsPrefix}-dropdown-option-body--group`
          }, vue.h("div", {
            "data-dropdown-option": true,
            class: [`${clsPrefix}-dropdown-option-body__prefix`, showIcon && `${clsPrefix}-dropdown-option-body__prefix--show-icon`]
          }, render$1(rawNode.icon)), vue.h("div", {
            class: `${clsPrefix}-dropdown-option-body__label`,
            "data-dropdown-option": true
          }, renderLabel ? renderLabel(rawNode) : render$1((_a = rawNode.title) !== null && _a !== void 0 ? _a : rawNode[this.labelField])), vue.h("div", {
            class: [`${clsPrefix}-dropdown-option-body__suffix`, hasSubmenu && `${clsPrefix}-dropdown-option-body__suffix--has-submenu`],
            "data-dropdown-option": true
          })));
          if (renderOption) {
            return renderOption({
              node,
              option: rawNode
            });
          }
          return node;
        }
      });
      const NDropdownGroup = vue.defineComponent({
        name: "NDropdownGroup",
        props: {
          clsPrefix: {
            type: String,
            required: true
          },
          tmNode: {
            type: Object,
            required: true
          },
          parentKey: {
            type: [String, Number],
            default: null
          }
        },
        render() {
          const {
            tmNode,
            parentKey,
            clsPrefix
          } = this;
          const {
            children
          } = tmNode;
          return vue.h(vue.Fragment, null, vue.h(NDropdownGroupHeader, {
            clsPrefix,
            tmNode,
            key: tmNode.key
          }), children === null || children === void 0 ? void 0 : children.map((child) => {
            const {
              rawNode
            } = child;
            if (rawNode.show === false)
              return null;
            if (isDividerNode$1(rawNode)) {
              return vue.h(NDropdownDivider, {
                clsPrefix,
                key: child.key
              });
            }
            if (child.isGroup) {
              warn$2("dropdown", "`group` node is not allowed to be put in `group` node.");
              return null;
            }
            return vue.h(NDropdownOption, {
              clsPrefix,
              tmNode: child,
              parentKey,
              key: child.key
            });
          }));
        }
      });
      const NDropdownRenderOption = vue.defineComponent({
        name: "DropdownRenderOption",
        props: {
          tmNode: {
            type: Object,
            required: true
          }
        },
        render() {
          const {
            rawNode: {
              render: render2,
              props
            }
          } = this.tmNode;
          return vue.h("div", props, [render2 === null || render2 === void 0 ? void 0 : render2()]);
        }
      });
      const NDropdownMenu = vue.defineComponent({
        name: "DropdownMenu",
        props: {
          scrollable: Boolean,
          showArrow: Boolean,
          arrowStyle: [String, Object],
          clsPrefix: {
            type: String,
            required: true
          },
          tmNodes: {
            type: Array,
            default: () => []
          },
          parentKey: {
            type: [String, Number],
            default: null
          }
        },
        setup(props) {
          const {
            renderIconRef,
            childrenFieldRef
          } = vue.inject(dropdownInjectionKey);
          vue.provide(dropdownMenuInjectionKey, {
            showIconRef: vue.computed(() => {
              const renderIcon = renderIconRef.value;
              return props.tmNodes.some((tmNode) => {
                var _a;
                if (tmNode.isGroup) {
                  return (_a = tmNode.children) === null || _a === void 0 ? void 0 : _a.some(({
                    rawNode: rawChild
                  }) => renderIcon ? renderIcon(rawChild) : rawChild.icon);
                }
                const {
                  rawNode
                } = tmNode;
                return renderIcon ? renderIcon(rawNode) : rawNode.icon;
              });
            }),
            hasSubmenuRef: vue.computed(() => {
              const {
                value: childrenField
              } = childrenFieldRef;
              return props.tmNodes.some((tmNode) => {
                var _a;
                if (tmNode.isGroup) {
                  return (_a = tmNode.children) === null || _a === void 0 ? void 0 : _a.some(({
                    rawNode: rawChild
                  }) => isSubmenuNode(rawChild, childrenField));
                }
                const {
                  rawNode
                } = tmNode;
                return isSubmenuNode(rawNode, childrenField);
              });
            })
          });
          const bodyRef = vue.ref(null);
          vue.provide(modalBodyInjectionKey, null);
          vue.provide(drawerBodyInjectionKey, null);
          vue.provide(popoverBodyInjectionKey, bodyRef);
          return {
            bodyRef
          };
        },
        render() {
          const {
            parentKey,
            clsPrefix,
            scrollable
          } = this;
          const menuOptionsNode = this.tmNodes.map((tmNode) => {
            const {
              rawNode
            } = tmNode;
            if (rawNode.show === false)
              return null;
            if (isRenderNode(rawNode)) {
              return vue.h(NDropdownRenderOption, {
                tmNode,
                key: tmNode.key
              });
            }
            if (isDividerNode$1(rawNode)) {
              return vue.h(NDropdownDivider, {
                clsPrefix,
                key: tmNode.key
              });
            }
            if (isGroupNode(rawNode)) {
              return vue.h(NDropdownGroup, {
                clsPrefix,
                tmNode,
                parentKey,
                key: tmNode.key
              });
            }
            return vue.h(NDropdownOption, {
              clsPrefix,
              tmNode,
              parentKey,
              key: tmNode.key,
              props: rawNode.props,
              scrollable
            });
          });
          return vue.h("div", {
            class: [`${clsPrefix}-dropdown-menu`, scrollable && `${clsPrefix}-dropdown-menu--scrollable`],
            ref: "bodyRef"
          }, scrollable ? vue.h(XScrollbar, {
            contentClass: `${clsPrefix}-dropdown-menu__content`
          }, {
            default: () => menuOptionsNode
          }) : menuOptionsNode, this.showArrow ? renderArrow({
            clsPrefix,
            arrowStyle: this.arrowStyle,
            arrowClass: void 0,
            arrowWrapperClass: void 0,
            arrowWrapperStyle: void 0
          }) : null);
        }
      });
      const style$1 = cB("dropdown-menu", `
 transform-origin: var(--v-transform-origin);
 background-color: var(--n-color);
 border-radius: var(--n-border-radius);
 box-shadow: var(--n-box-shadow);
 position: relative;
 transition:
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
`, [fadeInScaleUpTransition(), cB("dropdown-option", `
 position: relative;
 `, [c$1("a", `
 text-decoration: none;
 color: inherit;
 outline: none;
 `, [c$1("&::before", `
 content: "";
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 `)]), cB("dropdown-option-body", `
 display: flex;
 cursor: pointer;
 position: relative;
 height: var(--n-option-height);
 line-height: var(--n-option-height);
 font-size: var(--n-font-size);
 color: var(--n-option-text-color);
 transition: color .3s var(--n-bezier);
 `, [c$1("&::before", `
 content: "";
 position: absolute;
 top: 0;
 bottom: 0;
 left: 4px;
 right: 4px;
 transition: background-color .3s var(--n-bezier);
 border-radius: var(--n-border-radius);
 `), cNotM("disabled", [cM("pending", `
 color: var(--n-option-text-color-hover);
 `, [cE("prefix, suffix", `
 color: var(--n-option-text-color-hover);
 `), c$1("&::before", "background-color: var(--n-option-color-hover);")]), cM("active", `
 color: var(--n-option-text-color-active);
 `, [cE("prefix, suffix", `
 color: var(--n-option-text-color-active);
 `), c$1("&::before", "background-color: var(--n-option-color-active);")]), cM("child-active", `
 color: var(--n-option-text-color-child-active);
 `, [cE("prefix, suffix", `
 color: var(--n-option-text-color-child-active);
 `)])]), cM("disabled", `
 cursor: not-allowed;
 opacity: var(--n-option-opacity-disabled);
 `), cM("group", `
 font-size: calc(var(--n-font-size) - 1px);
 color: var(--n-group-header-text-color);
 `, [cE("prefix", `
 width: calc(var(--n-option-prefix-width) / 2);
 `, [cM("show-icon", `
 width: calc(var(--n-option-icon-prefix-width) / 2);
 `)])]), cE("prefix", `
 width: var(--n-option-prefix-width);
 display: flex;
 justify-content: center;
 align-items: center;
 color: var(--n-prefix-color);
 transition: color .3s var(--n-bezier);
 z-index: 1;
 `, [cM("show-icon", `
 width: var(--n-option-icon-prefix-width);
 `), cB("icon", `
 font-size: var(--n-option-icon-size);
 `)]), cE("label", `
 white-space: nowrap;
 flex: 1;
 z-index: 1;
 `), cE("suffix", `
 box-sizing: border-box;
 flex-grow: 0;
 flex-shrink: 0;
 display: flex;
 justify-content: flex-end;
 align-items: center;
 min-width: var(--n-option-suffix-width);
 padding: 0 8px;
 transition: color .3s var(--n-bezier);
 color: var(--n-suffix-color);
 z-index: 1;
 `, [cM("has-submenu", `
 width: var(--n-option-icon-suffix-width);
 `), cB("icon", `
 font-size: var(--n-option-icon-size);
 `)]), cB("dropdown-menu", "pointer-events: all;")]), cB("dropdown-offset-container", `
 pointer-events: none;
 position: absolute;
 left: 0;
 right: 0;
 top: -4px;
 bottom: -4px;
 `)]), cB("dropdown-divider", `
 transition: background-color .3s var(--n-bezier);
 background-color: var(--n-divider-color);
 height: 1px;
 margin: 4px 0;
 `), cB("dropdown-menu-wrapper", `
 transform-origin: var(--v-transform-origin);
 width: fit-content;
 `), c$1(">", [cB("scrollbar", `
 height: inherit;
 max-height: inherit;
 `)]), cNotM("scrollable", `
 padding: var(--n-padding);
 `), cM("scrollable", [cE("content", `
 padding: var(--n-padding);
 `)])]);
      const dropdownBaseProps = {
        animated: {
          type: Boolean,
          default: true
        },
        keyboard: {
          type: Boolean,
          default: true
        },
        size: {
          type: String,
          default: "medium"
        },
        inverted: Boolean,
        placement: {
          type: String,
          default: "bottom"
        },
        onSelect: [Function, Array],
        options: {
          type: Array,
          default: () => []
        },
        menuProps: Function,
        showArrow: Boolean,
        renderLabel: Function,
        renderIcon: Function,
        renderOption: Function,
        nodeProps: Function,
        labelField: {
          type: String,
          default: "label"
        },
        keyField: {
          type: String,
          default: "key"
        },
        childrenField: {
          type: String,
          default: "children"
        },
        // for menu, not documented
        value: [String, Number]
      };
      const popoverPropKeys = Object.keys(popoverBaseProps);
      const dropdownProps = Object.assign(Object.assign(Object.assign({}, popoverBaseProps), dropdownBaseProps), useTheme.props);
      const NDropdown = vue.defineComponent({
        name: "Dropdown",
        inheritAttrs: false,
        props: dropdownProps,
        setup(props) {
          const uncontrolledShowRef = vue.ref(false);
          const mergedShowRef = useMergedState(vue.toRef(props, "show"), uncontrolledShowRef);
          const treemateRef = vue.computed(() => {
            const {
              keyField,
              childrenField
            } = props;
            return createTreeMate(props.options, {
              getKey(node) {
                return node[keyField];
              },
              getDisabled(node) {
                return node.disabled === true;
              },
              getIgnored(node) {
                return node.type === "divider" || node.type === "render";
              },
              getChildren(node) {
                return node[childrenField];
              }
            });
          });
          const tmNodesRef = vue.computed(() => {
            return treemateRef.value.treeNodes;
          });
          const hoverKeyRef = vue.ref(null);
          const keyboardKeyRef = vue.ref(null);
          const lastToggledSubmenuKeyRef = vue.ref(null);
          const pendingKeyRef = vue.computed(() => {
            var _a, _b, _c;
            return (_c = (_b = (_a = hoverKeyRef.value) !== null && _a !== void 0 ? _a : keyboardKeyRef.value) !== null && _b !== void 0 ? _b : lastToggledSubmenuKeyRef.value) !== null && _c !== void 0 ? _c : null;
          });
          const pendingKeyPathRef = vue.computed(() => treemateRef.value.getPath(pendingKeyRef.value).keyPath);
          const activeKeyPathRef = vue.computed(() => treemateRef.value.getPath(props.value).keyPath);
          const keyboardEnabledRef = useMemo(() => {
            return props.keyboard && mergedShowRef.value;
          });
          useKeyboard({
            keydown: {
              ArrowUp: {
                prevent: true,
                handler: handleKeydownUp
              },
              ArrowRight: {
                prevent: true,
                handler: handleKeydownRight
              },
              ArrowDown: {
                prevent: true,
                handler: handleKeydownDown
              },
              ArrowLeft: {
                prevent: true,
                handler: handleKeydownLeft
              },
              Enter: {
                prevent: true,
                handler: handleKeydownEnter
              },
              Escape: handleKeydownEsc
            }
          }, keyboardEnabledRef);
          const {
            mergedClsPrefixRef,
            inlineThemeDisabled
          } = useConfig(props);
          const themeRef = useTheme("Dropdown", "-dropdown", style$1, dropdownLight, props, mergedClsPrefixRef);
          vue.provide(dropdownInjectionKey, {
            labelFieldRef: vue.toRef(props, "labelField"),
            childrenFieldRef: vue.toRef(props, "childrenField"),
            renderLabelRef: vue.toRef(props, "renderLabel"),
            renderIconRef: vue.toRef(props, "renderIcon"),
            hoverKeyRef,
            keyboardKeyRef,
            lastToggledSubmenuKeyRef,
            pendingKeyPathRef,
            activeKeyPathRef,
            animatedRef: vue.toRef(props, "animated"),
            mergedShowRef,
            nodePropsRef: vue.toRef(props, "nodeProps"),
            renderOptionRef: vue.toRef(props, "renderOption"),
            menuPropsRef: vue.toRef(props, "menuProps"),
            doSelect,
            doUpdateShow
          });
          vue.watch(mergedShowRef, (value) => {
            if (!props.animated && !value) {
              clearPendingState();
            }
          });
          function doSelect(key, node) {
            const {
              onSelect
            } = props;
            if (onSelect)
              call(onSelect, key, node);
          }
          function doUpdateShow(value) {
            const {
              "onUpdate:show": _onUpdateShow,
              onUpdateShow
            } = props;
            if (_onUpdateShow)
              call(_onUpdateShow, value);
            if (onUpdateShow)
              call(onUpdateShow, value);
            uncontrolledShowRef.value = value;
          }
          function clearPendingState() {
            hoverKeyRef.value = null;
            keyboardKeyRef.value = null;
            lastToggledSubmenuKeyRef.value = null;
          }
          function handleKeydownEsc() {
            doUpdateShow(false);
          }
          function handleKeydownLeft() {
            handleKeydown("left");
          }
          function handleKeydownRight() {
            handleKeydown("right");
          }
          function handleKeydownUp() {
            handleKeydown("up");
          }
          function handleKeydownDown() {
            handleKeydown("down");
          }
          function handleKeydownEnter() {
            const pendingNode = getPendingNode();
            if ((pendingNode === null || pendingNode === void 0 ? void 0 : pendingNode.isLeaf) && mergedShowRef.value) {
              doSelect(pendingNode.key, pendingNode.rawNode);
              doUpdateShow(false);
            }
          }
          function getPendingNode() {
            var _a;
            const {
              value: treeMate
            } = treemateRef;
            const {
              value: pendingKey
            } = pendingKeyRef;
            if (!treeMate || pendingKey === null)
              return null;
            return (_a = treeMate.getNode(pendingKey)) !== null && _a !== void 0 ? _a : null;
          }
          function handleKeydown(direction) {
            const {
              value: pendingKey
            } = pendingKeyRef;
            const {
              value: {
                getFirstAvailableNode: getFirstAvailableNode2
              }
            } = treemateRef;
            let nextKeyboardKey = null;
            if (pendingKey === null) {
              const firstNode = getFirstAvailableNode2();
              if (firstNode !== null) {
                nextKeyboardKey = firstNode.key;
              }
            } else {
              const currentNode = getPendingNode();
              if (currentNode) {
                let nextNode;
                switch (direction) {
                  case "down":
                    nextNode = currentNode.getNext();
                    break;
                  case "up":
                    nextNode = currentNode.getPrev();
                    break;
                  case "right":
                    nextNode = currentNode.getChild();
                    break;
                  case "left":
                    nextNode = currentNode.getParent();
                    break;
                }
                if (nextNode)
                  nextKeyboardKey = nextNode.key;
              }
            }
            if (nextKeyboardKey !== null) {
              hoverKeyRef.value = null;
              keyboardKeyRef.value = nextKeyboardKey;
            }
          }
          const cssVarsRef = vue.computed(() => {
            const {
              size: size2,
              inverted
            } = props;
            const {
              common: {
                cubicBezierEaseInOut: cubicBezierEaseInOut2
              },
              self: self2
            } = themeRef.value;
            const {
              padding,
              dividerColor,
              borderRadius,
              optionOpacityDisabled,
              [createKey("optionIconSuffixWidth", size2)]: optionIconSuffixWidth,
              [createKey("optionSuffixWidth", size2)]: optionSuffixWidth,
              [createKey("optionIconPrefixWidth", size2)]: optionIconPrefixWidth,
              [createKey("optionPrefixWidth", size2)]: optionPrefixWidth,
              [createKey("fontSize", size2)]: fontSize2,
              [createKey("optionHeight", size2)]: optionHeight,
              [createKey("optionIconSize", size2)]: optionIconSize
            } = self2;
            const vars = {
              "--n-bezier": cubicBezierEaseInOut2,
              "--n-font-size": fontSize2,
              "--n-padding": padding,
              "--n-border-radius": borderRadius,
              "--n-option-height": optionHeight,
              "--n-option-prefix-width": optionPrefixWidth,
              "--n-option-icon-prefix-width": optionIconPrefixWidth,
              "--n-option-suffix-width": optionSuffixWidth,
              "--n-option-icon-suffix-width": optionIconSuffixWidth,
              "--n-option-icon-size": optionIconSize,
              "--n-divider-color": dividerColor,
              "--n-option-opacity-disabled": optionOpacityDisabled
            };
            if (inverted) {
              vars["--n-color"] = self2.colorInverted;
              vars["--n-option-color-hover"] = self2.optionColorHoverInverted;
              vars["--n-option-color-active"] = self2.optionColorActiveInverted;
              vars["--n-option-text-color"] = self2.optionTextColorInverted;
              vars["--n-option-text-color-hover"] = self2.optionTextColorHoverInverted;
              vars["--n-option-text-color-active"] = self2.optionTextColorActiveInverted;
              vars["--n-option-text-color-child-active"] = self2.optionTextColorChildActiveInverted;
              vars["--n-prefix-color"] = self2.prefixColorInverted;
              vars["--n-suffix-color"] = self2.suffixColorInverted;
              vars["--n-group-header-text-color"] = self2.groupHeaderTextColorInverted;
            } else {
              vars["--n-color"] = self2.color;
              vars["--n-option-color-hover"] = self2.optionColorHover;
              vars["--n-option-color-active"] = self2.optionColorActive;
              vars["--n-option-text-color"] = self2.optionTextColor;
              vars["--n-option-text-color-hover"] = self2.optionTextColorHover;
              vars["--n-option-text-color-active"] = self2.optionTextColorActive;
              vars["--n-option-text-color-child-active"] = self2.optionTextColorChildActive;
              vars["--n-prefix-color"] = self2.prefixColor;
              vars["--n-suffix-color"] = self2.suffixColor;
              vars["--n-group-header-text-color"] = self2.groupHeaderTextColor;
            }
            return vars;
          });
          const themeClassHandle = inlineThemeDisabled ? useThemeClass("dropdown", vue.computed(() => `${props.size[0]}${props.inverted ? "i" : ""}`), cssVarsRef, props) : void 0;
          return {
            mergedClsPrefix: mergedClsPrefixRef,
            mergedTheme: themeRef,
            // data
            tmNodes: tmNodesRef,
            // show
            mergedShow: mergedShowRef,
            // methods
            handleAfterLeave: () => {
              if (!props.animated)
                return;
              clearPendingState();
            },
            doUpdateShow,
            cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
            themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
            onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
          };
        },
        render() {
          const renderPopoverBody = (className, ref2, style2, onMouseenter, onMouseleave) => {
            var _a;
            const {
              mergedClsPrefix,
              menuProps: menuProps2
            } = this;
            (_a = this.onRender) === null || _a === void 0 ? void 0 : _a.call(this);
            const menuNodeProps = (menuProps2 === null || menuProps2 === void 0 ? void 0 : menuProps2(void 0, this.tmNodes.map((v) => v.rawNode))) || {};
            const dropdownProps2 = {
              ref: createRefSetter(ref2),
              class: [className, `${mergedClsPrefix}-dropdown`, this.themeClass],
              clsPrefix: mergedClsPrefix,
              tmNodes: this.tmNodes,
              style: [...style2, this.cssVars],
              showArrow: this.showArrow,
              arrowStyle: this.arrowStyle,
              scrollable: this.scrollable,
              onMouseenter,
              onMouseleave
            };
            return vue.h(NDropdownMenu, vue.mergeProps(this.$attrs, dropdownProps2, menuNodeProps));
          };
          const {
            mergedTheme
          } = this;
          const popoverProps2 = {
            show: this.mergedShow,
            theme: mergedTheme.peers.Popover,
            themeOverrides: mergedTheme.peerOverrides.Popover,
            internalOnAfterLeave: this.handleAfterLeave,
            internalRenderBody: renderPopoverBody,
            onUpdateShow: this.doUpdateShow,
            "onUpdate:show": void 0
          };
          return vue.h(NPopover, Object.assign({}, keep(this.$props, popoverPropKeys), popoverProps2), {
            trigger: () => {
              var _a, _b;
              return (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a);
            }
          });
        }
      });
      function createPartialInvertedVars(color, activeItemColor, activeTextColor, groupTextColor) {
        return {
          itemColorHoverInverted: "#0000",
          itemColorActiveInverted: activeItemColor,
          itemColorActiveHoverInverted: activeItemColor,
          itemColorActiveCollapsedInverted: activeItemColor,
          itemTextColorInverted: color,
          itemTextColorHoverInverted: activeTextColor,
          itemTextColorChildActiveInverted: activeTextColor,
          itemTextColorChildActiveHoverInverted: activeTextColor,
          itemTextColorActiveInverted: activeTextColor,
          itemTextColorActiveHoverInverted: activeTextColor,
          itemTextColorHorizontalInverted: color,
          itemTextColorHoverHorizontalInverted: activeTextColor,
          itemTextColorChildActiveHorizontalInverted: activeTextColor,
          itemTextColorChildActiveHoverHorizontalInverted: activeTextColor,
          itemTextColorActiveHorizontalInverted: activeTextColor,
          itemTextColorActiveHoverHorizontalInverted: activeTextColor,
          itemIconColorInverted: color,
          itemIconColorHoverInverted: activeTextColor,
          itemIconColorActiveInverted: activeTextColor,
          itemIconColorActiveHoverInverted: activeTextColor,
          itemIconColorChildActiveInverted: activeTextColor,
          itemIconColorChildActiveHoverInverted: activeTextColor,
          itemIconColorCollapsedInverted: color,
          itemIconColorHorizontalInverted: color,
          itemIconColorHoverHorizontalInverted: activeTextColor,
          itemIconColorActiveHorizontalInverted: activeTextColor,
          itemIconColorActiveHoverHorizontalInverted: activeTextColor,
          itemIconColorChildActiveHorizontalInverted: activeTextColor,
          itemIconColorChildActiveHoverHorizontalInverted: activeTextColor,
          arrowColorInverted: color,
          arrowColorHoverInverted: activeTextColor,
          arrowColorActiveInverted: activeTextColor,
          arrowColorActiveHoverInverted: activeTextColor,
          arrowColorChildActiveInverted: activeTextColor,
          arrowColorChildActiveHoverInverted: activeTextColor,
          groupTextColorInverted: groupTextColor
        };
      }
      const self$1 = (vars) => {
        const {
          borderRadius,
          textColor3,
          primaryColor,
          textColor2,
          textColor1,
          fontSize: fontSize2,
          dividerColor,
          hoverColor,
          primaryColorHover
        } = vars;
        return Object.assign({
          borderRadius,
          color: "#0000",
          groupTextColor: textColor3,
          itemColorHover: hoverColor,
          itemColorActive: changeColor(primaryColor, {
            alpha: 0.1
          }),
          itemColorActiveHover: changeColor(primaryColor, {
            alpha: 0.1
          }),
          itemColorActiveCollapsed: changeColor(primaryColor, {
            alpha: 0.1
          }),
          itemTextColor: textColor2,
          itemTextColorHover: textColor2,
          itemTextColorActive: primaryColor,
          itemTextColorActiveHover: primaryColor,
          itemTextColorChildActive: primaryColor,
          itemTextColorChildActiveHover: primaryColor,
          itemTextColorHorizontal: textColor2,
          itemTextColorHoverHorizontal: primaryColorHover,
          itemTextColorActiveHorizontal: primaryColor,
          itemTextColorActiveHoverHorizontal: primaryColor,
          itemTextColorChildActiveHorizontal: primaryColor,
          itemTextColorChildActiveHoverHorizontal: primaryColor,
          itemIconColor: textColor1,
          itemIconColorHover: textColor1,
          itemIconColorActive: primaryColor,
          itemIconColorActiveHover: primaryColor,
          itemIconColorChildActive: primaryColor,
          itemIconColorChildActiveHover: primaryColor,
          itemIconColorCollapsed: textColor1,
          itemIconColorHorizontal: textColor1,
          itemIconColorHoverHorizontal: primaryColorHover,
          itemIconColorActiveHorizontal: primaryColor,
          itemIconColorActiveHoverHorizontal: primaryColor,
          itemIconColorChildActiveHorizontal: primaryColor,
          itemIconColorChildActiveHoverHorizontal: primaryColor,
          itemHeight: "42px",
          arrowColor: textColor2,
          arrowColorHover: textColor2,
          arrowColorActive: primaryColor,
          arrowColorActiveHover: primaryColor,
          arrowColorChildActive: primaryColor,
          arrowColorChildActiveHover: primaryColor,
          colorInverted: "#0000",
          borderColorHorizontal: "#0000",
          fontSize: fontSize2,
          dividerColor
        }, createPartialInvertedVars("#BBB", primaryColor, "#FFF", "#AAA"));
      };
      const menuLight = createTheme({
        name: "Menu",
        common: derived,
        peers: {
          Tooltip: tooltipLight,
          Dropdown: dropdownLight
        },
        self: self$1
      });
      const layoutSiderInjectionKey = createInjectionKey("n-layout-sider");
      const menuInjectionKey = createInjectionKey("n-menu");
      const submenuInjectionKey = createInjectionKey("n-submenu");
      const menuItemGroupInjectionKey = createInjectionKey("n-menu-item-group");
      const ICON_MARGIN_RIGHT = 8;
      function useMenuChild(props) {
        const NMenu = vue.inject(menuInjectionKey);
        const {
          props: menuProps2,
          mergedCollapsedRef
        } = NMenu;
        const NSubmenu2 = vue.inject(submenuInjectionKey, null);
        const NMenuOptionGroup2 = vue.inject(menuItemGroupInjectionKey, null);
        const horizontalRef = vue.computed(() => {
          return menuProps2.mode === "horizontal";
        });
        const dropdownPlacementRef = vue.computed(() => {
          if (horizontalRef.value) {
            return menuProps2.dropdownPlacement;
          }
          if ("tmNodes" in props)
            return "right-start";
          return "right";
        });
        const maxIconSizeRef = vue.computed(() => {
          var _a;
          return Math.max((_a = menuProps2.collapsedIconSize) !== null && _a !== void 0 ? _a : menuProps2.iconSize, menuProps2.iconSize);
        });
        const activeIconSizeRef = vue.computed(() => {
          var _a;
          if (!horizontalRef.value && props.root && mergedCollapsedRef.value) {
            return (_a = menuProps2.collapsedIconSize) !== null && _a !== void 0 ? _a : menuProps2.iconSize;
          } else {
            return menuProps2.iconSize;
          }
        });
        const paddingLeftRef = vue.computed(() => {
          if (horizontalRef.value)
            return void 0;
          const {
            collapsedWidth,
            indent,
            rootIndent
          } = menuProps2;
          const {
            root: root2,
            isGroup: isGroup2
          } = props;
          const mergedRootIndent = rootIndent === void 0 ? indent : rootIndent;
          if (root2) {
            if (mergedCollapsedRef.value) {
              return collapsedWidth / 2 - maxIconSizeRef.value / 2;
            }
            return mergedRootIndent;
          }
          if (NMenuOptionGroup2 && typeof NMenuOptionGroup2.paddingLeftRef.value === "number") {
            return indent / 2 + NMenuOptionGroup2.paddingLeftRef.value;
          }
          if (NSubmenu2 && typeof NSubmenu2.paddingLeftRef.value === "number") {
            return (isGroup2 ? indent / 2 : indent) + NSubmenu2.paddingLeftRef.value;
          }
          return 0;
        });
        const iconMarginRightRef = vue.computed(() => {
          const {
            collapsedWidth,
            indent,
            rootIndent
          } = menuProps2;
          const {
            value: maxIconSize
          } = maxIconSizeRef;
          const {
            root: root2
          } = props;
          if (horizontalRef.value)
            return ICON_MARGIN_RIGHT;
          if (!root2)
            return ICON_MARGIN_RIGHT;
          if (!mergedCollapsedRef.value)
            return ICON_MARGIN_RIGHT;
          const mergedRootIndent = rootIndent === void 0 ? indent : rootIndent;
          return mergedRootIndent + maxIconSize + ICON_MARGIN_RIGHT - (collapsedWidth + maxIconSize) / 2;
        });
        return {
          dropdownPlacement: dropdownPlacementRef,
          activeIconSize: activeIconSizeRef,
          maxIconSize: maxIconSizeRef,
          paddingLeft: paddingLeftRef,
          iconMarginRight: iconMarginRightRef,
          NMenu,
          NSubmenu: NSubmenu2
        };
      }
      const useMenuChildProps = {
        internalKey: {
          type: [String, Number],
          required: true
        },
        root: Boolean,
        isGroup: Boolean,
        level: {
          type: Number,
          required: true
        },
        title: [String, Function],
        extra: [String, Function]
      };
      const menuItemGroupProps = Object.assign(Object.assign({}, useMenuChildProps), {
        tmNode: {
          type: Object,
          required: true
        },
        tmNodes: {
          type: Array,
          required: true
        }
      });
      const NMenuOptionGroup = vue.defineComponent({
        name: "MenuOptionGroup",
        props: menuItemGroupProps,
        setup(props) {
          vue.provide(submenuInjectionKey, null);
          const MenuChild = useMenuChild(props);
          vue.provide(menuItemGroupInjectionKey, {
            paddingLeftRef: MenuChild.paddingLeft
          });
          const {
            mergedClsPrefixRef,
            props: menuProps2
          } = vue.inject(menuInjectionKey);
          return function() {
            const {
              value: mergedClsPrefix
            } = mergedClsPrefixRef;
            const paddingLeft = MenuChild.paddingLeft.value;
            const {
              nodeProps
            } = menuProps2;
            const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(props.tmNode.rawNode);
            return vue.h("div", {
              class: `${mergedClsPrefix}-menu-item-group`,
              role: "group"
            }, vue.h("div", Object.assign({}, attrs, {
              class: [`${mergedClsPrefix}-menu-item-group-title`, attrs === null || attrs === void 0 ? void 0 : attrs.class],
              style: [(attrs === null || attrs === void 0 ? void 0 : attrs.style) || "", paddingLeft !== void 0 ? `padding-left: ${paddingLeft}px;` : ""]
            }), render$1(props.title), props.extra ? vue.h(vue.Fragment, null, " ", render$1(props.extra)) : null), vue.h("div", null, props.tmNodes.map((tmNode) => itemRenderer(tmNode, menuProps2))));
          };
        }
      });
      const NMenuOptionContent = vue.defineComponent({
        name: "MenuOptionContent",
        props: {
          collapsed: Boolean,
          disabled: Boolean,
          title: [String, Function],
          icon: Function,
          extra: [String, Function],
          showArrow: Boolean,
          childActive: Boolean,
          hover: Boolean,
          paddingLeft: Number,
          selected: Boolean,
          maxIconSize: {
            type: Number,
            required: true
          },
          activeIconSize: {
            type: Number,
            required: true
          },
          iconMarginRight: {
            type: Number,
            required: true
          },
          clsPrefix: {
            type: String,
            required: true
          },
          onClick: Function,
          tmNode: {
            type: Object,
            required: true
          },
          isEllipsisPlaceholder: Boolean
        },
        setup(props) {
          const {
            props: menuProps2
          } = vue.inject(menuInjectionKey);
          return {
            menuProps: menuProps2,
            style: vue.computed(() => {
              const {
                paddingLeft
              } = props;
              return {
                paddingLeft: paddingLeft && `${paddingLeft}px`
              };
            }),
            iconStyle: vue.computed(() => {
              const {
                maxIconSize,
                activeIconSize,
                iconMarginRight
              } = props;
              return {
                width: `${maxIconSize}px`,
                height: `${maxIconSize}px`,
                fontSize: `${activeIconSize}px`,
                marginRight: `${iconMarginRight}px`
              };
            })
          };
        },
        render() {
          const {
            clsPrefix,
            tmNode,
            menuProps: {
              renderIcon,
              renderLabel,
              renderExtra,
              expandIcon
            }
          } = this;
          const icon = renderIcon ? renderIcon(tmNode.rawNode) : render$1(this.icon);
          return vue.h("div", {
            onClick: (e) => {
              var _a;
              (_a = this.onClick) === null || _a === void 0 ? void 0 : _a.call(this, e);
            },
            role: "none",
            class: [`${clsPrefix}-menu-item-content`, {
              [`${clsPrefix}-menu-item-content--selected`]: this.selected,
              [`${clsPrefix}-menu-item-content--collapsed`]: this.collapsed,
              [`${clsPrefix}-menu-item-content--child-active`]: this.childActive,
              [`${clsPrefix}-menu-item-content--disabled`]: this.disabled,
              [`${clsPrefix}-menu-item-content--hover`]: this.hover
            }],
            style: this.style
          }, icon && vue.h("div", {
            class: `${clsPrefix}-menu-item-content__icon`,
            style: this.iconStyle,
            role: "none"
          }, [icon]), vue.h("div", {
            class: `${clsPrefix}-menu-item-content-header`,
            role: "none"
          }, this.isEllipsisPlaceholder ? this.title : renderLabel ? renderLabel(tmNode.rawNode) : render$1(this.title), this.extra || renderExtra ? vue.h("span", {
            class: `${clsPrefix}-menu-item-content-header__extra`
          }, " ", renderExtra ? renderExtra(tmNode.rawNode) : render$1(this.extra)) : null), this.showArrow ? vue.h(NBaseIcon, {
            ariaHidden: true,
            class: `${clsPrefix}-menu-item-content__arrow`,
            clsPrefix
          }, {
            default: () => expandIcon ? expandIcon(tmNode.rawNode) : vue.h(ChevronDownFilledIcon, null)
          }) : null);
        }
      });
      const submenuProps = Object.assign(Object.assign({}, useMenuChildProps), {
        rawNodes: {
          type: Array,
          default: () => []
        },
        tmNodes: {
          type: Array,
          default: () => []
        },
        tmNode: {
          type: Object,
          required: true
        },
        disabled: Boolean,
        icon: Function,
        onClick: Function,
        domId: String,
        virtualChildActive: {
          type: Boolean,
          default: void 0
        },
        isEllipsisPlaceholder: Boolean
      });
      const NSubmenu = vue.defineComponent({
        name: "Submenu",
        props: submenuProps,
        setup(props) {
          const MenuChild = useMenuChild(props);
          const {
            NMenu,
            NSubmenu: NSubmenu2
          } = MenuChild;
          const {
            props: menuProps2,
            mergedCollapsedRef,
            mergedThemeRef
          } = NMenu;
          const mergedDisabledRef = vue.computed(() => {
            const {
              disabled
            } = props;
            if (NSubmenu2 === null || NSubmenu2 === void 0 ? void 0 : NSubmenu2.mergedDisabledRef.value)
              return true;
            if (menuProps2.disabled)
              return true;
            return disabled;
          });
          const dropdownShowRef = vue.ref(false);
          vue.provide(submenuInjectionKey, {
            paddingLeftRef: MenuChild.paddingLeft,
            mergedDisabledRef
          });
          vue.provide(menuItemGroupInjectionKey, null);
          function doClick() {
            const {
              onClick
            } = props;
            if (onClick)
              onClick();
          }
          function handleClick() {
            if (!mergedDisabledRef.value) {
              if (!mergedCollapsedRef.value) {
                NMenu.toggleExpand(props.internalKey);
              }
              doClick();
            }
          }
          function handlePopoverShowChange(value) {
            dropdownShowRef.value = value;
          }
          return {
            menuProps: menuProps2,
            mergedTheme: mergedThemeRef,
            doSelect: NMenu.doSelect,
            inverted: NMenu.invertedRef,
            isHorizontal: NMenu.isHorizontalRef,
            mergedClsPrefix: NMenu.mergedClsPrefixRef,
            maxIconSize: MenuChild.maxIconSize,
            activeIconSize: MenuChild.activeIconSize,
            iconMarginRight: MenuChild.iconMarginRight,
            dropdownPlacement: MenuChild.dropdownPlacement,
            dropdownShow: dropdownShowRef,
            paddingLeft: MenuChild.paddingLeft,
            mergedDisabled: mergedDisabledRef,
            mergedValue: NMenu.mergedValueRef,
            childActive: useMemo(() => {
              var _a;
              return (_a = props.virtualChildActive) !== null && _a !== void 0 ? _a : NMenu.activePathRef.value.includes(props.internalKey);
            }),
            collapsed: vue.computed(() => {
              if (menuProps2.mode === "horizontal")
                return false;
              if (mergedCollapsedRef.value) {
                return true;
              }
              return !NMenu.mergedExpandedKeysRef.value.includes(props.internalKey);
            }),
            dropdownEnabled: vue.computed(() => {
              return !mergedDisabledRef.value && (menuProps2.mode === "horizontal" || mergedCollapsedRef.value);
            }),
            handlePopoverShowChange,
            handleClick
          };
        },
        render() {
          var _a;
          const {
            mergedClsPrefix,
            menuProps: {
              renderIcon,
              renderLabel
            }
          } = this;
          const createSubmenuItem = () => {
            const {
              isHorizontal,
              paddingLeft,
              collapsed,
              mergedDisabled,
              maxIconSize,
              activeIconSize,
              title,
              childActive,
              icon,
              handleClick,
              menuProps: {
                nodeProps
              },
              dropdownShow,
              iconMarginRight,
              tmNode,
              mergedClsPrefix: mergedClsPrefix2,
              isEllipsisPlaceholder,
              extra
            } = this;
            const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(tmNode.rawNode);
            return vue.h("div", Object.assign({}, attrs, {
              class: [`${mergedClsPrefix2}-menu-item`, attrs === null || attrs === void 0 ? void 0 : attrs.class],
              role: "menuitem"
            }), vue.h(NMenuOptionContent, {
              tmNode,
              paddingLeft,
              collapsed,
              disabled: mergedDisabled,
              iconMarginRight,
              maxIconSize,
              activeIconSize,
              title,
              extra,
              showArrow: !isHorizontal,
              childActive,
              clsPrefix: mergedClsPrefix2,
              icon,
              hover: dropdownShow,
              onClick: handleClick,
              isEllipsisPlaceholder
            }));
          };
          const createSubmenuChildren = () => {
            return vue.h(NFadeInExpandTransition, null, {
              default: () => {
                const {
                  tmNodes,
                  collapsed
                } = this;
                return !collapsed ? vue.h("div", {
                  class: `${mergedClsPrefix}-submenu-children`,
                  role: "menu"
                }, tmNodes.map((item) => itemRenderer(item, this.menuProps))) : null;
              }
            });
          };
          return this.root ? vue.h(NDropdown, Object.assign({
            size: "large",
            trigger: "hover"
          }, (_a = this.menuProps) === null || _a === void 0 ? void 0 : _a.dropdownProps, {
            themeOverrides: this.mergedTheme.peerOverrides.Dropdown,
            theme: this.mergedTheme.peers.Dropdown,
            builtinThemeOverrides: {
              fontSizeLarge: "14px",
              optionIconSizeLarge: "18px"
            },
            value: this.mergedValue,
            disabled: !this.dropdownEnabled,
            placement: this.dropdownPlacement,
            keyField: this.menuProps.keyField,
            labelField: this.menuProps.labelField,
            childrenField: this.menuProps.childrenField,
            onUpdateShow: this.handlePopoverShowChange,
            options: this.rawNodes,
            onSelect: this.doSelect,
            inverted: this.inverted,
            renderIcon,
            renderLabel
          }), {
            default: () => vue.h("div", {
              class: `${mergedClsPrefix}-submenu`,
              role: "menu",
              "aria-expanded": !this.collapsed,
              id: this.domId
            }, createSubmenuItem(), this.isHorizontal ? null : createSubmenuChildren())
          }) : vue.h("div", {
            class: `${mergedClsPrefix}-submenu`,
            role: "menu",
            "aria-expanded": !this.collapsed,
            id: this.domId
          }, createSubmenuItem(), createSubmenuChildren());
        }
      });
      const menuItemProps = Object.assign(Object.assign({}, useMenuChildProps), {
        tmNode: {
          type: Object,
          required: true
        },
        disabled: Boolean,
        icon: Function,
        onClick: Function
      });
      const NMenuOption = vue.defineComponent({
        name: "MenuOption",
        props: menuItemProps,
        setup(props) {
          const MenuChild = useMenuChild(props);
          const {
            NSubmenu: NSubmenu2,
            NMenu
          } = MenuChild;
          const {
            props: menuProps2,
            mergedClsPrefixRef,
            mergedCollapsedRef
          } = NMenu;
          const submenuDisabledRef = NSubmenu2 ? NSubmenu2.mergedDisabledRef : {
            value: false
          };
          const mergedDisabledRef = vue.computed(() => {
            return submenuDisabledRef.value || props.disabled;
          });
          function doClick(e) {
            const {
              onClick
            } = props;
            if (onClick)
              onClick(e);
          }
          function handleClick(e) {
            if (!mergedDisabledRef.value) {
              NMenu.doSelect(props.internalKey, props.tmNode.rawNode);
              doClick(e);
            }
          }
          return {
            mergedClsPrefix: mergedClsPrefixRef,
            dropdownPlacement: MenuChild.dropdownPlacement,
            paddingLeft: MenuChild.paddingLeft,
            iconMarginRight: MenuChild.iconMarginRight,
            maxIconSize: MenuChild.maxIconSize,
            activeIconSize: MenuChild.activeIconSize,
            mergedTheme: NMenu.mergedThemeRef,
            menuProps: menuProps2,
            dropdownEnabled: useMemo(() => {
              return props.root && mergedCollapsedRef.value && menuProps2.mode !== "horizontal" && !mergedDisabledRef.value;
            }),
            selected: useMemo(() => {
              if (NMenu.mergedValueRef.value === props.internalKey)
                return true;
              return false;
            }),
            mergedDisabled: mergedDisabledRef,
            handleClick
          };
        },
        render() {
          const {
            mergedClsPrefix,
            mergedTheme,
            tmNode,
            menuProps: {
              renderLabel,
              nodeProps
            }
          } = this;
          const attrs = nodeProps === null || nodeProps === void 0 ? void 0 : nodeProps(tmNode.rawNode);
          return vue.h("div", Object.assign({}, attrs, {
            role: "menuitem",
            class: [`${mergedClsPrefix}-menu-item`, attrs === null || attrs === void 0 ? void 0 : attrs.class]
          }), vue.h(NTooltip, {
            theme: mergedTheme.peers.Tooltip,
            themeOverrides: mergedTheme.peerOverrides.Tooltip,
            trigger: "hover",
            placement: this.dropdownPlacement,
            disabled: !this.dropdownEnabled || this.title === void 0,
            internalExtraClass: ["menu-tooltip"]
          }, {
            default: () => renderLabel ? renderLabel(tmNode.rawNode) : render$1(this.title),
            trigger: () => vue.h(NMenuOptionContent, {
              tmNode,
              clsPrefix: mergedClsPrefix,
              paddingLeft: this.paddingLeft,
              iconMarginRight: this.iconMarginRight,
              maxIconSize: this.maxIconSize,
              activeIconSize: this.activeIconSize,
              selected: this.selected,
              title: this.title,
              extra: this.extra,
              disabled: this.mergedDisabled,
              icon: this.icon,
              onClick: this.handleClick
            })
          }));
        }
      });
      const NMenuDivider = vue.defineComponent({
        name: "MenuDivider",
        setup() {
          const NMenu = vue.inject(menuInjectionKey);
          const {
            mergedClsPrefixRef,
            isHorizontalRef
          } = NMenu;
          return () => isHorizontalRef.value ? null : vue.h("div", {
            class: `${mergedClsPrefixRef.value}-menu-divider`
          });
        }
      });
      const groupPropKeys = keysOf(menuItemGroupProps);
      const itemPropKeys = keysOf(menuItemProps);
      const submenuPropKeys = keysOf(submenuProps);
      function isIgnoredNode(rawNode) {
        return rawNode.type === "divider" || rawNode.type === "render";
      }
      function isDividerNode(rawNode) {
        return rawNode.type === "divider";
      }
      function itemRenderer(tmNode, menuProps2) {
        const {
          rawNode
        } = tmNode;
        const {
          show
        } = rawNode;
        if (show === false) {
          return null;
        }
        if (isIgnoredNode(rawNode)) {
          if (isDividerNode(rawNode)) {
            return vue.h(NMenuDivider, Object.assign({
              key: tmNode.key
            }, rawNode.props));
          }
          return null;
        }
        const {
          labelField
        } = menuProps2;
        const {
          key,
          level,
          isGroup: isGroup2
        } = tmNode;
        const props = Object.assign(Object.assign({}, rawNode), {
          title: rawNode.title || rawNode[labelField],
          extra: rawNode.titleExtra || rawNode.extra,
          key,
          internalKey: key,
          // since key can't be used as a prop
          level,
          root: level === 0,
          isGroup: isGroup2
        });
        if (tmNode.children) {
          if (tmNode.isGroup) {
            return vue.h(NMenuOptionGroup, keep(props, groupPropKeys, {
              tmNode,
              tmNodes: tmNode.children,
              key
            }));
          }
          return vue.h(NSubmenu, keep(props, submenuPropKeys, {
            key,
            rawNodes: rawNode[menuProps2.childrenField],
            tmNodes: tmNode.children,
            tmNode
          }));
        } else {
          return vue.h(NMenuOption, keep(props, itemPropKeys, {
            key,
            tmNode
          }));
        }
      }
      const hoverStyleChildren = [c$1("&::before", "background-color: var(--n-item-color-hover);"), cE("arrow", `
 color: var(--n-arrow-color-hover);
 `), cE("icon", `
 color: var(--n-item-icon-color-hover);
 `), cB("menu-item-content-header", `
 color: var(--n-item-text-color-hover);
 `, [c$1("a", `
 color: var(--n-item-text-color-hover);
 `), cE("extra", `
 color: var(--n-item-text-color-hover);
 `)])];
      const horizontalHoverStyleChildren = [cE("icon", `
 color: var(--n-item-icon-color-hover-horizontal);
 `), cB("menu-item-content-header", `
 color: var(--n-item-text-color-hover-horizontal);
 `, [c$1("a", `
 color: var(--n-item-text-color-hover-horizontal);
 `), cE("extra", `
 color: var(--n-item-text-color-hover-horizontal);
 `)])];
      const style = c$1([cB("menu", `
 background-color: var(--n-color);
 color: var(--n-item-text-color);
 overflow: hidden;
 transition: background-color .3s var(--n-bezier);
 box-sizing: border-box;
 font-size: var(--n-font-size);
 padding-bottom: 6px;
 `, [cM("horizontal", `
 max-width: 100%;
 width: 100%;
 display: flex;
 overflow: hidden;
 padding-bottom: 0;
 `, [cB("submenu", "margin: 0;"), cB("menu-item", "margin: 0;"), cB("menu-item-content", `
 padding: 0 20px;
 border-bottom: 2px solid #0000;
 `, [c$1("&::before", "display: none;"), cM("selected", "border-bottom: 2px solid var(--n-border-color-horizontal)")]), cB("menu-item-content", [cM("selected", [cE("icon", "color: var(--n-item-icon-color-active-horizontal);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-active-horizontal);
 `, [c$1("a", "color: var(--n-item-text-color-active-horizontal);"), cE("extra", "color: var(--n-item-text-color-active-horizontal);")])]), cM("child-active", `
 border-bottom: 2px solid var(--n-border-color-horizontal);
 `, [cB("menu-item-content-header", `
 color: var(--n-item-text-color-child-active-horizontal);
 `, [c$1("a", `
 color: var(--n-item-text-color-child-active-horizontal);
 `), cE("extra", `
 color: var(--n-item-text-color-child-active-horizontal);
 `)]), cE("icon", `
 color: var(--n-item-icon-color-child-active-horizontal);
 `)]), cNotM("disabled", [cNotM("selected, child-active", [c$1("&:focus-within", horizontalHoverStyleChildren)]), cM("selected", [hoverStyle(null, [cE("icon", "color: var(--n-item-icon-color-active-hover-horizontal);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-active-hover-horizontal);
 `, [c$1("a", "color: var(--n-item-text-color-active-hover-horizontal);"), cE("extra", "color: var(--n-item-text-color-active-hover-horizontal);")])])]), cM("child-active", [hoverStyle(null, [cE("icon", "color: var(--n-item-icon-color-child-active-hover-horizontal);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-child-active-hover-horizontal);
 `, [c$1("a", "color: var(--n-item-text-color-child-active-hover-horizontal);"), cE("extra", "color: var(--n-item-text-color-child-active-hover-horizontal);")])])]), hoverStyle("border-bottom: 2px solid var(--n-border-color-horizontal);", horizontalHoverStyleChildren)]), cB("menu-item-content-header", [c$1("a", "color: var(--n-item-text-color-horizontal);")])])]), cNotM("responsive", [cB("menu-item-content-header", `
 overflow: hidden;
 text-overflow: ellipsis;
 `)]), cM("collapsed", [cB("menu-item-content", [cM("selected", [c$1("&::before", `
 background-color: var(--n-item-color-active-collapsed) !important;
 `)]), cB("menu-item-content-header", "opacity: 0;"), cE("arrow", "opacity: 0;"), cE("icon", "color: var(--n-item-icon-color-collapsed);")])]), cB("menu-item", `
 height: var(--n-item-height);
 margin-top: 6px;
 position: relative;
 `), cB("menu-item-content", `
 box-sizing: border-box;
 line-height: 1.75;
 height: 100%;
 display: grid;
 grid-template-areas: "icon content arrow";
 grid-template-columns: auto 1fr auto;
 align-items: center;
 cursor: pointer;
 position: relative;
 padding-right: 18px;
 transition:
 background-color .3s var(--n-bezier),
 padding-left .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `, [c$1("> *", "z-index: 1;"), c$1("&::before", `
 z-index: auto;
 content: "";
 background-color: #0000;
 position: absolute;
 left: 8px;
 right: 8px;
 top: 0;
 bottom: 0;
 pointer-events: none;
 border-radius: var(--n-border-radius);
 transition: background-color .3s var(--n-bezier);
 `), cM("disabled", `
 opacity: .45;
 cursor: not-allowed;
 `), cM("collapsed", [cE("arrow", "transform: rotate(0);")]), cM("selected", [c$1("&::before", "background-color: var(--n-item-color-active);"), cE("arrow", "color: var(--n-arrow-color-active);"), cE("icon", "color: var(--n-item-icon-color-active);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-active);
 `, [c$1("a", "color: var(--n-item-text-color-active);"), cE("extra", "color: var(--n-item-text-color-active);")])]), cM("child-active", [cB("menu-item-content-header", `
 color: var(--n-item-text-color-child-active);
 `, [c$1("a", `
 color: var(--n-item-text-color-child-active);
 `), cE("extra", `
 color: var(--n-item-text-color-child-active);
 `)]), cE("arrow", `
 color: var(--n-arrow-color-child-active);
 `), cE("icon", `
 color: var(--n-item-icon-color-child-active);
 `)]), cNotM("disabled", [cNotM("selected, child-active", [c$1("&:focus-within", hoverStyleChildren)]), cM("selected", [hoverStyle(null, [cE("arrow", "color: var(--n-arrow-color-active-hover);"), cE("icon", "color: var(--n-item-icon-color-active-hover);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-active-hover);
 `, [c$1("a", "color: var(--n-item-text-color-active-hover);"), cE("extra", "color: var(--n-item-text-color-active-hover);")])])]), cM("child-active", [hoverStyle(null, [cE("arrow", "color: var(--n-arrow-color-child-active-hover);"), cE("icon", "color: var(--n-item-icon-color-child-active-hover);"), cB("menu-item-content-header", `
 color: var(--n-item-text-color-child-active-hover);
 `, [c$1("a", "color: var(--n-item-text-color-child-active-hover);"), cE("extra", "color: var(--n-item-text-color-child-active-hover);")])])]), cM("selected", [hoverStyle(null, [c$1("&::before", "background-color: var(--n-item-color-active-hover);")])]), hoverStyle(null, hoverStyleChildren)]), cE("icon", `
 grid-area: icon;
 color: var(--n-item-icon-color);
 transition:
 color .3s var(--n-bezier),
 font-size .3s var(--n-bezier),
 margin-right .3s var(--n-bezier);
 box-sizing: content-box;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 `), cE("arrow", `
 grid-area: arrow;
 font-size: 16px;
 color: var(--n-arrow-color);
 transform: rotate(180deg);
 opacity: 1;
 transition:
 color .3s var(--n-bezier),
 transform 0.2s var(--n-bezier),
 opacity 0.2s var(--n-bezier);
 `), cB("menu-item-content-header", `
 grid-area: content;
 transition:
 color .3s var(--n-bezier),
 opacity .3s var(--n-bezier);
 opacity: 1;
 white-space: nowrap;
 color: var(--n-item-text-color);
 `, [c$1("a", `
 outline: none;
 text-decoration: none;
 transition: color .3s var(--n-bezier);
 color: var(--n-item-text-color);
 `, [c$1("&::before", `
 content: "";
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 `)]), cE("extra", `
 font-size: .93em;
 color: var(--n-group-text-color);
 transition: color .3s var(--n-bezier);
 `)])]), cB("submenu", `
 cursor: pointer;
 position: relative;
 margin-top: 6px;
 `, [cB("menu-item-content", `
 height: var(--n-item-height);
 `), cB("submenu-children", `
 overflow: hidden;
 padding: 0;
 `, [fadeInHeightExpandTransition({
        duration: ".2s"
      })])]), cB("menu-item-group", [cB("menu-item-group-title", `
 margin-top: 6px;
 color: var(--n-group-text-color);
 cursor: default;
 font-size: .93em;
 height: 36px;
 display: flex;
 align-items: center;
 transition:
 padding-left .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `)])]), cB("menu-tooltip", [c$1("a", `
 color: inherit;
 text-decoration: none;
 `)]), cB("menu-divider", `
 transition: background-color .3s var(--n-bezier);
 background-color: var(--n-divider-color);
 height: 1px;
 margin: 6px 18px;
 `)]);
      function hoverStyle(props, children) {
        return [cM("hover", props, children), c$1("&:hover", props, children)];
      }
      const menuProps = Object.assign(Object.assign({}, useTheme.props), {
        options: {
          type: Array,
          default: () => []
        },
        collapsed: {
          type: Boolean,
          default: void 0
        },
        collapsedWidth: {
          type: Number,
          default: 48
        },
        iconSize: {
          type: Number,
          default: 20
        },
        collapsedIconSize: {
          type: Number,
          default: 24
        },
        rootIndent: Number,
        indent: {
          type: Number,
          default: 32
        },
        labelField: {
          type: String,
          default: "label"
        },
        keyField: {
          type: String,
          default: "key"
        },
        childrenField: {
          type: String,
          default: "children"
        },
        disabledField: {
          type: String,
          default: "disabled"
        },
        defaultExpandAll: Boolean,
        defaultExpandedKeys: Array,
        expandedKeys: Array,
        value: [String, Number],
        defaultValue: {
          type: [String, Number],
          default: null
        },
        mode: {
          type: String,
          default: "vertical"
        },
        watchProps: {
          type: Array,
          default: void 0
        },
        disabled: Boolean,
        show: {
          type: Boolean,
          default: true
        },
        inverted: Boolean,
        "onUpdate:expandedKeys": [Function, Array],
        onUpdateExpandedKeys: [Function, Array],
        onUpdateValue: [Function, Array],
        "onUpdate:value": [Function, Array],
        expandIcon: Function,
        renderIcon: Function,
        renderLabel: Function,
        renderExtra: Function,
        dropdownProps: Object,
        accordion: Boolean,
        nodeProps: Function,
        dropdownPlacement: {
          type: String,
          default: "bottom"
        },
        responsive: Boolean,
        // deprecated
        items: Array,
        onOpenNamesChange: [Function, Array],
        onSelect: [Function, Array],
        onExpandedNamesChange: [Function, Array],
        expandedNames: Array,
        defaultExpandedNames: Array
      });
      const __unplugin_components_0 = vue.defineComponent({
        name: "Menu",
        props: menuProps,
        setup(props) {
          const {
            mergedClsPrefixRef,
            inlineThemeDisabled
          } = useConfig(props);
          const themeRef = useTheme("Menu", "-menu", style, menuLight, props, mergedClsPrefixRef);
          const layoutSider = vue.inject(layoutSiderInjectionKey, null);
          const mergedCollapsedRef = vue.computed(() => {
            var _a;
            const {
              collapsed
            } = props;
            if (collapsed !== void 0)
              return collapsed;
            if (layoutSider) {
              const {
                collapseModeRef,
                collapsedRef
              } = layoutSider;
              if (collapseModeRef.value === "width") {
                return (_a = collapsedRef.value) !== null && _a !== void 0 ? _a : false;
              }
            }
            return false;
          });
          const treeMateRef = vue.computed(() => {
            const {
              keyField,
              childrenField,
              disabledField
            } = props;
            return createTreeMate(props.items || props.options, {
              getIgnored(node) {
                return isIgnoredNode(node);
              },
              getChildren(node) {
                return node[childrenField];
              },
              getDisabled(node) {
                return node[disabledField];
              },
              getKey(node) {
                var _a;
                return (_a = node[keyField]) !== null && _a !== void 0 ? _a : node.name;
              }
            });
          });
          const treeKeysLevelOneRef = vue.computed(() => new Set(treeMateRef.value.treeNodes.map((e) => e.key)));
          const {
            watchProps
          } = props;
          const uncontrolledValueRef = vue.ref(null);
          if (watchProps === null || watchProps === void 0 ? void 0 : watchProps.includes("defaultValue")) {
            vue.watchEffect(() => {
              uncontrolledValueRef.value = props.defaultValue;
            });
          } else {
            uncontrolledValueRef.value = props.defaultValue;
          }
          const controlledValueRef = vue.toRef(props, "value");
          const mergedValueRef = useMergedState(controlledValueRef, uncontrolledValueRef);
          const uncontrolledExpandedKeysRef = vue.ref([]);
          const initUncontrolledExpandedKeys = () => {
            uncontrolledExpandedKeysRef.value = props.defaultExpandAll ? treeMateRef.value.getNonLeafKeys() : props.defaultExpandedNames || props.defaultExpandedKeys || treeMateRef.value.getPath(mergedValueRef.value, {
              includeSelf: false
            }).keyPath;
          };
          if (watchProps === null || watchProps === void 0 ? void 0 : watchProps.includes("defaultExpandedKeys")) {
            vue.watchEffect(initUncontrolledExpandedKeys);
          } else {
            initUncontrolledExpandedKeys();
          }
          const controlledExpandedKeysRef = useCompitable(props, ["expandedNames", "expandedKeys"]);
          const mergedExpandedKeysRef = useMergedState(controlledExpandedKeysRef, uncontrolledExpandedKeysRef);
          const tmNodesRef = vue.computed(() => treeMateRef.value.treeNodes);
          const activePathRef = vue.computed(() => {
            return treeMateRef.value.getPath(mergedValueRef.value).keyPath;
          });
          vue.provide(menuInjectionKey, {
            props,
            mergedCollapsedRef,
            mergedThemeRef: themeRef,
            mergedValueRef,
            mergedExpandedKeysRef,
            activePathRef,
            mergedClsPrefixRef,
            isHorizontalRef: vue.computed(() => props.mode === "horizontal"),
            invertedRef: vue.toRef(props, "inverted"),
            doSelect,
            toggleExpand
          });
          function doSelect(value, item) {
            const {
              "onUpdate:value": _onUpdateValue,
              onUpdateValue,
              onSelect
            } = props;
            if (onUpdateValue) {
              call(onUpdateValue, value, item);
            }
            if (_onUpdateValue) {
              call(_onUpdateValue, value, item);
            }
            if (onSelect) {
              call(onSelect, value, item);
            }
            uncontrolledValueRef.value = value;
          }
          function doUpdateExpandedKeys(value) {
            const {
              "onUpdate:expandedKeys": _onUpdateExpandedKeys,
              onUpdateExpandedKeys,
              onExpandedNamesChange,
              onOpenNamesChange
            } = props;
            if (_onUpdateExpandedKeys) {
              call(_onUpdateExpandedKeys, value);
            }
            if (onUpdateExpandedKeys) {
              call(onUpdateExpandedKeys, value);
            }
            if (onExpandedNamesChange) {
              call(onExpandedNamesChange, value);
            }
            if (onOpenNamesChange) {
              call(onOpenNamesChange, value);
            }
            uncontrolledExpandedKeysRef.value = value;
          }
          function toggleExpand(key) {
            const currentExpandedKeys = Array.from(mergedExpandedKeysRef.value);
            const index = currentExpandedKeys.findIndex((expanededKey) => expanededKey === key);
            if (~index) {
              currentExpandedKeys.splice(index, 1);
            } else {
              if (props.accordion) {
                if (treeKeysLevelOneRef.value.has(key)) {
                  const closeKeyIndex = currentExpandedKeys.findIndex((e) => treeKeysLevelOneRef.value.has(e));
                  if (closeKeyIndex > -1) {
                    currentExpandedKeys.splice(closeKeyIndex, 1);
                  }
                }
              }
              currentExpandedKeys.push(key);
            }
            doUpdateExpandedKeys(currentExpandedKeys);
          }
          const showOption = (key) => {
            const selectedKeyPath = treeMateRef.value.getPath(key !== null && key !== void 0 ? key : mergedValueRef.value, {
              includeSelf: false
            }).keyPath;
            if (!selectedKeyPath.length)
              return;
            const currentExpandedKeys = Array.from(mergedExpandedKeysRef.value);
            const nextExpandedKeys = /* @__PURE__ */ new Set([...currentExpandedKeys, ...selectedKeyPath]);
            if (props.accordion) {
              treeKeysLevelOneRef.value.forEach((firstLevelKey) => {
                if (nextExpandedKeys.has(firstLevelKey) && !selectedKeyPath.includes(firstLevelKey)) {
                  nextExpandedKeys.delete(firstLevelKey);
                }
              });
            }
            doUpdateExpandedKeys(Array.from(nextExpandedKeys));
          };
          const cssVarsRef = vue.computed(() => {
            const {
              inverted
            } = props;
            const {
              common: {
                cubicBezierEaseInOut: cubicBezierEaseInOut2
              },
              self: self2
            } = themeRef.value;
            const {
              borderRadius,
              borderColorHorizontal,
              fontSize: fontSize2,
              itemHeight,
              dividerColor
            } = self2;
            const vars = {
              "--n-divider-color": dividerColor,
              "--n-bezier": cubicBezierEaseInOut2,
              "--n-font-size": fontSize2,
              "--n-border-color-horizontal": borderColorHorizontal,
              "--n-border-radius": borderRadius,
              "--n-item-height": itemHeight
            };
            if (inverted) {
              vars["--n-group-text-color"] = self2.groupTextColorInverted;
              vars["--n-color"] = self2.colorInverted;
              vars["--n-item-text-color"] = self2.itemTextColorInverted;
              vars["--n-item-text-color-hover"] = self2.itemTextColorHoverInverted;
              vars["--n-item-text-color-active"] = self2.itemTextColorActiveInverted;
              vars["--n-item-text-color-child-active"] = self2.itemTextColorChildActiveInverted;
              vars["--n-item-text-color-child-active-hover"] = self2.itemTextColorChildActiveInverted;
              vars["--n-item-text-color-active-hover"] = self2.itemTextColorActiveHoverInverted;
              vars["--n-item-icon-color"] = self2.itemIconColorInverted;
              vars["--n-item-icon-color-hover"] = self2.itemIconColorHoverInverted;
              vars["--n-item-icon-color-active"] = self2.itemIconColorActiveInverted;
              vars["--n-item-icon-color-active-hover"] = self2.itemIconColorActiveHoverInverted;
              vars["--n-item-icon-color-child-active"] = self2.itemIconColorChildActiveInverted;
              vars["--n-item-icon-color-child-active-hover"] = self2.itemIconColorChildActiveHoverInverted;
              vars["--n-item-icon-color-collapsed"] = self2.itemIconColorCollapsedInverted;
              vars["--n-item-text-color-horizontal"] = self2.itemTextColorHorizontalInverted;
              vars["--n-item-text-color-hover-horizontal"] = self2.itemTextColorHoverHorizontalInverted;
              vars["--n-item-text-color-active-horizontal"] = self2.itemTextColorActiveHorizontalInverted;
              vars["--n-item-text-color-child-active-horizontal"] = self2.itemTextColorChildActiveHorizontalInverted;
              vars["--n-item-text-color-child-active-hover-horizontal"] = self2.itemTextColorChildActiveHoverHorizontalInverted;
              vars["--n-item-text-color-active-hover-horizontal"] = self2.itemTextColorActiveHoverHorizontalInverted;
              vars["--n-item-icon-color-horizontal"] = self2.itemIconColorHorizontalInverted;
              vars["--n-item-icon-color-hover-horizontal"] = self2.itemIconColorHoverHorizontalInverted;
              vars["--n-item-icon-color-active-horizontal"] = self2.itemIconColorActiveHorizontalInverted;
              vars["--n-item-icon-color-active-hover-horizontal"] = self2.itemIconColorActiveHoverHorizontalInverted;
              vars["--n-item-icon-color-child-active-horizontal"] = self2.itemIconColorChildActiveHorizontalInverted;
              vars["--n-item-icon-color-child-active-hover-horizontal"] = self2.itemIconColorChildActiveHoverHorizontalInverted;
              vars["--n-arrow-color"] = self2.arrowColorInverted;
              vars["--n-arrow-color-hover"] = self2.arrowColorHoverInverted;
              vars["--n-arrow-color-active"] = self2.arrowColorActiveInverted;
              vars["--n-arrow-color-active-hover"] = self2.arrowColorActiveHoverInverted;
              vars["--n-arrow-color-child-active"] = self2.arrowColorChildActiveInverted;
              vars["--n-arrow-color-child-active-hover"] = self2.arrowColorChildActiveHoverInverted;
              vars["--n-item-color-hover"] = self2.itemColorHoverInverted;
              vars["--n-item-color-active"] = self2.itemColorActiveInverted;
              vars["--n-item-color-active-hover"] = self2.itemColorActiveHoverInverted;
              vars["--n-item-color-active-collapsed"] = self2.itemColorActiveCollapsedInverted;
            } else {
              vars["--n-group-text-color"] = self2.groupTextColor;
              vars["--n-color"] = self2.color;
              vars["--n-item-text-color"] = self2.itemTextColor;
              vars["--n-item-text-color-hover"] = self2.itemTextColorHover;
              vars["--n-item-text-color-active"] = self2.itemTextColorActive;
              vars["--n-item-text-color-child-active"] = self2.itemTextColorChildActive;
              vars["--n-item-text-color-child-active-hover"] = self2.itemTextColorChildActiveHover;
              vars["--n-item-text-color-active-hover"] = self2.itemTextColorActiveHover;
              vars["--n-item-icon-color"] = self2.itemIconColor;
              vars["--n-item-icon-color-hover"] = self2.itemIconColorHover;
              vars["--n-item-icon-color-active"] = self2.itemIconColorActive;
              vars["--n-item-icon-color-active-hover"] = self2.itemIconColorActiveHover;
              vars["--n-item-icon-color-child-active"] = self2.itemIconColorChildActive;
              vars["--n-item-icon-color-child-active-hover"] = self2.itemIconColorChildActiveHover;
              vars["--n-item-icon-color-collapsed"] = self2.itemIconColorCollapsed;
              vars["--n-item-text-color-horizontal"] = self2.itemTextColorHorizontal;
              vars["--n-item-text-color-hover-horizontal"] = self2.itemTextColorHoverHorizontal;
              vars["--n-item-text-color-active-horizontal"] = self2.itemTextColorActiveHorizontal;
              vars["--n-item-text-color-child-active-horizontal"] = self2.itemTextColorChildActiveHorizontal;
              vars["--n-item-text-color-child-active-hover-horizontal"] = self2.itemTextColorChildActiveHoverHorizontal;
              vars["--n-item-text-color-active-hover-horizontal"] = self2.itemTextColorActiveHoverHorizontal;
              vars["--n-item-icon-color-horizontal"] = self2.itemIconColorHorizontal;
              vars["--n-item-icon-color-hover-horizontal"] = self2.itemIconColorHoverHorizontal;
              vars["--n-item-icon-color-active-horizontal"] = self2.itemIconColorActiveHorizontal;
              vars["--n-item-icon-color-active-hover-horizontal"] = self2.itemIconColorActiveHoverHorizontal;
              vars["--n-item-icon-color-child-active-horizontal"] = self2.itemIconColorChildActiveHorizontal;
              vars["--n-item-icon-color-child-active-hover-horizontal"] = self2.itemIconColorChildActiveHoverHorizontal;
              vars["--n-arrow-color"] = self2.arrowColor;
              vars["--n-arrow-color-hover"] = self2.arrowColorHover;
              vars["--n-arrow-color-active"] = self2.arrowColorActive;
              vars["--n-arrow-color-active-hover"] = self2.arrowColorActiveHover;
              vars["--n-arrow-color-child-active"] = self2.arrowColorChildActive;
              vars["--n-arrow-color-child-active-hover"] = self2.arrowColorChildActiveHover;
              vars["--n-item-color-hover"] = self2.itemColorHover;
              vars["--n-item-color-active"] = self2.itemColorActive;
              vars["--n-item-color-active-hover"] = self2.itemColorActiveHover;
              vars["--n-item-color-active-collapsed"] = self2.itemColorActiveCollapsed;
            }
            return vars;
          });
          const themeClassHandle = inlineThemeDisabled ? useThemeClass("menu", vue.computed(() => props.inverted ? "a" : "b"), cssVarsRef, props) : void 0;
          const ellipsisNodeId = createId();
          const overflowRef = vue.ref(null);
          const counterRef = vue.ref(null);
          let isFirstResize = true;
          const onResize = () => {
            var _a;
            if (isFirstResize) {
              isFirstResize = false;
            } else {
              (_a = overflowRef.value) === null || _a === void 0 ? void 0 : _a.sync({
                showAllItemsBeforeCalculate: true
              });
            }
          };
          function getCounter() {
            return document.getElementById(ellipsisNodeId);
          }
          const ellipsisFromIndexRef = vue.ref(-1);
          function onUpdateCount(count) {
            ellipsisFromIndexRef.value = props.options.length - count;
          }
          function onUpdateOverflow(overflow) {
            if (!overflow) {
              ellipsisFromIndexRef.value = -1;
            }
          }
          const ellipsisOptionRef = vue.computed(() => {
            const ellipsisFromIndex = ellipsisFromIndexRef.value;
            const option = {
              children: ellipsisFromIndex === -1 ? [] : props.options.slice(ellipsisFromIndex)
            };
            return option;
          });
          const ellipsisTreeMateRef = vue.computed(() => {
            const {
              childrenField,
              disabledField,
              keyField
            } = props;
            return createTreeMate([ellipsisOptionRef.value], {
              getIgnored(node) {
                return isIgnoredNode(node);
              },
              getChildren(node) {
                return node[childrenField];
              },
              getDisabled(node) {
                return node[disabledField];
              },
              getKey(node) {
                var _a;
                return (_a = node[keyField]) !== null && _a !== void 0 ? _a : node.name;
              }
            });
          });
          const emptyTmNodeRef = vue.computed(() => {
            return createTreeMate([{}]).treeNodes[0];
          });
          function renderCounter() {
            var _a;
            if (ellipsisFromIndexRef.value === -1) {
              return vue.h(NSubmenu, {
                root: true,
                level: 0,
                key: "__ellpisisGroupPlaceholder__",
                internalKey: "__ellpisisGroupPlaceholder__",
                title: "···",
                tmNode: emptyTmNodeRef.value,
                domId: ellipsisNodeId,
                isEllipsisPlaceholder: true
              });
            }
            const tmNode = ellipsisTreeMateRef.value.treeNodes[0];
            const activePath = activePathRef.value;
            const childActive = !!((_a = tmNode.children) === null || _a === void 0 ? void 0 : _a.some((tmNode2) => {
              return activePath.includes(tmNode2.key);
            }));
            return vue.h(NSubmenu, {
              level: 0,
              root: true,
              key: "__ellpisisGroup__",
              internalKey: "__ellpisisGroup__",
              title: "···",
              virtualChildActive: childActive,
              tmNode,
              domId: ellipsisNodeId,
              rawNodes: tmNode.rawNode.children || [],
              tmNodes: tmNode.children || [],
              isEllipsisPlaceholder: true
            });
          }
          return {
            mergedClsPrefix: mergedClsPrefixRef,
            controlledExpandedKeys: controlledExpandedKeysRef,
            uncontrolledExpanededKeys: uncontrolledExpandedKeysRef,
            mergedExpandedKeys: mergedExpandedKeysRef,
            uncontrolledValue: uncontrolledValueRef,
            mergedValue: mergedValueRef,
            activePath: activePathRef,
            tmNodes: tmNodesRef,
            mergedTheme: themeRef,
            mergedCollapsed: mergedCollapsedRef,
            cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
            themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
            overflowRef,
            counterRef,
            updateCounter: () => {
            },
            onResize,
            onUpdateOverflow,
            onUpdateCount,
            renderCounter,
            getCounter,
            onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender,
            showOption,
            deriveResponsiveState: onResize
          };
        },
        render() {
          const {
            mergedClsPrefix,
            mode,
            themeClass,
            onRender
          } = this;
          onRender === null || onRender === void 0 ? void 0 : onRender();
          const renderMenuItemNodes = () => this.tmNodes.map((tmNode) => itemRenderer(tmNode, this.$props));
          const horizontal = mode === "horizontal";
          const finalResponsive = horizontal && this.responsive;
          const renderMainNode = () => vue.h("div", {
            role: mode === "horizontal" ? "menubar" : "menu",
            class: [`${mergedClsPrefix}-menu`, themeClass, `${mergedClsPrefix}-menu--${mode}`, finalResponsive && `${mergedClsPrefix}-menu--responsive`, this.mergedCollapsed && `${mergedClsPrefix}-menu--collapsed`],
            style: this.cssVars
          }, finalResponsive ? vue.h(VOverflow, {
            ref: "overflowRef",
            onUpdateOverflow: this.onUpdateOverflow,
            getCounter: this.getCounter,
            onUpdateCount: this.onUpdateCount,
            updateCounter: this.updateCounter,
            style: {
              width: "100%",
              display: "flex",
              overflow: "hidden"
            }
          }, {
            default: renderMenuItemNodes,
            counter: this.renderCounter
          }) : renderMenuItemNodes());
          return finalResponsive ? vue.h(VResizeObserver, {
            onResize: this.onResize
          }, {
            default: renderMainNode
          }) : renderMainNode();
        }
      });
      const _hoisted_1 = {
        class: "main"
      };
      const _sfc_main = /* @__PURE__ */ vue.defineComponent({
        __name: "App",
        setup(__props) {
          const menuThemeOverrides = {
            itemColorActive: "#EEF0FF",
            itemColorActiveHover: "#EEF0FF",
            itemTextColorActive: "#2777F8",
            itemTextColorActiveHover: "#2777F8"
          };
          const menuOptions = [{
            label: () => vue.createVNode("a", {
              "href": "//115.com/?cid=0&offset=0&mode=wangpan"
            }, [vue.createTextVNode("全部文件")]),
            key: "all"
          }, {
            label: () => vue.createVNode("a", {
              "href": "//115.com/?tab=upload&mode=wangpan"
            }, [vue.createTextVNode("最近上传")]),
            key: "upload"
          }, {
            label: () => vue.createVNode("a", {
              "href": "//115.com/?tab=offline&mode=wangpan"
            }, [vue.createTextVNode("云下载")]),
            key: "offline"
          }];
          const menuValue = vue.ref("all");
          const url = new URL(window.location.href);
          if (url.searchParams.has("cid")) {
            menuValue.value = "all";
          } else if (url.searchParams.has("tab")) {
            const tab = url.searchParams.get("tab");
            if (tab === "upload") {
              menuValue.value = "upload";
            } else if (tab === "offline") {
              menuValue.value = "offline";
            }
          }
          return (_ctx, _cache) => {
            const _component_NMenu = __unplugin_components_0;
            return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [vue.createVNode(_component_NMenu, {
              options: menuOptions,
              value: vue.unref(menuValue),
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => vue.isRef(menuValue) ? menuValue.value = $event : null),
              "theme-overrides": menuThemeOverrides
            }, null, 8, ["value"])]);
          };
        }
      });
      const _export_sfc = (sfc, props) => {
        const target = sfc.__vccOpts || sfc;
        for (const [key, val] of props) {
          target[key] = val;
        }
        return target;
      };
      const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8fb240a8"]]);
      var _GM_getValue = /* @__PURE__ */ (() => typeof GM_getValue != "undefined" ? GM_getValue : void 0)();
      var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
      var _GM_setValue = /* @__PURE__ */ (() => typeof GM_setValue != "undefined" ? GM_setValue : void 0)();
      vue.createApp(App).mount(
        (() => {
          const wrap_hflow = document.getElementsByClassName("wrap-hflow")[0];
          const site_left_bar = document.getElementById("site_left_bar");
          const app = document.createElement("div");
          app.addEventListener("mousedown", (e) => {
            e.stopPropagation();
          });
          if (site_left_bar && wrap_hflow) {
            wrap_hflow.insertBefore(app, site_left_bar);
            wrap_hflow.removeChild(site_left_bar);
          }
          return app;
        })()
      );
      let delSource = _GM_getValue("delSource") ?? true;
      _GM_setValue("delSource", delSource);
      function toggleDelSource() {
        delSource = !delSource;
        _GM_setValue("delSource", delSource);
        history.go(0);
      }
      _GM_registerMenuCommand(
        `${delSource ? "✅" : "🚫"}默认删除源文件`,
        toggleDelSource
      );
      const observer = new MutationObserver((mutationsList) => {
        mutationsList.some((mutation) => {
          if (mutation.type === "childList" && mutation.addedNodes.length > 0 && mutation.addedNodes[0].className === "dialog-box dialog-mini window-current" && delSource) {
            const checkBox = document.querySelector(
              "#js_del_task_source"
            );
            if (checkBox) {
              checkBox.checked = true;
            }
            return true;
          }
          return false;
        });
      });
      observer.observe(document.querySelector("body"), { childList: true });
    }
  });
  require_main_001();

})(Vue);