@qin-ui/antd-vue-pro
Version:
16,337 lines • 531 kB
JavaScript
import { inject, ref, h as h$1, getCurrentInstance, nextTick, reactive, defineComponent, createVNode, shallowRef, watch, unref, provide, watchEffect, onBeforeUnmount, computed, triggerRef, Fragment, Comment, Text, isVNode, onMounted, cloneVNode, Transition, withDirectives, resolveDirective, onUpdated, onUnmounted, toRef, withModifiers, vShow, onBeforeMount, Teleport, TransitionGroup, toRaw, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementBlock, renderList, createSlots, createTextVNode, createCommentVNode, shallowReadonly, useAttrs, resolveDynamicComponent, normalizeProps, renderSlot, toDisplayString, shallowReactive } from "vue";
import { Input, Textarea, InputSearch, InputPassword, InputNumber, Select, Cascader, DatePicker as DatePicker$1, RangePicker, TimePicker as TimePicker$1, CheckboxGroup, RadioGroup, Switch, Slider, TreeSelect, Transfer, Row as Row$1, Col as Col$1, FormItem as FormItem$1, Form as Form$2 } from "ant-design-vue";
import { INIT_PROPS_MAP, useInjectProps, INJECT_KEYS } from "../component-provider/index.js";
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
const freeGlobal$1 = freeGlobal;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal$1 || freeSelf || Function("return this")();
const root$1 = root;
var Symbol$1 = root$1.Symbol;
const Symbol$2 = Symbol$1;
var objectProto$f = Object.prototype;
var hasOwnProperty$d = objectProto$f.hasOwnProperty;
var nativeObjectToString$1 = objectProto$f.toString;
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
function getRawTag(value) {
var isOwn = hasOwnProperty$d.call(value, symToStringTag$1), tag = value[symToStringTag$1];
try {
value[symToStringTag$1] = void 0;
var unmasked = true;
} catch (e2) {
}
var result = nativeObjectToString$1.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag$1] = tag;
} else {
delete value[symToStringTag$1];
}
}
return result;
}
var objectProto$e = Object.prototype;
var nativeObjectToString = objectProto$e.toString;
function objectToString(value) {
return nativeObjectToString.call(value);
}
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
var symToStringTag = Symbol$2 ? Symbol$2.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$3 = "[object Symbol]";
function isSymbol(value) {
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
}
function arrayMap(array4, iteratee) {
var index2 = -1, length2 = array4 == null ? 0 : array4.length, result = Array(length2);
while (++index2 < length2) {
result[index2] = iteratee(array4[index2], index2, array4);
}
return result;
}
var isArray$1 = Array.isArray;
const isArray$2 = isArray$1;
var INFINITY$2 = 1 / 0;
var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
function baseToString(value) {
if (typeof value == "string") {
return value;
}
if (isArray$2(value)) {
return arrayMap(value, baseToString) + "";
}
if (isSymbol(value)) {
return symbolToString ? symbolToString.call(value) : "";
}
var result = value + "";
return result == "0" && 1 / value == -INFINITY$2 ? "-0" : result;
}
var reWhitespace = /\s/;
function trimmedEndIndex(string3) {
var index2 = string3.length;
while (index2-- && reWhitespace.test(string3.charAt(index2))) {
}
return index2;
}
var reTrimStart = /^\s+/;
function baseTrim(string3) {
return string3 ? string3.slice(0, trimmedEndIndex(string3) + 1).replace(reTrimStart, "") : string3;
}
function isObject$2(value) {
var type4 = typeof value;
return value != null && (type4 == "object" || type4 == "function");
}
var NAN = 0 / 0;
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
var reIsBinary = /^0b[01]+$/i;
var reIsOctal = /^0o[0-7]+$/i;
var freeParseInt = parseInt;
function toNumber(value) {
if (typeof value == "number") {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject$2(value)) {
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
value = isObject$2(other) ? other + "" : other;
}
if (typeof value != "string") {
return value === 0 ? value : +value;
}
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
}
var INFINITY$1 = 1 / 0, MAX_INTEGER = 17976931348623157e292;
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY$1 || value === -INFINITY$1) {
var sign = value < 0 ? -1 : 1;
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
}
function toInteger(value) {
var result = toFinite(value), remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
function identity(value) {
return value;
}
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
function isFunction$1(value) {
if (!isObject$2(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
}
var coreJsData = root$1["__core-js_shared__"];
const coreJsData$1 = coreJsData;
var maskSrcKey = function() {
var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.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 (e2) {
}
try {
return func + "";
} catch (e2) {
}
}
return "";
}
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
var funcToString$1 = funcProto$1.toString;
var hasOwnProperty$c = objectProto$d.hasOwnProperty;
var reIsNative = RegExp(
"^" + funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function baseIsNative(value) {
if (!isObject$2(value) || isMasked(value)) {
return false;
}
var pattern4 = isFunction$1(value) ? reIsNative : reIsHostCtor;
return pattern4.test(toSource(value));
}
function getValue$3(object4, key) {
return object4 == null ? void 0 : object4[key];
}
function getNative(object4, key) {
var value = getValue$3(object4, key);
return baseIsNative(value) ? value : void 0;
}
var WeakMap$1 = getNative(root$1, "WeakMap");
const WeakMap$2 = WeakMap$1;
var objectCreate = Object.create;
var baseCreate = function() {
function object4() {
}
return function(proto) {
if (!isObject$2(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object4.prototype = proto;
var result = new object4();
object4.prototype = void 0;
return result;
};
}();
const baseCreate$1 = baseCreate;
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, array4) {
var index2 = -1, length2 = source.length;
array4 || (array4 = Array(length2));
while (++index2 < length2) {
array4[index2] = source[index2];
}
return array4;
}
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 (e2) {
}
}();
const defineProperty$1 = defineProperty;
var baseSetToString = !defineProperty$1 ? identity : function(func, string3) {
return defineProperty$1(func, "toString", {
"configurable": true,
"enumerable": false,
"value": constant(string3),
"writable": true
});
};
const baseSetToString$1 = baseSetToString;
var setToString = shortOut(baseSetToString$1);
const setToString$1 = setToString;
function arrayEach(array4, iteratee) {
var index2 = -1, length2 = array4 == null ? 0 : array4.length;
while (++index2 < length2) {
if (iteratee(array4[index2], index2, array4) === false) {
break;
}
}
return array4;
}
function baseFindIndex(array4, predicate, fromIndex, fromRight) {
var length2 = array4.length, index2 = fromIndex + (fromRight ? 1 : -1);
while (fromRight ? index2-- : ++index2 < length2) {
if (predicate(array4[index2], index2, array4)) {
return index2;
}
}
return -1;
}
function baseIsNaN(value) {
return value !== value;
}
function strictIndexOf(array4, value, fromIndex) {
var index2 = fromIndex - 1, length2 = array4.length;
while (++index2 < length2) {
if (array4[index2] === value) {
return index2;
}
}
return -1;
}
function baseIndexOf(array4, value, fromIndex) {
return value === value ? strictIndexOf(array4, value, fromIndex) : baseFindIndex(array4, baseIsNaN, fromIndex);
}
function arrayIncludes(array4, value) {
var length2 = array4 == null ? 0 : array4.length;
return !!length2 && baseIndexOf(array4, value, 0) > -1;
}
var MAX_SAFE_INTEGER$1 = 9007199254740991;
var reIsUint = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length2) {
var type4 = typeof value;
length2 = length2 == null ? MAX_SAFE_INTEGER$1 : length2;
return !!length2 && (type4 == "number" || type4 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
}
function baseAssignValue(object4, key, value) {
if (key == "__proto__" && defineProperty$1) {
defineProperty$1(object4, key, {
"configurable": true,
"enumerable": true,
"value": value,
"writable": true
});
} else {
object4[key] = value;
}
}
function eq(value, other) {
return value === other || value !== value && other !== other;
}
var objectProto$c = Object.prototype;
var hasOwnProperty$b = objectProto$c.hasOwnProperty;
function assignValue(object4, key, value) {
var objValue = object4[key];
if (!(hasOwnProperty$b.call(object4, key) && eq(objValue, value)) || value === void 0 && !(key in object4)) {
baseAssignValue(object4, key, value);
}
}
function copyObject(source, props, object4, customizer) {
var isNew = !object4;
object4 || (object4 = {});
var index2 = -1, length2 = props.length;
while (++index2 < length2) {
var key = props[index2];
var newValue = customizer ? customizer(object4[key], source[key], key, object4, source) : void 0;
if (newValue === void 0) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object4, key, newValue);
} else {
assignValue(object4, key, newValue);
}
}
return object4;
}
var nativeMax$2 = Math.max;
function overRest(func, start, transform) {
start = nativeMax$2(start === void 0 ? func.length - 1 : start, 0);
return function() {
var args = arguments, index2 = -1, length2 = nativeMax$2(args.length - start, 0), array4 = Array(length2);
while (++index2 < length2) {
array4[index2] = args[start + index2];
}
index2 = -1;
var otherArgs = Array(start + 1);
while (++index2 < start) {
otherArgs[index2] = args[index2];
}
otherArgs[start] = transform(array4);
return apply(func, this, otherArgs);
};
}
function baseRest(func, start) {
return setToString$1(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$1(value);
}
var objectProto$b = Object.prototype;
function isPrototype(value) {
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
return value === proto;
}
function baseTimes(n2, iteratee) {
var index2 = -1, result = Array(n2);
while (++index2 < n2) {
result[index2] = iteratee(index2);
}
return result;
}
var argsTag$3 = "[object Arguments]";
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag$3;
}
var objectProto$a = Object.prototype;
var hasOwnProperty$a = objectProto$a.hasOwnProperty;
var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
var isArguments = baseIsArguments(function() {
return arguments;
}()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
};
const isArguments$1 = isArguments;
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$1.Buffer : void 0;
var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
var isBuffer = nativeIsBuffer || stubFalse;
const isBuffer$1 = isBuffer;
var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
var typedArrayTags = {};
typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = 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$1.process;
var nodeUtil = function() {
try {
var types2 = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
if (types2) {
return types2;
}
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e2) {
}
}();
const nodeUtil$1 = nodeUtil;
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
const isTypedArray$1 = isTypedArray;
var objectProto$9 = Object.prototype;
var hasOwnProperty$9 = objectProto$9.hasOwnProperty;
function arrayLikeKeys(value, inherited) {
var isArr = isArray$2(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty$9.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, length2)))) {
result.push(key);
}
}
return result;
}
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
var nativeKeys = overArg(Object.keys, Object);
const nativeKeys$1 = nativeKeys;
var objectProto$8 = Object.prototype;
var hasOwnProperty$8 = objectProto$8.hasOwnProperty;
function baseKeys(object4) {
if (!isPrototype(object4)) {
return nativeKeys$1(object4);
}
var result = [];
for (var key in Object(object4)) {
if (hasOwnProperty$8.call(object4, key) && key != "constructor") {
result.push(key);
}
}
return result;
}
function keys(object4) {
return isArrayLike(object4) ? arrayLikeKeys(object4) : baseKeys(object4);
}
function nativeKeysIn(object4) {
var result = [];
if (object4 != null) {
for (var key in Object(object4)) {
result.push(key);
}
}
return result;
}
var objectProto$7 = Object.prototype;
var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
function baseKeysIn(object4) {
if (!isObject$2(object4)) {
return nativeKeysIn(object4);
}
var isProto = isPrototype(object4), result = [];
for (var key in object4) {
if (!(key == "constructor" && (isProto || !hasOwnProperty$7.call(object4, key)))) {
result.push(key);
}
}
return result;
}
function keysIn(object4) {
return isArrayLike(object4) ? arrayLikeKeys(object4, true) : baseKeysIn(object4);
}
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
function isKey(value, object4) {
if (isArray$2(value)) {
return false;
}
var type4 = typeof value;
if (type4 == "number" || type4 == "symbol" || type4 == "boolean" || value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object4 != null && value in Object(object4);
}
var nativeCreate = getNative(Object, "create");
const nativeCreate$1 = nativeCreate;
function hashClear() {
this.__data__ = nativeCreate$1 ? nativeCreate$1(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$6 = Object.prototype;
var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
function hashGet(key) {
var data = this.__data__;
if (nativeCreate$1) {
var result = data[key];
return result === HASH_UNDEFINED$2 ? void 0 : result;
}
return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
}
var objectProto$5 = Object.prototype;
var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
function hashHas(key) {
var data = this.__data__;
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$5.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$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
return this;
}
function Hash(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry = entries[index2];
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(array4, key) {
var length2 = array4.length;
while (length2--) {
if (eq(array4[length2][0], key)) {
return length2;
}
}
return -1;
}
var arrayProto = Array.prototype;
var splice = arrayProto.splice;
function listCacheDelete(key) {
var data = this.__data__, index2 = assocIndexOf(data, key);
if (index2 < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index2 == lastIndex) {
data.pop();
} else {
splice.call(data, index2, 1);
}
--this.size;
return true;
}
function listCacheGet(key) {
var data = this.__data__, index2 = assocIndexOf(data, key);
return index2 < 0 ? void 0 : data[index2][1];
}
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
function listCacheSet(key, value) {
var data = this.__data__, index2 = assocIndexOf(data, key);
if (index2 < 0) {
++this.size;
data.push([key, value]);
} else {
data[index2][1] = value;
}
return this;
}
function ListCache(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry = entries[index2];
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$1, "Map");
const Map$2 = Map$1;
function mapCacheClear() {
this.size = 0;
this.__data__ = {
"hash": new Hash(),
"map": new (Map$2 || ListCache)(),
"string": new Hash()
};
}
function isKeyable(value) {
var type4 = typeof value;
return type4 == "string" || type4 == "number" || type4 == "symbol" || type4 == "boolean" ? value !== "__proto__" : value === null;
}
function getMapData(map, key) {
var data = map.__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), size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
function MapCache(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry = entries[index2];
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$2 = "Expected a function";
function memoize(func, resolver) {
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
throw new TypeError(FUNC_ERROR_TEXT$2);
}
var memoized = function() {
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
if (cache.has(key)) {
return cache.get(key);
}
var result = func.apply(this, args);
memoized.cache = cache.set(key, result) || cache;
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 (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
return key;
});
var cache = result.cache;
return result;
}
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath = memoizeCapped(function(string3) {
var result = [];
if (string3.charCodeAt(0) === 46) {
result.push("");
}
string3.replace(rePropName, function(match, number4, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, "$1") : number4 || match);
});
return result;
});
const stringToPath$1 = stringToPath;
function toString(value) {
return value == null ? "" : baseToString(value);
}
function castPath(value, object4) {
if (isArray$2(value)) {
return value;
}
return isKey(value, object4) ? [value] : stringToPath$1(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(object4, path) {
path = castPath(path, object4);
var index2 = 0, length2 = path.length;
while (object4 != null && index2 < length2) {
object4 = object4[toKey(path[index2++])];
}
return index2 && index2 == length2 ? object4 : void 0;
}
function get$1(object4, path, defaultValue) {
var result = object4 == null ? void 0 : baseGet(object4, path);
return result === void 0 ? defaultValue : result;
}
function arrayPush(array4, values) {
var index2 = -1, length2 = values.length, offset2 = array4.length;
while (++index2 < length2) {
array4[offset2 + index2] = values[index2];
}
return array4;
}
var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0;
function isFlattenable(value) {
return isArray$2(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
}
function baseFlatten(array4, depth, predicate, isStrict, result) {
var index2 = -1, length2 = array4.length;
predicate || (predicate = isFlattenable);
result || (result = []);
while (++index2 < length2) {
var value = array4[index2];
if (depth > 0 && predicate(value)) {
if (depth > 1) {
baseFlatten(value, depth - 1, predicate, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
function flatten(array4) {
var length2 = array4 == null ? 0 : array4.length;
return length2 ? baseFlatten(array4, 1) : [];
}
function flatRest(func) {
return setToString$1(overRest(func, void 0, flatten), func + "");
}
var getPrototype = overArg(Object.getPrototypeOf, Object);
const getPrototype$1 = getPrototype;
var objectTag$3 = "[object Object]";
var funcProto = Function.prototype, objectProto$4 = Object.prototype;
var funcToString = funcProto.toString;
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
var objectCtorString = funcToString.call(Object);
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
return false;
}
var proto = getPrototype$1(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty$4.call(proto, "constructor") && proto.constructor;
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
}
function baseSlice(array4, start, end) {
var index2 = -1, length2 = array4.length;
if (start < 0) {
start = -start > length2 ? 0 : length2 + start;
}
end = end > length2 ? length2 : end;
if (end < 0) {
end += length2;
}
length2 = start > end ? 0 : end - start >>> 0;
start >>>= 0;
var result = Array(length2);
while (++index2 < length2) {
result[index2] = array4[index2 + start];
}
return result;
}
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$2 || 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;
function baseAssign(object4, source) {
return object4 && copyObject(source, keys(source), object4);
}
function baseAssignIn(object4, source) {
return object4 && copyObject(source, keysIn(source), object4);
}
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 Buffer = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
function cloneBuffer(buffer, isDeep) {
if (isDeep) {
return buffer.slice();
}
var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
buffer.copy(result);
return result;
}
function arrayFilter(array4, predicate) {
var index2 = -1, length2 = array4 == null ? 0 : array4.length, resIndex = 0, result = [];
while (++index2 < length2) {
var value = array4[index2];
if (predicate(value, index2, array4)) {
result[resIndex++] = value;
}
}
return result;
}
function stubArray() {
return [];
}
var objectProto$3 = Object.prototype;
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object4) {
if (object4 == null) {
return [];
}
object4 = Object(object4);
return arrayFilter(nativeGetSymbols$1(object4), function(symbol) {
return propertyIsEnumerable.call(object4, symbol);
});
};
const getSymbols$1 = getSymbols;
function copySymbols(source, object4) {
return copyObject(source, getSymbols$1(source), object4);
}
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object4) {
var result = [];
while (object4) {
arrayPush(result, getSymbols$1(object4));
object4 = getPrototype$1(object4);
}
return result;
};
const getSymbolsIn$1 = getSymbolsIn;
function copySymbolsIn(source, object4) {
return copyObject(source, getSymbolsIn$1(source), object4);
}
function baseGetAllKeys(object4, keysFunc, symbolsFunc) {
var result = keysFunc(object4);
return isArray$2(object4) ? result : arrayPush(result, symbolsFunc(object4));
}
function getAllKeys(object4) {
return baseGetAllKeys(object4, keys, getSymbols$1);
}
function getAllKeysIn(object4) {
return baseGetAllKeys(object4, keysIn, getSymbolsIn$1);
}
var DataView = getNative(root$1, "DataView");
const DataView$1 = DataView;
var Promise$1 = getNative(root$1, "Promise");
const Promise$2 = Promise$1;
var Set$1 = getNative(root$1, "Set");
const Set$2 = Set$1;
var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
var dataViewTag$3 = "[object DataView]";
var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$2), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$2), weakMapCtorString = toSource(WeakMap$2);
var getTag = baseGetTag;
if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 || Map$2 && getTag(new Map$2()) != mapTag$4 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$2 && getTag(new Set$2()) != setTag$4 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag$1) {
getTag = function(value) {
var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag$3;
case mapCtorString:
return mapTag$4;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag$4;
case weakMapCtorString:
return weakMapTag$1;
}
}
return result;
};
}
const getTag$1 = getTag;
var objectProto$2 = Object.prototype;
var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
function initCloneArray(array4) {
var length2 = array4.length, result = new array4.constructor(length2);
if (length2 && typeof array4[0] == "string" && hasOwnProperty$3.call(array4, "index")) {
result.index = array4.index;
result.input = array4.input;
}
return result;
}
var Uint8Array = root$1.Uint8Array;
const Uint8Array$1 = Uint8Array;
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
return result;
}
function cloneDataView(dataView, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
}
var reFlags = /\w*$/;
function cloneRegExp(regexp4) {
var result = new regexp4.constructor(regexp4.source, reFlags.exec(regexp4));
result.lastIndex = regexp4.lastIndex;
return result;
}
var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
function cloneSymbol(symbol) {
return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
}
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
function initCloneByTag(object4, tag, isDeep) {
var Ctor = object4.constructor;
switch (tag) {
case arrayBufferTag$2:
return cloneArrayBuffer(object4);
case boolTag$2:
case dateTag$2:
return new Ctor(+object4);
case dataViewTag$2:
return cloneDataView(object4, isDeep);
case float32Tag$1:
case float64Tag$1:
case int8Tag$1:
case int16Tag$1:
case int32Tag$1:
case uint8Tag$1:
case uint8ClampedTag$1:
case uint16Tag$1:
case uint32Tag$1:
return cloneTypedArray(object4, isDeep);
case mapTag$3:
return new Ctor();
case numberTag$2:
case stringTag$2:
return new Ctor(object4);
case regexpTag$2:
return cloneRegExp(object4);
case setTag$3:
return new Ctor();
case symbolTag$2:
return cloneSymbol(object4);
}
}
function initCloneObject(object4) {
return typeof object4.constructor == "function" && !isPrototype(object4) ? baseCreate$1(getPrototype$1(object4)) : {};
}
var mapTag$2 = "[object Map]";
function baseIsMap(value) {
return isObjectLike(value) && getTag$1(value) == mapTag$2;
}
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
const isMap$1 = isMap;
var setTag$2 = "[object Set]";
function baseIsSet(value) {
return isObjectLike(value) && getTag$1(value) == setTag$2;
}
var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
const isSet$1 = isSet;
var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[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 cloneableTags = {};
cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
function baseClone(value, bitmask, customizer, key, object4, stack) {
var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
if (customizer) {
result = object4 ? customizer(value, key, object4, stack) : customizer(value);
}
if (result !== void 0) {
return result;
}
if (!isObject$2(value)) {
return value;
}
var isArr = isArray$2(value);
if (isArr) {
result = initCloneArray(value);
if (!isDeep) {
return copyArray(value, result);
}
} else {
var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
if (isBuffer$1(value)) {
return cloneBuffer(value, isDeep);
}
if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object4) {
result = isFlat || isFunc ? {} : initCloneObject(value);
if (!isDeep) {
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
}
} else {
if (!cloneableTags[tag]) {
return object4 ? value : {};
}
result = initCloneByTag(value, tag, isDeep);
}
}
stack || (stack = new Stack());
var stacked = stack.get(value);
if (stacked) {
return stacked;
}
stack.set(value, result);
if (isSet$1(value)) {
value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
} else if (isMap$1(value)) {
value.forEach(function(subValue, key2) {
result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
});
}
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
var props = isArr ? void 0 : keysFunc(value);
arrayEach(props || value, function(subValue, key2) {
if (props) {
key2 = subValue;
subValue = value[key2];
}
assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
});
return result;
}
var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
}
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 index2 = -1, length2 = values == null ? 0 : values.length;
this.__data__ = new MapCache();
while (++index2 < length2) {
this.add(values[index2]);
}
}
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
function arraySome(array4, predicate) {
var index2 = -1, length2 = array4 == null ? 0 : array4.length;
while (++index2 < length2) {
if (predicate(array4[index2], index2, array4)) {
return true;
}
}
return false;
}
function cacheHas(cache, key) {
return cache.has(key);
}
var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
function equalArrays(array4, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array4.length, othLength = other.length;
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
return false;
}
var arrStacked = stack.get(array4);
var othStacked = stack.get(other);
if (arrStacked && othStacked) {
return arrStacked == other && othStacked == array4;
}
var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
stack.set(array4, other);
stack.set(other, array4);
while (++index2 < arrLength) {
var arrValue = array4[index2], othValue = other[index2];
if (customizer) {
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array4, stack) : customizer(arrValue, othValue, index2, array4, other, stack);
}
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, stack))) {
return seen.push(othIndex);
}
})) {
result = false;
break;
}
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
result = false;
break;
}
}
stack["delete"](array4);
stack["delete"](other);
return result;
}
function mapToArray(map) {
var index2 = -1, result = Array(map.size);
map.forEach(function(value, key) {
result[++index2] = [key, value];
});
return result;
}
function setToArray(set2) {
var index2 = -1, result = Array(set2.size);
set2.forEach(function(value) {
result[++index2] = 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$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
function equalByTag(object4, other, tag, bitmask, customizer, equalFunc, stack) {
switch (tag) {
case dataViewTag:
if (object4.byteLength != other.byteLength || object4.byteOffset != other.byteOffset) {
return false;
}
object4 = object4.buffer;
other = other.buffer;
case arrayBufferTag:
if (object4.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object4), new Uint8Array$1(other))) {
return false;
}
return true;
case boolTag:
case dateTag:
case numberTag:
return eq(+object4, +other);
case errorTag:
return object4.name == other.name && object4.message == other.message;
case regexpTag:
case stringTag:
return object4 == other + "";
case mapTag:
var convert = mapToArray;
case setTag:
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
convert || (convert = setToArray);
if (object4.size != other.size && !isPartial) {
return false;
}
var stacked = stack.get(object4);
if (stacked) {
return stacked == other;
}
bitmask |= COMPARE_UNORDERED_FLAG$2;
stack.set(object4, other);
var result = equalArrays(convert(object4), convert(other), bitmask, customizer, equalFunc, stack);
stack["delete"](object4);
return result;
case symbolTag:
if (symbolValueOf) {
return symbolValueOf.call(object4) == symbolValueOf.call(other);
}
}
return false;
}
var COMPARE_PARTIAL_FLAG$3 = 1;
var objectProto$1 = Object.prototype;
var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
function equalObjects(object4, other, bitmask, customizer, equalFunc, stack) {
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object4), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
if (objLength != othLength && !isPartial) {
return false;
}
var index2 = objLength;
while (index2--) {
var key = objProps[index2];
if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
return false;
}
}
var objStacked = stack.get(object4);
var othStacked = stack.get(other);
if (objStacked && othStacked) {
return objStacked == other && othStacked == object4;
}
var result = true;
stack.set(object4, other);
stack.set(other, object4);
var skipCtor = isPartial;
while (++index2 < objLength) {
key = objProps[index2];
var objValue = object4[key], othValue = other[key];
if (customizer) {
var compared = isPartial ? customizer(othValue, objValue, key, other, object4, stack) : customizer(objValue, othValue, key, object4, other, stack);
}
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
result = false;
break;
}
skipCtor || (skipCtor = key == "constructor");
}
if (result && !skipCtor) {
var objCtor = object4.constructor, othCtor = other.constructor;
if (objCtor != othCtor && ("constructor" in object4 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
result = false;
}
}
stack["delete"](object4);
stack["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$1 = objectProto.hasOwnProperty;
function baseIsEqualDeep(object4, other, bitmask, customizer, equalFunc, stack) {
var objIsArr = isArray$2(object4), othIsArr = isArray$2(other), objTag = objIsArr ? arrayTag : getTag$1(object4), othTag = othIsArr ? arrayTag : getTag$1(other);
objTag = objTag == argsTag ? objectTag : objTag;
othTag = othTag == argsTag ? objectTag : othTag;
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
if (isSameTag && isBuffer$1(object4)) {
if (!isBuffer$1(other)) {
return false;
}
objIsArr = true;
objIsObj = false;
}
if (isSameTag && !objIsObj) {
stack || (stack = new Stack());
return objIsArr || isTypedArray$1(object4) ? equalArrays(object4, other, bitmask, customizer, equalFunc, stack) : equalByTag(object4, other, objTag, bitmask, customizer, equalFunc, stack);
}
if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
var objIsWrapped = objIsObj && hasOwnProperty$1.call(object4, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
if (objIsWrapped || othIsWrapped) {
var objUnwrapped = objIsWrapped ? object4.value() : object4, othUnwrapped = othIsWrapped ? other.value() : other;
stack || (stack = new Stack());
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
}
}
if (!isSameTag) {
return false;
}
stack || (stack = new Stack());
return equalObjects(object4, other, bitmask, customizer, equalFunc, stack);
}
function baseIsEqual(value, other, bitmask, customizer, stack) {
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, stack);
}
var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
function baseIsMatch(object4, source, matchData, customizer) {
var index2 = matchData.length, length2 = index2, noCustomizer = !customizer;
if (object4 == null) {
return !length2;
}
object4 = Object(object4);
while (index2--) {
var data = matchData[index2];
if (noCustomizer && data[2] ? data[1] !== object4[data[0]] : !(data[0] in object4)) {
return false;
}
}
while (++index2 < length2) {
data = matchData[index2];
var key = data[0], objValue = object4[key], srcValue = data[1];
if (noCustomizer && data[2]) {
if (objValue === void 0 && !(key in object4)) {
return false;
}
} else {
var stack = new Stack();
if (customizer) {
var result = customizer(objValue, srcValue, key, object4, source, stack);
}
if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
return false;
}
}
}
return true;
}
function isStrictComparable(value) {
return value === value && !isObject$2(value);
}
function getMatchData(object4) {
var result = keys(object4), length2 = result.length;
while (length2--) {
var key = result[length2], value = object4[key];
result[length2] = [key, value, isStrictComparable(value)];
}
return result;
}
function matchesStrictComparable(key, srcValue) {
return function(object4) {
if (object4 == null) {
return false;
}
return object4[key] === srcValue && (srcValue !== void 0 || key in Object(object4));
};
}
function baseMatches(source) {
var matchData = getMatchData(source);
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
return function(object4) {
return object4 === source || baseIsMatch(object4, source, matchData);
};
}
function baseHasIn(object4, key) {
return object4 != null && key in Object(object4);
}
function hasPath(object4, path, hasFunc) {
path = castPath(path, object4);
var index2 = -1, length2 = path.length, result = false;
while (++index2 < length2) {
var key = toKey(path[index2]);
if (!(result = object4 != null && hasFunc(object4, key))) {
break;
}
object4 = object4[key];
}
if (result || ++index2 != length2) {
return result;
}
length2 = object4 == null ? 0 : object4.length;
return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray$2(object4) || isArguments$1(object4));
}
function hasIn(object4, path) {
return object4 != null && hasPath(object4, 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(object4) {
var objValue = get$1(object4, path);
return objValue === void 0 && objValue === srcValue ? hasIn(object4, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
};
}
function baseProperty(key) {
return function(object4) {
return object4 == null ? void 0 : object4[key];
};
}
function basePropertyDeep(path) {
return function(object4) {
return baseGet(object4, 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$2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
}
return property(value);
}
var now = function() {
return root$1.Date.now();
};
const now$1 = now;
var FUNC_ERROR_TEXT$1 = "Expected a function";
var nativeMax$1 = Math.max, nativeMin$1 = Math.min;
function debounce(func, wait, options) {
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
if (typeof func != "function") {
throw new TypeError(FUNC_ERROR_TEXT$1);
}
wait = toNumber(wait) || 0;
if (isObject$2(options)) {
leading = !!options.leading;
maxing = "maxWait" in options;
maxWait = maxing ? nativeMax$1(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = "trailing" in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs, thisArg = lastThis;
lastArgs = lastThis = void 0;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
lastInvokeTime = time;
timerId = setTimeout(timerExpired, wait);
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
return maxing ? nativeMin$1(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
}
function timerExpired() {
var time = now$1();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = void 0;
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = void 0;
return result;
}
function cancel() {
if (timerId !== void 0) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = void 0;
}
function flush() {
return timerId === void 0 ? result : trailingEdge(now$1());
}
function debounced() {
var time = now$1(), isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === void 0) {
return leadingEdge(lastCallTime);
}
if (maxing) {
clearTimeout(timerId);
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === void 0) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
function arrayIncludesWith(array4, value, comparator) {
var index2 = -1, length2 = array4 == null ? 0 : array4.length;
while (++index2 < length2) {
if (comparator(value, array4[index2])) {
return true;
}
}
return false;
}
function last(array4) {
var length2 = array4 == null ? 0 : array4.length;
return length2 ? array4[length2 - 1] : void 0;
}
function createFind(findIndexFunc) {
return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate);
collection = keys(collection);
predicate = function(key) {
return iteratee(iterable[key], key, iterable);
};
}
var index2 = findIndexFunc(collection, predicate, fromIndex);
return index2 > -1 ? iterable[iteratee ? collection[index2] : index2] : void 0;
};
}
var nativeMax = Math.max;
function findIndex(array4, predicate, fromIndex) {
var length2 = array4 == null ? 0 : array4.length;
if (!length2) {
return -1;
}
var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
if (index2 < 0) {
index2 = nativeMax(length2 + index2, 0);
}
return baseFindIndex(array4, baseIteratee(predicate), index2);
}
var find = createFind(findIndex);
const find$1 = find;
var nativeMin = Math.min;
function baseIntersection(arrays, iteratee, comparator) {
var includes = comparator ? arrayIncludesWith : arrayIncludes, length2 = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = [];
while (othIndex--) {
var array4 = arrays[othIndex];
if (othIndex && iteratee) {
array4 = arrayMap(array4, baseUnary(iteratee));
}
maxLength = nativeMin(array4.length, maxLength);
caches[othIndex] = !comparator && (iteratee || length2 >= 120 && array4.length >= 120) ? new SetCache(othIndex && array4) : void 0;
}
array4 = arrays[0];
var index2 = -1, seen = caches[0];
outer:
while (++index2 < length2 && result.length < maxLength) {
var value = array4[index2], computed2 = iteratee ? iteratee(value) : value;
value = comparator || value !== 0 ? value : 0;
if (!(seen ? cacheHas(seen, computed2) : includes(result, computed2, comparator))) {
othIndex = othLength;
while (--othIndex) {
var cache = caches[othIndex];
if (!(cache ? cacheHas(cache, computed2) : includes(arrays[othIndex], computed2, comparator))) {
continue outer;
}
}
if (seen) {
seen.push(computed2);
}
result.push(value);
}
}
return result;
}
function castArrayLikeObject(value) {
return isArrayLikeObject(value) ? value : [];
}
var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
});
const intersection$1 = intersection;
function parent(object4, path) {
return path.length < 2 ? object4 : baseGet(object4, baseSlice(path, 0, -1));
}
function isEqual(value, other) {
return baseIsEqual(value, other);
}
var FUNC_ERROR_TEXT = "Expected a function";
function negate(predicate) {
if (typeof predicate != "function") {
throw new TypeError(FUNC_ERROR_TEXT);
}
return function() {
var args = arguments;
switch (args.length) {
case 0:
return !predicate.call(this);
case 1:
return !predicate.call(this, args[0]);
case 2:
return !predicate.call(this, args[0], args[1]);
case 3:
return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
}
function baseUnset(object4, path) {
path = castPath(path, object4);
object4 = parent(object4, path);
return object4 == null || delete object4[toKey(last(path))];
}
function customOmitClone(value) {
return isPlainObject(value) ? void 0 : value;
}
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
var omit = flatRest(function(object4, paths) {
var result = {};
if (object4 == null) {
return result;
}
var isDeep = false;
paths = arrayMap(paths, function(path) {
path = castPath(path, object4);
isDeep || (isDeep = path.length > 1);
return path;
});
copyObject(object4, getAllKeysIn(object4), result);
if (isDeep) {
result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
}
var length2 = paths.length;
while (length2--) {
baseUnset(result, paths[length2]);
}
return result;
});
const omit$1 = omit;
function baseSet(object4, path, value, customizer) {
if (!isObject$2(object4)) {
return object4;
}
path = castPath(path, object4);
var index2 = -1, length2 = path.length, lastIndex = length2 - 1, nested = object4;
while (nested != null && ++index2 < length2) {
var key = toKey(path[index2]), newValue = value;
if (key === "__proto__" || key === "constructor" || key === "prototype") {
return object4;
}
if (index2 != lastIndex) {
var objValue = nested[key];
newValue = customizer ? customizer(objValue, key, nested) : void 0;
if (newValue === void 0) {
newValue = isObject$2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
}
}
assignValue(nested, key, newValue);
nested = nested[key];
}
return object4;
}
function basePickBy(object4, paths, predicate) {
var index2 = -1, length2 = paths.length, result = {};
while (++index2 < length2) {
var path = paths[index2], value = baseGet(object4, path);
if (predicate(value, path)) {
baseSet(result, castPath(path, object4), value);
}
}
return result;
}
function pickBy(object4, predicate) {
if (object4 == null) {
return {};
}
var props = arrayMap(getAllKeysIn(object4), function(prop) {
return [prop];
});
predicate = baseIteratee(predicate);
return basePickBy(object4, props, function(value, path) {
return predicate(value, path[0]);
});
}
function omitBy(object4, predicate) {
return pickBy(object4, negate(baseIteratee(predicate)));
}
function basePick(object4, paths) {
return basePickBy(object4, paths, function(value, path) {
return hasIn(object4, path);
});
}
var pick = flatRest(function(object4, paths) {
return object4 == null ? {} : basePick(object4, paths);
});
const pick$1 = pick;
function set$1(object4, path, value) {
return object4 == null ? object4 : baseSet(object4, path, value);
}
function toPath(value) {
if (isArray$2(value)) {
return arrayMap(value, toKey);
}
return isSymbol(value) ? [value] : copyArray(stringToPath$1(toString(value)));
}
function _typeof$1(o2) {
"@babel/helpers - typeof";
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
return typeof o3;
} : function(o3) {
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
}, _typeof$1(o2);
}
function _toPrimitive(input, hint) {
if (_typeof$1(input) !== "object" || input === null)
return input;
var prim = input[Symbol.toPrimitive];
if (prim !== void 0) {
var res = prim.call(input, hint || "default");
if (_typeof$1(res) !== "object")
return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return _typeof$1(key) === "symbol" ? key : String(key);
}
function _defineProperty$9(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function ownKeys$1(e2, r2) {
var t2 = Object.keys(e2);
if (Object.getOwnPropertySymbols) {
var o2 = Object.getOwnPropertySymbols(e2);
r2 && (o2 = o2.filter(function(r3) {
return Object.getOwnPropertyDescriptor(e2, r3).enumerable;
})), t2.push.apply(t2, o2);
}
return t2;
}
function _objectSpread2$1(e2) {
for (var r2 = 1; r2 < arguments.length; r2++) {
var t2 = null != arguments[r2] ? arguments[r2] : {};
r2 % 2 ? ownKeys$1(Object(t2), true).forEach(function(r3) {
_defineProperty$9(e2, r3, t2[r3]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) {
Object.defineProperty(e2, r3, Object.getOwnPropertyDescriptor(t2, r3));
});
}
return e2;
}
function _extends$1() {
_extends$1 = Object.assign ? Object.assign.bind() : function(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
function e$1(e2, t2) {
for (var n2 = 0; n2 < t2.length; n2++) {
var r2 = t2[n2];
r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(e2, r2.key, r2);
}
}
function t$1(t2, n2, r2) {
return n2 && e$1(t2.prototype, n2), r2 && e$1(t2, r2), t2;
}
function n$1() {
return (n$1 = Object.assign || function(e2) {
for (var t2 = 1; t2 < arguments.length; t2++) {
var n2 = arguments[t2];
for (var r2 in n2)
Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]);
}
return e2;
}).apply(this, arguments);
}
function r$1(e2, t2) {
e2.prototype = Object.create(t2.prototype), e2.prototype.constructor = e2, e2.__proto__ = t2;
}
function i$1(e2, t2) {
if (null == e2)
return {};
var n2, r2, i2 = {}, o2 = Object.keys(e2);
for (r2 = 0; r2 < o2.length; r2++)
t2.indexOf(n2 = o2[r2]) >= 0 || (i2[n2] = e2[n2]);
return i2;
}
function o(e2) {
return 1 == (null != (t2 = e2) && "object" == typeof t2 && false === Array.isArray(t2)) && "[object Object]" === Object.prototype.toString.call(e2);
var t2;
}
var u = Object.prototype, a = u.toString, f = u.hasOwnProperty, c = /^\s*function (\w+)/;
function l(e2) {
var t2, n2 = null !== (t2 = null == e2 ? void 0 : e2.type) && void 0 !== t2 ? t2 : e2;
if (n2) {
var r2 = n2.toString().match(c);
return r2 ? r2[1] : "";
}
return "";
}
var s = function(e2) {
var t2, n2;
return false !== o(e2) && "function" == typeof (t2 = e2.constructor) && false !== o(n2 = t2.prototype) && false !== n2.hasOwnProperty("isPrototypeOf");
}, v = function(e2) {
return e2;
}, y = v;
if ("production" !== process.env.NODE_ENV) {
var p = "undefined" != typeof console;
y = p ? function(e2) {
console.warn("[VueTypes warn]: " + e2);
} : v;
}
var d = function(e2, t2) {
return f.call(e2, t2);
}, h = Number.isInteger || function(e2) {
return "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2;
}, b = Array.isArray || function(e2) {
return "[object Array]" === a.call(e2);
}, O = function(e2) {
return "[object Function]" === a.call(e2);
}, g = function(e2) {
return s(e2) && d(e2, "_vueTypes_name");
}, m = function(e2) {
return s(e2) && (d(e2, "type") || ["_vueTypes_name", "validator", "default", "required"].some(function(t2) {
return d(e2, t2);
}));
};
function j(e2, t2) {
return Object.defineProperty(e2.bind(t2), "__original", { value: e2 });
}
function _(e2, t2, n2) {
var r2;
void 0 === n2 && (n2 = false);
var i2 = true, o2 = "";
r2 = s(e2) ? e2 : { type: e2 };
var u2 = g(r2) ? r2._vueTypes_name + " - " : "";
if (m(r2) && null !== r2.type) {
if (void 0 === r2.type || true === r2.type)
return i2;
if (!r2.required && void 0 === t2)
return i2;
b(r2.type) ? (i2 = r2.type.some(function(e3) {
return true === _(e3, t2, true);
}), o2 = r2.type.map(function(e3) {
return l(e3);
}).join(" or ")) : i2 = "Array" === (o2 = l(r2)) ? b(t2) : "Object" === o2 ? s(t2) : "String" === o2 || "Number" === o2 || "Boolean" === o2 || "Function" === o2 ? function(e3) {
if (null == e3)
return "";
var t3 = e3.constructor.toString().match(c);
return t3 ? t3[1] : "";
}(t2) === o2 : t2 instanceof r2.type;
}
if (!i2) {
var a2 = u2 + 'value "' + t2 + '" should be of type "' + o2 + '"';
return false === n2 ? (y(a2), false) : a2;
}
if (d(r2, "validator") && O(r2.validator)) {
var f2 = y, v2 = [];
if (y = function(e3) {
v2.push(e3);
}, i2 = r2.validator(t2), y = f2, !i2) {
var p = (v2.length > 1 ? "* " : "") + v2.join("\n* ");
return v2.length = 0, false === n2 ? (y(p), i2) : p;
}
}
return i2;
}
function T(e2, t2) {
var n2 = Object.defineProperties(t2, { _vueTypes_name: { value: e2, writable: true }, isRequired: { get: function() {
return this.required = true, this;
} }, def: { value: function(e3) {
return void 0 !== e3 || this.default ? O(e3) || true === _(this, e3, true) ? (this.default = b(e3) ? function() {
return [].concat(e3);
} : s(e3) ? function() {
return Object.assign({}, e3);
} : e3, this) : (y(this._vueTypes_name + ' - invalid default value: "' + e3 + '"'), this) : this;
} } }), r2 = n2.validator;
return O(r2) && (n2.validator = j(r2, n2)), n2;
}
function w(e2, t2) {
var n2 = T(e2, t2);
return Object.defineProperty(n2, "validate", { value: function(e3) {
return O(this.validator) && y(this._vueTypes_name + " - calling .validate() will overwrite the current custom validator function. Validator info:\n" + JSON.stringify(this)), this.validator = j(e3, this), this;
} });
}
function k(e2, t2, n2) {
var r2, o2, u2 = (r2 = t2, o2 = {}, Object.getOwnPropertyNames(r2).forEach(function(e3) {
o2[e3] = Object.getOwnPropertyDescriptor(r2, e3);
}), Object.defineProperties({}, o2));
if (u2._vueTypes_name = e2, !s(n2))
return u2;
var a2, f2, c2 = n2.validator, l2 = i$1(n2, ["validator"]);
if (O(c2)) {
var v2 = u2.validator;
v2 && (v2 = null !== (f2 = (a2 = v2).__original) && void 0 !== f2 ? f2 : a2), u2.validator = j(v2 ? function(e3) {
return v2.call(this, e3) && c2.call(this, e3);
} : c2, u2);
}
return Object.assign(u2, l2);
}
function P(e2) {
return e2.replace(/^(?!\s*$)/gm, " ");
}
var x = function() {
return w("any", {});
}, A = function() {
return w("function", { type: Function });
}, E = function() {
return w("boolean", { type: Boolean });
}, N = function() {
return w("string", { type: String });
}, q = function() {
return w("number", { type: Number });
}, S = function() {
return w("array", { type: Array });
}, V = function() {
return w("object", { type: Object });
}, F = function() {
return T("integer", { type: Number, validator: function(e2) {
return h(e2);
} });
}, D = function() {
return T("symbol", { validator: function(e2) {
return "symbol" == typeof e2;
} });
};
function L(e2, t2) {
if (void 0 === t2 && (t2 = "custom validation failed"), "function" != typeof e2)
throw new TypeError("[VueTypes error]: You must provide a function as argument");
return T(e2.name || "<<anonymous function>>", { validator: function(n2) {
var r2 = e2(n2);
return r2 || y(this._vueTypes_name + " - " + t2), r2;
} });
}
function Y(e2) {
if (!b(e2))
throw new TypeError("[VueTypes error]: You must provide an array as argument.");
var t2 = 'oneOf - value should be one of "' + e2.join('", "') + '".', n2 = e2.reduce(function(e3, t3) {
if (null != t3) {
var n3 = t3.constructor;
-1 === e3.indexOf(n3) && e3.push(n3);
}
return e3;
}, []);
return T("oneOf", { type: n2.length > 0 ? n2 : void 0, validator: function(n3) {
var r2 = -1 !== e2.indexOf(n3);
return r2 || y(t2), r2;
} });
}
function B(e2) {
if (!b(e2))
throw new TypeError("[VueTypes error]: You must provide an array as argument");
for (var t2 = false, n2 = [], r2 = 0; r2 < e2.length; r2 += 1) {
var i2 = e2[r2];
if (m(i2)) {
if (g(i2) && "oneOf" === i2._vueTypes_name) {
n2 = n2.concat(i2.type);
continue;
}
if (O(i2.validator) && (t2 = true), true !== i2.type && i2.type) {
n2 = n2.concat(i2.type);
continue;
}
}
n2.push(i2);
}
return n2 = n2.filter(function(e3, t3) {
return n2.indexOf(e3) === t3;
}), T("oneOfType", t2 ? { type: n2, validator: function(t3) {
var n3 = [], r3 = e2.some(function(e3) {
var r4 = _(g(e3) && "oneOf" === e3._vueTypes_name ? e3.type || null : e3, t3, true);
return "string" == typeof r4 && n3.push(r4), true === r4;
});
return r3 || y("oneOfType - provided value does not match any of the " + n3.length + " passed-in validators:\n" + P(n3.join("\n"))), r3;
} } : { type: n2 });
}
function I(e2) {
return T("arrayOf", { type: Array, validator: function(t2) {
var n2, r2 = t2.every(function(t3) {
return true === (n2 = _(e2, t3, true));
});
return r2 || y("arrayOf - value validation error:\n" + P(n2)), r2;
} });
}
function J(e2) {
return T("instanceOf", { type: e2 });
}
function M(e2) {
return T("objectOf", { type: Object, validator: function(t2) {
var n2, r2 = Object.keys(t2).every(function(r3) {
return true === (n2 = _(e2, t2[r3], true));
});
return r2 || y("objectOf - value validation error:\n" + P(n2)), r2;
} });
}
function R(e2) {
var t2 = Object.keys(e2), n2 = t2.filter(function(t3) {
var n3;
return !!(null === (n3 = e2[t3]) || void 0 === n3 ? void 0 : n3.required);
}), r2 = T("shape", { type: Object, validator: function(r3) {
var i2 = this;
if (!s(r3))
return false;
var o2 = Object.keys(r3);
if (n2.length > 0 && n2.some(function(e3) {
return -1 === o2.indexOf(e3);
})) {
var u2 = n2.filter(function(e3) {
return -1 === o2.indexOf(e3);
});
return y(1 === u2.length ? 'shape - required property "' + u2[0] + '" is not defined.' : 'shape - required properties "' + u2.join('", "') + '" are not defined.'), false;
}
return o2.every(function(n3) {
if (-1 === t2.indexOf(n3))
return true === i2._vueTypes_isLoose || (y('shape - shape definition does not include a "' + n3 + '" property. Allowed keys: "' + t2.join('", "') + '".'), false);
var o3 = _(e2[n3], r3[n3], true);
return "string" == typeof o3 && y('shape - "' + n3 + '" property validation error:\n ' + P(o3)), true === o3;
});
} });
return Object.defineProperty(r2, "_vueTypes_isLoose", { writable: true, value: false }), Object.defineProperty(r2, "loose", { get: function() {
return this._vueTypes_isLoose = true, this;
} }), r2;
}
var $ = function() {
function e2() {
}
return e2.extend = function(e3) {
var t2 = this;
if (b(e3))
return e3.forEach(function(e4) {
return t2.extend(e4);
}), this;
var n2 = e3.name, r2 = e3.validate, o2 = void 0 !== r2 && r2, u2 = e3.getter, a2 = void 0 !== u2 && u2, f2 = i$1(e3, ["name", "validate", "getter"]);
if (d(this, n2))
throw new TypeError('[VueTypes error]: Type "' + n2 + '" already defined');
var c2, l2 = f2.type;
return g(l2) ? (delete f2.type, Object.defineProperty(this, n2, a2 ? { get: function() {
return k(n2, l2, f2);
} } : { value: function() {
var e4, t3 = k(n2, l2, f2);
return t3.validator && (t3.validator = (e4 = t3.validator).bind.apply(e4, [t3].concat([].slice.call(arguments)))), t3;
} })) : (c2 = a2 ? { get: function() {
var e4 = Object.assign({}, f2);
return o2 ? w(n2, e4) : T(n2, e4);
}, enumerable: true } : { value: function() {
var e4, t3, r3 = Object.assign({}, f2);
return e4 = o2 ? w(n2, r3) : T(n2, r3), r3.validator && (e4.validator = (t3 = r3.validator).bind.apply(t3, [e4].concat([].slice.call(arguments)))), e4;
}, enumerable: true }, Object.defineProperty(this, n2, c2));
}, t$1(e2, null, [{ key: "any", get: function() {
return x();
} }, { key: "func", get: function() {
return A().def(this.defaults.func);
} }, { key: "bool", get: function() {
return E().def(this.defaults.bool);
} }, { key: "string", get: function() {
return N().def(this.defaults.string);
} }, { key: "number", get: function() {
return q().def(this.defaults.number);
} }, { key: "array", get: function() {
return S().def(this.defaults.array);
} }, { key: "object", get: function() {
return V().def(this.defaults.object);
} }, { key: "integer", get: function() {
return F().def(this.defaults.integer);
} }, { key: "symbol", get: function() {
return D();
} }]), e2;
}();
function z(e2) {
var i2;
return void 0 === e2 && (e2 = { func: function() {
}, bool: true, string: "", number: 0, array: function() {
return [];
}, object: function() {
return {};
}, integer: 0 }), (i2 = function(i3) {
function o2() {
return i3.apply(this, arguments) || this;
}
return r$1(o2, i3), t$1(o2, null, [{ key: "sensibleDefaults", get: function() {
return n$1({}, this.defaults);
}, set: function(t2) {
this.defaults = false !== t2 ? n$1({}, true !== t2 ? t2 : e2) : {};
} }]), o2;
}($)).defaults = n$1({}, e2), i2;
}
$.defaults = {}, $.custom = L, $.oneOf = Y, $.instanceOf = J, $.oneOfType = B, $.arrayOf = I, $.objectOf = M, $.shape = R, $.utils = { validate: function(e2, t2) {
return true === _(t2, e2, true);
}, toType: function(e2, t2, n2) {
return void 0 === n2 && (n2 = false), n2 ? w(e2, t2) : T(e2, t2);
} };
(function(e2) {
function t2() {
return e2.apply(this, arguments) || this;
}
return r$1(t2, e2), t2;
})(z());
const PropTypes = z({
func: void 0,
bool: void 0,
string: void 0,
number: void 0,
array: void 0,
object: void 0,
integer: void 0
});
PropTypes.extend([{
name: "looseBool",
getter: true,
type: Boolean,
default: void 0
}, {
name: "style",
getter: true,
type: [String, Object],
default: void 0
}, {
name: "VueNode",
getter: true,
type: null
}]);
const PropTypes$1 = PropTypes;
const isFunction = (val) => typeof val === "function";
const isArray = Array.isArray;
const isString = (val) => typeof val === "string";
const isObject$1 = (val) => val !== null && typeof val === "object";
const onRE = /^on[^a-z]/;
const isOn = (key) => onRE.test(key);
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
};
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction((str) => {
return str.replace(hyphenateRE, "-$1").toLowerCase();
});
const hasOwnProperty = Object.prototype.hasOwnProperty;
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
function resolvePropValue(options, props, key, value) {
const opt = options[key];
if (opt != null) {
const hasDefault = hasOwn(opt, "default");
if (hasDefault && value === void 0) {
const defaultValue = opt.default;
value = opt.type !== Function && isFunction(defaultValue) ? defaultValue() : defaultValue;
}
if (opt.type === Boolean) {
if (!hasOwn(props, key) && !hasDefault) {
value = false;
} else if (value === "") {
value = true;
}
}
}
return value;
}
function classNames() {
const classes = [];
for (let i2 = 0; i2 < arguments.length; i2++) {
const value = i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2];
if (!value)
continue;
if (isString(value)) {
classes.push(value);
} else if (isArray(value)) {
for (let i3 = 0; i3 < value.length; i3++) {
const inner = classNames(value[i3]);
if (inner) {
classes.push(inner);
}
}
} else if (isObject$1(value)) {
for (const name in value) {
if (value[name]) {
classes.push(name);
}
}
}
}
return classes.join(" ");
}
let warned = {};
function warning$4(valid, message) {
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
console.error(`Warning: ${message}`);
}
}
function resetWarned() {
warned = {};
}
function call(method4, valid, message) {
if (!valid && !warned[message]) {
method4(false, message);
warned[message] = true;
}
}
function warningOnce(valid, message) {
call(warning$4, valid, message);
}
function noop$3() {
}
let warning$2 = noop$3;
if (process.env.NODE_ENV !== "production") {
warning$2 = (valid, component, message) => {
warningOnce(valid, `[ant-design-vue: ${component}] ${message}`);
if (process.env.NODE_ENV === "test") {
resetWarned();
}
};
}
const warning$3 = warning$2;
var LoadingOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
const LoadingOutlinedSvg = LoadingOutlined$2;
function bound01(n2, max) {
if (isOnePointZero(n2)) {
n2 = "100%";
}
var isPercent = isPercentage(n2);
n2 = max === 360 ? n2 : Math.min(max, Math.max(0, parseFloat(n2)));
if (isPercent) {
n2 = parseInt(String(n2 * max), 10) / 100;
}
if (Math.abs(n2 - max) < 1e-6) {
return 1;
}
if (max === 360) {
n2 = (n2 < 0 ? n2 % max + max : n2 % max) / parseFloat(String(max));
} else {
n2 = n2 % max / parseFloat(String(max));
}
return n2;
}
function clamp01(val) {
return Math.min(1, Math.max(0, val));
}
function isOnePointZero(n2) {
return typeof n2 === "string" && n2.indexOf(".") !== -1 && parseFloat(n2) === 1;
}
function isPercentage(n2) {
return typeof n2 === "string" && n2.indexOf("%") !== -1;
}
function boundAlpha(a2) {
a2 = parseFloat(a2);
if (isNaN(a2) || a2 < 0 || a2 > 1) {
a2 = 1;
}
return a2;
}
function convertToPercentage(n2) {
if (n2 <= 1) {
return "".concat(Number(n2) * 100, "%");
}
return n2;
}
function pad2(c2) {
return c2.length === 1 ? "0" + c2 : String(c2);
}
function rgbToRgb(r2, g2, b2) {
return {
r: bound01(r2, 255) * 255,
g: bound01(g2, 255) * 255,
b: bound01(b2, 255) * 255
};
}
function rgbToHsl(r2, g2, b2) {
r2 = bound01(r2, 255);
g2 = bound01(g2, 255);
b2 = bound01(b2, 255);
var max = Math.max(r2, g2, b2);
var min = Math.min(r2, g2, b2);
var h2 = 0;
var s2 = 0;
var l2 = (max + min) / 2;
if (max === min) {
s2 = 0;
h2 = 0;
} else {
var d2 = max - min;
s2 = l2 > 0.5 ? d2 / (2 - max - min) : d2 / (max + min);
switch (max) {
case r2:
h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
break;
case g2:
h2 = (b2 - r2) / d2 + 2;
break;
case b2:
h2 = (r2 - g2) / d2 + 4;
break;
}
h2 /= 6;
}
return { h: h2, s: s2, l: l2 };
}
function hue2rgb(p, q2, t2) {
if (t2 < 0) {
t2 += 1;
}
if (t2 > 1) {
t2 -= 1;
}
if (t2 < 1 / 6) {
return p + (q2 - p) * (6 * t2);
}
if (t2 < 1 / 2) {
return q2;
}
if (t2 < 2 / 3) {
return p + (q2 - p) * (2 / 3 - t2) * 6;
}
return p;
}
function hslToRgb(h2, s2, l2) {
var r2;
var g2;
var b2;
h2 = bound01(h2, 360);
s2 = bound01(s2, 100);
l2 = bound01(l2, 100);
if (s2 === 0) {
g2 = l2;
b2 = l2;
r2 = l2;
} else {
var q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
var p = 2 * l2 - q2;
r2 = hue2rgb(p, q2, h2 + 1 / 3);
g2 = hue2rgb(p, q2, h2);
b2 = hue2rgb(p, q2, h2 - 1 / 3);
}
return { r: r2 * 255, g: g2 * 255, b: b2 * 255 };
}
function rgbToHsv(r2, g2, b2) {
r2 = bound01(r2, 255);
g2 = bound01(g2, 255);
b2 = bound01(b2, 255);
var max = Math.max(r2, g2, b2);
var min = Math.min(r2, g2, b2);
var h2 = 0;
var v2 = max;
var d2 = max - min;
var s2 = max === 0 ? 0 : d2 / max;
if (max === min) {
h2 = 0;
} else {
switch (max) {
case r2:
h2 = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
break;
case g2:
h2 = (b2 - r2) / d2 + 2;
break;
case b2:
h2 = (r2 - g2) / d2 + 4;
break;
}
h2 /= 6;
}
return { h: h2, s: s2, v: v2 };
}
function hsvToRgb(h2, s2, v2) {
h2 = bound01(h2, 360) * 6;
s2 = bound01(s2, 100);
v2 = bound01(v2, 100);
var i2 = Math.floor(h2);
var f2 = h2 - i2;
var p = v2 * (1 - s2);
var q2 = v2 * (1 - f2 * s2);
var t2 = v2 * (1 - (1 - f2) * s2);
var mod = i2 % 6;
var r2 = [v2, q2, p, p, t2, v2][mod];
var g2 = [t2, v2, v2, q2, p, p][mod];
var b2 = [p, p, t2, v2, v2, q2][mod];
return { r: r2 * 255, g: g2 * 255, b: b2 * 255 };
}
function rgbToHex(r2, g2, b2, allow3Char) {
var hex2 = [
pad2(Math.round(r2).toString(16)),
pad2(Math.round(g2).toString(16)),
pad2(Math.round(b2).toString(16))
];
if (allow3Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1))) {
return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0);
}
return hex2.join("");
}
function rgbaToHex(r2, g2, b2, a2, allow4Char) {
var hex2 = [
pad2(Math.round(r2).toString(16)),
pad2(Math.round(g2).toString(16)),
pad2(Math.round(b2).toString(16)),
pad2(convertDecimalToHex(a2))
];
if (allow4Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1)) && hex2[3].startsWith(hex2[3].charAt(1))) {
return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0) + hex2[3].charAt(0);
}
return hex2.join("");
}
function convertDecimalToHex(d2) {
return Math.round(parseFloat(d2) * 255).toString(16);
}
function convertHexToDecimal(h2) {
return parseIntFromHex(h2) / 255;
}
function parseIntFromHex(val) {
return parseInt(val, 16);
}
function numberInputToObject(color) {
return {
r: color >> 16,
g: (color & 65280) >> 8,
b: color & 255
};
}
var names = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a2 = 1;
var s2 = null;
var v2 = null;
var l2 = null;
var ok = false;
var format2 = false;
if (typeof color === "string") {
color = stringInputToObject(color);
}
if (typeof color === "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s2 = convertToPercentage(color.s);
v2 = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s2, v2);
ok = true;
format2 = "hsv";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s2 = convertToPercentage(color.s);
l2 = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s2, l2);
ok = true;
format2 = "hsl";
}
if (Object.prototype.hasOwnProperty.call(color, "a")) {
a2 = color.a;
}
}
a2 = boundAlpha(a2);
return {
ok,
format: color.format || format2,
r: Math.min(255, Math.max(rgb.r, 0)),
g: Math.min(255, Math.max(rgb.g, 0)),
b: Math.min(255, Math.max(rgb.b, 0)),
a: a2
};
}
var CSS_INTEGER = "[-\\+]?\\d+%?";
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var matchers = {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function stringInputToObject(color) {
color = color.trim().toLowerCase();
if (color.length === 0) {
return false;
}
var named = false;
if (names[color]) {
color = names[color];
named = true;
} else if (color === "transparent") {
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
}
var match = matchers.rgb.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3] };
}
match = matchers.rgba.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
match = matchers.hsl.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3] };
}
match = matchers.hsla.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
match = matchers.hsv.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3] };
}
match = matchers.hsva.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
match = matchers.hex8.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
match = matchers.hex6.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
match = matchers.hex4.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1] + match[1]),
g: parseIntFromHex(match[2] + match[2]),
b: parseIntFromHex(match[3] + match[3]),
a: convertHexToDecimal(match[4] + match[4]),
format: named ? "name" : "hex8"
};
}
match = matchers.hex3.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1] + match[1]),
g: parseIntFromHex(match[2] + match[2]),
b: parseIntFromHex(match[3] + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function isValidCSSUnit(color) {
return Boolean(matchers.CSS_UNIT.exec(String(color)));
}
var TinyColor = (
/** @class */
function() {
function TinyColor2(color, opts) {
if (color === void 0) {
color = "";
}
if (opts === void 0) {
opts = {};
}
var _a;
if (color instanceof TinyColor2) {
return color;
}
if (typeof color === "number") {
color = numberInputToObject(color);
}
this.originalInput = color;
var rgb = inputToRGB(color);
this.originalInput = color;
this.r = rgb.r;
this.g = rgb.g;
this.b = rgb.b;
this.a = rgb.a;
this.roundA = Math.round(100 * this.a) / 100;
this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
this.gradientType = opts.gradientType;
if (this.r < 1) {
this.r = Math.round(this.r);
}
if (this.g < 1) {
this.g = Math.round(this.g);
}
if (this.b < 1) {
this.b = Math.round(this.b);
}
this.isValid = rgb.ok;
}
TinyColor2.prototype.isDark = function() {
return this.getBrightness() < 128;
};
TinyColor2.prototype.isLight = function() {
return !this.isDark();
};
TinyColor2.prototype.getBrightness = function() {
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
};
TinyColor2.prototype.getLuminance = function() {
var rgb = this.toRgb();
var R2;
var G;
var B2;
var RsRGB = rgb.r / 255;
var GsRGB = rgb.g / 255;
var BsRGB = rgb.b / 255;
if (RsRGB <= 0.03928) {
R2 = RsRGB / 12.92;
} else {
R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
}
if (GsRGB <= 0.03928) {
G = GsRGB / 12.92;
} else {
G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
}
if (BsRGB <= 0.03928) {
B2 = BsRGB / 12.92;
} else {
B2 = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
}
return 0.2126 * R2 + 0.7152 * G + 0.0722 * B2;
};
TinyColor2.prototype.getAlpha = function() {
return this.a;
};
TinyColor2.prototype.setAlpha = function(alpha) {
this.a = boundAlpha(alpha);
this.roundA = Math.round(100 * this.a) / 100;
return this;
};
TinyColor2.prototype.isMonochrome = function() {
var s2 = this.toHsl().s;
return s2 === 0;
};
TinyColor2.prototype.toHsv = function() {
var hsv = rgbToHsv(this.r, this.g, this.b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
};
TinyColor2.prototype.toHsvString = function() {
var hsv = rgbToHsv(this.r, this.g, this.b);
var h2 = Math.round(hsv.h * 360);
var s2 = Math.round(hsv.s * 100);
var v2 = Math.round(hsv.v * 100);
return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s2, "%, ").concat(v2, "%)") : "hsva(".concat(h2, ", ").concat(s2, "%, ").concat(v2, "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toHsl = function() {
var hsl = rgbToHsl(this.r, this.g, this.b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
};
TinyColor2.prototype.toHslString = function() {
var hsl = rgbToHsl(this.r, this.g, this.b);
var h2 = Math.round(hsl.h * 360);
var s2 = Math.round(hsl.s * 100);
var l2 = Math.round(hsl.l * 100);
return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%)") : "hsla(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toHex = function(allow3Char) {
if (allow3Char === void 0) {
allow3Char = false;
}
return rgbToHex(this.r, this.g, this.b, allow3Char);
};
TinyColor2.prototype.toHexString = function(allow3Char) {
if (allow3Char === void 0) {
allow3Char = false;
}
return "#" + this.toHex(allow3Char);
};
TinyColor2.prototype.toHex8 = function(allow4Char) {
if (allow4Char === void 0) {
allow4Char = false;
}
return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
};
TinyColor2.prototype.toHex8String = function(allow4Char) {
if (allow4Char === void 0) {
allow4Char = false;
}
return "#" + this.toHex8(allow4Char);
};
TinyColor2.prototype.toHexShortString = function(allowShortChar) {
if (allowShortChar === void 0) {
allowShortChar = false;
}
return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
};
TinyColor2.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
};
TinyColor2.prototype.toRgbString = function() {
var r2 = Math.round(this.r);
var g2 = Math.round(this.g);
var b2 = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g2, ", ").concat(b2, ")") : "rgba(".concat(r2, ", ").concat(g2, ", ").concat(b2, ", ").concat(this.roundA, ")");
};
TinyColor2.prototype.toPercentageRgb = function() {
var fmt = function(x2) {
return "".concat(Math.round(bound01(x2, 255) * 100), "%");
};
return {
r: fmt(this.r),
g: fmt(this.g),
b: fmt(this.b),
a: this.a
};
};
TinyColor2.prototype.toPercentageRgbString = function() {
var rnd = function(x2) {
return Math.round(bound01(x2, 255) * 100);
};
return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toName = function() {
if (this.a === 0) {
return "transparent";
}
if (this.a < 1) {
return false;
}
var hex2 = "#" + rgbToHex(this.r, this.g, this.b, false);
for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
var _b = _a[_i], key = _b[0], value = _b[1];
if (hex2 === value) {
return key;
}
}
return false;
};
TinyColor2.prototype.toString = function(format2) {
var formatSet = Boolean(format2);
format2 = format2 !== null && format2 !== void 0 ? format2 : this.format;
var formattedString = false;
var hasAlpha = this.a < 1 && this.a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format2.startsWith("hex") || format2 === "name");
if (needsAlphaFormat) {
if (format2 === "name" && this.a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format2 === "rgb") {
formattedString = this.toRgbString();
}
if (format2 === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format2 === "hex" || format2 === "hex6") {
formattedString = this.toHexString();
}
if (format2 === "hex3") {
formattedString = this.toHexString(true);
}
if (format2 === "hex4") {
formattedString = this.toHex8String(true);
}
if (format2 === "hex8") {
formattedString = this.toHex8String();
}
if (format2 === "name") {
formattedString = this.toName();
}
if (format2 === "hsl") {
formattedString = this.toHslString();
}
if (format2 === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
};
TinyColor2.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
};
TinyColor2.prototype.clone = function() {
return new TinyColor2(this.toString());
};
TinyColor2.prototype.lighten = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return new TinyColor2(hsl);
};
TinyColor2.prototype.brighten = function(amount) {
if (amount === void 0) {
amount = 10;
}
var rgb = this.toRgb();
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
return new TinyColor2(rgb);
};
TinyColor2.prototype.darken = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return new TinyColor2(hsl);
};
TinyColor2.prototype.tint = function(amount) {
if (amount === void 0) {
amount = 10;
}
return this.mix("white", amount);
};
TinyColor2.prototype.shade = function(amount) {
if (amount === void 0) {
amount = 10;
}
return this.mix("black", amount);
};
TinyColor2.prototype.desaturate = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return new TinyColor2(hsl);
};
TinyColor2.prototype.saturate = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return new TinyColor2(hsl);
};
TinyColor2.prototype.greyscale = function() {
return this.desaturate(100);
};
TinyColor2.prototype.spin = function(amount) {
var hsl = this.toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return new TinyColor2(hsl);
};
TinyColor2.prototype.mix = function(color, amount) {
if (amount === void 0) {
amount = 50;
}
var rgb1 = this.toRgb();
var rgb2 = new TinyColor2(color).toRgb();
var p = amount / 100;
var rgba = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b,
a: (rgb2.a - rgb1.a) * p + rgb1.a
};
return new TinyColor2(rgba);
};
TinyColor2.prototype.analogous = function(results, slices) {
if (results === void 0) {
results = 6;
}
if (slices === void 0) {
slices = 30;
}
var hsl = this.toHsl();
var part = 360 / slices;
var ret = [this];
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
hsl.h = (hsl.h + part) % 360;
ret.push(new TinyColor2(hsl));
}
return ret;
};
TinyColor2.prototype.complement = function() {
var hsl = this.toHsl();
hsl.h = (hsl.h + 180) % 360;
return new TinyColor2(hsl);
};
TinyColor2.prototype.monochromatic = function(results) {
if (results === void 0) {
results = 6;
}
var hsv = this.toHsv();
var h2 = hsv.h;
var s2 = hsv.s;
var v2 = hsv.v;
var res = [];
var modification = 1 / results;
while (results--) {
res.push(new TinyColor2({ h: h2, s: s2, v: v2 }));
v2 = (v2 + modification) % 1;
}
return res;
};
TinyColor2.prototype.splitcomplement = function() {
var hsl = this.toHsl();
var h2 = hsl.h;
return [
this,
new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
];
};
TinyColor2.prototype.onBackground = function(background) {
var fg = this.toRgb();
var bg = new TinyColor2(background).toRgb();
var alpha = fg.a + bg.a * (1 - fg.a);
return new TinyColor2({
r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
a: alpha
});
};
TinyColor2.prototype.triad = function() {
return this.polyad(3);
};
TinyColor2.prototype.tetrad = function() {
return this.polyad(4);
};
TinyColor2.prototype.polyad = function(n2) {
var hsl = this.toHsl();
var h2 = hsl.h;
var result = [this];
var increment = 360 / n2;
for (var i2 = 1; i2 < n2; i2++) {
result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl.s, l: hsl.l }));
}
return result;
};
TinyColor2.prototype.equals = function(color) {
return this.toRgbString() === new TinyColor2(color).toRgbString();
};
return TinyColor2;
}()
);
var hueStep = 2;
var saturationStep = 0.16;
var saturationStep2 = 0.05;
var brightnessStep1 = 0.05;
var brightnessStep2 = 0.15;
var lightColorCount = 5;
var darkColorCount = 4;
var darkColorMap = [{
index: 7,
opacity: 0.15
}, {
index: 6,
opacity: 0.25
}, {
index: 5,
opacity: 0.3
}, {
index: 5,
opacity: 0.45
}, {
index: 5,
opacity: 0.65
}, {
index: 5,
opacity: 0.85
}, {
index: 4,
opacity: 0.9
}, {
index: 3,
opacity: 0.95
}, {
index: 2,
opacity: 0.97
}, {
index: 1,
opacity: 0.98
}];
function toHsv(_ref) {
var r2 = _ref.r, g2 = _ref.g, b2 = _ref.b;
var hsv = rgbToHsv(r2, g2, b2);
return {
h: hsv.h * 360,
s: hsv.s,
v: hsv.v
};
}
function toHex(_ref2) {
var r2 = _ref2.r, g2 = _ref2.g, b2 = _ref2.b;
return "#".concat(rgbToHex(r2, g2, b2, false));
}
function mix$1(rgb1, rgb2, amount) {
var p = amount / 100;
var rgb = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b
};
return rgb;
}
function getHue(hsv, i2, light) {
var hue;
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
hue = light ? Math.round(hsv.h) - hueStep * i2 : Math.round(hsv.h) + hueStep * i2;
} else {
hue = light ? Math.round(hsv.h) + hueStep * i2 : Math.round(hsv.h) - hueStep * i2;
}
if (hue < 0) {
hue += 360;
} else if (hue >= 360) {
hue -= 360;
}
return hue;
}
function getSaturation(hsv, i2, light) {
if (hsv.h === 0 && hsv.s === 0) {
return hsv.s;
}
var saturation;
if (light) {
saturation = hsv.s - saturationStep * i2;
} else if (i2 === darkColorCount) {
saturation = hsv.s + saturationStep;
} else {
saturation = hsv.s + saturationStep2 * i2;
}
if (saturation > 1) {
saturation = 1;
}
if (light && i2 === lightColorCount && saturation > 0.1) {
saturation = 0.1;
}
if (saturation < 0.06) {
saturation = 0.06;
}
return Number(saturation.toFixed(2));
}
function getValue$2(hsv, i2, light) {
var value;
if (light) {
value = hsv.v + brightnessStep1 * i2;
} else {
value = hsv.v - brightnessStep2 * i2;
}
if (value > 1) {
value = 1;
}
return Number(value.toFixed(2));
}
function generate$1(color) {
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var patterns = [];
var pColor = inputToRGB(color);
for (var i2 = lightColorCount; i2 > 0; i2 -= 1) {
var hsv = toHsv(pColor);
var colorString = toHex(inputToRGB({
h: getHue(hsv, i2, true),
s: getSaturation(hsv, i2, true),
v: getValue$2(hsv, i2, true)
}));
patterns.push(colorString);
}
patterns.push(toHex(pColor));
for (var _i = 1; _i <= darkColorCount; _i += 1) {
var _hsv = toHsv(pColor);
var _colorString = toHex(inputToRGB({
h: getHue(_hsv, _i),
s: getSaturation(_hsv, _i),
v: getValue$2(_hsv, _i)
}));
patterns.push(_colorString);
}
if (opts.theme === "dark") {
return darkColorMap.map(function(_ref3) {
var index2 = _ref3.index, opacity = _ref3.opacity;
var darkColorString = toHex(mix$1(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index2]), opacity * 100));
return darkColorString;
});
}
return patterns;
}
var presetPrimaryColors = {
red: "#F5222D",
volcano: "#FA541C",
orange: "#FA8C16",
gold: "#FAAD14",
yellow: "#FADB14",
lime: "#A0D911",
green: "#52C41A",
cyan: "#13C2C2",
blue: "#1890FF",
geekblue: "#2F54EB",
purple: "#722ED1",
magenta: "#EB2F96",
grey: "#666666"
};
var presetPalettes = {};
var presetDarkPalettes = {};
Object.keys(presetPrimaryColors).forEach(function(key) {
presetPalettes[key] = generate$1(presetPrimaryColors[key]);
presetPalettes[key].primary = presetPalettes[key][5];
presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
theme: "dark",
backgroundColor: "#141414"
});
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
});
var blue = presetPalettes.blue;
var contextKey = Symbol("iconContext");
var useInjectIconContext = function useInjectIconContext2() {
return inject(contextKey, {
prefixCls: ref("anticon"),
rootClassName: ref(""),
csp: ref()
});
};
function canUseDom$1() {
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
}
function contains$1(root2, n2) {
if (!root2) {
return false;
}
if (root2.contains) {
return root2.contains(n2);
}
return false;
}
var APPEND_ORDER$1 = "data-vc-order";
var MARK_KEY$1 = "vc-icon-key";
var containerCache$1 = /* @__PURE__ */ new Map();
function getMark$1() {
var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, mark = _ref.mark;
if (mark) {
return mark.startsWith("data-") ? mark : "data-".concat(mark);
}
return MARK_KEY$1;
}
function getContainer$1(option) {
if (option.attachTo) {
return option.attachTo;
}
var head = document.querySelector("head");
return head || document.body;
}
function getOrder$1(prepend) {
if (prepend === "queue") {
return "prependQueue";
}
return prepend ? "prepend" : "append";
}
function findStyles$1(container) {
return Array.from((containerCache$1.get(container) || container).children).filter(function(node2) {
return node2.tagName === "STYLE";
});
}
function injectCSS$1(css2) {
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (!canUseDom$1()) {
return null;
}
var csp = option.csp, prepend = option.prepend;
var styleNode = document.createElement("style");
styleNode.setAttribute(APPEND_ORDER$1, getOrder$1(prepend));
if (csp && csp.nonce) {
styleNode.nonce = csp.nonce;
}
styleNode.innerHTML = css2;
var container = getContainer$1(option);
var firstChild = container.firstChild;
if (prepend) {
if (prepend === "queue") {
var existStyle = findStyles$1(container).filter(function(node2) {
return ["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER$1));
});
if (existStyle.length) {
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
return styleNode;
}
}
container.insertBefore(styleNode, firstChild);
} else {
container.appendChild(styleNode);
}
return styleNode;
}
function findExistNode$1(key) {
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var container = getContainer$1(option);
return findStyles$1(container).find(function(node2) {
return node2.getAttribute(getMark$1(option)) === key;
});
}
function syncRealContainer$1(container, option) {
var cachedRealContainer = containerCache$1.get(container);
if (!cachedRealContainer || !contains$1(document, cachedRealContainer)) {
var placeholderStyle = injectCSS$1("", option);
var parentNode = placeholderStyle.parentNode;
containerCache$1.set(container, parentNode);
container.removeChild(placeholderStyle);
}
}
function updateCSS$1(css2, key) {
var option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var container = getContainer$1(option);
syncRealContainer$1(container, option);
var existNode = findExistNode$1(key, option);
if (existNode) {
if (option.csp && option.csp.nonce && existNode.nonce !== option.csp.nonce) {
existNode.nonce = option.csp.nonce;
}
if (existNode.innerHTML !== css2) {
existNode.innerHTML = css2;
}
return existNode;
}
var newNode = injectCSS$1(css2, option);
newNode.setAttribute(getMark$1(option), key);
return newNode;
}
function _objectSpread$7(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$8(target, key, source[key]);
});
}
return target;
}
function _defineProperty$8(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
function warn(valid, message) {
if (process.env.NODE_ENV !== "production" && !valid && console !== void 0) {
console.error("Warning: ".concat(message));
}
}
function warning$1(valid, message) {
warn(valid, "[@ant-design/icons-vue] ".concat(message));
}
function isIconDefinition(target) {
return typeof target === "object" && typeof target.name === "string" && typeof target.theme === "string" && (typeof target.icon === "object" || typeof target.icon === "function");
}
function generate(node2, key, rootProps) {
if (!rootProps) {
return h$1(node2.tag, _objectSpread$7({
key
}, node2.attrs), (node2.children || []).map(function(child, index2) {
return generate(child, "".concat(key, "-").concat(node2.tag, "-").concat(index2));
}));
}
return h$1(node2.tag, _objectSpread$7({
key
}, rootProps, node2.attrs), (node2.children || []).map(function(child, index2) {
return generate(child, "".concat(key, "-").concat(node2.tag, "-").concat(index2));
}));
}
function getSecondaryColor(primaryColor) {
return generate$1(primaryColor)[0];
}
function normalizeTwoToneColors(twoToneColor) {
if (!twoToneColor) {
return [];
}
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
}
var iconStyles = "\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
function getRoot(ele) {
return ele && ele.getRootNode && ele.getRootNode();
}
function inShadow(ele) {
if (!canUseDom$1()) {
return false;
}
return getRoot(ele) instanceof ShadowRoot;
}
function getShadowRoot(ele) {
return inShadow(ele) ? getRoot(ele) : null;
}
var useInsertStyles = function useInsertStyles2() {
var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, csp = _useInjectIconContext.csp;
var instance = getCurrentInstance();
var mergedStyleStr = iconStyles;
if (prefixCls) {
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls.value);
}
nextTick(function() {
if (!canUseDom$1()) {
return;
}
var ele = instance.vnode.el;
var shadowRoot = getShadowRoot(ele);
updateCSS$1(mergedStyleStr, "@ant-design-vue-icons", {
prepend: true,
csp: csp.value,
attachTo: shadowRoot
});
});
};
var _excluded$1 = ["icon", "primaryColor", "secondaryColor"];
function _objectWithoutProperties$1(source, excluded) {
if (source == null)
return {};
var target = _objectWithoutPropertiesLoose$1(source, excluded);
var key, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key = sourceSymbolKeys[i2];
if (excluded.indexOf(key) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key))
continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose$1(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key = sourceKeys[i2];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
function _objectSpread$6(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$7(target, key, source[key]);
});
}
return target;
}
function _defineProperty$7(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var twoToneColorPalette = reactive({
primaryColor: "#333",
secondaryColor: "#E6E6E6",
calculated: false
});
function setTwoToneColors(_ref) {
var primaryColor = _ref.primaryColor, secondaryColor = _ref.secondaryColor;
twoToneColorPalette.primaryColor = primaryColor;
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
twoToneColorPalette.calculated = !!secondaryColor;
}
function getTwoToneColors() {
return _objectSpread$6({}, twoToneColorPalette);
}
var IconBase = function IconBase2(props, context) {
var _props$context$attrs = _objectSpread$6({}, props, context.attrs), icon = _props$context$attrs.icon, primaryColor = _props$context$attrs.primaryColor, secondaryColor = _props$context$attrs.secondaryColor, restProps = _objectWithoutProperties$1(_props$context$attrs, _excluded$1);
var colors = twoToneColorPalette;
if (primaryColor) {
colors = {
primaryColor,
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
};
}
warning$1(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
if (!isIconDefinition(icon)) {
return null;
}
var target = icon;
if (target && typeof target.icon === "function") {
target = _objectSpread$6({}, target, {
icon: target.icon(colors.primaryColor, colors.secondaryColor)
});
}
return generate(target.icon, "svg-".concat(target.name), _objectSpread$6({}, restProps, {
"data-icon": target.name,
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true"
}));
};
IconBase.props = {
icon: Object,
primaryColor: String,
secondaryColor: String,
focusable: String
};
IconBase.inheritAttrs = false;
IconBase.displayName = "IconBase";
IconBase.getTwoToneColors = getTwoToneColors;
IconBase.setTwoToneColors = setTwoToneColors;
const VueIcon = IconBase;
function _slicedToArray$1(arr, i2) {
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$1(arr, i2) || _nonIterableRest$1();
}
function _nonIterableRest$1() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray$1(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray$1(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray$1(o2, minLen);
}
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
arr2[i2] = arr[i2];
}
return arr2;
}
function _iterableToArrayLimit$1(arr, i2) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null)
return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null)
_i["return"]();
} finally {
if (_d)
throw _e;
}
}
return _arr;
}
function _arrayWithHoles$1(arr) {
if (Array.isArray(arr))
return arr;
}
function setTwoToneColor(twoToneColor) {
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray$1(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
return VueIcon.setTwoToneColors({
primaryColor,
secondaryColor
});
}
function getTwoToneColor() {
var colors = VueIcon.getTwoToneColors();
if (!colors.calculated) {
return colors.primaryColor;
}
return [colors.primaryColor, colors.secondaryColor];
}
var InsertStyles = defineComponent({
name: "InsertStyles",
setup: function setup() {
useInsertStyles();
return function() {
return null;
};
}
});
var _excluded = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
function _slicedToArray(arr, i2) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(o2, minLen) {
if (!o2)
return;
if (typeof o2 === "string")
return _arrayLikeToArray(o2, minLen);
var n2 = Object.prototype.toString.call(o2).slice(8, -1);
if (n2 === "Object" && o2.constructor)
n2 = o2.constructor.name;
if (n2 === "Map" || n2 === "Set")
return Array.from(o2);
if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
return _arrayLikeToArray(o2, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
arr2[i2] = arr[i2];
}
return arr2;
}
function _iterableToArrayLimit(arr, i2) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null)
return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i2 && _arr.length === i2)
break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null)
_i["return"]();
} finally {
if (_d)
throw _e;
}
}
return _arr;
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr))
return arr;
}
function _objectSpread$5(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$6(target, key, source[key]);
});
}
return target;
}
function _defineProperty$6(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
function _objectWithoutProperties(source, excluded) {
if (source == null)
return {};
var target = _objectWithoutPropertiesLoose(source, excluded);
var key, i2;
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
key = sourceSymbolKeys[i2];
if (excluded.indexOf(key) >= 0)
continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key))
continue;
target[key] = source[key];
}
}
return target;
}
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null)
return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i2;
for (i2 = 0; i2 < sourceKeys.length; i2++) {
key = sourceKeys[i2];
if (excluded.indexOf(key) >= 0)
continue;
target[key] = source[key];
}
return target;
}
setTwoToneColor(blue.primary);
var Icon = function Icon2(props, context) {
var _classObj;
var _props$context$attrs = _objectSpread$5({}, props, context.attrs), cls = _props$context$attrs["class"], icon = _props$context$attrs.icon, spin = _props$context$attrs.spin, rotate = _props$context$attrs.rotate, tabindex = _props$context$attrs.tabindex, twoToneColor = _props$context$attrs.twoToneColor, onClick = _props$context$attrs.onClick, restProps = _objectWithoutProperties(_props$context$attrs, _excluded);
var _useInjectIconContext = useInjectIconContext(), prefixCls = _useInjectIconContext.prefixCls, rootClassName = _useInjectIconContext.rootClassName;
var classObj = (_classObj = {}, _defineProperty$6(_classObj, rootClassName.value, !!rootClassName.value), _defineProperty$6(_classObj, prefixCls.value, true), _defineProperty$6(_classObj, "".concat(prefixCls.value, "-").concat(icon.name), Boolean(icon.name)), _defineProperty$6(_classObj, "".concat(prefixCls.value, "-spin"), !!spin || icon.name === "loading"), _classObj);
var iconTabIndex = tabindex;
if (iconTabIndex === void 0 && onClick) {
iconTabIndex = -1;
}
var svgStyle = rotate ? {
msTransform: "rotate(".concat(rotate, "deg)"),
transform: "rotate(".concat(rotate, "deg)")
} : void 0;
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor), _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2), primaryColor = _normalizeTwoToneColo2[0], secondaryColor = _normalizeTwoToneColo2[1];
return createVNode("span", _objectSpread$5({
"role": "img",
"aria-label": icon.name
}, restProps, {
"onClick": onClick,
"class": [classObj, cls],
"tabindex": iconTabIndex
}), [createVNode(VueIcon, {
"icon": icon,
"primaryColor": primaryColor,
"secondaryColor": secondaryColor,
"style": svgStyle
}, null), createVNode(InsertStyles, null, null)]);
};
Icon.props = {
spin: Boolean,
rotate: Number,
icon: Object,
twoToneColor: [String, Array]
};
Icon.displayName = "AntdIcon";
Icon.inheritAttrs = false;
Icon.getTwoToneColor = getTwoToneColor;
Icon.setTwoToneColor = setTwoToneColor;
const AntdIcon = Icon;
function _objectSpread$4(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$5(target, key, source[key]);
});
}
return target;
}
function _defineProperty$5(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var LoadingOutlined = function LoadingOutlined2(props, context) {
var p = _objectSpread$4({}, props, context.attrs);
return createVNode(AntdIcon, _objectSpread$4({}, p, {
"icon": LoadingOutlinedSvg
}), null);
};
LoadingOutlined.displayName = "LoadingOutlined";
LoadingOutlined.inheritAttrs = false;
const LoadingOutlined$1 = LoadingOutlined;
var CloseCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" } }] }, "name": "close-circle", "theme": "filled" };
const CloseCircleFilledSvg = CloseCircleFilled$2;
function _objectSpread$3(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$4(target, key, source[key]);
});
}
return target;
}
function _defineProperty$4(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var CloseCircleFilled = function CloseCircleFilled2(props, context) {
var p = _objectSpread$3({}, props, context.attrs);
return createVNode(AntdIcon, _objectSpread$3({}, p, {
"icon": CloseCircleFilledSvg
}), null);
};
CloseCircleFilled.displayName = "CloseCircleFilled";
CloseCircleFilled.inheritAttrs = false;
const CloseCircleFilled$1 = CloseCircleFilled;
var CheckCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
const CheckCircleFilledSvg = CheckCircleFilled$2;
function _objectSpread$2(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$3(target, key, source[key]);
});
}
return target;
}
function _defineProperty$3(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var CheckCircleFilled = function CheckCircleFilled2(props, context) {
var p = _objectSpread$2({}, props, context.attrs);
return createVNode(AntdIcon, _objectSpread$2({}, p, {
"icon": CheckCircleFilledSvg
}), null);
};
CheckCircleFilled.displayName = "CheckCircleFilled";
CheckCircleFilled.inheritAttrs = false;
const CheckCircleFilled$1 = CheckCircleFilled;
var ExclamationCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
const ExclamationCircleFilledSvg = ExclamationCircleFilled$2;
function _objectSpread$1(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty$2(target, key, source[key]);
});
}
return target;
}
function _defineProperty$2(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var ExclamationCircleFilled = function ExclamationCircleFilled2(props, context) {
var p = _objectSpread$1({}, props, context.attrs);
return createVNode(AntdIcon, _objectSpread$1({}, p, {
"icon": ExclamationCircleFilledSvg
}), null);
};
ExclamationCircleFilled.displayName = "ExclamationCircleFilled";
ExclamationCircleFilled.inheritAttrs = false;
const ExclamationCircleFilled$1 = ExclamationCircleFilled;
function murmur2(str) {
var h2 = 0;
var k2, i2 = 0, len = str.length;
for (; len >= 4; ++i2, len -= 4) {
k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24;
k2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
k2 ^= /* k >>> r: */
k2 >>> 24;
h2 = /* Math.imul(k, m): */
(k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(h2 & 65535) * 1540483477 + ((h2 >>> 16) * 59797 << 16);
}
switch (len) {
case 3:
h2 ^= (str.charCodeAt(i2 + 2) & 255) << 16;
case 2:
h2 ^= (str.charCodeAt(i2 + 1) & 255) << 8;
case 1:
h2 ^= str.charCodeAt(i2) & 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);
}
const SPLIT = "%";
class Entity {
constructor(instanceId) {
this.cache = /* @__PURE__ */ new Map();
this.instanceId = instanceId;
}
get(keys2) {
return this.cache.get(Array.isArray(keys2) ? keys2.join(SPLIT) : keys2) || null;
}
update(keys2, valueFn) {
const path = Array.isArray(keys2) ? keys2.join(SPLIT) : keys2;
const prevValue = this.cache.get(path);
const nextValue = valueFn(prevValue);
if (nextValue === null) {
this.cache.delete(path);
} else {
this.cache.set(path, nextValue);
}
}
}
const CacheEntity = Entity;
const tuple = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args;
};
const withInstall = (comp) => {
const c2 = comp;
c2.install = function(app) {
app.component(c2.displayName || c2.name, comp);
};
return comp;
};
function objectType(defaultVal) {
return {
type: Object,
default: defaultVal
};
}
function booleanType(defaultVal) {
return {
type: Boolean,
default: defaultVal
};
}
function functionType(defaultVal) {
return {
type: Function,
default: defaultVal
};
}
function anyType(defaultVal, required4) {
const type4 = {
validator: () => true,
default: defaultVal
};
return required4 ? type4 : type4;
}
function arrayType(defaultVal) {
return {
type: Array,
default: defaultVal
};
}
function stringType(defaultVal) {
return {
type: String,
default: defaultVal
};
}
function someType(types2, defaultVal) {
return types2 ? {
type: types2,
default: defaultVal
} : anyType(defaultVal);
}
const ATTR_TOKEN = "data-token-hash";
const ATTR_MARK = "data-css-hash";
const ATTR_CACHE_PATH = "data-cache-path";
const CSS_IN_JS_INSTANCE = "__cssinjs_instance__";
function createCache() {
const cssinjsInstanceId = Math.random().toString(12).slice(2);
if (typeof document !== "undefined" && document.head && document.body) {
const styles = document.body.querySelectorAll(`style[${ATTR_MARK}]`) || [];
const {
firstChild
} = document.head;
Array.from(styles).forEach((style) => {
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || cssinjsInstanceId;
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
document.head.insertBefore(style, firstChild);
}
});
const styleHash = {};
Array.from(document.querySelectorAll(`style[${ATTR_MARK}]`)).forEach((style) => {
var _a;
const hash = style.getAttribute(ATTR_MARK);
if (styleHash[hash]) {
if (style[CSS_IN_JS_INSTANCE] === cssinjsInstanceId) {
(_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style);
}
} else {
styleHash[hash] = true;
}
});
}
return new CacheEntity(cssinjsInstanceId);
}
const StyleContextKey = Symbol("StyleContextKey");
const getCache = () => {
var _a, _b, _c;
const instance = getCurrentInstance();
let cache;
if (instance && instance.appContext) {
const globalCache = (_c = (_b = (_a = instance.appContext) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.globalProperties) === null || _c === void 0 ? void 0 : _c.__ANTDV_CSSINJS_CACHE__;
if (globalCache) {
cache = globalCache;
} else {
cache = createCache();
if (instance.appContext.config.globalProperties) {
instance.appContext.config.globalProperties.__ANTDV_CSSINJS_CACHE__ = cache;
}
}
} else {
cache = createCache();
}
return cache;
};
const defaultStyleContext = {
cache: createCache(),
defaultCache: true,
hashPriority: "low"
};
const useStyleInject = () => {
const cache = getCache();
return inject(StyleContextKey, shallowRef(_extends$1(_extends$1({}, defaultStyleContext), {
cache
})));
};
const useStyleProvider = (props) => {
const parentContext = useStyleInject();
const context = shallowRef(_extends$1(_extends$1({}, defaultStyleContext), {
cache: createCache()
}));
watch([() => unref(props), parentContext], () => {
const mergedContext = _extends$1({}, parentContext.value);
const propsValue = unref(props);
Object.keys(propsValue).forEach((key) => {
const value = propsValue[key];
if (propsValue[key] !== void 0) {
mergedContext[key] = value;
}
});
const {
cache
} = propsValue;
mergedContext.cache = mergedContext.cache || createCache();
mergedContext.defaultCache = !cache && parentContext.value.defaultCache;
context.value = mergedContext;
}, {
immediate: true
});
provide(StyleContextKey, context);
return context;
};
const styleProviderProps = () => ({
autoClear: booleanType(),
/** @private Test only. Not work in production. */
mock: stringType(),
/**
* Only set when you need ssr to extract style on you own.
* If not provided, it will auto create <style /> on the end of Provider in server side.
*/
cache: objectType(),
/** Tell children that this context is default generated context */
defaultCache: booleanType(),
/** Use `:where` selector to reduce hashId css selector priority */
hashPriority: stringType(),
/** Tell cssinjs where to inject style in */
container: someType(),
/** Component wil render inline `<style />` for fallback in SSR. Not recommend. */
ssrInline: booleanType(),
/** Transform css before inject in document. Please note that `transformers` do not support dynamic update */
transformers: arrayType(),
/**
* Linters to lint css before inject in document.
* Styles will be linted after transforming.
* Please note that `linters` do not support dynamic update.
*/
linters: arrayType()
});
withInstall(defineComponent({
name: "AStyleProvider",
inheritAttrs: false,
props: styleProviderProps(),
setup(props, _ref) {
let {
slots
} = _ref;
useStyleProvider(props);
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
}));
function useProdHMR() {
return false;
}
let webpackHMR = false;
function useDevHMR() {
return webpackHMR;
}
const useHMR = process.env.NODE_ENV === "production" ? useProdHMR : useDevHMR;
if (process.env.NODE_ENV !== "production" && typeof module !== "undefined" && module && module.hot && typeof window !== "undefined") {
const win = window;
if (typeof win.webpackHotUpdate === "function") {
const originWebpackHotUpdate = win.webpackHotUpdate;
win.webpackHotUpdate = function() {
webpackHMR = true;
setTimeout(() => {
webpackHMR = false;
}, 0);
return originWebpackHotUpdate(...arguments);
};
}
}
function useClientCache(prefix, keyPath, cacheFn, onCacheRemove) {
const styleContext = useStyleInject();
const fullPathStr = shallowRef("");
const res = shallowRef();
watchEffect(() => {
fullPathStr.value = [prefix, ...keyPath.value].join("%");
});
const HMRUpdate = useHMR();
const clearCache = (pathStr) => {
styleContext.value.cache.update(pathStr, (prevCache) => {
const [times = 0, cache] = prevCache || [];
const nextCount = times - 1;
if (nextCount === 0) {
onCacheRemove === null || onCacheRemove === void 0 ? void 0 : onCacheRemove(cache, false);
return null;
}
return [times - 1, cache];
});
};
watch(fullPathStr, (newStr, oldStr) => {
if (oldStr)
clearCache(oldStr);
styleContext.value.cache.update(newStr, (prevCache) => {
const [times = 0, cache] = prevCache || [];
let tmpCache = cache;
if (process.env.NODE_ENV !== "production" && cache && HMRUpdate) {
onCacheRemove === null || onCacheRemove === void 0 ? void 0 : onCacheRemove(tmpCache, HMRUpdate);
tmpCache = null;
}
const mergedCache = tmpCache || cacheFn();
return [times + 1, mergedCache];
});
res.value = styleContext.value.cache.get(fullPathStr.value)[1];
}, {
immediate: true
});
onBeforeUnmount(() => {
clearCache(fullPathStr.value);
});
return res;
}
function canUseDom() {
return !!(typeof window !== "undefined" && window.document && window.document.createElement);
}
function contains(root2, n2) {
if (!root2) {
return false;
}
if (root2.contains) {
return root2.contains(n2);
}
return false;
}
const APPEND_ORDER = "data-vc-order";
const MARK_KEY = `vc-util-key`;
const containerCache = /* @__PURE__ */ new Map();
function getMark() {
let {
mark
} = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (mark) {
return mark.startsWith("data-") ? mark : `data-${mark}`;
}
return MARK_KEY;
}
function getContainer(option) {
if (option.attachTo) {
return option.attachTo;
}
const head = document.querySelector("head");
return head || document.body;
}
function getOrder(prepend) {
if (prepend === "queue") {
return "prependQueue";
}
return prepend ? "prepend" : "append";
}
function findStyles(container) {
return Array.from((containerCache.get(container) || container).children).filter((node2) => node2.tagName === "STYLE");
}
function injectCSS(css2) {
let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (!canUseDom()) {
return null;
}
const {
csp,
prepend
} = option;
const styleNode = document.createElement("style");
styleNode.setAttribute(APPEND_ORDER, getOrder(prepend));
if (csp === null || csp === void 0 ? void 0 : csp.nonce) {
styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
}
styleNode.innerHTML = css2;
const container = getContainer(option);
const {
firstChild
} = container;
if (prepend) {
if (prepend === "queue") {
const existStyle = findStyles(container).filter((node2) => ["prepend", "prependQueue"].includes(node2.getAttribute(APPEND_ORDER)));
if (existStyle.length) {
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
return styleNode;
}
}
container.insertBefore(styleNode, firstChild);
} else {
container.appendChild(styleNode);
}
return styleNode;
}
function findExistNode(key) {
let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const container = getContainer(option);
return findStyles(container).find((node2) => node2.getAttribute(getMark(option)) === key);
}
function removeCSS(key) {
let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const existNode = findExistNode(key, option);
if (existNode) {
const container = getContainer(option);
container.removeChild(existNode);
}
}
function syncRealContainer(container, option) {
const cachedRealContainer = containerCache.get(container);
if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
const placeholderStyle = injectCSS("", option);
const {
parentNode
} = placeholderStyle;
containerCache.set(container, parentNode);
container.removeChild(placeholderStyle);
}
}
function updateCSS(css2, key) {
let option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var _a, _b, _c;
const container = getContainer(option);
syncRealContainer(container, option);
const existNode = findExistNode(key, option);
if (existNode) {
if (((_a = option.csp) === null || _a === void 0 ? void 0 : _a.nonce) && existNode.nonce !== ((_b = option.csp) === null || _b === void 0 ? void 0 : _b.nonce)) {
existNode.nonce = (_c = option.csp) === null || _c === void 0 ? void 0 : _c.nonce;
}
if (existNode.innerHTML !== css2) {
existNode.innerHTML = css2;
}
return existNode;
}
const newNode = injectCSS(css2, option);
newNode.setAttribute(getMark(option), key);
return newNode;
}
function sameDerivativeOption(left, right) {
if (left.length !== right.length) {
return false;
}
for (let i2 = 0; i2 < left.length; i2++) {
if (left[i2] !== right[i2]) {
return false;
}
}
return true;
}
class ThemeCache {
constructor() {
this.cache = /* @__PURE__ */ new Map();
this.keys = [];
this.cacheCallTimes = 0;
}
size() {
return this.keys.length;
}
internalGet(derivativeOption) {
let updateCallTimes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
let cache = {
map: this.cache
};
derivativeOption.forEach((derivative2) => {
var _a;
if (!cache) {
cache = void 0;
} else {
cache = (_a = cache === null || cache === void 0 ? void 0 : cache.map) === null || _a === void 0 ? void 0 : _a.get(derivative2);
}
});
if ((cache === null || cache === void 0 ? void 0 : cache.value) && updateCallTimes) {
cache.value[1] = this.cacheCallTimes++;
}
return cache === null || cache === void 0 ? void 0 : cache.value;
}
get(derivativeOption) {
var _a;
return (_a = this.internalGet(derivativeOption, true)) === null || _a === void 0 ? void 0 : _a[0];
}
has(derivativeOption) {
return !!this.internalGet(derivativeOption);
}
set(derivativeOption, value) {
if (!this.has(derivativeOption)) {
if (this.size() + 1 > ThemeCache.MAX_CACHE_SIZE + ThemeCache.MAX_CACHE_OFFSET) {
const [targetKey] = this.keys.reduce((result, key) => {
const [, callTimes] = result;
if (this.internalGet(key)[1] < callTimes) {
return [key, this.internalGet(key)[1]];
}
return result;
}, [this.keys[0], this.cacheCallTimes]);
this.delete(targetKey);
}
this.keys.push(derivativeOption);
}
let cache = this.cache;
derivativeOption.forEach((derivative2, index2) => {
if (index2 === derivativeOption.length - 1) {
cache.set(derivative2, {
value: [value, this.cacheCallTimes++]
});
} else {
const cacheValue = cache.get(derivative2);
if (!cacheValue) {
cache.set(derivative2, {
map: /* @__PURE__ */ new Map()
});
} else if (!cacheValue.map) {
cacheValue.map = /* @__PURE__ */ new Map();
}
cache = cache.get(derivative2).map;
}
});
}
deleteByPath(currentCache, derivatives) {
var _a;
const cache = currentCache.get(derivatives[0]);
if (derivatives.length === 1) {
if (!cache.map) {
currentCache.delete(derivatives[0]);
} else {
currentCache.set(derivatives[0], {
map: cache.map
});
}
return (_a = cache.value) === null || _a === void 0 ? void 0 : _a[0];
}
const result = this.deleteByPath(cache.map, derivatives.slice(1));
if ((!cache.map || cache.map.size === 0) && !cache.value) {
currentCache.delete(derivatives[0]);
}
return result;
}
delete(derivativeOption) {
if (this.has(derivativeOption)) {
this.keys = this.keys.filter((item) => !sameDerivativeOption(item, derivativeOption));
return this.deleteByPath(this.cache, derivativeOption);
}
return void 0;
}
}
ThemeCache.MAX_CACHE_SIZE = 20;
ThemeCache.MAX_CACHE_OFFSET = 5;
let uuid$1 = 0;
class Theme {
constructor(derivatives) {
this.derivatives = Array.isArray(derivatives) ? derivatives : [derivatives];
this.id = uuid$1;
if (derivatives.length === 0) {
warning$3(derivatives.length > 0, "[Ant Design Vue CSS-in-JS] Theme should have at least one derivative function.");
}
uuid$1 += 1;
}
getDerivativeToken(token2) {
return this.derivatives.reduce((result, derivative2) => derivative2(token2, result), void 0);
}
}
const cacheThemes = new ThemeCache();
function createTheme(derivatives) {
const derivativeArr = Array.isArray(derivatives) ? derivatives : [derivatives];
if (!cacheThemes.has(derivativeArr)) {
cacheThemes.set(derivativeArr, new Theme(derivativeArr));
}
return cacheThemes.get(derivativeArr);
}
const flattenTokenCache = /* @__PURE__ */ new WeakMap();
function flattenToken(token2) {
let str = flattenTokenCache.get(token2) || "";
if (!str) {
Object.keys(token2).forEach((key) => {
const value = token2[key];
str += key;
if (value instanceof Theme) {
str += value.id;
} else if (value && typeof value === "object") {
str += flattenToken(value);
} else {
str += value;
}
});
flattenTokenCache.set(token2, str);
}
return str;
}
function token2key(token2, salt) {
return murmur2(`${salt}_${flattenToken(token2)}`);
}
const randomSelectorKey = `random-${Date.now()}-${Math.random()}`.replace(/\./g, "");
const checkContent = "_bAmBoO_";
function supportSelector(styleStr, handleElement, supportCheck) {
var _a, _b;
if (canUseDom()) {
updateCSS(styleStr, randomSelectorKey);
const ele = document.createElement("div");
ele.style.position = "fixed";
ele.style.left = "0";
ele.style.top = "0";
handleElement === null || handleElement === void 0 ? void 0 : handleElement(ele);
document.body.appendChild(ele);
if (process.env.NODE_ENV !== "production") {
ele.innerHTML = "Test";
ele.style.zIndex = "9999999";
}
const support = supportCheck ? supportCheck(ele) : (_a = getComputedStyle(ele).content) === null || _a === void 0 ? void 0 : _a.includes(checkContent);
(_b = ele.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(ele);
removeCSS(randomSelectorKey);
return support;
}
return false;
}
let canLayer = void 0;
function supportLayer() {
if (canLayer === void 0) {
canLayer = supportSelector(`@layer ${randomSelectorKey} { .${randomSelectorKey} { content: "${checkContent}"!important; } }`, (ele) => {
ele.className = randomSelectorKey;
});
}
return canLayer;
}
const EMPTY_OVERRIDE = {};
const isProduction = process.env.NODE_ENV === "production";
const isPrerender = process.env.NODE_ENV === "prerender";
const hashPrefix = !isProduction && !isPrerender ? "css-dev-only-do-not-override" : "css";
const tokenKeys = /* @__PURE__ */ new Map();
function recordCleanToken(tokenKey) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) + 1);
}
function removeStyleTags(key, instanceId) {
if (typeof document !== "undefined") {
const styles = document.querySelectorAll(`style[${ATTR_TOKEN}="${key}"]`);
styles.forEach((style) => {
var _a;
if (style[CSS_IN_JS_INSTANCE] === instanceId) {
(_a = style.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(style);
}
});
}
}
const TOKEN_THRESHOLD = 0;
function cleanTokenStyle(tokenKey, instanceId) {
tokenKeys.set(tokenKey, (tokenKeys.get(tokenKey) || 0) - 1);
const tokenKeyList = Array.from(tokenKeys.keys());
const cleanableKeyList = tokenKeyList.filter((key) => {
const count = tokenKeys.get(key) || 0;
return count <= 0;
});
if (tokenKeyList.length - cleanableKeyList.length > TOKEN_THRESHOLD) {
cleanableKeyList.forEach((key) => {
removeStyleTags(key, instanceId);
tokenKeys.delete(key);
});
}
}
const getComputedToken = (originToken, overrideToken, theme, format2) => {
const derivativeToken = theme.getDerivativeToken(originToken);
let mergedDerivativeToken = _extends$1(_extends$1({}, derivativeToken), overrideToken);
if (format2) {
mergedDerivativeToken = format2(mergedDerivativeToken);
}
return mergedDerivativeToken;
};
function useCacheToken(theme, tokens) {
let option = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ref({});
const style = useStyleInject();
const mergedToken = computed(() => _extends$1({}, ...tokens.value));
const tokenStr = computed(() => flattenToken(mergedToken.value));
const overrideTokenStr = computed(() => flattenToken(option.value.override || EMPTY_OVERRIDE));
const cachedToken = useClientCache("token", computed(() => [option.value.salt || "", theme.value.id, tokenStr.value, overrideTokenStr.value]), () => {
const {
salt = "",
override = EMPTY_OVERRIDE,
formatToken: formatToken2,
getComputedToken: compute
} = option.value;
const mergedDerivativeToken = compute ? compute(mergedToken.value, override, theme.value) : getComputedToken(mergedToken.value, override, theme.value, formatToken2);
const tokenKey = token2key(mergedDerivativeToken, salt);
mergedDerivativeToken._tokenKey = tokenKey;
recordCleanToken(tokenKey);
const hashId = `${hashPrefix}-${murmur2(tokenKey)}`;
mergedDerivativeToken._hashId = hashId;
return [mergedDerivativeToken, hashId];
}, (cache) => {
var _a;
cleanTokenStyle(cache[0]._tokenKey, (_a = style.value) === null || _a === void 0 ? void 0 : _a.cache.instanceId);
});
return cachedToken;
}
var unitlessKeys = {
animationIterationCount: 1,
aspectRatio: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
var COMMENT = "comm";
var RULESET = "rule";
var DECLARATION = "decl";
var IMPORT = "@import";
var KEYFRAMES = "@keyframes";
var LAYER = "@layer";
var abs = Math.abs;
var from = String.fromCharCode;
function trim(value) {
return value.trim();
}
function replace(value, pattern4, replacement) {
return value.replace(pattern4, replacement);
}
function indexof(value, search) {
return value.indexOf(search);
}
function charat(value, index2) {
return value.charCodeAt(index2) | 0;
}
function substr(value, begin, end) {
return value.slice(begin, end);
}
function strlen(value) {
return value.length;
}
function sizeof(value) {
return value.length;
}
function append(value, array4) {
return array4.push(value), value;
}
var line = 1;
var column = 1;
var length = 0;
var position = 0;
var character = 0;
var characters = "";
function node(value, root2, parent2, type4, props, children, length2, siblings) {
return { value, root: root2, parent: parent2, type: type4, props, children, line, column, length: length2, return: "", siblings };
}
function char() {
return character;
}
function prev() {
character = position > 0 ? charat(characters, --position) : 0;
if (column--, character === 10)
column = 1, line--;
return character;
}
function next() {
character = position < length ? charat(characters, position++) : 0;
if (column++, character === 10)
column = 1, line++;
return character;
}
function peek() {
return charat(characters, position);
}
function caret() {
return position;
}
function slice(begin, end) {
return substr(characters, begin, end);
}
function token(type4) {
switch (type4) {
case 0:
case 9:
case 10:
case 13:
case 32:
return 5;
case 33:
case 43:
case 44:
case 47:
case 62:
case 64:
case 126:
case 59:
case 123:
case 125:
return 4;
case 58:
return 3;
case 34:
case 39:
case 40:
case 91:
return 2;
case 41:
case 93:
return 1;
}
return 0;
}
function alloc(value) {
return line = column = 1, length = strlen(characters = value), position = 0, [];
}
function dealloc(value) {
return characters = "", value;
}
function delimit(type4) {
return trim(slice(position - 1, delimiter(type4 === 91 ? type4 + 2 : type4 === 40 ? type4 + 1 : type4)));
}
function whitespace$1(type4) {
while (character = peek())
if (character < 33)
next();
else
break;
return token(type4) > 2 || token(character) > 3 ? "" : " ";
}
function escaping(index2, count) {
while (--count && next())
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
break;
return slice(index2, caret() + (count < 6 && peek() == 32 && next() == 32));
}
function delimiter(type4) {
while (next())
switch (character) {
case type4:
return position;
case 34:
case 39:
if (type4 !== 34 && type4 !== 39)
delimiter(character);
break;
case 40:
if (type4 === 41)
delimiter(type4);
break;
case 92:
next();
break;
}
return position;
}
function commenter(type4, index2) {
while (next())
if (type4 + character === 47 + 10)
break;
else if (type4 + character === 42 + 42 && peek() === 47)
break;
return "/*" + slice(index2, position - 1) + "*" + from(type4 === 47 ? type4 : next());
}
function identifier(index2) {
while (!token(peek()))
next();
return slice(index2, position);
}
function compile(value) {
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
}
function parse(value, root2, parent2, rule, rules2, rulesets, pseudo, points, declarations) {
var index2 = 0;
var offset2 = 0;
var length2 = pseudo;
var atrule = 0;
var property2 = 0;
var previous = 0;
var variable = 1;
var scanning = 1;
var ampersand = 1;
var character2 = 0;
var type4 = "";
var props = rules2;
var children = rulesets;
var reference = rule;
var characters2 = type4;
while (scanning)
switch (previous = character2, character2 = next()) {
case 40:
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
ampersand = -1;
break;
}
case 34:
case 39:
case 91:
characters2 += delimit(character2);
break;
case 9:
case 10:
case 13:
case 32:
characters2 += whitespace$1(previous);
break;
case 92:
characters2 += escaping(caret() - 1, 7);
continue;
case 47:
switch (peek()) {
case 42:
case 47:
append(comment(commenter(next(), caret()), root2, parent2, declarations), declarations);
break;
default:
characters2 += "/";
}
break;
case 123 * variable:
points[index2++] = strlen(characters2) * ampersand;
case 125 * variable:
case 59:
case 0:
switch (character2) {
case 0:
case 125:
scanning = 0;
case 59 + offset2:
if (ampersand == -1)
characters2 = replace(characters2, /\f/g, "");
if (property2 > 0 && strlen(characters2) - length2)
append(property2 > 32 ? declaration(characters2 + ";", rule, parent2, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent2, length2 - 2, declarations), declarations);
break;
case 59:
characters2 += ";";
default:
append(reference = ruleset(characters2, root2, parent2, index2, offset2, rules2, points, type4, props = [], children = [], length2, rulesets), rulesets);
if (character2 === 123)
if (offset2 === 0)
parse(characters2, root2, reference, reference, props, rulesets, length2, points, children);
else
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
case 100:
case 108:
case 109:
case 115:
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules2, points, type4, rules2, props = [], length2, children), children), rules2, children, length2, points, rule ? props : children);
break;
default:
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
}
}
index2 = offset2 = property2 = 0, variable = ampersand = 1, type4 = characters2 = "", length2 = pseudo;
break;
case 58:
length2 = 1 + strlen(characters2), property2 = previous;
default:
if (variable < 1) {
if (character2 == 123)
--variable;
else if (character2 == 125 && variable++ == 0 && prev() == 125)
continue;
}
switch (characters2 += from(character2), character2 * variable) {
case 38:
ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1);
break;
case 44:
points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
break;
case 64:
if (peek() === 45)
characters2 += delimit(next());
atrule = peek(), offset2 = length2 = strlen(type4 = characters2 += identifier(caret())), character2++;
break;
case 45:
if (previous === 45 && strlen(characters2) == 2)
variable = 0;
}
}
return rulesets;
}
function ruleset(value, root2, parent2, index2, offset2, rules2, points, type4, props, children, length2, siblings) {
var post = offset2 - 1;
var rule = offset2 === 0 ? rules2 : [""];
var size = sizeof(rule);
for (var i2 = 0, j2 = 0, k2 = 0; i2 < index2; ++i2)
for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i2])), z2 = value; x2 < size; ++x2)
if (z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
props[k2++] = z2;
return node(value, root2, parent2, offset2 === 0 ? RULESET : type4, props, children, length2, siblings);
}
function comment(value, root2, parent2, siblings) {
return node(value, root2, parent2, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
}
function declaration(value, root2, parent2, length2, siblings) {
return node(value, root2, parent2, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings);
}
function serialize(children, callback) {
var output = "";
for (var i2 = 0; i2 < children.length; i2++)
output += callback(children[i2], i2, children, callback) || "";
return output;
}
function stringify(element, index2, children, callback) {
switch (element.type) {
case LAYER:
if (element.children.length)
break;
case IMPORT:
case DECLARATION:
return element.return = element.return || element.value;
case COMMENT:
return "";
case KEYFRAMES:
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
case RULESET:
if (!strlen(element.value = element.props.join(",")))
return "";
}
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
}
function lintWarning(message, info) {
const {
path,
parentSelectors
} = info;
warningOnce(false, `[Ant Design Vue CSS-in-JS] ${path ? `Error in '${path}': ` : ""}${message}${parentSelectors.length ? ` Selector info: ${parentSelectors.join(" -> ")}` : ""}`);
}
const linter$1 = (key, value, info) => {
if (key === "content") {
const contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
const contentValues = ["normal", "none", "initial", "inherit", "unset"];
if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
lintWarning(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${value}"'\`.`, info);
}
}
};
const contentQuotesLinter = linter$1;
const linter = (key, value, info) => {
if (key === "animation") {
if (info.hashId && value !== "none") {
lintWarning(`You seem to be using hashed animation '${value}', in which case 'animationName' with Keyframe as value is recommended.`, info);
}
}
};
const hashedAnimationLinter = linter;
const ATTR_CACHE_MAP = "data-ant-cssinjs-cache-path";
const CSS_FILE_STYLE = "_FILE_STYLE__";
let cachePathMap;
let fromCSSFile = true;
function prepare() {
var _a;
if (!cachePathMap) {
cachePathMap = {};
if (canUseDom()) {
const div = document.createElement("div");
div.className = ATTR_CACHE_MAP;
div.style.position = "fixed";
div.style.visibility = "hidden";
div.style.top = "-9999px";
document.body.appendChild(div);
let content = getComputedStyle(div).content || "";
content = content.replace(/^"/, "").replace(/"$/, "");
content.split(";").forEach((item) => {
const [path, hash] = item.split(":");
cachePathMap[path] = hash;
});
const inlineMapStyle = document.querySelector(`style[${ATTR_CACHE_MAP}]`);
if (inlineMapStyle) {
fromCSSFile = false;
(_a = inlineMapStyle.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(inlineMapStyle);
}
document.body.removeChild(div);
}
}
}
function existPath(path) {
prepare();
return !!cachePathMap[path];
}
function getStyleAndHash(path) {
const hash = cachePathMap[path];
let styleStr = null;
if (hash && canUseDom()) {
if (fromCSSFile) {
styleStr = CSS_FILE_STYLE;
} else {
const style = document.querySelector(`style[${ATTR_MARK}="${cachePathMap[path]}"]`);
if (style) {
styleStr = style.innerHTML;
} else {
delete cachePathMap[path];
}
}
}
return [styleStr, hash];
}
const isClientSide = canUseDom();
const SKIP_CHECK = "_skip_check_";
const MULTI_VALUE = "_multi_value_";
function normalizeStyle(styleStr) {
const serialized = serialize(compile(styleStr), stringify);
return serialized.replace(/\{%%%\:[^;];}/g, ";");
}
function isCompoundCSSProperty(value) {
return typeof value === "object" && value && (SKIP_CHECK in value || MULTI_VALUE in value);
}
function injectSelectorHash(key, hashId, hashPriority) {
if (!hashId) {
return key;
}
const hashClassName = `.${hashId}`;
const hashSelector = hashPriority === "low" ? `:where(${hashClassName})` : hashClassName;
const keys2 = key.split(",").map((k2) => {
var _a;
const fullPath = k2.trim().split(/\s+/);
let firstPath = fullPath[0] || "";
const htmlElement = ((_a = firstPath.match(/^\w+/)) === null || _a === void 0 ? void 0 : _a[0]) || "";
firstPath = `${htmlElement}${hashSelector}${firstPath.slice(htmlElement.length)}`;
return [firstPath, ...fullPath.slice(1)].join(" ");
});
return keys2.join(",");
}
const globalEffectStyleKeys = /* @__PURE__ */ new Set();
process.env.NODE_ENV !== "production" ? () => globalEffectStyleKeys.clear() : void 0;
const parseStyle = function(interpolation) {
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let {
root: root2,
injectHash,
parentSelectors
} = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
root: true,
parentSelectors: []
};
const {
hashId,
layer,
path,
hashPriority,
transformers = [],
linters = []
} = config;
let styleStr = "";
let effectStyle = {};
function parseKeyframes(keyframes) {
const animationName = keyframes.getName(hashId);
if (!effectStyle[animationName]) {
const [parsedStr] = parseStyle(keyframes.style, config, {
root: false,
parentSelectors
});
effectStyle[animationName] = `@keyframes ${keyframes.getName(hashId)}${parsedStr}`;
}
}
function flattenList(list) {
let fullList = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
list.forEach((item) => {
if (Array.isArray(item)) {
flattenList(item, fullList);
} else if (item) {
fullList.push(item);
}
});
return fullList;
}
const flattenStyleList = flattenList(Array.isArray(interpolation) ? interpolation : [interpolation]);
flattenStyleList.forEach((originStyle) => {
const style = typeof originStyle === "string" && !root2 ? {} : originStyle;
if (typeof style === "string") {
styleStr += `${style}
`;
} else if (style._keyframe) {
parseKeyframes(style);
} else {
const mergedStyle = transformers.reduce((prev2, trans) => {
var _a;
return ((_a = trans === null || trans === void 0 ? void 0 : trans.visit) === null || _a === void 0 ? void 0 : _a.call(trans, prev2)) || prev2;
}, style);
Object.keys(mergedStyle).forEach((key) => {
var _a;
const value = mergedStyle[key];
if (typeof value === "object" && value && (key !== "animationName" || !value._keyframe) && !isCompoundCSSProperty(value)) {
let subInjectHash = false;
let mergedKey = key.trim();
let nextRoot = false;
if ((root2 || injectHash) && hashId) {
if (mergedKey.startsWith("@")) {
subInjectHash = true;
} else {
mergedKey = injectSelectorHash(key, hashId, hashPriority);
}
} else if (root2 && !hashId && (mergedKey === "&" || mergedKey === "")) {
mergedKey = "";
nextRoot = true;
}
const [parsedStr, childEffectStyle] = parseStyle(value, config, {
root: nextRoot,
injectHash: subInjectHash,
parentSelectors: [...parentSelectors, mergedKey]
});
effectStyle = _extends$1(_extends$1({}, effectStyle), childEffectStyle);
styleStr += `${mergedKey}${parsedStr}`;
} else {
let appendStyle = function(cssKey, cssValue) {
if (process.env.NODE_ENV !== "production" && (typeof value !== "object" || !(value === null || value === void 0 ? void 0 : value[SKIP_CHECK]))) {
[contentQuotesLinter, hashedAnimationLinter, ...linters].forEach((linter2) => linter2(cssKey, cssValue, {
path,
hashId,
parentSelectors
}));
}
const styleName = cssKey.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
let formatValue = cssValue;
if (!unitlessKeys[cssKey] && typeof formatValue === "number" && formatValue !== 0) {
formatValue = `${formatValue}px`;
}
if (cssKey === "animationName" && (cssValue === null || cssValue === void 0 ? void 0 : cssValue._keyframe)) {
parseKeyframes(cssValue);
formatValue = cssValue.getName(hashId);
}
styleStr += `${styleName}:${formatValue};`;
};
const actualValue = (_a = value === null || value === void 0 ? void 0 : value.value) !== null && _a !== void 0 ? _a : value;
if (typeof value === "object" && (value === null || value === void 0 ? void 0 : value[MULTI_VALUE]) && Array.isArray(actualValue)) {
actualValue.forEach((item) => {
appendStyle(key, item);
});
} else {
appendStyle(key, actualValue);
}
}
});
}
});
if (!root2) {
styleStr = `{${styleStr}}`;
} else if (layer && supportLayer()) {
const layerCells = layer.split(",");
const layerName = layerCells[layerCells.length - 1].trim();
styleStr = `@layer ${layerName} {${styleStr}}`;
if (layerCells.length > 1) {
styleStr = `@layer ${layer}{%%%:%}${styleStr}`;
}
}
return [styleStr, effectStyle];
};
function uniqueHash(path, styleStr) {
return murmur2(`${path.join("%")}${styleStr}`);
}
function useStyleRegister(info, styleFn) {
const styleContext = useStyleInject();
const tokenKey = computed(() => info.value.token._tokenKey);
const fullPath = computed(() => [tokenKey.value, ...info.value.path]);
let isMergedClientSide = isClientSide;
if (process.env.NODE_ENV !== "production" && styleContext.value.mock !== void 0) {
isMergedClientSide = styleContext.value.mock === "client";
}
useClientCache(
"style",
fullPath,
// Create cache if needed
() => {
const {
path,
hashId,
layer,
nonce,
clientOnly,
order = 0
} = info.value;
const cachePath = fullPath.value.join("|");
if (existPath(cachePath)) {
const [inlineCacheStyleStr, styleHash] = getStyleAndHash(cachePath);
if (inlineCacheStyleStr) {
return [inlineCacheStyleStr, tokenKey.value, styleHash, {}, clientOnly, order];
}
}
const styleObj = styleFn();
const {
hashPriority,
container,
transformers,
linters,
cache
} = styleContext.value;
const [parsedStyle, effectStyle] = parseStyle(styleObj, {
hashId,
hashPriority,
layer,
path: path.join("-"),
transformers,
linters
});
const styleStr = normalizeStyle(parsedStyle);
const styleId = uniqueHash(fullPath.value, styleStr);
if (isMergedClientSide) {
const mergedCSSConfig = {
mark: ATTR_MARK,
prepend: "queue",
attachTo: container,
priority: order
};
const nonceStr = typeof nonce === "function" ? nonce() : nonce;
if (nonceStr) {
mergedCSSConfig.csp = {
nonce: nonceStr
};
}
const style = updateCSS(styleStr, styleId, mergedCSSConfig);
style[CSS_IN_JS_INSTANCE] = cache.instanceId;
style.setAttribute(ATTR_TOKEN, tokenKey.value);
if (process.env.NODE_ENV !== "production") {
style.setAttribute(ATTR_CACHE_PATH, fullPath.value.join("|"));
}
Object.keys(effectStyle).forEach((effectKey) => {
if (!globalEffectStyleKeys.has(effectKey)) {
globalEffectStyleKeys.add(effectKey);
updateCSS(normalizeStyle(effectStyle[effectKey]), `_effect-${effectKey}`, {
mark: ATTR_MARK,
prepend: "queue",
attachTo: container
});
}
});
}
return [styleStr, tokenKey.value, styleId, effectStyle, clientOnly, order];
},
// Remove cache if no need
(_ref, fromHMR) => {
let [, , styleId] = _ref;
if ((fromHMR || styleContext.value.autoClear) && isClientSide) {
removeCSS(styleId, {
mark: ATTR_MARK
});
}
}
);
return (node2) => {
return node2;
};
}
class Keyframe {
constructor(name, style) {
this._keyframe = true;
this.name = name;
this.style = style;
}
getName() {
let hashId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return hashId ? `${hashId}-${this.name}` : this.name;
}
}
const Keyframes = Keyframe;
const version = "4.2.5";
const PresetColors = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
const genControlHeight = (token2) => {
const {
controlHeight
} = token2;
return {
controlHeightSM: controlHeight * 0.75,
controlHeightXS: controlHeight * 0.5,
controlHeightLG: controlHeight * 1.25
};
};
const genControlHeight$1 = genControlHeight;
function genSizeMapToken(token2) {
const {
sizeUnit,
sizeStep
} = token2;
return {
sizeXXL: sizeUnit * (sizeStep + 8),
sizeXL: sizeUnit * (sizeStep + 4),
sizeLG: sizeUnit * (sizeStep + 2),
sizeMD: sizeUnit * (sizeStep + 1),
sizeMS: sizeUnit * sizeStep,
size: sizeUnit * sizeStep,
sizeSM: sizeUnit * (sizeStep - 1),
sizeXS: sizeUnit * (sizeStep - 2),
sizeXXS: sizeUnit * (sizeStep - 3)
// 4
};
}
const defaultPresetColors = {
blue: "#1677ff",
purple: "#722ED1",
cyan: "#13C2C2",
green: "#52C41A",
magenta: "#EB2F96",
pink: "#eb2f96",
red: "#F5222D",
orange: "#FA8C16",
yellow: "#FADB14",
volcano: "#FA541C",
geekblue: "#2F54EB",
gold: "#FAAD14",
lime: "#A0D911"
};
const seedToken = _extends$1(_extends$1({}, defaultPresetColors), {
// Color
colorPrimary: "#1677ff",
colorSuccess: "#52c41a",
colorWarning: "#faad14",
colorError: "#ff4d4f",
colorInfo: "#1677ff",
colorTextBase: "",
colorBgBase: "",
// Font
fontFamily: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,
fontSize: 14,
// Line
lineWidth: 1,
lineType: "solid",
// Motion
motionUnit: 0.1,
motionBase: 0,
motionEaseOutCirc: "cubic-bezier(0.08, 0.82, 0.17, 1)",
motionEaseInOutCirc: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
motionEaseOut: "cubic-bezier(0.215, 0.61, 0.355, 1)",
motionEaseInOut: "cubic-bezier(0.645, 0.045, 0.355, 1)",
motionEaseOutBack: "cubic-bezier(0.12, 0.4, 0.29, 1.46)",
motionEaseInBack: "cubic-bezier(0.71, -0.46, 0.88, 0.6)",
motionEaseInQuint: "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
motionEaseOutQuint: "cubic-bezier(0.23, 1, 0.32, 1)",
// Radius
borderRadius: 6,
// Size
sizeUnit: 4,
sizeStep: 4,
sizePopupArrow: 16,
// Control Base
controlHeight: 32,
// zIndex
zIndexBase: 0,
zIndexPopupBase: 1e3,
// Image
opacityImage: 1,
// Wireframe
wireframe: false
});
const defaultSeedToken = seedToken;
function genColorMapToken(seed, _ref) {
let {
generateColorPalettes: generateColorPalettes2,
generateNeutralColorPalettes: generateNeutralColorPalettes2
} = _ref;
const {
colorSuccess: colorSuccessBase,
colorWarning: colorWarningBase,
colorError: colorErrorBase,
colorInfo: colorInfoBase,
colorPrimary: colorPrimaryBase,
colorBgBase,
colorTextBase
} = seed;
const primaryColors = generateColorPalettes2(colorPrimaryBase);
const successColors = generateColorPalettes2(colorSuccessBase);
const warningColors = generateColorPalettes2(colorWarningBase);
const errorColors = generateColorPalettes2(colorErrorBase);
const infoColors = generateColorPalettes2(colorInfoBase);
const neutralColors = generateNeutralColorPalettes2(colorBgBase, colorTextBase);
return _extends$1(_extends$1({}, neutralColors), {
colorPrimaryBg: primaryColors[1],
colorPrimaryBgHover: primaryColors[2],
colorPrimaryBorder: primaryColors[3],
colorPrimaryBorderHover: primaryColors[4],
colorPrimaryHover: primaryColors[5],
colorPrimary: primaryColors[6],
colorPrimaryActive: primaryColors[7],
colorPrimaryTextHover: primaryColors[8],
colorPrimaryText: primaryColors[9],
colorPrimaryTextActive: primaryColors[10],
colorSuccessBg: successColors[1],
colorSuccessBgHover: successColors[2],
colorSuccessBorder: successColors[3],
colorSuccessBorderHover: successColors[4],
colorSuccessHover: successColors[4],
colorSuccess: successColors[6],
colorSuccessActive: successColors[7],
colorSuccessTextHover: successColors[8],
colorSuccessText: successColors[9],
colorSuccessTextActive: successColors[10],
colorErrorBg: errorColors[1],
colorErrorBgHover: errorColors[2],
colorErrorBorder: errorColors[3],
colorErrorBorderHover: errorColors[4],
colorErrorHover: errorColors[5],
colorError: errorColors[6],
colorErrorActive: errorColors[7],
colorErrorTextHover: errorColors[8],
colorErrorText: errorColors[9],
colorErrorTextActive: errorColors[10],
colorWarningBg: warningColors[1],
colorWarningBgHover: warningColors[2],
colorWarningBorder: warningColors[3],
colorWarningBorderHover: warningColors[4],
colorWarningHover: warningColors[4],
colorWarning: warningColors[6],
colorWarningActive: warningColors[7],
colorWarningTextHover: warningColors[8],
colorWarningText: warningColors[9],
colorWarningTextActive: warningColors[10],
colorInfoBg: infoColors[1],
colorInfoBgHover: infoColors[2],
colorInfoBorder: infoColors[3],
colorInfoBorderHover: infoColors[4],
colorInfoHover: infoColors[4],
colorInfo: infoColors[6],
colorInfoActive: infoColors[7],
colorInfoTextHover: infoColors[8],
colorInfoText: infoColors[9],
colorInfoTextActive: infoColors[10],
colorBgMask: new TinyColor("#000").setAlpha(0.45).toRgbString(),
colorWhite: "#fff"
});
}
const genRadius = (radiusBase) => {
let radiusLG = radiusBase;
let radiusSM = radiusBase;
let radiusXS = radiusBase;
let radiusOuter = radiusBase;
if (radiusBase < 6 && radiusBase >= 5) {
radiusLG = radiusBase + 1;
} else if (radiusBase < 16 && radiusBase >= 6) {
radiusLG = radiusBase + 2;
} else if (radiusBase >= 16) {
radiusLG = 16;
}
if (radiusBase < 7 && radiusBase >= 5) {
radiusSM = 4;
} else if (radiusBase < 8 && radiusBase >= 7) {
radiusSM = 5;
} else if (radiusBase < 14 && radiusBase >= 8) {
radiusSM = 6;
} else if (radiusBase < 16 && radiusBase >= 14) {
radiusSM = 7;
} else if (radiusBase >= 16) {
radiusSM = 8;
}
if (radiusBase < 6 && radiusBase >= 2) {
radiusXS = 1;
} else if (radiusBase >= 6) {
radiusXS = 2;
}
if (radiusBase > 4 && radiusBase < 8) {
radiusOuter = 4;
} else if (radiusBase >= 8) {
radiusOuter = 6;
}
return {
borderRadius: radiusBase > 16 ? 16 : radiusBase,
borderRadiusXS: radiusXS,
borderRadiusSM: radiusSM,
borderRadiusLG: radiusLG,
borderRadiusOuter: radiusOuter
};
};
const genRadius$1 = genRadius;
function genCommonMapToken(token2) {
const {
motionUnit,
motionBase,
borderRadius,
lineWidth
} = token2;
return _extends$1({
// motion
motionDurationFast: `${(motionBase + motionUnit).toFixed(1)}s`,
motionDurationMid: `${(motionBase + motionUnit * 2).toFixed(1)}s`,
motionDurationSlow: `${(motionBase + motionUnit * 3).toFixed(1)}s`,
// line
lineWidthBold: lineWidth + 1
}, genRadius$1(borderRadius));
}
const getAlphaColor$1 = (baseColor, alpha) => new TinyColor(baseColor).setAlpha(alpha).toRgbString();
const getSolidColor = (baseColor, brightness) => {
const instance = new TinyColor(baseColor);
return instance.darken(brightness).toHexString();
};
const generateColorPalettes = (baseColor) => {
const colors = generate$1(baseColor);
return {
1: colors[0],
2: colors[1],
3: colors[2],
4: colors[3],
5: colors[4],
6: colors[5],
7: colors[6],
8: colors[4],
9: colors[5],
10: colors[6]
// 8: colors[7],
// 9: colors[8],
// 10: colors[9],
};
};
const generateNeutralColorPalettes = (bgBaseColor, textBaseColor) => {
const colorBgBase = bgBaseColor || "#fff";
const colorTextBase = textBaseColor || "#000";
return {
colorBgBase,
colorTextBase,
colorText: getAlphaColor$1(colorTextBase, 0.88),
colorTextSecondary: getAlphaColor$1(colorTextBase, 0.65),
colorTextTertiary: getAlphaColor$1(colorTextBase, 0.45),
colorTextQuaternary: getAlphaColor$1(colorTextBase, 0.25),
colorFill: getAlphaColor$1(colorTextBase, 0.15),
colorFillSecondary: getAlphaColor$1(colorTextBase, 0.06),
colorFillTertiary: getAlphaColor$1(colorTextBase, 0.04),
colorFillQuaternary: getAlphaColor$1(colorTextBase, 0.02),
colorBgLayout: getSolidColor(colorBgBase, 4),
colorBgContainer: getSolidColor(colorBgBase, 0),
colorBgElevated: getSolidColor(colorBgBase, 0),
colorBgSpotlight: getAlphaColor$1(colorTextBase, 0.85),
colorBorder: getSolidColor(colorBgBase, 15),
colorBorderSecondary: getSolidColor(colorBgBase, 6)
};
};
function getFontSizes(base) {
const fontSizes = new Array(10).fill(null).map((_2, index2) => {
const i2 = index2 - 1;
const baseSize = base * Math.pow(2.71828, i2 / 5);
const intSize = index2 > 1 ? Math.floor(baseSize) : Math.ceil(baseSize);
return Math.floor(intSize / 2) * 2;
});
fontSizes[1] = base;
return fontSizes.map((size) => {
const height = size + 8;
return {
size,
lineHeight: height / size
};
});
}
const genFontMapToken = (fontSize) => {
const fontSizePairs = getFontSizes(fontSize);
const fontSizes = fontSizePairs.map((pair) => pair.size);
const lineHeights = fontSizePairs.map((pair) => pair.lineHeight);
return {
fontSizeSM: fontSizes[0],
fontSize: fontSizes[1],
fontSizeLG: fontSizes[2],
fontSizeXL: fontSizes[3],
fontSizeHeading1: fontSizes[6],
fontSizeHeading2: fontSizes[5],
fontSizeHeading3: fontSizes[4],
fontSizeHeading4: fontSizes[3],
fontSizeHeading5: fontSizes[2],
lineHeight: lineHeights[1],
lineHeightLG: lineHeights[2],
lineHeightSM: lineHeights[0],
lineHeightHeading1: lineHeights[6],
lineHeightHeading2: lineHeights[5],
lineHeightHeading3: lineHeights[4],
lineHeightHeading4: lineHeights[3],
lineHeightHeading5: lineHeights[2]
};
};
const genFontMapToken$1 = genFontMapToken;
function derivative(token2) {
const colorPalettes = Object.keys(defaultPresetColors).map((colorKey) => {
const colors = generate$1(token2[colorKey]);
return new Array(10).fill(1).reduce((prev2, _2, i2) => {
prev2[`${colorKey}-${i2 + 1}`] = colors[i2];
return prev2;
}, {});
}).reduce((prev2, cur) => {
prev2 = _extends$1(_extends$1({}, prev2), cur);
return prev2;
}, {});
return _extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1(_extends$1({}, token2), colorPalettes), genColorMapToken(token2, {
generateColorPalettes,
generateNeutralColorPalettes
})), genFontMapToken$1(token2.fontSize)), genSizeMapToken(token2)), genControlHeight$1(token2)), genCommonMapToken(token2));
}
function isStableColor(color) {
return color >= 0 && color <= 255;
}
function getAlphaColor(frontColor, backgroundColor) {
const {
r: fR,
g: fG,
b: fB,
a: originAlpha
} = new TinyColor(frontColor).toRgb();
if (originAlpha < 1) {
return frontColor;
}
const {
r: bR,
g: bG,
b: bB
} = new TinyColor(backgroundColor).toRgb();
for (let fA = 0.01; fA <= 1; fA += 0.01) {
const r2 = Math.round((fR - bR * (1 - fA)) / fA);
const g2 = Math.round((fG - bG * (1 - fA)) / fA);
const b2 = Math.round((fB - bB * (1 - fA)) / fA);
if (isStableColor(r2) && isStableColor(g2) && isStableColor(b2)) {
return new TinyColor({
r: r2,
g: g2,
b: b2,
a: Math.round(fA * 100) / 100
}).toRgbString();
}
}
return new TinyColor({
r: fR,
g: fG,
b: fB,
a: 1
}).toRgbString();
}
var __rest$2 = globalThis && globalThis.__rest || function(s2, e2) {
var t2 = {};
for (var p in s2)
if (Object.prototype.hasOwnProperty.call(s2, p) && e2.indexOf(p) < 0)
t2[p] = s2[p];
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
for (var i2 = 0, p = Object.getOwnPropertySymbols(s2); i2 < p.length; i2++) {
if (e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i2]))
t2[p[i2]] = s2[p[i2]];
}
return t2;
};
function formatToken(derivativeToken) {
const {
override
} = derivativeToken, restToken = __rest$2(derivativeToken, ["override"]);
const overrideTokens = _extends$1({}, override);
Object.keys(defaultSeedToken).forEach((token2) => {
delete overrideTokens[token2];
});
const mergedToken = _extends$1(_extends$1({}, restToken), overrideTokens);
const screenXS = 480;
const screenSM = 576;
const screenMD = 768;
const screenLG = 992;
const screenXL = 1200;
const screenXXL = 1600;
const screenXXXL = 2e3;
const aliasToken = _extends$1(_extends$1(_extends$1({}, mergedToken), {
colorLink: mergedToken.colorInfoText,
colorLinkHover: mergedToken.colorInfoHover,
colorLinkActive: mergedToken.colorInfoActive,
// ============== Background ============== //
colorFillContent: mergedToken.colorFillSecondary,
colorFillContentHover: mergedToken.colorFill,
colorFillAlter: mergedToken.colorFillQuaternary,
colorBgContainerDisabled: mergedToken.colorFillTertiary,
// ============== Split ============== //
colorBorderBg: mergedToken.colorBgContainer,
colorSplit: getAlphaColor(mergedToken.colorBorderSecondary, mergedToken.colorBgContainer),
// ============== Text ============== //
colorTextPlaceholder: mergedToken.colorTextQuaternary,
colorTextDisabled: mergedToken.colorTextQuaternary,
colorTextHeading: mergedToken.colorText,
colorTextLabel: mergedToken.colorTextSecondary,
colorTextDescription: mergedToken.colorTextTertiary,
colorTextLightSolid: mergedToken.colorWhite,
colorHighlight: mergedToken.colorError,
colorBgTextHover: mergedToken.colorFillSecondary,
colorBgTextActive: mergedToken.colorFill,
colorIcon: mergedToken.colorTextTertiary,
colorIconHover: mergedToken.colorText,
colorErrorOutline: getAlphaColor(mergedToken.colorErrorBg, mergedToken.colorBgContainer),
colorWarningOutline: getAlphaColor(mergedToken.colorWarningBg, mergedToken.colorBgContainer),
// Font
fontSizeIcon: mergedToken.fontSizeSM,
// Control
lineWidth: mergedToken.lineWidth,
controlOutlineWidth: mergedToken.lineWidth * 2,
// Checkbox size and expand icon size
controlInteractiveSize: mergedToken.controlHeight / 2,
controlItemBgHover: mergedToken.colorFillTertiary,
controlItemBgActive: mergedToken.colorPrimaryBg,
controlItemBgActiveHover: mergedToken.colorPrimaryBgHover,
controlItemBgActiveDisabled: mergedToken.colorFill,
controlTmpOutline: mergedToken.colorFillQuaternary,
controlOutline: getAlphaColor(mergedToken.colorPrimaryBg, mergedToken.colorBgContainer),
lineType: mergedToken.lineType,
borderRadius: mergedToken.borderRadius,
borderRadiusXS: mergedToken.borderRadiusXS,
borderRadiusSM: mergedToken.borderRadiusSM,
borderRadiusLG: mergedToken.borderRadiusLG,
fontWeightStrong: 600,
opacityLoading: 0.65,
linkDecoration: "none",
linkHoverDecoration: "none",
linkFocusDecoration: "none",
controlPaddingHorizontal: 12,
controlPaddingHorizontalSM: 8,
paddingXXS: mergedToken.sizeXXS,
paddingXS: mergedToken.sizeXS,
paddingSM: mergedToken.sizeSM,
padding: mergedToken.size,
paddingMD: mergedToken.sizeMD,
paddingLG: mergedToken.sizeLG,
paddingXL: mergedToken.sizeXL,
paddingContentHorizontalLG: mergedToken.sizeLG,
paddingContentVerticalLG: mergedToken.sizeMS,
paddingContentHorizontal: mergedToken.sizeMS,
paddingContentVertical: mergedToken.sizeSM,
paddingContentHorizontalSM: mergedToken.size,
paddingContentVerticalSM: mergedToken.sizeXS,
marginXXS: mergedToken.sizeXXS,
marginXS: mergedToken.sizeXS,
marginSM: mergedToken.sizeSM,
margin: mergedToken.size,
marginMD: mergedToken.sizeMD,
marginLG: mergedToken.sizeLG,
marginXL: mergedToken.sizeXL,
marginXXL: mergedToken.sizeXXL,
boxShadow: `
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,
boxShadowSecondary: `
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowTertiary: `
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,
screenXS,
screenXSMin: screenXS,
screenXSMax: screenSM - 1,
screenSM,
screenSMMin: screenSM,
screenSMMax: screenMD - 1,
screenMD,
screenMDMin: screenMD,
screenMDMax: screenLG - 1,
screenLG,
screenLGMin: screenLG,
screenLGMax: screenXL - 1,
screenXL,
screenXLMin: screenXL,
screenXLMax: screenXXL - 1,
screenXXL,
screenXXLMin: screenXXL,
screenXXLMax: screenXXXL - 1,
screenXXXL,
screenXXXLMin: screenXXXL,
// FIXME: component box-shadow, should be removed
boxShadowPopoverArrow: "3px 3px 7px rgba(0, 0, 0, 0.1)",
boxShadowCard: `
0 1px 2px -2px ${new TinyColor("rgba(0, 0, 0, 0.16)").toRgbString()},
0 3px 6px 0 ${new TinyColor("rgba(0, 0, 0, 0.12)").toRgbString()},
0 5px 12px 4px ${new TinyColor("rgba(0, 0, 0, 0.09)").toRgbString()}
`,
boxShadowDrawerRight: `
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerLeft: `
6px 0 16px 0 rgba(0, 0, 0, 0.08),
3px 0 6px -4px rgba(0, 0, 0, 0.12),
9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerUp: `
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowDrawerDown: `
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
`,
boxShadowTabsOverflowLeft: "inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowRight: "inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowTop: "inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",
boxShadowTabsOverflowBottom: "inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"
}), overrideTokens);
return aliasToken;
}
const roundedArrow = (width, innerRadius, outerRadius, bgColor, boxShadow) => {
const unitWidth = width / 2;
const ax = 0;
const ay = unitWidth;
const bx = outerRadius * 1 / Math.sqrt(2);
const by = unitWidth - outerRadius * (1 - 1 / Math.sqrt(2));
const cx = unitWidth - innerRadius * (1 / Math.sqrt(2));
const cy = outerRadius * (Math.sqrt(2) - 1) + innerRadius * (1 / Math.sqrt(2));
const dx = 2 * unitWidth - cx;
const dy = cy;
const ex = 2 * unitWidth - bx;
const ey = by;
const fx = 2 * unitWidth - ax;
const fy = ay;
const shadowWidth = unitWidth * Math.sqrt(2) + outerRadius * (Math.sqrt(2) - 2);
const polygonOffset = outerRadius * (Math.sqrt(2) - 1);
return {
pointerEvents: "none",
width,
height: width,
overflow: "hidden",
"&::after": {
content: '""',
position: "absolute",
width: shadowWidth,
height: shadowWidth,
bottom: 0,
insetInline: 0,
margin: "auto",
borderRadius: {
_skip_check_: true,
value: `0 0 ${innerRadius}px 0`
},
transform: "translateY(50%) rotate(-135deg)",
boxShadow,
zIndex: 0,
background: "transparent"
},
"&::before": {
position: "absolute",
bottom: 0,
insetInlineStart: 0,
width,
height: width / 2,
background: bgColor,
clipPath: {
_multi_value_: true,
value: [`polygon(${polygonOffset}px 100%, 50% ${polygonOffset}px, ${2 * unitWidth - polygonOffset}px 100%, ${polygonOffset}px 100%)`, `path('M ${ax} ${ay} A ${outerRadius} ${outerRadius} 0 0 0 ${bx} ${by} L ${cx} ${cy} A ${innerRadius} ${innerRadius} 0 0 1 ${dx} ${dy} L ${ex} ${ey} A ${outerRadius} ${outerRadius} 0 0 0 ${fx} ${fy} Z')`]
},
content: '""'
}
};
};
function genPresetColor(token2, genCss) {
return PresetColors.reduce((prev2, colorKey) => {
const lightColor = token2[`${colorKey}-1`];
const lightBorderColor = token2[`${colorKey}-3`];
const darkColor = token2[`${colorKey}-6`];
const textColor = token2[`${colorKey}-7`];
return _extends$1(_extends$1({}, prev2), genCss(colorKey, {
lightColor,
lightBorderColor,
darkColor,
textColor
}));
}, {});
}
const resetComponent = (token2) => ({
boxSizing: "border-box",
margin: 0,
padding: 0,
color: token2.colorText,
fontSize: token2.fontSize,
// font-variant: @font-variant-base;
lineHeight: token2.lineHeight,
listStyle: "none",
// font-feature-settings: @font-feature-settings-base;
fontFamily: token2.fontFamily
});
const genLinkStyle = (token2) => ({
a: {
color: token2.colorLink,
textDecoration: token2.linkDecoration,
backgroundColor: "transparent",
outline: "none",
cursor: "pointer",
transition: `color ${token2.motionDurationSlow}`,
"-webkit-text-decoration-skip": "objects",
"&:hover": {
color: token2.colorLinkHover
},
"&:active": {
color: token2.colorLinkActive
},
[`&:active,
&:hover`]: {
textDecoration: token2.linkHoverDecoration,
outline: 0
},
// https://github.com/ant-design/ant-design/issues/22503
"&:focus": {
textDecoration: token2.linkFocusDecoration,
outline: 0
},
"&[disabled]": {
color: token2.colorTextDisabled,
cursor: "not-allowed"
}
}
});
const genCommonStyle = (token2, componentPrefixCls) => {
const {
fontFamily,
fontSize
} = token2;
const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
return {
[rootPrefixSelector]: {
fontFamily,
fontSize,
boxSizing: "border-box",
"&::before, &::after": {
boxSizing: "border-box"
},
[rootPrefixSelector]: {
boxSizing: "border-box",
"&::before, &::after": {
boxSizing: "border-box"
}
}
}
};
};
const defaultIconPrefixCls = "anticon";
const GlobalFormContextKey = Symbol("GlobalFormContextKey");
const useInjectGlobalForm = () => {
return inject(GlobalFormContextKey, {
validateMessages: computed(() => void 0)
});
};
const configProviderKey = Symbol("configProvider");
const defaultConfigProvider = {
getPrefixCls: (suffixCls, customizePrefixCls) => {
if (customizePrefixCls)
return customizePrefixCls;
return suffixCls ? `ant-${suffixCls}` : "ant";
},
iconPrefixCls: computed(() => defaultIconPrefixCls),
getPopupContainer: computed(() => () => document.body),
direction: computed(() => "ltr")
};
const useConfigContextInject = () => {
return inject(configProviderKey, defaultConfigProvider);
};
function genComponentStyleHook(component, styleFn, getDefaultToken) {
return (_prefixCls) => {
const prefixCls = computed(() => _prefixCls === null || _prefixCls === void 0 ? void 0 : _prefixCls.value);
const [theme, token2, hashId] = useToken();
const {
getPrefixCls,
iconPrefixCls
} = useConfigContextInject();
const rootPrefixCls = computed(() => getPrefixCls());
const sharedInfo = computed(() => {
return {
theme: theme.value,
token: token2.value,
hashId: hashId.value,
path: ["Shared", rootPrefixCls.value]
};
});
useStyleRegister(sharedInfo, () => [{
// Link
"&": genLinkStyle(token2.value)
}]);
const componentInfo = computed(() => {
return {
theme: theme.value,
token: token2.value,
hashId: hashId.value,
path: [component, prefixCls.value, iconPrefixCls.value]
};
});
return [useStyleRegister(componentInfo, () => {
const {
token: proxyToken,
flush
} = statisticToken(token2.value);
const defaultComponentToken = typeof getDefaultToken === "function" ? getDefaultToken(proxyToken) : getDefaultToken;
const mergedComponentToken = _extends$1(_extends$1({}, defaultComponentToken), token2.value[component]);
const componentCls = `.${prefixCls.value}`;
const mergedToken = merge(proxyToken, {
componentCls,
prefixCls: prefixCls.value,
iconCls: `.${iconPrefixCls.value}`,
antCls: `.${rootPrefixCls.value}`
}, mergedComponentToken);
const styleInterpolation = styleFn(mergedToken, {
hashId: hashId.value,
prefixCls: prefixCls.value,
rootPrefixCls: rootPrefixCls.value,
iconPrefixCls: iconPrefixCls.value,
overrideComponentToken: token2.value[component]
});
flush(component, mergedComponentToken);
return [genCommonStyle(token2.value, prefixCls.value), styleInterpolation];
}), hashId];
};
}
const enableStatistic = process.env.NODE_ENV !== "production" || typeof CSSINJS_STATISTIC !== "undefined";
let recording = true;
function merge() {
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
objs[_key] = arguments[_key];
}
if (!enableStatistic) {
return _extends$1({}, ...objs);
}
recording = false;
const ret = {};
objs.forEach((obj) => {
const keys2 = Object.keys(obj);
keys2.forEach((key) => {
Object.defineProperty(ret, key, {
configurable: true,
enumerable: true,
get: () => obj[key]
});
});
});
recording = true;
return ret;
}
function noop$2() {
}
function statisticToken(token2) {
let tokenKeys2;
let proxy = token2;
let flush = noop$2;
if (enableStatistic) {
tokenKeys2 = /* @__PURE__ */ new Set();
proxy = new Proxy(token2, {
get(obj, prop) {
if (recording) {
tokenKeys2.add(prop);
}
return obj[prop];
}
});
flush = (componentName, componentToken) => {
({
global: Array.from(tokenKeys2),
component: componentToken
});
};
}
return {
token: proxy,
keys: tokenKeys2,
flush
};
}
const defaultTheme = createTheme(derivative);
const defaultConfig = {
token: defaultSeedToken,
hashed: true
};
const DesignTokenContextKey = Symbol("DesignTokenContext");
const globalDesignTokenApi = shallowRef();
const useDesignTokenProvider = (value) => {
provide(DesignTokenContextKey, value);
watch(value, () => {
globalDesignTokenApi.value = unref(value);
triggerRef(globalDesignTokenApi);
}, {
immediate: true,
deep: true
});
};
defineComponent({
props: {
value: objectType()
},
setup(props, _ref) {
let {
slots
} = _ref;
useDesignTokenProvider(computed(() => props.value));
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
function useToken() {
const designTokenContext = inject(DesignTokenContextKey, computed(() => globalDesignTokenApi.value || defaultConfig));
const salt = computed(() => `${version}-${designTokenContext.value.hashed || ""}`);
const mergedTheme = computed(() => designTokenContext.value.theme || defaultTheme);
const cacheToken = useCacheToken(mergedTheme, computed(() => [defaultSeedToken, designTokenContext.value.token]), computed(() => ({
salt: salt.value,
override: _extends$1({
override: designTokenContext.value.token
}, designTokenContext.value.components),
formatToken
})));
return [mergedTheme, computed(() => cacheToken.value[0]), computed(() => designTokenContext.value.hashed ? cacheToken.value[1] : "")];
}
const responsiveArray = ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"];
const getResponsiveMap = (token2) => ({
xs: `(max-width: ${token2.screenXSMax}px)`,
sm: `(min-width: ${token2.screenSM}px)`,
md: `(min-width: ${token2.screenMD}px)`,
lg: `(min-width: ${token2.screenLG}px)`,
xl: `(min-width: ${token2.screenXL}px)`,
xxl: `(min-width: ${token2.screenXXL}px)`,
xxxl: `{min-width: ${token2.screenXXXL}px}`
});
function useResponsiveObserver() {
const [, token2] = useToken();
return computed(() => {
const responsiveMap = getResponsiveMap(token2.value);
const subscribers = /* @__PURE__ */ new Map();
let subUid = -1;
let screens = {};
return {
matchHandlers: {},
dispatch(pointMap) {
screens = pointMap;
subscribers.forEach((func) => func(screens));
return subscribers.size >= 1;
},
subscribe(func) {
if (!subscribers.size)
this.register();
subUid += 1;
subscribers.set(subUid, func);
func(screens);
return subUid;
},
unsubscribe(paramToken) {
subscribers.delete(paramToken);
if (!subscribers.size)
this.unregister();
},
unregister() {
Object.keys(responsiveMap).forEach((screen) => {
const matchMediaQuery = responsiveMap[screen];
const handler = this.matchHandlers[matchMediaQuery];
handler === null || handler === void 0 ? void 0 : handler.mql.removeListener(handler === null || handler === void 0 ? void 0 : handler.listener);
});
subscribers.clear();
},
register() {
Object.keys(responsiveMap).forEach((screen) => {
const matchMediaQuery = responsiveMap[screen];
const listener = (_ref) => {
let {
matches
} = _ref;
this.dispatch(_extends$1(_extends$1({}, screens), {
[screen]: matches
}));
};
const mql = window.matchMedia(matchMediaQuery);
mql.addListener(listener);
this.matchHandlers[matchMediaQuery] = {
mql,
listener
};
listener(mql);
});
},
responsiveMap
};
});
}
const DisabledContextKey = Symbol("DisabledContextKey");
const useInjectDisabled = () => {
return inject(DisabledContextKey, ref(void 0));
};
const useProviderDisabled = (disabled) => {
const parentDisabled = useInjectDisabled();
provide(DisabledContextKey, computed(() => {
var _a;
return (_a = disabled.value) !== null && _a !== void 0 ? _a : parentDisabled.value;
}));
return disabled;
};
const Pagination = {
// Options.jsx
items_per_page: "/ page",
jump_to: "Go to",
jump_to_confirm: "confirm",
page: "",
// Pagination.jsx
prev_page: "Previous Page",
next_page: "Next Page",
prev_5: "Previous 5 Pages",
next_5: "Next 5 Pages",
prev_3: "Previous 3 Pages",
next_3: "Next 3 Pages"
};
const locale$2 = {
locale: "en_US",
today: "Today",
now: "Now",
backToToday: "Back to today",
ok: "Ok",
clear: "Clear",
month: "Month",
year: "Year",
timeSelect: "select time",
dateSelect: "select date",
weekSelect: "Choose a week",
monthSelect: "Choose a month",
yearSelect: "Choose a year",
decadeSelect: "Choose a decade",
yearFormat: "YYYY",
dateFormat: "M/D/YYYY",
dayFormat: "D",
dateTimeFormat: "M/D/YYYY HH:mm:ss",
monthBeforeYear: true,
previousMonth: "Previous month (PageUp)",
nextMonth: "Next month (PageDown)",
previousYear: "Last year (Control + left)",
nextYear: "Next year (Control + right)",
previousDecade: "Last decade",
nextDecade: "Next decade",
previousCentury: "Last century",
nextCentury: "Next century"
};
const CalendarLocale = locale$2;
const locale$1 = {
placeholder: "Select time",
rangePlaceholder: ["Start time", "End time"]
};
const TimePicker = locale$1;
const locale = {
lang: _extends$1({
placeholder: "Select date",
yearPlaceholder: "Select year",
quarterPlaceholder: "Select quarter",
monthPlaceholder: "Select month",
weekPlaceholder: "Select week",
rangePlaceholder: ["Start date", "End date"],
rangeYearPlaceholder: ["Start year", "End year"],
rangeQuarterPlaceholder: ["Start quarter", "End quarter"],
rangeMonthPlaceholder: ["Start month", "End month"],
rangeWeekPlaceholder: ["Start week", "End week"]
}, CalendarLocale),
timePickerLocale: _extends$1({}, TimePicker)
};
const DatePicker = locale;
const typeTemplate$1 = "${label} is not a valid ${type}";
const localeValues = {
locale: "en",
Pagination,
DatePicker,
TimePicker,
Calendar: DatePicker,
global: {
placeholder: "Please select"
},
Table: {
filterTitle: "Filter menu",
filterConfirm: "OK",
filterReset: "Reset",
filterEmptyText: "No filters",
filterCheckall: "Select all items",
filterSearchPlaceholder: "Search in filters",
emptyText: "No data",
selectAll: "Select current page",
selectInvert: "Invert current page",
selectNone: "Clear all data",
selectionAll: "Select all data",
sortTitle: "Sort",
expand: "Expand row",
collapse: "Collapse row",
triggerDesc: "Click to sort descending",
triggerAsc: "Click to sort ascending",
cancelSort: "Click to cancel sorting"
},
Tour: {
Next: "Next",
Previous: "Previous",
Finish: "Finish"
},
Modal: {
okText: "OK",
cancelText: "Cancel",
justOkText: "OK"
},
Popconfirm: {
okText: "OK",
cancelText: "Cancel"
},
Transfer: {
titles: ["", ""],
searchPlaceholder: "Search here",
itemUnit: "item",
itemsUnit: "items",
remove: "Remove",
selectCurrent: "Select current page",
removeCurrent: "Remove current page",
selectAll: "Select all data",
removeAll: "Remove all data",
selectInvert: "Invert current page"
},
Upload: {
uploading: "Uploading...",
removeFile: "Remove file",
uploadError: "Upload error",
previewFile: "Preview file",
downloadFile: "Download file"
},
Empty: {
description: "No data"
},
Icon: {
icon: "icon"
},
Text: {
edit: "Edit",
copy: "Copy",
copied: "Copied",
expand: "Expand"
},
PageHeader: {
back: "Back"
},
Form: {
optional: "(optional)",
defaultValidateMessages: {
default: "Field validation error for ${label}",
required: "Please enter ${label}",
enum: "${label} must be one of [${enum}]",
whitespace: "${label} cannot be a blank character",
date: {
format: "${label} date format is invalid",
parse: "${label} cannot be converted to a date",
invalid: "${label} is an invalid date"
},
types: {
string: typeTemplate$1,
method: typeTemplate$1,
array: typeTemplate$1,
object: typeTemplate$1,
number: typeTemplate$1,
date: typeTemplate$1,
boolean: typeTemplate$1,
integer: typeTemplate$1,
float: typeTemplate$1,
regexp: typeTemplate$1,
email: typeTemplate$1,
url: typeTemplate$1,
hex: typeTemplate$1
},
string: {
len: "${label} must be ${len} characters",
min: "${label} must be at least ${min} characters",
max: "${label} must be up to ${max} characters",
range: "${label} must be between ${min}-${max} characters"
},
number: {
len: "${label} must be equal to ${len}",
min: "${label} must be minimum ${min}",
max: "${label} must be maximum ${max}",
range: "${label} must be between ${min}-${max}"
},
array: {
len: "Must be ${len} ${label}",
min: "At least ${min} ${label}",
max: "At most ${max} ${label}",
range: "The amount of ${label} must be between ${min}-${max}"
},
pattern: {
mismatch: "${label} does not match the pattern ${pattern}"
}
}
},
Image: {
preview: "Preview"
},
QRCode: {
expired: "QR code expired",
refresh: "Refresh",
scanned: "Scanned"
}
};
const defaultLocale = localeValues;
const LocaleReceiver = defineComponent({
compatConfig: {
MODE: 3
},
name: "LocaleReceiver",
props: {
componentName: String,
defaultLocale: {
type: [Object, Function]
},
children: {
type: Function
}
},
setup(props, _ref) {
let {
slots
} = _ref;
const localeData = inject("localeData", {});
const locale2 = computed(() => {
const {
componentName = "global",
defaultLocale: defaultLocale$1
} = props;
const locale3 = defaultLocale$1 || defaultLocale[componentName || "global"];
const {
antLocale
} = localeData;
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends$1(_extends$1({}, typeof locale3 === "function" ? locale3() : locale3), localeFromContext || {});
});
const localeCode = computed(() => {
const {
antLocale
} = localeData;
const localeCode2 = antLocale && antLocale.locale;
if (antLocale && antLocale.exist && !localeCode2) {
return defaultLocale.locale;
}
return localeCode2;
});
return () => {
const children = props.children || slots.default;
const {
antLocale
} = localeData;
return children === null || children === void 0 ? void 0 : children(locale2.value, localeCode.value, antLocale);
};
}
});
function useLocaleReceiver(componentName, defaultLocale$1, propsLocale) {
const localeData = inject("localeData", {});
const componentLocale = computed(() => {
const {
antLocale
} = localeData;
const locale2 = unref(defaultLocale$1) || defaultLocale[componentName || "global"];
const localeFromContext = componentName && antLocale ? antLocale[componentName] : {};
return _extends$1(_extends$1(_extends$1({}, typeof locale2 === "function" ? locale2() : locale2), localeFromContext || {}), unref(propsLocale) || {});
});
return [componentLocale];
}
const Empty$2 = defineComponent({
compatConfig: {
MODE: 3
},
setup() {
const [, token2] = useToken();
const themeStyle = computed(() => {
const bgColor = new TinyColor(token2.value.colorBgBase);
if (bgColor.toHsl().l < 0.5) {
return {
opacity: 0.65
};
}
return {};
});
return () => createVNode("svg", {
"style": themeStyle.value,
"width": "184",
"height": "152",
"viewBox": "0 0 184 152",
"xmlns": "http://www.w3.org/2000/svg"
}, [createVNode("g", {
"fill": "none",
"fill-rule": "evenodd"
}, [createVNode("g", {
"transform": "translate(24 31.67)"
}, [createVNode("ellipse", {
"fill-opacity": ".8",
"fill": "#F5F5F7",
"cx": "67.797",
"cy": "106.89",
"rx": "67.797",
"ry": "12.668"
}, null), createVNode("path", {
"d": "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
"fill": "#AEB8C2"
}, null), createVNode("path", {
"d": "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
"fill": "url(#linearGradient-1)",
"transform": "translate(13.56)"
}, null), createVNode("path", {
"d": "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
"fill": "#F5F5F7"
}, null), createVNode("path", {
"d": "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
"fill": "#DCE0E6"
}, null)]), createVNode("path", {
"d": "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
"fill": "#DCE0E6"
}, null), createVNode("g", {
"transform": "translate(149.65 15.383)",
"fill": "#FFF"
}, [createVNode("ellipse", {
"cx": "20.654",
"cy": "3.167",
"rx": "2.849",
"ry": "2.815"
}, null), createVNode("path", {
"d": "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
}, null)])])]);
}
});
Empty$2.PRESENTED_IMAGE_DEFAULT = true;
const DefaultEmptyImg = Empty$2;
const Simple = defineComponent({
compatConfig: {
MODE: 3
},
setup() {
const [, token2] = useToken();
const color = computed(() => {
const {
colorFill,
colorFillTertiary,
colorFillQuaternary,
colorBgContainer
} = token2.value;
return {
borderColor: new TinyColor(colorFill).onBackground(colorBgContainer).toHexString(),
shadowColor: new TinyColor(colorFillTertiary).onBackground(colorBgContainer).toHexString(),
contentColor: new TinyColor(colorFillQuaternary).onBackground(colorBgContainer).toHexString()
};
});
return () => createVNode("svg", {
"width": "64",
"height": "41",
"viewBox": "0 0 64 41",
"xmlns": "http://www.w3.org/2000/svg"
}, [createVNode("g", {
"transform": "translate(0 1)",
"fill": "none",
"fill-rule": "evenodd"
}, [createVNode("ellipse", {
"fill": color.value.shadowColor,
"cx": "32",
"cy": "33",
"rx": "32",
"ry": "7"
}, null), createVNode("g", {
"fill-rule": "nonzero",
"stroke": color.value.borderColor
}, [createVNode("path", {
"d": "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
}, null), createVNode("path", {
"d": "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
"fill": color.value.contentColor
}, null)])])]);
}
});
Simple.PRESENTED_IMAGE_SIMPLE = true;
const SimpleEmptyImg = Simple;
const isValid = (value) => {
return value !== void 0 && value !== null && value !== "";
};
const isValid$1 = isValid;
const initDefaultProps = (types2, defaultProps) => {
const propTypes = _extends$1({}, types2);
Object.keys(defaultProps).forEach((k2) => {
const prop = propTypes[k2];
if (prop) {
if (prop.type || prop.default) {
prop.default = defaultProps[k2];
} else if (prop.def) {
prop.def(defaultProps[k2]);
} else {
propTypes[k2] = {
type: prop,
default: defaultProps[k2]
};
}
} else {
throw new Error(`not have ${k2} prop`);
}
});
return propTypes;
};
const initDefaultProps$1 = initDefaultProps;
const splitAttrs = (attrs) => {
const allAttrs = Object.keys(attrs);
const eventAttrs = {};
const onEvents = {};
const extraAttrs = {};
for (let i2 = 0, l2 = allAttrs.length; i2 < l2; i2++) {
const key = allAttrs[i2];
if (isOn(key)) {
eventAttrs[key[2].toLowerCase() + key.slice(3)] = attrs[key];
onEvents[key] = attrs[key];
} else {
extraAttrs[key] = attrs[key];
}
}
return {
onEvents,
events: eventAttrs,
extraAttrs
};
};
const parseStyleText = function() {
let cssText = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
let camel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
const res = {};
const listDelimiter = /;(?![^(]*\))/g;
const propertyDelimiter = /:(.+)/;
if (typeof cssText === "object")
return cssText;
cssText.split(listDelimiter).forEach(function(item) {
if (item) {
const tmp = item.split(propertyDelimiter);
if (tmp.length > 1) {
const k2 = camel ? camelize(tmp[0].trim()) : tmp[0].trim();
res[k2] = tmp[1].trim();
}
}
});
return res;
};
const hasProp = (instance, prop) => {
return instance[prop] !== void 0;
};
const skipFlattenKey = Symbol("skipFlatten");
const flattenChildren = function() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
let filterEmpty2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
const temp = Array.isArray(children) ? children : [children];
const res = [];
temp.forEach((child) => {
if (Array.isArray(child)) {
res.push(...flattenChildren(child, filterEmpty2));
} else if (child && child.type === Fragment) {
if (child.key === skipFlattenKey) {
res.push(child);
} else {
res.push(...flattenChildren(child.children, filterEmpty2));
}
} else if (child && isVNode(child)) {
if (filterEmpty2 && !isEmptyElement(child)) {
res.push(child);
} else if (!filterEmpty2) {
res.push(child);
}
} else if (isValid$1(child)) {
res.push(child);
}
});
return res;
};
const getSlot = function(self2) {
let name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
if (isVNode(self2)) {
if (self2.type === Fragment) {
return name === "default" ? flattenChildren(self2.children) : [];
} else if (self2.children && self2.children[name]) {
return flattenChildren(self2.children[name](options));
} else {
return [];
}
} else {
const res = self2.$slots[name] && self2.$slots[name](options);
return flattenChildren(res);
}
};
const findDOMNode = (instance) => {
var _a;
let node2 = ((_a = instance === null || instance === void 0 ? void 0 : instance.vnode) === null || _a === void 0 ? void 0 : _a.el) || instance && (instance.$el || instance);
while (node2 && !node2.tagName) {
node2 = node2.nextSibling;
}
return node2;
};
const getOptionProps = (instance) => {
const res = {};
if (instance.$ && instance.$.vnode) {
const props = instance.$.vnode.props || {};
Object.keys(instance.$props).forEach((k2) => {
const v2 = instance.$props[k2];
const hyphenateKey = hyphenate(k2);
if (v2 !== void 0 || hyphenateKey in props) {
res[k2] = v2;
}
});
} else if (isVNode(instance) && typeof instance.type === "object") {
const originProps = instance.props || {};
const props = {};
Object.keys(originProps).forEach((key) => {
props[camelize(key)] = originProps[key];
});
const options = instance.type.props || {};
Object.keys(options).forEach((k2) => {
const v2 = resolvePropValue(options, props, k2, props[k2]);
if (v2 !== void 0 || k2 in props) {
res[k2] = v2;
}
});
}
return res;
};
const getComponent = function(instance) {
let prop = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "default";
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : instance;
let execute = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
let com = void 0;
if (instance.$) {
const temp = instance[prop];
if (temp !== void 0) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else {
com = instance.$slots[prop];
com = execute && com ? com(options) : com;
}
} else if (isVNode(instance)) {
const temp = instance.props && instance.props[prop];
if (temp !== void 0 && instance.props !== null) {
return typeof temp === "function" && execute ? temp(options) : temp;
} else if (instance.type === Fragment) {
com = instance.children;
} else if (instance.children && instance.children[prop]) {
com = instance.children[prop];
com = execute && com ? com(options) : com;
}
}
if (Array.isArray(com)) {
com = flattenChildren(com);
com = com.length === 1 ? com[0] : com;
com = com.length === 0 ? void 0 : com;
}
return com;
};
function getEvents() {
let ele = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
let on = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
let props = {};
if (ele.$) {
props = _extends$1(_extends$1({}, props), ele.$attrs);
} else {
props = _extends$1(_extends$1({}, props), ele.props);
}
return splitAttrs(props)[on ? "onEvents" : "events"];
}
function getStyle(ele, camel) {
const props = (isVNode(ele) ? ele.props : ele.$attrs) || {};
let style = props.style || {};
if (typeof style === "string") {
style = parseStyleText(style, camel);
} else if (camel && style) {
const res = {};
Object.keys(style).forEach((k2) => res[camelize(k2)] = style[k2]);
return res;
}
return style;
}
function isFragment(c2) {
return c2.length === 1 && c2[0].type === Fragment;
}
function isEmptyElement(c2) {
return c2 && (c2.type === Comment || c2.type === Fragment && c2.children.length === 0 || c2.type === Text && c2.children.trim() === "");
}
function filterEmpty() {
let children = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
const res = [];
children.forEach((child) => {
if (Array.isArray(child)) {
res.push(...child);
} else if ((child === null || child === void 0 ? void 0 : child.type) === Fragment) {
res.push(...filterEmpty(child.children));
} else {
res.push(child);
}
});
return res.filter((c2) => !isEmptyElement(c2));
}
function isValidElement(element) {
if (Array.isArray(element) && element.length === 1) {
element = element[0];
}
return element && element.__v_isVNode && typeof element.type !== "symbol";
}
function getPropsSlot(slots, props) {
let prop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
var _a, _b;
return (_a = props[prop]) !== null && _a !== void 0 ? _a : (_b = slots[prop]) === null || _b === void 0 ? void 0 : _b.call(slots);
}
const genSharedEmptyStyle = (token2) => {
const {
componentCls,
margin,
marginXS,
marginXL,
fontSize,
lineHeight
} = token2;
return {
[componentCls]: {
marginInline: marginXS,
fontSize,
lineHeight,
textAlign: "center",
// 原来 &-image 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
[`${componentCls}-image`]: {
height: token2.emptyImgHeight,
marginBottom: marginXS,
opacity: token2.opacityImage,
img: {
height: "100%"
},
svg: {
height: "100%",
margin: "auto"
}
},
// 原来 &-footer 没有父子结构,现在为了外层承担我们的hashId,改成父子结果
[`${componentCls}-footer`]: {
marginTop: margin
},
"&-normal": {
marginBlock: marginXL,
color: token2.colorTextDisabled,
[`${componentCls}-image`]: {
height: token2.emptyImgHeightMD
}
},
"&-small": {
marginBlock: marginXS,
color: token2.colorTextDisabled,
[`${componentCls}-image`]: {
height: token2.emptyImgHeightSM
}
}
}
};
};
const useStyle$2 = genComponentStyleHook("Empty", (token2) => {
const {
componentCls,
controlHeightLG
} = token2;
const emptyToken = merge(token2, {
emptyImgCls: `${componentCls}-img`,
emptyImgHeight: controlHeightLG * 2.5,
emptyImgHeightMD: controlHeightLG,
emptyImgHeightSM: controlHeightLG * 0.875
});
return [genSharedEmptyStyle(emptyToken)];
});
var __rest$1 = globalThis && globalThis.__rest || function(s2, e2) {
var t2 = {};
for (var p in s2)
if (Object.prototype.hasOwnProperty.call(s2, p) && e2.indexOf(p) < 0)
t2[p] = s2[p];
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
for (var i2 = 0, p = Object.getOwnPropertySymbols(s2); i2 < p.length; i2++) {
if (e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i2]))
t2[p[i2]] = s2[p[i2]];
}
return t2;
};
const emptyProps = () => ({
prefixCls: String,
imageStyle: objectType(),
image: anyType(),
description: anyType()
});
const Empty = defineComponent({
name: "AEmpty",
compatConfig: {
MODE: 3
},
inheritAttrs: false,
props: emptyProps(),
setup(props, _ref) {
let {
slots = {},
attrs
} = _ref;
const {
direction,
prefixCls: prefixClsRef
} = useConfigInject("empty", props);
const [wrapSSR, hashId] = useStyle$2(prefixClsRef);
return () => {
var _a, _b;
const prefixCls = prefixClsRef.value;
const _c = _extends$1(_extends$1({}, props), attrs), {
image: mergedImage = ((_a = slots.image) === null || _a === void 0 ? void 0 : _a.call(slots)) || h$1(DefaultEmptyImg),
description = ((_b = slots.description) === null || _b === void 0 ? void 0 : _b.call(slots)) || void 0,
imageStyle,
class: className = ""
} = _c, restProps = __rest$1(_c, ["image", "description", "imageStyle", "class"]);
const image = typeof mergedImage === "function" ? mergedImage() : mergedImage;
const isNormal = typeof image === "object" && "type" in image && image.type.PRESENTED_IMAGE_SIMPLE;
return wrapSSR(createVNode(LocaleReceiver, {
"componentName": "Empty",
"children": (locale2) => {
const des = typeof description !== "undefined" ? description : locale2.description;
const alt = typeof des === "string" ? des : "empty";
let imageNode = null;
if (typeof image === "string") {
imageNode = createVNode("img", {
"alt": alt,
"src": image
}, null);
} else {
imageNode = image;
}
return createVNode("div", _objectSpread2$1({
"class": classNames(prefixCls, className, hashId.value, {
[`${prefixCls}-normal`]: isNormal,
[`${prefixCls}-rtl`]: direction.value === "rtl"
})
}, restProps), [createVNode("div", {
"class": `${prefixCls}-image`,
"style": imageStyle
}, [imageNode]), des && createVNode("p", {
"class": `${prefixCls}-description`
}, [des]), slots.default && createVNode("div", {
"class": `${prefixCls}-footer`
}, [filterEmpty(slots.default())])]);
}
}, null));
};
}
});
Empty.PRESENTED_IMAGE_DEFAULT = () => h$1(DefaultEmptyImg);
Empty.PRESENTED_IMAGE_SIMPLE = () => h$1(SimpleEmptyImg);
const Empty$1 = withInstall(Empty);
const DefaultRenderEmpty = (props) => {
const {
prefixCls
} = useConfigInject("empty", props);
const renderHtml = (componentName) => {
switch (componentName) {
case "Table":
case "List":
return createVNode(Empty$1, {
"image": Empty$1.PRESENTED_IMAGE_SIMPLE
}, null);
case "Select":
case "TreeSelect":
case "Cascader":
case "Transfer":
case "Mentions":
return createVNode(Empty$1, {
"image": Empty$1.PRESENTED_IMAGE_SIMPLE,
"class": `${prefixCls.value}-small`
}, null);
default:
return createVNode(Empty$1, null, null);
}
};
return renderHtml(props.componentName);
};
const SizeContextKey = Symbol("SizeContextKey");
const useInjectSize = () => {
return inject(SizeContextKey, ref(void 0));
};
const useProviderSize = (size) => {
const parentSize = useInjectSize();
provide(SizeContextKey, computed(() => size.value || parentSize.value));
return size;
};
const useConfigInject = (name, props) => {
const sizeContext = useInjectSize();
const disabledContext = useInjectDisabled();
const configProvider = inject(configProviderKey, _extends$1(_extends$1({}, defaultConfigProvider), {
renderEmpty: (name2) => h$1(DefaultRenderEmpty, {
componentName: name2
})
}));
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
const direction = computed(() => {
var _a, _b;
return (_a = props.direction) !== null && _a !== void 0 ? _a : (_b = configProvider.direction) === null || _b === void 0 ? void 0 : _b.value;
});
const iconPrefixCls = computed(() => {
var _a;
return (_a = props.iconPrefixCls) !== null && _a !== void 0 ? _a : configProvider.iconPrefixCls.value;
});
const rootPrefixCls = computed(() => configProvider.getPrefixCls());
const autoInsertSpaceInButton = computed(() => {
var _a;
return (_a = configProvider.autoInsertSpaceInButton) === null || _a === void 0 ? void 0 : _a.value;
});
const renderEmpty = configProvider.renderEmpty;
const space = configProvider.space;
const pageHeader = configProvider.pageHeader;
const form = configProvider.form;
const getTargetContainer = computed(() => {
var _a, _b;
return (_a = props.getTargetContainer) !== null && _a !== void 0 ? _a : (_b = configProvider.getTargetContainer) === null || _b === void 0 ? void 0 : _b.value;
});
const getPopupContainer = computed(() => {
var _a, _b, _c;
return (_b = (_a = props.getContainer) !== null && _a !== void 0 ? _a : props.getPopupContainer) !== null && _b !== void 0 ? _b : (_c = configProvider.getPopupContainer) === null || _c === void 0 ? void 0 : _c.value;
});
const dropdownMatchSelectWidth = computed(() => {
var _a, _b;
return (_a = props.dropdownMatchSelectWidth) !== null && _a !== void 0 ? _a : (_b = configProvider.dropdownMatchSelectWidth) === null || _b === void 0 ? void 0 : _b.value;
});
const virtual = computed(() => {
var _a;
return (props.virtual === void 0 ? ((_a = configProvider.virtual) === null || _a === void 0 ? void 0 : _a.value) !== false : props.virtual !== false) && dropdownMatchSelectWidth.value !== false;
});
const size = computed(() => props.size || sizeContext.value);
const autocomplete = computed(() => {
var _a, _b, _c;
return (_a = props.autocomplete) !== null && _a !== void 0 ? _a : (_c = (_b = configProvider.input) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.autocomplete;
});
const disabled = computed(() => {
var _a;
return (_a = props.disabled) !== null && _a !== void 0 ? _a : disabledContext.value;
});
const csp = computed(() => {
var _a;
return (_a = props.csp) !== null && _a !== void 0 ? _a : configProvider.csp;
});
const wave = computed(() => {
var _a, _b;
return (_a = props.wave) !== null && _a !== void 0 ? _a : (_b = configProvider.wave) === null || _b === void 0 ? void 0 : _b.value;
});
return {
configProvider,
prefixCls,
direction,
size,
getTargetContainer,
getPopupContainer,
space,
pageHeader,
form,
autoInsertSpaceInButton,
renderEmpty,
virtual,
dropdownMatchSelectWidth,
rootPrefixCls,
getPrefixCls: configProvider.getPrefixCls,
autocomplete,
csp,
iconPrefixCls,
disabled,
select: configProvider.select,
wave
};
};
const canUseDocElement = () => canUseDom() && window.document.documentElement;
let flexGapSupported;
const detectFlexGapSupported = () => {
if (!canUseDocElement()) {
return false;
}
if (flexGapSupported !== void 0) {
return flexGapSupported;
}
const flex = document.createElement("div");
flex.style.display = "flex";
flex.style.flexDirection = "column";
flex.style.rowGap = "1px";
flex.appendChild(document.createElement("div"));
flex.appendChild(document.createElement("div"));
document.body.appendChild(flex);
flexGapSupported = flex.scrollHeight === 1;
document.body.removeChild(flex);
return flexGapSupported;
};
const useFlexGapSupport = () => {
const flexible = shallowRef(false);
onMounted(() => {
flexible.value = detectFlexGapSupported();
});
return flexible;
};
const RowContextKey = Symbol("rowContextKey");
const useProvideRow = (state) => {
provide(RowContextKey, state);
};
const useInjectRow = () => {
return inject(RowContextKey, {
gutter: computed(() => void 0),
wrap: computed(() => void 0),
supportFlexGap: computed(() => void 0)
});
};
const useProvideRow$1 = useProvideRow;
const genGridRowStyle = (token2) => {
const {
componentCls
} = token2;
return {
// Grid system
[componentCls]: {
display: "flex",
flexFlow: "row wrap",
minWidth: 0,
"&::before, &::after": {
display: "flex"
},
"&-no-wrap": {
flexWrap: "nowrap"
},
// The origin of the X-axis
"&-start": {
justifyContent: "flex-start"
},
// The center of the X-axis
"&-center": {
justifyContent: "center"
},
// The opposite of the X-axis
"&-end": {
justifyContent: "flex-end"
},
"&-space-between": {
justifyContent: "space-between"
},
"&-space-around ": {
justifyContent: "space-around"
},
"&-space-evenly ": {
justifyContent: "space-evenly"
},
// Align at the top
"&-top": {
alignItems: "flex-start"
},
// Align at the center
"&-middle": {
alignItems: "center"
},
"&-bottom": {
alignItems: "flex-end"
}
}
};
};
const genGridColStyle = (token2) => {
const {
componentCls
} = token2;
return {
// Grid system
[componentCls]: {
position: "relative",
maxWidth: "100%",
// Prevent columns from collapsing when empty
minHeight: 1
}
};
};
const genLoopGridColumnsStyle = (token2, sizeCls) => {
const {
componentCls,
gridColumns
} = token2;
const gridColumnsStyle = {};
for (let i2 = gridColumns; i2 >= 0; i2--) {
if (i2 === 0) {
gridColumnsStyle[`${componentCls}${sizeCls}-${i2}`] = {
display: "none"
};
gridColumnsStyle[`${componentCls}-push-${i2}`] = {
insetInlineStart: "auto"
};
gridColumnsStyle[`${componentCls}-pull-${i2}`] = {
insetInlineEnd: "auto"
};
gridColumnsStyle[`${componentCls}${sizeCls}-push-${i2}`] = {
insetInlineStart: "auto"
};
gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i2}`] = {
insetInlineEnd: "auto"
};
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i2}`] = {
marginInlineEnd: 0
};
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i2}`] = {
order: 0
};
} else {
gridColumnsStyle[`${componentCls}${sizeCls}-${i2}`] = {
display: "block",
flex: `0 0 ${i2 / gridColumns * 100}%`,
maxWidth: `${i2 / gridColumns * 100}%`
};
gridColumnsStyle[`${componentCls}${sizeCls}-push-${i2}`] = {
insetInlineStart: `${i2 / gridColumns * 100}%`
};
gridColumnsStyle[`${componentCls}${sizeCls}-pull-${i2}`] = {
insetInlineEnd: `${i2 / gridColumns * 100}%`
};
gridColumnsStyle[`${componentCls}${sizeCls}-offset-${i2}`] = {
marginInlineStart: `${i2 / gridColumns * 100}%`
};
gridColumnsStyle[`${componentCls}${sizeCls}-order-${i2}`] = {
order: i2
};
}
}
return gridColumnsStyle;
};
const genGridStyle = (token2, sizeCls) => genLoopGridColumnsStyle(token2, sizeCls);
const genGridMediaStyle = (token2, screenSize, sizeCls) => ({
[`@media (min-width: ${screenSize}px)`]: _extends$1({}, genGridStyle(token2, sizeCls))
});
const useRowStyle = genComponentStyleHook("Grid", (token2) => [genGridRowStyle(token2)]);
const useColStyle = genComponentStyleHook("Grid", (token2) => {
const gridToken = merge(token2, {
gridColumns: 24
// Row is divided into 24 parts in Grid
});
const gridMediaSizesMap = {
"-sm": gridToken.screenSMMin,
"-md": gridToken.screenMDMin,
"-lg": gridToken.screenLGMin,
"-xl": gridToken.screenXLMin,
"-xxl": gridToken.screenXXLMin
};
return [genGridColStyle(gridToken), genGridStyle(gridToken, ""), genGridStyle(gridToken, "-xs"), Object.keys(gridMediaSizesMap).map((key) => genGridMediaStyle(gridToken, gridMediaSizesMap[key], key)).reduce((pre, cur) => _extends$1(_extends$1({}, pre), cur), {})];
});
const rowProps = () => ({
align: someType([String, Object]),
justify: someType([String, Object]),
prefixCls: String,
gutter: someType([Number, Array, Object], 0),
wrap: {
type: Boolean,
default: void 0
}
});
const ARow = defineComponent({
compatConfig: {
MODE: 3
},
name: "ARow",
inheritAttrs: false,
props: rowProps(),
setup(props, _ref) {
let {
slots,
attrs
} = _ref;
const {
prefixCls,
direction
} = useConfigInject("row", props);
const [wrapSSR, hashId] = useRowStyle(prefixCls);
let token2;
const responsiveObserve = useResponsiveObserver();
const screens = ref({
xs: true,
sm: true,
md: true,
lg: true,
xl: true,
xxl: true
});
const curScreens = ref({
xs: false,
sm: false,
md: false,
lg: false,
xl: false,
xxl: false
});
const mergePropsByScreen = (oriProp) => {
return computed(() => {
if (typeof props[oriProp] === "string") {
return props[oriProp];
}
if (typeof props[oriProp] !== "object") {
return "";
}
for (let i2 = 0; i2 < responsiveArray.length; i2++) {
const breakpoint = responsiveArray[i2];
if (!curScreens.value[breakpoint])
continue;
const curVal = props[oriProp][breakpoint];
if (curVal !== void 0) {
return curVal;
}
}
return "";
});
};
const mergeAlign = mergePropsByScreen("align");
const mergeJustify = mergePropsByScreen("justify");
const supportFlexGap = useFlexGapSupport();
onMounted(() => {
token2 = responsiveObserve.value.subscribe((screen) => {
curScreens.value = screen;
const currentGutter = props.gutter || 0;
if (!Array.isArray(currentGutter) && typeof currentGutter === "object" || Array.isArray(currentGutter) && (typeof currentGutter[0] === "object" || typeof currentGutter[1] === "object")) {
screens.value = screen;
}
});
});
onBeforeUnmount(() => {
responsiveObserve.value.unsubscribe(token2);
});
const gutter = computed(() => {
const results = [void 0, void 0];
const {
gutter: gutter2 = 0
} = props;
const normalizedGutter = Array.isArray(gutter2) ? gutter2 : [gutter2, void 0];
normalizedGutter.forEach((g2, index2) => {
if (typeof g2 === "object") {
for (let i2 = 0; i2 < responsiveArray.length; i2++) {
const breakpoint = responsiveArray[i2];
if (screens.value[breakpoint] && g2[breakpoint] !== void 0) {
results[index2] = g2[breakpoint];
break;
}
}
} else {
results[index2] = g2;
}
});
return results;
});
useProvideRow$1({
gutter,
supportFlexGap,
wrap: computed(() => props.wrap)
});
const classes = computed(() => classNames(prefixCls.value, {
[`${prefixCls.value}-no-wrap`]: props.wrap === false,
[`${prefixCls.value}-${mergeJustify.value}`]: mergeJustify.value,
[`${prefixCls.value}-${mergeAlign.value}`]: mergeAlign.value,
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
}, attrs.class, hashId.value));
const rowStyle = computed(() => {
const gt = gutter.value;
const style = {};
const horizontalGutter = gt[0] != null && gt[0] > 0 ? `${gt[0] / -2}px` : void 0;
const verticalGutter = gt[1] != null && gt[1] > 0 ? `${gt[1] / -2}px` : void 0;
if (horizontalGutter) {
style.marginLeft = horizontalGutter;
style.marginRight = horizontalGutter;
}
if (supportFlexGap.value) {
style.rowGap = `${gt[1]}px`;
} else if (verticalGutter) {
style.marginTop = verticalGutter;
style.marginBottom = verticalGutter;
}
return style;
});
return () => {
var _a;
return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, {
"class": classes.value,
"style": _extends$1(_extends$1({}, rowStyle.value), attrs.style)
}), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]));
};
}
});
const Row = ARow;
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o2) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o3) {
return o3.__proto__ || Object.getPrototypeOf(o3);
};
return _getPrototypeOf(o2);
}
function _setPrototypeOf(o2, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p2) {
o3.__proto__ = p2;
return o3;
};
return _setPrototypeOf(o2, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e2) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct.bind();
} else {
_construct = function _construct2(Parent2, args2, Class2) {
var a2 = [null];
a2.push.apply(a2, args2);
var Constructor = Function.bind.apply(Parent2, a2);
var instance = new Constructor();
if (Class2)
_setPrototypeOf(instance, Class2.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _isNativeFunction(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
if (Class2 === null || !_isNativeFunction(Class2))
return Class2;
if (typeof Class2 !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class2))
return _cache.get(Class2);
_cache.set(Class2, Wrapper);
}
function Wrapper() {
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
}
Wrapper.prototype = Object.create(Class2.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _setPrototypeOf(Wrapper, Class2);
};
return _wrapNativeSuper(Class);
}
var formatRegExp = /%[sdj%]/g;
var warning = function warning2() {
};
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window !== "undefined" && typeof document !== "undefined") {
warning = function warning3(type4, errors) {
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
if (errors.every(function(e2) {
return typeof e2 === "string";
})) {
console.warn(type4, errors);
}
}
};
}
function convertFieldsError(errors) {
if (!errors || !errors.length)
return null;
var fields = {};
errors.forEach(function(error) {
var field = error.field;
fields[field] = fields[field] || [];
fields[field].push(error);
});
return fields;
}
function format(template) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var i2 = 0;
var len = args.length;
if (typeof template === "function") {
return template.apply(null, args);
}
if (typeof template === "string") {
var str = template.replace(formatRegExp, function(x2) {
if (x2 === "%%") {
return "%";
}
if (i2 >= len) {
return x2;
}
switch (x2) {
case "%s":
return String(args[i2++]);
case "%d":
return Number(args[i2++]);
case "%j":
try {
return JSON.stringify(args[i2++]);
} catch (_2) {
return "[Circular]";
}
break;
default:
return x2;
}
});
return str;
}
return template;
}
function isNativeStringType(type4) {
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
}
function isEmptyValue(value, type4) {
if (value === void 0 || value === null) {
return true;
}
if (type4 === "array" && Array.isArray(value) && !value.length) {
return true;
}
if (isNativeStringType(type4) && typeof value === "string" && !value) {
return true;
}
return false;
}
function asyncParallelArray(arr, func, callback) {
var results = [];
var total = 0;
var arrLength = arr.length;
function count(errors) {
results.push.apply(results, errors || []);
total++;
if (total === arrLength) {
callback(results);
}
}
arr.forEach(function(a2) {
func(a2, count);
});
}
function asyncSerialArray(arr, func, callback) {
var index2 = 0;
var arrLength = arr.length;
function next2(errors) {
if (errors && errors.length) {
callback(errors);
return;
}
var original = index2;
index2 = index2 + 1;
if (original < arrLength) {
func(arr[original], next2);
} else {
callback([]);
}
}
next2([]);
}
function flattenObjArr(objArr) {
var ret = [];
Object.keys(objArr).forEach(function(k2) {
ret.push.apply(ret, objArr[k2] || []);
});
return ret;
}
var AsyncValidationError = /* @__PURE__ */ function(_Error) {
_inheritsLoose(AsyncValidationError2, _Error);
function AsyncValidationError2(errors, fields) {
var _this;
_this = _Error.call(this, "Async Validation Error") || this;
_this.errors = errors;
_this.fields = fields;
return _this;
}
return AsyncValidationError2;
}(/* @__PURE__ */ _wrapNativeSuper(Error));
function asyncMap(objArr, option, func, callback, source) {
if (option.first) {
var _pending = new Promise(function(resolve, reject) {
var next2 = function next3(errors) {
callback(errors);
return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
};
var flattenArr = flattenObjArr(objArr);
asyncSerialArray(flattenArr, func, next2);
});
_pending["catch"](function(e2) {
return e2;
});
return _pending;
}
var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
var objArrKeys = Object.keys(objArr);
var objArrLength = objArrKeys.length;
var total = 0;
var results = [];
var pending = new Promise(function(resolve, reject) {
var next2 = function next3(errors) {
results.push.apply(results, errors);
total++;
if (total === objArrLength) {
callback(results);
return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
}
};
if (!objArrKeys.length) {
callback(results);
resolve(source);
}
objArrKeys.forEach(function(key) {
var arr = objArr[key];
if (firstFields.indexOf(key) !== -1) {
asyncSerialArray(arr, func, next2);
} else {
asyncParallelArray(arr, func, next2);
}
});
});
pending["catch"](function(e2) {
return e2;
});
return pending;
}
function isErrorObj(obj) {
return !!(obj && obj.message !== void 0);
}
function getValue$1(value, path) {
var v2 = value;
for (var i2 = 0; i2 < path.length; i2++) {
if (v2 == void 0) {
return v2;
}
v2 = v2[path[i2]];
}
return v2;
}
function complementError(rule, source) {
return function(oe) {
var fieldValue;
if (rule.fullFields) {
fieldValue = getValue$1(source, rule.fullFields);
} else {
fieldValue = source[oe.field || rule.fullField];
}
if (isErrorObj(oe)) {
oe.field = oe.field || rule.fullField;
oe.fieldValue = fieldValue;
return oe;
}
return {
message: typeof oe === "function" ? oe() : oe,
fieldValue,
field: oe.field || rule.fullField
};
};
}
function deepMerge(target, source) {
if (source) {
for (var s2 in source) {
if (source.hasOwnProperty(s2)) {
var value = source[s2];
if (typeof value === "object" && typeof target[s2] === "object") {
target[s2] = _extends({}, target[s2], value);
} else {
target[s2] = value;
}
}
}
}
return target;
}
var required$1 = function required(rule, value, source, errors, options, type4) {
if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
errors.push(format(options.messages.required, rule.fullField));
}
};
var whitespace = function whitespace2(rule, value, source, errors, options) {
if (/^\s+$/.test(value) || value === "") {
errors.push(format(options.messages.whitespace, rule.fullField));
}
};
var urlReg;
var getUrlRegex = function() {
if (urlReg) {
return urlReg;
}
var word = "[a-fA-F\\d:]";
var b2 = function b3(options) {
return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
};
var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
var v6seg = "[a-fA-F\\d]{1,4}";
var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
var v4exact = new RegExp("^" + v4 + "$");
var v6exact = new RegExp("^" + v6 + "$");
var ip = function ip2(options) {
return options && options.exact ? v46Exact : new RegExp("(?:" + b2(options) + v4 + b2(options) + ")|(?:" + b2(options) + v6 + b2(options) + ")", "g");
};
ip.v4 = function(options) {
return options && options.exact ? v4exact : new RegExp("" + b2(options) + v4 + b2(options), "g");
};
ip.v6 = function(options) {
return options && options.exact ? v6exact : new RegExp("" + b2(options) + v6 + b2(options), "g");
};
var protocol = "(?:(?:[a-z]+:)?//)";
var auth = "(?:\\S+(?::\\S*)?@)?";
var ipv4 = ip.v4().source;
var ipv6 = ip.v6().source;
var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
var port = "(?::\\d{2,5})?";
var path = '(?:[/?#][^\\s"]*)?';
var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
urlReg = new RegExp("(?:^" + regex + "$)", "i");
return urlReg;
};
var pattern$2 = {
// http://emailregex.com/
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
// url: new RegExp(
// '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
// 'i',
// ),
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
};
var types = {
integer: function integer(value) {
return types.number(value) && parseInt(value, 10) === value;
},
"float": function float(value) {
return types.number(value) && !types.integer(value);
},
array: function array(value) {
return Array.isArray(value);
},
regexp: function regexp(value) {
if (value instanceof RegExp) {
return true;
}
try {
return !!new RegExp(value);
} catch (e2) {
return false;
}
},
date: function date(value) {
return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
},
number: function number(value) {
if (isNaN(value)) {
return false;
}
return typeof value === "number";
},
object: function object(value) {
return typeof value === "object" && !types.array(value);
},
method: function method(value) {
return typeof value === "function";
},
email: function email(value) {
return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
},
url: function url(value) {
return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
},
hex: function hex(value) {
return typeof value === "string" && !!value.match(pattern$2.hex);
}
};
var type$1 = function type(rule, value, source, errors, options) {
if (rule.required && value === void 0) {
required$1(rule, value, source, errors, options);
return;
}
var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
var ruleType = rule.type;
if (custom.indexOf(ruleType) > -1) {
if (!types[ruleType](value)) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
}
} else if (ruleType && typeof value !== rule.type) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
}
};
var range = function range2(rule, value, source, errors, options) {
var len = typeof rule.len === "number";
var min = typeof rule.min === "number";
var max = typeof rule.max === "number";
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var val = value;
var key = null;
var num = typeof value === "number";
var str = typeof value === "string";
var arr = Array.isArray(value);
if (num) {
key = "number";
} else if (str) {
key = "string";
} else if (arr) {
key = "array";
}
if (!key) {
return false;
}
if (arr) {
val = value.length;
}
if (str) {
val = value.replace(spRegexp, "_").length;
}
if (len) {
if (val !== rule.len) {
errors.push(format(options.messages[key].len, rule.fullField, rule.len));
}
} else if (min && !max && val < rule.min) {
errors.push(format(options.messages[key].min, rule.fullField, rule.min));
} else if (max && !min && val > rule.max) {
errors.push(format(options.messages[key].max, rule.fullField, rule.max));
} else if (min && max && (val < rule.min || val > rule.max)) {
errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
}
};
var ENUM$1 = "enum";
var enumerable$1 = function enumerable(rule, value, source, errors, options) {
rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
if (rule[ENUM$1].indexOf(value) === -1) {
errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
}
};
var pattern$1 = function pattern(rule, value, source, errors, options) {
if (rule.pattern) {
if (rule.pattern instanceof RegExp) {
rule.pattern.lastIndex = 0;
if (!rule.pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
} else if (typeof rule.pattern === "string") {
var _pattern = new RegExp(rule.pattern);
if (!_pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
}
}
};
var rules = {
required: required$1,
whitespace,
type: type$1,
range,
"enum": enumerable$1,
pattern: pattern$1
};
var string = function string2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "string") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, "string");
if (!isEmptyValue(value, "string")) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
rules.pattern(rule, value, source, errors, options);
if (rule.whitespace === true) {
rules.whitespace(rule, value, source, errors, options);
}
}
}
callback(errors);
};
var method2 = function method3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var number2 = function number3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (value === "") {
value = void 0;
}
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var _boolean = function _boolean2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var regexp2 = function regexp3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var integer2 = function integer3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var floatFn = function floatFn2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var array2 = function array3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((value === void 0 || value === null) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, "array");
if (value !== void 0 && value !== null) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var object2 = function object3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var ENUM = "enum";
var enumerable2 = function enumerable3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules[ENUM](rule, value, source, errors, options);
}
}
callback(errors);
};
var pattern2 = function pattern3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "string") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "string")) {
rules.pattern(rule, value, source, errors, options);
}
}
callback(errors);
};
var date2 = function date3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "date") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "date")) {
var dateObject;
if (value instanceof Date) {
dateObject = value;
} else {
dateObject = new Date(value);
}
rules.type(rule, dateObject, source, errors, options);
if (dateObject) {
rules.range(rule, dateObject.getTime(), source, errors, options);
}
}
}
callback(errors);
};
var required2 = function required3(rule, value, callback, source, options) {
var errors = [];
var type4 = Array.isArray(value) ? "array" : typeof value;
rules.required(rule, value, source, errors, options, type4);
callback(errors);
};
var type2 = function type3(rule, value, callback, source, options) {
var ruleType = rule.type;
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, ruleType) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, ruleType);
if (!isEmptyValue(value, ruleType)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var any = function any2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
}
callback(errors);
};
var validators = {
string,
method: method2,
number: number2,
"boolean": _boolean,
regexp: regexp2,
integer: integer2,
"float": floatFn,
array: array2,
object: object2,
"enum": enumerable2,
pattern: pattern2,
date: date2,
url: type2,
hex: type2,
email: type2,
required: required2,
any
};
function newMessages() {
return {
"default": "Validation error on field %s",
required: "%s is required",
"enum": "%s must be one of %s",
whitespace: "%s cannot be empty",
date: {
format: "%s date %s is invalid for format %s",
parse: "%s date could not be parsed, %s is invalid ",
invalid: "%s date %s is invalid"
},
types: {
string: "%s is not a %s",
method: "%s is not a %s (function)",
array: "%s is not an %s",
object: "%s is not an %s",
number: "%s is not a %s",
date: "%s is not a %s",
"boolean": "%s is not a %s",
integer: "%s is not an %s",
"float": "%s is not a %s",
regexp: "%s is not a valid %s",
email: "%s is not a valid %s",
url: "%s is not a valid %s",
hex: "%s is not a valid %s"
},
string: {
len: "%s must be exactly %s characters",
min: "%s must be at least %s characters",
max: "%s cannot be longer than %s characters",
range: "%s must be between %s and %s characters"
},
number: {
len: "%s must equal %s",
min: "%s cannot be less than %s",
max: "%s cannot be greater than %s",
range: "%s must be between %s and %s"
},
array: {
len: "%s must be exactly %s in length",
min: "%s cannot be less than %s in length",
max: "%s cannot be greater than %s in length",
range: "%s must be between %s and %s in length"
},
pattern: {
mismatch: "%s value %s does not match pattern %s"
},
clone: function clone2() {
var cloned = JSON.parse(JSON.stringify(this));
cloned.clone = this.clone;
return cloned;
}
};
}
var messages = newMessages();
var Schema = /* @__PURE__ */ function() {
function Schema2(descriptor) {
this.rules = null;
this._messages = messages;
this.define(descriptor);
}
var _proto = Schema2.prototype;
_proto.define = function define(rules2) {
var _this = this;
if (!rules2) {
throw new Error("Cannot configure a schema with no rules");
}
if (typeof rules2 !== "object" || Array.isArray(rules2)) {
throw new Error("Rules must be an object");
}
this.rules = {};
Object.keys(rules2).forEach(function(name) {
var item = rules2[name];
_this.rules[name] = Array.isArray(item) ? item : [item];
});
};
_proto.messages = function messages2(_messages) {
if (_messages) {
this._messages = deepMerge(newMessages(), _messages);
}
return this._messages;
};
_proto.validate = function validate(source_, o2, oc) {
var _this2 = this;
if (o2 === void 0) {
o2 = {};
}
if (oc === void 0) {
oc = function oc2() {
};
}
var source = source_;
var options = o2;
var callback = oc;
if (typeof options === "function") {
callback = options;
options = {};
}
if (!this.rules || Object.keys(this.rules).length === 0) {
if (callback) {
callback(null, source);
}
return Promise.resolve(source);
}
function complete(results) {
var errors = [];
var fields = {};
function add(e2) {
if (Array.isArray(e2)) {
var _errors;
errors = (_errors = errors).concat.apply(_errors, e2);
} else {
errors.push(e2);
}
}
for (var i2 = 0; i2 < results.length; i2++) {
add(results[i2]);
}
if (!errors.length) {
callback(null, source);
} else {
fields = convertFieldsError(errors);
callback(errors, fields);
}
}
if (options.messages) {
var messages$1 = this.messages();
if (messages$1 === messages) {
messages$1 = newMessages();
}
deepMerge(messages$1, options.messages);
options.messages = messages$1;
} else {
options.messages = this.messages();
}
var series = {};
var keys2 = options.keys || Object.keys(this.rules);
keys2.forEach(function(z2) {
var arr = _this2.rules[z2];
var value = source[z2];
arr.forEach(function(r2) {
var rule = r2;
if (typeof rule.transform === "function") {
if (source === source_) {
source = _extends({}, source);
}
value = source[z2] = rule.transform(value);
}
if (typeof rule === "function") {
rule = {
validator: rule
};
} else {
rule = _extends({}, rule);
}
rule.validator = _this2.getValidationMethod(rule);
if (!rule.validator) {
return;
}
rule.field = z2;
rule.fullField = rule.fullField || z2;
rule.type = _this2.getType(rule);
series[z2] = series[z2] || [];
series[z2].push({
rule,
value,
source,
field: z2
});
});
});
var errorFields = {};
return asyncMap(series, options, function(data, doIt) {
var rule = data.rule;
var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
deep = deep && (rule.required || !rule.required && data.value);
rule.field = data.field;
function addFullField(key, schema) {
return _extends({}, schema, {
fullField: rule.fullField + "." + key,
fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
});
}
function cb(e2) {
if (e2 === void 0) {
e2 = [];
}
var errorList = Array.isArray(e2) ? e2 : [e2];
if (!options.suppressWarning && errorList.length) {
Schema2.warning("async-validator:", errorList);
}
if (errorList.length && rule.message !== void 0) {
errorList = [].concat(rule.message);
}
var filledErrors = errorList.map(complementError(rule, source));
if (options.first && filledErrors.length) {
errorFields[rule.field] = 1;
return doIt(filledErrors);
}
if (!deep) {
doIt(filledErrors);
} else {
if (rule.required && !data.value) {
if (rule.message !== void 0) {
filledErrors = [].concat(rule.message).map(complementError(rule, source));
} else if (options.error) {
filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
}
return doIt(filledErrors);
}
var fieldsSchema = {};
if (rule.defaultField) {
Object.keys(data.value).map(function(key) {
fieldsSchema[key] = rule.defaultField;
});
}
fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
var paredFieldsSchema = {};
Object.keys(fieldsSchema).forEach(function(field) {
var fieldSchema = fieldsSchema[field];
var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
});
var schema = new Schema2(paredFieldsSchema);
schema.messages(options.messages);
if (data.rule.options) {
data.rule.options.messages = options.messages;
data.rule.options.error = options.error;
}
schema.validate(data.value, data.rule.options || options, function(errs) {
var finalErrors = [];
if (filledErrors && filledErrors.length) {
finalErrors.push.apply(finalErrors, filledErrors);
}
if (errs && errs.length) {
finalErrors.push.apply(finalErrors, errs);
}
doIt(finalErrors.length ? finalErrors : null);
});
}
}
var res;
if (rule.asyncValidator) {
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
} else if (rule.validator) {
try {
res = rule.validator(rule, data.value, cb, data.source, options);
} catch (error) {
console.error == null ? void 0 : console.error(error);
if (!options.suppressValidatorError) {
setTimeout(function() {
throw error;
}, 0);
}
cb(error.message);
}
if (res === true) {
cb();
} else if (res === false) {
cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
} else if (res instanceof Array) {
cb(res);
} else if (res instanceof Error) {
cb(res.message);
}
}
if (res && res.then) {
res.then(function() {
return cb();
}, function(e2) {
return cb(e2);
});
}
}, function(results) {
complete(results);
}, source);
};
_proto.getType = function getType(rule) {
if (rule.type === void 0 && rule.pattern instanceof RegExp) {
rule.type = "pattern";
}
if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
throw new Error(format("Unknown rule type %s", rule.type));
}
return rule.type || "string";
};
_proto.getValidationMethod = function getValidationMethod(rule) {
if (typeof rule.validator === "function") {
return rule.validator;
}
var keys2 = Object.keys(rule);
var messageIndex = keys2.indexOf("message");
if (messageIndex !== -1) {
keys2.splice(messageIndex, 1);
}
if (keys2.length === 1 && keys2[0] === "required") {
return validators.required;
}
return validators[this.getType(rule)] || void 0;
};
return Schema2;
}();
Schema.register = function register(type4, validator) {
if (typeof validator !== "function") {
throw new Error("Cannot register a validator by type, validator is not a function");
}
validators[type4] = validator;
};
Schema.warning = warning;
Schema.messages = messages;
Schema.validators = validators;
function toArray$1(value) {
if (value === void 0 || value === null) {
return [];
}
return Array.isArray(value) ? value : [value];
}
function get(entity, path) {
let current = entity;
for (let i2 = 0; i2 < path.length; i2 += 1) {
if (current === null || current === void 0) {
return void 0;
}
current = current[path[i2]];
}
return current;
}
function internalSet(entity, paths, value, removeIfUndefined) {
if (!paths.length) {
return value;
}
const [path, ...restPath] = paths;
let clone2;
if (!entity && typeof path === "number") {
clone2 = [];
} else if (Array.isArray(entity)) {
clone2 = [...entity];
} else {
clone2 = _extends$1({}, entity);
}
if (removeIfUndefined && value === void 0 && restPath.length === 1) {
delete clone2[path][restPath[0]];
} else {
clone2[path] = internalSet(clone2[path], restPath, value, removeIfUndefined);
}
return clone2;
}
function set(entity, paths, value) {
let removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
if (paths.length && removeIfUndefined && value === void 0 && !get(entity, paths.slice(0, -1))) {
return entity;
}
return internalSet(entity, paths, value, removeIfUndefined);
}
function getNamePath(path) {
return toArray$1(path);
}
function getValue(store, namePath) {
const value = get(store, namePath);
return value;
}
function setValue(store, namePath, value) {
let removeIfUndefined = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
const newStore = set(store, namePath, value, removeIfUndefined);
return newStore;
}
function containsNamePath(namePathList, namePath) {
return namePathList && namePathList.some((path) => matchNamePath(path, namePath));
}
function isObject(obj) {
return typeof obj === "object" && obj !== null && Object.getPrototypeOf(obj) === Object.prototype;
}
function internalSetValues(store, values) {
const newStore = Array.isArray(store) ? [...store] : _extends$1({}, store);
if (!values) {
return newStore;
}
Object.keys(values).forEach((key) => {
const prevValue = newStore[key];
const value = values[key];
const recursive = isObject(prevValue) && isObject(value);
newStore[key] = recursive ? internalSetValues(prevValue, value || {}) : value;
});
return newStore;
}
function setValues(store) {
for (var _len = arguments.length, restValues = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
restValues[_key - 1] = arguments[_key];
}
return restValues.reduce((current, newStore) => internalSetValues(current, newStore), store);
}
function cloneByNamePathList(store, namePathList) {
let newStore = {};
namePathList.forEach((namePath) => {
const value = getValue(store, namePath);
newStore = setValue(newStore, namePath, value);
});
return newStore;
}
function matchNamePath(namePath, changedNamePath) {
if (!namePath || !changedNamePath || namePath.length !== changedNamePath.length) {
return false;
}
return namePath.every((nameUnit, i2) => changedNamePath[i2] === nameUnit);
}
const typeTemplate = "'${name}' is not a valid ${type}";
const defaultValidateMessages = {
default: "Validation error on field '${name}'",
required: "'${name}' is required",
enum: "'${name}' must be one of [${enum}]",
whitespace: "'${name}' cannot be empty",
date: {
format: "'${name}' is invalid for format date",
parse: "'${name}' could not be parsed as date",
invalid: "'${name}' is invalid date"
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate
},
string: {
len: "'${name}' must be exactly ${len} characters",
min: "'${name}' must be at least ${min} characters",
max: "'${name}' cannot be longer than ${max} characters",
range: "'${name}' must be between ${min} and ${max} characters"
},
number: {
len: "'${name}' must equal ${len}",
min: "'${name}' cannot be less than ${min}",
max: "'${name}' cannot be greater than ${max}",
range: "'${name}' must be between ${min} and ${max}"
},
array: {
len: "'${name}' must be exactly ${len} in length",
min: "'${name}' cannot be less than ${min} in length",
max: "'${name}' cannot be greater than ${max} in length",
range: "'${name}' must be between ${min} and ${max} in length"
},
pattern: {
mismatch: "'${name}' does not match pattern ${pattern}"
}
};
var __awaiter$1 = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve) {
resolve(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e2) {
reject(e2);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e2) {
reject(e2);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const AsyncValidator = Schema;
function replaceMessage(template, kv) {
return template.replace(/\$\{\w+\}/g, (str) => {
const key = str.slice(2, -1);
return kv[key];
});
}
function validateRule(name, value, rule, options, messageVariables) {
return __awaiter$1(this, void 0, void 0, function* () {
const cloneRule = _extends$1({}, rule);
delete cloneRule.ruleIndex;
delete cloneRule.trigger;
let subRuleField = null;
if (cloneRule && cloneRule.type === "array" && cloneRule.defaultField) {
subRuleField = cloneRule.defaultField;
delete cloneRule.defaultField;
}
const validator = new AsyncValidator({
[name]: [cloneRule]
});
const messages2 = setValues({}, defaultValidateMessages, options.validateMessages);
validator.messages(messages2);
let result = [];
try {
yield Promise.resolve(validator.validate({
[name]: value
}, _extends$1({}, options)));
} catch (errObj) {
if (errObj.errors) {
result = errObj.errors.map((_ref, index2) => {
let {
message
} = _ref;
return (
// Wrap VueNode with `key`
isValidElement(message) ? cloneVNode(message, {
key: `error_${index2}`
}) : message
);
});
} else {
console.error(errObj);
result = [messages2.default()];
}
}
if (!result.length && subRuleField) {
const subResults = yield Promise.all(value.map((subValue, i2) => validateRule(`${name}.${i2}`, subValue, subRuleField, options, messageVariables)));
return subResults.reduce((prev2, errors) => [...prev2, ...errors], []);
}
const kv = _extends$1(_extends$1(_extends$1({}, rule), {
name,
enum: (rule.enum || []).join(", ")
}), messageVariables);
const fillVariableResult = result.map((error) => {
if (typeof error === "string") {
return replaceMessage(error, kv);
}
return error;
});
return fillVariableResult;
});
}
function validateRules(namePath, value, rules2, options, validateFirst, messageVariables) {
const name = namePath.join(".");
const filledRules = rules2.map((currentRule, ruleIndex) => {
const originValidatorFunc = currentRule.validator;
const cloneRule = _extends$1(_extends$1({}, currentRule), {
ruleIndex
});
if (originValidatorFunc) {
cloneRule.validator = (rule, val, callback) => {
let hasPromise = false;
const wrappedCallback = function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
Promise.resolve().then(() => {
warning$4(!hasPromise, "Your validator function has already return a promise. `callback` will be ignored.");
if (!hasPromise) {
callback(...args);
}
});
};
const promise = originValidatorFunc(rule, val, wrappedCallback);
hasPromise = promise && typeof promise.then === "function" && typeof promise.catch === "function";
warning$4(hasPromise, "`callback` is deprecated. Please return a promise instead.");
if (hasPromise) {
promise.then(() => {
callback();
}).catch((err) => {
callback(err || " ");
});
}
};
}
return cloneRule;
}).sort((_ref2, _ref3) => {
let {
warningOnly: w1,
ruleIndex: i1
} = _ref2;
let {
warningOnly: w2,
ruleIndex: i2
} = _ref3;
if (!!w1 === !!w2) {
return i1 - i2;
}
if (w1) {
return 1;
}
return -1;
});
let summaryPromise;
if (validateFirst === true) {
summaryPromise = new Promise((resolve, reject) => __awaiter$1(this, void 0, void 0, function* () {
for (let i2 = 0; i2 < filledRules.length; i2 += 1) {
const rule = filledRules[i2];
const errors = yield validateRule(name, value, rule, options, messageVariables);
if (errors.length) {
reject([{
errors,
rule
}]);
return;
}
}
resolve([]);
}));
} else {
const rulePromises = filledRules.map((rule) => validateRule(name, value, rule, options, messageVariables).then((errors) => ({
errors,
rule
})));
summaryPromise = (validateFirst ? finishOnFirstFailed(rulePromises) : finishOnAllFailed(rulePromises)).then((errors) => {
return Promise.reject(errors);
});
}
summaryPromise.catch((e2) => e2);
return summaryPromise;
}
function finishOnAllFailed(rulePromises) {
return __awaiter$1(this, void 0, void 0, function* () {
return Promise.all(rulePromises).then((errorsList) => {
const errors = [].concat(...errorsList);
return errors;
});
});
}
function finishOnFirstFailed(rulePromises) {
return __awaiter$1(this, void 0, void 0, function* () {
let count = 0;
return new Promise((resolve) => {
rulePromises.forEach((promise) => {
promise.then((ruleError) => {
if (ruleError.errors.length) {
resolve([ruleError]);
}
count += 1;
if (count === rulePromises.length) {
resolve([]);
}
});
});
});
});
}
const FormContextKey = Symbol("formContextKey");
const useProvideForm = (state) => {
provide(FormContextKey, state);
};
const useInjectForm = () => {
return inject(FormContextKey, {
name: computed(() => void 0),
labelAlign: computed(() => "right"),
vertical: computed(() => false),
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addField: (_eventKey, _field) => {
},
// eslint-disable-next-line @typescript-eslint/no-unused-vars
removeField: (_eventKey) => {
},
model: computed(() => void 0),
rules: computed(() => void 0),
colon: computed(() => void 0),
labelWrap: computed(() => void 0),
labelCol: computed(() => void 0),
requiredMark: computed(() => false),
validateTrigger: computed(() => void 0),
onValidate: () => {
},
validateMessages: computed(() => defaultValidateMessages)
});
};
const FormItemPrefixContextKey = Symbol("formItemPrefixContextKey");
const useProvideFormItemPrefix = (state) => {
provide(FormItemPrefixContextKey, state);
};
const useInjectFormItemPrefix = () => {
return inject(FormItemPrefixContextKey, {
prefixCls: computed(() => "")
});
};
function parseFlex(flex) {
if (typeof flex === "number") {
return `${flex} ${flex} auto`;
}
if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
return `0 0 ${flex}`;
}
return flex;
}
const colProps = () => ({
span: [String, Number],
order: [String, Number],
offset: [String, Number],
push: [String, Number],
pull: [String, Number],
xs: {
type: [String, Number, Object],
default: void 0
},
sm: {
type: [String, Number, Object],
default: void 0
},
md: {
type: [String, Number, Object],
default: void 0
},
lg: {
type: [String, Number, Object],
default: void 0
},
xl: {
type: [String, Number, Object],
default: void 0
},
xxl: {
type: [String, Number, Object],
default: void 0
},
prefixCls: String,
flex: [String, Number]
});
const sizes = ["xs", "sm", "md", "lg", "xl", "xxl"];
const Col = defineComponent({
compatConfig: {
MODE: 3
},
name: "ACol",
inheritAttrs: false,
props: colProps(),
setup(props, _ref) {
let {
slots,
attrs
} = _ref;
const {
gutter,
supportFlexGap,
wrap
} = useInjectRow();
const {
prefixCls,
direction
} = useConfigInject("col", props);
const [wrapSSR, hashId] = useColStyle(prefixCls);
const classes = computed(() => {
const {
span,
order,
offset: offset2,
push,
pull
} = props;
const pre = prefixCls.value;
let sizeClassObj = {};
sizes.forEach((size) => {
let sizeProps = {};
const propSize = props[size];
if (typeof propSize === "number") {
sizeProps.span = propSize;
} else if (typeof propSize === "object") {
sizeProps = propSize || {};
}
sizeClassObj = _extends$1(_extends$1({}, sizeClassObj), {
[`${pre}-${size}-${sizeProps.span}`]: sizeProps.span !== void 0,
[`${pre}-${size}-order-${sizeProps.order}`]: sizeProps.order || sizeProps.order === 0,
[`${pre}-${size}-offset-${sizeProps.offset}`]: sizeProps.offset || sizeProps.offset === 0,
[`${pre}-${size}-push-${sizeProps.push}`]: sizeProps.push || sizeProps.push === 0,
[`${pre}-${size}-pull-${sizeProps.pull}`]: sizeProps.pull || sizeProps.pull === 0,
[`${pre}-rtl`]: direction.value === "rtl"
});
});
return classNames(pre, {
[`${pre}-${span}`]: span !== void 0,
[`${pre}-order-${order}`]: order,
[`${pre}-offset-${offset2}`]: offset2,
[`${pre}-push-${push}`]: push,
[`${pre}-pull-${pull}`]: pull
}, sizeClassObj, attrs.class, hashId.value);
});
const mergedStyle = computed(() => {
const {
flex
} = props;
const gutterVal = gutter.value;
const style = {};
if (gutterVal && gutterVal[0] > 0) {
const horizontalGutter = `${gutterVal[0] / 2}px`;
style.paddingLeft = horizontalGutter;
style.paddingRight = horizontalGutter;
}
if (gutterVal && gutterVal[1] > 0 && !supportFlexGap.value) {
const verticalGutter = `${gutterVal[1] / 2}px`;
style.paddingTop = verticalGutter;
style.paddingBottom = verticalGutter;
}
if (flex) {
style.flex = parseFlex(flex);
if (wrap.value === false && !style.minWidth) {
style.minWidth = 0;
}
}
return style;
});
return () => {
var _a;
return wrapSSR(createVNode("div", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, {
"class": classes.value,
"style": [mergedStyle.value, attrs.style]
}), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]));
};
}
});
function returnEmptyString() {
return "";
}
function returnDocument(element) {
if (element) {
return element.ownerDocument;
}
return window.document;
}
function noop$1() {
}
const triggerProps = () => ({
action: PropTypes$1.oneOfType([PropTypes$1.string, PropTypes$1.arrayOf(PropTypes$1.string)]).def([]),
showAction: PropTypes$1.any.def([]),
hideAction: PropTypes$1.any.def([]),
getPopupClassNameFromAlign: PropTypes$1.any.def(returnEmptyString),
onPopupVisibleChange: Function,
afterPopupVisibleChange: PropTypes$1.func.def(noop$1),
popup: PropTypes$1.any,
arrow: PropTypes$1.bool.def(true),
popupStyle: {
type: Object,
default: void 0
},
prefixCls: PropTypes$1.string.def("rc-trigger-popup"),
popupClassName: PropTypes$1.string.def(""),
popupPlacement: String,
builtinPlacements: PropTypes$1.object,
popupTransitionName: String,
popupAnimation: PropTypes$1.any,
mouseEnterDelay: PropTypes$1.number.def(0),
mouseLeaveDelay: PropTypes$1.number.def(0.1),
zIndex: Number,
focusDelay: PropTypes$1.number.def(0),
blurDelay: PropTypes$1.number.def(0.15),
getPopupContainer: Function,
getDocument: PropTypes$1.func.def(returnDocument),
forceRender: {
type: Boolean,
default: void 0
},
destroyPopupOnHide: {
type: Boolean,
default: false
},
mask: {
type: Boolean,
default: false
},
maskClosable: {
type: Boolean,
default: true
},
// onPopupAlign: PropTypes.func.def(noop),
popupAlign: PropTypes$1.object.def(() => ({})),
popupVisible: {
type: Boolean,
default: void 0
},
defaultPopupVisible: {
type: Boolean,
default: false
},
maskTransitionName: String,
maskAnimation: String,
stretch: String,
alignPoint: {
type: Boolean,
default: void 0
},
autoDestroy: {
type: Boolean,
default: false
},
mobile: Object,
getTriggerDOMNode: Function
});
let raf = (callback) => setTimeout(callback, 16);
let caf = (num) => clearTimeout(num);
if (typeof window !== "undefined" && "requestAnimationFrame" in window) {
raf = (callback) => window.requestAnimationFrame(callback);
caf = (handle) => window.cancelAnimationFrame(handle);
}
let rafUUID = 0;
const rafIds = /* @__PURE__ */ new Map();
function cleanup(id) {
rafIds.delete(id);
}
function wrapperRaf(callback) {
let times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
rafUUID += 1;
const id = rafUUID;
function callRef(leftTimes) {
if (leftTimes === 0) {
cleanup(id);
callback();
} else {
const realId = raf(() => {
callRef(leftTimes - 1);
});
rafIds.set(id, realId);
}
}
callRef(times);
return id;
}
wrapperRaf.cancel = (id) => {
const realId = rafIds.get(id);
cleanup(realId);
return caf(realId);
};
let supportsPassive = false;
try {
const opts = Object.defineProperty({}, "passive", {
get() {
supportsPassive = true;
}
});
window.addEventListener("testPassive", null, opts);
window.removeEventListener("testPassive", null, opts);
} catch (e2) {
}
const supportsPassive$1 = supportsPassive;
function addEventListenerWrap(target, eventType, cb, option) {
if (target && target.addEventListener) {
let opt = option;
if (opt === void 0 && supportsPassive$1 && (eventType === "touchstart" || eventType === "touchmove" || eventType === "wheel")) {
opt = {
passive: false
};
}
target.addEventListener(eventType, cb, opt);
}
return {
remove: () => {
if (target && target.removeEventListener) {
target.removeEventListener(eventType, cb);
}
}
};
}
const innerProps = {
visible: Boolean,
prefixCls: String,
zIndex: Number,
destroyPopupOnHide: Boolean,
forceRender: Boolean,
arrow: {
type: Boolean,
default: true
},
// Legacy Motion
animation: [String, Object],
transitionName: String,
// Measure
stretch: {
type: String
},
// Align
align: {
type: Object
},
point: {
type: Object
},
getRootDomNode: {
type: Function
},
getClassNameFromAlign: {
type: Function
},
onAlign: {
type: Function
},
onMouseenter: {
type: Function
},
onMouseleave: {
type: Function
},
onMousedown: {
type: Function
},
onTouchstart: {
type: Function
}
};
const mobileProps = _extends$1(_extends$1({}, innerProps), {
mobile: {
type: Object
}
});
const popupProps = _extends$1(_extends$1({}, innerProps), {
mask: Boolean,
mobile: {
type: Object
},
maskAnimation: String,
maskTransitionName: String
});
function getMotion(_ref) {
let {
prefixCls,
animation,
transitionName
} = _ref;
if (animation) {
return {
name: `${prefixCls}-${animation}`
};
}
if (transitionName) {
return {
name: transitionName
};
}
return {};
}
function Mask(props) {
const {
prefixCls,
visible,
zIndex,
mask,
maskAnimation,
maskTransitionName
} = props;
if (!mask) {
return null;
}
let motion = {};
if (maskTransitionName || maskAnimation) {
motion = getMotion({
prefixCls,
transitionName: maskTransitionName,
animation: maskAnimation
});
}
return createVNode(Transition, _objectSpread2$1({
"appear": true
}, motion), {
default: () => [withDirectives(createVNode("div", {
"style": {
zIndex
},
"class": `${prefixCls}-mask`
}, null), [[resolveDirective("if"), visible]])]
});
}
Mask.displayName = "Mask";
const MobilePopupInner = defineComponent({
compatConfig: {
MODE: 3
},
name: "MobilePopupInner",
inheritAttrs: false,
props: mobileProps,
emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
setup(props, _ref) {
let {
expose,
slots
} = _ref;
const elementRef = ref();
expose({
forceAlign: () => {
},
getElement: () => elementRef.value
});
return () => {
var _a;
const {
zIndex,
visible,
prefixCls,
mobile: {
popupClassName,
popupStyle,
popupMotion = {},
popupRender
} = {}
} = props;
const mergedStyle = _extends$1({
zIndex
}, popupStyle);
let childNode = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
if (childNode.length > 1) {
childNode = createVNode("div", {
"class": `${prefixCls}-content`
}, [childNode]);
}
if (popupRender) {
childNode = popupRender(childNode);
}
const mergedClassName = classNames(prefixCls, popupClassName);
return createVNode(Transition, _objectSpread2$1({
"ref": elementRef
}, popupMotion), {
default: () => [visible ? createVNode("div", {
"class": mergedClassName,
"style": mergedStyle
}, [childNode]) : null]
});
};
}
});
var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve) {
resolve(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e2) {
reject(e2);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e2) {
reject(e2);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const StatusQueue = ["measure", "align", null, "motion"];
const useVisibleStatus = (visible, doMeasure) => {
const status = shallowRef(null);
const rafRef = shallowRef();
const destroyRef = shallowRef(false);
function setStatus(nextStatus) {
if (!destroyRef.value) {
status.value = nextStatus;
}
}
function cancelRaf() {
wrapperRaf.cancel(rafRef.value);
}
function goNextStatus(callback) {
cancelRaf();
rafRef.value = wrapperRaf(() => {
let newStatus = status.value;
switch (status.value) {
case "align":
newStatus = "motion";
break;
case "motion":
newStatus = "stable";
break;
}
setStatus(newStatus);
callback === null || callback === void 0 ? void 0 : callback();
});
}
watch(visible, () => {
setStatus("measure");
}, {
immediate: true,
flush: "post"
});
onMounted(() => {
watch(status, () => {
switch (status.value) {
case "measure":
doMeasure();
break;
}
if (status.value) {
rafRef.value = wrapperRaf(() => __awaiter(void 0, void 0, void 0, function* () {
const index2 = StatusQueue.indexOf(status.value);
const nextStatus = StatusQueue[index2 + 1];
if (nextStatus && index2 !== -1) {
setStatus(nextStatus);
}
}));
}
}, {
immediate: true,
flush: "post"
});
});
onBeforeUnmount(() => {
destroyRef.value = true;
cancelRaf();
});
return [status, goNextStatus];
};
const useStretchStyle = (stretch) => {
const targetSize = shallowRef({
width: 0,
height: 0
});
function measureStretch(element) {
targetSize.value = {
width: element.offsetWidth,
height: element.offsetHeight
};
}
const style = computed(() => {
const sizeStyle = {};
if (stretch.value) {
const {
width,
height
} = targetSize.value;
if (stretch.value.indexOf("height") !== -1 && height) {
sizeStyle.height = `${height}px`;
} else if (stretch.value.indexOf("minHeight") !== -1 && height) {
sizeStyle.minHeight = `${height}px`;
}
if (stretch.value.indexOf("width") !== -1 && width) {
sizeStyle.width = `${width}px`;
} else if (stretch.value.indexOf("minWidth") !== -1 && width) {
sizeStyle.minWidth = `${width}px`;
}
}
return sizeStyle;
});
return [style, measureStretch];
};
function ownKeys(object4, enumerableOnly) {
var keys2 = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys2.push.apply(keys2, symbols);
}
return keys2;
}
function _objectSpread2(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = null != arguments[i2] ? arguments[i2] : {};
i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) {
_defineProperty$1(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof(obj);
}
function _defineProperty$1(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var vendorPrefix;
var jsCssMap = {
Webkit: "-webkit-",
Moz: "-moz-",
// IE did it wrong again ...
ms: "-ms-",
O: "-o-"
};
function getVendorPrefix() {
if (vendorPrefix !== void 0) {
return vendorPrefix;
}
vendorPrefix = "";
var style = document.createElement("p").style;
var testProp = "Transform";
for (var key in jsCssMap) {
if (key + testProp in style) {
vendorPrefix = key;
}
}
return vendorPrefix;
}
function getTransitionName$1() {
return getVendorPrefix() ? "".concat(getVendorPrefix(), "TransitionProperty") : "transitionProperty";
}
function getTransformName() {
return getVendorPrefix() ? "".concat(getVendorPrefix(), "Transform") : "transform";
}
function setTransitionProperty(node2, value) {
var name = getTransitionName$1();
if (name) {
node2.style[name] = value;
if (name !== "transitionProperty") {
node2.style.transitionProperty = value;
}
}
}
function setTransform(node2, value) {
var name = getTransformName();
if (name) {
node2.style[name] = value;
if (name !== "transform") {
node2.style.transform = value;
}
}
}
function getTransitionProperty(node2) {
return node2.style.transitionProperty || node2.style[getTransitionName$1()];
}
function getTransformXY(node2) {
var style = window.getComputedStyle(node2, null);
var transform = style.getPropertyValue("transform") || style.getPropertyValue(getTransformName());
if (transform && transform !== "none") {
var matrix = transform.replace(/[^0-9\-.,]/g, "").split(",");
return {
x: parseFloat(matrix[12] || matrix[4], 0),
y: parseFloat(matrix[13] || matrix[5], 0)
};
}
return {
x: 0,
y: 0
};
}
var matrix2d = /matrix\((.*)\)/;
var matrix3d = /matrix3d\((.*)\)/;
function setTransformXY(node2, xy) {
var style = window.getComputedStyle(node2, null);
var transform = style.getPropertyValue("transform") || style.getPropertyValue(getTransformName());
if (transform && transform !== "none") {
var arr;
var match2d = transform.match(matrix2d);
if (match2d) {
match2d = match2d[1];
arr = match2d.split(",").map(function(item) {
return parseFloat(item, 10);
});
arr[4] = xy.x;
arr[5] = xy.y;
setTransform(node2, "matrix(".concat(arr.join(","), ")"));
} else {
var match3d = transform.match(matrix3d)[1];
arr = match3d.split(",").map(function(item) {
return parseFloat(item, 10);
});
arr[12] = xy.x;
arr[13] = xy.y;
setTransform(node2, "matrix3d(".concat(arr.join(","), ")"));
}
} else {
setTransform(node2, "translateX(".concat(xy.x, "px) translateY(").concat(xy.y, "px) translateZ(0)"));
}
}
var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
var getComputedStyleX;
function forceRelayout(elem) {
var originalStyle = elem.style.display;
elem.style.display = "none";
elem.offsetHeight;
elem.style.display = originalStyle;
}
function css(el, name, v2) {
var value = v2;
if (_typeof(name) === "object") {
for (var i2 in name) {
if (name.hasOwnProperty(i2)) {
css(el, i2, name[i2]);
}
}
return void 0;
}
if (typeof value !== "undefined") {
if (typeof value === "number") {
value = "".concat(value, "px");
}
el.style[name] = value;
return void 0;
}
return getComputedStyleX(el, name);
}
function getClientPosition(elem) {
var box;
var x2;
var y2;
var doc = elem.ownerDocument;
var body = doc.body;
var docElem = doc && doc.documentElement;
box = elem.getBoundingClientRect();
x2 = Math.floor(box.left);
y2 = Math.floor(box.top);
x2 -= docElem.clientLeft || body.clientLeft || 0;
y2 -= docElem.clientTop || body.clientTop || 0;
return {
left: x2,
top: y2
};
}
function getScroll(w2, top) {
var ret = w2["page".concat(top ? "Y" : "X", "Offset")];
var method4 = "scroll".concat(top ? "Top" : "Left");
if (typeof ret !== "number") {
var d2 = w2.document;
ret = d2.documentElement[method4];
if (typeof ret !== "number") {
ret = d2.body[method4];
}
}
return ret;
}
function getScrollLeft(w2) {
return getScroll(w2);
}
function getScrollTop(w2) {
return getScroll(w2, true);
}
function getOffset(el) {
var pos = getClientPosition(el);
var doc = el.ownerDocument;
var w2 = doc.defaultView || doc.parentWindow;
pos.left += getScrollLeft(w2);
pos.top += getScrollTop(w2);
return pos;
}
function isWindow(obj) {
return obj !== null && obj !== void 0 && obj == obj.window;
}
function getDocument(node2) {
if (isWindow(node2)) {
return node2.document;
}
if (node2.nodeType === 9) {
return node2;
}
return node2.ownerDocument;
}
function _getComputedStyle(elem, name, cs) {
var computedStyle = cs;
var val = "";
var d2 = getDocument(elem);
computedStyle = computedStyle || d2.defaultView.getComputedStyle(elem, null);
if (computedStyle) {
val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
return val;
}
var _RE_NUM_NO_PX = new RegExp("^(".concat(RE_NUM, ")(?!px)[a-z%]+$"), "i");
var RE_POS = /^(top|right|bottom|left)$/;
var CURRENT_STYLE = "currentStyle";
var RUNTIME_STYLE = "runtimeStyle";
var LEFT = "left";
var PX = "px";
function _getComputedStyleIE(elem, name) {
var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
var style = elem.style;
var left = style[LEFT];
var rsLeft = elem[RUNTIME_STYLE][LEFT];
elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
style[LEFT] = name === "fontSize" ? "1em" : ret || 0;
ret = style.pixelLeft + PX;
style[LEFT] = left;
elem[RUNTIME_STYLE][LEFT] = rsLeft;
}
return ret === "" ? "auto" : ret;
}
if (typeof window !== "undefined") {
getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
}
function getOffsetDirection(dir, option) {
if (dir === "left") {
return option.useCssRight ? "right" : dir;
}
return option.useCssBottom ? "bottom" : dir;
}
function oppositeOffsetDirection(dir) {
if (dir === "left") {
return "right";
} else if (dir === "right") {
return "left";
} else if (dir === "top") {
return "bottom";
} else if (dir === "bottom") {
return "top";
}
}
function setLeftTop(elem, offset2, option) {
if (css(elem, "position") === "static") {
elem.style.position = "relative";
}
var presetH = -999;
var presetV = -999;
var horizontalProperty = getOffsetDirection("left", option);
var verticalProperty = getOffsetDirection("top", option);
var oppositeHorizontalProperty = oppositeOffsetDirection(horizontalProperty);
var oppositeVerticalProperty = oppositeOffsetDirection(verticalProperty);
if (horizontalProperty !== "left") {
presetH = 999;
}
if (verticalProperty !== "top") {
presetV = 999;
}
var originalTransition = "";
var originalOffset = getOffset(elem);
if ("left" in offset2 || "top" in offset2) {
originalTransition = getTransitionProperty(elem) || "";
setTransitionProperty(elem, "none");
}
if ("left" in offset2) {
elem.style[oppositeHorizontalProperty] = "";
elem.style[horizontalProperty] = "".concat(presetH, "px");
}
if ("top" in offset2) {
elem.style[oppositeVerticalProperty] = "";
elem.style[verticalProperty] = "".concat(presetV, "px");
}
forceRelayout(elem);
var old = getOffset(elem);
var originalStyle = {};
for (var key in offset2) {
if (offset2.hasOwnProperty(key)) {
var dir = getOffsetDirection(key, option);
var preset = key === "left" ? presetH : presetV;
var off = originalOffset[key] - old[key];
if (dir === key) {
originalStyle[dir] = preset + off;
} else {
originalStyle[dir] = preset - off;
}
}
}
css(elem, originalStyle);
forceRelayout(elem);
if ("left" in offset2 || "top" in offset2) {
setTransitionProperty(elem, originalTransition);
}
var ret = {};
for (var _key in offset2) {
if (offset2.hasOwnProperty(_key)) {
var _dir = getOffsetDirection(_key, option);
var _off = offset2[_key] - originalOffset[_key];
if (_key === _dir) {
ret[_dir] = originalStyle[_dir] + _off;
} else {
ret[_dir] = originalStyle[_dir] - _off;
}
}
}
css(elem, ret);
}
function setTransform$1(elem, offset2) {
var originalOffset = getOffset(elem);
var originalXY = getTransformXY(elem);
var resultXY = {
x: originalXY.x,
y: originalXY.y
};
if ("left" in offset2) {
resultXY.x = originalXY.x + offset2.left - originalOffset.left;
}
if ("top" in offset2) {
resultXY.y = originalXY.y + offset2.top - originalOffset.top;
}
setTransformXY(elem, resultXY);
}
function setOffset(elem, offset2, option) {
if (option.ignoreShake) {
var oriOffset = getOffset(elem);
var oLeft = oriOffset.left.toFixed(0);
var oTop = oriOffset.top.toFixed(0);
var tLeft = offset2.left.toFixed(0);
var tTop = offset2.top.toFixed(0);
if (oLeft === tLeft && oTop === tTop) {
return;
}
}
if (option.useCssRight || option.useCssBottom) {
setLeftTop(elem, offset2, option);
} else if (option.useCssTransform && getTransformName() in document.body.style) {
setTransform$1(elem, offset2);
} else {
setLeftTop(elem, offset2, option);
}
}
function each(arr, fn) {
for (var i2 = 0; i2 < arr.length; i2++) {
fn(arr[i2]);
}
}
function isBorderBoxFn(elem) {
return getComputedStyleX(elem, "boxSizing") === "border-box";
}
var BOX_MODELS = ["margin", "border", "padding"];
var CONTENT_INDEX = -1;
var PADDING_INDEX = 2;
var BORDER_INDEX = 1;
var MARGIN_INDEX = 0;
function swap(elem, options, callback) {
var old = {};
var style = elem.style;
var name;
for (name in options) {
if (options.hasOwnProperty(name)) {
old[name] = style[name];
style[name] = options[name];
}
}
callback.call(elem);
for (name in options) {
if (options.hasOwnProperty(name)) {
style[name] = old[name];
}
}
}
function getPBMWidth(elem, props, which) {
var value = 0;
var prop;
var j2;
var i2;
for (j2 = 0; j2 < props.length; j2++) {
prop = props[j2];
if (prop) {
for (i2 = 0; i2 < which.length; i2++) {
var cssProp = void 0;
if (prop === "border") {
cssProp = "".concat(prop).concat(which[i2], "Width");
} else {
cssProp = prop + which[i2];
}
value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
}
}
}
return value;
}
var domUtils = {
getParent: function getParent(element) {
var parent2 = element;
do {
if (parent2.nodeType === 11 && parent2.host) {
parent2 = parent2.host;
} else {
parent2 = parent2.parentNode;
}
} while (parent2 && parent2.nodeType !== 1 && parent2.nodeType !== 9);
return parent2;
}
};
each(["Width", "Height"], function(name) {
domUtils["doc".concat(name)] = function(refWin) {
var d2 = refWin.document;
return Math.max(
// firefox chrome documentElement.scrollHeight< body.scrollHeight
// ie standard mode : documentElement.scrollHeight> body.scrollHeight
d2.documentElement["scroll".concat(name)],
// quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
d2.body["scroll".concat(name)],
domUtils["viewport".concat(name)](d2)
);
};
domUtils["viewport".concat(name)] = function(win) {
var prop = "client".concat(name);
var doc = win.document;
var body = doc.body;
var documentElement = doc.documentElement;
var documentElementProp = documentElement[prop];
return doc.compatMode === "CSS1Compat" && documentElementProp || body && body[prop] || documentElementProp;
};
});
function getWH(elem, name, ex) {
var extra = ex;
if (isWindow(elem)) {
return name === "width" ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
} else if (elem.nodeType === 9) {
return name === "width" ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
}
var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"];
var borderBoxValue = name === "width" ? Math.floor(elem.getBoundingClientRect().width) : Math.floor(elem.getBoundingClientRect().height);
var isBorderBox = isBorderBoxFn(elem);
var cssBoxValue = 0;
if (borderBoxValue === null || borderBoxValue === void 0 || borderBoxValue <= 0) {
borderBoxValue = void 0;
cssBoxValue = getComputedStyleX(elem, name);
if (cssBoxValue === null || cssBoxValue === void 0 || Number(cssBoxValue) < 0) {
cssBoxValue = elem.style[name] || 0;
}
cssBoxValue = Math.floor(parseFloat(cssBoxValue)) || 0;
}
if (extra === void 0) {
extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
}
var borderBoxValueOrIsBorderBox = borderBoxValue !== void 0 || isBorderBox;
var val = borderBoxValue || cssBoxValue;
if (extra === CONTENT_INDEX) {
if (borderBoxValueOrIsBorderBox) {
return val - getPBMWidth(elem, ["border", "padding"], which);
}
return cssBoxValue;
} else if (borderBoxValueOrIsBorderBox) {
if (extra === BORDER_INDEX) {
return val;
}
return val + (extra === PADDING_INDEX ? -getPBMWidth(elem, ["border"], which) : getPBMWidth(elem, ["margin"], which));
}
return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which);
}
var cssShow = {
position: "absolute",
visibility: "hidden",
display: "block"
};
function getWHIgnoreDisplay() {
for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
args[_key2] = arguments[_key2];
}
var val;
var elem = args[0];
if (elem.offsetWidth !== 0) {
val = getWH.apply(void 0, args);
} else {
swap(elem, cssShow, function() {
val = getWH.apply(void 0, args);
});
}
return val;
}
each(["width", "height"], function(name) {
var first = name.charAt(0).toUpperCase() + name.slice(1);
domUtils["outer".concat(first)] = function(el, includeMargin) {
return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
};
var which = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"];
domUtils[name] = function(elem, v2) {
var val = v2;
if (val !== void 0) {
if (elem) {
var isBorderBox = isBorderBoxFn(elem);
if (isBorderBox) {
val += getPBMWidth(elem, ["padding", "border"], which);
}
return css(elem, name, val);
}
return void 0;
}
return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
};
});
function mix(to, from2) {
for (var i2 in from2) {
if (from2.hasOwnProperty(i2)) {
to[i2] = from2[i2];
}
}
return to;
}
var utils = {
getWindow: function getWindow(node2) {
if (node2 && node2.document && node2.setTimeout) {
return node2;
}
var doc = node2.ownerDocument || node2;
return doc.defaultView || doc.parentWindow;
},
getDocument,
offset: function offset(el, value, option) {
if (typeof value !== "undefined") {
setOffset(el, value, option || {});
} else {
return getOffset(el);
}
},
isWindow,
each,
css,
clone: function clone(obj) {
var i2;
var ret = {};
for (i2 in obj) {
if (obj.hasOwnProperty(i2)) {
ret[i2] = obj[i2];
}
}
var overflow = obj.overflow;
if (overflow) {
for (i2 in obj) {
if (obj.hasOwnProperty(i2)) {
ret.overflow[i2] = obj.overflow[i2];
}
}
}
return ret;
},
mix,
getWindowScrollLeft: function getWindowScrollLeft(w2) {
return getScrollLeft(w2);
},
getWindowScrollTop: function getWindowScrollTop(w2) {
return getScrollTop(w2);
},
merge: function merge2() {
var ret = {};
for (var i2 = 0; i2 < arguments.length; i2++) {
utils.mix(ret, i2 < 0 || arguments.length <= i2 ? void 0 : arguments[i2]);
}
return ret;
},
viewportWidth: 0,
viewportHeight: 0
};
mix(utils, domUtils);
var getParent$1 = utils.getParent;
function getOffsetParent(element) {
if (utils.isWindow(element) || element.nodeType === 9) {
return null;
}
var doc = utils.getDocument(element);
var body = doc.body;
var parent2;
var positionStyle = utils.css(element, "position");
var skipStatic = positionStyle === "fixed" || positionStyle === "absolute";
if (!skipStatic) {
return element.nodeName.toLowerCase() === "html" ? null : getParent$1(element);
}
for (parent2 = getParent$1(element); parent2 && parent2 !== body && parent2.nodeType !== 9; parent2 = getParent$1(parent2)) {
positionStyle = utils.css(parent2, "position");
if (positionStyle !== "static") {
return parent2;
}
}
return null;
}
var getParent$1$1 = utils.getParent;
function isAncestorFixed(element) {
if (utils.isWindow(element) || element.nodeType === 9) {
return false;
}
var doc = utils.getDocument(element);
var body = doc.body;
var parent2 = null;
for (
parent2 = getParent$1$1(element);
// 修复元素位于 document.documentElement 下导致崩溃问题
parent2 && parent2 !== body && parent2 !== doc;
parent2 = getParent$1$1(parent2)
) {
var positionStyle = utils.css(parent2, "position");
if (positionStyle === "fixed") {
return true;
}
}
return false;
}
function getVisibleRectForElement(element, alwaysByViewport) {
var visibleRect = {
left: 0,
right: Infinity,
top: 0,
bottom: Infinity
};
var el = getOffsetParent(element);
var doc = utils.getDocument(element);
var win = doc.defaultView || doc.parentWindow;
var body = doc.body;
var documentElement = doc.documentElement;
while (el) {
if ((navigator.userAgent.indexOf("MSIE") === -1 || el.clientWidth !== 0) && // body may have overflow set on it, yet we still get the entire
// viewport. In some browsers, el.offsetParent may be
// document.documentElement, so check for that too.
el !== body && el !== documentElement && utils.css(el, "overflow") !== "visible") {
var pos = utils.offset(el);
pos.left += el.clientLeft;
pos.top += el.clientTop;
visibleRect.top = Math.max(visibleRect.top, pos.top);
visibleRect.right = Math.min(
visibleRect.right,
// consider area without scrollBar
pos.left + el.clientWidth
);
visibleRect.bottom = Math.min(visibleRect.bottom, pos.top + el.clientHeight);
visibleRect.left = Math.max(visibleRect.left, pos.left);
} else if (el === body || el === documentElement) {
break;
}
el = getOffsetParent(el);
}
var originalPosition = null;
if (!utils.isWindow(element) && element.nodeType !== 9) {
originalPosition = element.style.position;
var position2 = utils.css(element, "position");
if (position2 === "absolute") {
element.style.position = "fixed";
}
}
var scrollX = utils.getWindowScrollLeft(win);
var scrollY = utils.getWindowScrollTop(win);
var viewportWidth = utils.viewportWidth(win);
var viewportHeight = utils.viewportHeight(win);
var documentWidth = documentElement.scrollWidth;
var documentHeight = documentElement.scrollHeight;
var bodyStyle = window.getComputedStyle(body);
if (bodyStyle.overflowX === "hidden") {
documentWidth = win.innerWidth;
}
if (bodyStyle.overflowY === "hidden") {
documentHeight = win.innerHeight;
}
if (element.style) {
element.style.position = originalPosition;
}
if (alwaysByViewport || isAncestorFixed(element)) {
visibleRect.left = Math.max(visibleRect.left, scrollX);
visibleRect.top = Math.max(visibleRect.top, scrollY);
visibleRect.right = Math.min(visibleRect.right, scrollX + viewportWidth);
visibleRect.bottom = Math.min(visibleRect.bottom, scrollY + viewportHeight);
} else {
var maxVisibleWidth = Math.max(documentWidth, scrollX + viewportWidth);
visibleRect.right = Math.min(visibleRect.right, maxVisibleWidth);
var maxVisibleHeight = Math.max(documentHeight, scrollY + viewportHeight);
visibleRect.bottom = Math.min(visibleRect.bottom, maxVisibleHeight);
}
return visibleRect.top >= 0 && visibleRect.left >= 0 && visibleRect.bottom > visibleRect.top && visibleRect.right > visibleRect.left ? visibleRect : null;
}
function adjustForViewport(elFuturePos, elRegion, visibleRect, overflow) {
var pos = utils.clone(elFuturePos);
var size = {
width: elRegion.width,
height: elRegion.height
};
if (overflow.adjustX && pos.left < visibleRect.left) {
pos.left = visibleRect.left;
}
if (overflow.resizeWidth && pos.left >= visibleRect.left && pos.left + size.width > visibleRect.right) {
size.width -= pos.left + size.width - visibleRect.right;
}
if (overflow.adjustX && pos.left + size.width > visibleRect.right) {
pos.left = Math.max(visibleRect.right - size.width, visibleRect.left);
}
if (overflow.adjustY && pos.top < visibleRect.top) {
pos.top = visibleRect.top;
}
if (overflow.resizeHeight && pos.top >= visibleRect.top && pos.top + size.height > visibleRect.bottom) {
size.height -= pos.top + size.height - visibleRect.bottom;
}
if (overflow.adjustY && pos.top + size.height > visibleRect.bottom) {
pos.top = Math.max(visibleRect.bottom - size.height, visibleRect.top);
}
return utils.mix(pos, size);
}
function getRegion(node2) {
var offset2;
var w2;
var h2;
if (!utils.isWindow(node2) && node2.nodeType !== 9) {
offset2 = utils.offset(node2);
w2 = utils.outerWidth(node2);
h2 = utils.outerHeight(node2);
} else {
var win = utils.getWindow(node2);
offset2 = {
left: utils.getWindowScrollLeft(win),
top: utils.getWindowScrollTop(win)
};
w2 = utils.viewportWidth(win);
h2 = utils.viewportHeight(win);
}
offset2.width = w2;
offset2.height = h2;
return offset2;
}
function getAlignOffset(region, align) {
var V2 = align.charAt(0);
var H = align.charAt(1);
var w2 = region.width;
var h2 = region.height;
var x2 = region.left;
var y2 = region.top;
if (V2 === "c") {
y2 += h2 / 2;
} else if (V2 === "b") {
y2 += h2;
}
if (H === "c") {
x2 += w2 / 2;
} else if (H === "r") {
x2 += w2;
}
return {
left: x2,
top: y2
};
}
function getElFuturePos(elRegion, refNodeRegion, points, offset2, targetOffset2) {
var p1 = getAlignOffset(refNodeRegion, points[1]);
var p2 = getAlignOffset(elRegion, points[0]);
var diff = [p2.left - p1.left, p2.top - p1.top];
return {
left: Math.round(elRegion.left - diff[0] + offset2[0] - targetOffset2[0]),
top: Math.round(elRegion.top - diff[1] + offset2[1] - targetOffset2[1])
};
}
function isFailX(elFuturePos, elRegion, visibleRect) {
return elFuturePos.left < visibleRect.left || elFuturePos.left + elRegion.width > visibleRect.right;
}
function isFailY(elFuturePos, elRegion, visibleRect) {
return elFuturePos.top < visibleRect.top || elFuturePos.top + elRegion.height > visibleRect.bottom;
}
function isCompleteFailX(elFuturePos, elRegion, visibleRect) {
return elFuturePos.left > visibleRect.right || elFuturePos.left + elRegion.width < visibleRect.left;
}
function isCompleteFailY(elFuturePos, elRegion, visibleRect) {
return elFuturePos.top > visibleRect.bottom || elFuturePos.top + elRegion.height < visibleRect.top;
}
function flip(points, reg, map) {
var ret = [];
utils.each(points, function(p) {
ret.push(p.replace(reg, function(m2) {
return map[m2];
}));
});
return ret;
}
function flipOffset(offset2, index2) {
offset2[index2] = -offset2[index2];
return offset2;
}
function convertOffset(str, offsetLen) {
var n2;
if (/%$/.test(str)) {
n2 = parseInt(str.substring(0, str.length - 1), 10) / 100 * offsetLen;
} else {
n2 = parseInt(str, 10);
}
return n2 || 0;
}
function normalizeOffset(offset2, el) {
offset2[0] = convertOffset(offset2[0], el.width);
offset2[1] = convertOffset(offset2[1], el.height);
}
function doAlign(el, tgtRegion, align, isTgtRegionVisible) {
var points = align.points;
var offset2 = align.offset || [0, 0];
var targetOffset2 = align.targetOffset || [0, 0];
var overflow = align.overflow;
var source = align.source || el;
offset2 = [].concat(offset2);
targetOffset2 = [].concat(targetOffset2);
overflow = overflow || {};
var newOverflowCfg = {};
var fail = 0;
var alwaysByViewport = !!(overflow && overflow.alwaysByViewport);
var visibleRect = getVisibleRectForElement(source, alwaysByViewport);
var elRegion = getRegion(source);
normalizeOffset(offset2, elRegion);
normalizeOffset(targetOffset2, tgtRegion);
var elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset2);
var newElRegion = utils.merge(elRegion, elFuturePos);
if (visibleRect && (overflow.adjustX || overflow.adjustY) && isTgtRegionVisible) {
if (overflow.adjustX) {
if (isFailX(elFuturePos, elRegion, visibleRect)) {
var newPoints = flip(points, /[lr]/gi, {
l: "r",
r: "l"
});
var newOffset = flipOffset(offset2, 0);
var newTargetOffset = flipOffset(targetOffset2, 0);
var newElFuturePos = getElFuturePos(elRegion, tgtRegion, newPoints, newOffset, newTargetOffset);
if (!isCompleteFailX(newElFuturePos, elRegion, visibleRect)) {
fail = 1;
points = newPoints;
offset2 = newOffset;
targetOffset2 = newTargetOffset;
}
}
}
if (overflow.adjustY) {
if (isFailY(elFuturePos, elRegion, visibleRect)) {
var _newPoints = flip(points, /[tb]/gi, {
t: "b",
b: "t"
});
var _newOffset = flipOffset(offset2, 1);
var _newTargetOffset = flipOffset(targetOffset2, 1);
var _newElFuturePos = getElFuturePos(elRegion, tgtRegion, _newPoints, _newOffset, _newTargetOffset);
if (!isCompleteFailY(_newElFuturePos, elRegion, visibleRect)) {
fail = 1;
points = _newPoints;
offset2 = _newOffset;
targetOffset2 = _newTargetOffset;
}
}
}
if (fail) {
elFuturePos = getElFuturePos(elRegion, tgtRegion, points, offset2, targetOffset2);
utils.mix(newElRegion, elFuturePos);
}
var isStillFailX = isFailX(elFuturePos, elRegion, visibleRect);
var isStillFailY = isFailY(elFuturePos, elRegion, visibleRect);
if (isStillFailX || isStillFailY) {
var _newPoints2 = points;
if (isStillFailX) {
_newPoints2 = flip(points, /[lr]/gi, {
l: "r",
r: "l"
});
}
if (isStillFailY) {
_newPoints2 = flip(points, /[tb]/gi, {
t: "b",
b: "t"
});
}
points = _newPoints2;
offset2 = align.offset || [0, 0];
targetOffset2 = align.targetOffset || [0, 0];
}
newOverflowCfg.adjustX = overflow.adjustX && isStillFailX;
newOverflowCfg.adjustY = overflow.adjustY && isStillFailY;
if (newOverflowCfg.adjustX || newOverflowCfg.adjustY) {
newElRegion = adjustForViewport(elFuturePos, elRegion, visibleRect, newOverflowCfg);
}
}
if (newElRegion.width !== elRegion.width) {
utils.css(source, "width", utils.width(source) + newElRegion.width - elRegion.width);
}
if (newElRegion.height !== elRegion.height) {
utils.css(source, "height", utils.height(source) + newElRegion.height - elRegion.height);
}
utils.offset(source, {
left: newElRegion.left,
top: newElRegion.top
}, {
useCssRight: align.useCssRight,
useCssBottom: align.useCssBottom,
useCssTransform: align.useCssTransform,
ignoreShake: align.ignoreShake
});
return {
points,
offset: offset2,
targetOffset: targetOffset2,
overflow: newOverflowCfg
};
}
function isOutOfVisibleRect(target, alwaysByViewport) {
var visibleRect = getVisibleRectForElement(target, alwaysByViewport);
var targetRegion = getRegion(target);
return !visibleRect || targetRegion.left + targetRegion.width <= visibleRect.left || targetRegion.top + targetRegion.height <= visibleRect.top || targetRegion.left >= visibleRect.right || targetRegion.top >= visibleRect.bottom;
}
function alignElement(el, refNode, align) {
var target = align.target || refNode;
var refNodeRegion = getRegion(target);
var isTargetNotOutOfVisible = !isOutOfVisibleRect(target, align.overflow && align.overflow.alwaysByViewport);
return doAlign(el, refNodeRegion, align, isTargetNotOutOfVisible);
}
alignElement.__getOffsetParent = getOffsetParent;
alignElement.__getVisibleRectForElement = getVisibleRectForElement;
function alignPoint(el, tgtPoint, align) {
var pageX;
var pageY;
var doc = utils.getDocument(el);
var win = doc.defaultView || doc.parentWindow;
var scrollX = utils.getWindowScrollLeft(win);
var scrollY = utils.getWindowScrollTop(win);
var viewportWidth = utils.viewportWidth(win);
var viewportHeight = utils.viewportHeight(win);
if ("pageX" in tgtPoint) {
pageX = tgtPoint.pageX;
} else {
pageX = scrollX + tgtPoint.clientX;
}
if ("pageY" in tgtPoint) {
pageY = tgtPoint.pageY;
} else {
pageY = scrollY + tgtPoint.clientY;
}
var tgtRegion = {
left: pageX,
top: pageY,
width: 0,
height: 0
};
var pointInView = pageX >= 0 && pageX <= scrollX + viewportWidth && pageY >= 0 && pageY <= scrollY + viewportHeight;
var points = [align.points[0], "cc"];
return doAlign(el, tgtRegion, _objectSpread2(_objectSpread2({}, align), {}, {
points
}), pointInView);
}
function cloneElement(vnode) {
let nodeProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let override = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
let mergeRef = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
let ele = vnode;
if (Array.isArray(vnode)) {
ele = filterEmpty(vnode)[0];
}
if (!ele) {
return null;
}
const node2 = cloneVNode(ele, nodeProps, mergeRef);
node2.props = override ? _extends$1(_extends$1({}, node2.props), nodeProps) : node2.props;
warning$3(typeof node2.props.class !== "object", "class must be string");
return node2;
}
const isVisible = (element) => {
if (!element) {
return false;
}
if (element.offsetParent) {
return true;
}
if (element.getBBox) {
const box = element.getBBox();
if (box.width || box.height) {
return true;
}
}
if (element.getBoundingClientRect) {
const box = element.getBoundingClientRect();
if (box.width || box.height) {
return true;
}
}
return false;
};
var MapShim = function() {
if (typeof Map !== "undefined") {
return Map;
}
function getIndex(arr, key) {
var result = -1;
arr.some(function(entry, index2) {
if (entry[0] === key) {
result = index2;
return true;
}
return false;
});
return result;
}
return (
/** @class */
function() {
function class_1() {
this.__entries__ = [];
}
Object.defineProperty(class_1.prototype, "size", {
/**
* @returns {boolean}
*/
get: function() {
return this.__entries__.length;
},
enumerable: true,
configurable: true
});
class_1.prototype.get = function(key) {
var index2 = getIndex(this.__entries__, key);
var entry = this.__entries__[index2];
return entry && entry[1];
};
class_1.prototype.set = function(key, value) {
var index2 = getIndex(this.__entries__, key);
if (~index2) {
this.__entries__[index2][1] = value;
} else {
this.__entries__.push([key, value]);
}
};
class_1.prototype.delete = function(key) {
var entries = this.__entries__;
var index2 = getIndex(entries, key);
if (~index2) {
entries.splice(index2, 1);
}
};
class_1.prototype.has = function(key) {
return !!~getIndex(this.__entries__, key);
};
class_1.prototype.clear = function() {
this.__entries__.splice(0);
};
class_1.prototype.forEach = function(callback, ctx) {
if (ctx === void 0) {
ctx = null;
}
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
var entry = _a[_i];
callback.call(ctx, entry[1], entry[0]);
}
};
return class_1;
}()
);
}();
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
var global$1 = function() {
if (typeof global !== "undefined" && global.Math === Math) {
return global;
}
if (typeof self !== "undefined" && self.Math === Math) {
return self;
}
if (typeof window !== "undefined" && window.Math === Math) {
return window;
}
return Function("return this")();
}();
var requestAnimationFrame$1 = function() {
if (typeof requestAnimationFrame === "function") {
return requestAnimationFrame.bind(global$1);
}
return function(callback) {
return setTimeout(function() {
return callback(Date.now());
}, 1e3 / 60);
};
}();
var trailingTimeout = 2;
function throttle(callback, delay) {
var leadingCall = false, trailingCall = false, lastCallTime = 0;
function resolvePending() {
if (leadingCall) {
leadingCall = false;
callback();
}
if (trailingCall) {
proxy();
}
}
function timeoutCallback() {
requestAnimationFrame$1(resolvePending);
}
function proxy() {
var timeStamp = Date.now();
if (leadingCall) {
if (timeStamp - lastCallTime < trailingTimeout) {
return;
}
trailingCall = true;
} else {
leadingCall = true;
trailingCall = false;
setTimeout(timeoutCallback, delay);
}
lastCallTime = timeStamp;
}
return proxy;
}
var REFRESH_DELAY = 20;
var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
var mutationObserverSupported = typeof MutationObserver !== "undefined";
var ResizeObserverController = (
/** @class */
function() {
function ResizeObserverController2() {
this.connected_ = false;
this.mutationEventsAdded_ = false;
this.mutationsObserver_ = null;
this.observers_ = [];
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
}
ResizeObserverController2.prototype.addObserver = function(observer) {
if (!~this.observers_.indexOf(observer)) {
this.observers_.push(observer);
}
if (!this.connected_) {
this.connect_();
}
};
ResizeObserverController2.prototype.removeObserver = function(observer) {
var observers2 = this.observers_;
var index2 = observers2.indexOf(observer);
if (~index2) {
observers2.splice(index2, 1);
}
if (!observers2.length && this.connected_) {
this.disconnect_();
}
};
ResizeObserverController2.prototype.refresh = function() {
var changesDetected = this.updateObservers_();
if (changesDetected) {
this.refresh();
}
};
ResizeObserverController2.prototype.updateObservers_ = function() {
var activeObservers = this.observers_.filter(function(observer) {
return observer.gatherActive(), observer.hasActive();
});
activeObservers.forEach(function(observer) {
return observer.broadcastActive();
});
return activeObservers.length > 0;
};
ResizeObserverController2.prototype.connect_ = function() {
if (!isBrowser || this.connected_) {
return;
}
document.addEventListener("transitionend", this.onTransitionEnd_);
window.addEventListener("resize", this.refresh);
if (mutationObserverSupported) {
this.mutationsObserver_ = new MutationObserver(this.refresh);
this.mutationsObserver_.observe(document, {
attributes: true,
childList: true,
characterData: true,
subtree: true
});
} else {
document.addEventListener("DOMSubtreeModified", this.refresh);
this.mutationEventsAdded_ = true;
}
this.connected_ = true;
};
ResizeObserverController2.prototype.disconnect_ = function() {
if (!isBrowser || !this.connected_) {
return;
}
document.removeEventListener("transitionend", this.onTransitionEnd_);
window.removeEventListener("resize", this.refresh);
if (this.mutationsObserver_) {
this.mutationsObserver_.disconnect();
}
if (this.mutationEventsAdded_) {
document.removeEventListener("DOMSubtreeModified", this.refresh);
}
this.mutationsObserver_ = null;
this.mutationEventsAdded_ = false;
this.connected_ = false;
};
ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
var isReflowProperty = transitionKeys.some(function(key) {
return !!~propertyName.indexOf(key);
});
if (isReflowProperty) {
this.refresh();
}
};
ResizeObserverController2.getInstance = function() {
if (!this.instance_) {
this.instance_ = new ResizeObserverController2();
}
return this.instance_;
};
ResizeObserverController2.instance_ = null;
return ResizeObserverController2;
}()
);
var defineConfigurable = function(target, props) {
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
var key = _a[_i];
Object.defineProperty(target, key, {
value: props[key],
enumerable: false,
writable: false,
configurable: true
});
}
return target;
};
var getWindowOf = function(target) {
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
return ownerGlobal || global$1;
};
var emptyRect = createRectInit(0, 0, 0, 0);
function toFloat(value) {
return parseFloat(value) || 0;
}
function getBordersSize(styles) {
var positions = [];
for (var _i = 1; _i < arguments.length; _i++) {
positions[_i - 1] = arguments[_i];
}
return positions.reduce(function(size, position2) {
var value = styles["border-" + position2 + "-width"];
return size + toFloat(value);
}, 0);
}
function getPaddings(styles) {
var positions = ["top", "right", "bottom", "left"];
var paddings = {};
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
var position2 = positions_1[_i];
var value = styles["padding-" + position2];
paddings[position2] = toFloat(value);
}
return paddings;
}
function getSVGContentRect(target) {
var bbox = target.getBBox();
return createRectInit(0, 0, bbox.width, bbox.height);
}
function getHTMLElementContentRect(target) {
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
if (!clientWidth && !clientHeight) {
return emptyRect;
}
var styles = getWindowOf(target).getComputedStyle(target);
var paddings = getPaddings(styles);
var horizPad = paddings.left + paddings.right;
var vertPad = paddings.top + paddings.bottom;
var width = toFloat(styles.width), height = toFloat(styles.height);
if (styles.boxSizing === "border-box") {
if (Math.round(width + horizPad) !== clientWidth) {
width -= getBordersSize(styles, "left", "right") + horizPad;
}
if (Math.round(height + vertPad) !== clientHeight) {
height -= getBordersSize(styles, "top", "bottom") + vertPad;
}
}
if (!isDocumentElement(target)) {
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
if (Math.abs(vertScrollbar) !== 1) {
width -= vertScrollbar;
}
if (Math.abs(horizScrollbar) !== 1) {
height -= horizScrollbar;
}
}
return createRectInit(paddings.left, paddings.top, width, height);
}
var isSVGGraphicsElement = function() {
if (typeof SVGGraphicsElement !== "undefined") {
return function(target) {
return target instanceof getWindowOf(target).SVGGraphicsElement;
};
}
return function(target) {
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
};
}();
function isDocumentElement(target) {
return target === getWindowOf(target).document.documentElement;
}
function getContentRect(target) {
if (!isBrowser) {
return emptyRect;
}
if (isSVGGraphicsElement(target)) {
return getSVGContentRect(target);
}
return getHTMLElementContentRect(target);
}
function createReadOnlyRect(_a) {
var x2 = _a.x, y2 = _a.y, width = _a.width, height = _a.height;
var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
var rect = Object.create(Constr.prototype);
defineConfigurable(rect, {
x: x2,
y: y2,
width,
height,
top: y2,
right: x2 + width,
bottom: height + y2,
left: x2
});
return rect;
}
function createRectInit(x2, y2, width, height) {
return { x: x2, y: y2, width, height };
}
var ResizeObservation = (
/** @class */
function() {
function ResizeObservation2(target) {
this.broadcastWidth = 0;
this.broadcastHeight = 0;
this.contentRect_ = createRectInit(0, 0, 0, 0);
this.target = target;
}
ResizeObservation2.prototype.isActive = function() {
var rect = getContentRect(this.target);
this.contentRect_ = rect;
return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
};
ResizeObservation2.prototype.broadcastRect = function() {
var rect = this.contentRect_;
this.broadcastWidth = rect.width;
this.broadcastHeight = rect.height;
return rect;
};
return ResizeObservation2;
}()
);
var ResizeObserverEntry = (
/** @class */
function() {
function ResizeObserverEntry2(target, rectInit) {
var contentRect = createReadOnlyRect(rectInit);
defineConfigurable(this, { target, contentRect });
}
return ResizeObserverEntry2;
}()
);
var ResizeObserverSPI = (
/** @class */
function() {
function ResizeObserverSPI2(callback, controller, callbackCtx) {
this.activeObservations_ = [];
this.observations_ = new MapShim();
if (typeof callback !== "function") {
throw new TypeError("The callback provided as parameter 1 is not a function.");
}
this.callback_ = callback;
this.controller_ = controller;
this.callbackCtx_ = callbackCtx;
}
ResizeObserverSPI2.prototype.observe = function(target) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (observations.has(target)) {
return;
}
observations.set(target, new ResizeObservation(target));
this.controller_.addObserver(this);
this.controller_.refresh();
};
ResizeObserverSPI2.prototype.unobserve = function(target) {
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
if (typeof Element === "undefined" || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
var observations = this.observations_;
if (!observations.has(target)) {
return;
}
observations.delete(target);
if (!observations.size) {
this.controller_.removeObserver(this);
}
};
ResizeObserverSPI2.prototype.disconnect = function() {
this.clearActive();
this.observations_.clear();
this.controller_.removeObserver(this);
};
ResizeObserverSPI2.prototype.gatherActive = function() {
var _this = this;
this.clearActive();
this.observations_.forEach(function(observation) {
if (observation.isActive()) {
_this.activeObservations_.push(observation);
}
});
};
ResizeObserverSPI2.prototype.broadcastActive = function() {
if (!this.hasActive()) {
return;
}
var ctx = this.callbackCtx_;
var entries = this.activeObservations_.map(function(observation) {
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
});
this.callback_.call(ctx, entries, ctx);
this.clearActive();
};
ResizeObserverSPI2.prototype.clearActive = function() {
this.activeObservations_.splice(0);
};
ResizeObserverSPI2.prototype.hasActive = function() {
return this.activeObservations_.length > 0;
};
return ResizeObserverSPI2;
}()
);
var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
var ResizeObserver = (
/** @class */
function() {
function ResizeObserver2(callback) {
if (!(this instanceof ResizeObserver2)) {
throw new TypeError("Cannot call a class as a function.");
}
if (!arguments.length) {
throw new TypeError("1 argument required, but only 0 present.");
}
var controller = ResizeObserverController.getInstance();
var observer = new ResizeObserverSPI(callback, controller, this);
observers.set(this, observer);
}
return ResizeObserver2;
}()
);
[
"observe",
"unobserve",
"disconnect"
].forEach(function(method4) {
ResizeObserver.prototype[method4] = function() {
var _a;
return (_a = observers.get(this))[method4].apply(_a, arguments);
};
});
var index = function() {
if (typeof global$1.ResizeObserver !== "undefined") {
return global$1.ResizeObserver;
}
return ResizeObserver;
}();
function isSamePoint(prev2, next2) {
if (prev2 === next2)
return true;
if (!prev2 || !next2)
return false;
if ("pageX" in next2 && "pageY" in next2) {
return prev2.pageX === next2.pageX && prev2.pageY === next2.pageY;
}
if ("clientX" in next2 && "clientY" in next2) {
return prev2.clientX === next2.clientX && prev2.clientY === next2.clientY;
}
return false;
}
function restoreFocus(activeElement, container) {
if (activeElement !== document.activeElement && contains(container, activeElement) && typeof activeElement.focus === "function") {
activeElement.focus();
}
}
function monitorResize(element, callback) {
let prevWidth = null;
let prevHeight = null;
function onResize(_ref) {
let [{
target
}] = _ref;
if (!document.documentElement.contains(target))
return;
const {
width,
height
} = target.getBoundingClientRect();
const fixedWidth = Math.floor(width);
const fixedHeight = Math.floor(height);
if (prevWidth !== fixedWidth || prevHeight !== fixedHeight) {
Promise.resolve().then(() => {
callback({
width: fixedWidth,
height: fixedHeight
});
});
}
prevWidth = fixedWidth;
prevHeight = fixedHeight;
}
const resizeObserver = new index(onResize);
if (element) {
resizeObserver.observe(element);
}
return () => {
resizeObserver.disconnect();
};
}
const useBuffer = (callback, buffer) => {
let called = false;
let timeout = null;
function cancelTrigger() {
clearTimeout(timeout);
}
function trigger(force) {
if (!called || force === true) {
if (callback() === false) {
return;
}
called = true;
cancelTrigger();
timeout = setTimeout(() => {
called = false;
}, buffer.value);
} else {
cancelTrigger();
timeout = setTimeout(() => {
called = false;
trigger();
}, buffer.value);
}
}
return [trigger, () => {
called = false;
cancelTrigger();
}];
};
const alignProps = {
align: Object,
target: [Object, Function],
onAlign: Function,
monitorBufferTime: Number,
monitorWindowResize: Boolean,
disabled: Boolean
};
function getElement(func) {
if (typeof func !== "function")
return null;
return func();
}
function getPoint(point) {
if (typeof point !== "object" || !point)
return null;
return point;
}
const Align = defineComponent({
compatConfig: {
MODE: 3
},
name: "Align",
props: alignProps,
emits: ["align"],
setup(props, _ref) {
let {
expose,
slots
} = _ref;
const cacheRef = ref({});
const nodeRef = ref();
const [forceAlign, cancelForceAlign] = useBuffer(() => {
const {
disabled: latestDisabled,
target: latestTarget,
align: latestAlign,
onAlign: latestOnAlign
} = props;
if (!latestDisabled && latestTarget && nodeRef.value) {
const source = nodeRef.value;
let result;
const element = getElement(latestTarget);
const point = getPoint(latestTarget);
cacheRef.value.element = element;
cacheRef.value.point = point;
cacheRef.value.align = latestAlign;
const {
activeElement
} = document;
if (element && isVisible(element)) {
result = alignElement(source, element, latestAlign);
} else if (point) {
result = alignPoint(source, point, latestAlign);
}
restoreFocus(activeElement, source);
if (latestOnAlign && result) {
latestOnAlign(source, result);
}
return true;
}
return false;
}, computed(() => props.monitorBufferTime));
const resizeMonitor = ref({
cancel: () => {
}
});
const sourceResizeMonitor = ref({
cancel: () => {
}
});
const goAlign = () => {
const target = props.target;
const element = getElement(target);
const point = getPoint(target);
if (nodeRef.value !== sourceResizeMonitor.value.element) {
sourceResizeMonitor.value.cancel();
sourceResizeMonitor.value.element = nodeRef.value;
sourceResizeMonitor.value.cancel = monitorResize(nodeRef.value, forceAlign);
}
if (cacheRef.value.element !== element || !isSamePoint(cacheRef.value.point, point) || !isEqual(cacheRef.value.align, props.align)) {
forceAlign();
if (resizeMonitor.value.element !== element) {
resizeMonitor.value.cancel();
resizeMonitor.value.element = element;
resizeMonitor.value.cancel = monitorResize(element, forceAlign);
}
}
};
onMounted(() => {
nextTick(() => {
goAlign();
});
});
onUpdated(() => {
nextTick(() => {
goAlign();
});
});
watch(() => props.disabled, (disabled) => {
if (!disabled) {
forceAlign();
} else {
cancelForceAlign();
}
}, {
immediate: true,
flush: "post"
});
const winResizeRef = ref(null);
watch(() => props.monitorWindowResize, (monitorWindowResize) => {
if (monitorWindowResize) {
if (!winResizeRef.value) {
winResizeRef.value = addEventListenerWrap(window, "resize", forceAlign);
}
} else if (winResizeRef.value) {
winResizeRef.value.remove();
winResizeRef.value = null;
}
}, {
flush: "post"
});
onUnmounted(() => {
resizeMonitor.value.cancel();
sourceResizeMonitor.value.cancel();
if (winResizeRef.value)
winResizeRef.value.remove();
cancelForceAlign();
});
expose({
forceAlign: () => forceAlign(true)
});
return () => {
const child = slots === null || slots === void 0 ? void 0 : slots.default();
if (child) {
return cloneElement(child[0], {
ref: nodeRef
}, true, true);
}
return null;
};
}
});
tuple("bottomLeft", "bottomRight", "topLeft", "topRight");
const getTransitionProps = function(transitionName) {
let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const transitionProps = transitionName ? _extends$1({
name: transitionName,
appear: true,
// type: 'animation',
// appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
// appearActiveClass: `antdv-base-transtion`,
// appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
enterFromClass: `${transitionName}-enter ${transitionName}-enter-prepare ${transitionName}-enter-start`,
enterActiveClass: `${transitionName}-enter ${transitionName}-enter-prepare`,
enterToClass: `${transitionName}-enter ${transitionName}-enter-active`,
leaveFromClass: ` ${transitionName}-leave`,
leaveActiveClass: `${transitionName}-leave ${transitionName}-leave-active`,
leaveToClass: `${transitionName}-leave ${transitionName}-leave-active`
}, opt) : _extends$1({
css: false
}, opt);
return transitionProps;
};
const getTransitionGroupProps = function(transitionName) {
let opt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const transitionProps = transitionName ? _extends$1({
name: transitionName,
appear: true,
// appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
appearActiveClass: `${transitionName}`,
appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
enterFromClass: `${transitionName}-appear ${transitionName}-enter ${transitionName}-appear-prepare ${transitionName}-enter-prepare`,
enterActiveClass: `${transitionName}`,
enterToClass: `${transitionName}-enter ${transitionName}-appear ${transitionName}-appear-active ${transitionName}-enter-active`,
leaveActiveClass: `${transitionName} ${transitionName}-leave`,
leaveToClass: `${transitionName}-leave-active`
}, opt) : _extends$1({
css: false
}, opt);
return transitionProps;
};
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
if (transitionName !== void 0) {
return transitionName;
}
return `${rootPrefixCls}-${motion}`;
};
const PopupInner = defineComponent({
compatConfig: {
MODE: 3
},
name: "PopupInner",
inheritAttrs: false,
props: innerProps,
emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
setup(props, _ref) {
let {
expose,
attrs,
slots
} = _ref;
const alignRef = shallowRef();
const elementRef = shallowRef();
const alignedClassName = shallowRef();
const [stretchStyle, measureStretchStyle] = useStretchStyle(toRef(props, "stretch"));
const doMeasure = () => {
if (props.stretch) {
measureStretchStyle(props.getRootDomNode());
}
};
const visible = shallowRef(false);
let timeoutId;
watch(() => props.visible, (val) => {
clearTimeout(timeoutId);
if (val) {
timeoutId = setTimeout(() => {
visible.value = props.visible;
});
} else {
visible.value = false;
}
}, {
immediate: true
});
const [status, goNextStatus] = useVisibleStatus(visible, doMeasure);
const prepareResolveRef = shallowRef();
const getAlignTarget = () => {
if (props.point) {
return props.point;
}
return props.getRootDomNode;
};
const forceAlign = () => {
var _a;
(_a = alignRef.value) === null || _a === void 0 ? void 0 : _a.forceAlign();
};
const onInternalAlign = (popupDomNode, matchAlign) => {
var _a;
const nextAlignedClassName = props.getClassNameFromAlign(matchAlign);
const preAlignedClassName = alignedClassName.value;
if (alignedClassName.value !== nextAlignedClassName) {
alignedClassName.value = nextAlignedClassName;
}
if (status.value === "align") {
if (preAlignedClassName !== nextAlignedClassName) {
Promise.resolve().then(() => {
forceAlign();
});
} else {
goNextStatus(() => {
var _a2;
(_a2 = prepareResolveRef.value) === null || _a2 === void 0 ? void 0 : _a2.call(prepareResolveRef);
});
}
(_a = props.onAlign) === null || _a === void 0 ? void 0 : _a.call(props, popupDomNode, matchAlign);
}
};
const motion = computed(() => {
const m2 = typeof props.animation === "object" ? props.animation : getMotion(props);
["onAfterEnter", "onAfterLeave"].forEach((eventName) => {
const originFn = m2[eventName];
m2[eventName] = (node2) => {
goNextStatus();
status.value = "stable";
originFn === null || originFn === void 0 ? void 0 : originFn(node2);
};
});
return m2;
});
const onShowPrepare = () => {
return new Promise((resolve) => {
prepareResolveRef.value = resolve;
});
};
watch([motion, status], () => {
if (!motion.value && status.value === "motion") {
goNextStatus();
}
}, {
immediate: true
});
expose({
forceAlign,
getElement: () => {
return elementRef.value.$el || elementRef.value;
}
});
const alignDisabled = computed(() => {
var _a;
if (((_a = props.align) === null || _a === void 0 ? void 0 : _a.points) && (status.value === "align" || status.value === "stable")) {
return false;
}
return true;
});
return () => {
var _a;
const {
zIndex,
align,
prefixCls,
destroyPopupOnHide,
onMouseenter,
onMouseleave,
onTouchstart = () => {
},
onMousedown
} = props;
const statusValue = status.value;
const mergedStyle = [_extends$1(_extends$1({}, stretchStyle.value), {
zIndex,
opacity: statusValue === "motion" || statusValue === "stable" || !visible.value ? null : 0,
// pointerEvents: statusValue === 'stable' ? null : 'none',
pointerEvents: !visible.value && statusValue !== "stable" ? "none" : null
}), attrs.style];
let childNode = flattenChildren((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, {
visible: props.visible
}));
if (childNode.length > 1) {
childNode = createVNode("div", {
"class": `${prefixCls}-content`
}, [childNode]);
}
const mergedClassName = classNames(prefixCls, attrs.class, alignedClassName.value, !props.arrow && `${prefixCls}-arrow-hidden`);
const hasAnimate = visible.value || !props.visible;
const transitionProps = hasAnimate ? getTransitionProps(motion.value.name, motion.value) : {};
return createVNode(Transition, _objectSpread2$1(_objectSpread2$1({
"ref": elementRef
}, transitionProps), {}, {
"onBeforeEnter": onShowPrepare
}), {
default: () => {
return !destroyPopupOnHide || props.visible ? withDirectives(createVNode(Align, {
"target": getAlignTarget(),
"key": "popup",
"ref": alignRef,
"monitorWindowResize": true,
"disabled": alignDisabled.value,
"align": align,
"onAlign": onInternalAlign
}, {
default: () => createVNode("div", {
"class": mergedClassName,
"onMouseenter": onMouseenter,
"onMouseleave": onMouseleave,
"onMousedown": withModifiers(onMousedown, ["capture"]),
[supportsPassive$1 ? "onTouchstartPassive" : "onTouchstart"]: withModifiers(onTouchstart, ["capture"]),
"style": mergedStyle
}, [childNode])
}), [[vShow, visible.value]]) : null;
}
});
};
}
});
const Popup = defineComponent({
compatConfig: {
MODE: 3
},
name: "Popup",
inheritAttrs: false,
props: popupProps,
setup(props, _ref) {
let {
attrs,
slots,
expose
} = _ref;
const innerVisible = shallowRef(false);
const inMobile = shallowRef(false);
const popupRef = shallowRef();
const rootRef = shallowRef();
watch([() => props.visible, () => props.mobile], () => {
innerVisible.value = props.visible;
if (props.visible && props.mobile) {
inMobile.value = true;
}
}, {
immediate: true,
flush: "post"
});
expose({
forceAlign: () => {
var _a;
(_a = popupRef.value) === null || _a === void 0 ? void 0 : _a.forceAlign();
},
getElement: () => {
var _a;
return (_a = popupRef.value) === null || _a === void 0 ? void 0 : _a.getElement();
}
});
return () => {
const cloneProps = _extends$1(_extends$1(_extends$1({}, props), attrs), {
visible: innerVisible.value
});
const popupNode = inMobile.value ? createVNode(MobilePopupInner, _objectSpread2$1(_objectSpread2$1({}, cloneProps), {}, {
"mobile": props.mobile,
"ref": popupRef
}), {
default: slots.default
}) : createVNode(PopupInner, _objectSpread2$1(_objectSpread2$1({}, cloneProps), {}, {
"ref": popupRef
}), {
default: slots.default
});
return createVNode("div", {
"ref": rootRef
}, [createVNode(Mask, cloneProps, null), popupNode]);
};
}
});
function isPointsEq(a1, a2, isAlignPoint) {
if (isAlignPoint) {
return a1[0] === a2[0];
}
return a1[0] === a2[0] && a1[1] === a2[1];
}
function getAlignFromPlacement(builtinPlacements, placementStr, align) {
const baseAlign = builtinPlacements[placementStr] || {};
return _extends$1(_extends$1({}, baseAlign), align);
}
function getAlignPopupClassName(builtinPlacements, prefixCls, align, isAlignPoint) {
const {
points
} = align;
const placements2 = Object.keys(builtinPlacements);
for (let i2 = 0; i2 < placements2.length; i2 += 1) {
const placement = placements2[i2];
if (isPointsEq(builtinPlacements[placement].points, points, isAlignPoint)) {
return `${prefixCls}-placement-${placement}`;
}
}
return "";
}
const BaseMixin = {
methods: {
setState() {
let state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
let callback = arguments.length > 1 ? arguments[1] : void 0;
let newState = typeof state === "function" ? state(this.$data, this.$props) : state;
if (this.getDerivedStateFromProps) {
const s2 = this.getDerivedStateFromProps(getOptionProps(this), _extends$1(_extends$1({}, this.$data), newState));
if (s2 === null) {
return;
} else {
newState = _extends$1(_extends$1({}, newState), s2 || {});
}
}
_extends$1(this.$data, newState);
if (this._.isMounted) {
this.$forceUpdate();
}
nextTick(() => {
callback && callback();
});
},
__emit() {
const args = [].slice.call(arguments, 0);
let eventName = args[0];
eventName = `on${eventName[0].toUpperCase()}${eventName.substring(1)}`;
const event = this.$props[eventName] || this.$attrs[eventName];
if (args.length && event) {
if (Array.isArray(event)) {
for (let i2 = 0, l2 = event.length; i2 < l2; i2++) {
event[i2](...args.slice(1));
}
} else {
event(...args.slice(1));
}
}
}
}
};
const PortalContextKey = Symbol("PortalContextKey");
const useProvidePortal = function(instance) {
let config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
inTriggerContext: true
};
provide(PortalContextKey, {
inTriggerContext: config.inTriggerContext,
shouldRender: computed(() => {
const {
sPopupVisible,
popupRef,
forceRender,
autoDestroy
} = instance || {};
let shouldRender = false;
if (sPopupVisible || popupRef || forceRender) {
shouldRender = true;
}
if (!sPopupVisible && autoDestroy) {
shouldRender = false;
}
return shouldRender;
})
});
};
const useInjectPortal = () => {
useProvidePortal({}, {
inTriggerContext: false
});
const portalContext = inject(PortalContextKey, {
shouldRender: computed(() => false),
inTriggerContext: false
});
return {
shouldRender: computed(() => portalContext.shouldRender.value || portalContext.inTriggerContext === false)
};
};
const Portal$1 = defineComponent({
compatConfig: {
MODE: 3
},
name: "Portal",
inheritAttrs: false,
props: {
getContainer: PropTypes$1.func.isRequired,
didUpdate: Function
},
setup(props, _ref) {
let {
slots
} = _ref;
let isSSR = true;
let container;
const {
shouldRender
} = useInjectPortal();
function setContainer() {
if (shouldRender.value) {
container = props.getContainer();
}
}
onBeforeMount(() => {
isSSR = false;
setContainer();
});
onMounted(() => {
if (container)
return;
setContainer();
});
const stopWatch = watch(shouldRender, () => {
if (shouldRender.value && !container) {
container = props.getContainer();
}
if (container) {
stopWatch();
}
});
onUpdated(() => {
nextTick(() => {
var _a;
if (shouldRender.value) {
(_a = props.didUpdate) === null || _a === void 0 ? void 0 : _a.call(props, props);
}
});
});
return () => {
var _a;
if (!shouldRender.value)
return null;
if (isSSR) {
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
}
return container ? createVNode(Teleport, {
"to": container
}, slots) : null;
};
}
});
let cached;
function getScrollBarSize(fresh) {
if (typeof document === "undefined") {
return 0;
}
if (fresh || cached === void 0) {
const inner = document.createElement("div");
inner.style.width = "100%";
inner.style.height = "200px";
const outer = document.createElement("div");
const outerStyle = outer.style;
outerStyle.position = "absolute";
outerStyle.top = "0";
outerStyle.left = "0";
outerStyle.pointerEvents = "none";
outerStyle.visibility = "hidden";
outerStyle.width = "200px";
outerStyle.height = "150px";
outerStyle.overflow = "hidden";
outer.appendChild(inner);
document.body.appendChild(outer);
const widthContained = inner.offsetWidth;
outer.style.overflow = "scroll";
let widthScroll = inner.offsetWidth;
if (widthContained === widthScroll) {
widthScroll = outer.clientWidth;
}
document.body.removeChild(outer);
cached = widthContained - widthScroll;
}
return cached;
}
const UNIQUE_ID = `vc-util-locker-${Date.now()}`;
let uuid = 0;
function isBodyOverflowing() {
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
}
function useScrollLocker(lock) {
const mergedLock = computed(() => !!lock && !!lock.value);
uuid += 1;
const id = `${UNIQUE_ID}_${uuid}`;
watchEffect((onClear) => {
if (!canUseDom()) {
return;
}
if (mergedLock.value) {
const scrollbarSize = getScrollBarSize();
const isOverflow = isBodyOverflowing();
updateCSS(`
html body {
overflow-y: hidden;
${isOverflow ? `width: calc(100% - ${scrollbarSize}px);` : ""}
}`, id);
} else {
removeCSS(id);
}
onClear(() => {
removeCSS(id);
});
}, {
flush: "post"
});
}
let openCount = 0;
const supportDom = canUseDom();
const getParent2 = (getContainer2) => {
if (!supportDom) {
return null;
}
if (getContainer2) {
if (typeof getContainer2 === "string") {
return document.querySelectorAll(getContainer2)[0];
}
if (typeof getContainer2 === "function") {
return getContainer2();
}
if (typeof getContainer2 === "object" && getContainer2 instanceof window.HTMLElement) {
return getContainer2;
}
}
return document.body;
};
const Portal = defineComponent({
compatConfig: {
MODE: 3
},
name: "PortalWrapper",
inheritAttrs: false,
props: {
wrapperClassName: String,
forceRender: {
type: Boolean,
default: void 0
},
getContainer: PropTypes$1.any,
visible: {
type: Boolean,
default: void 0
},
autoLock: booleanType(),
didUpdate: Function
},
setup(props, _ref) {
let {
slots
} = _ref;
const container = shallowRef();
const componentRef = shallowRef();
const rafId = shallowRef();
const triggerUpdate = shallowRef(1);
const defaultContainer = canUseDom() && document.createElement("div");
const removeCurrentContainer = () => {
var _a, _b;
if (container.value === defaultContainer) {
(_b = (_a = container.value) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(container.value);
}
container.value = null;
};
let parent2 = null;
const attachToParent = function() {
let force = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
if (force || container.value && !container.value.parentNode) {
parent2 = getParent2(props.getContainer);
if (parent2) {
parent2.appendChild(container.value);
return true;
}
return false;
}
return true;
};
const getContainer2 = () => {
if (!supportDom) {
return null;
}
if (!container.value) {
container.value = defaultContainer;
attachToParent(true);
}
setWrapperClassName();
return container.value;
};
const setWrapperClassName = () => {
const {
wrapperClassName
} = props;
if (container.value && wrapperClassName && wrapperClassName !== container.value.className) {
container.value.className = wrapperClassName;
}
};
onUpdated(() => {
setWrapperClassName();
attachToParent();
});
useScrollLocker(computed(() => {
return props.autoLock && props.visible && canUseDom() && (container.value === document.body || container.value === defaultContainer);
}));
onMounted(() => {
let init = false;
watch([() => props.visible, () => props.getContainer], (_ref2, _ref3) => {
let [visible, getContainer3] = _ref2;
let [prevVisible, prevGetContainer] = _ref3;
if (supportDom) {
parent2 = getParent2(props.getContainer);
if (parent2 === document.body) {
if (visible && !prevVisible) {
openCount += 1;
} else if (init) {
openCount -= 1;
}
}
}
if (init) {
const getContainerIsFunc = typeof getContainer3 === "function" && typeof prevGetContainer === "function";
if (getContainerIsFunc ? getContainer3.toString() !== prevGetContainer.toString() : getContainer3 !== prevGetContainer) {
removeCurrentContainer();
}
}
init = true;
}, {
immediate: true,
flush: "post"
});
nextTick(() => {
if (!attachToParent()) {
rafId.value = wrapperRaf(() => {
triggerUpdate.value += 1;
});
}
});
});
onBeforeUnmount(() => {
const {
visible
} = props;
if (supportDom && parent2 === document.body) {
openCount = visible && openCount ? openCount - 1 : openCount;
}
removeCurrentContainer();
wrapperRaf.cancel(rafId.value);
});
return () => {
const {
forceRender,
visible
} = props;
let portal = null;
const childProps = {
getOpenCount: () => openCount,
getContainer: getContainer2
};
if (triggerUpdate.value && (forceRender || visible || componentRef.value)) {
portal = createVNode(Portal$1, {
"getContainer": getContainer2,
"ref": componentRef,
"didUpdate": props.didUpdate
}, {
default: () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots, childProps);
}
});
}
return portal;
};
}
});
const ALL_HANDLERS = ["onClick", "onMousedown", "onTouchstart", "onMouseenter", "onMouseleave", "onFocus", "onBlur", "onContextmenu"];
const Trigger = defineComponent({
compatConfig: {
MODE: 3
},
name: "Trigger",
mixins: [BaseMixin],
inheritAttrs: false,
props: triggerProps(),
setup(props) {
const align = computed(() => {
const {
popupPlacement,
popupAlign,
builtinPlacements
} = props;
if (popupPlacement && builtinPlacements) {
return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);
}
return popupAlign;
});
const popupRef = shallowRef(null);
const setPopupRef = (val) => {
popupRef.value = val;
};
return {
vcTriggerContext: inject("vcTriggerContext", {}),
popupRef,
setPopupRef,
triggerRef: shallowRef(null),
align,
focusTime: null,
clickOutsideHandler: null,
contextmenuOutsideHandler1: null,
contextmenuOutsideHandler2: null,
touchOutsideHandler: null,
attachId: null,
delayTimer: null,
hasPopupMouseDown: false,
preClickTime: null,
preTouchTime: null,
mouseDownTimeout: null,
childOriginEvents: {}
};
},
data() {
const props = this.$props;
let popupVisible;
if (this.popupVisible !== void 0) {
popupVisible = !!props.popupVisible;
} else {
popupVisible = !!props.defaultPopupVisible;
}
ALL_HANDLERS.forEach((h2) => {
this[`fire${h2}`] = (e2) => {
this.fireEvents(h2, e2);
};
});
return {
prevPopupVisible: popupVisible,
sPopupVisible: popupVisible,
point: null
};
},
watch: {
popupVisible(val) {
if (val !== void 0) {
this.prevPopupVisible = this.sPopupVisible;
this.sPopupVisible = val;
}
}
},
created() {
provide("vcTriggerContext", {
onPopupMouseDown: this.onPopupMouseDown,
onPopupMouseenter: this.onPopupMouseenter,
onPopupMouseleave: this.onPopupMouseleave
});
useProvidePortal(this);
},
deactivated() {
this.setPopupVisible(false);
},
mounted() {
this.$nextTick(() => {
this.updatedCal();
});
},
updated() {
this.$nextTick(() => {
this.updatedCal();
});
},
beforeUnmount() {
this.clearDelayTimer();
this.clearOutsideHandler();
clearTimeout(this.mouseDownTimeout);
wrapperRaf.cancel(this.attachId);
},
methods: {
updatedCal() {
const props = this.$props;
const state = this.$data;
if (state.sPopupVisible) {
let currentDocument;
if (!this.clickOutsideHandler && (this.isClickToHide() || this.isContextmenuToShow())) {
currentDocument = props.getDocument(this.getRootDomNode());
this.clickOutsideHandler = addEventListenerWrap(currentDocument, "mousedown", this.onDocumentClick);
}
if (!this.touchOutsideHandler) {
currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
this.touchOutsideHandler = addEventListenerWrap(currentDocument, "touchstart", this.onDocumentClick, supportsPassive$1 ? {
passive: false
} : false);
}
if (!this.contextmenuOutsideHandler1 && this.isContextmenuToShow()) {
currentDocument = currentDocument || props.getDocument(this.getRootDomNode());
this.contextmenuOutsideHandler1 = addEventListenerWrap(currentDocument, "scroll", this.onContextmenuClose);
}
if (!this.contextmenuOutsideHandler2 && this.isContextmenuToShow()) {
this.contextmenuOutsideHandler2 = addEventListenerWrap(window, "blur", this.onContextmenuClose);
}
} else {
this.clearOutsideHandler();
}
},
onMouseenter(e2) {
const {
mouseEnterDelay
} = this.$props;
this.fireEvents("onMouseenter", e2);
this.delaySetPopupVisible(true, mouseEnterDelay, mouseEnterDelay ? null : e2);
},
onMouseMove(e2) {
this.fireEvents("onMousemove", e2);
this.setPoint(e2);
},
onMouseleave(e2) {
this.fireEvents("onMouseleave", e2);
this.delaySetPopupVisible(false, this.$props.mouseLeaveDelay);
},
onPopupMouseenter() {
const {
vcTriggerContext = {}
} = this;
if (vcTriggerContext.onPopupMouseenter) {
vcTriggerContext.onPopupMouseenter();
}
this.clearDelayTimer();
},
onPopupMouseleave(e2) {
var _a;
if (e2 && e2.relatedTarget && !e2.relatedTarget.setTimeout && contains((_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.getElement(), e2.relatedTarget)) {
return;
}
if (this.isMouseLeaveToHide()) {
this.delaySetPopupVisible(false, this.$props.mouseLeaveDelay);
}
const {
vcTriggerContext = {}
} = this;
if (vcTriggerContext.onPopupMouseleave) {
vcTriggerContext.onPopupMouseleave(e2);
}
},
onFocus(e2) {
this.fireEvents("onFocus", e2);
this.clearDelayTimer();
if (this.isFocusToShow()) {
this.focusTime = Date.now();
this.delaySetPopupVisible(true, this.$props.focusDelay);
}
},
onMousedown(e2) {
this.fireEvents("onMousedown", e2);
this.preClickTime = Date.now();
},
onTouchstart(e2) {
this.fireEvents("onTouchstart", e2);
this.preTouchTime = Date.now();
},
onBlur(e2) {
if (!contains(e2.target, e2.relatedTarget || document.activeElement)) {
this.fireEvents("onBlur", e2);
this.clearDelayTimer();
if (this.isBlurToHide()) {
this.delaySetPopupVisible(false, this.$props.blurDelay);
}
}
},
onContextmenu(e2) {
e2.preventDefault();
this.fireEvents("onContextmenu", e2);
this.setPopupVisible(true, e2);
},
onContextmenuClose() {
if (this.isContextmenuToShow()) {
this.close();
}
},
onClick(event) {
this.fireEvents("onClick", event);
if (this.focusTime) {
let preTime;
if (this.preClickTime && this.preTouchTime) {
preTime = Math.min(this.preClickTime, this.preTouchTime);
} else if (this.preClickTime) {
preTime = this.preClickTime;
} else if (this.preTouchTime) {
preTime = this.preTouchTime;
}
if (Math.abs(preTime - this.focusTime) < 20) {
return;
}
this.focusTime = 0;
}
this.preClickTime = 0;
this.preTouchTime = 0;
if (this.isClickToShow() && (this.isClickToHide() || this.isBlurToHide()) && event && event.preventDefault) {
event.preventDefault();
}
if (event && event.domEvent) {
event.domEvent.preventDefault();
}
const nextVisible = !this.$data.sPopupVisible;
if (this.isClickToHide() && !nextVisible || nextVisible && this.isClickToShow()) {
this.setPopupVisible(!this.$data.sPopupVisible, event);
}
},
onPopupMouseDown() {
const {
vcTriggerContext = {}
} = this;
this.hasPopupMouseDown = true;
clearTimeout(this.mouseDownTimeout);
this.mouseDownTimeout = setTimeout(() => {
this.hasPopupMouseDown = false;
}, 0);
if (vcTriggerContext.onPopupMouseDown) {
vcTriggerContext.onPopupMouseDown(...arguments);
}
},
onDocumentClick(event) {
if (this.$props.mask && !this.$props.maskClosable) {
return;
}
const target = event.target;
const root2 = this.getRootDomNode();
const popupNode = this.getPopupDomNode();
if (
// mousedown on the target should also close popup when action is contextMenu.
// https://github.com/ant-design/ant-design/issues/29853
(!contains(root2, target) || this.isContextMenuOnly()) && !contains(popupNode, target) && !this.hasPopupMouseDown
) {
this.delaySetPopupVisible(false, 0.1);
}
},
getPopupDomNode() {
var _a;
return ((_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.getElement()) || null;
},
getRootDomNode() {
var _a, _b, _c, _d;
const {
getTriggerDOMNode
} = this.$props;
if (getTriggerDOMNode) {
const domNode = ((_b = (_a = this.triggerRef) === null || _a === void 0 ? void 0 : _a.$el) === null || _b === void 0 ? void 0 : _b.nodeName) === "#comment" ? null : findDOMNode(this.triggerRef);
return findDOMNode(getTriggerDOMNode(domNode));
}
try {
const domNode = ((_d = (_c = this.triggerRef) === null || _c === void 0 ? void 0 : _c.$el) === null || _d === void 0 ? void 0 : _d.nodeName) === "#comment" ? null : findDOMNode(this.triggerRef);
if (domNode) {
return domNode;
}
} catch (err) {
}
return findDOMNode(this);
},
handleGetPopupClassFromAlign(align) {
const className = [];
const props = this.$props;
const {
popupPlacement,
builtinPlacements,
prefixCls,
alignPoint: alignPoint2,
getPopupClassNameFromAlign
} = props;
if (popupPlacement && builtinPlacements) {
className.push(getAlignPopupClassName(builtinPlacements, prefixCls, align, alignPoint2));
}
if (getPopupClassNameFromAlign) {
className.push(getPopupClassNameFromAlign(align));
}
return className.join(" ");
},
getPopupAlign() {
const props = this.$props;
const {
popupPlacement,
popupAlign,
builtinPlacements
} = props;
if (popupPlacement && builtinPlacements) {
return getAlignFromPlacement(builtinPlacements, popupPlacement, popupAlign);
}
return popupAlign;
},
getComponent() {
const mouseProps = {};
if (this.isMouseEnterToShow()) {
mouseProps.onMouseenter = this.onPopupMouseenter;
}
if (this.isMouseLeaveToHide()) {
mouseProps.onMouseleave = this.onPopupMouseleave;
}
mouseProps.onMousedown = this.onPopupMouseDown;
mouseProps[supportsPassive$1 ? "onTouchstartPassive" : "onTouchstart"] = this.onPopupMouseDown;
const {
handleGetPopupClassFromAlign,
getRootDomNode,
$attrs
} = this;
const {
prefixCls,
destroyPopupOnHide,
popupClassName,
popupAnimation,
popupTransitionName,
popupStyle,
mask,
maskAnimation,
maskTransitionName,
zIndex,
stretch,
alignPoint: alignPoint2,
mobile,
arrow,
forceRender
} = this.$props;
const {
sPopupVisible,
point
} = this.$data;
const popupProps2 = _extends$1(_extends$1({
prefixCls,
arrow,
destroyPopupOnHide,
visible: sPopupVisible,
point: alignPoint2 ? point : null,
align: this.align,
animation: popupAnimation,
getClassNameFromAlign: handleGetPopupClassFromAlign,
stretch,
getRootDomNode,
mask,
zIndex,
transitionName: popupTransitionName,
maskAnimation,
maskTransitionName,
class: popupClassName,
style: popupStyle,
onAlign: $attrs.onPopupAlign || noop$1
}, mouseProps), {
ref: this.setPopupRef,
mobile,
forceRender
});
return createVNode(Popup, popupProps2, {
default: this.$slots.popup || (() => getComponent(this, "popup"))
});
},
attachParent(popupContainer) {
wrapperRaf.cancel(this.attachId);
const {
getPopupContainer,
getDocument: getDocument2
} = this.$props;
const domNode = this.getRootDomNode();
let mountNode;
if (!getPopupContainer) {
mountNode = getDocument2(this.getRootDomNode()).body;
} else if (domNode || getPopupContainer.length === 0) {
mountNode = getPopupContainer(domNode);
}
if (mountNode) {
mountNode.appendChild(popupContainer);
} else {
this.attachId = wrapperRaf(() => {
this.attachParent(popupContainer);
});
}
},
getContainer() {
const {
$props: props
} = this;
const {
getDocument: getDocument2
} = props;
const popupContainer = getDocument2(this.getRootDomNode()).createElement("div");
popupContainer.style.position = "absolute";
popupContainer.style.top = "0";
popupContainer.style.left = "0";
popupContainer.style.width = "100%";
this.attachParent(popupContainer);
return popupContainer;
},
setPopupVisible(sPopupVisible, event) {
const {
alignPoint: alignPoint2,
sPopupVisible: prevPopupVisible,
onPopupVisibleChange
} = this;
this.clearDelayTimer();
if (prevPopupVisible !== sPopupVisible) {
if (!hasProp(this, "popupVisible")) {
this.setState({
sPopupVisible,
prevPopupVisible
});
}
onPopupVisibleChange && onPopupVisibleChange(sPopupVisible);
}
if (alignPoint2 && event && sPopupVisible) {
this.setPoint(event);
}
},
setPoint(point) {
const {
alignPoint: alignPoint2
} = this.$props;
if (!alignPoint2 || !point)
return;
this.setState({
point: {
pageX: point.pageX,
pageY: point.pageY
}
});
},
handlePortalUpdate() {
if (this.prevPopupVisible !== this.sPopupVisible) {
this.afterPopupVisibleChange(this.sPopupVisible);
}
},
delaySetPopupVisible(visible, delayS, event) {
const delay = delayS * 1e3;
this.clearDelayTimer();
if (delay) {
const point = event ? {
pageX: event.pageX,
pageY: event.pageY
} : null;
this.delayTimer = setTimeout(() => {
this.setPopupVisible(visible, point);
this.clearDelayTimer();
}, delay);
} else {
this.setPopupVisible(visible, event);
}
},
clearDelayTimer() {
if (this.delayTimer) {
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
},
clearOutsideHandler() {
if (this.clickOutsideHandler) {
this.clickOutsideHandler.remove();
this.clickOutsideHandler = null;
}
if (this.contextmenuOutsideHandler1) {
this.contextmenuOutsideHandler1.remove();
this.contextmenuOutsideHandler1 = null;
}
if (this.contextmenuOutsideHandler2) {
this.contextmenuOutsideHandler2.remove();
this.contextmenuOutsideHandler2 = null;
}
if (this.touchOutsideHandler) {
this.touchOutsideHandler.remove();
this.touchOutsideHandler = null;
}
},
createTwoChains(event) {
let fn = () => {
};
const events = getEvents(this);
if (this.childOriginEvents[event] && events[event]) {
return this[`fire${event}`];
}
fn = this.childOriginEvents[event] || events[event] || fn;
return fn;
},
isClickToShow() {
const {
action,
showAction
} = this.$props;
return action.indexOf("click") !== -1 || showAction.indexOf("click") !== -1;
},
isContextMenuOnly() {
const {
action
} = this.$props;
return action === "contextmenu" || action.length === 1 && action[0] === "contextmenu";
},
isContextmenuToShow() {
const {
action,
showAction
} = this.$props;
return action.indexOf("contextmenu") !== -1 || showAction.indexOf("contextmenu") !== -1;
},
isClickToHide() {
const {
action,
hideAction
} = this.$props;
return action.indexOf("click") !== -1 || hideAction.indexOf("click") !== -1;
},
isMouseEnterToShow() {
const {
action,
showAction
} = this.$props;
return action.indexOf("hover") !== -1 || showAction.indexOf("mouseenter") !== -1;
},
isMouseLeaveToHide() {
const {
action,
hideAction
} = this.$props;
return action.indexOf("hover") !== -1 || hideAction.indexOf("mouseleave") !== -1;
},
isFocusToShow() {
const {
action,
showAction
} = this.$props;
return action.indexOf("focus") !== -1 || showAction.indexOf("focus") !== -1;
},
isBlurToHide() {
const {
action,
hideAction
} = this.$props;
return action.indexOf("focus") !== -1 || hideAction.indexOf("blur") !== -1;
},
forcePopupAlign() {
var _a;
if (this.$data.sPopupVisible) {
(_a = this.popupRef) === null || _a === void 0 ? void 0 : _a.forceAlign();
}
},
fireEvents(type4, e2) {
if (this.childOriginEvents[type4]) {
this.childOriginEvents[type4](e2);
}
const event = this.$props[type4] || this.$attrs[type4];
if (event) {
event(e2);
}
},
close() {
this.setPopupVisible(false);
}
},
render() {
const {
$attrs
} = this;
const children = filterEmpty(getSlot(this));
const {
alignPoint: alignPoint2,
getPopupContainer
} = this.$props;
const child = children[0];
this.childOriginEvents = getEvents(child);
const newChildProps = {
key: "trigger"
};
if (this.isContextmenuToShow()) {
newChildProps.onContextmenu = this.onContextmenu;
} else {
newChildProps.onContextmenu = this.createTwoChains("onContextmenu");
}
if (this.isClickToHide() || this.isClickToShow()) {
newChildProps.onClick = this.onClick;
newChildProps.onMousedown = this.onMousedown;
newChildProps[supportsPassive$1 ? "onTouchstartPassive" : "onTouchstart"] = this.onTouchstart;
} else {
newChildProps.onClick = this.createTwoChains("onClick");
newChildProps.onMousedown = this.createTwoChains("onMousedown");
newChildProps[supportsPassive$1 ? "onTouchstartPassive" : "onTouchstart"] = this.createTwoChains("onTouchstart");
}
if (this.isMouseEnterToShow()) {
newChildProps.onMouseenter = this.onMouseenter;
if (alignPoint2) {
newChildProps.onMousemove = this.onMouseMove;
}
} else {
newChildProps.onMouseenter = this.createTwoChains("onMouseenter");
}
if (this.isMouseLeaveToHide()) {
newChildProps.onMouseleave = this.onMouseleave;
} else {
newChildProps.onMouseleave = this.createTwoChains("onMouseleave");
}
if (this.isFocusToShow() || this.isBlurToHide()) {
newChildProps.onFocus = this.onFocus;
newChildProps.onBlur = this.onBlur;
} else {
newChildProps.onFocus = this.createTwoChains("onFocus");
newChildProps.onBlur = (e2) => {
if (e2 && (!e2.relatedTarget || !contains(e2.target, e2.relatedTarget))) {
this.createTwoChains("onBlur")(e2);
}
};
}
const childrenClassName = classNames(child && child.props && child.props.class, $attrs.class);
if (childrenClassName) {
newChildProps.class = childrenClassName;
}
const trigger = cloneElement(child, _extends$1(_extends$1({}, newChildProps), {
ref: "triggerRef"
}), true, true);
const portal = createVNode(Portal, {
"key": "portal",
"getContainer": getPopupContainer && (() => getPopupContainer(this.getRootDomNode())),
"didUpdate": this.handlePortalUpdate,
"visible": this.$data.sPopupVisible
}, {
default: this.getComponent
});
return createVNode(Fragment, null, [trigger, portal]);
}
});
const autoAdjustOverflow = {
adjustX: 1,
adjustY: 1
};
const targetOffset$1 = [0, 0];
const placements = {
left: {
points: ["cr", "cl"],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset$1
},
right: {
points: ["cl", "cr"],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset$1
},
top: {
points: ["bc", "tc"],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset$1
},
bottom: {
points: ["tc", "bc"],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset$1
},
topLeft: {
points: ["bl", "tl"],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset$1
},
leftTop: {
points: ["tr", "tl"],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset$1
},
topRight: {
points: ["br", "tr"],
overflow: autoAdjustOverflow,
offset: [0, -4],
targetOffset: targetOffset$1
},
rightTop: {
points: ["tl", "tr"],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset$1
},
bottomRight: {
points: ["tr", "br"],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset$1
},
rightBottom: {
points: ["bl", "br"],
overflow: autoAdjustOverflow,
offset: [4, 0],
targetOffset: targetOffset$1
},
bottomLeft: {
points: ["tl", "bl"],
overflow: autoAdjustOverflow,
offset: [0, 4],
targetOffset: targetOffset$1
},
leftBottom: {
points: ["br", "bl"],
overflow: autoAdjustOverflow,
offset: [-4, 0],
targetOffset: targetOffset$1
}
};
const tooltipContentProps = {
prefixCls: String,
id: String,
overlayInnerStyle: PropTypes$1.any
};
const Content = defineComponent({
compatConfig: {
MODE: 3
},
name: "TooltipContent",
props: tooltipContentProps,
setup(props, _ref) {
let {
slots
} = _ref;
return () => {
var _a;
return createVNode("div", {
"class": `${props.prefixCls}-inner`,
"id": props.id,
"role": "tooltip",
"style": props.overlayInnerStyle
}, [(_a = slots.overlay) === null || _a === void 0 ? void 0 : _a.call(slots)]);
};
}
});
var __rest = globalThis && globalThis.__rest || function(s2, e2) {
var t2 = {};
for (var p in s2)
if (Object.prototype.hasOwnProperty.call(s2, p) && e2.indexOf(p) < 0)
t2[p] = s2[p];
if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
for (var i2 = 0, p = Object.getOwnPropertySymbols(s2); i2 < p.length; i2++) {
if (e2.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i2]))
t2[p[i2]] = s2[p[i2]];
}
return t2;
};
function noop() {
}
const Tooltip$1 = defineComponent({
compatConfig: {
MODE: 3
},
name: "Tooltip",
inheritAttrs: false,
props: {
trigger: PropTypes$1.any.def(["hover"]),
defaultVisible: {
type: Boolean,
default: void 0
},
visible: {
type: Boolean,
default: void 0
},
placement: PropTypes$1.string.def("right"),
transitionName: String,
animation: PropTypes$1.any,
afterVisibleChange: PropTypes$1.func.def(() => {
}),
overlayStyle: {
type: Object,
default: void 0
},
overlayClassName: String,
prefixCls: PropTypes$1.string.def("rc-tooltip"),
mouseEnterDelay: PropTypes$1.number.def(0.1),
mouseLeaveDelay: PropTypes$1.number.def(0.1),
getPopupContainer: Function,
destroyTooltipOnHide: {
type: Boolean,
default: false
},
align: PropTypes$1.object.def(() => ({})),
arrowContent: PropTypes$1.any.def(null),
tipId: String,
builtinPlacements: PropTypes$1.object,
overlayInnerStyle: {
type: Object,
default: void 0
},
popupVisible: {
type: Boolean,
default: void 0
},
onVisibleChange: Function,
onPopupAlign: Function,
arrow: {
type: Boolean,
default: true
}
},
setup(props, _ref) {
let {
slots,
attrs,
expose
} = _ref;
const triggerDOM = shallowRef();
const getPopupElement = () => {
const {
prefixCls,
tipId,
overlayInnerStyle
} = props;
return [!!props.arrow ? createVNode("div", {
"class": `${prefixCls}-arrow`,
"key": "arrow"
}, [getPropsSlot(slots, props, "arrowContent")]) : null, createVNode(Content, {
"key": "content",
"prefixCls": prefixCls,
"id": tipId,
"overlayInnerStyle": overlayInnerStyle
}, {
overlay: slots.overlay
})];
};
const getPopupDomNode = () => {
return triggerDOM.value.getPopupDomNode();
};
expose({
getPopupDomNode,
triggerDOM,
forcePopupAlign: () => {
var _a;
return (_a = triggerDOM.value) === null || _a === void 0 ? void 0 : _a.forcePopupAlign();
}
});
const destroyTooltip = shallowRef(false);
const autoDestroy = shallowRef(false);
watchEffect(() => {
const {
destroyTooltipOnHide
} = props;
if (typeof destroyTooltipOnHide === "boolean") {
destroyTooltip.value = destroyTooltipOnHide;
} else if (destroyTooltipOnHide && typeof destroyTooltipOnHide === "object") {
const {
keepParent
} = destroyTooltipOnHide;
destroyTooltip.value = keepParent === true;
autoDestroy.value = keepParent === false;
}
});
return () => {
const {
overlayClassName,
trigger,
mouseEnterDelay,
mouseLeaveDelay,
overlayStyle,
prefixCls,
afterVisibleChange,
transitionName,
animation,
placement,
align,
destroyTooltipOnHide,
defaultVisible
} = props, restProps = __rest(props, ["overlayClassName", "trigger", "mouseEnterDelay", "mouseLeaveDelay", "overlayStyle", "prefixCls", "afterVisibleChange", "transitionName", "animation", "placement", "align", "destroyTooltipOnHide", "defaultVisible"]);
const extraProps = _extends$1({}, restProps);
if (props.visible !== void 0) {
extraProps.popupVisible = props.visible;
}
const triggerProps2 = _extends$1(_extends$1(_extends$1({
popupClassName: overlayClassName,
prefixCls,
action: trigger,
builtinPlacements: placements,
popupPlacement: placement,
popupAlign: align,
afterPopupVisibleChange: afterVisibleChange,
popupTransitionName: transitionName,
popupAnimation: animation,
defaultPopupVisible: defaultVisible,
destroyPopupOnHide: destroyTooltip.value,
autoDestroy: autoDestroy.value,
mouseLeaveDelay,
popupStyle: overlayStyle,
mouseEnterDelay
}, extraProps), attrs), {
onPopupVisibleChange: props.onVisibleChange || noop,
onPopupAlign: props.onPopupAlign || noop,
ref: triggerDOM,
arrow: !!props.arrow,
popup: getPopupElement()
});
return createVNode(Trigger, triggerProps2, {
default: slots.default
});
};
}
});
const abstractTooltipProps = () => ({
trigger: [String, Array],
open: {
type: Boolean,
default: void 0
},
/** @deprecated Please use `open` instead. */
visible: {
type: Boolean,
default: void 0
},
placement: String,
color: String,
transitionName: String,
overlayStyle: objectType(),
overlayInnerStyle: objectType(),
overlayClassName: String,
openClassName: String,
prefixCls: String,
mouseEnterDelay: Number,
mouseLeaveDelay: Number,
getPopupContainer: Function,
/**@deprecated Please use `arrow={{ pointAtCenter: true }}` instead. */
arrowPointAtCenter: {
type: Boolean,
default: void 0
},
arrow: {
type: [Boolean, Object],
default: true
},
autoAdjustOverflow: {
type: [Boolean, Object],
default: void 0
},
destroyTooltipOnHide: {
type: Boolean,
default: void 0
},
align: objectType(),
builtinPlacements: objectType(),
children: Array,
/** @deprecated Please use `onOpenChange` instead. */
onVisibleChange: Function,
/** @deprecated Please use `onUpdate:open` instead. */
"onUpdate:visible": Function,
onOpenChange: Function,
"onUpdate:open": Function
});
const autoAdjustOverflowEnabled = {
adjustX: 1,
adjustY: 1
};
const autoAdjustOverflowDisabled = {
adjustX: 0,
adjustY: 0
};
const targetOffset = [0, 0];
function getOverflowOptions(autoAdjustOverflow2) {
if (typeof autoAdjustOverflow2 === "boolean") {
return autoAdjustOverflow2 ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled;
}
return _extends$1(_extends$1({}, autoAdjustOverflowDisabled), autoAdjustOverflow2);
}
function getPlacements(config) {
const {
arrowWidth = 4,
horizontalArrowShift = 16,
verticalArrowShift = 8,
autoAdjustOverflow: autoAdjustOverflow2,
arrowPointAtCenter
} = config;
const placementMap = {
left: {
points: ["cr", "cl"],
offset: [-4, 0]
},
right: {
points: ["cl", "cr"],
offset: [4, 0]
},
top: {
points: ["bc", "tc"],
offset: [0, -4]
},
bottom: {
points: ["tc", "bc"],
offset: [0, 4]
},
topLeft: {
points: ["bl", "tc"],
offset: [-(horizontalArrowShift + arrowWidth), -4]
},
leftTop: {
points: ["tr", "cl"],
offset: [-4, -(verticalArrowShift + arrowWidth)]
},
topRight: {
points: ["br", "tc"],
offset: [horizontalArrowShift + arrowWidth, -4]
},
rightTop: {
points: ["tl", "cr"],
offset: [4, -(verticalArrowShift + arrowWidth)]
},
bottomRight: {
points: ["tr", "bc"],
offset: [horizontalArrowShift + arrowWidth, 4]
},
rightBottom: {
points: ["bl", "cr"],
offset: [4, verticalArrowShift + arrowWidth]
},
bottomLeft: {
points: ["tl", "bc"],
offset: [-(horizontalArrowShift + arrowWidth), 4]
},
leftBottom: {
points: ["br", "cl"],
offset: [-4, verticalArrowShift + arrowWidth]
}
};
Object.keys(placementMap).forEach((key) => {
placementMap[key] = arrowPointAtCenter ? _extends$1(_extends$1({}, placementMap[key]), {
overflow: getOverflowOptions(autoAdjustOverflow2),
targetOffset
}) : _extends$1(_extends$1({}, placements[key]), {
overflow: getOverflowOptions(autoAdjustOverflow2)
});
placementMap[key].ignoreShake = true;
});
return placementMap;
}
function firstNotUndefined() {
let arr = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
for (let i2 = 0, len = arr.length; i2 < len; i2++) {
if (arr[i2] !== void 0) {
return arr[i2];
}
}
return void 0;
}
const inverseColors = PresetColors.map((color) => `${color}-inverse`);
function isPresetColor(color) {
let includeInverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
if (includeInverse) {
return [...inverseColors, ...PresetColors].includes(color);
}
return PresetColors.includes(color);
}
function parseColor(prefixCls, color) {
const isInternalColor = isPresetColor(color);
const className = classNames({
[`${prefixCls}-${color}`]: color && isInternalColor
});
const overlayStyle = {};
const arrowStyle = {};
if (color && !isInternalColor) {
overlayStyle.background = color;
arrowStyle["--antd-arrow-background-color"] = color;
}
return {
className,
overlayStyle,
arrowStyle
};
}
const initMotionCommon = (duration) => ({
animationDuration: duration,
animationFillMode: "both"
});
const initMotionCommonLeave = (duration) => ({
animationDuration: duration,
animationFillMode: "both"
});
const initMotion = function(motionCls, inKeyframes, outKeyframes, duration) {
let sameLevel = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
const sameLevelPrefix = sameLevel ? "&" : "";
return {
[`
${sameLevelPrefix}${motionCls}-enter,
${sameLevelPrefix}${motionCls}-appear
`]: _extends$1(_extends$1({}, initMotionCommon(duration)), {
animationPlayState: "paused"
}),
[`${sameLevelPrefix}${motionCls}-leave`]: _extends$1(_extends$1({}, initMotionCommonLeave(duration)), {
animationPlayState: "paused"
}),
[`
${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
`]: {
animationName: inKeyframes,
animationPlayState: "running"
},
[`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
animationName: outKeyframes,
animationPlayState: "running",
pointerEvents: "none"
}
};
};
const zoomIn = new Keyframes("antZoomIn", {
"0%": {
transform: "scale(0.2)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
const zoomOut = new Keyframes("antZoomOut", {
"0%": {
transform: "scale(1)"
},
"100%": {
transform: "scale(0.2)",
opacity: 0
}
});
const zoomBigIn = new Keyframes("antZoomBigIn", {
"0%": {
transform: "scale(0.8)",
opacity: 0
},
"100%": {
transform: "scale(1)",
opacity: 1
}
});
const zoomBigOut = new Keyframes("antZoomBigOut", {
"0%": {
transform: "scale(1)"
},
"100%": {
transform: "scale(0.8)",
opacity: 0
}
});
const zoomUpIn = new Keyframes("antZoomUpIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
}
});
const zoomUpOut = new Keyframes("antZoomUpOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 0%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 0%",
opacity: 0
}
});
const zoomLeftIn = new Keyframes("antZoomLeftIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
}
});
const zoomLeftOut = new Keyframes("antZoomLeftOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "0% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "0% 50%",
opacity: 0
}
});
const zoomRightIn = new Keyframes("antZoomRightIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
}
});
const zoomRightOut = new Keyframes("antZoomRightOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "100% 50%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "100% 50%",
opacity: 0
}
});
const zoomDownIn = new Keyframes("antZoomDownIn", {
"0%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
},
"100%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
}
});
const zoomDownOut = new Keyframes("antZoomDownOut", {
"0%": {
transform: "scale(1)",
transformOrigin: "50% 100%"
},
"100%": {
transform: "scale(0.8)",
transformOrigin: "50% 100%",
opacity: 0
}
});
const zoomMotion = {
zoom: {
inKeyframes: zoomIn,
outKeyframes: zoomOut
},
"zoom-big": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-big-fast": {
inKeyframes: zoomBigIn,
outKeyframes: zoomBigOut
},
"zoom-left": {
inKeyframes: zoomLeftIn,
outKeyframes: zoomLeftOut
},
"zoom-right": {
inKeyframes: zoomRightIn,
outKeyframes: zoomRightOut
},
"zoom-up": {
inKeyframes: zoomUpIn,
outKeyframes: zoomUpOut
},
"zoom-down": {
inKeyframes: zoomDownIn,
outKeyframes: zoomDownOut
}
};
const initZoomMotion = (token2, motionName) => {
const {
antCls
} = token2;
const motionCls = `${antCls}-${motionName}`;
const {
inKeyframes,
outKeyframes
} = zoomMotion[motionName];
return [initMotion(motionCls, inKeyframes, outKeyframes, motionName === "zoom-big-fast" ? token2.motionDurationFast : token2.motionDurationMid), {
[`
${motionCls}-enter,
${motionCls}-appear
`]: {
transform: "scale(0)",
opacity: 0,
animationTimingFunction: token2.motionEaseOutCirc,
"&-prepare": {
transform: "none"
}
},
[`${motionCls}-leave`]: {
animationTimingFunction: token2.motionEaseInOutCirc
}
}];
};
const genCollapseMotion = (token2) => ({
[token2.componentCls]: {
// For common/openAnimation
[`${token2.antCls}-motion-collapse-legacy`]: {
overflow: "hidden",
"&-active": {
transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut},
opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important`
}
},
[`${token2.antCls}-motion-collapse`]: {
overflow: "hidden",
transition: `height ${token2.motionDurationMid} ${token2.motionEaseInOut},
opacity ${token2.motionDurationMid} ${token2.motionEaseInOut} !important`
}
}
});
const genCollapseMotion$1 = genCollapseMotion;
function connectArrowCls(classList) {
let showArrowCls = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
return classList.map((cls) => `${showArrowCls}${cls}`).join(",");
}
const MAX_VERTICAL_CONTENT_RADIUS = 8;
function getArrowOffset(options) {
const maxVerticalContentRadius = MAX_VERTICAL_CONTENT_RADIUS;
const {
sizePopupArrow,
contentRadius,
borderRadiusOuter,
limitVerticalRadius
} = options;
const arrowInnerOffset = sizePopupArrow / 2 - Math.ceil(borderRadiusOuter * (Math.sqrt(2) - 1));
const dropdownArrowOffset = (contentRadius > 12 ? contentRadius + 2 : 12) - arrowInnerOffset;
const dropdownArrowOffsetVertical = limitVerticalRadius ? maxVerticalContentRadius - arrowInnerOffset : dropdownArrowOffset;
return {
dropdownArrowOffset,
dropdownArrowOffsetVertical
};
}
function getArrowStyle(token2, options) {
const {
componentCls,
sizePopupArrow,
marginXXS,
borderRadiusXS,
borderRadiusOuter,
boxShadowPopoverArrow
} = token2;
const {
colorBg,
showArrowCls,
contentRadius = token2.borderRadiusLG,
limitVerticalRadius
} = options;
const {
dropdownArrowOffsetVertical,
dropdownArrowOffset
} = getArrowOffset({
sizePopupArrow,
contentRadius,
borderRadiusOuter,
limitVerticalRadius
});
const dropdownArrowDistance = sizePopupArrow / 2 + marginXXS;
return {
[componentCls]: {
// ============================ Basic ============================
[`${componentCls}-arrow`]: [_extends$1(_extends$1({
position: "absolute",
zIndex: 1,
display: "block"
}, roundedArrow(sizePopupArrow, borderRadiusXS, borderRadiusOuter, colorBg, boxShadowPopoverArrow)), {
"&:before": {
background: colorBg
}
})],
// ========================== Placement ==========================
// Here handle the arrow position and rotate stuff
// >>>>> Top
[[`&-placement-top ${componentCls}-arrow`, `&-placement-topLeft ${componentCls}-arrow`, `&-placement-topRight ${componentCls}-arrow`].join(",")]: {
bottom: 0,
transform: "translateY(100%) rotate(180deg)"
},
[`&-placement-top ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: "50%"
},
transform: "translateX(-50%) translateY(100%) rotate(180deg)"
},
[`&-placement-topLeft ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: dropdownArrowOffset
}
},
[`&-placement-topRight ${componentCls}-arrow`]: {
right: {
_skip_check_: true,
value: dropdownArrowOffset
}
},
// >>>>> Bottom
[[`&-placement-bottom ${componentCls}-arrow`, `&-placement-bottomLeft ${componentCls}-arrow`, `&-placement-bottomRight ${componentCls}-arrow`].join(",")]: {
top: 0,
transform: `translateY(-100%)`
},
[`&-placement-bottom ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: "50%"
},
transform: `translateX(-50%) translateY(-100%)`
},
[`&-placement-bottomLeft ${componentCls}-arrow`]: {
left: {
_skip_check_: true,
value: dropdownArrowOffset
}
},
[`&-placement-bottomRight ${componentCls}-arrow`]: {
right: {
_skip_check_: true,
value: dropdownArrowOffset
}
},
// >>>>> Left
[[`&-placement-left ${componentCls}-arrow`, `&-placement-leftTop ${componentCls}-arrow`, `&-placement-leftBottom ${componentCls}-arrow`].join(",")]: {
right: {
_skip_check_: true,
value: 0
},
transform: "translateX(100%) rotate(90deg)"
},
[`&-placement-left ${componentCls}-arrow`]: {
top: {
_skip_check_: true,
value: "50%"
},
transform: "translateY(-50%) translateX(100%) rotate(90deg)"
},
[`&-placement-leftTop ${componentCls}-arrow`]: {
top: dropdownArrowOffsetVertical
},
[`&-placement-leftBottom ${componentCls}-arrow`]: {
bottom: dropdownArrowOffsetVertical
},
// >>>>> Right
[[`&-placement-right ${componentCls}-arrow`, `&-placement-rightTop ${componentCls}-arrow`, `&-placement-rightBottom ${componentCls}-arrow`].join(",")]: {
left: {
_skip_check_: true,
value: 0
},
transform: "translateX(-100%) rotate(-90deg)"
},
[`&-placement-right ${componentCls}-arrow`]: {
top: {
_skip_check_: true,
value: "50%"
},
transform: "translateY(-50%) translateX(-100%) rotate(-90deg)"
},
[`&-placement-rightTop ${componentCls}-arrow`]: {
top: dropdownArrowOffsetVertical
},
[`&-placement-rightBottom ${componentCls}-arrow`]: {
bottom: dropdownArrowOffsetVertical
},
// =========================== Offset ============================
// Offset the popover to account for the dropdown arrow
// >>>>> Top
[connectArrowCls([`&-placement-topLeft`, `&-placement-top`, `&-placement-topRight`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: {
paddingBottom: dropdownArrowDistance
},
// >>>>> Bottom
[connectArrowCls([`&-placement-bottomLeft`, `&-placement-bottom`, `&-placement-bottomRight`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: {
paddingTop: dropdownArrowDistance
},
// >>>>> Left
[connectArrowCls([`&-placement-leftTop`, `&-placement-left`, `&-placement-leftBottom`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: {
paddingRight: {
_skip_check_: true,
value: dropdownArrowDistance
}
},
// >>>>> Right
[connectArrowCls([`&-placement-rightTop`, `&-placement-right`, `&-placement-rightBottom`].map((cls) => cls += ":not(&-arrow-hidden)"), showArrowCls)]: {
paddingLeft: {
_skip_check_: true,
value: dropdownArrowDistance
}
}
}
};
}
const genTooltipStyle = (token2) => {
const {
componentCls,
// ant-tooltip
tooltipMaxWidth,
tooltipColor,
tooltipBg,
tooltipBorderRadius,
zIndexPopup,
controlHeight,
boxShadowSecondary,
paddingSM,
paddingXS,
tooltipRadiusOuter
} = token2;
return [
{
[componentCls]: _extends$1(_extends$1(_extends$1(_extends$1({}, resetComponent(token2)), {
position: "absolute",
zIndex: zIndexPopup,
display: "block",
"&": [{
width: "max-content"
}, {
width: "intrinsic"
}],
maxWidth: tooltipMaxWidth,
visibility: "visible",
"&-hidden": {
display: "none"
},
"--antd-arrow-background-color": tooltipBg,
// Wrapper for the tooltip content
[`${componentCls}-inner`]: {
minWidth: controlHeight,
minHeight: controlHeight,
padding: `${paddingSM / 2}px ${paddingXS}px`,
color: tooltipColor,
textAlign: "start",
textDecoration: "none",
wordWrap: "break-word",
backgroundColor: tooltipBg,
borderRadius: tooltipBorderRadius,
boxShadow: boxShadowSecondary
},
// Limit left and right placement radius
[[`&-placement-left`, `&-placement-leftTop`, `&-placement-leftBottom`, `&-placement-right`, `&-placement-rightTop`, `&-placement-rightBottom`].join(",")]: {
[`${componentCls}-inner`]: {
borderRadius: Math.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS)
}
},
[`${componentCls}-content`]: {
position: "relative"
}
}), genPresetColor(token2, (colorKey, _ref) => {
let {
darkColor
} = _ref;
return {
[`&${componentCls}-${colorKey}`]: {
[`${componentCls}-inner`]: {
backgroundColor: darkColor
},
[`${componentCls}-arrow`]: {
"--antd-arrow-background-color": darkColor
}
}
};
})), {
// RTL
"&-rtl": {
direction: "rtl"
}
})
},
// Arrow Style
getArrowStyle(merge(token2, {
borderRadiusOuter: tooltipRadiusOuter
}), {
colorBg: "var(--antd-arrow-background-color)",
showArrowCls: "",
contentRadius: tooltipBorderRadius,
limitVerticalRadius: true
}),
// Pure Render
{
[`${componentCls}-pure`]: {
position: "relative",
maxWidth: "none"
}
}
];
};
const useStyle$1 = (prefixCls, injectStyle) => {
const useOriginHook = genComponentStyleHook("Tooltip", (token2) => {
if ((injectStyle === null || injectStyle === void 0 ? void 0 : injectStyle.value) === false) {
return [];
}
const {
borderRadius,
colorTextLightSolid,
colorBgDefault,
borderRadiusOuter
} = token2;
const TooltipToken = merge(token2, {
// default variables
tooltipMaxWidth: 250,
tooltipColor: colorTextLightSolid,
tooltipBorderRadius: borderRadius,
tooltipBg: colorBgDefault,
tooltipRadiusOuter: borderRadiusOuter > 4 ? 4 : borderRadiusOuter
});
return [genTooltipStyle(TooltipToken), initZoomMotion(token2, "zoom-big-fast")];
}, (_ref2) => {
let {
zIndexPopupBase,
colorBgSpotlight
} = _ref2;
return {
zIndexPopup: zIndexPopupBase + 70,
colorBgDefault: colorBgSpotlight
};
});
return useOriginHook(prefixCls);
};
const splitObject = (obj, keys2) => {
const picked = {};
const omitted = _extends$1({}, obj);
keys2.forEach((key) => {
if (obj && key in obj) {
picked[key] = obj[key];
delete omitted[key];
}
});
return {
picked,
omitted
};
};
const tooltipProps = () => _extends$1(_extends$1({}, abstractTooltipProps()), {
title: PropTypes$1.any
});
const ToolTip = defineComponent({
compatConfig: {
MODE: 3
},
name: "ATooltip",
inheritAttrs: false,
props: initDefaultProps$1(tooltipProps(), {
trigger: "hover",
align: {},
placement: "top",
mouseEnterDelay: 0.1,
mouseLeaveDelay: 0.1,
arrowPointAtCenter: false,
autoAdjustOverflow: true
}),
slots: Object,
// emits: ['update:visible', 'visibleChange'],
setup(props, _ref) {
let {
slots,
emit,
attrs,
expose
} = _ref;
if (process.env.NODE_ENV !== "production") {
[["visible", "open"], ["onVisibleChange", "onOpenChange"]].forEach((_ref2) => {
let [deprecatedName, newName] = _ref2;
warning$3(props[deprecatedName] === void 0, "Tooltip", `\`${deprecatedName}\` is deprecated, please use \`${newName}\` instead.`);
});
}
const {
prefixCls,
getPopupContainer,
direction,
rootPrefixCls
} = useConfigInject("tooltip", props);
const mergedOpen = computed(() => {
var _a;
return (_a = props.open) !== null && _a !== void 0 ? _a : props.visible;
});
const innerOpen = ref(firstNotUndefined([props.open, props.visible]));
const tooltip = ref();
let rafId;
watch(mergedOpen, (val) => {
wrapperRaf.cancel(rafId);
rafId = wrapperRaf(() => {
innerOpen.value = !!val;
});
});
const isNoTitle = () => {
var _a;
const title = (_a = props.title) !== null && _a !== void 0 ? _a : slots.title;
return !title && title !== 0;
};
const handleVisibleChange = (val) => {
const noTitle = isNoTitle();
if (mergedOpen.value === void 0) {
innerOpen.value = noTitle ? false : val;
}
if (!noTitle) {
emit("update:visible", val);
emit("visibleChange", val);
emit("update:open", val);
emit("openChange", val);
}
};
const getPopupDomNode = () => {
return tooltip.value.getPopupDomNode();
};
expose({
getPopupDomNode,
open: innerOpen,
forcePopupAlign: () => {
var _a;
return (_a = tooltip.value) === null || _a === void 0 ? void 0 : _a.forcePopupAlign();
}
});
const tooltipPlacements = computed(() => {
var _a;
const {
builtinPlacements,
autoAdjustOverflow: autoAdjustOverflow2,
arrow,
arrowPointAtCenter
} = props;
let mergedArrowPointAtCenter = arrowPointAtCenter;
if (typeof arrow === "object") {
mergedArrowPointAtCenter = (_a = arrow.pointAtCenter) !== null && _a !== void 0 ? _a : arrowPointAtCenter;
}
return builtinPlacements || getPlacements({
arrowPointAtCenter: mergedArrowPointAtCenter,
autoAdjustOverflow: autoAdjustOverflow2
});
});
const isTrueProps = (val) => {
return val || val === "";
};
const getDisabledCompatibleChildren = (ele) => {
const elementType = ele.type;
if (typeof elementType === "object" && ele.props) {
if ((elementType.__ANT_BUTTON === true || elementType === "button") && isTrueProps(ele.props.disabled) || elementType.__ANT_SWITCH === true && (isTrueProps(ele.props.disabled) || isTrueProps(ele.props.loading)) || elementType.__ANT_RADIO === true && isTrueProps(ele.props.disabled)) {
const {
picked,
omitted
} = splitObject(getStyle(ele), ["position", "left", "right", "top", "bottom", "float", "display", "zIndex"]);
const spanStyle = _extends$1(_extends$1({
display: "inline-block"
}, picked), {
cursor: "not-allowed",
lineHeight: 1,
width: ele.props && ele.props.block ? "100%" : void 0
});
const buttonStyle = _extends$1(_extends$1({}, omitted), {
pointerEvents: "none"
});
const child = cloneElement(ele, {
style: buttonStyle
}, true);
return createVNode("span", {
"style": spanStyle,
"class": `${prefixCls.value}-disabled-compatible-wrapper`
}, [child]);
}
}
return ele;
};
const getOverlay = () => {
var _a, _b;
return (_a = props.title) !== null && _a !== void 0 ? _a : (_b = slots.title) === null || _b === void 0 ? void 0 : _b.call(slots);
};
const onPopupAlign = (domNode, align) => {
const placements2 = tooltipPlacements.value;
const placement = Object.keys(placements2).find((key) => {
var _a, _b;
return placements2[key].points[0] === ((_a = align.points) === null || _a === void 0 ? void 0 : _a[0]) && placements2[key].points[1] === ((_b = align.points) === null || _b === void 0 ? void 0 : _b[1]);
});
if (placement) {
const rect = domNode.getBoundingClientRect();
const transformOrigin = {
top: "50%",
left: "50%"
};
if (placement.indexOf("top") >= 0 || placement.indexOf("Bottom") >= 0) {
transformOrigin.top = `${rect.height - align.offset[1]}px`;
} else if (placement.indexOf("Top") >= 0 || placement.indexOf("bottom") >= 0) {
transformOrigin.top = `${-align.offset[1]}px`;
}
if (placement.indexOf("left") >= 0 || placement.indexOf("Right") >= 0) {
transformOrigin.left = `${rect.width - align.offset[0]}px`;
} else if (placement.indexOf("right") >= 0 || placement.indexOf("Left") >= 0) {
transformOrigin.left = `${-align.offset[0]}px`;
}
domNode.style.transformOrigin = `${transformOrigin.left} ${transformOrigin.top}`;
}
};
const colorInfo = computed(() => parseColor(prefixCls.value, props.color));
const injectFromPopover = computed(() => attrs["data-popover-inject"]);
const [wrapSSR, hashId] = useStyle$1(prefixCls, computed(() => !injectFromPopover.value));
return () => {
var _a, _b;
const {
openClassName,
overlayClassName,
overlayStyle,
overlayInnerStyle
} = props;
let children = (_b = filterEmpty((_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots))) !== null && _b !== void 0 ? _b : null;
children = children.length === 1 ? children[0] : children;
let tempVisible = innerOpen.value;
if (mergedOpen.value === void 0 && isNoTitle()) {
tempVisible = false;
}
if (!children) {
return null;
}
const child = getDisabledCompatibleChildren(isValidElement(children) && !isFragment(children) ? children : createVNode("span", null, [children]));
const childCls = classNames({
[openClassName || `${prefixCls.value}-open`]: true,
[child.props && child.props.class]: child.props && child.props.class
});
const customOverlayClassName = classNames(overlayClassName, {
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
}, colorInfo.value.className, hashId.value);
const formattedOverlayInnerStyle = _extends$1(_extends$1({}, colorInfo.value.overlayStyle), overlayInnerStyle);
const arrowContentStyle = colorInfo.value.arrowStyle;
const vcTooltipProps = _extends$1(_extends$1(_extends$1({}, attrs), props), {
prefixCls: prefixCls.value,
arrow: !!props.arrow,
getPopupContainer: getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value,
builtinPlacements: tooltipPlacements.value,
visible: tempVisible,
ref: tooltip,
overlayClassName: customOverlayClassName,
overlayStyle: _extends$1(_extends$1({}, arrowContentStyle), overlayStyle),
overlayInnerStyle: formattedOverlayInnerStyle,
onVisibleChange: handleVisibleChange,
onPopupAlign,
transitionName: getTransitionName(rootPrefixCls.value, "zoom-big-fast", props.transitionName)
});
return wrapSSR(createVNode(Tooltip$1, vcTooltipProps, {
default: () => [innerOpen.value ? cloneElement(child, {
class: childCls
}) : child],
arrowContent: () => createVNode("span", {
"class": `${prefixCls.value}-arrow-content`
}, null),
overlay: getOverlay
}));
};
}
});
const Tooltip = withInstall(ToolTip);
var QuestionCircleOutlined$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, "name": "question-circle", "theme": "outlined" };
const QuestionCircleOutlinedSvg = QuestionCircleOutlined$2;
function _objectSpread(target) {
for (var i2 = 1; i2 < arguments.length; i2++) {
var source = arguments[i2] != null ? Object(arguments[i2]) : {};
var ownKeys2 = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === "function") {
ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys2.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}
return obj;
}
var QuestionCircleOutlined = function QuestionCircleOutlined2(props, context) {
var p = _objectSpread({}, props, context.attrs);
return createVNode(AntdIcon, _objectSpread({}, p, {
"icon": QuestionCircleOutlinedSvg
}), null);
};
QuestionCircleOutlined.displayName = "QuestionCircleOutlined";
QuestionCircleOutlined.inheritAttrs = false;
const QuestionCircleOutlined$1 = QuestionCircleOutlined;
const FormItemLabel = (props, _ref) => {
let {
slots,
emit,
attrs
} = _ref;
var _a, _b, _c, _d, _e;
const {
prefixCls,
htmlFor,
labelCol,
labelAlign,
colon,
required: required4,
requiredMark
} = _extends$1(_extends$1({}, props), attrs);
const [formLocale] = useLocaleReceiver("Form");
const label = (_a = props.label) !== null && _a !== void 0 ? _a : (_b = slots.label) === null || _b === void 0 ? void 0 : _b.call(slots);
if (!label)
return null;
const {
vertical,
labelAlign: contextLabelAlign,
labelCol: contextLabelCol,
labelWrap,
colon: contextColon
} = useInjectForm();
const mergedLabelCol = labelCol || (contextLabelCol === null || contextLabelCol === void 0 ? void 0 : contextLabelCol.value) || {};
const mergedLabelAlign = labelAlign || (contextLabelAlign === null || contextLabelAlign === void 0 ? void 0 : contextLabelAlign.value);
const labelClsBasic = `${prefixCls}-item-label`;
const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === "left" && `${labelClsBasic}-left`, mergedLabelCol.class, {
[`${labelClsBasic}-wrap`]: !!labelWrap.value
});
let labelChildren = label;
const computedColon = colon === true || (contextColon === null || contextColon === void 0 ? void 0 : contextColon.value) !== false && colon !== false;
const haveColon = computedColon && !vertical.value;
if (haveColon && typeof label === "string" && label.trim() !== "") {
labelChildren = label.replace(/[:|:]\s*$/, "");
}
if (props.tooltip || slots.tooltip) {
const tooltipNode = createVNode("span", {
"class": `${prefixCls}-item-tooltip`
}, [createVNode(Tooltip, {
"title": props.tooltip
}, {
default: () => [createVNode(QuestionCircleOutlined$1, null, null)]
})]);
labelChildren = createVNode(Fragment, null, [labelChildren, slots.tooltip ? (_c = slots.tooltip) === null || _c === void 0 ? void 0 : _c.call(slots, {
class: `${prefixCls}-item-tooltip`
}) : tooltipNode]);
}
if (requiredMark === "optional" && !required4) {
labelChildren = createVNode(Fragment, null, [labelChildren, createVNode("span", {
"class": `${prefixCls}-item-optional`
}, [((_d = formLocale.value) === null || _d === void 0 ? void 0 : _d.optional) || ((_e = defaultLocale.Form) === null || _e === void 0 ? void 0 : _e.optional)])]);
}
const labelClassName = classNames({
[`${prefixCls}-item-required`]: required4,
[`${prefixCls}-item-required-mark-optional`]: requiredMark === "optional",
[`${prefixCls}-item-no-colon`]: !computedColon
});
return createVNode(Col, _objectSpread2$1(_objectSpread2$1({}, mergedLabelCol), {}, {
"class": labelColClassName
}), {
default: () => [createVNode("label", {
"for": htmlFor,
"class": labelClassName,
"title": typeof label === "string" ? label : "",
"onClick": (e2) => emit("click", e2)
}, [labelChildren])]
});
};
FormItemLabel.displayName = "FormItemLabel";
FormItemLabel.inheritAttrs = false;
const FormItemLabel$1 = FormItemLabel;
function hasClass(node2, className) {
if (node2.classList) {
return node2.classList.contains(className);
}
const originClass = node2.className;
return ` ${originClass} `.indexOf(` ${className} `) > -1;
}
function addClass(node2, className) {
if (node2.classList) {
node2.classList.add(className);
} else {
if (!hasClass(node2, className)) {
node2.className = `${node2.className} ${className}`;
}
}
}
function removeClass(node2, className) {
if (node2.classList) {
node2.classList.remove(className);
} else {
if (hasClass(node2, className)) {
const originClass = node2.className;
node2.className = ` ${originClass} `.replace(` ${className} `, " ");
}
}
}
const collapseMotion = function() {
let name = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "ant-motion-collapse";
let appear = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
return {
name,
appear,
css: true,
onBeforeEnter: (node2) => {
node2.style.height = "0px";
node2.style.opacity = "0";
addClass(node2, name);
},
onEnter: (node2) => {
nextTick(() => {
node2.style.height = `${node2.scrollHeight}px`;
node2.style.opacity = "1";
});
},
onAfterEnter: (node2) => {
if (node2) {
removeClass(node2, name);
node2.style.height = null;
node2.style.opacity = null;
}
},
onBeforeLeave: (node2) => {
addClass(node2, name);
node2.style.height = `${node2.offsetHeight}px`;
node2.style.opacity = null;
},
onLeave: (node2) => {
setTimeout(() => {
node2.style.height = "0px";
node2.style.opacity = "0";
});
},
onAfterLeave: (node2) => {
if (node2) {
removeClass(node2, name);
if (node2.style) {
node2.style.height = null;
node2.style.opacity = null;
}
}
}
};
};
const collapseMotion$1 = collapseMotion;
const genFormValidateMotionStyle = (token2) => {
const {
componentCls
} = token2;
const helpCls = `${componentCls}-show-help`;
const helpItemCls = `${componentCls}-show-help-item`;
return {
[helpCls]: {
// Explain holder
transition: `opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut}`,
"&-appear, &-enter": {
opacity: 0,
"&-active": {
opacity: 1
}
},
"&-leave": {
opacity: 1,
"&-active": {
opacity: 0
}
},
// Explain
[helpItemCls]: {
overflow: "hidden",
transition: `height ${token2.motionDurationSlow} ${token2.motionEaseInOut},
opacity ${token2.motionDurationSlow} ${token2.motionEaseInOut},
transform ${token2.motionDurationSlow} ${token2.motionEaseInOut} !important`,
[`&${helpItemCls}-appear, &${helpItemCls}-enter`]: {
transform: `translateY(-5px)`,
opacity: 0,
[`&-active`]: {
transform: "translateY(0)",
opacity: 1
}
},
[`&${helpItemCls}-leave-active`]: {
transform: `translateY(-5px)`
}
}
}
};
};
const genFormValidateMotionStyle$1 = genFormValidateMotionStyle;
const resetForm = (token2) => ({
legend: {
display: "block",
width: "100%",
marginBottom: token2.marginLG,
padding: 0,
color: token2.colorTextDescription,
fontSize: token2.fontSizeLG,
lineHeight: "inherit",
border: 0,
borderBottom: `${token2.lineWidth}px ${token2.lineType} ${token2.colorBorder}`
},
label: {
fontSize: token2.fontSize
},
'input[type="search"]': {
boxSizing: "border-box"
},
// Position radios and checkboxes better
'input[type="radio"], input[type="checkbox"]': {
lineHeight: "normal"
},
'input[type="file"]': {
display: "block"
},
// Make range inputs behave like textual form controls
'input[type="range"]': {
display: "block",
width: "100%"
},
// Make multiple select elements height not fixed
"select[multiple], select[size]": {
height: "auto"
},
// Focus for file, radio, and checkbox
[`input[type='file']:focus,
input[type='radio']:focus,
input[type='checkbox']:focus`]: {
outline: 0,
boxShadow: `0 0 0 ${token2.controlOutlineWidth}px ${token2.controlOutline}`
},
// Adjust output element
output: {
display: "block",
paddingTop: 15,
color: token2.colorText,
fontSize: token2.fontSize,
lineHeight: token2.lineHeight
}
});
const genFormSize = (token2, height) => {
const {
formItemCls
} = token2;
return {
[formItemCls]: {
[`${formItemCls}-label > label`]: {
height
},
[`${formItemCls}-control-input`]: {
minHeight: height
}
}
};
};
const genFormStyle = (token2) => {
const {
componentCls
} = token2;
return {
[token2.componentCls]: _extends$1(_extends$1(_extends$1({}, resetComponent(token2)), resetForm(token2)), {
[`${componentCls}-text`]: {
display: "inline-block",
paddingInlineEnd: token2.paddingSM
},
// ================================================================
// = Size =
// ================================================================
"&-small": _extends$1({}, genFormSize(token2, token2.controlHeightSM)),
"&-large": _extends$1({}, genFormSize(token2, token2.controlHeightLG))
})
};
};
const genFormItemStyle = (token2) => {
const {
formItemCls,
iconCls,
componentCls,
rootPrefixCls
} = token2;
return {
[formItemCls]: _extends$1(_extends$1({}, resetComponent(token2)), {
marginBottom: token2.marginLG,
verticalAlign: "top",
"&-with-help": {
transition: "none"
},
[`&-hidden,
&-hidden.${rootPrefixCls}-row`]: {
// https://github.com/ant-design/ant-design/issues/26141
display: "none"
},
"&-has-warning": {
[`${formItemCls}-split`]: {
color: token2.colorError
}
},
"&-has-error": {
[`${formItemCls}-split`]: {
color: token2.colorWarning
}
},
// ==============================================================
// = Label =
// ==============================================================
[`${formItemCls}-label`]: {
display: "inline-block",
flexGrow: 0,
overflow: "hidden",
whiteSpace: "nowrap",
textAlign: "end",
verticalAlign: "middle",
"&-left": {
textAlign: "start"
},
"&-wrap": {
overflow: "unset",
lineHeight: `${token2.lineHeight} - 0.25em`,
whiteSpace: "unset"
},
"> label": {
position: "relative",
display: "inline-flex",
alignItems: "center",
maxWidth: "100%",
height: token2.controlHeight,
color: token2.colorTextHeading,
fontSize: token2.fontSize,
[`> ${iconCls}`]: {
fontSize: token2.fontSize,
verticalAlign: "top"
},
// Required mark
[`&${formItemCls}-required:not(${formItemCls}-required-mark-optional)::before`]: {
display: "inline-block",
marginInlineEnd: token2.marginXXS,
color: token2.colorError,
fontSize: token2.fontSize,
fontFamily: "SimSun, sans-serif",
lineHeight: 1,
content: '"*"',
[`${componentCls}-hide-required-mark &`]: {
display: "none"
}
},
// Optional mark
[`${formItemCls}-optional`]: {
display: "inline-block",
marginInlineStart: token2.marginXXS,
color: token2.colorTextDescription,
[`${componentCls}-hide-required-mark &`]: {
display: "none"
}
},
// Optional mark
[`${formItemCls}-tooltip`]: {
color: token2.colorTextDescription,
cursor: "help",
writingMode: "horizontal-tb",
marginInlineStart: token2.marginXXS
},
"&::after": {
content: '":"',
position: "relative",
marginBlock: 0,
marginInlineStart: token2.marginXXS / 2,
marginInlineEnd: token2.marginXS
},
[`&${formItemCls}-no-colon::after`]: {
content: '" "'
}
}
},
// ==============================================================
// = Input =
// ==============================================================
[`${formItemCls}-control`]: {
display: "flex",
flexDirection: "column",
flexGrow: 1,
[`&:first-child:not([class^="'${rootPrefixCls}-col-'"]):not([class*="' ${rootPrefixCls}-col-'"])`]: {
width: "100%"
},
"&-input": {
position: "relative",
display: "flex",
alignItems: "center",
minHeight: token2.controlHeight,
"&-content": {
flex: "auto",
maxWidth: "100%"
}
}
},
// ==============================================================
// = Explain =
// ==============================================================
[formItemCls]: {
"&-explain, &-extra": {
clear: "both",
color: token2.colorTextDescription,
fontSize: token2.fontSize,
lineHeight: token2.lineHeight
},
"&-explain-connected": {
width: "100%"
},
"&-extra": {
minHeight: token2.controlHeightSM,
transition: `color ${token2.motionDurationMid} ${token2.motionEaseOut}`
// sync input color transition
},
"&-explain": {
"&-error": {
color: token2.colorError
},
"&-warning": {
color: token2.colorWarning
}
}
},
[`&-with-help ${formItemCls}-explain`]: {
height: "auto",
opacity: 1
},
// ==============================================================
// = Feedback Icon =
// ==============================================================
[`${formItemCls}-feedback-icon`]: {
fontSize: token2.fontSize,
textAlign: "center",
visibility: "visible",
animationName: zoomIn,
animationDuration: token2.motionDurationMid,
animationTimingFunction: token2.motionEaseOutBack,
pointerEvents: "none",
"&-success": {
color: token2.colorSuccess
},
"&-error": {
color: token2.colorError
},
"&-warning": {
color: token2.colorWarning
},
"&-validating": {
color: token2.colorPrimary
}
}
})
};
};
const genHorizontalStyle = (token2) => {
const {
componentCls,
formItemCls,
rootPrefixCls
} = token2;
return {
[`${componentCls}-horizontal`]: {
[`${formItemCls}-label`]: {
flexGrow: 0
},
[`${formItemCls}-control`]: {
flex: "1 1 0",
// https://github.com/ant-design/ant-design/issues/32777
// https://github.com/ant-design/ant-design/issues/33773
minWidth: 0
},
// https://github.com/ant-design/ant-design/issues/32980
[`${formItemCls}-label.${rootPrefixCls}-col-24 + ${formItemCls}-control`]: {
minWidth: "unset"
}
}
};
};
const genInlineStyle = (token2) => {
const {
componentCls,
formItemCls
} = token2;
return {
[`${componentCls}-inline`]: {
display: "flex",
flexWrap: "wrap",
[formItemCls]: {
flex: "none",
flexWrap: "nowrap",
marginInlineEnd: token2.margin,
marginBottom: 0,
"&-with-help": {
marginBottom: token2.marginLG
},
[`> ${formItemCls}-label,
> ${formItemCls}-control`]: {
display: "inline-block",
verticalAlign: "top"
},
[`> ${formItemCls}-label`]: {
flex: "none"
},
[`${componentCls}-text`]: {
display: "inline-block"
},
[`${formItemCls}-has-feedback`]: {
display: "inline-block"
}
}
}
};
};
const makeVerticalLayoutLabel = (token2) => ({
margin: 0,
padding: `0 0 ${token2.paddingXS}px`,
whiteSpace: "initial",
textAlign: "start",
"> label": {
margin: 0,
"&::after": {
display: "none"
}
}
});
const makeVerticalLayout = (token2) => {
const {
componentCls,
formItemCls
} = token2;
return {
[`${formItemCls} ${formItemCls}-label`]: makeVerticalLayoutLabel(token2),
[componentCls]: {
[formItemCls]: {
flexWrap: "wrap",
[`${formItemCls}-label,
${formItemCls}-control`]: {
flex: "0 0 100%",
maxWidth: "100%"
}
}
}
};
};
const genVerticalStyle = (token2) => {
const {
componentCls,
formItemCls,
rootPrefixCls
} = token2;
return {
[`${componentCls}-vertical`]: {
[formItemCls]: {
"&-row": {
flexDirection: "column"
},
"&-label > label": {
height: "auto"
},
[`${componentCls}-item-control`]: {
width: "100%"
}
}
},
[`${componentCls}-vertical ${formItemCls}-label,
.${rootPrefixCls}-col-24${formItemCls}-label,
.${rootPrefixCls}-col-xl-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2),
[`@media (max-width: ${token2.screenXSMax}px)`]: [makeVerticalLayout(token2), {
[componentCls]: {
[`.${rootPrefixCls}-col-xs-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
}
}],
[`@media (max-width: ${token2.screenSMMax}px)`]: {
[componentCls]: {
[`.${rootPrefixCls}-col-sm-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
}
},
[`@media (max-width: ${token2.screenMDMax}px)`]: {
[componentCls]: {
[`.${rootPrefixCls}-col-md-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
}
},
[`@media (max-width: ${token2.screenLGMax}px)`]: {
[componentCls]: {
[`.${rootPrefixCls}-col-lg-24${formItemCls}-label`]: makeVerticalLayoutLabel(token2)
}
}
};
};
const useStyle = genComponentStyleHook("Form", (token2, _ref) => {
let {
rootPrefixCls
} = _ref;
const formToken = merge(token2, {
formItemCls: `${token2.componentCls}-item`,
rootPrefixCls
});
return [genFormStyle(formToken), genFormItemStyle(formToken), genFormValidateMotionStyle$1(formToken), genHorizontalStyle(formToken), genInlineStyle(formToken), genVerticalStyle(formToken), genCollapseMotion$1(formToken), zoomIn];
});
const ErrorList = defineComponent({
compatConfig: {
MODE: 3
},
name: "ErrorList",
inheritAttrs: false,
props: ["errors", "help", "onErrorVisibleChanged", "helpStatus", "warnings"],
setup(props, _ref) {
let {
attrs
} = _ref;
const {
prefixCls,
status
} = useInjectFormItemPrefix();
const baseClassName = computed(() => `${prefixCls.value}-item-explain`);
const visible = computed(() => !!(props.errors && props.errors.length));
const innerStatus = ref(status.value);
const [, hashId] = useStyle(prefixCls);
watch([visible, status], () => {
if (visible.value) {
innerStatus.value = status.value;
}
});
return () => {
var _a, _b;
const colMItem = collapseMotion$1(`${prefixCls.value}-show-help-item`);
const transitionGroupProps = getTransitionGroupProps(`${prefixCls.value}-show-help-item`, colMItem);
transitionGroupProps.role = "alert";
transitionGroupProps.class = [hashId.value, baseClassName.value, attrs.class, `${prefixCls.value}-show-help`];
return createVNode(Transition, _objectSpread2$1(_objectSpread2$1({}, getTransitionProps(`${prefixCls.value}-show-help`)), {}, {
"onAfterEnter": () => props.onErrorVisibleChanged(true),
"onAfterLeave": () => props.onErrorVisibleChanged(false)
}), {
default: () => [withDirectives(createVNode(TransitionGroup, _objectSpread2$1(_objectSpread2$1({}, transitionGroupProps), {}, {
"tag": "div"
}), {
default: () => [(_b = props.errors) === null || _b === void 0 ? void 0 : _b.map((error, index2) => createVNode("div", {
"key": index2,
"class": innerStatus.value ? `${baseClassName.value}-${innerStatus.value}` : ""
}, [error]))]
}), [[vShow, !!((_a = props.errors) === null || _a === void 0 ? void 0 : _a.length)]])]
});
};
}
});
const FormItemInput = defineComponent({
compatConfig: {
MODE: 3
},
slots: Object,
inheritAttrs: false,
props: ["prefixCls", "errors", "hasFeedback", "onDomErrorVisibleChange", "wrapperCol", "help", "extra", "status", "marginBottom", "onErrorVisibleChanged"],
setup(props, _ref) {
let {
slots
} = _ref;
const formContext = useInjectForm();
const {
wrapperCol: contextWrapperCol
} = formContext;
const subFormContext = _extends$1({}, formContext);
delete subFormContext.labelCol;
delete subFormContext.wrapperCol;
useProvideForm(subFormContext);
useProvideFormItemPrefix({
prefixCls: computed(() => props.prefixCls),
status: computed(() => props.status)
});
return () => {
var _a, _b, _c;
const {
prefixCls,
wrapperCol,
marginBottom,
onErrorVisibleChanged,
help = (_a = slots.help) === null || _a === void 0 ? void 0 : _a.call(slots),
errors = filterEmpty((_b = slots.errors) === null || _b === void 0 ? void 0 : _b.call(slots)),
// hasFeedback,
// status,
extra = (_c = slots.extra) === null || _c === void 0 ? void 0 : _c.call(slots)
} = props;
const baseClassName = `${prefixCls}-item`;
const mergedWrapperCol = wrapperCol || (contextWrapperCol === null || contextWrapperCol === void 0 ? void 0 : contextWrapperCol.value) || {};
const className = classNames(`${baseClassName}-control`, mergedWrapperCol.class);
return createVNode(Col, _objectSpread2$1(_objectSpread2$1({}, mergedWrapperCol), {}, {
"class": className
}), {
default: () => {
var _a2;
return createVNode(Fragment, null, [createVNode("div", {
"class": `${baseClassName}-control-input`
}, [createVNode("div", {
"class": `${baseClassName}-control-input-content`
}, [(_a2 = slots.default) === null || _a2 === void 0 ? void 0 : _a2.call(slots)])]), marginBottom !== null || errors.length ? createVNode("div", {
"style": {
display: "flex",
flexWrap: "nowrap"
}
}, [createVNode(ErrorList, {
"errors": errors,
"help": help,
"class": `${baseClassName}-explain-connected`,
"onErrorVisibleChanged": onErrorVisibleChanged
}, null), !!marginBottom && createVNode("div", {
"style": {
width: 0,
height: `${marginBottom}px`
}
}, null)]) : null, extra ? createVNode("div", {
"class": `${baseClassName}-extra`
}, [extra]) : null]);
}
});
};
}
});
const FormItemInput$1 = FormItemInput;
const devWarning = (valid, component, message) => {
warningOnce(valid, `[ant-design-vue: ${component}] ${message}`);
};
function createContext(defaultValue) {
const contextKey2 = Symbol("contextKey");
const useProvide = (props, newProps) => {
const mergedProps = reactive({});
provide(contextKey2, mergedProps);
watchEffect(() => {
_extends$1(mergedProps, props, newProps || {});
});
return mergedProps;
};
const useInject = () => {
return inject(contextKey2, defaultValue) || {};
};
return {
useProvide,
useInject
};
}
const ContextKey = Symbol("ContextProps");
const InternalContextKey = Symbol("InternalContextProps");
const useProvideFormItemContext = function(props) {
let useValidation = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : computed(() => true);
const formItemFields = ref(/* @__PURE__ */ new Map());
const addFormItemField = (key, type4) => {
formItemFields.value.set(key, type4);
formItemFields.value = new Map(formItemFields.value);
};
const removeFormItemField = (key) => {
formItemFields.value.delete(key);
formItemFields.value = new Map(formItemFields.value);
};
const instance = getCurrentInstance();
watch([useValidation, formItemFields], () => {
if (process.env.NODE_ENV !== "production") {
if (useValidation.value && formItemFields.value.size > 1) {
devWarning(false, "Form.Item", `FormItem can only collect one field item, you haved set ${[...formItemFields.value.values()].map((v2) => `\`${v2.name}\``).join(", ")} ${formItemFields.value.size} field items.
You can set not need to be collected fields into \`a-form-item-rest\``);
let cur = instance;
while (cur.parent) {
console.warn("at", cur.type);
cur = cur.parent;
}
}
}
});
provide(ContextKey, props);
provide(InternalContextKey, {
addFormItemField,
removeFormItemField
});
};
const defaultContext = {
id: computed(() => void 0),
onFieldBlur: () => {
},
onFieldChange: () => {
},
clearValidate: () => {
}
};
const defaultInternalContext = {
addFormItemField: () => {
},
removeFormItemField: () => {
}
};
const useInjectFormItemContext = () => {
const internalContext = inject(InternalContextKey, defaultInternalContext);
const formItemFieldKey = Symbol("FormItemFieldKey");
const instance = getCurrentInstance();
internalContext.addFormItemField(formItemFieldKey, instance.type);
onBeforeUnmount(() => {
internalContext.removeFormItemField(formItemFieldKey);
});
provide(InternalContextKey, defaultInternalContext);
provide(ContextKey, defaultContext);
return inject(ContextKey, defaultContext);
};
const FormItemRest = defineComponent({
compatConfig: {
MODE: 3
},
name: "AFormItemRest",
setup(_2, _ref) {
let {
slots
} = _ref;
provide(InternalContextKey, defaultInternalContext);
provide(ContextKey, defaultContext);
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
const FormItemInputContext = createContext({});
defineComponent({
name: "NoFormStatus",
setup(_2, _ref2) {
let {
slots
} = _ref2;
FormItemInputContext.useProvide({});
return () => {
var _a;
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
};
}
});
function useDebounce(value) {
const cacheValue = shallowRef(value.value.slice());
let timeout = null;
watchEffect(() => {
clearTimeout(timeout);
timeout = setTimeout(() => {
cacheValue.value = value.value;
}, value.value.length ? 0 : 10);
});
return cacheValue;
}
tuple("success", "warning", "error", "validating", "");
const iconMap = {
success: CheckCircleFilled$1,
warning: ExclamationCircleFilled$1,
error: CloseCircleFilled$1,
validating: LoadingOutlined$1
};
function getPropByPath$1(obj, namePathList, strict) {
let tempObj = obj;
const keyArr = namePathList;
let i2 = 0;
try {
for (let len = keyArr.length; i2 < len - 1; ++i2) {
if (!tempObj && !strict)
break;
const key = keyArr[i2];
if (key in tempObj) {
tempObj = tempObj[key];
} else {
if (strict) {
throw Error("please transfer a valid name path to form item!");
}
break;
}
}
if (strict && !tempObj) {
throw Error("please transfer a valid name path to form item!");
}
} catch (error) {
console.error("please transfer a valid name path to form item!");
}
return {
o: tempObj,
k: keyArr[i2],
v: tempObj ? tempObj[keyArr[i2]] : void 0
};
}
const formItemProps = () => ({
htmlFor: String,
prefixCls: String,
label: PropTypes$1.any,
help: PropTypes$1.any,
extra: PropTypes$1.any,
labelCol: {
type: Object
},
wrapperCol: {
type: Object
},
hasFeedback: {
type: Boolean,
default: false
},
colon: {
type: Boolean,
default: void 0
},
labelAlign: String,
prop: {
type: [String, Number, Array]
},
name: {
type: [String, Number, Array]
},
rules: [Array, Object],
autoLink: {
type: Boolean,
default: true
},
required: {
type: Boolean,
default: void 0
},
validateFirst: {
type: Boolean,
default: void 0
},
validateStatus: PropTypes$1.oneOf(tuple("", "success", "warning", "error", "validating")),
validateTrigger: {
type: [String, Array]
},
messageVariables: {
type: Object
},
hidden: Boolean,
noStyle: Boolean,
tooltip: String
});
let indexGuid = 0;
const defaultItemNamePrefixCls = "form_item";
const FormItem = defineComponent({
compatConfig: {
MODE: 3
},
name: "AFormItem",
inheritAttrs: false,
__ANT_NEW_FORM_ITEM: true,
props: formItemProps(),
slots: Object,
setup(props, _ref) {
let {
slots,
attrs,
expose
} = _ref;
warning$4(props.prop === void 0, `\`prop\` is deprecated. Please use \`name\` instead.`);
const eventKey = `form-item-${++indexGuid}`;
const {
prefixCls
} = useConfigInject("form", props);
const [wrapSSR, hashId] = useStyle(prefixCls);
const itemRef = shallowRef();
const formContext = useInjectForm();
const fieldName = computed(() => props.name || props.prop);
const errors = shallowRef([]);
const validateDisabled = shallowRef(false);
const inputRef = shallowRef();
const namePath = computed(() => {
const val = fieldName.value;
return getNamePath(val);
});
const fieldId = computed(() => {
if (!namePath.value.length) {
return void 0;
} else {
const formName = formContext.name.value;
const mergedId = namePath.value.join("_");
return formName ? `${formName}_${mergedId}` : `${defaultItemNamePrefixCls}_${mergedId}`;
}
});
const getNewFieldValue = () => {
const model = formContext.model.value;
if (!model || !fieldName.value) {
return;
} else {
return getPropByPath$1(model, namePath.value, true).v;
}
};
const fieldValue = computed(() => getNewFieldValue());
const initialValue = shallowRef(cloneDeep(fieldValue.value));
const mergedValidateTrigger = computed(() => {
let validateTrigger = props.validateTrigger !== void 0 ? props.validateTrigger : formContext.validateTrigger.value;
validateTrigger = validateTrigger === void 0 ? "change" : validateTrigger;
return toArray$1(validateTrigger);
});
const rulesRef = computed(() => {
let formRules = formContext.rules.value;
const selfRules = props.rules;
const requiredRule = props.required !== void 0 ? {
required: !!props.required,
trigger: mergedValidateTrigger.value
} : [];
const prop = getPropByPath$1(formRules, namePath.value);
formRules = formRules ? prop.o[prop.k] || prop.v : [];
const rules2 = [].concat(selfRules || formRules || []);
if (find$1(rules2, (rule) => rule.required)) {
return rules2;
} else {
return rules2.concat(requiredRule);
}
});
const isRequired2 = computed(() => {
const rules2 = rulesRef.value;
let isRequired3 = false;
if (rules2 && rules2.length) {
rules2.every((rule) => {
if (rule.required) {
isRequired3 = true;
return false;
}
return true;
});
}
return isRequired3 || props.required;
});
const validateState = shallowRef();
watchEffect(() => {
validateState.value = props.validateStatus;
});
const messageVariables = computed(() => {
let variables = {};
if (typeof props.label === "string") {
variables.label = props.label;
} else if (props.name) {
variables.label = String(props.name);
}
if (props.messageVariables) {
variables = _extends$1(_extends$1({}, variables), props.messageVariables);
}
return variables;
});
const validateRules$1 = (options) => {
if (namePath.value.length === 0) {
return;
}
const {
validateFirst = false
} = props;
const {
triggerName
} = options || {};
let filteredRules = rulesRef.value;
if (triggerName) {
filteredRules = filteredRules.filter((rule) => {
const {
trigger
} = rule;
if (!trigger && !mergedValidateTrigger.value.length) {
return true;
}
const triggerList = toArray$1(trigger || mergedValidateTrigger.value);
return triggerList.includes(triggerName);
});
}
if (!filteredRules.length) {
return Promise.resolve();
}
const promise = validateRules(namePath.value, fieldValue.value, filteredRules, _extends$1({
validateMessages: formContext.validateMessages.value
}, options), validateFirst, messageVariables.value);
validateState.value = "validating";
errors.value = [];
promise.catch((e2) => e2).then(function() {
let results = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
if (validateState.value === "validating") {
const res = results.filter((result) => result && result.errors.length);
validateState.value = res.length ? "error" : "success";
errors.value = res.map((r2) => r2.errors);
formContext.onValidate(fieldName.value, !errors.value.length, errors.value.length ? toRaw(errors.value[0]) : null);
}
});
return promise;
};
const onFieldBlur = () => {
validateRules$1({
triggerName: "blur"
});
};
const onFieldChange = () => {
if (validateDisabled.value) {
validateDisabled.value = false;
return;
}
validateRules$1({
triggerName: "change"
});
};
const clearValidate = () => {
validateState.value = props.validateStatus;
validateDisabled.value = false;
errors.value = [];
};
const resetField = () => {
var _a;
validateState.value = props.validateStatus;
validateDisabled.value = true;
errors.value = [];
const model = formContext.model.value || {};
const value = fieldValue.value;
const prop = getPropByPath$1(model, namePath.value, true);
if (Array.isArray(value)) {
prop.o[prop.k] = [].concat((_a = initialValue.value) !== null && _a !== void 0 ? _a : []);
} else {
prop.o[prop.k] = initialValue.value;
}
nextTick(() => {
validateDisabled.value = false;
});
};
const htmlFor = computed(() => {
return props.htmlFor === void 0 ? fieldId.value : props.htmlFor;
});
const onLabelClick = () => {
const id = htmlFor.value;
if (!id || !inputRef.value) {
return;
}
const control = inputRef.value.$el.querySelector(`[id="${id}"]`);
if (control && control.focus) {
control.focus();
}
};
expose({
onFieldBlur,
onFieldChange,
clearValidate,
resetField
});
useProvideFormItemContext({
id: fieldId,
onFieldBlur: () => {
if (props.autoLink) {
onFieldBlur();
}
},
onFieldChange: () => {
if (props.autoLink) {
onFieldChange();
}
},
clearValidate
}, computed(() => {
return !!(props.autoLink && formContext.model.value && fieldName.value);
}));
let registered = false;
watch(fieldName, (val) => {
if (val) {
if (!registered) {
registered = true;
formContext.addField(eventKey, {
fieldValue,
fieldId,
fieldName,
resetField,
clearValidate,
namePath,
validateRules: validateRules$1,
rules: rulesRef
});
}
} else {
registered = false;
formContext.removeField(eventKey);
}
}, {
immediate: true
});
onBeforeUnmount(() => {
formContext.removeField(eventKey);
});
const debounceErrors = useDebounce(errors);
const mergedValidateStatus = computed(() => {
if (props.validateStatus !== void 0) {
return props.validateStatus;
} else if (debounceErrors.value.length) {
return "error";
}
return validateState.value;
});
const itemClassName = computed(() => ({
[`${prefixCls.value}-item`]: true,
[hashId.value]: true,
// Status
[`${prefixCls.value}-item-has-feedback`]: mergedValidateStatus.value && props.hasFeedback,
[`${prefixCls.value}-item-has-success`]: mergedValidateStatus.value === "success",
[`${prefixCls.value}-item-has-warning`]: mergedValidateStatus.value === "warning",
[`${prefixCls.value}-item-has-error`]: mergedValidateStatus.value === "error",
[`${prefixCls.value}-item-is-validating`]: mergedValidateStatus.value === "validating",
[`${prefixCls.value}-item-hidden`]: props.hidden
}));
const formItemInputContext = reactive({});
FormItemInputContext.useProvide(formItemInputContext);
watchEffect(() => {
let feedbackIcon;
if (props.hasFeedback) {
const IconNode = mergedValidateStatus.value && iconMap[mergedValidateStatus.value];
feedbackIcon = IconNode ? createVNode("span", {
"class": classNames(`${prefixCls.value}-item-feedback-icon`, `${prefixCls.value}-item-feedback-icon-${mergedValidateStatus.value}`)
}, [createVNode(IconNode, null, null)]) : null;
}
_extends$1(formItemInputContext, {
status: mergedValidateStatus.value,
hasFeedback: props.hasFeedback,
feedbackIcon,
isFormItemInput: true
});
});
const marginBottom = shallowRef(null);
const showMarginOffset = shallowRef(false);
const updateMarginBottom = () => {
if (itemRef.value) {
const itemStyle = getComputedStyle(itemRef.value);
marginBottom.value = parseInt(itemStyle.marginBottom, 10);
}
};
onMounted(() => {
watch(showMarginOffset, () => {
if (showMarginOffset.value) {
updateMarginBottom();
}
}, {
flush: "post",
immediate: true
});
});
const onErrorVisibleChanged = (nextVisible) => {
if (!nextVisible) {
marginBottom.value = null;
}
};
return () => {
var _a, _b;
if (props.noStyle)
return (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots);
const help = (_b = props.help) !== null && _b !== void 0 ? _b : slots.help ? filterEmpty(slots.help()) : null;
const withHelp = !!(help !== void 0 && help !== null && Array.isArray(help) && help.length || debounceErrors.value.length);
showMarginOffset.value = withHelp;
return wrapSSR(createVNode("div", {
"class": [itemClassName.value, withHelp ? `${prefixCls.value}-item-with-help` : "", attrs.class],
"ref": itemRef
}, [createVNode(Row, _objectSpread2$1(_objectSpread2$1({}, attrs), {}, {
"class": `${prefixCls.value}-item-row`,
"key": "row"
}), {
default: () => {
var _a2, _b2;
return createVNode(Fragment, null, [createVNode(FormItemLabel$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
"htmlFor": htmlFor.value,
"required": isRequired2.value,
"requiredMark": formContext.requiredMark.value,
"prefixCls": prefixCls.value,
"onClick": onLabelClick,
"label": props.label
}), {
label: slots.label,
tooltip: slots.tooltip
}), createVNode(FormItemInput$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
"errors": help !== void 0 && help !== null ? toArray$1(help) : debounceErrors.value,
"marginBottom": marginBottom.value,
"prefixCls": prefixCls.value,
"status": mergedValidateStatus.value,
"ref": inputRef,
"help": help,
"extra": (_a2 = props.extra) !== null && _a2 !== void 0 ? _a2 : (_b2 = slots.extra) === null || _b2 === void 0 ? void 0 : _b2.call(slots),
"onErrorVisibleChanged": onErrorVisibleChanged
}), {
default: slots.default
})]);
}
}), !!marginBottom.value && createVNode("div", {
"class": `${prefixCls.value}-margin-offset`,
"style": {
marginBottom: `-${marginBottom.value}px`
}
}, null)]));
};
}
});
function allPromiseFinish(promiseList) {
let hasError = false;
let count = promiseList.length;
const results = [];
if (!promiseList.length) {
return Promise.resolve([]);
}
return new Promise((resolve, reject) => {
promiseList.forEach((promise, index2) => {
promise.catch((e2) => {
hasError = true;
return e2;
}).then((result) => {
count -= 1;
results[index2] = result;
if (count > 0) {
return;
}
if (hasError) {
reject(results);
}
resolve(results);
});
});
});
}
function t(t2) {
return "object" == typeof t2 && null != t2 && 1 === t2.nodeType;
}
function e(t2, e2) {
return (!e2 || "hidden" !== t2) && "visible" !== t2 && "clip" !== t2;
}
function n(t2, n2) {
if (t2.clientHeight < t2.scrollHeight || t2.clientWidth < t2.scrollWidth) {
var r2 = getComputedStyle(t2, null);
return e(r2.overflowY, n2) || e(r2.overflowX, n2) || function(t3) {
var e2 = function(t4) {
if (!t4.ownerDocument || !t4.ownerDocument.defaultView)
return null;
try {
return t4.ownerDocument.defaultView.frameElement;
} catch (t5) {
return null;
}
}(t3);
return !!e2 && (e2.clientHeight < t3.scrollHeight || e2.clientWidth < t3.scrollWidth);
}(t2);
}
return false;
}
function r(t2, e2, n2, r2, i2, o2, l2, d2) {
return o2 < t2 && l2 > e2 || o2 > t2 && l2 < e2 ? 0 : o2 <= t2 && d2 <= n2 || l2 >= e2 && d2 >= n2 ? o2 - t2 - r2 : l2 > e2 && d2 < n2 || o2 < t2 && d2 > n2 ? l2 - e2 + i2 : 0;
}
var i = function(e2, i2) {
var o2 = window, l2 = i2.scrollMode, d2 = i2.block, f2 = i2.inline, h2 = i2.boundary, u2 = i2.skipOverflowHiddenElements, s2 = "function" == typeof h2 ? h2 : function(t2) {
return t2 !== h2;
};
if (!t(e2))
throw new TypeError("Invalid target");
for (var a2, c2, g2 = document.scrollingElement || document.documentElement, p = [], m2 = e2; t(m2) && s2(m2); ) {
if ((m2 = null == (c2 = (a2 = m2).parentElement) ? a2.getRootNode().host || null : c2) === g2) {
p.push(m2);
break;
}
null != m2 && m2 === document.body && n(m2) && !n(document.documentElement) || null != m2 && n(m2, u2) && p.push(m2);
}
for (var w2 = o2.visualViewport ? o2.visualViewport.width : innerWidth, v2 = o2.visualViewport ? o2.visualViewport.height : innerHeight, W = window.scrollX || pageXOffset, H = window.scrollY || pageYOffset, b2 = e2.getBoundingClientRect(), y2 = b2.height, E2 = b2.width, M2 = b2.top, V2 = b2.right, x2 = b2.bottom, I2 = b2.left, C = "start" === d2 || "nearest" === d2 ? M2 : "end" === d2 ? x2 : M2 + y2 / 2, R2 = "center" === f2 ? I2 + E2 / 2 : "end" === f2 ? V2 : I2, T2 = [], k2 = 0; k2 < p.length; k2++) {
var B2 = p[k2], D2 = B2.getBoundingClientRect(), O2 = D2.height, X = D2.width, Y2 = D2.top, L2 = D2.right, S2 = D2.bottom, j2 = D2.left;
if ("if-needed" === l2 && M2 >= 0 && I2 >= 0 && x2 <= v2 && V2 <= w2 && M2 >= Y2 && x2 <= S2 && I2 >= j2 && V2 <= L2)
return T2;
var N2 = getComputedStyle(B2), q2 = parseInt(N2.borderLeftWidth, 10), z2 = parseInt(N2.borderTopWidth, 10), A2 = parseInt(N2.borderRightWidth, 10), F2 = parseInt(N2.borderBottomWidth, 10), G = 0, J2 = 0, K = "offsetWidth" in B2 ? B2.offsetWidth - B2.clientWidth - q2 - A2 : 0, P2 = "offsetHeight" in B2 ? B2.offsetHeight - B2.clientHeight - z2 - F2 : 0, Q = "offsetWidth" in B2 ? 0 === B2.offsetWidth ? 0 : X / B2.offsetWidth : 0, U = "offsetHeight" in B2 ? 0 === B2.offsetHeight ? 0 : O2 / B2.offsetHeight : 0;
if (g2 === B2)
G = "start" === d2 ? C : "end" === d2 ? C - v2 : "nearest" === d2 ? r(H, H + v2, v2, z2, F2, H + C, H + C + y2, y2) : C - v2 / 2, J2 = "start" === f2 ? R2 : "center" === f2 ? R2 - w2 / 2 : "end" === f2 ? R2 - w2 : r(W, W + w2, w2, q2, A2, W + R2, W + R2 + E2, E2), G = Math.max(0, G + H), J2 = Math.max(0, J2 + W);
else {
G = "start" === d2 ? C - Y2 - z2 : "end" === d2 ? C - S2 + F2 + P2 : "nearest" === d2 ? r(Y2, S2, O2, z2, F2 + P2, C, C + y2, y2) : C - (Y2 + O2 / 2) + P2 / 2, J2 = "start" === f2 ? R2 - j2 - q2 : "center" === f2 ? R2 - (j2 + X / 2) + K / 2 : "end" === f2 ? R2 - L2 + A2 + K : r(j2, L2, X, q2, A2 + K, R2, R2 + E2, E2);
var Z = B2.scrollLeft, $2 = B2.scrollTop;
C += $2 - (G = Math.max(0, Math.min($2 + G / U, B2.scrollHeight - O2 / U + P2))), R2 += Z - (J2 = Math.max(0, Math.min(Z + J2 / Q, B2.scrollWidth - X / Q + K)));
}
T2.push({ el: B2, top: G, left: J2 });
}
return T2;
};
function isOptionsObject(options) {
return options === Object(options) && Object.keys(options).length !== 0;
}
function defaultBehavior(actions, behavior) {
if (behavior === void 0) {
behavior = "auto";
}
var canSmoothScroll = "scrollBehavior" in document.body.style;
actions.forEach(function(_ref) {
var el = _ref.el, top = _ref.top, left = _ref.left;
if (el.scroll && canSmoothScroll) {
el.scroll({
top,
left,
behavior
});
} else {
el.scrollTop = top;
el.scrollLeft = left;
}
});
}
function getOptions(options) {
if (options === false) {
return {
block: "end",
inline: "nearest"
};
}
if (isOptionsObject(options)) {
return options;
}
return {
block: "start",
inline: "nearest"
};
}
function scrollIntoView(target, options) {
var isTargetAttached = target.isConnected || target.ownerDocument.documentElement.contains(target);
if (isOptionsObject(options) && typeof options.behavior === "function") {
return options.behavior(isTargetAttached ? i(target, options) : []);
}
if (!isTargetAttached) {
return;
}
var computeOptions = getOptions(options);
return defaultBehavior(i(target, computeOptions), computeOptions.behavior);
}
function isRequired(rules2) {
let isRequired2 = false;
if (rules2 && rules2.length) {
rules2.every((rule) => {
if (rule.required) {
isRequired2 = true;
return false;
}
return true;
});
}
return isRequired2;
}
function toArray(value) {
if (value === void 0 || value === null) {
return [];
}
return Array.isArray(value) ? value : [value];
}
function getPropByPath(obj, path, strict) {
let tempObj = obj;
path = path.replace(/\[(\w+)\]/g, ".$1");
path = path.replace(/^\./, "");
const keyArr = path.split(".");
let i2 = 0;
for (let len = keyArr.length; i2 < len - 1; ++i2) {
if (!tempObj && !strict)
break;
const key = keyArr[i2];
if (key in tempObj) {
tempObj = tempObj[key];
} else {
if (strict) {
throw new Error("please transfer a valid name path to validate!");
}
break;
}
}
return {
o: tempObj,
k: keyArr[i2],
v: tempObj ? tempObj[keyArr[i2]] : null,
isValid: tempObj && keyArr[i2] in tempObj
};
}
function useForm$2(modelRef) {
let rulesRef = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ref({});
let options = arguments.length > 2 ? arguments[2] : void 0;
const initialModel = cloneDeep(unref(modelRef));
const validateInfos = reactive({});
const rulesKeys = shallowRef([]);
const resetFields = (newValues) => {
_extends$1(unref(modelRef), _extends$1(_extends$1({}, cloneDeep(initialModel)), newValues));
nextTick(() => {
Object.keys(validateInfos).forEach((key) => {
validateInfos[key] = {
autoLink: false,
required: isRequired(unref(rulesRef)[key])
};
});
});
};
const filterRules = function() {
let rules2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
let trigger = arguments.length > 1 ? arguments[1] : void 0;
if (!trigger.length) {
return rules2;
} else {
return rules2.filter((rule) => {
const triggerList = toArray(rule.trigger || "change");
return intersection$1(triggerList, trigger).length;
});
}
};
let lastValidatePromise = null;
const validateFields = function(names2) {
let option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let strict = arguments.length > 2 ? arguments[2] : void 0;
const promiseList = [];
const values = {};
for (let i2 = 0; i2 < names2.length; i2++) {
const name = names2[i2];
const prop = getPropByPath(unref(modelRef), name, strict);
if (!prop.isValid)
continue;
values[name] = prop.v;
const rules2 = filterRules(unref(rulesRef)[name], toArray(option && option.trigger));
if (rules2.length) {
promiseList.push(validateField(name, prop.v, rules2, option || {}).then(() => ({
name,
errors: [],
warnings: []
})).catch((ruleErrors) => {
const mergedErrors = [];
const mergedWarnings = [];
ruleErrors.forEach((_ref) => {
let {
rule: {
warningOnly
},
errors
} = _ref;
if (warningOnly) {
mergedWarnings.push(...errors);
} else {
mergedErrors.push(...errors);
}
});
if (mergedErrors.length) {
return Promise.reject({
name,
errors: mergedErrors,
warnings: mergedWarnings
});
}
return {
name,
errors: mergedErrors,
warnings: mergedWarnings
};
}));
}
}
const summaryPromise = allPromiseFinish(promiseList);
lastValidatePromise = summaryPromise;
const returnPromise = summaryPromise.then(() => {
if (lastValidatePromise === summaryPromise) {
return Promise.resolve(values);
}
return Promise.reject([]);
}).catch((results) => {
const errorList = results.filter((result) => result && result.errors.length);
return errorList.length ? Promise.reject({
values,
errorFields: errorList,
outOfDate: lastValidatePromise !== summaryPromise
}) : Promise.resolve(values);
});
returnPromise.catch((e2) => e2);
return returnPromise;
};
const validateField = function(name, value, rules2) {
let option = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
const promise = validateRules([name], value, rules2, _extends$1({
validateMessages: defaultValidateMessages
}, option), !!option.validateFirst);
if (!validateInfos[name]) {
return promise.catch((e2) => e2);
}
validateInfos[name].validateStatus = "validating";
promise.catch((e2) => e2).then(function() {
let results = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
var _a;
if (validateInfos[name].validateStatus === "validating") {
const res = results.filter((result) => result && result.errors.length);
validateInfos[name].validateStatus = res.length ? "error" : "success";
validateInfos[name].help = res.length ? res.map((r2) => r2.errors) : null;
(_a = options === null || options === void 0 ? void 0 : options.onValidate) === null || _a === void 0 ? void 0 : _a.call(options, name, !res.length, res.length ? toRaw(validateInfos[name].help[0]) : null);
}
});
return promise;
};
const validate = (names2, option) => {
let keys2 = [];
let strict = true;
if (!names2) {
strict = false;
keys2 = rulesKeys.value;
} else if (Array.isArray(names2)) {
keys2 = names2;
} else {
keys2 = [names2];
}
const promises = validateFields(keys2, option || {}, strict);
promises.catch((e2) => e2);
return promises;
};
const clearValidate = (names2) => {
let keys2 = [];
if (!names2) {
keys2 = rulesKeys.value;
} else if (Array.isArray(names2)) {
keys2 = names2;
} else {
keys2 = [names2];
}
keys2.forEach((key) => {
validateInfos[key] && _extends$1(validateInfos[key], {
validateStatus: "",
help: null
});
});
};
const mergeValidateInfo = (items) => {
const info = {
autoLink: false
};
const help = [];
const infos = Array.isArray(items) ? items : [items];
for (let i2 = 0; i2 < infos.length; i2++) {
const arg = infos[i2];
if ((arg === null || arg === void 0 ? void 0 : arg.validateStatus) === "error") {
info.validateStatus = "error";
arg.help && help.push(arg.help);
}
info.required = info.required || (arg === null || arg === void 0 ? void 0 : arg.required);
}
info.help = help;
return info;
};
let oldModel = initialModel;
let isFirstTime = true;
const modelFn = (model) => {
const names2 = [];
rulesKeys.value.forEach((key) => {
const prop = getPropByPath(model, key, false);
const oldProp = getPropByPath(oldModel, key, false);
const isFirstValidation = isFirstTime && (options === null || options === void 0 ? void 0 : options.immediate) && prop.isValid;
if (isFirstValidation || !isEqual(prop.v, oldProp.v)) {
names2.push(key);
}
});
validate(names2, {
trigger: "change"
});
isFirstTime = false;
oldModel = cloneDeep(toRaw(model));
};
const debounceOptions = options === null || options === void 0 ? void 0 : options.debounce;
let first = true;
watch(rulesRef, () => {
rulesKeys.value = rulesRef ? Object.keys(unref(rulesRef)) : [];
if (!first && options && options.validateOnRuleChange) {
validate();
}
first = false;
}, {
deep: true,
immediate: true
});
watch(rulesKeys, () => {
const newValidateInfos = {};
rulesKeys.value.forEach((key) => {
newValidateInfos[key] = _extends$1({}, validateInfos[key], {
autoLink: false,
required: isRequired(unref(rulesRef)[key])
});
delete validateInfos[key];
});
for (const key in validateInfos) {
if (Object.prototype.hasOwnProperty.call(validateInfos, key)) {
delete validateInfos[key];
}
}
_extends$1(validateInfos, newValidateInfos);
}, {
immediate: true
});
watch(modelRef, debounceOptions && debounceOptions.wait ? debounce(modelFn, debounceOptions.wait, omit$1(debounceOptions, ["wait"])) : modelFn, {
immediate: options && !!options.immediate,
deep: true
});
return {
modelRef,
rulesRef,
initialModel,
validateInfos,
resetFields,
validate,
validateField,
mergeValidateInfo,
clearValidate
};
}
const formProps = () => ({
layout: PropTypes$1.oneOf(tuple("horizontal", "inline", "vertical")),
labelCol: objectType(),
wrapperCol: objectType(),
colon: booleanType(),
labelAlign: stringType(),
labelWrap: booleanType(),
prefixCls: String,
requiredMark: someType([String, Boolean]),
/** @deprecated Will warning in future branch. Pls use `requiredMark` instead. */
hideRequiredMark: booleanType(),
model: PropTypes$1.object,
rules: objectType(),
validateMessages: objectType(),
validateOnRuleChange: booleanType(),
// 提交失败自动滚动到第一个错误字段
scrollToFirstError: anyType(),
onSubmit: functionType(),
name: String,
validateTrigger: someType([String, Array]),
size: stringType(),
disabled: booleanType(),
onValuesChange: functionType(),
onFieldsChange: functionType(),
onFinish: functionType(),
onFinishFailed: functionType(),
onValidate: functionType()
});
function isEqualName(name1, name2) {
return isEqual(toArray$1(name1), toArray$1(name2));
}
const Form = defineComponent({
compatConfig: {
MODE: 3
},
name: "AForm",
inheritAttrs: false,
props: initDefaultProps$1(formProps(), {
layout: "horizontal",
hideRequiredMark: false,
colon: true
}),
Item: FormItem,
useForm: useForm$2,
// emits: ['finishFailed', 'submit', 'finish', 'validate'],
setup(props, _ref) {
let {
emit,
slots,
expose,
attrs
} = _ref;
const {
prefixCls,
direction,
form: contextForm,
size,
disabled
} = useConfigInject("form", props);
const requiredMark = computed(() => props.requiredMark === "" || props.requiredMark);
const mergedRequiredMark = computed(() => {
var _a;
if (requiredMark.value !== void 0) {
return requiredMark.value;
}
if (contextForm && ((_a = contextForm.value) === null || _a === void 0 ? void 0 : _a.requiredMark) !== void 0) {
return contextForm.value.requiredMark;
}
if (props.hideRequiredMark) {
return false;
}
return true;
});
useProviderSize(size);
useProviderDisabled(disabled);
const mergedColon = computed(() => {
var _a, _b;
return (_a = props.colon) !== null && _a !== void 0 ? _a : (_b = contextForm.value) === null || _b === void 0 ? void 0 : _b.colon;
});
const {
validateMessages: globalValidateMessages
} = useInjectGlobalForm();
const validateMessages = computed(() => {
return _extends$1(_extends$1(_extends$1({}, defaultValidateMessages), globalValidateMessages.value), props.validateMessages);
});
const [wrapSSR, hashId] = useStyle(prefixCls);
const formClassName = computed(() => classNames(prefixCls.value, {
[`${prefixCls.value}-${props.layout}`]: true,
[`${prefixCls.value}-hide-required-mark`]: mergedRequiredMark.value === false,
[`${prefixCls.value}-rtl`]: direction.value === "rtl",
[`${prefixCls.value}-${size.value}`]: size.value
}, hashId.value));
const lastValidatePromise = ref();
const fields = {};
const addField = (eventKey, field) => {
fields[eventKey] = field;
};
const removeField = (eventKey) => {
delete fields[eventKey];
};
const getFieldsByNameList = (nameList) => {
const provideNameList = !!nameList;
const namePathList = provideNameList ? toArray$1(nameList).map(getNamePath) : [];
if (!provideNameList) {
return Object.values(fields);
} else {
return Object.values(fields).filter((field) => namePathList.findIndex((namePath) => isEqualName(namePath, field.fieldName.value)) > -1);
}
};
const resetFields = (name) => {
if (!props.model) {
warning$3(false, "Form", "model is required for resetFields to work.");
return;
}
getFieldsByNameList(name).forEach((field) => {
field.resetField();
});
};
const clearValidate = (name) => {
getFieldsByNameList(name).forEach((field) => {
field.clearValidate();
});
};
const handleFinishFailed = (errorInfo) => {
const {
scrollToFirstError
} = props;
emit("finishFailed", errorInfo);
if (scrollToFirstError && errorInfo.errorFields.length) {
let scrollToFieldOptions = {};
if (typeof scrollToFirstError === "object") {
scrollToFieldOptions = scrollToFirstError;
}
scrollToField(errorInfo.errorFields[0].name, scrollToFieldOptions);
}
};
const validate = function() {
return validateField(...arguments);
};
const scrollToField = function(name) {
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
const fields2 = getFieldsByNameList(name ? [name] : void 0);
if (fields2.length) {
const fieldId = fields2[0].fieldId.value;
const node2 = fieldId ? document.getElementById(fieldId) : null;
if (node2) {
scrollIntoView(node2, _extends$1({
scrollMode: "if-needed",
block: "nearest"
}, options));
}
}
};
const getFieldsValue = function() {
let nameList = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
if (nameList === true) {
const allNameList = [];
Object.values(fields).forEach((_ref2) => {
let {
namePath
} = _ref2;
allNameList.push(namePath.value);
});
return cloneByNamePathList(props.model, allNameList);
} else {
return cloneByNamePathList(props.model, nameList);
}
};
const validateFields = (nameList, options) => {
warning$3(!(nameList instanceof Function), "Form", "validateFields/validateField/validate not support callback, please use promise instead");
if (!props.model) {
warning$3(false, "Form", "model is required for validateFields to work.");
return Promise.reject("Form `model` is required for validateFields to work.");
}
const provideNameList = !!nameList;
const namePathList = provideNameList ? toArray$1(nameList).map(getNamePath) : [];
const promiseList = [];
Object.values(fields).forEach((field) => {
var _a;
if (!provideNameList) {
namePathList.push(field.namePath.value);
}
if (!((_a = field.rules) === null || _a === void 0 ? void 0 : _a.value.length)) {
return;
}
const fieldNamePath = field.namePath.value;
if (!provideNameList || containsNamePath(namePathList, fieldNamePath)) {
const promise = field.validateRules(_extends$1({
validateMessages: validateMessages.value
}, options));
promiseList.push(promise.then(() => ({
name: fieldNamePath,
errors: [],
warnings: []
})).catch((ruleErrors) => {
const mergedErrors = [];
const mergedWarnings = [];
ruleErrors.forEach((_ref3) => {
let {
rule: {
warningOnly
},
errors
} = _ref3;
if (warningOnly) {
mergedWarnings.push(...errors);
} else {
mergedErrors.push(...errors);
}
});
if (mergedErrors.length) {
return Promise.reject({
name: fieldNamePath,
errors: mergedErrors,
warnings: mergedWarnings
});
}
return {
name: fieldNamePath,
errors: mergedErrors,
warnings: mergedWarnings
};
}));
}
});
const summaryPromise = allPromiseFinish(promiseList);
lastValidatePromise.value = summaryPromise;
const returnPromise = summaryPromise.then(() => {
if (lastValidatePromise.value === summaryPromise) {
return Promise.resolve(getFieldsValue(namePathList));
}
return Promise.reject([]);
}).catch((results) => {
const errorList = results.filter((result) => result && result.errors.length);
return Promise.reject({
values: getFieldsValue(namePathList),
errorFields: errorList,
outOfDate: lastValidatePromise.value !== summaryPromise
});
});
returnPromise.catch((e2) => e2);
return returnPromise;
};
const validateField = function() {
return validateFields(...arguments);
};
const handleSubmit = (e2) => {
e2.preventDefault();
e2.stopPropagation();
emit("submit", e2);
if (props.model) {
const res = validateFields();
res.then((values) => {
emit("finish", values);
}).catch((errors) => {
handleFinishFailed(errors);
});
}
};
expose({
resetFields,
clearValidate,
validateFields,
getFieldsValue,
validate,
scrollToField
});
useProvideForm({
model: computed(() => props.model),
name: computed(() => props.name),
labelAlign: computed(() => props.labelAlign),
labelCol: computed(() => props.labelCol),
labelWrap: computed(() => props.labelWrap),
wrapperCol: computed(() => props.wrapperCol),
vertical: computed(() => props.layout === "vertical"),
colon: mergedColon,
requiredMark: mergedRequiredMark,
validateTrigger: computed(() => props.validateTrigger),
rules: computed(() => props.rules),
addField,
removeField,
onValidate: (name, status, errors) => {
emit("validate", name, status, errors);
},
validateMessages
});
watch(() => props.rules, () => {
if (props.validateOnRuleChange) {
validateFields();
}
});
return () => {
var _a;
return wrapSSR(createVNode("form", _objectSpread2$1(_objectSpread2$1({}, attrs), {}, {
"onSubmit": handleSubmit,
"class": [formClassName.value, attrs.class]
}), [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]));
};
}
});
const Form$1 = Form;
Form$1.useInjectFormItemContext = useInjectFormItemContext;
Form$1.ItemRest = FormItemRest;
Form$1.install = function(app) {
app.component(Form$1.name, Form$1);
app.component(Form$1.Item.name, Form$1.Item);
app.component(FormItemRest.name, FormItemRest);
return app;
};
const FORM_ITEM_SLOT_KEYS = ["label", "extra", "help", "tooltip"];
const COMPONENT_MAP = /* @__PURE__ */ new Map([
["input", Input],
["textarea", Textarea],
["input-search", InputSearch],
["input-password", InputPassword],
["input-number", InputNumber],
["select", Select],
["cascader", Cascader],
["date-picker", DatePicker$1],
["range-picker", RangePicker],
["time-picker", TimePicker$1],
["checkbox-group", CheckboxGroup],
["radio-group", RadioGroup],
["switch", Switch],
["slider", Slider],
["tree-select", TreeSelect],
["transfer", Transfer]
]);
const FORM_DATA = Symbol("formData");
const UPDATE_FORM_DATA = Symbol("updateFormData");
const UPDATE_ACTIVE_PATH = Symbol("setActivePath");
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
...{
name: "BaseFormItem"
},
__name: "index",
props: {
grid: { type: [Boolean, Object], default: void 0 },
fields: {},
path: { default: void 0 },
disabled: { type: Boolean, default: void 0 }
},
setup(__props) {
const formItemPropKeys = Object.keys(formItemProps());
const gridItemPropKeys = Object.keys(colProps());
memoize.Cache = WeakMap;
const customItemPropsKeys = [
"style",
"className",
"hidden",
"container",
"hideFeedback"
];
const props = __props;
useProviderDisabled(computed(() => props.disabled));
const getPath = (field) => {
const path = (field == null ? void 0 : field.name) ?? [props.path, field == null ? void 0 : field.key].filter(Boolean);
return toPath(path).join(".");
};
const formItemRefs = ref();
const setFormItemRef = (el, field) => {
var _a;
if (!el)
return;
if (((_a = field.getFormItemRef) == null ? void 0 : _a.call(field)) === el)
return;
Object.assign(field, { getFormItemRef: () => el });
};
const setComponentRef = (el, field) => {
var _a;
if (!el)
return;
if (((_a = field.getComponentRef) == null ? void 0 : _a.call(field)) === el)
return;
Object.assign(field, { getComponentRef: () => el });
};
const proFormPropKeys = computed(() => {
return [
...formItemPropKeys,
...customItemPropsKeys,
...props.grid ? gridItemPropKeys : []
];
});
const withDefault = (field) => {
const baseFormItemProps = pickBy(
field,
(v2, k2) => formItemPropKeys.includes(k2) || k2.startsWith("data-form-item")
);
const defaultProps = {
validateFirst: true
};
return {
...defaultProps,
...baseFormItemProps
};
};
const omitFormItemProps = memoize((field) => {
return omitBy(
field,
(v2, k2) => proFormPropKeys.value.includes(k2) || k2.startsWith("data-form-item")
);
});
const withDefaultGrid = computed(() => {
if (props.grid) {
const defaultGrid = { gutter: 24 };
return props.grid === true ? defaultGrid : { ...defaultGrid, ...props.grid };
}
return props.grid;
});
const withDefaultGridItem = memoize((field) => {
const fieldGridItemProps = pick$1(field, gridItemPropKeys);
return {
span: field.fields ? 24 : 8,
...fieldGridItemProps
};
});
return (_ctx, _cache) => {
const _component_BaseFormItem = resolveComponent("BaseFormItem");
return openBlock(), createBlock(unref(_sfc_main$2), mergeProps({
component: _ctx.grid ? unref(Row$1) : void 0
}, withDefaultGrid.value), {
default: withCtx(() => {
var _a;
return [
(openBlock(true), createElementBlock(Fragment, null, renderList((_a = _ctx.fields) == null ? void 0 : _a.filter((i2) => i2 && !i2.hidden), (field, index2) => {
return openBlock(), createBlock(unref(_sfc_main$2), mergeProps({
key: getPath(field) || index2,
component: _ctx.grid ? unref(Col$1) : void 0,
ref_for: true
}, unref(withDefaultGridItem)(field)), {
default: withCtx(() => [
createVNode(unref(_sfc_main$2), {
component: field.container,
path: getPath(field)
}, {
default: withCtx(() => [
createVNode(unref(FormItem$1), mergeProps({ ref_for: true }, withDefault(field), {
ref_for: true,
ref_key: "formItemRefs",
ref: formItemRefs,
class: field.className,
style: field.style,
"hide-feedback": field.hideFeedback,
name: unref(toPath)(getPath(field)),
path: getPath(field),
onVnodeMounted: () => {
var _a2;
return setFormItemRef((_a2 = formItemRefs.value) == null ? void 0 : _a2[index2], field);
}
}), createSlots({
default: withCtx(() => [
field.fields ? (openBlock(), createBlock(_component_BaseFormItem, {
key: 0,
grid: field.grid ?? _ctx.grid,
fields: field.fields,
path: getPath(field),
disabled: field.disabled
}, null, 8, ["grid", "fields", "path", "disabled"])) : !field.component ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(' missing "component" prop ')
], 64)) : (openBlock(), createBlock(unref(BaseField), mergeProps({
key: 2,
ref_for: true
}, unref(omitFormItemProps)(field), {
path: getPath(field),
onSetComponentRef: (el) => setComponentRef(el, field),
onFieldChange: () => {
var _a2, _b, _c;
return (_c = (_b = (_a2 = formItemRefs.value) == null ? void 0 : _a2[index2]) == null ? void 0 : _b.onFieldChange) == null ? void 0 : _c.call(_b);
},
onFieldBlur: () => {
var _a2, _b, _c;
return (_c = (_b = (_a2 = formItemRefs.value) == null ? void 0 : _a2[index2]) == null ? void 0 : _b.onFieldBlur) == null ? void 0 : _c.call(_b);
}
}), null, 16, ["path", "onSetComponentRef", "onFieldChange", "onFieldBlur"]))
]),
_: 2
}, [
renderList(field.slots, (slot, name) => {
return {
name,
fn: withCtx((scoped) => [
unref(FORM_ITEM_SLOT_KEYS).includes(name) ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
key: 0,
path: getPath(field),
component: slot,
ref_for: true
}, scoped), null, 16, ["path", "component"])) : createCommentVNode("", true)
])
};
})
]), 1040, ["class", "style", "hide-feedback", "name", "path", "onVnodeMounted"])
]),
_: 2
}, 1032, ["component", "path"])
]),
_: 2
}, 1040, ["component"]);
}), 128))
];
}),
_: 1
}, 16, ["component"]);
};
}
});
const index_vue_vue_type_style_index_0_lang = "";
const useFields = (initFields) => {
const fields = ref(initFields);
const updateField = (path, updater, options, fieldList = fields.value, parentPath = "", parentFieldPath = "", parsedPath = typeof path === "function" ? "" : toPath(path).join(".")) => {
if (!path)
return false;
const { all = false } = options || {};
for (let i2 = 0; i2 < fieldList.length; i2 += 1) {
const field = fieldList[i2];
const fieldPath = `${parentFieldPath}[${i2}]`;
let found = false;
let selfPath = "";
if (typeof path === "function") {
found = path(shallowReadonly(field));
} else {
const { name, key = "" } = field;
const concatPath = name ?? `${parentPath}${parentPath && key ? "." : ""}${key}`;
selfPath = toPath(concatPath).join(".");
found = !!selfPath && selfPath === parsedPath;
}
if (found) {
updater({ field, fieldIndex: i2, parentFields: fieldList, fieldPath });
if (!all)
return true;
}
if (parsedPath.includes(".") && !parsedPath.startsWith(selfPath)) {
if (!all)
continue;
}
if (field.fields && updateField(path, updater, options, field.fields, selfPath, `${fieldPath}.fields`, parsedPath)) {
if (!all)
return true;
}
}
return false;
};
const getField = (path) => {
if (!path)
return void 0;
let res;
updateField(path, ({ field }) => {
res = field;
});
return res;
};
const setField = (path, field, options) => {
if (!path || !field)
return;
const { updateType = "merge", ...rest } = options || {};
updateField(
path,
({ field: preField, fieldIndex, parentFields }) => {
let value = field;
if (typeof field === "function") {
value = field(preField);
}
if (!value)
return;
const newField = updateType === "rewrite" ? value : { ...preField, ...value };
parentFields[fieldIndex] = newField;
},
rest
);
};
const deleteField = (path, options) => {
if (!path)
return;
updateField(
path,
({ fieldIndex, parentFields }) => {
parentFields.splice(fieldIndex, 1);
},
options
);
};
const addField = (path, field, placement) => {
if (!field)
return;
if (path) {
updateField(path, ({ fieldIndex, parentFields }) => {
const index2 = placement === "after" ? fieldIndex + 1 : fieldIndex;
parentFields.splice(index2, 0, field);
});
} else if (placement === "after") {
fields.value.push(field);
} else {
fields.value.unshift(field);
}
};
const appendField = (path, field) => {
addField(path, field, "after");
};
const prependField = (path, field) => {
addField(path, field, "before");
};
const getFieldPath = (path) => {
if (!path)
return void 0;
let res;
updateField(path, ({ fieldPath }) => {
res = fieldPath;
});
return res;
};
const getParentFields = (path) => {
if (!path)
return void 0;
let res;
updateField(path, ({ parentFields }) => {
res = parentFields;
});
return res;
};
return {
fields,
getField,
setField,
deleteField,
appendField,
prependField,
getFieldPath,
getParentFields
};
};
const useFields$1 = useFields;
const useFormData = (initFormData) => {
const formData = ref(initFormData);
const activePath = ref();
const setActivePath = (path) => {
activePath.value = path;
};
const getFormData = (path) => {
if (!path)
return void 0;
return get$1(formData.value, path);
};
const setFormData = (...args) => {
let path;
let value;
if (args.length === 2) {
[path, value] = args;
} else {
[value] = args;
}
if (path) {
if (typeof value === "function") {
const preValue = getFormData(path);
value = value(preValue);
}
set$1(formData.value, path, value);
} else {
if (typeof value === "function") {
const preValue = formData.value;
value = value(preValue);
}
formData.value = value;
}
};
return { formData, getFormData, setFormData, activePath, setActivePath };
};
const useFormData$1 = useFormData;
const useFormRef = () => {
const formRef = ref();
const setFormRef = (val) => {
formRef.value = val;
};
return { formRef, setFormRef };
};
const useFormRef$1 = useFormRef;
const useForm = (initFormData = {}, initFields = []) => {
return {
...useFormData$1(initFormData),
...useFields$1(initFields),
...useFormRef$1()
};
};
const useForm$1 = useForm;
const useInitProps = () => {
const initPropsMap = /* @__PURE__ */ new Map();
INIT_PROPS_MAP.forEach((val, key) => {
const injectProps = useInjectProps(key);
initPropsMap.set(key, injectProps);
});
const getInitProps = (field) => {
const { component, type: type4 = "" } = field;
if (COMPONENT_MAP.has(component)) {
const k2 = [component, type4].filter(Boolean).join(".");
return initPropsMap.get(INJECT_KEYS[k2]) || {};
}
return {};
};
return { getInitProps };
};
const useInitProps$1 = useInitProps;
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
...{
name: "BaseField"
},
__name: "index",
props: {
component: { default: () => h$1("div", 'Missing required prop: "component"') },
path: { default: "" }
},
emits: ["setComponentRef", "fieldChange", "fieldBlur"],
setup(__props, { emit: __emit }) {
const props = __props;
const emit = __emit;
const formData = inject(FORM_DATA);
const updateFormData = inject(UPDATE_FORM_DATA);
const updateActivePath = inject(UPDATE_ACTIVE_PATH);
const { getInitProps } = useInitProps$1();
const componentRef = ref();
const componentMounted = () => {
emit("setComponentRef", componentRef.value);
};
const triggerFormItemChange = () => {
if (typeof props.component === "string" && COMPONENT_MAP.has(props.component))
return;
emit("fieldChange");
};
const value = computed({
get() {
return get$1(formData == null ? void 0 : formData.value, props.path);
},
set(val) {
const { valueFormatter } = mergedAttrs.value;
if (valueFormatter && typeof valueFormatter === "function") {
updateFormData == null ? void 0 : updateFormData(props.path, valueFormatter(val));
return;
}
updateFormData == null ? void 0 : updateFormData(props.path, val);
triggerFormItemChange();
}
});
const attrs = useAttrs();
const componentType = computed(
() => typeof props.component === "function" || isVNode(props.component) ? void 0 : props.component
);
const modelName = computed(() => {
if (componentType.value === "switch") {
return "checked";
}
return "value";
});
const parentDisabled = useInjectDisabled();
const mergedAttrs = computed(() => {
const compType = componentType.value;
const initProps = getInitProps({
component: compType,
type: attrs.type
});
return {
...initProps,
...attrs,
onFocus: void 0,
disabled: attrs.disabled ?? parentDisabled.value ?? initProps.disabled,
slots: void 0
};
});
const is = computed(() => {
return COMPONENT_MAP.get(props.component) ?? props.component;
});
function handleFocus(...args) {
var _a;
updateActivePath == null ? void 0 : updateActivePath(props.path);
(_a = attrs.onFocus) == null ? void 0 : _a.call(attrs, ...args);
}
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(_sfc_main$2), {
component: mergedAttrs.value.componentContainer,
path: _ctx.path
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(is.value), mergeProps(unref(omit$1)(mergedAttrs.value, "componentContainer"), {
ref_key: "componentRef",
ref: componentRef,
[modelName.value]: value.value,
["onUpdate:" + modelName.value]: _cache[0] || (_cache[0] = ($event) => value.value = $event),
class: [unref(attrs).componentClassName, "field-component"],
style: unref(attrs).componentStyle,
path: _ctx.path,
onVnodeMounted: componentMounted,
onFocus: handleFocus
}), createSlots({ _: 2 }, [
renderList(unref(attrs).slots, (slot, name) => {
return {
name,
fn: withCtx((scoped) => [
!unref(FORM_ITEM_SLOT_KEYS).includes(name) ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({
key: 0,
path: _ctx.path
}, scoped, { component: slot }), null, 16, ["path", "component"])) : createCommentVNode("", true)
])
};
})
]), 1040, ["class", "style", "path"]))
]),
_: 1
}, 8, ["component", "path"]);
};
}
});
const index_vue_vue_type_style_index_0_scoped_37574a50_lang = "";
const _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const BaseField = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-37574a50"]]);
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
...{
name: "ContainerFragment",
inheritAttrs: false
},
__name: "index",
props: {
component: {}
},
setup(__props) {
return (_ctx, _cache) => {
return _ctx.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.component), normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16)) : renderSlot(_ctx.$slots, "default", { key: 1 });
};
}
});
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
...{
name: "SlotComponent",
inheritAttrs: false
},
__name: "index",
props: {
component: {}
},
setup(__props) {
return (_ctx, _cache) => {
return isVNode(_ctx.component) || typeof _ctx.component === "function" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.component), normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString(_ctx.component), 1)
], 64));
};
}
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...{
name: "BaseForm"
},
__name: "index",
props: {
grid: { type: [Boolean, Object], default: false },
form: { default: () => ({}) }
},
setup(__props, { expose: __expose }) {
const props = __props;
const {
setActivePath: updateActivePath,
setFormData,
formData = {},
fields = [],
setFormRef,
formRef
} = props.form;
const injectProps = useInjectProps(INJECT_KEYS["pro-form"]);
const injectAttrs = omit$1(injectProps, Object.keys(props));
const updateFormData = (path, value) => {
setFormData == null ? void 0 : setFormData(path, value);
updateActivePath == null ? void 0 : updateActivePath(path);
};
const exposed = shallowReactive({});
const formInstanceRef = ref(null);
onMounted(() => {
Object.assign(exposed, formInstanceRef.value);
if (setFormRef && !(formRef == null ? void 0 : formRef.value)) {
setFormRef(exposed);
}
});
provide(FORM_DATA, formData);
provide(UPDATE_FORM_DATA, updateFormData);
provide(UPDATE_ACTIVE_PATH, updateActivePath);
__expose(exposed);
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(Form$2), mergeProps({
ref_key: "formInstanceRef",
ref: formInstanceRef,
model: unref(formData)
}, { ...unref(injectAttrs), ..._ctx.$attrs }), {
default: withCtx(() => [
createVNode(unref(_sfc_main$4), {
fields: unref(fields),
grid: _ctx.grid,
disabled: _ctx.$attrs.disabled
}, null, 8, ["fields", "grid", "disabled"]),
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["model"]);
};
}
});
export {
AntdIcon as A,
BaseField as B,
COMPONENT_MAP as C,
FORM_ITEM_SLOT_KEYS as F,
UPDATE_FORM_DATA as U,
_sfc_main as _,
_export_sfc as a,
_sfc_main$2 as b,
cloneDeep as c,
_sfc_main$4 as d,
_sfc_main$1 as e,
FORM_DATA as f,
get$1 as g,
UPDATE_ACTIVE_PATH as h,
useFields$1 as i,
useFormData$1 as j,
useInitProps$1 as k,
omit$1 as o,
useForm$1 as u
};