import {
__assign,
__rest,
__spreadArray,
require_prop_types,
require_react_is
} from "./chunk-Z5OXUWRS.js";
import {
require_react_dom
} from "./chunk-FO7RYXPS.js";
import {
require_jsx_runtime
} from "./chunk-QXMNAICV.js";
import {
require_react
} from "./chunk-QBXGYTN6.js";
import {
__commonJS,
__esm,
__export,
__toCommonJS,
__toESM
} from "./chunk-4B2QHNJT.js";
// ../../node_modules/lodash.mergewith/index.js
var require_lodash = __commonJS({
"../../node_modules/lodash.mergewith/index.js"(exports, module) {
var LARGE_ARRAY_SIZE = 200;
var HASH_UNDEFINED = "__lodash_hash_undefined__";
var HOT_COUNT = 800;
var HOT_SPAN = 16;
var MAX_SAFE_INTEGER = 9007199254740991;
var argsTag = "[object Arguments]";
var arrayTag = "[object Array]";
var asyncTag = "[object AsyncFunction]";
var boolTag = "[object Boolean]";
var dateTag = "[object Date]";
var errorTag = "[object Error]";
var funcTag = "[object Function]";
var genTag = "[object GeneratorFunction]";
var mapTag = "[object Map]";
var numberTag = "[object Number]";
var nullTag = "[object Null]";
var objectTag = "[object Object]";
var proxyTag = "[object Proxy]";
var regexpTag = "[object RegExp]";
var setTag = "[object Set]";
var stringTag = "[object String]";
var undefinedTag = "[object Undefined]";
var weakMapTag = "[object WeakMap]";
var arrayBufferTag = "[object ArrayBuffer]";
var dataViewTag = "[object DataView]";
var float32Tag = "[object Float32Array]";
var float64Tag = "[object Float64Array]";
var int8Tag = "[object Int8Array]";
var int16Tag = "[object Int16Array]";
var int32Tag = "[object Int32Array]";
var uint8Tag = "[object Uint8Array]";
var uint8ClampedTag = "[object Uint8ClampedArray]";
var uint16Tag = "[object Uint16Array]";
var uint32Tag = "[object Uint32Array]";
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
var reIsHostCtor = /^\[object .+?Constructor\]$/;
var reIsUint = /^(?:0|[1-9]\d*)$/;
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function("return this")();
var 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 freeProcess = moduleExports && freeGlobal.process;
var nodeUtil = function() {
try {
var types2 = freeModule && freeModule.require && freeModule.require("util").types;
if (types2) {
return types2;
}
return freeProcess && freeProcess.binding && freeProcess.binding("util");
} catch (e) {
}
}();
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
function apply(func2, thisArg, args) {
switch (args.length) {
case 0:
return func2.call(thisArg);
case 1:
return func2.call(thisArg, args[0]);
case 2:
return func2.call(thisArg, args[0], args[1]);
case 3:
return func2.call(thisArg, args[0], args[1], args[2]);
}
return func2.apply(thisArg, args);
}
function baseTimes(n, iteratee) {
var index2 = -1, result = Array(n);
while (++index2 < n) {
result[index2] = iteratee(index2);
}
return result;
}
function baseUnary(func2) {
return function(value) {
return func2(value);
};
}
function getValue2(object2, key) {
return object2 == null ? void 0 : object2[key];
}
function overArg(func2, transform3) {
return function(arg) {
return func2(transform3(arg));
};
}
var arrayProto = Array.prototype;
var funcProto = Function.prototype;
var objectProto = Object.prototype;
var coreJsData = root["__core-js_shared__"];
var funcToString = funcProto.toString;
var hasOwnProperty = objectProto.hasOwnProperty;
var maskSrcKey = function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
return uid ? "Symbol(src)_1." + uid : "";
}();
var nativeObjectToString = objectProto.toString;
var objectCtorString = funcToString.call(Object);
var reIsNative = RegExp(
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
var Buffer = moduleExports ? root.Buffer : void 0;
var Symbol2 = root.Symbol;
var Uint8Array = root.Uint8Array;
var allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
var getPrototype = overArg(Object.getPrototypeOf, Object);
var objectCreate = Object.create;
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
var splice = arrayProto.splice;
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
var defineProperty = function() {
try {
var func2 = getNative(Object, "defineProperty");
func2({}, "", {});
return func2;
} catch (e) {
}
}();
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
var nativeMax = Math.max;
var nativeNow = Date.now;
var Map2 = getNative(root, "Map");
var nativeCreate = getNative(Object, "create");
var baseCreate = /* @__PURE__ */ function() {
function object2() {
}
return function(proto) {
if (!isObject2(proto)) {
return {};
}
if (objectCreate) {
return objectCreate(proto);
}
object2.prototype = proto;
var result = new object2();
object2.prototype = void 0;
return result;
};
}();
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]);
}
}
function hashClear() {
this.__data__ = nativeCreate ? nativeCreate(null) : {};
this.size = 0;
}
function hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? void 0 : result;
}
return hasOwnProperty.call(data, key) ? data[key] : void 0;
}
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
}
function hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
return this;
}
Hash.prototype.clear = hashClear;
Hash.prototype["delete"] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;
function ListCache(entries) {
var index2 = -1, length2 = entries == null ? 0 : entries.length;
this.clear();
while (++index2 < length2) {
var entry = entries[index2];
this.set(entry[0], entry[1]);
}
}
function listCacheClear() {
this.__data__ = [];
this.size = 0;
}
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;
}
ListCache.prototype.clear = listCacheClear;
ListCache.prototype["delete"] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
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]);
}
}
function mapCacheClear() {
this.size = 0;
this.__data__ = {
"hash": new Hash(),
"map": new (Map2 || ListCache)(),
"string": new Hash()
};
}
function mapCacheDelete(key) {
var result = getMapData(this, key)["delete"](key);
this.size -= result ? 1 : 0;
return result;
}
function mapCacheGet(key) {
return getMapData(this, key).get(key);
}
function mapCacheHas(key) {
return getMapData(this, key).has(key);
}
function mapCacheSet(key, value) {
var data = getMapData(this, key), size2 = data.size;
data.set(key, value);
this.size += data.size == size2 ? 0 : 1;
return this;
}
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype["delete"] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
function Stack2(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
function stackClear() {
this.__data__ = new ListCache();
this.size = 0;
}
function stackDelete(key) {
var data = this.__data__, result = data["delete"](key);
this.size = data.size;
return result;
}
function stackGet(key) {
return this.__data__.get(key);
}
function stackHas(key) {
return this.__data__.has(key);
}
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
Stack2.prototype.clear = stackClear;
Stack2.prototype["delete"] = stackDelete;
Stack2.prototype.get = stackGet;
Stack2.prototype.has = stackHas;
Stack2.prototype.set = stackSet;
function arrayLikeKeys(value, inherited) {
var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.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 assignMergeValue(object2, key, value) {
if (value !== void 0 && !eq(object2[key], value) || value === void 0 && !(key in object2)) {
baseAssignValue(object2, key, value);
}
}
function assignValue(object2, key, value) {
var objValue = object2[key];
if (!(hasOwnProperty.call(object2, key) && eq(objValue, value)) || value === void 0 && !(key in object2)) {
baseAssignValue(object2, key, value);
}
}
function assocIndexOf(array, key) {
var length2 = array.length;
while (length2--) {
if (eq(array[length2][0], key)) {
return length2;
}
}
return -1;
}
function baseAssignValue(object2, key, value) {
if (key == "__proto__" && defineProperty) {
defineProperty(object2, key, {
"configurable": true,
"enumerable": true,
"value": value,
"writable": true
});
} else {
object2[key] = value;
}
}
var baseFor = createBaseFor();
function baseGetTag(value) {
if (value == null) {
return value === void 0 ? undefinedTag : nullTag;
}
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
}
function baseIsArguments(value) {
return isObjectLike(value) && baseGetTag(value) == argsTag;
}
function baseIsNative(value) {
if (!isObject2(value) || isMasked(value)) {
return false;
}
var pattern = isFunction5(value) ? reIsNative : reIsHostCtor;
return pattern.test(toSource(value));
}
function baseIsTypedArray(value) {
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}
function baseKeysIn(object2) {
if (!isObject2(object2)) {
return nativeKeysIn(object2);
}
var isProto = isPrototype(object2), result = [];
for (var key in object2) {
if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object2, key)))) {
result.push(key);
}
}
return result;
}
function baseMerge(object2, source, srcIndex, customizer, stack) {
if (object2 === source) {
return;
}
baseFor(source, function(srcValue, key) {
stack || (stack = new Stack2());
if (isObject2(srcValue)) {
baseMergeDeep(object2, source, key, srcIndex, baseMerge, customizer, stack);
} else {
var newValue = customizer ? customizer(safeGet(object2, key), srcValue, key + "", object2, source, stack) : void 0;
if (newValue === void 0) {
newValue = srcValue;
}
assignMergeValue(object2, key, newValue);
}
}, keysIn);
}
function baseMergeDeep(object2, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object2, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object2, key, stacked);
return;
}
var newValue = customizer ? customizer(objValue, srcValue, key + "", object2, source, stack) : void 0;
var isCommon = newValue === void 0;
if (isCommon) {
var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray2(objValue)) {
newValue = objValue;
} else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
} else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
} else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
} else {
newValue = [];
}
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
} else if (!isObject2(objValue) || isFunction5(objValue)) {
newValue = initCloneObject(srcValue);
}
} else {
isCommon = false;
}
}
if (isCommon) {
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack["delete"](srcValue);
}
assignMergeValue(object2, key, newValue);
}
function baseRest(func2, start2) {
return setToString(overRest(func2, start2, identity), func2 + "");
}
var baseSetToString = !defineProperty ? identity : function(func2, string2) {
return defineProperty(func2, "toString", {
"configurable": true,
"enumerable": false,
"value": constant(string2),
"writable": true
});
};
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 cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
function cloneTypedArray(typedArray, isDeep) {
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
}
function copyArray(source, array) {
var index2 = -1, length2 = source.length;
array || (array = Array(length2));
while (++index2 < length2) {
array[index2] = source[index2];
}
return array;
}
function copyObject(source, props, object2, customizer) {
var isNew = !object2;
object2 || (object2 = {});
var index2 = -1, length2 = props.length;
while (++index2 < length2) {
var key = props[index2];
var newValue = customizer ? customizer(object2[key], source[key], key, object2, source) : void 0;
if (newValue === void 0) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object2, key, newValue);
} else {
assignValue(object2, key, newValue);
}
}
return object2;
}
function createAssigner(assigner) {
return baseRest(function(object2, sources) {
var index2 = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard2 = length2 > 2 ? sources[2] : void 0;
customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
if (guard2 && isIterateeCall(sources[0], sources[1], guard2)) {
customizer = length2 < 3 ? void 0 : customizer;
length2 = 1;
}
object2 = Object(object2);
while (++index2 < length2) {
var source = sources[index2];
if (source) {
assigner(object2, source, index2, customizer);
}
}
return object2;
});
}
function createBaseFor(fromRight) {
return function(object2, iteratee, keysFunc) {
var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length2 = props.length;
while (length2--) {
var key = props[fromRight ? length2 : ++index2];
if (iteratee(iterable[key], key, iterable) === false) {
break;
}
}
return object2;
};
}
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
}
function getNative(object2, key) {
var value = getValue2(object2, key);
return baseIsNative(value) ? value : void 0;
}
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
try {
value[symToStringTag] = void 0;
var unmasked = true;
} catch (e) {
}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
function initCloneObject(object2) {
return typeof object2.constructor == "function" && !isPrototype(object2) ? baseCreate(getPrototype(object2)) : {};
}
function isIndex(value, length2) {
var type = typeof value;
length2 = length2 == null ? MAX_SAFE_INTEGER : length2;
return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
}
function isIterateeCall(value, index2, object2) {
if (!isObject2(object2)) {
return false;
}
var type = typeof index2;
if (type == "number" ? isArrayLike(object2) && isIndex(index2, object2.length) : type == "string" && index2 in object2) {
return eq(object2[index2], value);
}
return false;
}
function isKeyable(value) {
var type = typeof value;
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
}
function isMasked(func2) {
return !!maskSrcKey && maskSrcKey in func2;
}
function isPrototype(value) {
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
return value === proto;
}
function nativeKeysIn(object2) {
var result = [];
if (object2 != null) {
for (var key in Object(object2)) {
result.push(key);
}
}
return result;
}
function objectToString(value) {
return nativeObjectToString.call(value);
}
function overRest(func2, start2, transform3) {
start2 = nativeMax(start2 === void 0 ? func2.length - 1 : start2, 0);
return function() {
var args = arguments, index2 = -1, length2 = nativeMax(args.length - start2, 0), array = Array(length2);
while (++index2 < length2) {
array[index2] = args[start2 + index2];
}
index2 = -1;
var otherArgs = Array(start2 + 1);
while (++index2 < start2) {
otherArgs[index2] = args[index2];
}
otherArgs[start2] = transform3(array);
return apply(func2, this, otherArgs);
};
}
function safeGet(object2, key) {
if (key === "constructor" && typeof object2[key] === "function") {
return;
}
if (key == "__proto__") {
return;
}
return object2[key];
}
var setToString = shortOut(baseSetToString);
function shortOut(func2) {
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 func2.apply(void 0, arguments);
};
}
function toSource(func2) {
if (func2 != null) {
try {
return funcToString.call(func2);
} catch (e) {
}
try {
return func2 + "";
} catch (e) {
}
}
return "";
}
function eq(value, other) {
return value === other || value !== value && other !== other;
}
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
return arguments;
}()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
};
var isArray2 = Array.isArray;
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction5(value);
}
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
}
var isBuffer = nativeIsBuffer || stubFalse;
function isFunction5(value) {
if (!isObject2(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
function isLength(value) {
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
function isObject2(value) {
var type = typeof value;
return value != null && (type == "object" || type == "function");
}
function isObjectLike(value) {
return value != null && typeof value == "object";
}
function isPlainObject(value) {
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
return false;
}
var proto = getPrototype(value);
if (proto === null) {
return true;
}
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
}
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
function toPlainObject(value) {
return copyObject(value, keysIn(value));
}
function keysIn(object2) {
return isArrayLike(object2) ? arrayLikeKeys(object2, true) : baseKeysIn(object2);
}
var mergeWith = createAssigner(function(object2, source, srcIndex, customizer) {
baseMerge(object2, source, srcIndex, customizer);
});
function constant(value) {
return function() {
return value;
};
}
function identity(value) {
return value;
}
function stubFalse() {
return false;
}
module.exports = mergeWith;
}
});
// ../../node_modules/toggle-selection/index.js
var require_toggle_selection = __commonJS({
"../../node_modules/toggle-selection/index.js"(exports, module) {
module.exports = function() {
var selection = document.getSelection();
if (!selection.rangeCount) {
return function() {
};
}
var active = document.activeElement;
var ranges = [];
for (var i = 0; i < selection.rangeCount; i++) {
ranges.push(selection.getRangeAt(i));
}
switch (active.tagName.toUpperCase()) {
case "INPUT":
case "TEXTAREA":
active.blur();
break;
default:
active = null;
break;
}
selection.removeAllRanges();
return function() {
selection.type === "Caret" && selection.removeAllRanges();
if (!selection.rangeCount) {
ranges.forEach(function(range2) {
selection.addRange(range2);
});
}
active && active.focus();
};
};
}
});
// ../../node_modules/copy-to-clipboard/index.js
var require_copy_to_clipboard = __commonJS({
"../../node_modules/copy-to-clipboard/index.js"(exports, module) {
"use strict";
var deselectCurrent = require_toggle_selection();
var clipboardToIE11Formatting = {
"text/plain": "Text",
"text/html": "Url",
"default": "Text"
};
var defaultMessage = "Copy to clipboard: #{key}, Enter";
function format(message) {
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
return message.replace(/#{\s*key\s*}/g, copyKey);
}
function copy3(text, options) {
var debug, message, reselectPrevious, range2, selection, mark, success = false;
if (!options) {
options = {};
}
debug = options.debug || false;
try {
reselectPrevious = deselectCurrent();
range2 = document.createRange();
selection = document.getSelection();
mark = document.createElement("span");
mark.textContent = text;
mark.ariaHidden = "true";
mark.style.all = "unset";
mark.style.position = "fixed";
mark.style.top = 0;
mark.style.clip = "rect(0, 0, 0, 0)";
mark.style.whiteSpace = "pre";
mark.style.webkitUserSelect = "text";
mark.style.MozUserSelect = "text";
mark.style.msUserSelect = "text";
mark.style.userSelect = "text";
mark.addEventListener("copy", function(e) {
e.stopPropagation();
if (options.format) {
e.preventDefault();
if (typeof e.clipboardData === "undefined") {
debug && console.warn("unable to use e.clipboardData");
debug && console.warn("trying IE specific stuff");
window.clipboardData.clearData();
var format2 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
window.clipboardData.setData(format2, text);
} else {
e.clipboardData.clearData();
e.clipboardData.setData(options.format, text);
}
}
if (options.onCopy) {
e.preventDefault();
options.onCopy(e.clipboardData);
}
});
document.body.appendChild(mark);
range2.selectNodeContents(mark);
selection.addRange(range2);
var successful = document.execCommand("copy");
if (!successful) {
throw new Error("copy command was unsuccessful");
}
success = true;
} catch (err) {
debug && console.error("unable to copy using execCommand: ", err);
debug && console.warn("trying IE specific stuff");
try {
window.clipboardData.setData(options.format || "text", text);
options.onCopy && options.onCopy(window.clipboardData);
success = true;
} catch (err2) {
debug && console.error("unable to copy using clipboardData: ", err2);
debug && console.error("falling back to prompt");
message = format("message" in options ? options.message : defaultMessage);
window.prompt(message, text);
}
} finally {
if (selection) {
if (typeof selection.removeRange == "function") {
selection.removeRange(range2);
} else {
selection.removeAllRanges();
}
}
if (mark) {
document.body.removeChild(mark);
}
reselectPrevious();
}
return success;
}
module.exports = copy3;
}
});
// ../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
var require_hoist_non_react_statics_cjs = __commonJS({
"../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) {
"use strict";
var reactIs = require_react_is();
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
"$$typeof": true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
"$$typeof": true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
}
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics2(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== "string") {
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics2(targetComponent, inheritedComponent, blacklist);
}
}
var keys2 = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys2 = keys2.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys2.length; ++i) {
var key = keys2[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
defineProperty(targetComponent, key, descriptor);
} catch (e) {
}
}
}
}
return targetComponent;
}
module.exports = hoistNonReactStatics2;
}
});
// ../../node_modules/framer-motion/node_modules/@emotion/memoize/dist/memoize.browser.esm.js
function memoize4(fn2) {
var cache = {};
return function(arg) {
if (cache[arg] === void 0) cache[arg] = fn2(arg);
return cache[arg];
};
}
var memoize_browser_esm_default;
var init_memoize_browser_esm = __esm({
"../../node_modules/framer-motion/node_modules/@emotion/memoize/dist/memoize.browser.esm.js"() {
memoize_browser_esm_default = memoize4;
}
});
// ../../node_modules/framer-motion/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
var is_prop_valid_browser_esm_exports = {};
__export(is_prop_valid_browser_esm_exports, {
default: () => is_prop_valid_browser_esm_default
});
var reactPropsRegex, index, is_prop_valid_browser_esm_default;
var init_is_prop_valid_browser_esm = __esm({
"../../node_modules/framer-motion/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js"() {
init_memoize_browser_esm();
reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
index = memoize_browser_esm_default(
function(prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
is_prop_valid_browser_esm_default = index;
}
});
// ../../node_modules/react-fast-compare/index.js
var require_react_fast_compare = __commonJS({
"../../node_modules/react-fast-compare/index.js"(exports, module) {
var hasElementType = typeof Element !== "undefined";
var hasMap = typeof Map === "function";
var hasSet = typeof Set === "function";
var hasArrayBuffer = typeof ArrayBuffer === "function" && !!ArrayBuffer.isView;
function equal(a, b) {
if (a === b) return true;
if (a && b && typeof a == "object" && typeof b == "object") {
if (a.constructor !== b.constructor) return false;
var length2, i, keys2;
if (Array.isArray(a)) {
length2 = a.length;
if (length2 != b.length) return false;
for (i = length2; i-- !== 0; )
if (!equal(a[i], b[i])) return false;
return true;
}
var it;
if (hasMap && a instanceof Map && b instanceof Map) {
if (a.size !== b.size) return false;
it = a.entries();
while (!(i = it.next()).done)
if (!b.has(i.value[0])) return false;
it = a.entries();
while (!(i = it.next()).done)
if (!equal(i.value[1], b.get(i.value[0]))) return false;
return true;
}
if (hasSet && a instanceof Set && b instanceof Set) {
if (a.size !== b.size) return false;
it = a.entries();
while (!(i = it.next()).done)
if (!b.has(i.value[0])) return false;
return true;
}
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
length2 = a.length;
if (length2 != b.length) return false;
for (i = length2; i-- !== 0; )
if (a[i] !== b[i]) return false;
return true;
}
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === "function" && typeof b.valueOf === "function") return a.valueOf() === b.valueOf();
if (a.toString !== Object.prototype.toString && typeof a.toString === "function" && typeof b.toString === "function") return a.toString() === b.toString();
keys2 = Object.keys(a);
length2 = keys2.length;
if (length2 !== Object.keys(b).length) return false;
for (i = length2; i-- !== 0; )
if (!Object.prototype.hasOwnProperty.call(b, keys2[i])) return false;
if (hasElementType && a instanceof Element) return false;
for (i = length2; i-- !== 0; ) {
if ((keys2[i] === "_owner" || keys2[i] === "__v" || keys2[i] === "__o") && a.$$typeof) {
continue;
}
if (!equal(a[keys2[i]], b[keys2[i]])) return false;
}
return true;
}
return a !== a && b !== b;
}
module.exports = function isEqual2(a, b) {
try {
return equal(a, b);
} catch (error) {
if ((error.message || "").match(/stack|recursion/i)) {
console.warn("react-fast-compare cannot handle circular refs");
return false;
}
throw error;
}
};
}
});
// ../../node_modules/@chakra-ui/utils/dist/esm/add-dom-event.mjs
function addDomEvent(target, eventName, handler, options) {
target.addEventListener(eventName, handler, options);
return () => {
target.removeEventListener(eventName, handler, options);
};
}
// ../../node_modules/@chakra-ui/utils/dist/esm/is-element.mjs
function isHTMLElement(el) {
return el != null && typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE;
}
function isBrowser() {
return Boolean(globalThis == null ? void 0 : globalThis.document);
}
function isHiddenElement(element) {
if (element.parentElement && isHiddenElement(element.parentElement))
return true;
return element.hidden;
}
function isContentEditableElement(element) {
const value = element.getAttribute("contenteditable");
return value !== "false" && value != null;
}
function isDisabledElement(element) {
return Boolean(element.getAttribute("disabled")) === true || Boolean(element.getAttribute("aria-disabled")) === true;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/owner.mjs
function getOwnerWindow(node3) {
var _a8;
return ((_a8 = getOwnerDocument(node3)) == null ? void 0 : _a8.defaultView) ?? window;
}
function getOwnerDocument(node3) {
return isHTMLElement(node3) ? node3.ownerDocument : document;
}
function getEventWindow(event) {
return event.view ?? window;
}
function getActiveElement(node3) {
return getOwnerDocument(node3).activeElement;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/is-event.mjs
function isMouseEvent(event) {
const win = getEventWindow(event);
if (typeof win.PointerEvent !== "undefined" && event instanceof win.PointerEvent) {
return !!(event.pointerType === "mouse");
}
return event instanceof win.MouseEvent;
}
function isTouchEvent(event) {
const hasTouches = !!event.touches;
return hasTouches;
}
function isMultiTouchEvent(event) {
return isTouchEvent(event) && event.touches.length > 1;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/event-point.mjs
function pointFromTouch(e, type = "page") {
const point = e.touches[0] || e.changedTouches[0];
return { x: point[`${type}X`], y: point[`${type}Y`] };
}
function pointFromMouse(point, type = "page") {
return {
x: point[`${type}X`],
y: point[`${type}Y`]
};
}
function getEventPoint(event, type = "page") {
return isTouchEvent(event) ? pointFromTouch(event, type) : pointFromMouse(event, type);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/add-pointer-event.mjs
function filter(cb) {
return (event) => {
const isMouse = isMouseEvent(event);
if (!isMouse || isMouse && event.button === 0) {
cb(event);
}
};
}
function wrap(cb, filterPrimary = false) {
function listener(event) {
cb(event, { point: getEventPoint(event) });
}
const fn2 = filterPrimary ? filter(listener) : listener;
return fn2;
}
function addPointerEvent(target, type, cb, options) {
return addDomEvent(target, type, wrap(cb, type === "pointerdown"), options);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/assign-after.mjs
function assignAfter(target, ...sources) {
if (target == null) {
throw new TypeError("Cannot convert undefined or null to object");
}
const result = { ...target };
for (const nextSource of sources) {
if (nextSource == null)
continue;
for (const nextKey in nextSource) {
if (!Object.prototype.hasOwnProperty.call(nextSource, nextKey))
continue;
if (nextKey in result)
delete result[nextKey];
result[nextKey] = nextSource[nextKey];
}
}
return result;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/attr.mjs
var dataAttr = (condition) => condition ? "" : void 0;
var ariaAttr = (condition) => condition ? true : void 0;
// ../../node_modules/@chakra-ui/utils/dist/esm/is.mjs
function isArray(value) {
return Array.isArray(value);
}
function isObject(value) {
const type = typeof value;
return value != null && (type === "object" || type === "function") && !isArray(value);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/breakpoint.mjs
function getLastItem(array) {
const length2 = array == null ? 0 : array.length;
return length2 ? array[length2 - 1] : void 0;
}
function analyzeCSSValue(value) {
const num = parseFloat(value.toString());
const unit = value.toString().replace(String(num), "");
return { unitless: !unit, value: num, unit };
}
function px(value) {
if (value == null)
return value;
const { unitless } = analyzeCSSValue(value);
return unitless || typeof value === "number" ? `${value}px` : value;
}
var sortByBreakpointValue = (a, b) => parseInt(a[1], 10) > parseInt(b[1], 10) ? 1 : -1;
var sortBps = (breakpoints3) => Object.fromEntries(Object.entries(breakpoints3).sort(sortByBreakpointValue));
function normalize(breakpoints3) {
const sorted = sortBps(breakpoints3);
return Object.assign(Object.values(sorted), sorted);
}
function keys(breakpoints3) {
const value = Object.keys(sortBps(breakpoints3));
return new Set(value);
}
function subtract(value) {
if (!value)
return value;
value = px(value) ?? value;
const OFFSET = -0.02;
return typeof value === "number" ? `${value + OFFSET}` : value.replace(/(\d+\.?\d*)/u, (m2) => `${parseFloat(m2) + OFFSET}`);
}
function toMediaQueryString(min2, max2) {
const query = ["@media screen"];
if (min2)
query.push("and", `(min-width: ${px(min2)})`);
if (max2)
query.push("and", `(max-width: ${px(max2)})`);
return query.join(" ");
}
function analyzeBreakpoints(breakpoints3) {
if (!breakpoints3)
return null;
breakpoints3.base = breakpoints3.base ?? "0px";
const normalized = normalize(breakpoints3);
const queries = Object.entries(breakpoints3).sort(sortByBreakpointValue).map(([breakpoint, minW], index2, entry) => {
let [, maxW] = entry[index2 + 1] ?? [];
maxW = parseFloat(maxW) > 0 ? subtract(maxW) : void 0;
return {
_minW: subtract(minW),
breakpoint,
minW,
maxW,
maxWQuery: toMediaQueryString(null, maxW),
minWQuery: toMediaQueryString(minW),
minMaxQuery: toMediaQueryString(minW, maxW)
};
});
const _keys = keys(breakpoints3);
const _keysArr = Array.from(_keys.values());
return {
keys: _keys,
normalized,
isResponsive(test2) {
const keys2 = Object.keys(test2);
return keys2.length > 0 && keys2.every((key) => _keys.has(key));
},
asObject: sortBps(breakpoints3),
asArray: normalize(breakpoints3),
details: queries,
get(key) {
return queries.find((q) => q.breakpoint === key);
},
media: [
null,
...normalized.map((minW) => toMediaQueryString(minW)).slice(1)
],
/**
* Converts the object responsive syntax to array syntax
*
* @example
* toArrayValue({ base: 1, sm: 2, md: 3 }) // => [1, 2, 3]
*/
toArrayValue(test2) {
if (!isObject(test2)) {
throw new Error("toArrayValue: value must be an object");
}
const result = _keysArr.map((bp) => test2[bp] ?? null);
while (getLastItem(result) === null) {
result.pop();
}
return result;
},
/**
* Converts the array responsive syntax to object syntax
*
* @example
* toObjectValue([1, 2, 3]) // => { base: 1, sm: 2, md: 3 }
*/
toObjectValue(test2) {
if (!Array.isArray(test2)) {
throw new Error("toObjectValue: value must be an array");
}
return test2.reduce(
(acc, value, index2) => {
const key = _keysArr[index2];
if (key != null && value != null)
acc[key] = value;
return acc;
},
{}
);
}
};
}
// ../../node_modules/@chakra-ui/utils/dist/esm/call-all.mjs
function callAll(...fns) {
return function mergedFn(...args) {
fns.forEach((fn2) => fn2 == null ? void 0 : fn2(...args));
};
}
function callAllHandlers(...fns) {
return function func2(event) {
fns.some((fn2) => {
fn2 == null ? void 0 : fn2(event);
return event == null ? void 0 : event.defaultPrevented;
});
};
}
// ../../node_modules/@chakra-ui/utils/dist/esm/children.mjs
var import_react = __toESM(require_react(), 1);
function getValidChildren(children) {
return import_react.Children.toArray(children).filter(
(child) => (0, import_react.isValidElement)(child)
);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/compact.mjs
function compact(object2) {
const clone = Object.assign({}, object2);
for (let key in clone) {
if (clone[key] === void 0)
delete clone[key];
}
return clone;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/context.mjs
var import_react2 = __toESM(require_react(), 1);
function getErrorMessage(hook, provider) {
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
}
function createContext(options = {}) {
const {
name,
strict = true,
hookName = "useContext",
providerName = "Provider",
errorMessage,
defaultValue
} = options;
const Context = (0, import_react2.createContext)(defaultValue);
Context.displayName = name;
function useContext$1() {
var _a8;
const context = (0, import_react2.useContext)(Context);
if (!context && strict) {
const error = new Error(
errorMessage ?? getErrorMessage(hookName, providerName)
);
error.name = "ContextError";
(_a8 = Error.captureStackTrace) == null ? void 0 : _a8.call(Error, error, useContext$1);
throw error;
}
return context;
}
return [Context.Provider, useContext$1, Context];
}
// ../../node_modules/@chakra-ui/utils/dist/esm/cx.mjs
var cx = (...classNames2) => classNames2.filter(Boolean).join(" ");
// ../../node_modules/@chakra-ui/utils/dist/esm/tabbable.mjs
var hasTabIndex = (element) => element.hasAttribute("tabindex");
var hasNegativeTabIndex = (element) => hasTabIndex(element) && element.tabIndex === -1;
function isFocusable(element) {
if (!isHTMLElement(element) || isHiddenElement(element) || isDisabledElement(element)) {
return false;
}
const { localName } = element;
const focusableTags = ["input", "select", "textarea", "button"];
if (focusableTags.indexOf(localName) >= 0)
return true;
const others2 = {
a: () => element.hasAttribute("href"),
audio: () => element.hasAttribute("controls"),
video: () => element.hasAttribute("controls")
};
if (localName in others2) {
return others2[localName]();
}
if (isContentEditableElement(element))
return true;
return hasTabIndex(element);
}
function isTabbable(element) {
if (!element)
return false;
return isHTMLElement(element) && isFocusable(element) && !hasNegativeTabIndex(element);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/focusable.mjs
var focusableElList = [
"input:not(:disabled):not([disabled])",
"select:not(:disabled):not([disabled])",
"textarea:not(:disabled):not([disabled])",
"embed",
"iframe",
"object",
"a[href]",
"area[href]",
"button:not(:disabled):not([disabled])",
"[tabindex]",
"audio[controls]",
"video[controls]",
"*[tabindex]:not([aria-disabled])",
"*[contenteditable]"
];
var focusableElSelector = focusableElList.join();
var isVisible = (el) => el.offsetWidth > 0 && el.offsetHeight > 0;
function getAllFocusable(container2) {
const focusableEls = Array.from(
container2.querySelectorAll(focusableElSelector)
);
focusableEls.unshift(container2);
return focusableEls.filter((el) => isFocusable(el) && isVisible(el));
}
// ../../node_modules/@chakra-ui/utils/dist/esm/get.mjs
function get(obj, path, fallback, index2) {
const key = typeof path === "string" ? path.split(".") : [path];
for (index2 = 0; index2 < key.length; index2 += 1) {
if (!obj)
break;
obj = obj[key[index2]];
}
return obj === void 0 ? fallback : obj;
}
var memoize = (fn2) => {
const cache = /* @__PURE__ */ new WeakMap();
const memoizedFn = (obj, path, fallback, index2) => {
if (typeof obj === "undefined") {
return fn2(obj, path, fallback);
}
if (!cache.has(obj)) {
cache.set(obj, /* @__PURE__ */ new Map());
}
const map = cache.get(obj);
if (map.has(path)) {
return map.get(path);
}
const value = fn2(obj, path, fallback, index2);
map.set(path, value);
return value;
};
return memoizedFn;
};
var memoizedGet = memoize(get);
// ../../node_modules/@chakra-ui/utils/dist/esm/interop-default.mjs
var interopDefault = (mod) => mod.default || mod;
// ../../node_modules/@chakra-ui/utils/dist/esm/lazy.mjs
function lazyDisclosure(options) {
const { wasSelected, enabled, isSelected, mode: mode2 = "unmount" } = options;
if (!enabled)
return true;
if (isSelected)
return true;
if (mode2 === "keepMounted" && wasSelected)
return true;
return false;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/number.mjs
function toNumber(value) {
const num = parseFloat(value);
return typeof num !== "number" || Number.isNaN(num) ? 0 : num;
}
function toPrecision(value, precision) {
let nextValue = toNumber(value);
const scaleFactor = 10 ** (precision ?? 10);
nextValue = Math.round(nextValue * scaleFactor) / scaleFactor;
return precision ? nextValue.toFixed(precision) : nextValue.toString();
}
function countDecimalPlaces(value) {
if (!Number.isFinite(value))
return 0;
let e = 1;
let p = 0;
while (Math.round(value * e) / e !== value) {
e *= 10;
p += 1;
}
return p;
}
function valueToPercent(value, min2, max2) {
return (value - min2) * 100 / (max2 - min2);
}
function percentToValue(percent2, min2, max2) {
return (max2 - min2) * percent2 + min2;
}
function roundValueToStep(value, from2, step) {
const nextValue = Math.round((value - from2) / step) * step + from2;
const precision = countDecimalPlaces(step);
return toPrecision(nextValue, precision);
}
function clampValue(value, min2, max2) {
if (value == null)
return value;
if (max2 < min2) {
console.warn("clamp: max cannot be less than min");
}
return Math.min(Math.max(value, min2), max2);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/omit.mjs
function omit(object2, keysToOmit = []) {
const clone = Object.assign({}, object2);
for (const key of keysToOmit) {
if (key in clone) {
delete clone[key];
}
}
return clone;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/pick.mjs
function pick(object2, keysToPick) {
const result = {};
for (const key of keysToPick) {
if (key in object2) {
result[key] = object2[key];
}
}
return result;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/responsive.mjs
var breakpoints = Object.freeze([
"base",
"sm",
"md",
"lg",
"xl",
"2xl"
]);
function mapResponsive(prop, mapper) {
if (Array.isArray(prop)) {
return prop.map((item) => item === null ? null : mapper(item));
}
if (isObject(prop)) {
return Object.keys(prop).reduce((result, key) => {
result[key] = mapper(prop[key]);
return result;
}, {});
}
if (prop != null) {
return mapper(prop);
}
return null;
}
function arrayToObjectNotation(values, bps = breakpoints) {
const result = {};
values.forEach((value, index2) => {
const key = bps[index2];
if (value == null)
return;
result[key] = value;
});
return result;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/run-if-fn.mjs
var isFunction = (value) => typeof value === "function";
function runIfFn(valueOrFn, ...args) {
return isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
}
// ../../node_modules/@chakra-ui/utils/dist/esm/scroll-parent.mjs
function isScrollParent(el) {
const win = el.ownerDocument.defaultView || window;
const { overflow, overflowX, overflowY } = win.getComputedStyle(el);
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
function getParent(el) {
if (el.localName === "html")
return el;
return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement;
}
function getScrollParent(el) {
if (["html", "body", "#document"].includes(el.localName)) {
return el.ownerDocument.body;
}
if (isHTMLElement(el) && isScrollParent(el)) {
return el;
}
return getScrollParent(getParent(el));
}
// ../../node_modules/@chakra-ui/utils/dist/esm/split.mjs
function split(object2, keys2) {
const picked = {};
const omitted2 = {};
for (const [key, value] of Object.entries(object2)) {
if (keys2.includes(key))
picked[key] = value;
else
omitted2[key] = value;
}
return [picked, omitted2];
}
// ../../node_modules/@chakra-ui/utils/dist/esm/split-props.mjs
function splitProps(props, ...keys2) {
const descriptors = Object.getOwnPropertyDescriptors(props);
const dKeys = Object.keys(descriptors);
const split2 = (k) => {
const clone = {};
for (let i = 0; i < k.length; i++) {
const key = k[i];
if (descriptors[key]) {
Object.defineProperty(clone, key, descriptors[key]);
delete descriptors[key];
}
}
return clone;
};
const fn2 = (key) => split2(Array.isArray(key) ? key : dKeys.filter(key));
return keys2.map(fn2).concat(split2(dKeys));
}
// ../../node_modules/@chakra-ui/utils/dist/esm/walk-object.mjs
function walkObject(target, predicate, options = {}) {
const { stop, getKey } = options;
function inner(value, path = []) {
if (isObject(value) || Array.isArray(value)) {
const result = {};
for (const [prop, child] of Object.entries(value)) {
const key = (getKey == null ? void 0 : getKey(prop)) ?? prop;
const childPath = [...path, key];
if (stop == null ? void 0 : stop(value, childPath)) {
return predicate(value, path);
}
result[key] = inner(child, childPath);
}
return result;
}
return predicate(value, path);
}
return inner(target);
}
// ../../node_modules/@chakra-ui/utils/dist/esm/warn.mjs
var warn = (options) => {
const { condition, message } = options;
if (condition && true) {
console.warn(message);
}
};
// ../../node_modules/@chakra-ui/utils/dist/esm/index.mjs
var import_lodash = __toESM(require_lodash(), 1);
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-animation-state.mjs
var import_react5 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-event-listener.mjs
var import_react4 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-callback-ref.mjs
var import_react3 = __toESM(require_react(), 1);
function useCallbackRef(callback, deps = []) {
const callbackRef = (0, import_react3.useRef)(callback);
(0, import_react3.useEffect)(() => {
callbackRef.current = callback;
});
return (0, import_react3.useCallback)((...args) => {
var _a8;
return (_a8 = callbackRef.current) == null ? void 0 : _a8.call(callbackRef, ...args);
}, deps);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-event-listener.mjs
function useEventListener(target, event, handler, options) {
const listener = useCallbackRef(handler);
(0, import_react4.useEffect)(() => {
const node3 = typeof target === "function" ? target() : target ?? document;
if (!handler || !node3)
return;
node3.addEventListener(event, listener, options);
return () => {
node3.removeEventListener(event, listener, options);
};
}, [event, target, options, listener, handler]);
return () => {
const node3 = typeof target === "function" ? target() : target ?? document;
node3 == null ? void 0 : node3.removeEventListener(event, listener, options);
};
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-animation-state.mjs
function useAnimationState(props) {
const { isOpen, ref } = props;
const [mounted, setMounted] = (0, import_react5.useState)(isOpen);
const [once, setOnce] = (0, import_react5.useState)(false);
(0, import_react5.useEffect)(() => {
if (!once) {
setMounted(isOpen);
setOnce(true);
}
}, [isOpen, once, mounted]);
useEventListener(
() => ref.current,
"animationend",
() => {
setMounted(isOpen);
}
);
const hidden = isOpen ? false : !mounted;
return {
present: !hidden,
onComplete() {
var _a8;
const win = getOwnerWindow(ref.current);
const evt = new win.CustomEvent("animationend", { bubbles: true });
(_a8 = ref.current) == null ? void 0 : _a8.dispatchEvent(evt);
}
};
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-boolean.mjs
var import_react6 = __toESM(require_react(), 1);
function useBoolean(initialState2 = false) {
const [value, setValue] = (0, import_react6.useState)(initialState2);
const callbacks = (0, import_react6.useMemo)(
() => ({
on: () => setValue(true),
off: () => setValue(false),
toggle: () => setValue((prev2) => !prev2)
}),
[]
);
return [value, callbacks];
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-clipboard.mjs
var import_react7 = __toESM(require_react(), 1);
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
function useClipboard(value, optionsOrTimeout = {}) {
const [hasCopied, setHasCopied] = (0, import_react7.useState)(false);
const [valueState, setValueState] = (0, import_react7.useState)(value);
(0, import_react7.useEffect)(() => setValueState(value), [value]);
const { timeout = 1500, ...copyOptions } = typeof optionsOrTimeout === "number" ? { timeout: optionsOrTimeout } : optionsOrTimeout;
const onCopy = (0, import_react7.useCallback)(
(valueToCopy) => {
const value2 = typeof valueToCopy === "string" ? valueToCopy : valueState;
if ("clipboard" in navigator) {
navigator.clipboard.writeText(value2).then(() => setHasCopied(true)).catch(() => setHasCopied((0, import_copy_to_clipboard.default)(value2, copyOptions)));
} else {
setHasCopied((0, import_copy_to_clipboard.default)(value2, copyOptions));
}
},
[valueState, copyOptions]
);
(0, import_react7.useEffect)(() => {
let timeoutId = null;
if (hasCopied) {
timeoutId = window.setTimeout(() => {
setHasCopied(false);
}, timeout);
}
return () => {
if (timeoutId) {
window.clearTimeout(timeoutId);
}
};
}, [timeout, hasCopied]);
return {
value: valueState,
setValue: setValueState,
onCopy,
hasCopied
};
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-const.mjs
var import_react8 = __toESM(require_react(), 1);
function useConst(init) {
const ref = (0, import_react8.useRef)(null);
if (ref.current === null) {
ref.current = typeof init === "function" ? init() : init;
}
return ref.current;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-controllable-state.mjs
var import_react9 = __toESM(require_react(), 1);
function useControllableProp(prop, state2) {
const controlled = typeof prop !== "undefined";
const value = controlled ? prop : state2;
return (0, import_react9.useMemo)(() => [controlled, value], [controlled, value]);
}
function useControllableState(props) {
const {
value: valueProp,
defaultValue,
onChange,
shouldUpdate = (prev2, next2) => prev2 !== next2
} = props;
const onChangeProp = useCallbackRef(onChange);
const shouldUpdateProp = useCallbackRef(shouldUpdate);
const [uncontrolledState, setUncontrolledState] = (0, import_react9.useState)(defaultValue);
const controlled = valueProp !== void 0;
const value = controlled ? valueProp : uncontrolledState;
const setValue = useCallbackRef(
(next2) => {
const setter = next2;
const nextValue = typeof next2 === "function" ? setter(value) : next2;
if (!shouldUpdateProp(value, nextValue)) {
return;
}
if (!controlled) {
setUncontrolledState(nextValue);
}
onChangeProp(nextValue);
},
[controlled, onChangeProp, value, shouldUpdateProp]
);
return [value, setValue];
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-counter.mjs
var import_react10 = __toESM(require_react(), 1);
function useCounter(props = {}) {
const {
onChange,
precision: precisionProp,
defaultValue,
value: valueProp,
step: stepProp = 1,
min: min2 = Number.MIN_SAFE_INTEGER,
max: max2 = Number.MAX_SAFE_INTEGER,
keepWithinRange = true
} = props;
const onChangeProp = useCallbackRef(onChange);
const [valueState, setValue] = (0, import_react10.useState)(() => {
if (defaultValue == null)
return "";
return cast(defaultValue, stepProp, precisionProp) ?? "";
});
const isControlled = typeof valueProp !== "undefined";
const value = isControlled ? valueProp : valueState;
const decimalPlaces = getDecimalPlaces(parse(value), stepProp);
const precision = precisionProp ?? decimalPlaces;
const update = (0, import_react10.useCallback)(
(next2) => {
if (next2 === value)
return;
if (!isControlled) {
setValue(next2.toString());
}
onChangeProp == null ? void 0 : onChangeProp(next2.toString(), parse(next2));
},
[onChangeProp, isControlled, value]
);
const clamp2 = (0, import_react10.useCallback)(
(value2) => {
let nextValue = value2;
if (keepWithinRange) {
nextValue = clampValue(nextValue, min2, max2);
}
return toPrecision(nextValue, precision);
},
[precision, keepWithinRange, max2, min2]
);
const increment = (0, import_react10.useCallback)(
(step = stepProp) => {
let next2;
if (value === "") {
next2 = parse(step);
} else {
next2 = parse(value) + step;
}
next2 = clamp2(next2);
update(next2);
},
[clamp2, stepProp, update, value]
);
const decrement = (0, import_react10.useCallback)(
(step = stepProp) => {
let next2;
if (value === "") {
next2 = parse(-step);
} else {
next2 = parse(value) - step;
}
next2 = clamp2(next2);
update(next2);
},
[clamp2, stepProp, update, value]
);
const reset = (0, import_react10.useCallback)(() => {
let next2;
if (defaultValue == null) {
next2 = "";
} else {
next2 = cast(defaultValue, stepProp, precisionProp) ?? min2;
}
update(next2);
}, [defaultValue, precisionProp, stepProp, update, min2]);
const castValue = (0, import_react10.useCallback)(
(value2) => {
const nextValue = cast(value2, stepProp, precision) ?? min2;
update(nextValue);
},
[precision, stepProp, update, min2]
);
const valueAsNumber = parse(value);
const isOutOfRange = valueAsNumber > max2 || valueAsNumber < min2;
const isAtMax = valueAsNumber === max2;
const isAtMin = valueAsNumber === min2;
return {
isOutOfRange,
isAtMax,
isAtMin,
precision,
value,
valueAsNumber,
update,
reset,
increment,
decrement,
clamp: clamp2,
cast: castValue,
setValue
};
}
function parse(value) {
return parseFloat(value.toString().replace(/[^\w.-]+/g, ""));
}
function getDecimalPlaces(value, step) {
return Math.max(countDecimalPlaces(step), countDecimalPlaces(value));
}
function cast(value, step, precision) {
const parsedValue = parse(value);
if (Number.isNaN(parsedValue))
return void 0;
const decimalPlaces = getDecimalPlaces(parsedValue, step);
return toPrecision(parsedValue, precision ?? decimalPlaces);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-disclosure.mjs
var import_react11 = __toESM(require_react(), 1);
function useDisclosure(props = {}) {
const {
onClose: onCloseProp,
onOpen: onOpenProp,
isOpen: isOpenProp,
id: idProp
} = props;
const handleOpen = useCallbackRef(onOpenProp);
const handleClose = useCallbackRef(onCloseProp);
const [isOpenState, setIsOpen] = (0, import_react11.useState)(props.defaultIsOpen || false);
const isOpen = isOpenProp !== void 0 ? isOpenProp : isOpenState;
const isControlled = isOpenProp !== void 0;
const uid = (0, import_react11.useId)();
const id3 = idProp ?? `disclosure-${uid}`;
const onClose = (0, import_react11.useCallback)(() => {
if (!isControlled) {
setIsOpen(false);
}
handleClose == null ? void 0 : handleClose();
}, [isControlled, handleClose]);
const onOpen = (0, import_react11.useCallback)(() => {
if (!isControlled) {
setIsOpen(true);
}
handleOpen == null ? void 0 : handleOpen();
}, [isControlled, handleOpen]);
const onToggle = (0, import_react11.useCallback)(() => {
if (isOpen) {
onClose();
} else {
onOpen();
}
}, [isOpen, onOpen, onClose]);
function getButtonProps(props2 = {}) {
return {
...props2,
"aria-expanded": isOpen,
"aria-controls": id3,
onClick(event) {
var _a8;
(_a8 = props2.onClick) == null ? void 0 : _a8.call(props2, event);
onToggle();
}
};
}
function getDisclosureProps(props2 = {}) {
return {
...props2,
hidden: !isOpen,
id: id3
};
}
return {
isOpen,
onOpen,
onClose,
onToggle,
isControlled,
getButtonProps,
getDisclosureProps
};
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-focus-effect.mjs
var import_react14 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-safe-layout-effect.mjs
var import_react12 = __toESM(require_react(), 1);
var useSafeLayoutEffect = Boolean(globalThis == null ? void 0 : globalThis.document) ? import_react12.useLayoutEffect : import_react12.useEffect;
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-update-effect.mjs
var import_react13 = __toESM(require_react(), 1);
var useUpdateEffect = (effect5, deps) => {
const renderCycleRef = (0, import_react13.useRef)(false);
const effectCycleRef = (0, import_react13.useRef)(false);
(0, import_react13.useEffect)(() => {
const isMounted = renderCycleRef.current;
const shouldRun = isMounted && effectCycleRef.current;
if (shouldRun) {
return effect5();
}
effectCycleRef.current = true;
}, deps);
(0, import_react13.useEffect)(() => {
renderCycleRef.current = true;
return () => {
renderCycleRef.current = false;
};
}, []);
};
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-focus-effect.mjs
function preventReturnFocus(containerRef) {
const el = containerRef.current;
if (!el)
return false;
const activeElement = getActiveElement(el);
if (!activeElement)
return false;
if (el.contains(activeElement))
return false;
if (isTabbable(activeElement))
return true;
return false;
}
function useFocusOnHide(containerRef, options) {
const { shouldFocus: shouldFocusProp, visible, focusRef } = options;
const shouldFocus = shouldFocusProp && !visible;
useUpdateEffect(() => {
if (!shouldFocus)
return;
if (preventReturnFocus(containerRef)) {
return;
}
const el = (focusRef == null ? void 0 : focusRef.current) || containerRef.current;
let rafId;
if (el) {
rafId = requestAnimationFrame(() => {
el.focus({ preventScroll: true });
});
return () => {
cancelAnimationFrame(rafId);
};
}
}, [shouldFocus, containerRef, focusRef]);
}
var defaultOptions = {
preventScroll: true,
shouldFocus: false
};
function useFocusOnShow(target, options = defaultOptions) {
const { focusRef, preventScroll, shouldFocus, visible } = options;
const element = isRefObject2(target) ? target.current : target;
const autoFocusValue = shouldFocus && visible;
const autoFocusRef = (0, import_react14.useRef)(autoFocusValue);
const lastVisibleRef = (0, import_react14.useRef)(visible);
useSafeLayoutEffect(() => {
if (!lastVisibleRef.current && visible) {
autoFocusRef.current = autoFocusValue;
}
lastVisibleRef.current = visible;
}, [visible, autoFocusValue]);
const onFocus3 = (0, import_react14.useCallback)(() => {
if (!visible || !element || !autoFocusRef.current)
return;
autoFocusRef.current = false;
if (element.contains(document.activeElement))
return;
if (focusRef == null ? void 0 : focusRef.current) {
requestAnimationFrame(() => {
var _a8;
(_a8 = focusRef.current) == null ? void 0 : _a8.focus({ preventScroll });
});
} else {
const tabbableEls = getAllFocusable(element);
if (tabbableEls.length > 0) {
requestAnimationFrame(() => {
tabbableEls[0].focus({ preventScroll });
});
}
}
}, [visible, preventScroll, element, focusRef]);
useUpdateEffect(() => {
onFocus3();
}, [onFocus3]);
useEventListener(element, "transitionend", onFocus3);
}
function isRefObject2(val) {
return "current" in val;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-focus-on-pointer-down.mjs
function isRefObject3(val) {
return "current" in val;
}
var isDom = () => typeof window !== "undefined";
function getPlatform() {
const agent = navigator.userAgentData;
return (agent == null ? void 0 : agent.platform) ?? navigator.platform;
}
var vn = (v) => isDom() && v.test(navigator.vendor);
var pt = (v) => isDom() && v.test(getPlatform());
var isApple = () => pt(/mac|iphone|ipad|ipod/i);
var isSafari = () => isApple() && vn(/apple/i);
function useFocusOnPointerDown(props) {
const { ref, elements, enabled } = props;
const doc = () => {
var _a8;
return ((_a8 = ref.current) == null ? void 0 : _a8.ownerDocument) ?? document;
};
useEventListener(doc, "pointerdown", (event) => {
var _a8, _b3;
if (!isSafari() || !enabled)
return;
const target = ((_b3 = (_a8 = event.composedPath) == null ? void 0 : _a8.call(event)) == null ? void 0 : _b3[0]) ?? event.target;
const els = elements ?? [ref];
const isValidTarget = els.some((elementOrRef) => {
const el = isRefObject3(elementOrRef) ? elementOrRef.current : elementOrRef;
return (el == null ? void 0 : el.contains(target)) || el === target;
});
if (doc().activeElement !== target && isValidTarget) {
event.preventDefault();
target.focus();
}
});
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-id.mjs
var import_react15 = __toESM(require_react(), 1);
function useId2(idProp, prefix3) {
const id3 = (0, import_react15.useId)();
return (0, import_react15.useMemo)(
() => idProp || [prefix3, id3].filter(Boolean).join("-"),
[idProp, prefix3, id3]
);
}
function useIds(idProp, ...prefixes) {
const id3 = useId2(idProp);
return (0, import_react15.useMemo)(() => {
return prefixes.map((prefix3) => `${prefix3}-${id3}`);
}, [id3, prefixes]);
}
function useOptionalPart(partId) {
const [id3, setId] = (0, import_react15.useState)(null);
const ref = (0, import_react15.useCallback)(
(node3) => {
setId(node3 ? partId : null);
},
[partId]
);
return { ref, id: id3, isRendered: Boolean(id3) };
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-interval.mjs
var import_react16 = __toESM(require_react(), 1);
function useInterval(callback, delay2) {
const fn2 = useCallbackRef(callback);
(0, import_react16.useEffect)(() => {
let intervalId = null;
const tick = () => fn2();
if (delay2 !== null) {
intervalId = window.setInterval(tick, delay2);
}
return () => {
if (intervalId) {
window.clearInterval(intervalId);
}
};
}, [delay2, fn2]);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-latest-ref.mjs
var import_react17 = __toESM(require_react(), 1);
function useLatestRef(value) {
const ref = (0, import_react17.useRef)(null);
ref.current = value;
return ref;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-merge-refs.mjs
var import_react18 = __toESM(require_react(), 1);
function assignRef(ref, value) {
if (ref == null)
return;
if (typeof ref === "function") {
ref(value);
return;
}
try {
ref.current = value;
} catch (error) {
throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);
}
}
function mergeRefs(...refs) {
return (node3) => {
refs.forEach((ref) => {
assignRef(ref, node3);
});
};
}
function useMergeRefs(...refs) {
return (0, import_react18.useMemo)(() => mergeRefs(...refs), refs);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-outside-click.mjs
var import_react19 = __toESM(require_react(), 1);
function useOutsideClick(props) {
const { ref, handler, enabled = true } = props;
const savedHandler = useCallbackRef(handler);
const stateRef = (0, import_react19.useRef)({
isPointerDown: false,
ignoreEmulatedMouseEvents: false
});
const state2 = stateRef.current;
(0, import_react19.useEffect)(() => {
if (!enabled)
return;
const onPointerDown = (e) => {
if (isValidEvent(e, ref)) {
state2.isPointerDown = true;
}
};
const onMouseUp = (event) => {
if (state2.ignoreEmulatedMouseEvents) {
state2.ignoreEmulatedMouseEvents = false;
return;
}
if (state2.isPointerDown && handler && isValidEvent(event, ref)) {
state2.isPointerDown = false;
savedHandler(event);
}
};
const onTouchEnd = (event) => {
state2.ignoreEmulatedMouseEvents = true;
if (handler && state2.isPointerDown && isValidEvent(event, ref)) {
state2.isPointerDown = false;
savedHandler(event);
}
};
const doc = getOwnerDocument2(ref.current);
doc.addEventListener("mousedown", onPointerDown, true);
doc.addEventListener("mouseup", onMouseUp, true);
doc.addEventListener("touchstart", onPointerDown, true);
doc.addEventListener("touchend", onTouchEnd, true);
return () => {
doc.removeEventListener("mousedown", onPointerDown, true);
doc.removeEventListener("mouseup", onMouseUp, true);
doc.removeEventListener("touchstart", onPointerDown, true);
doc.removeEventListener("touchend", onTouchEnd, true);
};
}, [handler, ref, savedHandler, state2, enabled]);
}
function isValidEvent(event, ref) {
var _a8, _b3;
const target = ((_a8 = event.composedPath) == null ? void 0 : _a8.call(event)[0]) ?? event.target;
if (target) {
const doc = getOwnerDocument2(target);
if (!doc.contains(target))
return false;
}
return !((_b3 = ref.current) == null ? void 0 : _b3.contains(target));
}
function getOwnerDocument2(node3) {
return (node3 == null ? void 0 : node3.ownerDocument) ?? document;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-previous.mjs
var import_react20 = __toESM(require_react(), 1);
function usePrevious(value) {
const ref = (0, import_react20.useRef)(void 0);
(0, import_react20.useEffect)(() => {
ref.current = value;
}, [value]);
return ref.current;
}
// ../../node_modules/@zag-js/element-size/dist/index.mjs
function trackElementSize(element, callback) {
if (!element) {
callback(void 0);
return;
}
callback({ width: element.offsetWidth, height: element.offsetHeight });
const win = element.ownerDocument.defaultView ?? window;
const observer = new win.ResizeObserver((entries) => {
if (!Array.isArray(entries) || !entries.length)
return;
const [entry] = entries;
let width;
let height;
if ("borderBoxSize" in entry) {
const borderSizeEntry = entry["borderBoxSize"];
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
width = borderSize["inlineSize"];
height = borderSize["blockSize"];
} else {
width = element.offsetWidth;
height = element.offsetHeight;
}
callback({ width, height });
});
observer.observe(element, { box: "border-box" });
return () => observer.unobserve(element);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-size.mjs
var import_react21 = __toESM(require_react(), 1);
var useSafeLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? import_react21.useLayoutEffect : import_react21.useEffect;
function trackMutation(el, cb) {
var _a8;
if (!el || !el.parentElement)
return;
const win = ((_a8 = el.ownerDocument) == null ? void 0 : _a8.defaultView) ?? window;
const observer = new win.MutationObserver(() => {
cb();
});
observer.observe(el.parentElement, { childList: true });
return () => {
observer.disconnect();
};
}
function useSizes(props) {
const {
getNodes,
observeMutation = true,
enabled = true,
fallback = []
} = props;
const [sizes24, setSizes] = (0, import_react21.useState)(fallback);
const [count, setCount] = (0, import_react21.useState)(0);
useSafeLayoutEffect2(() => {
if (!enabled)
return;
const elements = getNodes();
const cleanups = elements.map(
(element, index2) => trackElementSize(element, (size2) => {
setSizes((sizes25) => {
return [
...sizes25.slice(0, index2),
size2,
...sizes25.slice(index2 + 1)
];
});
})
);
if (observeMutation) {
const firstNode = elements[0];
cleanups.push(
trackMutation(firstNode, () => {
setCount((count2) => count2 + 1);
})
);
}
return () => {
cleanups.forEach((cleanup) => {
cleanup == null ? void 0 : cleanup();
});
};
}, [count, enabled]);
return sizes24;
}
function isRef(ref) {
return typeof ref === "object" && ref !== null && "current" in ref;
}
function useSize(subject, options) {
const { observeMutation = false, enabled, fallback } = options ?? {};
const [size2] = useSizes({
observeMutation,
enabled,
fallback: fallback ? [fallback] : void 0,
getNodes() {
const node3 = isRef(subject) ? subject.current : subject;
return [node3];
}
});
return size2;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-timeout.mjs
var import_react22 = __toESM(require_react(), 1);
function useTimeout(callback, delay2) {
const fn2 = useCallbackRef(callback);
(0, import_react22.useEffect)(() => {
if (delay2 == null)
return void 0;
let timeoutId = null;
timeoutId = window.setTimeout(() => {
fn2();
}, delay2);
return () => {
if (timeoutId) {
window.clearTimeout(timeoutId);
}
};
}, [delay2, fn2]);
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-pan-event/use-pan-event.mjs
var import_react23 = __toESM(require_react(), 1);
// ../../node_modules/framesync/dist/es/on-next-frame.mjs
var defaultTimestep = 1 / 60 * 1e3;
var getCurrentTime = typeof performance !== "undefined" ? () => performance.now() : () => Date.now();
var onNextFrame = typeof window !== "undefined" ? (callback) => window.requestAnimationFrame(callback) : (callback) => setTimeout(() => callback(getCurrentTime()), defaultTimestep);
// ../../node_modules/framesync/dist/es/create-render-step.mjs
function createRenderStep(runNextFrame2) {
let toRun = [];
let toRunNextFrame = [];
let numToRun = 0;
let isProcessing2 = false;
let flushNextFrame = false;
const toKeepAlive = /* @__PURE__ */ new WeakSet();
const step = {
schedule: (callback, keepAlive = false, immediate = false) => {
const addToCurrentFrame = immediate && isProcessing2;
const buffer = addToCurrentFrame ? toRun : toRunNextFrame;
if (keepAlive)
toKeepAlive.add(callback);
if (buffer.indexOf(callback) === -1) {
buffer.push(callback);
if (addToCurrentFrame && isProcessing2)
numToRun = toRun.length;
}
return callback;
},
cancel: (callback) => {
const index2 = toRunNextFrame.indexOf(callback);
if (index2 !== -1)
toRunNextFrame.splice(index2, 1);
toKeepAlive.delete(callback);
},
process: (frameData2) => {
if (isProcessing2) {
flushNextFrame = true;
return;
}
isProcessing2 = true;
[toRun, toRunNextFrame] = [toRunNextFrame, toRun];
toRunNextFrame.length = 0;
numToRun = toRun.length;
if (numToRun) {
for (let i = 0; i < numToRun; i++) {
const callback = toRun[i];
callback(frameData2);
if (toKeepAlive.has(callback)) {
step.schedule(callback);
runNextFrame2();
}
}
}
isProcessing2 = false;
if (flushNextFrame) {
flushNextFrame = false;
step.process(frameData2);
}
}
};
return step;
}
// ../../node_modules/framesync/dist/es/index.mjs
var maxElapsed = 40;
var useDefaultElapsed = true;
var runNextFrame = false;
var isProcessing = false;
var frame = {
delta: 0,
timestamp: 0
};
var stepsOrder = [
"read",
"update",
"preRender",
"render",
"postRender"
];
var steps = stepsOrder.reduce((acc, key) => {
acc[key] = createRenderStep(() => runNextFrame = true);
return acc;
}, {});
var sync = stepsOrder.reduce((acc, key) => {
const step = steps[key];
acc[key] = (process2, keepAlive = false, immediate = false) => {
if (!runNextFrame)
startLoop();
return step.schedule(process2, keepAlive, immediate);
};
return acc;
}, {});
var cancelSync = stepsOrder.reduce((acc, key) => {
acc[key] = steps[key].cancel;
return acc;
}, {});
var flushSync = stepsOrder.reduce((acc, key) => {
acc[key] = () => steps[key].process(frame);
return acc;
}, {});
var processStep = (stepId) => steps[stepId].process(frame);
var processFrame = (timestamp) => {
runNextFrame = false;
frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - frame.timestamp, maxElapsed), 1);
frame.timestamp = timestamp;
isProcessing = true;
stepsOrder.forEach(processStep);
isProcessing = false;
if (runNextFrame) {
useDefaultElapsed = false;
onNextFrame(processFrame);
}
};
var startLoop = () => {
runNextFrame = true;
useDefaultElapsed = true;
if (!isProcessing)
onNextFrame(processFrame);
};
var getFrameData = () => frame;
var es_default = sync;
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-pan-event/pan-event.mjs
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var PanEvent = class {
constructor(event, handlers2, threshold) {
__publicField(this, "history", []);
__publicField(this, "startEvent", null);
__publicField(this, "lastEvent", null);
__publicField(this, "lastEventInfo", null);
__publicField(this, "handlers", {});
__publicField(this, "removeListeners", () => {
});
__publicField(this, "threshold", 3);
__publicField(this, "win");
__publicField(this, "updatePoint", () => {
if (!(this.lastEvent && this.lastEventInfo))
return;
const info2 = getPanInfo(this.lastEventInfo, this.history);
const isPanStarted = this.startEvent !== null;
const isDistancePastThreshold = distance(info2.offset, { x: 0, y: 0 }) >= this.threshold;
if (!isPanStarted && !isDistancePastThreshold)
return;
const { timestamp: timestamp2 } = getFrameData();
this.history.push({ ...info2.point, timestamp: timestamp2 });
const { onStart, onMove } = this.handlers;
if (!isPanStarted) {
onStart == null ? void 0 : onStart(this.lastEvent, info2);
this.startEvent = this.lastEvent;
}
onMove == null ? void 0 : onMove(this.lastEvent, info2);
});
__publicField(this, "onPointerMove", (event2, info2) => {
this.lastEvent = event2;
this.lastEventInfo = info2;
es_default.update(this.updatePoint, true);
});
__publicField(this, "onPointerUp", (event2, info2) => {
const panInfo = getPanInfo(info2, this.history);
const { onEnd, onSessionEnd } = this.handlers;
onSessionEnd == null ? void 0 : onSessionEnd(event2, panInfo);
this.end();
if (!onEnd || !this.startEvent)
return;
onEnd == null ? void 0 : onEnd(event2, panInfo);
});
this.win = event.view ?? window;
if (isMultiTouchEvent(event))
return;
this.handlers = handlers2;
if (threshold) {
this.threshold = threshold;
}
event.stopPropagation();
event.preventDefault();
const info = { point: getEventPoint(event) };
const { timestamp } = getFrameData();
this.history = [{ ...info.point, timestamp }];
const { onSessionStart } = handlers2;
onSessionStart == null ? void 0 : onSessionStart(event, getPanInfo(info, this.history));
this.removeListeners = pipe(
addPointerEvent(this.win, "pointermove", this.onPointerMove),
addPointerEvent(this.win, "pointerup", this.onPointerUp),
addPointerEvent(this.win, "pointercancel", this.onPointerUp)
);
}
updateHandlers(handlers2) {
this.handlers = handlers2;
}
end() {
var _a8;
(_a8 = this.removeListeners) == null ? void 0 : _a8.call(this);
cancelSync.update(this.updatePoint);
}
};
function subtract2(a, b) {
return { x: a.x - b.x, y: a.y - b.y };
}
function getPanInfo(info, history) {
return {
point: info.point,
delta: subtract2(info.point, history[history.length - 1]),
offset: subtract2(info.point, history[0]),
velocity: getVelocity(history, 0.1)
};
}
var toMilliseconds = (v) => v * 1e3;
function getVelocity(history, timeDelta) {
if (history.length < 2) {
return { x: 0, y: 0 };
}
let i = history.length - 1;
let timestampedPoint = null;
const lastPoint = history[history.length - 1];
while (i >= 0) {
timestampedPoint = history[i];
if (lastPoint.timestamp - timestampedPoint.timestamp > toMilliseconds(timeDelta)) {
break;
}
i--;
}
if (!timestampedPoint) {
return { x: 0, y: 0 };
}
const time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1e3;
if (time === 0) {
return { x: 0, y: 0 };
}
const currentVelocity = {
x: (lastPoint.x - timestampedPoint.x) / time,
y: (lastPoint.y - timestampedPoint.y) / time
};
if (currentVelocity.x === Infinity) {
currentVelocity.x = 0;
}
if (currentVelocity.y === Infinity) {
currentVelocity.y = 0;
}
return currentVelocity;
}
function pipe(...fns) {
return (v) => fns.reduce((a, b) => b(a), v);
}
function distance1D(a, b) {
return Math.abs(a - b);
}
function isPoint(point) {
return "x" in point && "y" in point;
}
function distance(a, b) {
if (typeof a === "number" && typeof b === "number") {
return distance1D(a, b);
}
if (isPoint(a) && isPoint(b)) {
const xDelta = distance1D(a.x, b.x);
const yDelta = distance1D(a.y, b.y);
return Math.sqrt(xDelta ** 2 + yDelta ** 2);
}
return 0;
}
// ../../node_modules/@chakra-ui/hooks/dist/esm/use-pan-event/use-pan-event.mjs
function usePanEvent(ref, options) {
const {
onPan,
onPanStart,
onPanEnd,
onPanSessionStart,
onPanSessionEnd,
threshold
} = options;
const hasPanEvents = Boolean(
onPan || onPanStart || onPanEnd || onPanSessionStart || onPanSessionEnd
);
const panSession = (0, import_react23.useRef)(null);
const handlersRef = useLatestRef({
onSessionStart: onPanSessionStart,
onSessionEnd: onPanSessionEnd,
onStart: onPanStart,
onMove: onPan,
onEnd(event, info) {
panSession.current = null;
onPanEnd == null ? void 0 : onPanEnd(event, info);
}
});
(0, import_react23.useEffect)(() => {
var _a8;
(_a8 = panSession.current) == null ? void 0 : _a8.updateHandlers(handlersRef.current);
});
(0, import_react23.useEffect)(() => {
const node3 = ref.current;
if (!node3 || !hasPanEvents)
return;
function onPointerDown(event) {
panSession.current = new PanEvent(event, handlersRef.current, threshold);
}
return addPointerEvent(node3, "pointerdown", onPointerDown);
}, [ref, hasPanEvents, handlersRef, threshold]);
(0, import_react23.useEffect)(() => {
return () => {
var _a8;
(_a8 = panSession.current) == null ? void 0 : _a8.end();
panSession.current = null;
};
}, []);
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/pseudos.mjs
var state = {
open: (str, post) => `${str}[data-open], ${str}[open], ${str}[data-state=open] ${post}`,
closed: (str, post) => `${str}[data-closed], ${str}[data-state=closed] ${post}`,
hover: (str, post) => `${str}:hover ${post}, ${str}[data-hover] ${post}`,
focus: (str, post) => `${str}:focus ${post}, ${str}[data-focus] ${post}`,
focusVisible: (str, post) => `${str}:focus-visible ${post}`,
focusWithin: (str, post) => `${str}:focus-within ${post}`,
active: (str, post) => `${str}:active ${post}, ${str}[data-active] ${post}`,
disabled: (str, post) => `${str}:disabled ${post}, ${str}[data-disabled] ${post}`,
invalid: (str, post) => `${str}:invalid ${post}, ${str}[data-invalid] ${post}`,
checked: (str, post) => `${str}:checked ${post}, ${str}[data-checked] ${post}`,
indeterminate: (str, post) => `${str}:indeterminate ${post}, ${str}[aria-checked=mixed] ${post}, ${str}[data-indeterminate] ${post}`,
readOnly: (str, post) => `${str}:read-only ${post}, ${str}[readonly] ${post}, ${str}[data-read-only] ${post}`,
expanded: (str, post) => `${str}:read-only ${post}, ${str}[aria-expanded=true] ${post}, ${str}[data-expanded] ${post}`,
placeholderShown: (str, post) => `${str}:placeholder-shown ${post}`
};
var toGroup = (fn2) => merge((v) => fn2(v, "&"), "[role=group]", "[data-group]", ".group");
var toPeer = (fn2) => merge((v) => fn2(v, "~ &"), "[data-peer]", ".peer");
var merge = (fn2, ...selectors) => selectors.map(fn2).join(", ");
var pseudoSelectors = {
/**
* Styles for CSS selector `&:hover`
*/
_hover: "&:hover, &[data-hover]",
/**
* Styles for CSS Selector `&:active`
*/
_active: "&:active, &[data-active]",
/**
* Styles for CSS selector `&:focus`
*
*/
_focus: "&:focus, &[data-focus]",
/**
* Styles for the highlighted state.
*/
_highlighted: "&[data-highlighted]",
/**
* Styles to apply when a child of this element has received focus
* - CSS Selector `&:focus-within`
*/
_focusWithin: "&:focus-within, &[data-focus-within]",
/**
* Styles to apply when this element has received focus via tabbing
* - CSS Selector `&:focus-visible`
*/
_focusVisible: "&:focus-visible, &[data-focus-visible]",
/**
* Styles to apply when this element is disabled. The passed styles are applied to these CSS selectors:
* - `&[aria-disabled=true]`
* - `&:disabled`
* - `&[data-disabled]`
* - `&[disabled]`
*/
_disabled: "&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",
/**
* Styles for CSS Selector `&:readonly`
*/
_readOnly: "&[aria-readonly=true], &[readonly], &[data-readonly]",
/**
* Styles for CSS selector `&::before`
*
* NOTE:When using this, ensure the `content` is wrapped in a backtick.
* @example
* ```jsx
*
* ```
*/
_before: "&::before",
/**
* Styles for CSS selector `&::after`
*
* NOTE:When using this, ensure the `content` is wrapped in a backtick.
* @example
* ```jsx
*
* ```
*/
_after: "&::after",
/**
* Styles for CSS selector `&:empty`
*/
_empty: "&:empty, &[data-empty]",
/**
* Styles to apply when the ARIA attribute `aria-expanded` is `true`
* - CSS selector `&[aria-expanded=true]`
*/
_expanded: "&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",
/**
* Styles to apply when the ARIA attribute `aria-checked` is `true`
* - CSS selector `&[aria-checked=true]`
*/
_checked: "&[aria-checked=true], &[data-checked], &[data-state=checked]",
/**
* Styles to apply when the ARIA attribute `aria-grabbed` is `true`
* - CSS selector `&[aria-grabbed=true]`
*/
_grabbed: "&[aria-grabbed=true], &[data-grabbed]",
/**
* Styles for CSS Selector `&[aria-pressed=true]`
* Typically used to style the current "pressed" state of toggle buttons
*/
_pressed: "&[aria-pressed=true], &[data-pressed]",
/**
* Styles to apply when the ARIA attribute `aria-invalid` is `true`
* - CSS selector `&[aria-invalid=true]`
*/
_invalid: "&[aria-invalid=true], &[data-invalid]",
/**
* Styles for the valid state
* - CSS selector `&[data-valid], &[data-state=valid]`
*/
_valid: "&[data-valid], &[data-state=valid]",
/**
* Styles for CSS Selector `&[aria-busy=true]` or `&[data-loading=true]`.
* Useful for styling loading states
*/
_loading: "&[data-loading], &[aria-busy=true]",
/**
* Styles to apply when the ARIA attribute `aria-selected` is `true`
*
* - CSS selector `&[aria-selected=true]`
*/
_selected: "&[aria-selected=true], &[data-selected]",
/**
* Styles for CSS Selector `[hidden=true]`
*/
_hidden: "&[hidden], &[data-hidden]",
/**
* Styles for CSS Selector `&:-webkit-autofill`
*/
_autofill: "&:-webkit-autofill",
/**
* Styles for CSS Selector `&:nth-child(even)`
*/
_even: "&:nth-of-type(even)",
/**
* Styles for CSS Selector `&:nth-child(odd)`
*/
_odd: "&:nth-of-type(odd)",
/**
* Styles for CSS Selector `&:first-of-type`
*/
_first: "&:first-of-type",
/**
* Styles for CSS selector `&::first-letter`
*
* NOTE: This selector is only applied for block-level elements and not preceded by an image or table.
* @example
* ```jsx
* Once upon a time
* ```
*/
_firstLetter: "&::first-letter",
/**
* Styles for CSS Selector `&:last-of-type`
*/
_last: "&:last-of-type",
/**
* Styles for CSS Selector `&:not(:first-of-type)`
*/
_notFirst: "&:not(:first-of-type)",
/**
* Styles for CSS Selector `&:not(:last-of-type)`
*/
_notLast: "&:not(:last-of-type)",
/**
* Styles for CSS Selector `&:visited`
*/
_visited: "&:visited",
/**
* Used to style the active link in a navigation
* Styles for CSS Selector `&[aria-current=page]`
*/
_activeLink: "&[aria-current=page]",
/**
* Used to style the current step within a process
* Styles for CSS Selector `&[aria-current=step]`
*/
_activeStep: "&[aria-current=step]",
/**
* Styles to apply when the ARIA attribute `aria-checked` is `mixed`
* - CSS selector `&[aria-checked=mixed]`
*/
_indeterminate: "&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is open
*/
_groupOpen: toGroup(state.open),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is closed
*/
_groupClosed: toGroup(state.closed),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is hovered
*/
_groupHover: toGroup(state.hover),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is hovered
*/
_peerHover: toPeer(state.hover),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is focused
*/
_groupFocus: toGroup(state.focus),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is focused
*/
_peerFocus: toPeer(state.focus),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` has visible focus
*/
_groupFocusVisible: toGroup(state.focusVisible),
/**
* Styles to apply when a sibling element with `.peer`or `data-peer` has visible focus
*/
_peerFocusVisible: toPeer(state.focusVisible),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is active
*/
_groupActive: toGroup(state.active),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is active
*/
_peerActive: toPeer(state.active),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is disabled
*/
_groupDisabled: toGroup(state.disabled),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is disabled
*/
_peerDisabled: toPeer(state.disabled),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is invalid
*/
_groupInvalid: toGroup(state.invalid),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is invalid
*/
_peerInvalid: toPeer(state.invalid),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` is checked
*/
_groupChecked: toGroup(state.checked),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` is checked
*/
_peerChecked: toPeer(state.checked),
/**
* Styles to apply when a parent element with `.group`, `data-group` or `role=group` has focus within
*/
_groupFocusWithin: toGroup(state.focusWithin),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` has focus within
*/
_peerFocusWithin: toPeer(state.focusWithin),
/**
* Styles to apply when a sibling element with `.peer` or `data-peer` has placeholder shown
*/
_peerPlaceholderShown: toPeer(state.placeholderShown),
/**
* Styles for CSS Selector `&::placeholder`.
*/
_placeholder: "&::placeholder, &[data-placeholder]",
/**
* Styles for CSS Selector `&:placeholder-shown`.
*/
_placeholderShown: "&:placeholder-shown, &[data-placeholder-shown]",
/**
* Styles for CSS Selector `&:fullscreen`.
*/
_fullScreen: "&:fullscreen, &[data-fullscreen]",
/**
* Styles for CSS Selector `&::selection`
*/
_selection: "&::selection",
/**
* Styles for CSS Selector `[dir=rtl] &`
* It is applied when a parent element or this element has `dir="rtl"`
*/
_rtl: "[dir=rtl] &, &[dir=rtl]",
/**
* Styles for CSS Selector `[dir=ltr] &`
* It is applied when a parent element or this element has `dir="ltr"`
*/
_ltr: "[dir=ltr] &, &[dir=ltr]",
/**
* Styles for CSS Selector `@media (prefers-color-scheme: dark)`
* It is used when the user has requested the system use a light or dark color theme.
*/
_mediaDark: "@media (prefers-color-scheme: dark)",
/**
* Styles for CSS Selector `@media (prefers-reduced-motion: reduce)`
* It is used when the user has requested the system to reduce the amount of animations.
*/
_mediaReduceMotion: "@media (prefers-reduced-motion: reduce)",
/**
* Styles for when `data-theme` is applied to any parent of
* this component or element.
*/
_dark: ".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",
/**
* Styles for when `data-theme` is applied to any parent of
* this component or element.
*/
_light: ".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",
/**
* Styles for the CSS Selector `&[data-orientation=horizontal]`
*/
_horizontal: "&[data-orientation=horizontal]",
/**
* Styles for the CSS Selector `&[data-orientation=vertical]`
*/
_vertical: "&[data-orientation=vertical]",
/**
* Styles for the CSS Selector `&[data-open], &[open], &[data-state=open]`
*/
_open: "&[data-open], &[open], &[data-state=open]",
/**
* Styles for the CSS Selector `&[data-closed], &[data-state=closed]`
*/
_closed: "&[data-closed], &[data-state=closed]",
/**
* Styles for the CSS Selector `&[data-complete]`
*/
_complete: "&[data-complete]",
/**
* Styles for the CSS Selector `&[data-incomplete]`
*/
_incomplete: "&[data-incomplete]",
/**
* Styles for the CSS Selector `&[data-current]`
*/
_current: "&[data-current]"
};
var pseudoPropNames = Object.keys(
pseudoSelectors
);
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/create-transform.mjs
var isImportant = (value) => /!(important)?$/.test(value);
var withoutImportant = (value) => typeof value === "string" ? value.replace(/!(important)?$/, "").trim() : value;
var tokenToCSSVar = (scale3, value) => (theme2) => {
const valueStr = String(value);
const important = isImportant(valueStr);
const valueWithoutImportant = withoutImportant(valueStr);
const key = scale3 ? `${scale3}.${valueWithoutImportant}` : valueWithoutImportant;
let transformed = isObject(theme2.__cssMap) && key in theme2.__cssMap ? theme2.__cssMap[key].varRef : value;
transformed = withoutImportant(transformed);
return important ? `${transformed} !important` : transformed;
};
function createTransform(options) {
const { scale: scale3, transform: transform3, compose } = options;
const fn2 = (value, theme2) => {
const _value = tokenToCSSVar(scale3, value)(theme2);
let result = (transform3 == null ? void 0 : transform3(_value, theme2)) ?? _value;
if (compose) {
result = compose(result, theme2);
}
return result;
};
return fn2;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/pipe.mjs
var pipe2 = (...fns) => (v) => fns.reduce((a, b) => b(a), v);
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/prop-config.mjs
function toConfig(scale3, transform3) {
return (property) => {
const result = { property, scale: scale3 };
result.transform = createTransform({
scale: scale3,
transform: transform3
});
return result;
};
}
var getRtl = ({ rtl, ltr }) => (theme2) => theme2.direction === "rtl" ? rtl : ltr;
function logical(options) {
const { property, scale: scale3, transform: transform3 } = options;
return {
scale: scale3,
property: getRtl(property),
transform: scale3 ? createTransform({
scale: scale3,
compose: transform3
}) : transform3
};
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/templates.mjs
var transformTemplate = [
"rotate(var(--chakra-rotate, 0))",
"scaleX(var(--chakra-scale-x, 1))",
"scaleY(var(--chakra-scale-y, 1))",
"skewX(var(--chakra-skew-x, 0))",
"skewY(var(--chakra-skew-y, 0))"
];
function getTransformTemplate() {
return [
"translateX(var(--chakra-translate-x, 0))",
"translateY(var(--chakra-translate-y, 0))",
...transformTemplate
].join(" ");
}
function getTransformGpuTemplate() {
return [
"translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",
...transformTemplate
].join(" ");
}
var filterTemplate = {
"--chakra-blur": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-brightness": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-contrast": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-grayscale": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-hue-rotate": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-invert": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-saturate": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-sepia": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-drop-shadow": "var(--chakra-empty,/*!*/ /*!*/)",
filter: [
"var(--chakra-blur)",
"var(--chakra-brightness)",
"var(--chakra-contrast)",
"var(--chakra-grayscale)",
"var(--chakra-hue-rotate)",
"var(--chakra-invert)",
"var(--chakra-saturate)",
"var(--chakra-sepia)",
"var(--chakra-drop-shadow)"
].join(" ")
};
var backdropFilterTemplate = {
backdropFilter: [
"var(--chakra-backdrop-blur)",
"var(--chakra-backdrop-brightness)",
"var(--chakra-backdrop-contrast)",
"var(--chakra-backdrop-grayscale)",
"var(--chakra-backdrop-hue-rotate)",
"var(--chakra-backdrop-invert)",
"var(--chakra-backdrop-opacity)",
"var(--chakra-backdrop-saturate)",
"var(--chakra-backdrop-sepia)"
].join(" "),
"--chakra-backdrop-blur": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-brightness": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-contrast": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-grayscale": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-hue-rotate": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-invert": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-opacity": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-saturate": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-backdrop-sepia": "var(--chakra-empty,/*!*/ /*!*/)"
};
function getRingTemplate(value) {
return {
"--chakra-ring-offset-shadow": `var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)`,
"--chakra-ring-shadow": `var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)`,
"--chakra-ring-width": value,
boxShadow: [
`var(--chakra-ring-offset-shadow)`,
`var(--chakra-ring-shadow)`,
`var(--chakra-shadow, 0 0 #0000)`
].join(", ")
};
}
var flexDirectionTemplate = {
"row-reverse": {
space: "--chakra-space-x-reverse",
divide: "--chakra-divide-x-reverse"
},
"column-reverse": {
space: "--chakra-space-y-reverse",
divide: "--chakra-divide-y-reverse"
}
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/parse-gradient.mjs
var directionMap = {
"to-t": "to top",
"to-tr": "to top right",
"to-r": "to right",
"to-br": "to bottom right",
"to-b": "to bottom",
"to-bl": "to bottom left",
"to-l": "to left",
"to-tl": "to top left"
};
var valueSet = new Set(Object.values(directionMap));
var globalSet = /* @__PURE__ */ new Set([
"none",
"-moz-initial",
"inherit",
"initial",
"revert",
"unset"
]);
var trimSpace = (str) => str.trim();
function parseGradient(value, theme2) {
if (value == null || globalSet.has(value))
return value;
const prevent = isCSSFunction(value) || globalSet.has(value);
if (!prevent)
return `url('${value}')`;
const regex = /(^[a-z-A-Z]+)\((.*)\)/g;
const results = regex.exec(value);
const type = results == null ? void 0 : results[1];
const values = results == null ? void 0 : results[2];
if (!type || !values)
return value;
const _type = type.includes("-gradient") ? type : `${type}-gradient`;
const [maybeDirection, ...stops] = values.split(",").map(trimSpace).filter(Boolean);
if ((stops == null ? void 0 : stops.length) === 0)
return value;
const direction2 = maybeDirection in directionMap ? directionMap[maybeDirection] : maybeDirection;
stops.unshift(direction2);
const _values = stops.map((stop) => {
if (valueSet.has(stop))
return stop;
const firstStop = stop.indexOf(" ");
const [_color, _stop] = firstStop !== -1 ? [stop.substr(0, firstStop), stop.substr(firstStop + 1)] : [stop];
const _stopOrFunc = isCSSFunction(_stop) ? _stop : _stop && _stop.split(" ");
const key = `colors.${_color}`;
const color3 = key in theme2.__cssMap ? theme2.__cssMap[key].varRef : _color;
return _stopOrFunc ? [
color3,
...Array.isArray(_stopOrFunc) ? _stopOrFunc : [_stopOrFunc]
].join(" ") : color3;
});
return `${_type}(${_values.join(", ")})`;
}
var isCSSFunction = (value) => {
return typeof value === "string" && value.includes("(") && value.includes(")");
};
var gradientTransform = (value, theme2) => parseGradient(value, theme2 ?? {});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/transform-functions.mjs
function isCssVar2(value) {
return /^var\(--.+\)$/.test(value);
}
var analyzeCSSValue2 = (value) => {
const num = parseFloat(value.toString());
const unit = value.toString().replace(String(num), "");
return { unitless: !unit, value: num, unit };
};
var wrap2 = (str) => (value) => `${str}(${value})`;
var transformFunctions = {
filter(value) {
return value !== "auto" ? value : filterTemplate;
},
backdropFilter(value) {
return value !== "auto" ? value : backdropFilterTemplate;
},
ring(value) {
return getRingTemplate(transformFunctions.px(value));
},
bgClip(value) {
return value === "text" ? { color: "transparent", backgroundClip: "text" } : { backgroundClip: value };
},
transform(value) {
if (value === "auto")
return getTransformTemplate();
if (value === "auto-gpu")
return getTransformGpuTemplate();
return value;
},
vh(value) {
return value === "$100vh" ? "var(--chakra-vh)" : value;
},
px(value) {
if (value == null)
return value;
const { unitless } = analyzeCSSValue2(value);
return unitless || typeof value === "number" ? `${value}px` : value;
},
fraction(value) {
return !(typeof value === "number") || value > 1 ? value : `${value * 100}%`;
},
float(value, theme2) {
const map = { left: "right", right: "left" };
return theme2.direction === "rtl" ? map[value] : value;
},
degree(value) {
if (isCssVar2(value) || value == null)
return value;
const unitless = typeof value === "string" && !value.endsWith("deg");
return typeof value === "number" || unitless ? `${value}deg` : value;
},
gradient: gradientTransform,
blur: wrap2("blur"),
opacity: wrap2("opacity"),
brightness: wrap2("brightness"),
contrast: wrap2("contrast"),
dropShadow: wrap2("drop-shadow"),
grayscale: wrap2("grayscale"),
hueRotate: (value) => wrap2("hue-rotate")(transformFunctions.degree(value)),
invert: wrap2("invert"),
saturate: wrap2("saturate"),
sepia: wrap2("sepia"),
bgImage(value) {
if (value == null)
return value;
const prevent = isCSSFunction(value) || globalSet.has(value);
return !prevent ? `url(${value})` : value;
},
outline(value) {
const isNoneOrZero = String(value) === "0" || String(value) === "none";
return value !== null && isNoneOrZero ? { outline: "2px solid transparent", outlineOffset: "2px" } : { outline: value };
},
flexDirection(value) {
const { space: space2, divide: divide3 } = flexDirectionTemplate[value] ?? {};
const result = { flexDirection: value };
if (space2)
result[space2] = 1;
if (divide3)
result[divide3] = 1;
return result;
}
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/index.mjs
var t = {
borderWidths: toConfig("borderWidths"),
borderStyles: toConfig("borderStyles"),
colors: toConfig("colors"),
borders: toConfig("borders"),
gradients: toConfig("gradients", transformFunctions.gradient),
radii: toConfig("radii", transformFunctions.px),
space: toConfig("space", pipe2(transformFunctions.vh, transformFunctions.px)),
spaceT: toConfig("space", pipe2(transformFunctions.vh, transformFunctions.px)),
degreeT(property) {
return { property, transform: transformFunctions.degree };
},
prop(property, scale3, transform3) {
return {
property,
scale: scale3,
...scale3 && {
transform: createTransform({ scale: scale3, transform: transform3 })
}
};
},
propT(property, transform3) {
return { property, transform: transform3 };
},
sizes: toConfig("sizes", pipe2(transformFunctions.vh, transformFunctions.px)),
sizesT: toConfig("sizes", pipe2(transformFunctions.vh, transformFunctions.fraction)),
shadows: toConfig("shadows"),
logical,
blur: toConfig("blur", transformFunctions.blur)
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/background.mjs
var background = {
background: t.colors("background"),
backgroundColor: t.colors("backgroundColor"),
backgroundImage: t.gradients("backgroundImage"),
backgroundSize: true,
backgroundPosition: true,
backgroundRepeat: true,
backgroundAttachment: true,
backgroundClip: { transform: transformFunctions.bgClip },
bgSize: t.prop("backgroundSize"),
bgPosition: t.prop("backgroundPosition"),
bg: t.colors("background"),
bgColor: t.colors("backgroundColor"),
bgPos: t.prop("backgroundPosition"),
bgRepeat: t.prop("backgroundRepeat"),
bgAttachment: t.prop("backgroundAttachment"),
bgGradient: t.gradients("backgroundImage"),
bgClip: { transform: transformFunctions.bgClip }
};
Object.assign(background, {
bgImage: background.backgroundImage,
bgImg: background.backgroundImage
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/border.mjs
var border = {
border: t.borders("border"),
borderWidth: t.borderWidths("borderWidth"),
borderStyle: t.borderStyles("borderStyle"),
borderColor: t.colors("borderColor"),
borderRadius: t.radii("borderRadius"),
borderTop: t.borders("borderTop"),
borderBlockStart: t.borders("borderBlockStart"),
borderTopLeftRadius: t.radii("borderTopLeftRadius"),
borderStartStartRadius: t.logical({
scale: "radii",
property: {
ltr: "borderTopLeftRadius",
rtl: "borderTopRightRadius"
}
}),
borderEndStartRadius: t.logical({
scale: "radii",
property: {
ltr: "borderBottomLeftRadius",
rtl: "borderBottomRightRadius"
}
}),
borderTopRightRadius: t.radii("borderTopRightRadius"),
borderStartEndRadius: t.logical({
scale: "radii",
property: {
ltr: "borderTopRightRadius",
rtl: "borderTopLeftRadius"
}
}),
borderEndEndRadius: t.logical({
scale: "radii",
property: {
ltr: "borderBottomRightRadius",
rtl: "borderBottomLeftRadius"
}
}),
borderRight: t.borders("borderRight"),
borderInlineEnd: t.borders("borderInlineEnd"),
borderBottom: t.borders("borderBottom"),
borderBlockEnd: t.borders("borderBlockEnd"),
borderBottomLeftRadius: t.radii("borderBottomLeftRadius"),
borderBottomRightRadius: t.radii("borderBottomRightRadius"),
borderLeft: t.borders("borderLeft"),
borderInlineStart: {
property: "borderInlineStart",
scale: "borders"
},
borderInlineStartRadius: t.logical({
scale: "radii",
property: {
ltr: ["borderTopLeftRadius", "borderBottomLeftRadius"],
rtl: ["borderTopRightRadius", "borderBottomRightRadius"]
}
}),
borderInlineEndRadius: t.logical({
scale: "radii",
property: {
ltr: ["borderTopRightRadius", "borderBottomRightRadius"],
rtl: ["borderTopLeftRadius", "borderBottomLeftRadius"]
}
}),
borderX: t.borders(["borderLeft", "borderRight"]),
borderInline: t.borders("borderInline"),
borderY: t.borders(["borderTop", "borderBottom"]),
borderBlock: t.borders("borderBlock"),
borderTopWidth: t.borderWidths("borderTopWidth"),
borderBlockStartWidth: t.borderWidths("borderBlockStartWidth"),
borderTopColor: t.colors("borderTopColor"),
borderBlockStartColor: t.colors("borderBlockStartColor"),
borderTopStyle: t.borderStyles("borderTopStyle"),
borderBlockStartStyle: t.borderStyles("borderBlockStartStyle"),
borderBottomWidth: t.borderWidths("borderBottomWidth"),
borderBlockEndWidth: t.borderWidths("borderBlockEndWidth"),
borderBottomColor: t.colors("borderBottomColor"),
borderBlockEndColor: t.colors("borderBlockEndColor"),
borderBottomStyle: t.borderStyles("borderBottomStyle"),
borderBlockEndStyle: t.borderStyles("borderBlockEndStyle"),
borderLeftWidth: t.borderWidths("borderLeftWidth"),
borderInlineStartWidth: t.borderWidths("borderInlineStartWidth"),
borderLeftColor: t.colors("borderLeftColor"),
borderInlineStartColor: t.colors("borderInlineStartColor"),
borderLeftStyle: t.borderStyles("borderLeftStyle"),
borderInlineStartStyle: t.borderStyles("borderInlineStartStyle"),
borderRightWidth: t.borderWidths("borderRightWidth"),
borderInlineEndWidth: t.borderWidths("borderInlineEndWidth"),
borderRightColor: t.colors("borderRightColor"),
borderInlineEndColor: t.colors("borderInlineEndColor"),
borderRightStyle: t.borderStyles("borderRightStyle"),
borderInlineEndStyle: t.borderStyles("borderInlineEndStyle"),
borderTopRadius: t.radii(["borderTopLeftRadius", "borderTopRightRadius"]),
borderBottomRadius: t.radii([
"borderBottomLeftRadius",
"borderBottomRightRadius"
]),
borderLeftRadius: t.radii(["borderTopLeftRadius", "borderBottomLeftRadius"]),
borderRightRadius: t.radii([
"borderTopRightRadius",
"borderBottomRightRadius"
])
};
Object.assign(border, {
rounded: border.borderRadius,
roundedTop: border.borderTopRadius,
roundedTopLeft: border.borderTopLeftRadius,
roundedTopRight: border.borderTopRightRadius,
roundedTopStart: border.borderStartStartRadius,
roundedTopEnd: border.borderStartEndRadius,
roundedBottom: border.borderBottomRadius,
roundedBottomLeft: border.borderBottomLeftRadius,
roundedBottomRight: border.borderBottomRightRadius,
roundedBottomStart: border.borderEndStartRadius,
roundedBottomEnd: border.borderEndEndRadius,
roundedLeft: border.borderLeftRadius,
roundedRight: border.borderRightRadius,
roundedStart: border.borderInlineStartRadius,
roundedEnd: border.borderInlineEndRadius,
borderStart: border.borderInlineStart,
borderEnd: border.borderInlineEnd,
borderTopStartRadius: border.borderStartStartRadius,
borderTopEndRadius: border.borderStartEndRadius,
borderBottomStartRadius: border.borderEndStartRadius,
borderBottomEndRadius: border.borderEndEndRadius,
borderStartRadius: border.borderInlineStartRadius,
borderEndRadius: border.borderInlineEndRadius,
borderStartWidth: border.borderInlineStartWidth,
borderEndWidth: border.borderInlineEndWidth,
borderStartColor: border.borderInlineStartColor,
borderEndColor: border.borderInlineEndColor,
borderStartStyle: border.borderInlineStartStyle,
borderEndStyle: border.borderInlineEndStyle
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/color.mjs
var color = {
color: t.colors("color"),
textColor: t.colors("color"),
fill: t.colors("fill"),
stroke: t.colors("stroke"),
accentColor: t.colors("accentColor"),
textFillColor: t.colors("textFillColor")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/flexbox.mjs
var flexbox = {
alignItems: true,
alignContent: true,
justifyItems: true,
justifyContent: true,
flexWrap: true,
flexDirection: { transform: transformFunctions.flexDirection },
flex: true,
flexFlow: true,
flexGrow: true,
flexShrink: true,
flexBasis: t.sizes("flexBasis"),
justifySelf: true,
alignSelf: true,
order: true,
placeItems: true,
placeContent: true,
placeSelf: true,
gap: t.space("gap"),
rowGap: t.space("rowGap"),
columnGap: t.space("columnGap")
};
Object.assign(flexbox, {
flexDir: flexbox.flexDirection
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/layout.mjs
var layout = {
width: t.sizesT("width"),
inlineSize: t.sizesT("inlineSize"),
height: t.sizes("height"),
blockSize: t.sizes("blockSize"),
boxSize: t.sizes(["width", "height"]),
minWidth: t.sizes("minWidth"),
minInlineSize: t.sizes("minInlineSize"),
minHeight: t.sizes("minHeight"),
minBlockSize: t.sizes("minBlockSize"),
maxWidth: t.sizes("maxWidth"),
maxInlineSize: t.sizes("maxInlineSize"),
maxHeight: t.sizes("maxHeight"),
maxBlockSize: t.sizes("maxBlockSize"),
overflow: true,
overflowX: true,
overflowY: true,
overscrollBehavior: true,
overscrollBehaviorX: true,
overscrollBehaviorY: true,
display: true,
aspectRatio: true,
hideFrom: {
scale: "breakpoints",
transform: (value, theme2) => {
var _a8, _b3;
const breakpoint = ((_b3 = (_a8 = theme2.__breakpoints) == null ? void 0 : _a8.get(value)) == null ? void 0 : _b3.minW) ?? value;
const mq = `@media screen and (min-width: ${breakpoint})`;
return { [mq]: { display: "none" } };
}
},
hideBelow: {
scale: "breakpoints",
transform: (value, theme2) => {
var _a8, _b3;
const breakpoint = ((_b3 = (_a8 = theme2.__breakpoints) == null ? void 0 : _a8.get(value)) == null ? void 0 : _b3._minW) ?? value;
const mq = `@media screen and (max-width: ${breakpoint})`;
return { [mq]: { display: "none" } };
}
},
verticalAlign: true,
boxSizing: true,
boxDecorationBreak: true,
float: t.propT("float", transformFunctions.float),
objectFit: true,
objectPosition: true,
visibility: true,
isolation: true
};
Object.assign(layout, {
w: layout.width,
h: layout.height,
minW: layout.minWidth,
maxW: layout.maxWidth,
minH: layout.minHeight,
maxH: layout.maxHeight,
overscroll: layout.overscrollBehavior,
overscrollX: layout.overscrollBehaviorX,
overscrollY: layout.overscrollBehaviorY
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/filter.mjs
var filter2 = {
filter: { transform: transformFunctions.filter },
blur: t.blur("--chakra-blur"),
brightness: t.propT("--chakra-brightness", transformFunctions.brightness),
contrast: t.propT("--chakra-contrast", transformFunctions.contrast),
hueRotate: t.propT("--chakra-hue-rotate", transformFunctions.hueRotate),
invert: t.propT("--chakra-invert", transformFunctions.invert),
saturate: t.propT("--chakra-saturate", transformFunctions.saturate),
dropShadow: t.propT("--chakra-drop-shadow", transformFunctions.dropShadow),
backdropFilter: { transform: transformFunctions.backdropFilter },
backdropBlur: t.blur("--chakra-backdrop-blur"),
backdropBrightness: t.propT(
"--chakra-backdrop-brightness",
transformFunctions.brightness
),
backdropContrast: t.propT("--chakra-backdrop-contrast", transformFunctions.contrast),
backdropHueRotate: t.propT(
"--chakra-backdrop-hue-rotate",
transformFunctions.hueRotate
),
backdropInvert: t.propT("--chakra-backdrop-invert", transformFunctions.invert),
backdropSaturate: t.propT("--chakra-backdrop-saturate", transformFunctions.saturate)
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/ring.mjs
var ring = {
ring: { transform: transformFunctions.ring },
ringColor: t.colors("--chakra-ring-color"),
ringOffset: t.prop("--chakra-ring-offset-width"),
ringOffsetColor: t.colors("--chakra-ring-offset-color"),
ringInset: t.prop("--chakra-ring-inset")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/interactivity.mjs
var interactivity = {
appearance: true,
cursor: true,
resize: true,
userSelect: true,
pointerEvents: true,
outline: { transform: transformFunctions.outline },
outlineOffset: true,
outlineColor: t.colors("outlineColor")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/grid.mjs
var grid = {
gridGap: t.space("gridGap"),
gridColumnGap: t.space("gridColumnGap"),
gridRowGap: t.space("gridRowGap"),
gridColumn: true,
gridRow: true,
gridAutoFlow: true,
gridAutoColumns: true,
gridColumnStart: true,
gridColumnEnd: true,
gridRowStart: true,
gridRowEnd: true,
gridAutoRows: true,
gridTemplate: true,
gridTemplateColumns: true,
gridTemplateRows: true,
gridTemplateAreas: true,
gridArea: true
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/get.mjs
function get2(obj, path, fallback, index2) {
const key = typeof path === "string" ? path.split(".") : [path];
for (index2 = 0; index2 < key.length; index2 += 1) {
if (!obj)
break;
obj = obj[key[index2]];
}
return obj === void 0 ? fallback : obj;
}
var memoize2 = (fn2) => {
const cache = /* @__PURE__ */ new WeakMap();
const memoizedFn = (obj, path, fallback, index2) => {
if (typeof obj === "undefined") {
return fn2(obj, path, fallback);
}
if (!cache.has(obj)) {
cache.set(obj, /* @__PURE__ */ new Map());
}
const map = cache.get(obj);
if (map.has(path)) {
return map.get(path);
}
const value = fn2(obj, path, fallback, index2);
map.set(path, value);
return value;
};
return memoizedFn;
};
var memoizedGet2 = memoize2(get2);
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/others.mjs
var srOnly = {
border: "0px",
clip: "rect(0, 0, 0, 0)",
width: "1px",
height: "1px",
margin: "-1px",
padding: "0px",
overflow: "hidden",
whiteSpace: "nowrap",
position: "absolute"
};
var srFocusable = {
position: "static",
width: "auto",
height: "auto",
clip: "auto",
padding: "0",
margin: "0",
overflow: "visible",
whiteSpace: "normal"
};
var getWithPriority = (theme2, key, styles2) => {
const result = {};
const obj = memoizedGet2(theme2, key, {});
for (const prop in obj) {
const isInStyles = prop in styles2 && styles2[prop] != null;
if (!isInStyles)
result[prop] = obj[prop];
}
return result;
};
var others = {
srOnly: {
transform(value) {
if (value === true)
return srOnly;
if (value === "focusable")
return srFocusable;
return {};
}
},
layerStyle: {
processResult: true,
transform: (value, theme2, styles2) => getWithPriority(theme2, `layerStyles.${value}`, styles2)
},
textStyle: {
processResult: true,
transform: (value, theme2, styles2) => getWithPriority(theme2, `textStyles.${value}`, styles2)
},
apply: {
processResult: true,
transform: (value, theme2, styles2) => getWithPriority(theme2, value, styles2)
}
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/position.mjs
var position = {
position: true,
pos: t.prop("position"),
zIndex: t.prop("zIndex", "zIndices"),
inset: t.spaceT("inset"),
insetX: t.spaceT(["left", "right"]),
insetInline: t.spaceT("insetInline"),
insetY: t.spaceT(["top", "bottom"]),
insetBlock: t.spaceT("insetBlock"),
top: t.spaceT("top"),
insetBlockStart: t.spaceT("insetBlockStart"),
bottom: t.spaceT("bottom"),
insetBlockEnd: t.spaceT("insetBlockEnd"),
left: t.spaceT("left"),
insetInlineStart: t.logical({
scale: "space",
property: { ltr: "left", rtl: "right" }
}),
right: t.spaceT("right"),
insetInlineEnd: t.logical({
scale: "space",
property: { ltr: "right", rtl: "left" }
})
};
Object.assign(position, {
insetStart: position.insetInlineStart,
insetEnd: position.insetInlineEnd
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/effect.mjs
var effect = {
boxShadow: t.shadows("boxShadow"),
mixBlendMode: true,
blendMode: t.prop("mixBlendMode"),
backgroundBlendMode: true,
bgBlendMode: t.prop("backgroundBlendMode"),
opacity: true
};
Object.assign(effect, {
shadow: effect.boxShadow
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/space.mjs
var space = {
margin: t.spaceT("margin"),
marginTop: t.spaceT("marginTop"),
marginBlockStart: t.spaceT("marginBlockStart"),
marginRight: t.spaceT("marginRight"),
marginInlineEnd: t.spaceT("marginInlineEnd"),
marginBottom: t.spaceT("marginBottom"),
marginBlockEnd: t.spaceT("marginBlockEnd"),
marginLeft: t.spaceT("marginLeft"),
marginInlineStart: t.spaceT("marginInlineStart"),
marginX: t.spaceT(["marginInlineStart", "marginInlineEnd"]),
marginInline: t.spaceT("marginInline"),
marginY: t.spaceT(["marginTop", "marginBottom"]),
marginBlock: t.spaceT("marginBlock"),
padding: t.space("padding"),
paddingTop: t.space("paddingTop"),
paddingBlockStart: t.space("paddingBlockStart"),
paddingRight: t.space("paddingRight"),
paddingBottom: t.space("paddingBottom"),
paddingBlockEnd: t.space("paddingBlockEnd"),
paddingLeft: t.space("paddingLeft"),
paddingInlineStart: t.space("paddingInlineStart"),
paddingInlineEnd: t.space("paddingInlineEnd"),
paddingX: t.space(["paddingInlineStart", "paddingInlineEnd"]),
paddingInline: t.space("paddingInline"),
paddingY: t.space(["paddingTop", "paddingBottom"]),
paddingBlock: t.space("paddingBlock")
};
Object.assign(space, {
m: space.margin,
mt: space.marginTop,
mr: space.marginRight,
me: space.marginInlineEnd,
marginEnd: space.marginInlineEnd,
mb: space.marginBottom,
ml: space.marginLeft,
ms: space.marginInlineStart,
marginStart: space.marginInlineStart,
mx: space.marginX,
my: space.marginY,
p: space.padding,
pt: space.paddingTop,
py: space.paddingY,
px: space.paddingX,
pb: space.paddingBottom,
pl: space.paddingLeft,
ps: space.paddingInlineStart,
paddingStart: space.paddingInlineStart,
pr: space.paddingRight,
pe: space.paddingInlineEnd,
paddingEnd: space.paddingInlineEnd
});
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/scroll.mjs
var scroll = {
scrollBehavior: true,
scrollSnapAlign: true,
scrollSnapStop: true,
scrollSnapType: true,
// scroll margin
scrollMargin: t.spaceT("scrollMargin"),
scrollMarginTop: t.spaceT("scrollMarginTop"),
scrollMarginBottom: t.spaceT("scrollMarginBottom"),
scrollMarginLeft: t.spaceT("scrollMarginLeft"),
scrollMarginRight: t.spaceT("scrollMarginRight"),
scrollMarginX: t.spaceT(["scrollMarginLeft", "scrollMarginRight"]),
scrollMarginY: t.spaceT(["scrollMarginTop", "scrollMarginBottom"]),
// scroll padding
scrollPadding: t.spaceT("scrollPadding"),
scrollPaddingTop: t.spaceT("scrollPaddingTop"),
scrollPaddingBottom: t.spaceT("scrollPaddingBottom"),
scrollPaddingLeft: t.spaceT("scrollPaddingLeft"),
scrollPaddingRight: t.spaceT("scrollPaddingRight"),
scrollPaddingX: t.spaceT(["scrollPaddingLeft", "scrollPaddingRight"]),
scrollPaddingY: t.spaceT(["scrollPaddingTop", "scrollPaddingBottom"])
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/typography.mjs
var typography = {
fontFamily: t.prop("fontFamily", "fonts"),
fontSize: t.prop("fontSize", "fontSizes", transformFunctions.px),
fontWeight: t.prop("fontWeight", "fontWeights"),
lineHeight: t.prop("lineHeight", "lineHeights"),
letterSpacing: t.prop("letterSpacing", "letterSpacings"),
textAlign: true,
fontStyle: true,
textIndent: true,
wordBreak: true,
overflowWrap: true,
textOverflow: true,
textTransform: true,
whiteSpace: true,
isTruncated: {
transform(value) {
if (value === true) {
return {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
};
}
}
},
noOfLines: {
static: {
overflow: "hidden",
textOverflow: "ellipsis",
display: "-webkit-box",
WebkitBoxOrient: "vertical",
//@ts-ignore
WebkitLineClamp: "var(--chakra-line-clamp)"
},
property: "--chakra-line-clamp"
}
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/text-decoration.mjs
var textDecoration = {
textDecorationColor: t.colors("textDecorationColor"),
textDecoration: true,
textDecor: { property: "textDecoration" },
textDecorationLine: true,
textDecorationStyle: true,
textDecorationThickness: true,
textUnderlineOffset: true,
textShadow: t.shadows("textShadow")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/transform.mjs
var transform = {
clipPath: true,
transform: t.propT("transform", transformFunctions.transform),
transformOrigin: true,
translateX: t.spaceT("--chakra-translate-x"),
translateY: t.spaceT("--chakra-translate-y"),
skewX: t.degreeT("--chakra-skew-x"),
skewY: t.degreeT("--chakra-skew-y"),
scaleX: t.prop("--chakra-scale-x"),
scaleY: t.prop("--chakra-scale-y"),
scale: t.prop(["--chakra-scale-x", "--chakra-scale-y"]),
rotate: t.degreeT("--chakra-rotate")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/list.mjs
var list = {
listStyleType: true,
listStylePosition: true,
listStylePos: t.prop("listStylePosition"),
listStyleImage: true,
listStyleImg: t.prop("listStyleImage")
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/config/transition.mjs
var transition = {
transition: true,
transitionDelay: true,
animation: true,
willChange: true,
transitionDuration: t.prop("transitionDuration", "transition.duration"),
transitionProperty: t.prop("transitionProperty", "transition.property"),
transitionTimingFunction: t.prop(
"transitionTimingFunction",
"transition.easing"
)
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/system.mjs
var systemProps = (0, import_lodash.default)(
{},
background,
border,
color,
flexbox,
layout,
filter2,
ring,
interactivity,
grid,
others,
position,
effect,
space,
scroll,
typography,
textDecoration,
transform,
list,
transition
);
var layoutSystem = Object.assign({}, space, layout, flexbox, grid, position);
var layoutPropNames = Object.keys(
layoutSystem
);
var propNames = [...Object.keys(systemProps), ...pseudoPropNames];
var styleProps = { ...systemProps, ...pseudoSelectors };
var isStyleProp = (prop) => prop in styleProps;
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/expand-responsive.mjs
var expandResponsive = (styles2) => (theme2) => {
if (!theme2.__breakpoints)
return styles2;
const { isResponsive, toArrayValue, media: medias } = theme2.__breakpoints;
const computedStyles = {};
for (const key in styles2) {
let value = runIfFn(styles2[key], theme2);
if (value == null)
continue;
value = isObject(value) && isResponsive(value) ? toArrayValue(value) : value;
if (!Array.isArray(value)) {
computedStyles[key] = value;
continue;
}
const queries = value.slice(0, medias.length).length;
for (let index2 = 0; index2 < queries; index2 += 1) {
const media = medias == null ? void 0 : medias[index2];
if (!media) {
computedStyles[key] = value[index2];
continue;
}
computedStyles[media] = computedStyles[media] || {};
if (value[index2] == null) {
continue;
}
computedStyles[media][key] = value[index2];
}
}
return computedStyles;
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/utils/split-by-comma.mjs
function splitByComma(value) {
const chunks = [];
let chunk = "";
let inParens = false;
for (let i = 0; i < value.length; i++) {
const char2 = value[i];
if (char2 === "(") {
inParens = true;
chunk += char2;
} else if (char2 === ")") {
inParens = false;
chunk += char2;
} else if (char2 === "," && !inParens) {
chunks.push(chunk);
chunk = "";
} else {
chunk += char2;
}
}
chunk = chunk.trim();
if (chunk) {
chunks.push(chunk);
}
return chunks;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/css.mjs
function isCssVar3(value) {
return /^var\(--.+\)$/.test(value);
}
var isCSSVariableTokenValue = (key, value) => key.startsWith("--") && typeof value === "string" && !isCssVar3(value);
var resolveTokenValue = (theme2, value) => {
if (value == null)
return value;
const getVar = (val) => {
var _a8, _b3;
return (_b3 = (_a8 = theme2.__cssMap) == null ? void 0 : _a8[val]) == null ? void 0 : _b3.varRef;
};
const getValue2 = (val) => getVar(val) ?? val;
const [tokenValue, fallbackValue] = splitByComma(value);
value = getVar(tokenValue) ?? getValue2(fallbackValue) ?? getValue2(value);
return value;
};
function getCss(options) {
const { configs = {}, pseudos = {}, theme: theme2 } = options;
const css22 = (stylesOrFn, nested = false) => {
var _a8;
const _styles = runIfFn(stylesOrFn, theme2);
const styles2 = expandResponsive(_styles)(theme2);
let computedStyles = {};
for (let key in styles2) {
const valueOrFn = styles2[key];
let value = runIfFn(valueOrFn, theme2);
if (key in pseudos) {
key = pseudos[key];
}
if (isCSSVariableTokenValue(key, value)) {
value = resolveTokenValue(theme2, value);
}
let config2 = configs[key];
if (config2 === true) {
config2 = { property: key };
}
if (isObject(value)) {
computedStyles[key] = computedStyles[key] ?? {};
computedStyles[key] = (0, import_lodash.default)(
{},
computedStyles[key],
css22(value, true)
);
continue;
}
let rawValue = ((_a8 = config2 == null ? void 0 : config2.transform) == null ? void 0 : _a8.call(config2, value, theme2, _styles)) ?? value;
rawValue = (config2 == null ? void 0 : config2.processResult) ? css22(rawValue, true) : rawValue;
const configProperty = runIfFn(config2 == null ? void 0 : config2.property, theme2);
if (!nested && (config2 == null ? void 0 : config2.static)) {
const staticStyles = runIfFn(config2.static, theme2);
computedStyles = (0, import_lodash.default)({}, computedStyles, staticStyles);
}
if (configProperty && Array.isArray(configProperty)) {
for (const property of configProperty) {
computedStyles[property] = rawValue;
}
continue;
}
if (configProperty) {
if (configProperty === "&" && isObject(rawValue)) {
computedStyles = (0, import_lodash.default)({}, computedStyles, rawValue);
} else {
computedStyles[configProperty] = rawValue;
}
continue;
}
if (isObject(rawValue)) {
computedStyles = (0, import_lodash.default)({}, computedStyles, rawValue);
continue;
}
computedStyles[key] = rawValue;
}
return computedStyles;
};
return css22;
}
var css = (styles2) => (theme2) => {
const cssFn = getCss({
theme: theme2,
pseudos: pseudoSelectors,
configs: systemProps
});
return cssFn(styles2);
};
// ../../node_modules/@chakra-ui/styled-system/dist/esm/define-styles.mjs
function defineStyle(styles2) {
return styles2;
}
function defineStyleConfig(config2) {
return config2;
}
function createMultiStyleConfigHelpers(parts) {
return {
definePartsStyle(config2) {
return config2;
},
defineMultiStyleConfig(config2) {
return { parts, ...config2 };
}
};
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/get-css-var.mjs
function getCSSVar(theme2, scale3, value) {
var _a8, _b3;
return ((_b3 = (_a8 = theme2.__cssMap) == null ? void 0 : _a8[`${scale3}.${value}`]) == null ? void 0 : _b3.varRef) ?? value;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/style-config.mjs
function normalize2(value, toArray3) {
if (Array.isArray(value))
return value;
if (isObject(value))
return toArray3(value);
if (value != null)
return [value];
}
function getNextIndex(values, i) {
for (let j = i + 1; j < values.length; j++) {
if (values[j] != null)
return j;
}
return -1;
}
function createResolver(theme2) {
const breakpointUtil = theme2.__breakpoints;
return function resolver(config2, prop, value, props) {
var _a8, _b3;
if (!breakpointUtil)
return;
const result = {};
const normalized = normalize2(value, breakpointUtil.toArrayValue);
if (!normalized)
return result;
const len = normalized.length;
const isSingle = len === 1;
const isMultipart = !!config2.parts;
for (let i = 0; i < len; i++) {
const key = breakpointUtil.details[i];
const nextKey = breakpointUtil.details[getNextIndex(normalized, i)];
const query = toMediaQueryString(key.minW, nextKey == null ? void 0 : nextKey._minW);
const styles2 = runIfFn((_a8 = config2[prop]) == null ? void 0 : _a8[normalized[i]], props);
if (!styles2)
continue;
if (isMultipart) {
(_b3 = config2.parts) == null ? void 0 : _b3.forEach((part) => {
(0, import_lodash.default)(result, {
[part]: isSingle ? styles2[part] : { [query]: styles2[part] }
});
});
continue;
}
if (!isMultipart) {
if (isSingle)
(0, import_lodash.default)(result, styles2);
else
result[query] = styles2;
continue;
}
result[query] = styles2;
}
return result;
};
}
function resolveStyleConfig(config2) {
return (props) => {
const { variant, size: size2, theme: theme2 } = props;
const recipe = createResolver(theme2);
return (0, import_lodash.default)(
{},
runIfFn(config2.baseStyle ?? {}, props),
recipe(config2, "sizes", size2, props),
recipe(config2, "variants", variant, props)
);
};
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/theming-props.mjs
function omitThemingProps(props) {
return omit(props, ["styleConfig", "size", "variant", "colorScheme"]);
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/calc.mjs
function resolveReference(operand) {
if (isObject(operand) && operand.reference) {
return operand.reference;
}
return String(operand);
}
var toExpression = (operator, ...operands) => operands.map(resolveReference).join(` ${operator} `).replace(/calc/g, "");
var add = (...operands) => `calc(${toExpression("+", ...operands)})`;
var subtract3 = (...operands) => `calc(${toExpression("-", ...operands)})`;
var multiply = (...operands) => `calc(${toExpression("*", ...operands)})`;
var divide = (...operands) => `calc(${toExpression("/", ...operands)})`;
var negate = (x) => {
const value = resolveReference(x);
if (value != null && !Number.isNaN(parseFloat(value))) {
return String(value).startsWith("-") ? String(value).slice(1) : `-${value}`;
}
return multiply(value, -1);
};
var calc = Object.assign(
(x) => ({
add: (...operands) => calc(add(x, ...operands)),
subtract: (...operands) => calc(subtract3(x, ...operands)),
multiply: (...operands) => calc(multiply(x, ...operands)),
divide: (...operands) => calc(divide(x, ...operands)),
negate: () => calc(negate(x)),
toString: () => x.toString()
}),
{
add,
subtract: subtract3,
multiply,
divide,
negate
}
);
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/css-var.mjs
function replaceWhiteSpace(value, replaceValue = "-") {
return value.replace(/\s+/g, replaceValue);
}
function escape(value) {
const valueStr = replaceWhiteSpace(value.toString());
return escapeSymbol(escapeDot(valueStr));
}
function escapeDot(value) {
if (value.includes("\\."))
return value;
const isDecimal2 = !Number.isInteger(parseFloat(value.toString()));
return isDecimal2 ? value.replace(".", `\\.`) : value;
}
function escapeSymbol(value) {
return value.replace(/[!-,/:-@[-^`{-~]/g, "\\$&");
}
function addPrefix(value, prefix3 = "") {
return [prefix3, value].filter(Boolean).join("-");
}
function toVarReference(name, fallback) {
return `var(${name}${fallback ? `, ${fallback}` : ""})`;
}
function toVarDefinition(value, prefix3 = "") {
return escape(`--${addPrefix(value, prefix3)}`);
}
function cssVar(name, fallback, cssVarPrefix) {
const cssVariable = toVarDefinition(name, cssVarPrefix);
return {
variable: cssVariable,
reference: toVarReference(cssVariable, fallback)
};
}
function defineCssVars(scope, keys2) {
const vars2 = {};
for (const key of keys2) {
if (Array.isArray(key)) {
const [name, fallback] = key;
vars2[name] = cssVar(`${scope}-${name}`, fallback);
continue;
}
vars2[key] = cssVar(`${scope}-${key}`);
}
return vars2;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/theme-tokens.mjs
var tokens = [
"colors",
"borders",
"borderWidths",
"borderStyles",
"fonts",
"fontSizes",
"fontWeights",
"gradients",
"letterSpacings",
"lineHeights",
"radii",
"space",
"shadows",
"sizes",
"zIndices",
"transition",
"blur",
"breakpoints"
];
function extractTokens(theme2) {
const _tokens = tokens;
return pick(theme2, _tokens);
}
function extractSemanticTokens(theme2) {
return theme2.semanticTokens;
}
function omitVars(rawTheme) {
const { __cssMap, __cssVars, __breakpoints, ...cleanTheme } = rawTheme;
return cleanTheme;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/flatten-tokens.mjs
function flattenTokens(theme2) {
const tokens2 = extractTokens(theme2);
const semanticTokens2 = extractSemanticTokens(theme2);
const isSemanticCondition = (key) => (
// @ts-ignore
pseudoPropNames.includes(key) || "default" === key
);
const result = {};
walkObject(tokens2, (value, path) => {
if (value == null)
return;
result[path.join(".")] = { isSemantic: false, value };
});
walkObject(
semanticTokens2,
(value, path) => {
if (value == null)
return;
result[path.join(".")] = { isSemantic: true, value };
},
{
stop: (value) => Object.keys(value).every(isSemanticCondition)
}
);
return result;
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/create-theme-vars.mjs
function tokenToCssVar(token2, prefix3) {
return cssVar(String(token2).replace(/\./g, "-"), void 0, prefix3);
}
function createThemeVars(theme2) {
var _a8;
const flatTokens = flattenTokens(theme2);
const cssVarPrefix = (_a8 = theme2.config) == null ? void 0 : _a8.cssVarPrefix;
let cssVars2 = {};
const cssMap = {};
function lookupToken(token2, maybeToken) {
const scale3 = String(token2).split(".")[0];
const withScale = [scale3, maybeToken].join(".");
const resolvedTokenValue = flatTokens[withScale];
if (!resolvedTokenValue)
return maybeToken;
const { reference: reference2 } = tokenToCssVar(withScale, cssVarPrefix);
return reference2;
}
for (const [token2, tokenValue] of Object.entries(flatTokens)) {
const { isSemantic, value } = tokenValue;
const { variable, reference: reference2 } = tokenToCssVar(token2, cssVarPrefix);
if (!isSemantic) {
if (token2.startsWith("space")) {
const keys2 = token2.split(".");
const [firstKey, ...referenceKeys] = keys2;
const negativeLookupKey = `${firstKey}.-${referenceKeys.join(".")}`;
const negativeValue = calc.negate(value);
const negatedReference = calc.negate(reference2);
cssMap[negativeLookupKey] = {
value: negativeValue,
var: variable,
varRef: negatedReference
};
}
cssVars2[variable] = value;
cssMap[token2] = {
value,
var: variable,
varRef: reference2
};
continue;
}
const normalizedValue = isObject(value) ? value : { default: value };
cssVars2 = (0, import_lodash.default)(
cssVars2,
Object.entries(normalizedValue).reduce(
(acc, [conditionAlias, conditionValue]) => {
var _a9;
if (!conditionValue)
return acc;
const tokenReference = lookupToken(token2, `${conditionValue}`);
if (conditionAlias === "default") {
acc[variable] = tokenReference;
return acc;
}
const conditionSelector = ((_a9 = pseudoSelectors) == null ? void 0 : _a9[conditionAlias]) ?? conditionAlias;
acc[conditionSelector] = { [variable]: tokenReference };
return acc;
},
{}
)
);
cssMap[token2] = {
value: reference2,
var: variable,
varRef: reference2
};
}
return {
cssVars: cssVars2,
cssMap
};
}
// ../../node_modules/@chakra-ui/styled-system/dist/esm/create-theme-vars/to-css-var.mjs
function toCSSVar(rawTheme) {
const theme2 = omitVars(rawTheme);
const {
/**
* This is more like a dictionary of tokens users will type `green.500`,
* and their equivalent css variable.
*/
cssMap,
/**
* The extracted css variables will be stored here, and used in
* the emotion's component to attach variables to `:root`
*/
cssVars: cssVars2
} = createThemeVars(theme2);
const defaultCssVars = {
"--chakra-ring-inset": "var(--chakra-empty,/*!*/ /*!*/)",
"--chakra-ring-offset-width": "0px",
"--chakra-ring-offset-color": "#fff",
"--chakra-ring-color": "rgba(66, 153, 225, 0.6)",
"--chakra-ring-offset-shadow": "0 0 #0000",
"--chakra-ring-shadow": "0 0 #0000",
"--chakra-space-x-reverse": "0",
"--chakra-space-y-reverse": "0"
};
Object.assign(theme2, {
__cssVars: { ...defaultCssVars, ...cssVars2 },
__cssMap: cssMap,
__breakpoints: analyzeBreakpoints(theme2.breakpoints)
});
return theme2;
}
// ../../node_modules/@chakra-ui/anatomy/dist/esm/create-anatomy.mjs
function anatomy(name, map = {}) {
let called = false;
function assert() {
if (!called) {
called = true;
return;
}
throw new Error(
"[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?"
);
}
function parts(...values) {
assert();
for (const part of values) {
map[part] = toPart(part);
}
return anatomy(name, map);
}
function extend(...parts2) {
for (const part of parts2) {
if (part in map)
continue;
map[part] = toPart(part);
}
return anatomy(name, map);
}
function selectors() {
const value = Object.fromEntries(
Object.entries(map).map(([key, part]) => [key, part.selector])
);
return value;
}
function classnames3() {
const value = Object.fromEntries(
Object.entries(map).map(([key, part]) => [key, part.className])
);
return value;
}
function toPart(part) {
const el = ["container", "root"].includes(part ?? "") ? [name] : [name, part];
const attr = el.filter(Boolean).join("__");
const className = `chakra-${attr}`;
const partObj = {
className,
selector: `.${className}`,
toString: () => part
};
return partObj;
}
const __type = {};
return {
parts,
toPart,
extend,
selectors,
classnames: classnames3,
get keys() {
return Object.keys(map);
},
__type
};
}
// ../../node_modules/@chakra-ui/anatomy/dist/esm/components.mjs
var accordionAnatomy = anatomy("accordion").parts(
"root",
"container",
"button",
"panel",
"icon"
);
var alertAnatomy = anatomy("alert").parts(
"title",
"description",
"container",
"icon",
"spinner"
);
var avatarAnatomy = anatomy("avatar").parts(
"label",
"badge",
"container",
"excessLabel",
"group"
);
var breadcrumbAnatomy = anatomy("breadcrumb").parts(
"link",
"item",
"container",
"separator"
);
var buttonAnatomy = anatomy("button").parts();
var checkboxAnatomy = anatomy("checkbox").parts(
"control",
"icon",
"container",
"label"
);
var circularProgressAnatomy = anatomy("progress").parts(
"track",
"filledTrack",
"label"
);
var drawerAnatomy = anatomy("drawer").parts(
"overlay",
"dialogContainer",
"dialog",
"header",
"closeButton",
"body",
"footer"
);
var editableAnatomy = anatomy("editable").parts(
"preview",
"input",
"textarea"
);
var formAnatomy = anatomy("form").parts(
"container",
"requiredIndicator",
"helperText"
);
var formErrorAnatomy = anatomy("formError").parts("text", "icon");
var inputAnatomy = anatomy("input").parts(
"addon",
"field",
"element",
"group"
);
var listAnatomy = anatomy("list").parts("container", "item", "icon");
var menuAnatomy = anatomy("menu").parts(
"button",
"list",
"item",
"groupTitle",
"icon",
"command",
"divider"
);
var modalAnatomy = anatomy("modal").parts(
"overlay",
"dialogContainer",
"dialog",
"header",
"closeButton",
"body",
"footer"
);
var numberInputAnatomy = anatomy("numberinput").parts(
"root",
"field",
"stepperGroup",
"stepper"
);
var pinInputAnatomy = anatomy("pininput").parts("field");
var popoverAnatomy = anatomy("popover").parts(
"content",
"header",
"body",
"footer",
"popper",
"arrow",
"closeButton"
);
var progressAnatomy = anatomy("progress").parts(
"label",
"filledTrack",
"track"
);
var radioAnatomy = anatomy("radio").parts(
"container",
"control",
"label"
);
var selectAnatomy = anatomy("select").parts("field", "icon");
var sliderAnatomy = anatomy("slider").parts(
"container",
"track",
"thumb",
"filledTrack",
"mark"
);
var statAnatomy = anatomy("stat").parts(
"container",
"label",
"helpText",
"number",
"icon"
);
var switchAnatomy = anatomy("switch").parts(
"container",
"track",
"thumb",
"label"
);
var tableAnatomy = anatomy("table").parts(
"table",
"thead",
"tbody",
"tr",
"th",
"td",
"tfoot",
"caption"
);
var tabsAnatomy = anatomy("tabs").parts(
"root",
"tab",
"tablist",
"tabpanel",
"tabpanels",
"indicator"
);
var tagAnatomy = anatomy("tag").parts(
"container",
"label",
"closeButton"
);
var cardAnatomy = anatomy("card").parts(
"container",
"header",
"body",
"footer"
);
var stepperAnatomy = anatomy("stepper").parts(
"stepper",
"step",
"title",
"description",
"indicator",
"separator",
"icon",
"number"
);
// ../../node_modules/@chakra-ui/theme/dist/esm/components/accordion.mjs
var { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(accordionAnatomy.keys);
var baseStyleContainer = defineStyle({
borderTopWidth: "1px",
borderColor: "inherit",
_last: {
borderBottomWidth: "1px"
}
});
var baseStyleButton = defineStyle({
transitionProperty: "common",
transitionDuration: "normal",
fontSize: "md",
_focusVisible: {
boxShadow: "outline"
},
_hover: {
bg: "blackAlpha.50"
},
_disabled: {
opacity: 0.4,
cursor: "not-allowed"
},
px: "4",
py: "2"
});
var baseStylePanel = defineStyle({
pt: "2",
px: "4",
pb: "5"
});
var baseStyleIcon = defineStyle({
fontSize: "1.25em"
});
var baseStyle = definePartsStyle({
container: baseStyleContainer,
button: baseStyleButton,
panel: baseStylePanel,
icon: baseStyleIcon
});
var accordionTheme = defineMultiStyleConfig({ baseStyle });
// ../../node_modules/color2k/dist/index.exports.import.es.mjs
function guard(low, high, value) {
return Math.min(Math.max(low, value), high);
}
var ColorError = class extends Error {
constructor(color3) {
super(`Failed to parse color: "${color3}"`);
}
};
var ColorError$1 = ColorError;
function parseToRgba(color3) {
if (typeof color3 !== "string") throw new ColorError$1(color3);
if (color3.trim().toLowerCase() === "transparent") return [0, 0, 0, 0];
let normalizedColor = color3.trim();
normalizedColor = namedColorRegex.test(color3) ? nameToHex(color3) : color3;
const reducedHexMatch = reducedHexRegex.exec(normalizedColor);
if (reducedHexMatch) {
const arr = Array.from(reducedHexMatch).slice(1);
return [...arr.slice(0, 3).map((x) => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || "f", 2), 16) / 255];
}
const hexMatch = hexRegex.exec(normalizedColor);
if (hexMatch) {
const arr = Array.from(hexMatch).slice(1);
return [...arr.slice(0, 3).map((x) => parseInt(x, 16)), parseInt(arr[3] || "ff", 16) / 255];
}
const rgbaMatch = rgbaRegex.exec(normalizedColor);
if (rgbaMatch) {
const arr = Array.from(rgbaMatch).slice(1);
return [...arr.slice(0, 3).map((x) => parseInt(x, 10)), parseFloat(arr[3] || "1")];
}
const hslaMatch = hslaRegex.exec(normalizedColor);
if (hslaMatch) {
const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);
if (guard(0, 100, s) !== s) throw new ColorError$1(color3);
if (guard(0, 100, l) !== l) throw new ColorError$1(color3);
return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];
}
throw new ColorError$1(color3);
}
function hash(str) {
let hash5 = 5381;
let i = str.length;
while (i) {
hash5 = hash5 * 33 ^ str.charCodeAt(--i);
}
return (hash5 >>> 0) % 2341;
}
var colorToInt = (x) => parseInt(x.replace(/_/g, ""), 36);
var compressedColorMap = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((acc, next2) => {
const key = colorToInt(next2.substring(0, 3));
const hex2 = colorToInt(next2.substring(3)).toString(16);
let prefix3 = "";
for (let i = 0; i < 6 - hex2.length; i++) {
prefix3 += "0";
}
acc[key] = `${prefix3}${hex2}`;
return acc;
}, {});
function nameToHex(color3) {
const normalizedColorName = color3.toLowerCase().trim();
const result = compressedColorMap[hash(normalizedColorName)];
if (!result) throw new ColorError$1(color3);
return `#${result}`;
}
var r = (str, amount) => Array.from(Array(amount)).map(() => str).join("");
var reducedHexRegex = new RegExp(`^#${r("([a-f0-9])", 3)}([a-f0-9])?$`, "i");
var hexRegex = new RegExp(`^#${r("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i");
var rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r(",\\s*(\\d+)\\s*", 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, "i");
var hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
var namedColorRegex = /^[a-z]+$/i;
var roundColor = (color3) => {
return Math.round(color3 * 255);
};
var hslToRgb = (hue, saturation, lightness) => {
let l = lightness / 100;
if (saturation === 0) {
return [l, l, l].map(roundColor);
}
const huePrime = (hue % 360 + 360) % 360 / 60;
const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);
const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
let red = 0;
let green = 0;
let blue = 0;
if (huePrime >= 0 && huePrime < 1) {
red = chroma;
green = secondComponent;
} else if (huePrime >= 1 && huePrime < 2) {
red = secondComponent;
green = chroma;
} else if (huePrime >= 2 && huePrime < 3) {
green = chroma;
blue = secondComponent;
} else if (huePrime >= 3 && huePrime < 4) {
green = secondComponent;
blue = chroma;
} else if (huePrime >= 4 && huePrime < 5) {
red = secondComponent;
blue = chroma;
} else if (huePrime >= 5 && huePrime < 6) {
red = chroma;
blue = secondComponent;
}
const lightnessModification = l - chroma / 2;
const finalRed = red + lightnessModification;
const finalGreen = green + lightnessModification;
const finalBlue = blue + lightnessModification;
return [finalRed, finalGreen, finalBlue].map(roundColor);
};
function rgba(red, green, blue, alpha2) {
return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha2).toFixed(3))})`;
}
function transparentize(color3, amount) {
const [r2, g, b, a] = parseToRgba(color3);
return rgba(r2, g, b, a - amount);
}
function toHex(color3) {
const [r2, g, b, a] = parseToRgba(color3);
let hex2 = (x) => {
const h = guard(0, 255, x).toString(16);
return h.length === 1 ? `0${h}` : h;
};
return `#${hex2(r2)}${hex2(g)}${hex2(b)}${a < 1 ? hex2(Math.round(a * 255)) : ""}`;
}
// ../../node_modules/@chakra-ui/theme-tools/dist/esm/color.mjs
var isEmptyObject2 = (obj) => Object.keys(obj).length === 0;
function get3(obj, key, def, p, undef) {
key = key.split ? key.split(".") : key;
for (p = 0; p < key.length; p++) {
obj = obj ? obj[key[p]] : undef;
}
return obj === undef ? def : obj;
}
var getColor = (theme2, color3, fallback) => {
const hex2 = get3(theme2, `colors.${color3}`, color3);
try {
toHex(hex2);
return hex2;
} catch {
return fallback ?? "#000000";
}
};
var getBrightness = (color3) => {
const [r2, g, b] = parseToRgba(color3);
return (r2 * 299 + g * 587 + b * 114) / 1e3;
};
var tone = (color3) => (theme2) => {
const hex2 = getColor(theme2, color3);
const brightness = getBrightness(hex2);
const isDark2 = brightness < 128;
return isDark2 ? "dark" : "light";
};
var isDark = (color3) => (theme2) => tone(color3)(theme2) === "dark";
var transparentize2 = (color3, opacity) => (theme2) => {
const raw = getColor(theme2, color3);
return transparentize(raw, 1 - opacity);
};
function generateStripe(size2 = "1rem", color3 = "rgba(255, 255, 255, 0.15)") {
return {
backgroundImage: `linear-gradient(
45deg,
${color3} 25%,
transparent 25%,
transparent 50%,
${color3} 50%,
${color3} 75%,
transparent 75%,
transparent
)`,
backgroundSize: `${size2} ${size2}`
};
}
var randomHex = () => `#${Math.floor(Math.random() * 16777215).toString(16).padEnd(6, "0")}`;
function randomColor(opts) {
const fallback = randomHex();
if (!opts || isEmptyObject2(opts)) {
return fallback;
}
if (opts.string && opts.colors) {
return randomColorFromList(opts.string, opts.colors);
}
if (opts.string && !opts.colors) {
return randomColorFromString(opts.string);
}
if (opts.colors && !opts.string) {
return randomFromList(opts.colors);
}
return fallback;
}
function randomColorFromString(str) {
let hash5 = 0;
if (str.length === 0)
return hash5.toString();
for (let i = 0; i < str.length; i += 1) {
hash5 = str.charCodeAt(i) + ((hash5 << 5) - hash5);
hash5 = hash5 & hash5;
}
let color3 = "#";
for (let j = 0; j < 3; j += 1) {
const value = hash5 >> j * 8 & 255;
color3 += `00${value.toString(16)}`.substr(-2);
}
return color3;
}
function randomColorFromList(str, list2) {
let index2 = 0;
if (str.length === 0)
return list2[0];
for (let i = 0; i < str.length; i += 1) {
index2 = str.charCodeAt(i) + ((index2 << 5) - index2);
index2 = index2 & index2;
}
index2 = (index2 % list2.length + list2.length) % list2.length;
return list2[index2];
}
function randomFromList(list2) {
return list2[Math.floor(Math.random() * list2.length)];
}
// ../../node_modules/@chakra-ui/theme-tools/dist/esm/component.mjs
function mode(light, dark) {
return (props) => props.colorMode === "dark" ? dark : light;
}
function orient(options) {
const { orientation, vertical, horizontal } = options;
if (!orientation)
return {};
return orientation === "vertical" ? vertical : horizontal;
}
// ../../node_modules/@chakra-ui/theme-tools/dist/esm/css-calc.mjs
function toRef(operand) {
if (isObject(operand) && operand.reference) {
return operand.reference;
}
return String(operand);
}
var toExpr = (operator, ...operands) => operands.map(toRef).join(` ${operator} `).replace(/calc/g, "");
var add2 = (...operands) => `calc(${toExpr("+", ...operands)})`;
var subtract4 = (...operands) => `calc(${toExpr("-", ...operands)})`;
var multiply2 = (...operands) => `calc(${toExpr("*", ...operands)})`;
var divide2 = (...operands) => `calc(${toExpr("/", ...operands)})`;
var negate2 = (x) => {
const value = toRef(x);
if (value != null && !Number.isNaN(parseFloat(value))) {
return String(value).startsWith("-") ? String(value).slice(1) : `-${value}`;
}
return multiply2(value, -1);
};
var calc2 = Object.assign(
(x) => ({
add: (...operands) => calc2(add2(x, ...operands)),
subtract: (...operands) => calc2(subtract4(x, ...operands)),
multiply: (...operands) => calc2(multiply2(x, ...operands)),
divide: (...operands) => calc2(divide2(x, ...operands)),
negate: () => calc2(negate2(x)),
toString: () => x.toString()
}),
{
add: add2,
subtract: subtract4,
multiply: multiply2,
divide: divide2,
negate: negate2
}
);
// ../../node_modules/@chakra-ui/theme-tools/dist/esm/css-var.mjs
function isDecimal(value) {
return !Number.isInteger(parseFloat(value.toString()));
}
function replaceWhiteSpace2(value, replaceValue = "-") {
return value.replace(/\s+/g, replaceValue);
}
function escape2(value) {
const valueStr = replaceWhiteSpace2(value.toString());
if (valueStr.includes("\\."))
return value;
return isDecimal(value) ? valueStr.replace(".", `\\.`) : value;
}
function addPrefix2(value, prefix3 = "") {
return [prefix3, escape2(value)].filter(Boolean).join("-");
}
function toVarRef(name, fallback) {
return `var(${escape2(name)}${fallback ? `, ${fallback}` : ""})`;
}
function toVar(value, prefix3 = "") {
return `--${addPrefix2(value, prefix3)}`;
}
function cssVar2(name, options) {
const cssVariable = toVar(name, options == null ? void 0 : options.prefix);
return {
variable: cssVariable,
reference: toVarRef(cssVariable, getFallback(options == null ? void 0 : options.fallback))
};
}
function getFallback(fallback) {
if (typeof fallback === "string")
return fallback;
return fallback == null ? void 0 : fallback.reference;
}
// ../../node_modules/@chakra-ui/theme/dist/esm/components/alert.mjs
var { definePartsStyle: definePartsStyle2, defineMultiStyleConfig: defineMultiStyleConfig2 } = createMultiStyleConfigHelpers(alertAnatomy.keys);
var $fg = cssVar("alert-fg");
var $bg = cssVar("alert-bg");
var baseStyle2 = definePartsStyle2({
container: {
bg: $bg.reference,
px: "4",
py: "3"
},
title: {
fontWeight: "bold",
lineHeight: "6",
marginEnd: "2"
},
description: {
lineHeight: "6"
},
icon: {
color: $fg.reference,
flexShrink: 0,
marginEnd: "3",
w: "5",
h: "6"
},
spinner: {
color: $fg.reference,
flexShrink: 0,
marginEnd: "3",
w: "5",
h: "5"
}
});
function getBg(props) {
const { theme: theme2, colorScheme: c } = props;
const darkBg = transparentize2(`${c}.200`, 0.16)(theme2);
return {
light: `colors.${c}.100`,
dark: darkBg
};
}
var variantSubtle = definePartsStyle2((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
}
}
};
});
var variantLeftAccent = definePartsStyle2((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
},
paddingStart: "3",
borderStartWidth: "4px",
borderStartColor: $fg.reference
}
};
});
var variantTopAccent = definePartsStyle2((props) => {
const { colorScheme: c } = props;
const bg = getBg(props);
return {
container: {
[$fg.variable]: `colors.${c}.600`,
[$bg.variable]: bg.light,
_dark: {
[$fg.variable]: `colors.${c}.200`,
[$bg.variable]: bg.dark
},
pt: "2",
borderTopWidth: "4px",
borderTopColor: $fg.reference
}
};
});
var variantSolid = definePartsStyle2((props) => {
const { colorScheme: c } = props;
return {
container: {
[$fg.variable]: `colors.white`,
[$bg.variable]: `colors.${c}.600`,
_dark: {
[$fg.variable]: `colors.gray.900`,
[$bg.variable]: `colors.${c}.200`
},
color: $fg.reference
}
};
});
var variants = {
subtle: variantSubtle,
"left-accent": variantLeftAccent,
"top-accent": variantTopAccent,
solid: variantSolid
};
var alertTheme = defineMultiStyleConfig2({
baseStyle: baseStyle2,
variants,
defaultProps: {
variant: "subtle",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/spacing.mjs
var spacing = {
px: "1px",
0.5: "0.125rem",
1: "0.25rem",
1.5: "0.375rem",
2: "0.5rem",
2.5: "0.625rem",
3: "0.75rem",
3.5: "0.875rem",
4: "1rem",
5: "1.25rem",
6: "1.5rem",
7: "1.75rem",
8: "2rem",
9: "2.25rem",
10: "2.5rem",
12: "3rem",
14: "3.5rem",
16: "4rem",
20: "5rem",
24: "6rem",
28: "7rem",
32: "8rem",
36: "9rem",
40: "10rem",
44: "11rem",
48: "12rem",
52: "13rem",
56: "14rem",
60: "15rem",
64: "16rem",
72: "18rem",
80: "20rem",
96: "24rem"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/sizes.mjs
var largeSizes = {
max: "max-content",
min: "min-content",
full: "100%",
"3xs": "14rem",
"2xs": "16rem",
xs: "20rem",
sm: "24rem",
md: "28rem",
lg: "32rem",
xl: "36rem",
"2xl": "42rem",
"3xl": "48rem",
"4xl": "56rem",
"5xl": "64rem",
"6xl": "72rem",
"7xl": "80rem",
"8xl": "90rem",
prose: "60ch"
};
var container = {
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1280px"
};
var sizes = {
...spacing,
...largeSizes,
container
};
// ../../node_modules/@chakra-ui/theme/dist/esm/utils/run-if-fn.mjs
var isFunction3 = (value) => typeof value === "function";
function runIfFn2(valueOrFn, ...args) {
return isFunction3(valueOrFn) ? valueOrFn(...args) : valueOrFn;
}
// ../../node_modules/@chakra-ui/theme/dist/esm/components/avatar.mjs
var { definePartsStyle: definePartsStyle3, defineMultiStyleConfig: defineMultiStyleConfig3 } = createMultiStyleConfigHelpers(avatarAnatomy.keys);
var $border = cssVar("avatar-border-color");
var $bg2 = cssVar("avatar-bg");
var $fs = cssVar("avatar-font-size");
var $size = cssVar("avatar-size");
var baseStyleBadge = defineStyle({
borderRadius: "full",
border: "0.2em solid",
borderColor: $border.reference,
[$border.variable]: "white",
_dark: {
[$border.variable]: "colors.gray.800"
}
});
var baseStyleExcessLabel = defineStyle({
bg: $bg2.reference,
fontSize: $fs.reference,
width: $size.reference,
height: $size.reference,
lineHeight: "1",
[$bg2.variable]: "colors.gray.200",
_dark: {
[$bg2.variable]: "colors.whiteAlpha.400"
}
});
var baseStyleContainer2 = defineStyle((props) => {
const { name, theme: theme2 } = props;
const bg = name ? randomColor({ string: name }) : "colors.gray.400";
const isBgDark = isDark(bg)(theme2);
let color3 = "white";
if (!isBgDark)
color3 = "gray.800";
return {
bg: $bg2.reference,
fontSize: $fs.reference,
color: color3,
borderColor: $border.reference,
verticalAlign: "top",
width: $size.reference,
height: $size.reference,
"&:not([data-loaded])": {
[$bg2.variable]: bg
},
[$border.variable]: "colors.white",
_dark: {
[$border.variable]: "colors.gray.800"
}
};
});
var baseStyleLabel = defineStyle({
fontSize: $fs.reference,
lineHeight: "1"
});
var baseStyle3 = definePartsStyle3((props) => ({
badge: runIfFn2(baseStyleBadge, props),
excessLabel: runIfFn2(baseStyleExcessLabel, props),
container: runIfFn2(baseStyleContainer2, props),
label: baseStyleLabel
}));
function getSize(size2) {
const themeSize = size2 !== "100%" ? sizes[size2] : void 0;
return definePartsStyle3({
container: {
[$size.variable]: themeSize ?? size2,
[$fs.variable]: `calc(${themeSize ?? size2} / 2.5)`
},
excessLabel: {
[$size.variable]: themeSize ?? size2,
[$fs.variable]: `calc(${themeSize ?? size2} / 2.5)`
}
});
}
var sizes2 = {
"2xs": getSize(4),
xs: getSize(6),
sm: getSize(8),
md: getSize(12),
lg: getSize(16),
xl: getSize(24),
"2xl": getSize(32),
full: getSize("100%")
};
var avatarTheme = defineMultiStyleConfig3({
baseStyle: baseStyle3,
sizes: sizes2,
defaultProps: {
size: "md"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/badge.mjs
var vars = defineCssVars("badge", ["bg", "color", "shadow"]);
var baseStyle4 = defineStyle({
px: 1,
textTransform: "uppercase",
fontSize: "xs",
borderRadius: "sm",
fontWeight: "bold",
bg: vars.bg.reference,
color: vars.color.reference,
boxShadow: vars.shadow.reference
});
var variantSolid2 = defineStyle((props) => {
const { colorScheme: c, theme: theme2 } = props;
const dark = transparentize2(`${c}.500`, 0.6)(theme2);
return {
[vars.bg.variable]: `colors.${c}.500`,
[vars.color.variable]: `colors.white`,
_dark: {
[vars.bg.variable]: dark,
[vars.color.variable]: `colors.whiteAlpha.800`
}
};
});
var variantSubtle2 = defineStyle((props) => {
const { colorScheme: c, theme: theme2 } = props;
const darkBg = transparentize2(`${c}.200`, 0.16)(theme2);
return {
[vars.bg.variable]: `colors.${c}.100`,
[vars.color.variable]: `colors.${c}.800`,
_dark: {
[vars.bg.variable]: darkBg,
[vars.color.variable]: `colors.${c}.200`
}
};
});
var variantOutline = defineStyle((props) => {
const { colorScheme: c, theme: theme2 } = props;
const darkColor = transparentize2(`${c}.200`, 0.8)(theme2);
return {
[vars.color.variable]: `colors.${c}.500`,
_dark: {
[vars.color.variable]: darkColor
},
[vars.shadow.variable]: `inset 0 0 0px 1px ${vars.color.reference}`
};
});
var variants2 = {
solid: variantSolid2,
subtle: variantSubtle2,
outline: variantOutline
};
var badgeTheme = defineStyleConfig({
baseStyle: baseStyle4,
variants: variants2,
defaultProps: {
variant: "subtle",
colorScheme: "gray"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/breadcrumb.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig4, definePartsStyle: definePartsStyle4 } = createMultiStyleConfigHelpers(breadcrumbAnatomy.keys);
var $decor = cssVar("breadcrumb-link-decor");
var baseStyleLink = defineStyle({
transitionProperty: "common",
transitionDuration: "fast",
transitionTimingFunction: "ease-out",
outline: "none",
color: "inherit",
textDecoration: $decor.reference,
[$decor.variable]: "none",
"&:not([aria-current=page])": {
cursor: "pointer",
_hover: {
[$decor.variable]: "underline"
},
_focusVisible: {
boxShadow: "outline"
}
}
});
var baseStyle5 = definePartsStyle4({
link: baseStyleLink
});
var breadcrumbTheme = defineMultiStyleConfig4({
baseStyle: baseStyle5
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/button.mjs
var baseStyle6 = defineStyle({
lineHeight: "1.2",
borderRadius: "md",
fontWeight: "semibold",
transitionProperty: "common",
transitionDuration: "normal",
_focusVisible: {
boxShadow: "outline"
},
_disabled: {
opacity: 0.4,
cursor: "not-allowed",
boxShadow: "none"
},
_hover: {
_disabled: {
bg: "initial"
}
}
});
var variantGhost = defineStyle((props) => {
const { colorScheme: c, theme: theme2 } = props;
if (c === "gray") {
return {
color: mode(`gray.800`, `whiteAlpha.900`)(props),
_hover: {
bg: mode(`gray.100`, `whiteAlpha.200`)(props)
},
_active: { bg: mode(`gray.200`, `whiteAlpha.300`)(props) }
};
}
const darkHoverBg = transparentize2(`${c}.200`, 0.12)(theme2);
const darkActiveBg = transparentize2(`${c}.200`, 0.24)(theme2);
return {
color: mode(`${c}.600`, `${c}.200`)(props),
bg: "transparent",
_hover: {
bg: mode(`${c}.50`, darkHoverBg)(props)
},
_active: {
bg: mode(`${c}.100`, darkActiveBg)(props)
}
};
});
var variantOutline2 = defineStyle((props) => {
const { colorScheme: c } = props;
const borderColor = mode(`gray.200`, `whiteAlpha.300`)(props);
return {
border: "1px solid",
borderColor: c === "gray" ? borderColor : "currentColor",
".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)": { marginEnd: "-1px" },
".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)": { marginBottom: "-1px" },
...runIfFn2(variantGhost, props)
};
});
var accessibleColorMap = {
yellow: {
bg: "yellow.400",
color: "black",
hoverBg: "yellow.500",
activeBg: "yellow.600"
},
cyan: {
bg: "cyan.400",
color: "black",
hoverBg: "cyan.500",
activeBg: "cyan.600"
}
};
var variantSolid3 = defineStyle((props) => {
const { colorScheme: c } = props;
if (c === "gray") {
const bg2 = mode(`gray.100`, `whiteAlpha.200`)(props);
return {
bg: bg2,
color: mode(`gray.800`, `whiteAlpha.900`)(props),
_hover: {
bg: mode(`gray.200`, `whiteAlpha.300`)(props),
_disabled: {
bg: bg2
}
},
_active: { bg: mode(`gray.300`, `whiteAlpha.400`)(props) }
};
}
const {
bg = `${c}.500`,
color: color3 = "white",
hoverBg = `${c}.600`,
activeBg = `${c}.700`
} = accessibleColorMap[c] ?? {};
const background2 = mode(bg, `${c}.200`)(props);
return {
bg: background2,
color: mode(color3, `gray.800`)(props),
_hover: {
bg: mode(hoverBg, `${c}.300`)(props),
_disabled: {
bg: background2
}
},
_active: { bg: mode(activeBg, `${c}.400`)(props) }
};
});
var variantLink = defineStyle((props) => {
const { colorScheme: c } = props;
return {
padding: 0,
height: "auto",
lineHeight: "normal",
verticalAlign: "baseline",
color: mode(`${c}.500`, `${c}.200`)(props),
_hover: {
textDecoration: "underline",
_disabled: {
textDecoration: "none"
}
},
_active: {
color: mode(`${c}.700`, `${c}.500`)(props)
}
};
});
var variantUnstyled = defineStyle({
bg: "none",
color: "inherit",
display: "inline",
lineHeight: "inherit",
m: "0",
p: "0"
});
var variants3 = {
ghost: variantGhost,
outline: variantOutline2,
solid: variantSolid3,
link: variantLink,
unstyled: variantUnstyled
};
var sizes3 = {
lg: defineStyle({
h: "12",
minW: "12",
fontSize: "lg",
px: "6"
}),
md: defineStyle({
h: "10",
minW: "10",
fontSize: "md",
px: "4"
}),
sm: defineStyle({
h: "8",
minW: "8",
fontSize: "sm",
px: "3"
}),
xs: defineStyle({
h: "6",
minW: "6",
fontSize: "xs",
px: "2"
})
};
var buttonTheme = defineStyleConfig({
baseStyle: baseStyle6,
variants: variants3,
sizes: sizes3,
defaultProps: {
variant: "solid",
size: "md",
colorScheme: "gray"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/card.mjs
var { definePartsStyle: definePartsStyle5, defineMultiStyleConfig: defineMultiStyleConfig5 } = createMultiStyleConfigHelpers(cardAnatomy.keys);
var $bg3 = cssVar("card-bg");
var $padding = cssVar("card-padding");
var $shadow = cssVar("card-shadow");
var $radius = cssVar("card-radius");
var $border2 = cssVar("card-border-width", "0");
var $borderColor = cssVar("card-border-color");
var baseStyle7 = definePartsStyle5({
container: {
[$bg3.variable]: "colors.chakra-body-bg",
backgroundColor: $bg3.reference,
boxShadow: $shadow.reference,
borderRadius: $radius.reference,
color: "chakra-body-text",
borderWidth: $border2.reference,
borderColor: $borderColor.reference
},
body: {
padding: $padding.reference,
flex: "1 1 0%"
},
header: {
padding: $padding.reference
},
footer: {
padding: $padding.reference
}
});
var sizes4 = {
sm: definePartsStyle5({
container: {
[$radius.variable]: "radii.base",
[$padding.variable]: "space.3"
}
}),
md: definePartsStyle5({
container: {
[$radius.variable]: "radii.md",
[$padding.variable]: "space.5"
}
}),
lg: definePartsStyle5({
container: {
[$radius.variable]: "radii.xl",
[$padding.variable]: "space.7"
}
})
};
var variants4 = {
elevated: definePartsStyle5({
container: {
[$shadow.variable]: "shadows.base",
_dark: {
[$bg3.variable]: "colors.gray.700"
}
}
}),
outline: definePartsStyle5({
container: {
[$border2.variable]: "1px",
[$borderColor.variable]: "colors.chakra-border-color"
}
}),
filled: definePartsStyle5({
container: {
[$bg3.variable]: "colors.chakra-subtle-bg"
}
}),
unstyled: {
body: {
[$padding.variable]: 0
},
header: {
[$padding.variable]: 0
},
footer: {
[$padding.variable]: 0
}
}
};
var cardTheme = defineMultiStyleConfig5({
baseStyle: baseStyle7,
variants: variants4,
sizes: sizes4,
defaultProps: {
variant: "elevated",
size: "md"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/checkbox.mjs
var { definePartsStyle: definePartsStyle6, defineMultiStyleConfig: defineMultiStyleConfig6 } = createMultiStyleConfigHelpers(checkboxAnatomy.keys);
var $size2 = cssVar("checkbox-size");
var baseStyleControl = defineStyle((props) => {
const { colorScheme: c } = props;
return {
w: $size2.reference,
h: $size2.reference,
transitionProperty: "box-shadow",
transitionDuration: "normal",
border: "2px solid",
borderRadius: "sm",
borderColor: "inherit",
color: "white",
_checked: {
bg: mode(`${c}.500`, `${c}.200`)(props),
borderColor: mode(`${c}.500`, `${c}.200`)(props),
color: mode("white", "gray.900")(props),
_hover: {
bg: mode(`${c}.600`, `${c}.300`)(props),
borderColor: mode(`${c}.600`, `${c}.300`)(props)
},
_disabled: {
borderColor: mode("gray.200", "transparent")(props),
bg: mode("gray.200", "whiteAlpha.300")(props),
color: mode("gray.500", "whiteAlpha.500")(props)
}
},
_indeterminate: {
bg: mode(`${c}.500`, `${c}.200`)(props),
borderColor: mode(`${c}.500`, `${c}.200`)(props),
color: mode("white", "gray.900")(props)
},
_disabled: {
bg: mode("gray.100", "whiteAlpha.100")(props),
borderColor: mode("gray.100", "transparent")(props)
},
_focusVisible: {
boxShadow: "outline"
},
_invalid: {
borderColor: mode("red.500", "red.300")(props)
}
};
});
var baseStyleContainer3 = defineStyle({
_disabled: { cursor: "not-allowed" }
});
var baseStyleLabel2 = defineStyle({
userSelect: "none",
_disabled: { opacity: 0.4 }
});
var baseStyleIcon2 = defineStyle({
transitionProperty: "transform",
transitionDuration: "normal"
});
var baseStyle8 = definePartsStyle6((props) => ({
icon: baseStyleIcon2,
container: baseStyleContainer3,
control: runIfFn2(baseStyleControl, props),
label: baseStyleLabel2
}));
var sizes5 = {
sm: definePartsStyle6({
control: { [$size2.variable]: "sizes.3" },
label: { fontSize: "sm" },
icon: { fontSize: "3xs" }
}),
md: definePartsStyle6({
control: { [$size2.variable]: "sizes.4" },
label: { fontSize: "md" },
icon: { fontSize: "2xs" }
}),
lg: definePartsStyle6({
control: { [$size2.variable]: "sizes.5" },
label: { fontSize: "lg" },
icon: { fontSize: "2xs" }
})
};
var checkboxTheme = defineMultiStyleConfig6({
baseStyle: baseStyle8,
sizes: sizes5,
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/close-button.mjs
var $size3 = cssVar2("close-button-size");
var $bg4 = cssVar2("close-button-bg");
var baseStyle9 = defineStyle({
w: [$size3.reference],
h: [$size3.reference],
borderRadius: "md",
transitionProperty: "common",
transitionDuration: "normal",
_disabled: {
opacity: 0.4,
cursor: "not-allowed",
boxShadow: "none"
},
_hover: {
[$bg4.variable]: "colors.blackAlpha.100",
_dark: {
[$bg4.variable]: "colors.whiteAlpha.100"
}
},
_active: {
[$bg4.variable]: "colors.blackAlpha.200",
_dark: {
[$bg4.variable]: "colors.whiteAlpha.200"
}
},
_focusVisible: {
boxShadow: "outline"
},
bg: $bg4.reference
});
var sizes6 = {
lg: defineStyle({
[$size3.variable]: "sizes.10",
fontSize: "md"
}),
md: defineStyle({
[$size3.variable]: "sizes.8",
fontSize: "xs"
}),
sm: defineStyle({
[$size3.variable]: "sizes.6",
fontSize: "2xs"
})
};
var closeButtonTheme = defineStyleConfig({
baseStyle: baseStyle9,
sizes: sizes6,
defaultProps: {
size: "md"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/code.mjs
var { variants: variants5, defaultProps } = badgeTheme;
var baseStyle10 = defineStyle({
fontFamily: "mono",
fontSize: "sm",
px: "0.2em",
borderRadius: "sm",
bg: vars.bg.reference,
color: vars.color.reference,
boxShadow: vars.shadow.reference
});
var codeTheme = defineStyleConfig({
baseStyle: baseStyle10,
variants: variants5,
defaultProps
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/container.mjs
var baseStyle11 = defineStyle({
w: "100%",
mx: "auto",
maxW: "prose",
px: "4"
});
var containerTheme = defineStyleConfig({
baseStyle: baseStyle11
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/divider.mjs
var baseStyle12 = defineStyle({
opacity: 0.6,
borderColor: "inherit"
});
var variantSolid4 = defineStyle({
borderStyle: "solid"
});
var variantDashed = defineStyle({
borderStyle: "dashed"
});
var variants6 = {
solid: variantSolid4,
dashed: variantDashed
};
var dividerTheme = defineStyleConfig({
baseStyle: baseStyle12,
variants: variants6,
defaultProps: {
variant: "solid"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/drawer.mjs
var { definePartsStyle: definePartsStyle7, defineMultiStyleConfig: defineMultiStyleConfig7 } = createMultiStyleConfigHelpers(drawerAnatomy.keys);
var $bg5 = cssVar("drawer-bg");
var $bs = cssVar("drawer-box-shadow");
function getSize2(value) {
if (value === "full") {
return definePartsStyle7({
dialog: { maxW: "100vw", h: "100vh" }
});
}
return definePartsStyle7({
dialog: { maxW: value }
});
}
var baseStyleOverlay = defineStyle({
bg: "blackAlpha.600",
zIndex: "modal"
});
var baseStyleDialogContainer = defineStyle({
display: "flex",
zIndex: "modal",
justifyContent: "center"
});
var baseStyleDialog = defineStyle((props) => {
const { isFullHeight } = props;
return {
...isFullHeight && { height: "100vh" },
zIndex: "modal",
maxH: "100vh",
color: "inherit",
[$bg5.variable]: "colors.white",
[$bs.variable]: "shadows.lg",
_dark: {
[$bg5.variable]: "colors.gray.700",
[$bs.variable]: "shadows.dark-lg"
},
bg: $bg5.reference,
boxShadow: $bs.reference
};
});
var baseStyleHeader = defineStyle({
px: "6",
py: "4",
fontSize: "xl",
fontWeight: "semibold"
});
var baseStyleCloseButton = defineStyle({
position: "absolute",
top: "2",
insetEnd: "3"
});
var baseStyleBody = defineStyle({
px: "6",
py: "2",
flex: "1",
overflow: "auto"
});
var baseStyleFooter = defineStyle({
px: "6",
py: "4"
});
var baseStyle13 = definePartsStyle7((props) => ({
overlay: baseStyleOverlay,
dialogContainer: baseStyleDialogContainer,
dialog: runIfFn2(baseStyleDialog, props),
header: baseStyleHeader,
closeButton: baseStyleCloseButton,
body: baseStyleBody,
footer: baseStyleFooter
}));
var sizes7 = {
xs: getSize2("xs"),
sm: getSize2("md"),
md: getSize2("lg"),
lg: getSize2("2xl"),
xl: getSize2("4xl"),
full: getSize2("full")
};
var drawerTheme = defineMultiStyleConfig7({
baseStyle: baseStyle13,
sizes: sizes7,
defaultProps: {
size: "xs"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/editable.mjs
var { definePartsStyle: definePartsStyle8, defineMultiStyleConfig: defineMultiStyleConfig8 } = createMultiStyleConfigHelpers(editableAnatomy.keys);
var baseStylePreview = defineStyle({
borderRadius: "md",
py: "1",
transitionProperty: "common",
transitionDuration: "normal"
});
var baseStyleInput = defineStyle({
borderRadius: "md",
py: "1",
transitionProperty: "common",
transitionDuration: "normal",
width: "full",
_focusVisible: { boxShadow: "outline" },
_placeholder: { opacity: 0.6 }
});
var baseStyleTextarea = defineStyle({
borderRadius: "md",
py: "1",
transitionProperty: "common",
transitionDuration: "normal",
width: "full",
_focusVisible: { boxShadow: "outline" },
_placeholder: { opacity: 0.6 }
});
var baseStyle14 = definePartsStyle8({
preview: baseStylePreview,
input: baseStyleInput,
textarea: baseStyleTextarea
});
var editableTheme = defineMultiStyleConfig8({
baseStyle: baseStyle14
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/form-control.mjs
var { definePartsStyle: definePartsStyle9, defineMultiStyleConfig: defineMultiStyleConfig9 } = createMultiStyleConfigHelpers(formAnatomy.keys);
var $fg2 = cssVar("form-control-color");
var baseStyleRequiredIndicator = defineStyle({
marginStart: "1",
[$fg2.variable]: "colors.red.500",
_dark: {
[$fg2.variable]: "colors.red.300"
},
color: $fg2.reference
});
var baseStyleHelperText = defineStyle({
mt: "2",
[$fg2.variable]: "colors.gray.600",
_dark: {
[$fg2.variable]: "colors.whiteAlpha.600"
},
color: $fg2.reference,
lineHeight: "normal",
fontSize: "sm"
});
var baseStyle15 = definePartsStyle9({
container: {
width: "100%",
position: "relative"
},
requiredIndicator: baseStyleRequiredIndicator,
helperText: baseStyleHelperText
});
var formTheme = defineMultiStyleConfig9({
baseStyle: baseStyle15
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/form-error.mjs
var { definePartsStyle: definePartsStyle10, defineMultiStyleConfig: defineMultiStyleConfig10 } = createMultiStyleConfigHelpers(formErrorAnatomy.keys);
var $fg3 = cssVar("form-error-color");
var baseStyleText = defineStyle({
[$fg3.variable]: `colors.red.500`,
_dark: {
[$fg3.variable]: `colors.red.300`
},
color: $fg3.reference,
mt: "2",
fontSize: "sm",
lineHeight: "normal"
});
var baseStyleIcon3 = defineStyle({
marginEnd: "0.5em",
[$fg3.variable]: `colors.red.500`,
_dark: {
[$fg3.variable]: `colors.red.300`
},
color: $fg3.reference
});
var baseStyle16 = definePartsStyle10({
text: baseStyleText,
icon: baseStyleIcon3
});
var formErrorTheme = defineMultiStyleConfig10({
baseStyle: baseStyle16
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/form-label.mjs
var baseStyle17 = defineStyle({
fontSize: "md",
marginEnd: "3",
mb: "2",
fontWeight: "medium",
transitionProperty: "common",
transitionDuration: "normal",
opacity: 1,
_disabled: {
opacity: 0.4
}
});
var formLabelTheme = defineStyleConfig({
baseStyle: baseStyle17
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/heading.mjs
var baseStyle18 = defineStyle({
fontFamily: "heading",
fontWeight: "bold"
});
var sizes8 = {
"4xl": defineStyle({
fontSize: ["6xl", null, "7xl"],
lineHeight: 1
}),
"3xl": defineStyle({
fontSize: ["5xl", null, "6xl"],
lineHeight: 1
}),
"2xl": defineStyle({
fontSize: ["4xl", null, "5xl"],
lineHeight: [1.2, null, 1]
}),
xl: defineStyle({
fontSize: ["3xl", null, "4xl"],
lineHeight: [1.33, null, 1.2]
}),
lg: defineStyle({
fontSize: ["2xl", null, "3xl"],
lineHeight: [1.33, null, 1.2]
}),
md: defineStyle({
fontSize: "xl",
lineHeight: 1.2
}),
sm: defineStyle({
fontSize: "md",
lineHeight: 1.2
}),
xs: defineStyle({
fontSize: "sm",
lineHeight: 1.2
})
};
var headingTheme = defineStyleConfig({
baseStyle: baseStyle18,
sizes: sizes8,
defaultProps: {
size: "xl"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/input.mjs
var { definePartsStyle: definePartsStyle11, defineMultiStyleConfig: defineMultiStyleConfig11 } = createMultiStyleConfigHelpers(inputAnatomy.keys);
var $height = cssVar("input-height");
var $fontSize = cssVar("input-font-size");
var $padding2 = cssVar("input-padding");
var $borderRadius = cssVar("input-border-radius");
var baseStyle19 = definePartsStyle11({
addon: {
height: $height.reference,
fontSize: $fontSize.reference,
px: $padding2.reference,
borderRadius: $borderRadius.reference
},
field: {
width: "100%",
height: $height.reference,
fontSize: $fontSize.reference,
px: $padding2.reference,
borderRadius: $borderRadius.reference,
minWidth: 0,
outline: 0,
position: "relative",
appearance: "none",
transitionProperty: "common",
transitionDuration: "normal",
_disabled: {
opacity: 0.4,
cursor: "not-allowed"
}
}
});
var size = {
lg: defineStyle({
[$fontSize.variable]: "fontSizes.lg",
[$padding2.variable]: "space.4",
[$borderRadius.variable]: "radii.md",
[$height.variable]: "sizes.12"
}),
md: defineStyle({
[$fontSize.variable]: "fontSizes.md",
[$padding2.variable]: "space.4",
[$borderRadius.variable]: "radii.md",
[$height.variable]: "sizes.10"
}),
sm: defineStyle({
[$fontSize.variable]: "fontSizes.sm",
[$padding2.variable]: "space.3",
[$borderRadius.variable]: "radii.sm",
[$height.variable]: "sizes.8"
}),
xs: defineStyle({
[$fontSize.variable]: "fontSizes.xs",
[$padding2.variable]: "space.2",
[$borderRadius.variable]: "radii.sm",
[$height.variable]: "sizes.6"
})
};
var sizes9 = {
lg: definePartsStyle11({
field: size.lg,
group: size.lg
}),
md: definePartsStyle11({
field: size.md,
group: size.md
}),
sm: definePartsStyle11({
field: size.sm,
group: size.sm
}),
xs: definePartsStyle11({
field: size.xs,
group: size.xs
})
};
function getDefaults(props) {
const { focusBorderColor: fc, errorBorderColor: ec } = props;
return {
focusBorderColor: fc || mode("blue.500", "blue.300")(props),
errorBorderColor: ec || mode("red.500", "red.300")(props)
};
}
var variantOutline3 = definePartsStyle11((props) => {
const { theme: theme2 } = props;
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
return {
field: {
border: "1px solid",
borderColor: "inherit",
bg: "inherit",
_hover: {
borderColor: mode("gray.300", "whiteAlpha.400")(props)
},
_readOnly: {
boxShadow: "none !important",
userSelect: "all"
},
_invalid: {
borderColor: getColor(theme2, ec),
boxShadow: `0 0 0 1px ${getColor(theme2, ec)}`
},
_focusVisible: {
zIndex: 1,
borderColor: getColor(theme2, fc),
boxShadow: `0 0 0 1px ${getColor(theme2, fc)}`
}
},
addon: {
border: "1px solid",
borderColor: mode("inherit", "whiteAlpha.50")(props),
bg: mode("gray.100", "whiteAlpha.300")(props)
}
};
});
var variantFilled = definePartsStyle11((props) => {
const { theme: theme2 } = props;
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
return {
field: {
border: "2px solid",
borderColor: "transparent",
bg: mode("gray.100", "whiteAlpha.50")(props),
_hover: {
bg: mode("gray.200", "whiteAlpha.100")(props)
},
_readOnly: {
boxShadow: "none !important",
userSelect: "all"
},
_invalid: {
borderColor: getColor(theme2, ec)
},
_focusVisible: {
bg: "transparent",
borderColor: getColor(theme2, fc)
}
},
addon: {
border: "2px solid",
borderColor: "transparent",
bg: mode("gray.100", "whiteAlpha.50")(props)
}
};
});
var variantFlushed = definePartsStyle11((props) => {
const { theme: theme2 } = props;
const { focusBorderColor: fc, errorBorderColor: ec } = getDefaults(props);
return {
field: {
borderBottom: "1px solid",
borderColor: "inherit",
borderRadius: "0",
px: "0",
bg: "transparent",
_readOnly: {
boxShadow: "none !important",
userSelect: "all"
},
_invalid: {
borderColor: getColor(theme2, ec),
boxShadow: `0px 1px 0px 0px ${getColor(theme2, ec)}`
},
_focusVisible: {
borderColor: getColor(theme2, fc),
boxShadow: `0px 1px 0px 0px ${getColor(theme2, fc)}`
}
},
addon: {
borderBottom: "2px solid",
borderColor: "inherit",
borderRadius: "0",
px: "0",
bg: "transparent"
}
};
});
var variantUnstyled2 = definePartsStyle11({
field: {
bg: "transparent",
px: "0",
height: "auto"
},
addon: {
bg: "transparent",
px: "0",
height: "auto"
}
});
var variants7 = {
outline: variantOutline3,
filled: variantFilled,
flushed: variantFlushed,
unstyled: variantUnstyled2
};
var inputTheme = defineMultiStyleConfig11({
baseStyle: baseStyle19,
sizes: sizes9,
variants: variants7,
defaultProps: {
size: "md",
variant: "outline"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/kbd.mjs
var $bg6 = cssVar("kbd-bg");
var baseStyle20 = defineStyle({
[$bg6.variable]: "colors.gray.100",
_dark: {
[$bg6.variable]: "colors.whiteAlpha.100"
},
bg: $bg6.reference,
borderRadius: "md",
borderWidth: "1px",
borderBottomWidth: "3px",
fontSize: "0.8em",
fontWeight: "bold",
lineHeight: "normal",
px: "0.4em",
whiteSpace: "nowrap"
});
var kbdTheme = defineStyleConfig({
baseStyle: baseStyle20
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/link.mjs
var baseStyle21 = defineStyle({
transitionProperty: "common",
transitionDuration: "fast",
transitionTimingFunction: "ease-out",
cursor: "pointer",
textDecoration: "none",
outline: "none",
color: "inherit",
_hover: {
textDecoration: "underline"
},
_focusVisible: {
boxShadow: "outline"
}
});
var linkTheme = defineStyleConfig({
baseStyle: baseStyle21
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/list.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig12, definePartsStyle: definePartsStyle12 } = createMultiStyleConfigHelpers(listAnatomy.keys);
var baseStyleIcon4 = defineStyle({
marginEnd: "2",
display: "inline",
verticalAlign: "text-bottom"
});
var baseStyle22 = definePartsStyle12({
icon: baseStyleIcon4
});
var listTheme = defineMultiStyleConfig12({
baseStyle: baseStyle22
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/menu.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig13, definePartsStyle: definePartsStyle13 } = createMultiStyleConfigHelpers(menuAnatomy.keys);
var $bg7 = cssVar("menu-bg");
var $shadow2 = cssVar("menu-shadow");
var baseStyleList = defineStyle({
[$bg7.variable]: "#fff",
[$shadow2.variable]: "shadows.sm",
_dark: {
[$bg7.variable]: "colors.gray.700",
[$shadow2.variable]: "shadows.dark-lg"
},
color: "inherit",
minW: "3xs",
py: "2",
zIndex: "dropdown",
borderRadius: "md",
borderWidth: "1px",
bg: $bg7.reference,
boxShadow: $shadow2.reference
});
var baseStyleItem = defineStyle({
py: "1.5",
px: "3",
transitionProperty: "background",
transitionDuration: "ultra-fast",
transitionTimingFunction: "ease-in",
_focus: {
[$bg7.variable]: "colors.gray.100",
_dark: {
[$bg7.variable]: "colors.whiteAlpha.100"
}
},
_active: {
[$bg7.variable]: "colors.gray.200",
_dark: {
[$bg7.variable]: "colors.whiteAlpha.200"
}
},
_expanded: {
[$bg7.variable]: "colors.gray.100",
_dark: {
[$bg7.variable]: "colors.whiteAlpha.100"
}
},
_disabled: {
opacity: 0.4,
cursor: "not-allowed"
},
bg: $bg7.reference
});
var baseStyleGroupTitle = defineStyle({
mx: 4,
my: 2,
fontWeight: "semibold",
fontSize: "sm"
});
var baseStyleIcon5 = defineStyle({
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
flexShrink: 0
});
var baseStyleCommand = defineStyle({
opacity: 0.6
});
var baseStyleDivider = defineStyle({
border: 0,
borderBottom: "1px solid",
borderColor: "inherit",
my: "2",
opacity: 0.6
});
var baseStyleButton2 = defineStyle({
transitionProperty: "common",
transitionDuration: "normal"
});
var baseStyle23 = definePartsStyle13({
button: baseStyleButton2,
list: baseStyleList,
item: baseStyleItem,
groupTitle: baseStyleGroupTitle,
icon: baseStyleIcon5,
command: baseStyleCommand,
divider: baseStyleDivider
});
var menuTheme = defineMultiStyleConfig13({
baseStyle: baseStyle23
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/modal.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig14, definePartsStyle: definePartsStyle14 } = createMultiStyleConfigHelpers(modalAnatomy.keys);
var $bg8 = cssVar("modal-bg");
var $shadow3 = cssVar("modal-shadow");
var baseStyleOverlay2 = defineStyle({
bg: "blackAlpha.600",
zIndex: "modal"
});
var baseStyleDialogContainer2 = defineStyle((props) => {
const { isCentered, scrollBehavior } = props;
return {
display: "flex",
zIndex: "modal",
justifyContent: "center",
alignItems: isCentered ? "center" : "flex-start",
overflow: scrollBehavior === "inside" ? "hidden" : "auto",
overscrollBehaviorY: "none"
};
});
var baseStyleDialog2 = defineStyle((props) => {
const { isCentered, scrollBehavior } = props;
return {
borderRadius: "md",
color: "inherit",
my: isCentered ? "auto" : "16",
mx: isCentered ? "auto" : void 0,
zIndex: "modal",
maxH: scrollBehavior === "inside" ? "calc(100% - 7.5rem)" : void 0,
[$bg8.variable]: "colors.white",
[$shadow3.variable]: "shadows.lg",
_dark: {
[$bg8.variable]: "colors.gray.700",
[$shadow3.variable]: "shadows.dark-lg"
},
bg: $bg8.reference,
boxShadow: $shadow3.reference
};
});
var baseStyleHeader2 = defineStyle({
px: "6",
py: "4",
fontSize: "xl",
fontWeight: "semibold"
});
var baseStyleCloseButton2 = defineStyle({
position: "absolute",
top: "2",
insetEnd: "3"
});
var baseStyleBody2 = defineStyle((props) => {
const { scrollBehavior } = props;
return {
px: "6",
py: "2",
flex: "1",
overflow: scrollBehavior === "inside" ? "auto" : void 0
};
});
var baseStyleFooter2 = defineStyle({
px: "6",
py: "4"
});
var baseStyle24 = definePartsStyle14((props) => ({
overlay: baseStyleOverlay2,
dialogContainer: runIfFn2(baseStyleDialogContainer2, props),
dialog: runIfFn2(baseStyleDialog2, props),
header: baseStyleHeader2,
closeButton: baseStyleCloseButton2,
body: runIfFn2(baseStyleBody2, props),
footer: baseStyleFooter2
}));
function getSize3(value) {
if (value === "full") {
return definePartsStyle14({
dialog: {
maxW: "100vw",
minH: "$100vh",
my: "0",
borderRadius: "0"
}
});
}
return definePartsStyle14({
dialog: { maxW: value }
});
}
var sizes10 = {
xs: getSize3("xs"),
sm: getSize3("sm"),
md: getSize3("md"),
lg: getSize3("lg"),
xl: getSize3("xl"),
"2xl": getSize3("2xl"),
"3xl": getSize3("3xl"),
"4xl": getSize3("4xl"),
"5xl": getSize3("5xl"),
"6xl": getSize3("6xl"),
full: getSize3("full")
};
var modalTheme = defineMultiStyleConfig14({
baseStyle: baseStyle24,
sizes: sizes10,
defaultProps: { size: "md" }
});
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/typography.mjs
var typography2 = {
letterSpacings: {
tighter: "-0.05em",
tight: "-0.025em",
normal: "0",
wide: "0.025em",
wider: "0.05em",
widest: "0.1em"
},
lineHeights: {
normal: "normal",
none: 1,
shorter: 1.25,
short: 1.375,
base: 1.5,
tall: 1.625,
taller: "2",
"3": ".75rem",
"4": "1rem",
"5": "1.25rem",
"6": "1.5rem",
"7": "1.75rem",
"8": "2rem",
"9": "2.25rem",
"10": "2.5rem"
},
fontWeights: {
hairline: 100,
thin: 200,
light: 300,
normal: 400,
medium: 500,
semibold: 600,
bold: 700,
extrabold: 800,
black: 900
},
fonts: {
heading: `-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
body: `-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
mono: `SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace`
},
fontSizes: {
"3xs": "0.45rem",
"2xs": "0.625rem",
xs: "0.75rem",
sm: "0.875rem",
md: "1rem",
lg: "1.125rem",
xl: "1.25rem",
"2xl": "1.5rem",
"3xl": "1.875rem",
"4xl": "2.25rem",
"5xl": "3rem",
"6xl": "3.75rem",
"7xl": "4.5rem",
"8xl": "6rem",
"9xl": "8rem"
}
};
// ../../node_modules/@chakra-ui/theme/dist/esm/components/number-input.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig15, definePartsStyle: definePartsStyle15 } = createMultiStyleConfigHelpers(numberInputAnatomy.keys);
var $stepperWidth = cssVar2("number-input-stepper-width");
var $inputPadding = cssVar2("number-input-input-padding");
var inputPaddingValue = calc2($stepperWidth).add("0.5rem").toString();
var $bg9 = cssVar2("number-input-bg");
var $fg4 = cssVar2("number-input-color");
var $border3 = cssVar2("number-input-border-color");
var baseStyleRoot = defineStyle({
[$stepperWidth.variable]: "sizes.6",
[$inputPadding.variable]: inputPaddingValue
});
var baseStyleField = defineStyle(
(props) => {
var _a8;
return ((_a8 = runIfFn2(inputTheme.baseStyle, props)) == null ? void 0 : _a8.field) ?? {};
}
);
var baseStyleStepperGroup = defineStyle({
width: $stepperWidth.reference
});
var baseStyleStepper = defineStyle({
borderStart: "1px solid",
borderStartColor: $border3.reference,
color: $fg4.reference,
bg: $bg9.reference,
[$fg4.variable]: "colors.chakra-body-text",
[$border3.variable]: "colors.chakra-border-color",
_dark: {
[$fg4.variable]: "colors.whiteAlpha.800",
[$border3.variable]: "colors.whiteAlpha.300"
},
_active: {
[$bg9.variable]: "colors.gray.200",
_dark: {
[$bg9.variable]: "colors.whiteAlpha.300"
}
},
_disabled: {
opacity: 0.4,
cursor: "not-allowed"
}
});
var baseStyle25 = definePartsStyle15((props) => ({
root: baseStyleRoot,
field: runIfFn2(baseStyleField, props) ?? {},
stepperGroup: baseStyleStepperGroup,
stepper: baseStyleStepper
}));
function getSize4(size2) {
var _a8, _b3;
const sizeStyle = (_a8 = inputTheme.sizes) == null ? void 0 : _a8[size2];
const radius = {
lg: "md",
md: "md",
sm: "sm",
xs: "sm"
};
const _fontSize = ((_b3 = sizeStyle.field) == null ? void 0 : _b3.fontSize) ?? "md";
const fontSize = typography2.fontSizes[_fontSize];
return definePartsStyle15({
field: {
...sizeStyle.field,
paddingInlineEnd: $inputPadding.reference,
verticalAlign: "top"
},
stepper: {
fontSize: calc2(fontSize).multiply(0.75).toString(),
_first: {
borderTopEndRadius: radius[size2]
},
_last: {
borderBottomEndRadius: radius[size2],
mt: "-1px",
borderTopWidth: 1
}
}
});
}
var sizes11 = {
xs: getSize4("xs"),
sm: getSize4("sm"),
md: getSize4("md"),
lg: getSize4("lg")
};
var numberInputTheme = defineMultiStyleConfig15({
baseStyle: baseStyle25,
sizes: sizes11,
variants: inputTheme.variants,
defaultProps: inputTheme.defaultProps
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/pin-input.mjs
var _a;
var baseStyle26 = defineStyle({
...(_a = inputTheme.baseStyle) == null ? void 0 : _a.field,
textAlign: "center"
});
var sizes12 = {
lg: defineStyle({
fontSize: "lg",
w: 12,
h: 12,
borderRadius: "md"
}),
md: defineStyle({
fontSize: "md",
w: 10,
h: 10,
borderRadius: "md"
}),
sm: defineStyle({
fontSize: "sm",
w: 8,
h: 8,
borderRadius: "sm"
}),
xs: defineStyle({
fontSize: "xs",
w: 6,
h: 6,
borderRadius: "sm"
})
};
var _a2;
var variants8 = {
outline: defineStyle(
(props) => {
var _a8, _b3;
return ((_b3 = runIfFn2((_a8 = inputTheme.variants) == null ? void 0 : _a8.outline, props)) == null ? void 0 : _b3.field) ?? {};
}
),
flushed: defineStyle(
(props) => {
var _a8, _b3;
return ((_b3 = runIfFn2((_a8 = inputTheme.variants) == null ? void 0 : _a8.flushed, props)) == null ? void 0 : _b3.field) ?? {};
}
),
filled: defineStyle(
(props) => {
var _a8, _b3;
return ((_b3 = runIfFn2((_a8 = inputTheme.variants) == null ? void 0 : _a8.filled, props)) == null ? void 0 : _b3.field) ?? {};
}
),
unstyled: ((_a2 = inputTheme.variants) == null ? void 0 : _a2.unstyled.field) ?? {}
};
var pinInputTheme = defineStyleConfig({
baseStyle: baseStyle26,
sizes: sizes12,
variants: variants8,
defaultProps: inputTheme.defaultProps
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/popover.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig16, definePartsStyle: definePartsStyle16 } = createMultiStyleConfigHelpers(popoverAnatomy.keys);
var $popperBg = cssVar2("popper-bg");
var $arrowBg = cssVar2("popper-arrow-bg");
var $arrowShadowColor = cssVar2("popper-arrow-shadow-color");
var baseStylePopper = defineStyle({
zIndex: "popover"
});
var baseStyleContent = defineStyle({
[$popperBg.variable]: `colors.white`,
bg: $popperBg.reference,
[$arrowBg.variable]: $popperBg.reference,
[$arrowShadowColor.variable]: `colors.gray.200`,
_dark: {
[$popperBg.variable]: `colors.gray.700`,
[$arrowShadowColor.variable]: `colors.whiteAlpha.300`
},
width: "xs",
border: "1px solid",
borderColor: "inherit",
borderRadius: "md",
boxShadow: "sm",
zIndex: "inherit",
_focusVisible: {
outline: 0,
boxShadow: "outline"
}
});
var baseStyleHeader3 = defineStyle({
px: 3,
py: 2,
borderBottomWidth: "1px"
});
var baseStyleBody3 = defineStyle({
px: 3,
py: 2
});
var baseStyleFooter3 = defineStyle({
px: 3,
py: 2,
borderTopWidth: "1px"
});
var baseStyleCloseButton3 = defineStyle({
position: "absolute",
borderRadius: "md",
top: 1,
insetEnd: 2,
padding: 2
});
var baseStyle27 = definePartsStyle16({
popper: baseStylePopper,
content: baseStyleContent,
header: baseStyleHeader3,
body: baseStyleBody3,
footer: baseStyleFooter3,
closeButton: baseStyleCloseButton3
});
var popoverTheme = defineMultiStyleConfig16({
baseStyle: baseStyle27
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/progress.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig17, definePartsStyle: definePartsStyle17 } = createMultiStyleConfigHelpers(progressAnatomy.keys);
var filledStyle = defineStyle((props) => {
const { colorScheme: c, theme: t2, isIndeterminate, hasStripe } = props;
const stripeStyle = mode(
generateStripe(),
generateStripe("1rem", "rgba(0,0,0,0.1)")
)(props);
const bgColor = mode(`${c}.500`, `${c}.200`)(props);
const gradient = `linear-gradient(
to right,
transparent 0%,
${getColor(t2, bgColor)} 50%,
transparent 100%
)`;
const addStripe = !isIndeterminate && hasStripe;
return {
...addStripe && stripeStyle,
...isIndeterminate ? { bgImage: gradient } : { bgColor }
};
});
var baseStyleLabel3 = defineStyle({
lineHeight: "1",
fontSize: "0.25em",
fontWeight: "bold",
color: "white"
});
var baseStyleTrack = defineStyle((props) => {
return {
bg: mode("gray.100", "whiteAlpha.300")(props)
};
});
var baseStyleFilledTrack = defineStyle((props) => {
return {
transitionProperty: "common",
transitionDuration: "slow",
...filledStyle(props)
};
});
var baseStyle28 = definePartsStyle17((props) => ({
label: baseStyleLabel3,
filledTrack: baseStyleFilledTrack(props),
track: baseStyleTrack(props)
}));
var sizes13 = {
xs: definePartsStyle17({
track: { h: "1" }
}),
sm: definePartsStyle17({
track: { h: "2" }
}),
md: definePartsStyle17({
track: { h: "3" }
}),
lg: definePartsStyle17({
track: { h: "4" }
})
};
var progressTheme = defineMultiStyleConfig17({
sizes: sizes13,
baseStyle: baseStyle28,
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/radio.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig18, definePartsStyle: definePartsStyle18 } = createMultiStyleConfigHelpers(radioAnatomy.keys);
var baseStyleControl2 = defineStyle((props) => {
var _a8;
const controlStyle = (_a8 = runIfFn2(checkboxTheme.baseStyle, props)) == null ? void 0 : _a8.control;
return {
...controlStyle,
borderRadius: "full",
_checked: {
...controlStyle == null ? void 0 : controlStyle["_checked"],
_before: {
content: `""`,
display: "inline-block",
pos: "relative",
w: "50%",
h: "50%",
borderRadius: "50%",
bg: "currentColor"
}
}
};
});
var baseStyle29 = definePartsStyle18((props) => {
var _a8, _b3, _c3, _d3;
return {
label: (_b3 = (_a8 = checkboxTheme).baseStyle) == null ? void 0 : _b3.call(_a8, props).label,
container: (_d3 = (_c3 = checkboxTheme).baseStyle) == null ? void 0 : _d3.call(_c3, props).container,
control: baseStyleControl2(props)
};
});
var sizes14 = {
md: definePartsStyle18({
control: { w: "4", h: "4" },
label: { fontSize: "md" }
}),
lg: definePartsStyle18({
control: { w: "5", h: "5" },
label: { fontSize: "lg" }
}),
sm: definePartsStyle18({
control: { width: "3", height: "3" },
label: { fontSize: "sm" }
})
};
var radioTheme = defineMultiStyleConfig18({
baseStyle: baseStyle29,
sizes: sizes14,
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/select.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig19, definePartsStyle: definePartsStyle19 } = createMultiStyleConfigHelpers(selectAnatomy.keys);
var $bg10 = cssVar("select-bg");
var _a3;
var baseStyleField2 = defineStyle({
...(_a3 = inputTheme.baseStyle) == null ? void 0 : _a3.field,
appearance: "none",
paddingBottom: "1px",
lineHeight: "normal",
bg: $bg10.reference,
[$bg10.variable]: "colors.white",
_dark: {
[$bg10.variable]: "colors.gray.700"
},
"> option, > optgroup": {
bg: $bg10.reference
}
});
var baseStyleIcon6 = defineStyle({
width: "6",
height: "100%",
insetEnd: "2",
position: "relative",
color: "currentColor",
fontSize: "xl",
_disabled: {
opacity: 0.5
}
});
var baseStyle30 = definePartsStyle19({
field: baseStyleField2,
icon: baseStyleIcon6
});
var iconSpacing = defineStyle({
paddingInlineEnd: "8"
});
var _a4, _b, _c, _d, _e, _f, _g, _h;
var sizes15 = {
lg: {
...(_a4 = inputTheme.sizes) == null ? void 0 : _a4.lg,
field: {
...(_b = inputTheme.sizes) == null ? void 0 : _b.lg.field,
...iconSpacing
}
},
md: {
...(_c = inputTheme.sizes) == null ? void 0 : _c.md,
field: {
...(_d = inputTheme.sizes) == null ? void 0 : _d.md.field,
...iconSpacing
}
},
sm: {
...(_e = inputTheme.sizes) == null ? void 0 : _e.sm,
field: {
...(_f = inputTheme.sizes) == null ? void 0 : _f.sm.field,
...iconSpacing
}
},
xs: {
...(_g = inputTheme.sizes) == null ? void 0 : _g.xs,
field: {
...(_h = inputTheme.sizes) == null ? void 0 : _h.xs.field,
...iconSpacing
},
icon: {
insetEnd: "1"
}
}
};
var selectTheme = defineMultiStyleConfig19({
baseStyle: baseStyle30,
sizes: sizes15,
variants: inputTheme.variants,
defaultProps: inputTheme.defaultProps
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/skeleton.mjs
var $startColor = cssVar("skeleton-start-color");
var $endColor = cssVar("skeleton-end-color");
var baseStyle31 = defineStyle({
[$startColor.variable]: "colors.gray.100",
[$endColor.variable]: "colors.gray.400",
_dark: {
[$startColor.variable]: "colors.gray.800",
[$endColor.variable]: "colors.gray.600"
},
background: $startColor.reference,
borderColor: $endColor.reference,
opacity: 0.7,
borderRadius: "sm"
});
var skeletonTheme = defineStyleConfig({
baseStyle: baseStyle31
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/skip-link.mjs
var $bg11 = cssVar("skip-link-bg");
var baseStyle32 = defineStyle({
borderRadius: "md",
fontWeight: "semibold",
_focusVisible: {
boxShadow: "outline",
padding: "4",
position: "fixed",
top: "6",
insetStart: "6",
[$bg11.variable]: "colors.white",
_dark: {
[$bg11.variable]: "colors.gray.700"
},
bg: $bg11.reference
}
});
var skipLinkTheme = defineStyleConfig({
baseStyle: baseStyle32
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/slider.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig20, definePartsStyle: definePartsStyle20 } = createMultiStyleConfigHelpers(sliderAnatomy.keys);
var $thumbSize = cssVar("slider-thumb-size");
var $trackSize = cssVar("slider-track-size");
var $bg12 = cssVar("slider-bg");
var baseStyleContainer4 = defineStyle((props) => {
const { orientation } = props;
return {
display: "inline-block",
position: "relative",
cursor: "pointer",
_disabled: {
opacity: 0.6,
cursor: "default",
pointerEvents: "none"
},
...orient({
orientation,
vertical: {
h: "100%",
px: calc($thumbSize.reference).divide(2).toString()
},
horizontal: {
w: "100%",
py: calc($thumbSize.reference).divide(2).toString()
}
})
};
});
var baseStyleTrack2 = defineStyle((props) => {
const orientationStyles = orient({
orientation: props.orientation,
horizontal: { h: $trackSize.reference },
vertical: { w: $trackSize.reference }
});
return {
...orientationStyles,
overflow: "hidden",
borderRadius: "sm",
[$bg12.variable]: "colors.gray.200",
_dark: {
[$bg12.variable]: "colors.whiteAlpha.200"
},
_disabled: {
[$bg12.variable]: "colors.gray.300",
_dark: {
[$bg12.variable]: "colors.whiteAlpha.300"
}
},
bg: $bg12.reference
};
});
var baseStyleThumb = defineStyle((props) => {
const { orientation } = props;
const orientationStyle = orient({
orientation,
vertical: { left: "50%" },
horizontal: { top: "50%" }
});
return {
...orientationStyle,
w: $thumbSize.reference,
h: $thumbSize.reference,
display: "flex",
alignItems: "center",
justifyContent: "center",
position: "absolute",
outline: 0,
zIndex: 1,
borderRadius: "full",
bg: "white",
boxShadow: "base",
border: "1px solid",
borderColor: "transparent",
transitionProperty: "transform",
transitionDuration: "normal",
_focusVisible: {
boxShadow: "outline"
},
_active: {
"--slider-thumb-scale": `1.15`
},
_disabled: {
bg: "gray.300"
}
};
});
var baseStyleFilledTrack2 = defineStyle((props) => {
const { colorScheme: c } = props;
return {
width: "inherit",
height: "inherit",
[$bg12.variable]: `colors.${c}.500`,
_dark: {
[$bg12.variable]: `colors.${c}.200`
},
bg: $bg12.reference
};
});
var baseStyle33 = definePartsStyle20((props) => ({
container: baseStyleContainer4(props),
track: baseStyleTrack2(props),
thumb: baseStyleThumb(props),
filledTrack: baseStyleFilledTrack2(props)
}));
var sizeLg = definePartsStyle20({
container: {
[$thumbSize.variable]: `sizes.4`,
[$trackSize.variable]: `sizes.1`
}
});
var sizeMd = definePartsStyle20({
container: {
[$thumbSize.variable]: `sizes.3.5`,
[$trackSize.variable]: `sizes.1`
}
});
var sizeSm = definePartsStyle20({
container: {
[$thumbSize.variable]: `sizes.2.5`,
[$trackSize.variable]: `sizes.0.5`
}
});
var sizes16 = {
lg: sizeLg,
md: sizeMd,
sm: sizeSm
};
var sliderTheme = defineMultiStyleConfig20({
baseStyle: baseStyle33,
sizes: sizes16,
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/spinner.mjs
var $size4 = cssVar2("spinner-size");
var baseStyle34 = defineStyle({
width: [$size4.reference],
height: [$size4.reference]
});
var sizes17 = {
xs: defineStyle({
[$size4.variable]: "sizes.3"
}),
sm: defineStyle({
[$size4.variable]: "sizes.4"
}),
md: defineStyle({
[$size4.variable]: "sizes.6"
}),
lg: defineStyle({
[$size4.variable]: "sizes.8"
}),
xl: defineStyle({
[$size4.variable]: "sizes.12"
})
};
var spinnerTheme = defineStyleConfig({
baseStyle: baseStyle34,
sizes: sizes17,
defaultProps: {
size: "md"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/stat.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig21, definePartsStyle: definePartsStyle21 } = createMultiStyleConfigHelpers(statAnatomy.keys);
var baseStyleLabel4 = defineStyle({
fontWeight: "medium"
});
var baseStyleHelpText = defineStyle({
opacity: 0.8,
marginBottom: "2"
});
var baseStyleNumber = defineStyle({
verticalAlign: "baseline",
fontWeight: "semibold"
});
var baseStyleIcon7 = defineStyle({
marginEnd: 1,
w: "3.5",
h: "3.5",
verticalAlign: "middle"
});
var baseStyle35 = definePartsStyle21({
container: {},
label: baseStyleLabel4,
helpText: baseStyleHelpText,
number: baseStyleNumber,
icon: baseStyleIcon7
});
var sizes18 = {
md: definePartsStyle21({
label: { fontSize: "sm" },
helpText: { fontSize: "sm" },
number: { fontSize: "2xl" }
})
};
var statTheme = defineMultiStyleConfig21({
baseStyle: baseStyle35,
sizes: sizes18,
defaultProps: {
size: "md"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/stepper.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig22, definePartsStyle: definePartsStyle22 } = createMultiStyleConfigHelpers([
"stepper",
"step",
"title",
"description",
"indicator",
"separator",
"icon",
"number"
]);
var $size5 = cssVar("stepper-indicator-size");
var $iconSize = cssVar("stepper-icon-size");
var $titleFontSize = cssVar("stepper-title-font-size");
var $descFontSize = cssVar("stepper-description-font-size");
var $accentColor = cssVar("stepper-accent-color");
var baseStyle36 = definePartsStyle22(({ colorScheme: c }) => ({
stepper: {
display: "flex",
justifyContent: "space-between",
gap: "4",
"&[data-orientation=vertical]": {
flexDirection: "column",
alignItems: "flex-start"
},
"&[data-orientation=horizontal]": {
flexDirection: "row",
alignItems: "center"
},
[$accentColor.variable]: `colors.${c}.500`,
_dark: {
[$accentColor.variable]: `colors.${c}.200`
}
},
title: {
fontSize: $titleFontSize.reference,
fontWeight: "medium"
},
description: {
fontSize: $descFontSize.reference,
color: "chakra-subtle-text"
},
number: {
fontSize: $titleFontSize.reference
},
step: {
flexShrink: 0,
position: "relative",
display: "flex",
gap: "2",
"&[data-orientation=horizontal]": {
alignItems: "center"
},
flex: "1",
"&:last-of-type:not([data-stretch])": {
flex: "initial"
}
},
icon: {
flexShrink: 0,
width: $iconSize.reference,
height: $iconSize.reference
},
indicator: {
flexShrink: 0,
borderRadius: "full",
width: $size5.reference,
height: $size5.reference,
display: "flex",
justifyContent: "center",
alignItems: "center",
"&[data-status=active]": {
borderWidth: "2px",
borderColor: $accentColor.reference
},
"&[data-status=complete]": {
bg: $accentColor.reference,
color: "chakra-inverse-text"
},
"&[data-status=incomplete]": {
borderWidth: "2px"
}
},
separator: {
bg: "chakra-border-color",
flex: "1",
"&[data-status=complete]": {
bg: $accentColor.reference
},
"&[data-orientation=horizontal]": {
width: "100%",
height: "2px",
marginStart: "2"
},
"&[data-orientation=vertical]": {
width: "2px",
position: "absolute",
height: "100%",
maxHeight: `calc(100% - ${$size5.reference} - 8px)`,
top: `calc(${$size5.reference} + 4px)`,
insetStart: `calc(${$size5.reference} / 2 - 1px)`
}
}
}));
var stepperTheme = defineMultiStyleConfig22({
baseStyle: baseStyle36,
sizes: {
xs: definePartsStyle22({
stepper: {
[$size5.variable]: "sizes.4",
[$iconSize.variable]: "sizes.3",
[$titleFontSize.variable]: "fontSizes.xs",
[$descFontSize.variable]: "fontSizes.xs"
}
}),
sm: definePartsStyle22({
stepper: {
[$size5.variable]: "sizes.6",
[$iconSize.variable]: "sizes.4",
[$titleFontSize.variable]: "fontSizes.sm",
[$descFontSize.variable]: "fontSizes.xs"
}
}),
md: definePartsStyle22({
stepper: {
[$size5.variable]: "sizes.8",
[$iconSize.variable]: "sizes.5",
[$titleFontSize.variable]: "fontSizes.md",
[$descFontSize.variable]: "fontSizes.sm"
}
}),
lg: definePartsStyle22({
stepper: {
[$size5.variable]: "sizes.10",
[$iconSize.variable]: "sizes.6",
[$titleFontSize.variable]: "fontSizes.lg",
[$descFontSize.variable]: "fontSizes.md"
}
})
},
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/switch.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig23, definePartsStyle: definePartsStyle23 } = createMultiStyleConfigHelpers(switchAnatomy.keys);
var $width = cssVar2("switch-track-width");
var $height2 = cssVar2("switch-track-height");
var $diff = cssVar2("switch-track-diff");
var diffValue = calc2.subtract($width, $height2);
var $translateX = cssVar2("switch-thumb-x");
var $bg13 = cssVar2("switch-bg");
var baseStyleTrack3 = defineStyle((props) => {
const { colorScheme: c } = props;
return {
borderRadius: "full",
p: "0.5",
width: [$width.reference],
height: [$height2.reference],
transitionProperty: "common",
transitionDuration: "fast",
[$bg13.variable]: "colors.gray.300",
_dark: {
[$bg13.variable]: "colors.whiteAlpha.400"
},
_focusVisible: {
boxShadow: "outline"
},
_disabled: {
opacity: 0.4,
cursor: "not-allowed"
},
_checked: {
[$bg13.variable]: `colors.${c}.500`,
_dark: {
[$bg13.variable]: `colors.${c}.200`
}
},
bg: $bg13.reference
};
});
var baseStyleThumb2 = defineStyle({
bg: "white",
transitionProperty: "transform",
transitionDuration: "normal",
borderRadius: "inherit",
width: [$height2.reference],
height: [$height2.reference],
_checked: {
transform: `translateX(${$translateX.reference})`
}
});
var baseStyle37 = definePartsStyle23((props) => ({
container: {
[$diff.variable]: diffValue,
[$translateX.variable]: $diff.reference,
_rtl: {
[$translateX.variable]: calc2($diff).negate().toString()
}
},
track: baseStyleTrack3(props),
thumb: baseStyleThumb2
}));
var sizes19 = {
sm: definePartsStyle23({
container: {
[$width.variable]: "1.375rem",
[$height2.variable]: "sizes.3"
}
}),
md: definePartsStyle23({
container: {
[$width.variable]: "1.875rem",
[$height2.variable]: "sizes.4"
}
}),
lg: definePartsStyle23({
container: {
[$width.variable]: "2.875rem",
[$height2.variable]: "sizes.6"
}
})
};
var switchTheme = defineMultiStyleConfig23({
baseStyle: baseStyle37,
sizes: sizes19,
defaultProps: {
size: "md",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/table.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig24, definePartsStyle: definePartsStyle24 } = createMultiStyleConfigHelpers(tableAnatomy.keys);
var baseStyle38 = definePartsStyle24({
table: {
fontVariantNumeric: "lining-nums tabular-nums",
borderCollapse: "collapse",
width: "full"
},
th: {
fontFamily: "heading",
fontWeight: "bold",
textTransform: "uppercase",
letterSpacing: "wider",
textAlign: "start"
},
td: {
textAlign: "start"
},
caption: {
mt: 4,
fontFamily: "heading",
textAlign: "center",
fontWeight: "medium"
}
});
var numericStyles = defineStyle({
"&[data-is-numeric=true]": {
textAlign: "end"
}
});
var variantSimple = definePartsStyle24((props) => {
const { colorScheme: c } = props;
return {
th: {
color: mode("gray.600", "gray.400")(props),
borderBottom: "1px",
borderColor: mode(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
td: {
borderBottom: "1px",
borderColor: mode(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
caption: {
color: mode("gray.600", "gray.100")(props)
},
tfoot: {
tr: {
"&:last-of-type": {
th: { borderBottomWidth: 0 }
}
}
}
};
});
var variantStripe = definePartsStyle24((props) => {
const { colorScheme: c } = props;
return {
th: {
color: mode("gray.600", "gray.400")(props),
borderBottom: "1px",
borderColor: mode(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
td: {
borderBottom: "1px",
borderColor: mode(`${c}.100`, `${c}.700`)(props),
...numericStyles
},
caption: {
color: mode("gray.600", "gray.100")(props)
},
tbody: {
tr: {
"&:nth-of-type(odd)": {
"th, td": {
borderBottomWidth: "1px",
borderColor: mode(`${c}.100`, `${c}.700`)(props)
},
td: {
background: mode(`${c}.100`, `${c}.700`)(props)
}
}
}
},
tfoot: {
tr: {
"&:last-of-type": {
th: { borderBottomWidth: 0 }
}
}
}
};
});
var variants9 = {
simple: variantSimple,
striped: variantStripe,
unstyled: defineStyle({})
};
var sizes20 = {
sm: definePartsStyle24({
th: {
px: "4",
py: "1",
lineHeight: "4",
fontSize: "xs"
},
td: {
px: "4",
py: "2",
fontSize: "sm",
lineHeight: "4"
},
caption: {
px: "4",
py: "2",
fontSize: "xs"
}
}),
md: definePartsStyle24({
th: {
px: "6",
py: "3",
lineHeight: "4",
fontSize: "xs"
},
td: {
px: "6",
py: "4",
lineHeight: "5"
},
caption: {
px: "6",
py: "2",
fontSize: "sm"
}
}),
lg: definePartsStyle24({
th: {
px: "8",
py: "4",
lineHeight: "5",
fontSize: "sm"
},
td: {
px: "8",
py: "5",
lineHeight: "6"
},
caption: {
px: "6",
py: "2",
fontSize: "md"
}
})
};
var tableTheme = defineMultiStyleConfig24({
baseStyle: baseStyle38,
variants: variants9,
sizes: sizes20,
defaultProps: {
variant: "simple",
size: "md",
colorScheme: "gray"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/tabs.mjs
var $fg5 = cssVar("tabs-color");
var $bg14 = cssVar("tabs-bg");
var $border4 = cssVar("tabs-border-color");
var { defineMultiStyleConfig: defineMultiStyleConfig25, definePartsStyle: definePartsStyle25 } = createMultiStyleConfigHelpers(tabsAnatomy.keys);
var baseStyleRoot2 = defineStyle((props) => {
const { orientation } = props;
return {
display: orientation === "vertical" ? "flex" : "block"
};
});
var baseStyleTab = defineStyle((props) => {
const { isFitted } = props;
return {
flex: isFitted ? 1 : void 0,
transitionProperty: "common",
transitionDuration: "normal",
_focusVisible: {
zIndex: 1,
boxShadow: "outline"
},
_disabled: {
cursor: "not-allowed",
opacity: 0.4
}
};
});
var baseStyleTablist = defineStyle((props) => {
const { align = "start", orientation } = props;
const alignments = {
end: "flex-end",
center: "center",
start: "flex-start"
};
return {
justifyContent: alignments[align],
flexDirection: orientation === "vertical" ? "column" : "row"
};
});
var baseStyleTabpanel = defineStyle({
p: 4
});
var baseStyle39 = definePartsStyle25((props) => ({
root: baseStyleRoot2(props),
tab: baseStyleTab(props),
tablist: baseStyleTablist(props),
tabpanel: baseStyleTabpanel
}));
var sizes21 = {
sm: definePartsStyle25({
tab: {
py: 1,
px: 4,
fontSize: "sm"
}
}),
md: definePartsStyle25({
tab: {
fontSize: "md",
py: 2,
px: 4
}
}),
lg: definePartsStyle25({
tab: {
fontSize: "lg",
py: 3,
px: 4
}
})
};
var variantLine = definePartsStyle25((props) => {
const { colorScheme: c, orientation } = props;
const isVertical = orientation === "vertical";
const borderProp = isVertical ? "borderStart" : "borderBottom";
const marginProp = isVertical ? "marginStart" : "marginBottom";
return {
tablist: {
[borderProp]: "2px solid",
borderColor: "inherit"
},
tab: {
[borderProp]: "2px solid",
borderColor: "transparent",
[marginProp]: "-2px",
_selected: {
[$fg5.variable]: `colors.${c}.600`,
_dark: {
[$fg5.variable]: `colors.${c}.300`
},
borderColor: "currentColor"
},
_active: {
[$bg14.variable]: "colors.gray.200",
_dark: {
[$bg14.variable]: "colors.whiteAlpha.300"
}
},
_disabled: {
_active: { bg: "none" }
},
color: $fg5.reference,
bg: $bg14.reference
}
};
});
var variantEnclosed = definePartsStyle25((props) => {
const { colorScheme: c } = props;
return {
tab: {
borderTopRadius: "md",
border: "1px solid",
borderColor: "transparent",
mb: "-1px",
[$border4.variable]: "transparent",
_selected: {
[$fg5.variable]: `colors.${c}.600`,
[$border4.variable]: `colors.white`,
_dark: {
[$fg5.variable]: `colors.${c}.300`,
[$border4.variable]: `colors.gray.800`
},
borderColor: "inherit",
borderBottomColor: $border4.reference
},
color: $fg5.reference
},
tablist: {
mb: "-1px",
borderBottom: "1px solid",
borderColor: "inherit"
}
};
});
var variantEnclosedColored = definePartsStyle25((props) => {
const { colorScheme: c } = props;
return {
tab: {
border: "1px solid",
borderColor: "inherit",
[$bg14.variable]: "colors.gray.50",
_dark: {
[$bg14.variable]: "colors.whiteAlpha.50"
},
mb: "-1px",
_notLast: {
marginEnd: "-1px"
},
_selected: {
[$bg14.variable]: "colors.white",
[$fg5.variable]: `colors.${c}.600`,
_dark: {
[$bg14.variable]: "colors.gray.800",
[$fg5.variable]: `colors.${c}.300`
},
borderColor: "inherit",
borderTopColor: "currentColor",
borderBottomColor: "transparent"
},
color: $fg5.reference,
bg: $bg14.reference
},
tablist: {
mb: "-1px",
borderBottom: "1px solid",
borderColor: "inherit"
}
};
});
var variantSoftRounded = definePartsStyle25((props) => {
const { colorScheme: c, theme: theme2 } = props;
return {
tab: {
borderRadius: "full",
fontWeight: "semibold",
color: "gray.600",
_selected: {
color: getColor(theme2, `${c}.700`),
bg: getColor(theme2, `${c}.100`)
}
}
};
});
var variantSolidRounded = definePartsStyle25((props) => {
const { colorScheme: c } = props;
return {
tab: {
borderRadius: "full",
fontWeight: "semibold",
[$fg5.variable]: "colors.gray.600",
_dark: {
[$fg5.variable]: "inherit"
},
_selected: {
[$fg5.variable]: "colors.white",
[$bg14.variable]: `colors.${c}.600`,
_dark: {
[$fg5.variable]: "colors.gray.800",
[$bg14.variable]: `colors.${c}.300`
}
},
color: $fg5.reference,
bg: $bg14.reference
}
};
});
var variantUnstyled3 = definePartsStyle25({});
var variants10 = {
line: variantLine,
enclosed: variantEnclosed,
"enclosed-colored": variantEnclosedColored,
"soft-rounded": variantSoftRounded,
"solid-rounded": variantSolidRounded,
unstyled: variantUnstyled3
};
var tabsTheme = defineMultiStyleConfig25({
baseStyle: baseStyle39,
sizes: sizes21,
variants: variants10,
defaultProps: {
size: "md",
variant: "line",
colorScheme: "blue"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/tag.mjs
var { defineMultiStyleConfig: defineMultiStyleConfig26, definePartsStyle: definePartsStyle26 } = createMultiStyleConfigHelpers(tagAnatomy.keys);
var $bg15 = cssVar("tag-bg");
var $color = cssVar("tag-color");
var $shadow4 = cssVar("tag-shadow");
var $minH = cssVar("tag-min-height");
var $minW = cssVar("tag-min-width");
var $fontSize2 = cssVar("tag-font-size");
var $paddingX = cssVar("tag-padding-inline");
var baseStyleContainer5 = defineStyle({
fontWeight: "medium",
lineHeight: 1.2,
outline: 0,
[$color.variable]: vars.color.reference,
[$bg15.variable]: vars.bg.reference,
[$shadow4.variable]: vars.shadow.reference,
color: $color.reference,
bg: $bg15.reference,
boxShadow: $shadow4.reference,
borderRadius: "md",
minH: $minH.reference,
minW: $minW.reference,
fontSize: $fontSize2.reference,
px: $paddingX.reference,
_focusVisible: {
[$shadow4.variable]: "shadows.outline"
}
});
var baseStyleLabel5 = defineStyle({
lineHeight: 1.2,
overflow: "visible"
});
var baseStyleCloseButton4 = defineStyle({
fontSize: "lg",
w: "5",
h: "5",
transitionProperty: "common",
transitionDuration: "normal",
borderRadius: "full",
marginStart: "1.5",
marginEnd: "-1",
opacity: 0.5,
_disabled: {
opacity: 0.4
},
_focusVisible: {
boxShadow: "outline",
bg: "rgba(0, 0, 0, 0.14)"
},
_hover: {
opacity: 0.8
},
_active: {
opacity: 1
}
});
var baseStyle40 = definePartsStyle26({
container: baseStyleContainer5,
label: baseStyleLabel5,
closeButton: baseStyleCloseButton4
});
var sizes22 = {
sm: definePartsStyle26({
container: {
[$minH.variable]: "sizes.5",
[$minW.variable]: "sizes.5",
[$fontSize2.variable]: "fontSizes.xs",
[$paddingX.variable]: "space.2"
},
closeButton: {
marginEnd: "-2px",
marginStart: "0.35rem"
}
}),
md: definePartsStyle26({
container: {
[$minH.variable]: "sizes.6",
[$minW.variable]: "sizes.6",
[$fontSize2.variable]: "fontSizes.sm",
[$paddingX.variable]: "space.2"
}
}),
lg: definePartsStyle26({
container: {
[$minH.variable]: "sizes.8",
[$minW.variable]: "sizes.8",
[$fontSize2.variable]: "fontSizes.md",
[$paddingX.variable]: "space.3"
}
})
};
var variants11 = {
subtle: definePartsStyle26((props) => {
var _a8;
return {
container: (_a8 = badgeTheme.variants) == null ? void 0 : _a8.subtle(props)
};
}),
solid: definePartsStyle26((props) => {
var _a8;
return {
container: (_a8 = badgeTheme.variants) == null ? void 0 : _a8.solid(props)
};
}),
outline: definePartsStyle26((props) => {
var _a8;
return {
container: (_a8 = badgeTheme.variants) == null ? void 0 : _a8.outline(props)
};
})
};
var tagTheme = defineMultiStyleConfig26({
variants: variants11,
baseStyle: baseStyle40,
sizes: sizes22,
defaultProps: {
size: "md",
variant: "subtle",
colorScheme: "gray"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/textarea.mjs
var _a5;
var baseStyle41 = defineStyle({
...(_a5 = inputTheme.baseStyle) == null ? void 0 : _a5.field,
paddingY: "2",
minHeight: "20",
lineHeight: "short",
verticalAlign: "top"
});
var _a6;
var variants12 = {
outline: defineStyle(
(props) => {
var _a8;
return ((_a8 = inputTheme.variants) == null ? void 0 : _a8.outline(props).field) ?? {};
}
),
flushed: defineStyle(
(props) => {
var _a8;
return ((_a8 = inputTheme.variants) == null ? void 0 : _a8.flushed(props).field) ?? {};
}
),
filled: defineStyle(
(props) => {
var _a8;
return ((_a8 = inputTheme.variants) == null ? void 0 : _a8.filled(props).field) ?? {};
}
),
unstyled: ((_a6 = inputTheme.variants) == null ? void 0 : _a6.unstyled.field) ?? {}
};
var _a7, _b2, _c2, _d2;
var sizes23 = {
xs: ((_a7 = inputTheme.sizes) == null ? void 0 : _a7.xs.field) ?? {},
sm: ((_b2 = inputTheme.sizes) == null ? void 0 : _b2.sm.field) ?? {},
md: ((_c2 = inputTheme.sizes) == null ? void 0 : _c2.md.field) ?? {},
lg: ((_d2 = inputTheme.sizes) == null ? void 0 : _d2.lg.field) ?? {}
};
var textareaTheme = defineStyleConfig({
baseStyle: baseStyle41,
sizes: sizes23,
variants: variants12,
defaultProps: {
size: "md",
variant: "outline"
}
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/tooltip.mjs
var $bg16 = cssVar2("tooltip-bg");
var $fg6 = cssVar2("tooltip-fg");
var $arrowBg2 = cssVar2("popper-arrow-bg");
var baseStyle42 = defineStyle({
bg: $bg16.reference,
color: $fg6.reference,
[$bg16.variable]: "colors.gray.700",
[$fg6.variable]: "colors.whiteAlpha.900",
_dark: {
[$bg16.variable]: "colors.gray.300",
[$fg6.variable]: "colors.gray.900"
},
[$arrowBg2.variable]: $bg16.reference,
px: "2",
py: "0.5",
borderRadius: "sm",
fontWeight: "medium",
fontSize: "sm",
boxShadow: "md",
maxW: "xs",
zIndex: "tooltip"
});
var tooltipTheme = defineStyleConfig({
baseStyle: baseStyle42
});
// ../../node_modules/@chakra-ui/theme/dist/esm/components/index.mjs
var components = {
Accordion: accordionTheme,
Alert: alertTheme,
Avatar: avatarTheme,
Badge: badgeTheme,
Breadcrumb: breadcrumbTheme,
Button: buttonTheme,
Checkbox: checkboxTheme,
CloseButton: closeButtonTheme,
Code: codeTheme,
Container: containerTheme,
Divider: dividerTheme,
Drawer: drawerTheme,
Editable: editableTheme,
Form: formTheme,
FormError: formErrorTheme,
FormLabel: formLabelTheme,
Heading: headingTheme,
Input: inputTheme,
Kbd: kbdTheme,
Link: linkTheme,
List: listTheme,
Menu: menuTheme,
Modal: modalTheme,
NumberInput: numberInputTheme,
PinInput: pinInputTheme,
Popover: popoverTheme,
Progress: progressTheme,
Radio: radioTheme,
Select: selectTheme,
Skeleton: skeletonTheme,
SkipLink: skipLinkTheme,
Slider: sliderTheme,
Spinner: spinnerTheme,
Stat: statTheme,
Switch: switchTheme,
Table: tableTheme,
Tabs: tabsTheme,
Tag: tagTheme,
Textarea: textareaTheme,
Tooltip: tooltipTheme,
Card: cardTheme,
Stepper: stepperTheme
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/borders.mjs
var borders = {
none: 0,
"1px": "1px solid",
"2px": "2px solid",
"4px": "4px solid",
"8px": "8px solid"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/breakpoints.mjs
var breakpoints2 = {
base: "0em",
sm: "30em",
md: "48em",
lg: "62em",
xl: "80em",
"2xl": "96em"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/colors.mjs
var colors = {
transparent: "transparent",
current: "currentColor",
black: "#000000",
white: "#FFFFFF",
whiteAlpha: {
50: "rgba(255, 255, 255, 0.04)",
100: "rgba(255, 255, 255, 0.06)",
200: "rgba(255, 255, 255, 0.08)",
300: "rgba(255, 255, 255, 0.16)",
400: "rgba(255, 255, 255, 0.24)",
500: "rgba(255, 255, 255, 0.36)",
600: "rgba(255, 255, 255, 0.48)",
700: "rgba(255, 255, 255, 0.64)",
800: "rgba(255, 255, 255, 0.80)",
900: "rgba(255, 255, 255, 0.92)"
},
blackAlpha: {
50: "rgba(0, 0, 0, 0.04)",
100: "rgba(0, 0, 0, 0.06)",
200: "rgba(0, 0, 0, 0.08)",
300: "rgba(0, 0, 0, 0.16)",
400: "rgba(0, 0, 0, 0.24)",
500: "rgba(0, 0, 0, 0.36)",
600: "rgba(0, 0, 0, 0.48)",
700: "rgba(0, 0, 0, 0.64)",
800: "rgba(0, 0, 0, 0.80)",
900: "rgba(0, 0, 0, 0.92)"
},
gray: {
50: "#F7FAFC",
100: "#EDF2F7",
200: "#E2E8F0",
300: "#CBD5E0",
400: "#A0AEC0",
500: "#718096",
600: "#4A5568",
700: "#2D3748",
800: "#1A202C",
900: "#171923"
},
red: {
50: "#FFF5F5",
100: "#FED7D7",
200: "#FEB2B2",
300: "#FC8181",
400: "#F56565",
500: "#E53E3E",
600: "#C53030",
700: "#9B2C2C",
800: "#822727",
900: "#63171B"
},
orange: {
50: "#FFFAF0",
100: "#FEEBC8",
200: "#FBD38D",
300: "#F6AD55",
400: "#ED8936",
500: "#DD6B20",
600: "#C05621",
700: "#9C4221",
800: "#7B341E",
900: "#652B19"
},
yellow: {
50: "#FFFFF0",
100: "#FEFCBF",
200: "#FAF089",
300: "#F6E05E",
400: "#ECC94B",
500: "#D69E2E",
600: "#B7791F",
700: "#975A16",
800: "#744210",
900: "#5F370E"
},
green: {
50: "#F0FFF4",
100: "#C6F6D5",
200: "#9AE6B4",
300: "#68D391",
400: "#48BB78",
500: "#38A169",
600: "#2F855A",
700: "#276749",
800: "#22543D",
900: "#1C4532"
},
teal: {
50: "#E6FFFA",
100: "#B2F5EA",
200: "#81E6D9",
300: "#4FD1C5",
400: "#38B2AC",
500: "#319795",
600: "#2C7A7B",
700: "#285E61",
800: "#234E52",
900: "#1D4044"
},
blue: {
50: "#ebf8ff",
100: "#bee3f8",
200: "#90cdf4",
300: "#63b3ed",
400: "#4299e1",
500: "#3182ce",
600: "#2b6cb0",
700: "#2c5282",
800: "#2a4365",
900: "#1A365D"
},
cyan: {
50: "#EDFDFD",
100: "#C4F1F9",
200: "#9DECF9",
300: "#76E4F7",
400: "#0BC5EA",
500: "#00B5D8",
600: "#00A3C4",
700: "#0987A0",
800: "#086F83",
900: "#065666"
},
purple: {
50: "#FAF5FF",
100: "#E9D8FD",
200: "#D6BCFA",
300: "#B794F4",
400: "#9F7AEA",
500: "#805AD5",
600: "#6B46C1",
700: "#553C9A",
800: "#44337A",
900: "#322659"
},
pink: {
50: "#FFF5F7",
100: "#FED7E2",
200: "#FBB6CE",
300: "#F687B3",
400: "#ED64A6",
500: "#D53F8C",
600: "#B83280",
700: "#97266D",
800: "#702459",
900: "#521B41"
}
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/radius.mjs
var radii = {
none: "0",
sm: "0.125rem",
base: "0.25rem",
md: "0.375rem",
lg: "0.5rem",
xl: "0.75rem",
"2xl": "1rem",
"3xl": "1.5rem",
full: "9999px"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/shadows.mjs
var shadows = {
xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
outline: "0 0 0 3px rgba(66, 153, 225, 0.6)",
inner: "inset 0 2px 4px 0 rgba(0,0,0,0.06)",
none: "none",
"dark-lg": "rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/transition.mjs
var transitionProperty = {
common: "background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",
colors: "background-color, border-color, color, fill, stroke",
dimensions: "width, height",
position: "left, right, top, bottom",
background: "background-color, background-image, background-position"
};
var transitionTimingFunction = {
"ease-in": "cubic-bezier(0.4, 0, 1, 1)",
"ease-out": "cubic-bezier(0, 0, 0.2, 1)",
"ease-in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
};
var transitionDuration = {
"ultra-fast": "50ms",
faster: "100ms",
fast: "150ms",
normal: "200ms",
slow: "300ms",
slower: "400ms",
"ultra-slow": "500ms"
};
var transition2 = {
property: transitionProperty,
easing: transitionTimingFunction,
duration: transitionDuration
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/z-index.mjs
var zIndices = {
hide: -1,
auto: "auto",
base: 0,
docked: 10,
dropdown: 1e3,
sticky: 1100,
banner: 1200,
overlay: 1300,
modal: 1400,
popover: 1500,
skipLink: 1600,
toast: 1700,
tooltip: 1800
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/blur.mjs
var blur = {
none: 0,
sm: "4px",
base: "8px",
md: "12px",
lg: "16px",
xl: "24px",
"2xl": "40px",
"3xl": "64px"
};
// ../../node_modules/@chakra-ui/theme/dist/esm/foundations/index.mjs
var foundations = {
breakpoints: breakpoints2,
zIndices,
radii,
blur,
colors,
...typography2,
sizes,
shadows,
space: spacing,
borders,
transition: transition2
};
// ../../node_modules/@chakra-ui/theme/dist/esm/semantic-tokens.mjs
var semanticTokens = {
colors: {
"chakra-body-text": { _light: "gray.800", _dark: "whiteAlpha.900" },
"chakra-body-bg": { _light: "white", _dark: "gray.800" },
"chakra-border-color": { _light: "gray.200", _dark: "whiteAlpha.300" },
"chakra-inverse-text": { _light: "white", _dark: "gray.800" },
"chakra-subtle-bg": { _light: "gray.100", _dark: "gray.700" },
"chakra-subtle-text": { _light: "gray.600", _dark: "gray.400" },
"chakra-placeholder-color": { _light: "gray.500", _dark: "whiteAlpha.400" }
}
};
// ../../node_modules/@chakra-ui/theme/dist/esm/styles.mjs
var styles = {
global: {
body: {
fontFamily: "body",
color: "chakra-body-text",
bg: "chakra-body-bg",
transitionProperty: "background-color",
transitionDuration: "normal",
lineHeight: "base"
},
"*::placeholder": {
color: "chakra-placeholder-color"
},
"*, *::before, &::after": {
borderColor: "chakra-border-color"
}
}
};
// ../../node_modules/@chakra-ui/theme/dist/esm/utils/is-chakra-theme.mjs
var requiredChakraThemeKeys = [
"borders",
"breakpoints",
"colors",
"components",
"config",
"direction",
"fonts",
"fontSizes",
"fontWeights",
"letterSpacings",
"lineHeights",
"radii",
"shadows",
"sizes",
"space",
"styles",
"transition",
"zIndices"
];
function isChakraTheme(unit) {
if (!isObject(unit)) {
return false;
}
return requiredChakraThemeKeys.every(
(propertyName) => Object.prototype.hasOwnProperty.call(unit, propertyName)
);
}
// ../../node_modules/@chakra-ui/theme/dist/esm/index.mjs
var direction = "ltr";
var config = {
useSystemColorMode: false,
initialColorMode: "light",
cssVarPrefix: "chakra"
};
var theme = {
semanticTokens,
direction,
...foundations,
components,
styles,
config
};
var baseTheme = {
semanticTokens,
direction,
components: {},
...foundations,
styles,
config
};
// ../../node_modules/@chakra-ui/react/dist/esm/provider/create-provider.mjs
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/provider/provider.mjs
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-provider.mjs
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js
var React2 = __toESM(require_react());
var import_react24 = __toESM(require_react());
// ../../node_modules/@emotion/sheet/dist/emotion-sheet.development.esm.js
var isDevelopment = true;
function sheetForTag(tag) {
if (tag.sheet) {
return tag.sheet;
}
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
return document.styleSheets[i];
}
}
return void 0;
}
function createStyleElement(options) {
var tag = document.createElement("style");
tag.setAttribute("data-emotion", options.key);
if (options.nonce !== void 0) {
tag.setAttribute("nonce", options.nonce);
}
tag.appendChild(document.createTextNode(""));
tag.setAttribute("data-s", "");
return tag;
}
var StyleSheet = function() {
function StyleSheet2(options) {
var _this = this;
this._insertTag = function(tag) {
var before;
if (_this.tags.length === 0) {
if (_this.insertionPoint) {
before = _this.insertionPoint.nextSibling;
} else if (_this.prepend) {
before = _this.container.firstChild;
} else {
before = _this.before;
}
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options.speedy === void 0 ? !isDevelopment : options.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options.nonce;
this.key = options.key;
this.container = options.container;
this.prepend = options.prepend;
this.insertionPoint = options.insertionPoint;
this.before = null;
}
var _proto = StyleSheet2.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert(rule) {
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
{
var isImportRule3 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
if (isImportRule3 && this._alreadyInsertedOrderInsensitiveRule) {
console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
}
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule3;
}
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
sheet.insertRule(rule, sheet.cssRules.length);
} catch (e) {
if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
console.error('There was a problem inserting the following rule: "' + rule + '"', e);
}
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
this.tags.forEach(function(tag) {
var _tag$parentNode;
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
{
this._alreadyInsertedOrderInsensitiveRule = false;
}
};
return StyleSheet2;
}();
// ../../node_modules/stylis/src/Enum.js
var MS = "-ms-";
var MOZ = "-moz-";
var WEBKIT = "-webkit-";
var COMMENT = "comm";
var RULESET = "rule";
var DECLARATION = "decl";
var IMPORT = "@import";
var KEYFRAMES = "@keyframes";
var LAYER = "@layer";
// ../../node_modules/stylis/src/Utility.js
var abs = Math.abs;
var from = String.fromCharCode;
var assign = Object.assign;
function hash2(value, length2) {
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
}
function trim(value) {
return value.trim();
}
function match(value, pattern) {
return (value = pattern.exec(value)) ? value[0] : value;
}
function replace(value, pattern, replacement) {
return value.replace(pattern, replacement);
}
function indexof(value, search) {
return value.indexOf(search);
}
function charat(value, index2) {
return value.charCodeAt(index2) | 0;
}
function substr(value, begin, end2) {
return value.slice(begin, end2);
}
function strlen(value) {
return value.length;
}
function sizeof(value) {
return value.length;
}
function append(value, array) {
return array.push(value), value;
}
function combine(array, callback) {
return array.map(callback).join("");
}
// ../../node_modules/stylis/src/Tokenizer.js
var line = 1;
var column = 1;
var length = 0;
var position2 = 0;
var character = 0;
var characters = "";
function node(value, root, parent, type, props, children, length2) {
return { value, root, parent, type, props, children, line, column, length: length2, return: "" };
}
function copy2(root, props) {
return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
}
function char() {
return character;
}
function prev() {
character = position2 > 0 ? charat(characters, --position2) : 0;
if (column--, character === 10)
column = 1, line--;
return character;
}
function next() {
character = position2 < length ? charat(characters, position2++) : 0;
if (column++, character === 10)
column = 1, line++;
return character;
}
function peek() {
return charat(characters, position2);
}
function caret() {
return position2;
}
function slice(begin, end2) {
return substr(characters, begin, end2);
}
function token(type) {
switch (type) {
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), position2 = 0, [];
}
function dealloc(value) {
return characters = "", value;
}
function delimit(type) {
return trim(slice(position2 - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
}
function whitespace(type) {
while (character = peek())
if (character < 33)
next();
else
break;
return token(type) > 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(type) {
while (next())
switch (character) {
case type:
return position2;
case 34:
case 39:
if (type !== 34 && type !== 39)
delimiter(character);
break;
case 40:
if (type === 41)
delimiter(type);
break;
case 92:
next();
break;
}
return position2;
}
function commenter(type, index2) {
while (next())
if (type + character === 47 + 10)
break;
else if (type + character === 42 + 42 && peek() === 47)
break;
return "/*" + slice(index2, position2 - 1) + "*" + from(type === 47 ? type : next());
}
function identifier(index2) {
while (!token(peek()))
next();
return slice(index2, position2);
}
// ../../node_modules/stylis/src/Parser.js
function compile(value) {
return dealloc(parse2("", null, null, null, [""], value = alloc(value), 0, [0], value));
}
function parse2(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
var index2 = 0;
var offset2 = 0;
var length2 = pseudo;
var atrule = 0;
var property = 0;
var previous = 0;
var variable = 1;
var scanning = 1;
var ampersand = 1;
var character2 = 0;
var type = "";
var props = rules;
var children = rulesets;
var reference2 = rule;
var characters2 = type;
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(previous);
break;
case 92:
characters2 += escaping(caret() - 1, 7);
continue;
case 47:
switch (peek()) {
case 42:
case 47:
append(comment(commenter(next(), caret()), root, parent), declarations);
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 (property > 0 && strlen(characters2) - length2)
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
break;
case 59:
characters2 += ";";
default:
append(reference2 = ruleset(characters2, root, parent, index2, offset2, rules, points, type, props = [], children = [], length2), rulesets);
if (character2 === 123)
if (offset2 === 0)
parse2(characters2, root, reference2, reference2, props, rulesets, length2, points, children);
else
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
case 100:
case 108:
case 109:
case 115:
parse2(value, reference2, reference2, rule && append(ruleset(value, reference2, reference2, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
break;
default:
parse2(characters2, reference2, reference2, reference2, [""], children, 0, points, children);
}
}
index2 = offset2 = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
break;
case 58:
length2 = 1 + strlen(characters2), property = previous;
default:
if (variable < 1) {
if (character2 == 123)
--variable;
else if (character2 == 125 && variable++ == 0 && prev() == 125)
continue;
}
switch (characters2 += from(character2), character2 * variable) {
case 38:
ampersand = offset2 > 0 ? 1 : (characters2 += "\f", -1);
break;
case 44:
points[index2++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
break;
case 64:
if (peek() === 45)
characters2 += delimit(next());
atrule = peek(), offset2 = length2 = strlen(type = characters2 += identifier(caret())), character2++;
break;
case 45:
if (previous === 45 && strlen(characters2) == 2)
variable = 0;
}
}
return rulesets;
}
function ruleset(value, root, parent, index2, offset2, rules, points, type, props, children, length2) {
var post = offset2 - 1;
var rule = offset2 === 0 ? rules : [""];
var size2 = sizeof(rule);
for (var i = 0, j = 0, k = 0; i < index2; ++i)
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size2; ++x)
if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
props[k++] = z;
return node(value, root, parent, offset2 === 0 ? RULESET : type, props, children, length2);
}
function comment(value, root, parent) {
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
}
function declaration(value, root, parent, length2) {
return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
}
// ../../node_modules/stylis/src/Serializer.js
function serialize(children, callback) {
var output = "";
var length2 = sizeof(children);
for (var i = 0; i < length2; i++)
output += callback(children[i], i, 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:
element.value = element.props.join(",");
}
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
}
// ../../node_modules/stylis/src/Middleware.js
function middleware(collection) {
var length2 = sizeof(collection);
return function(element, index2, children, callback) {
var output = "";
for (var i = 0; i < length2; i++)
output += collection[i](element, index2, children, callback) || "";
return output;
};
}
// ../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
var weakMemoize = function weakMemoize2(func2) {
var cache = /* @__PURE__ */ new WeakMap();
return function(arg) {
if (cache.has(arg)) {
return cache.get(arg);
}
var ret = func2(arg);
cache.set(arg, ret);
return ret;
};
};
// ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize3(fn2) {
var cache = /* @__PURE__ */ Object.create(null);
return function(arg) {
if (cache[arg] === void 0) cache[arg] = fn2(arg);
return cache[arg];
};
}
// ../../node_modules/@emotion/cache/dist/emotion-cache.browser.development.esm.js
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index2) {
var previous = 0;
var character2 = 0;
while (true) {
previous = character2;
character2 = peek();
if (previous === 38 && character2 === 12) {
points[index2] = 1;
}
if (token(character2)) {
break;
}
next();
}
return slice(begin, position2);
};
var toRules = function toRules2(parsed, points) {
var index2 = -1;
var character2 = 44;
do {
switch (token(character2)) {
case 0:
if (character2 === 38 && peek() === 12) {
points[index2] = 1;
}
parsed[index2] += identifierWithPointTracking(position2 - 1, points, index2);
break;
case 2:
parsed[index2] += delimit(character2);
break;
case 4:
if (character2 === 44) {
parsed[++index2] = peek() === 58 ? "&\f" : "";
points[index2] = parsed[index2].length;
break;
}
default:
parsed[index2] += from(character2);
}
} while (character2 = next());
return parsed;
};
var getRules = function getRules2(value, points) {
return dealloc(toRules(alloc(value), points));
};
var fixedElements = /* @__PURE__ */ new WeakMap();
var compat = function compat2(element) {
if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
// negative .length indicates that this rule has been already prefixed
element.length < 1) {
return;
}
var value = element.value;
var parent = element.parent;
var isImplicitRule = element.column === parent.column && element.line === parent.line;
while (parent.type !== "rule") {
parent = parent.parent;
if (!parent) return;
}
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
return;
}
if (isImplicitRule) {
return;
}
fixedElements.set(element, true);
var points = [];
var rules = getRules(value, points);
var parentRules = parent.props;
for (var i = 0, k = 0; i < rules.length; i++) {
for (var j = 0; j < parentRules.length; j++, k++) {
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
}
}
};
var removeLabel = function removeLabel2(element) {
if (element.type === "decl") {
var value = element.value;
if (
// charcode for l
value.charCodeAt(0) === 108 && // charcode for b
value.charCodeAt(2) === 98
) {
element["return"] = "";
element.value = "";
}
}
};
var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
var isIgnoringComment = function isIgnoringComment2(element) {
return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1;
};
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache) {
return function(element, index2, children) {
if (element.type !== "rule" || cache.compat) return;
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
if (unsafePseudoClasses) {
var isNested = !!element.parent;
var commentContainer = isNested ? element.parent.children : (
// global rule at the root level
children
);
for (var i = commentContainer.length - 1; i >= 0; i--) {
var node3 = commentContainer[i];
if (node3.line < element.line) {
break;
}
if (node3.column < element.column) {
if (isIgnoringComment(node3)) {
return;
}
break;
}
}
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
});
}
};
};
var isImportRule = function isImportRule2(element) {
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
};
var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index2, children) {
for (var i = index2 - 1; i >= 0; i--) {
if (!isImportRule(children[i])) {
return true;
}
}
return false;
};
var nullifyElement = function nullifyElement2(element) {
element.type = "";
element.value = "";
element["return"] = "";
element.children = "";
element.props = "";
};
var incorrectImportAlarm = function incorrectImportAlarm2(element, index2, children) {
if (!isImportRule(element)) {
return;
}
if (element.parent) {
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
nullifyElement(element);
} else if (isPrependedWithRegularRules(index2, children)) {
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
nullifyElement(element);
}
};
function prefix2(value, length2) {
switch (hash2(value, length2)) {
case 5103:
return WEBKIT + "print-" + value + value;
case 5737:
case 4201:
case 3177:
case 3433:
case 1641:
case 4457:
case 2921:
case 5572:
case 6356:
case 5844:
case 3191:
case 6645:
case 3005:
case 6391:
case 5879:
case 5623:
case 6135:
case 4599:
case 4855:
case 4215:
case 6389:
case 5109:
case 5365:
case 5621:
case 3829:
return WEBKIT + value + value;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return WEBKIT + value + MOZ + value + MS + value + value;
case 6828:
case 4268:
return WEBKIT + value + MS + value + value;
case 6165:
return WEBKIT + value + MS + "flex-" + value + value;
case 5187:
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
case 5443:
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
case 4675:
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
case 5548:
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
case 5292:
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
case 6060:
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
case 4554:
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
case 6187:
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
case 5495:
case 3959:
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
case 4968:
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
case 4095:
case 3583:
case 4068:
case 2532:
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
case 8116:
case 7059:
case 5753:
case 5535:
case 5445:
case 5701:
case 4933:
case 4677:
case 5533:
case 5789:
case 5021:
case 4765:
if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
case 109:
if (charat(value, length2 + 4) !== 45) break;
case 102:
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
case 115:
return ~indexof(value, "stretch") ? prefix2(replace(value, "stretch", "fill-available"), length2) + value : value;
}
break;
case 4949:
if (charat(value, length2 + 1) !== 115) break;
case 6444:
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
case 107:
return replace(value, ":", ":" + WEBKIT) + value;
case 101:
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
}
break;
case 5936:
switch (charat(value, length2 + 11)) {
case 114:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
case 108:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
case 45:
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
}
return WEBKIT + value + MS + value + value;
}
return value;
}
var prefixer = function prefixer2(element, index2, children, callback) {
if (element.length > -1) {
if (!element["return"]) switch (element.type) {
case DECLARATION:
element["return"] = prefix2(element.value, element.length);
break;
case KEYFRAMES:
return serialize([copy2(element, {
value: replace(element.value, "@", "@" + WEBKIT)
})], callback);
case RULESET:
if (element.length) return combine(element.props, function(value) {
switch (match(value, /(::plac\w+|:read-\w+)/)) {
case ":read-only":
case ":read-write":
return serialize([copy2(element, {
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
})], callback);
case "::placeholder":
return serialize([copy2(element, {
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
}), copy2(element, {
props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
}), copy2(element, {
props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
})], callback);
}
return "";
});
}
}
};
var defaultStylisPlugins = [prefixer];
var getSourceMap;
{
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
getSourceMap = function getSourceMap2(styles2) {
var matches = styles2.match(sourceMapPattern);
if (!matches) return;
return matches[matches.length - 1];
};
}
var sourceMapPattern;
var createCache = function createCache2(options) {
var key = options.key;
if (!key) {
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
}
if (key === "css") {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
Array.prototype.forEach.call(ssrStyles, function(node3) {
var dataEmotionAttribute = node3.getAttribute("data-emotion");
if (dataEmotionAttribute.indexOf(" ") === -1) {
return;
}
document.head.appendChild(node3);
node3.setAttribute("data-s", "");
});
}
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
{
if (/[^a-z-]/.test(key)) {
throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
}
}
var inserted = {};
var container2;
var nodesToHydrate = [];
{
container2 = options.container || document.head;
Array.prototype.forEach.call(
// this means we will ignore elements which don't have a space in them which
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
function(node3) {
var attrib = node3.getAttribute("data-emotion").split(" ");
for (var i = 1; i < attrib.length; i++) {
inserted[attrib[i]] = true;
}
nodesToHydrate.push(node3);
}
);
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
{
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
get compat() {
return cache.compat;
}
}), incorrectImportAlarm);
}
{
var currentSheet;
var finalizingPlugins = [stringify, function(element) {
if (!element.root) {
if (element["return"]) {
currentSheet.insert(element["return"]);
} else if (element.value && element.type !== COMMENT) {
currentSheet.insert(element.value + "{}");
}
}
}];
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis2(styles2) {
return serialize(compile(styles2), serializer);
};
_insert = function insert(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
if (getSourceMap) {
var sourceMap = getSourceMap(serialized.styles);
if (sourceMap) {
currentSheet = {
insert: function insert2(rule) {
sheet.insert(rule + sourceMap);
}
};
}
}
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache.inserted[serialized.name] = true;
}
};
}
var cache = {
key,
sheet: new StyleSheet({
key,
container: container2,
nonce: options.nonce,
speedy: options.speedy,
prepend: options.prepend,
insertionPoint: options.insertionPoint
}),
nonce: options.nonce,
inserted,
registered: {},
insert: _insert
};
cache.sheet.hydrate(nodesToHydrate);
return cache;
};
// ../../node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function(n) {
for (var e = 1; e < arguments.length; e++) {
var t2 = arguments[e];
for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n[r2] = t2[r2]);
}
return n;
}, _extends.apply(null, arguments);
}
// ../../node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
// ../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var isBrowser2 = true;
function getRegisteredStyles(registered, registeredStyles, classNames2) {
var rawClassName = "";
classNames2.split(" ").forEach(function(className) {
if (registered[className] !== void 0) {
registeredStyles.push(registered[className] + ";");
} else if (className) {
rawClassName += className + " ";
}
});
return rawClassName;
}
var registerStyles = function registerStyles2(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if (
// we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser2 === false) && cache.registered[className] === void 0
) {
cache.registered[className] = serialized.styles;
}
};
var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
registerStyles(cache, serialized, isStringTag);
var className = cache.key + "-" + serialized.name;
if (cache.inserted[serialized.name] === void 0) {
var current = serialized;
do {
cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
current = current.next;
} while (current !== void 0);
}
};
// ../../node_modules/@emotion/hash/dist/emotion-hash.esm.js
function murmur2(str) {
var h = 0;
var k, i = 0, len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
k = /* Math.imul(k, m): */
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
k ^= /* k >>> r: */
k >>> 24;
h = /* Math.imul(k, m): */
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 255) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 255) << 8;
case 1:
h ^= str.charCodeAt(i) & 255;
h = /* Math.imul(h, m): */
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
}
h ^= h >>> 13;
h = /* Math.imul(h, m): */
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
// ../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
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,
scale: 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
};
// ../../node_modules/@emotion/serialize/dist/emotion-serialize.development.esm.js
var isDevelopment2 = true;
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty2(property) {
return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue2(value) {
return value != null && typeof value !== "boolean";
};
var processStyleName = memoize3(function(styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
});
var processStyleValue = function processStyleValue2(key, value) {
switch (key) {
case "animation":
case "animationName": {
if (typeof value === "string") {
return value.replace(animationRegex, function(match3, p1, p2) {
cursor = {
name: p1,
styles: p2,
next: cursor
};
return p1;
});
}
}
}
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
return value + "px";
}
return value;
};
{
contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
contentValues = ["normal", "none", "initial", "inherit", "unset"];
oldProcessStyleValue = processStyleValue;
msPattern = /^-ms-/;
hyphenPattern = /-(.)/g;
hyphenatedCache = {};
processStyleValue = function processStyleValue3(key, value) {
if (key === "content") {
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) !== "'")) {
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
}
}
var processed = oldProcessStyleValue(key, value);
if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
hyphenatedCache[key] = true;
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
return _char.toUpperCase();
}) + "?");
}
return processed;
};
}
var contentValuePattern;
var contentValues;
var oldProcessStyleValue;
var msPattern;
var hyphenPattern;
var hyphenatedCache;
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return "";
}
var componentSelector = interpolation;
if (componentSelector.__emotion_styles !== void 0) {
if (String(componentSelector) === "NO_COMPONENT_SELECTOR") {
throw new Error(noComponentSelectorMessage);
}
return componentSelector;
}
switch (typeof interpolation) {
case "boolean": {
return "";
}
case "object": {
var keyframes3 = interpolation;
if (keyframes3.anim === 1) {
cursor = {
name: keyframes3.name,
styles: keyframes3.styles,
next: cursor
};
return keyframes3.name;
}
var serializedStyles = interpolation;
if (serializedStyles.styles !== void 0) {
var next2 = serializedStyles.next;
if (next2 !== void 0) {
while (next2 !== void 0) {
cursor = {
name: next2.name,
styles: next2.styles,
next: cursor
};
next2 = next2.next;
}
}
var styles2 = serializedStyles.styles + ";";
return styles2;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case "function": {
if (mergedProps !== void 0) {
var previousCursor = cursor;
var result = interpolation(mergedProps);
cursor = previousCursor;
return handleInterpolation(mergedProps, registered, result);
} else {
console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
}
break;
}
case "string":
{
var matched = [];
var replaced = interpolation.replace(animationRegex, function(_match, _p1, p2) {
var fakeVarName = "animation" + matched.length;
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
return "${" + fakeVarName + "}";
});
if (matched.length) {
console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\ncss`" + replaced + "`");
}
}
break;
}
var asString = interpolation;
if (registered == null) {
return asString;
}
var cached = registered[asString];
return cached !== void 0 ? cached : asString;
}
function createStringFromObject(mergedProps, registered, obj) {
var string2 = "";
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string2 += handleInterpolation(mergedProps, registered, obj[i]) + ";";
}
} else {
for (var key in obj) {
var value = obj[key];
if (typeof value !== "object") {
var asString = value;
if (registered != null && registered[asString] !== void 0) {
string2 += key + "{" + registered[asString] + "}";
} else if (isProcessableValue(asString)) {
string2 += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
}
} else {
if (key === "NO_COMPONENT_SELECTOR" && isDevelopment2) {
throw new Error(noComponentSelectorMessage);
}
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
for (var _i = 0; _i < value.length; _i++) {
if (isProcessableValue(value[_i])) {
string2 += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value);
switch (key) {
case "animation":
case "animationName": {
string2 += processStyleName(key) + ":" + interpolated + ";";
break;
}
default: {
if (key === "undefined") {
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
}
string2 += key + "{" + interpolated + "}";
}
}
}
}
}
}
return string2;
}
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g;
var cursor;
function serializeStyles(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
return args[0];
}
var stringMode = true;
var styles2 = "";
cursor = void 0;
var strings = args[0];
if (strings == null || strings.raw === void 0) {
stringMode = false;
styles2 += handleInterpolation(mergedProps, registered, strings);
} else {
var asTemplateStringsArr = strings;
if (asTemplateStringsArr[0] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles2 += asTemplateStringsArr[0];
}
for (var i = 1; i < args.length; i++) {
styles2 += handleInterpolation(mergedProps, registered, args[i]);
if (stringMode) {
var templateStringsArr = strings;
if (templateStringsArr[i] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles2 += templateStringsArr[i];
}
}
labelPattern.lastIndex = 0;
var identifierName = "";
var match3;
while ((match3 = labelPattern.exec(styles2)) !== null) {
identifierName += "-" + match3[1];
}
var name = murmur2(styles2) + identifierName;
{
var devStyles = {
name,
styles: styles2,
next: cursor,
toString: function toString() {
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
};
return devStyles;
}
}
// ../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
var React = __toESM(require_react());
var syncFallback = function syncFallback2(create) {
return create();
};
var useInsertionEffect2 = React["useInsertionEffect"] ? React["useInsertionEffect"] : false;
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect2 || syncFallback;
var useInsertionEffectWithLayoutFallback = useInsertionEffect2 || React.useLayoutEffect;
// ../../node_modules/@emotion/react/dist/emotion-element-489459f2.browser.development.esm.js
var EmotionCacheContext = React2.createContext(
// we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== "undefined" ? createCache({
key: "css"
}) : null
);
{
EmotionCacheContext.displayName = "EmotionCacheContext";
}
var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
return (0, import_react24.useContext)(EmotionCacheContext);
};
var withEmotionCache = function withEmotionCache2(func2) {
return (0, import_react24.forwardRef)(function(props, ref) {
var cache = (0, import_react24.useContext)(EmotionCacheContext);
return func2(props, cache, ref);
});
};
var ThemeContext = React2.createContext({});
{
ThemeContext.displayName = "EmotionThemeContext";
}
var getTheme = function getTheme2(outerTheme, theme2) {
if (typeof theme2 === "function") {
var mergedTheme = theme2(outerTheme);
if (mergedTheme == null || typeof mergedTheme !== "object" || Array.isArray(mergedTheme)) {
throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");
}
return mergedTheme;
}
if (theme2 == null || typeof theme2 !== "object" || Array.isArray(theme2)) {
throw new Error("[ThemeProvider] Please make your theme prop a plain object");
}
return _extends({}, outerTheme, theme2);
};
var createCacheWithTheme = weakMemoize(function(outerTheme) {
return weakMemoize(function(theme2) {
return getTheme(outerTheme, theme2);
});
});
var ThemeProvider = function ThemeProvider2(props) {
var theme2 = React2.useContext(ThemeContext);
if (props.theme !== theme2) {
theme2 = createCacheWithTheme(theme2)(props.theme);
}
return React2.createElement(ThemeContext.Provider, {
value: theme2
}, props.children);
};
var hasOwn = {}.hasOwnProperty;
var getLastPart = function getLastPart2(functionName) {
var parts = functionName.split(".");
return parts[parts.length - 1];
};
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine2(line2) {
var match3 = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line2);
if (match3) return getLastPart(match3[1]);
match3 = /^([A-Za-z0-9$.]+)@/.exec(line2);
if (match3) return getLastPart(match3[1]);
return void 0;
};
var internalReactFunctionNames = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]);
var sanitizeIdentifier = function sanitizeIdentifier2(identifier2) {
return identifier2.replace(/\$/g, "-");
};
var getLabelFromStackTrace = function getLabelFromStackTrace2(stackTrace) {
if (!stackTrace) return void 0;
var lines = stackTrace.split("\n");
for (var i = 0; i < lines.length; i++) {
var functionName = getFunctionNameFromStackTraceLine(lines[i]);
if (!functionName) continue;
if (internalReactFunctionNames.has(functionName)) break;
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
}
return void 0;
};
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
var createEmotionProps = function createEmotionProps2(type, props) {
if (typeof props.css === "string" && // check if there is a css declaration
props.css.indexOf(":") !== -1) {
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
}
var newProps = {};
for (var _key in props) {
if (hasOwn.call(props, _key)) {
newProps[_key] = props[_key];
}
}
newProps[typePropName] = type;
if (typeof globalThis !== "undefined" && !!globalThis.EMOTION_RUNTIME_AUTO_LABEL && !!props.css && (typeof props.css !== "object" || !("name" in props.css) || typeof props.css.name !== "string" || props.css.name.indexOf("-") === -1)) {
var label = getLabelFromStackTrace(new Error().stack);
if (label) newProps[labelPropName] = label;
}
return newProps;
};
var Insertion = function Insertion2(_ref2) {
var cache = _ref2.cache, serialized = _ref2.serialized, isStringTag = _ref2.isStringTag;
registerStyles(cache, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function() {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var Emotion = withEmotionCache(function(props, cache, ref) {
var cssProp = props.css;
if (typeof cssProp === "string" && cache.registered[cssProp] !== void 0) {
cssProp = cache.registered[cssProp];
}
var WrappedComponent = props[typePropName];
var registeredStyles = [cssProp];
var className = "";
if (typeof props.className === "string") {
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, void 0, React2.useContext(ThemeContext));
if (serialized.name.indexOf("-") === -1) {
var labelFromStack = props[labelPropName];
if (labelFromStack) {
serialized = serializeStyles([serialized, "label:" + labelFromStack + ";"]);
}
}
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var _key2 in props) {
if (hasOwn.call(props, _key2) && _key2 !== "css" && _key2 !== typePropName && _key2 !== labelPropName) {
newProps[_key2] = props[_key2];
}
}
newProps.className = className;
if (ref) {
newProps.ref = ref;
}
return React2.createElement(React2.Fragment, null, React2.createElement(Insertion, {
cache,
serialized,
isStringTag: typeof WrappedComponent === "string"
}), React2.createElement(WrappedComponent, newProps));
});
{
Emotion.displayName = "EmotionCssPropInternal";
}
var Emotion$1 = Emotion;
// ../../node_modules/@emotion/react/dist/emotion-react.browser.development.esm.js
var React3 = __toESM(require_react());
var import_hoist_non_react_statics2 = __toESM(require_hoist_non_react_statics_cjs());
var isDevelopment3 = true;
var pkg = {
name: "@emotion/react",
version: "11.14.0",
main: "dist/emotion-react.cjs.js",
module: "dist/emotion-react.esm.js",
types: "dist/emotion-react.cjs.d.ts",
exports: {
".": {
types: {
"import": "./dist/emotion-react.cjs.mjs",
"default": "./dist/emotion-react.cjs.js"
},
development: {
"edge-light": {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
worker: {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
workerd: {
module: "./dist/emotion-react.development.edge-light.esm.js",
"import": "./dist/emotion-react.development.edge-light.cjs.mjs",
"default": "./dist/emotion-react.development.edge-light.cjs.js"
},
browser: {
module: "./dist/emotion-react.browser.development.esm.js",
"import": "./dist/emotion-react.browser.development.cjs.mjs",
"default": "./dist/emotion-react.browser.development.cjs.js"
},
module: "./dist/emotion-react.development.esm.js",
"import": "./dist/emotion-react.development.cjs.mjs",
"default": "./dist/emotion-react.development.cjs.js"
},
"edge-light": {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
worker: {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
workerd: {
module: "./dist/emotion-react.edge-light.esm.js",
"import": "./dist/emotion-react.edge-light.cjs.mjs",
"default": "./dist/emotion-react.edge-light.cjs.js"
},
browser: {
module: "./dist/emotion-react.browser.esm.js",
"import": "./dist/emotion-react.browser.cjs.mjs",
"default": "./dist/emotion-react.browser.cjs.js"
},
module: "./dist/emotion-react.esm.js",
"import": "./dist/emotion-react.cjs.mjs",
"default": "./dist/emotion-react.cjs.js"
},
"./jsx-runtime": {
types: {
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
development: {
"edge-light": {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
worker: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
workerd: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.edge-light.cjs.js"
},
browser: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.development.cjs.js"
},
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.development.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.development.cjs.js"
},
"edge-light": {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
worker: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
workerd: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.edge-light.cjs.js"
},
browser: {
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.cjs.js"
},
module: "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js",
"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
},
"./_isolated-hnrs": {
types: {
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
development: {
"edge-light": {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
worker: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
workerd: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.cjs.js"
},
browser: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.development.cjs.js"
},
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.cjs.js"
},
"edge-light": {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
worker: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
workerd: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.edge-light.cjs.js"
},
browser: {
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.cjs.js"
},
module: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js",
"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
},
"./jsx-dev-runtime": {
types: {
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
development: {
"edge-light": {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
worker: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
workerd: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.edge-light.cjs.js"
},
browser: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.development.cjs.js"
},
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.development.cjs.js"
},
"edge-light": {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
worker: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
workerd: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.edge-light.cjs.js"
},
browser: {
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js"
},
module: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js",
"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
},
"./package.json": "./package.json",
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
},
imports: {
"#is-development": {
development: "./src/conditions/true.ts",
"default": "./src/conditions/false.ts"
},
"#is-browser": {
"edge-light": "./src/conditions/false.ts",
workerd: "./src/conditions/false.ts",
worker: "./src/conditions/false.ts",
browser: "./src/conditions/true.ts",
"default": "./src/conditions/is-browser.ts"
}
},
files: [
"src",
"dist",
"jsx-runtime",
"jsx-dev-runtime",
"_isolated-hnrs",
"types/css-prop.d.ts",
"macro.*"
],
sideEffects: false,
author: "Emotion Contributors",
license: "MIT",
scripts: {
"test:typescript": "dtslint types"
},
dependencies: {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.13.5",
"@emotion/cache": "^11.14.0",
"@emotion/serialize": "^1.3.3",
"@emotion/use-insertion-effect-with-fallbacks": "^1.2.0",
"@emotion/utils": "^1.4.2",
"@emotion/weak-memoize": "^0.4.0",
"hoist-non-react-statics": "^3.3.1"
},
peerDependencies: {
react: ">=16.8.0"
},
peerDependenciesMeta: {
"@types/react": {
optional: true
}
},
devDependencies: {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/css": "11.13.5",
"@emotion/css-prettifier": "1.2.0",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.14.0",
"@types/hoist-non-react-statics": "^3.3.5",
"html-tag-names": "^1.1.2",
react: "16.14.0",
"svg-tag-names": "^1.1.1",
typescript: "^5.4.5"
},
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
publishConfig: {
access: "public"
},
"umd:main": "dist/emotion-react.umd.min.js",
preconstruct: {
entrypoints: [
"./index.ts",
"./jsx-runtime.ts",
"./jsx-dev-runtime.ts",
"./_isolated-hnrs.ts"
],
umdName: "emotionReact",
exports: {
extra: {
"./types/css-prop": "./types/css-prop.d.ts",
"./macro": {
types: {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
}
}
}
};
var jsx = function jsx2(type, props) {
var args = arguments;
if (props == null || !hasOwn.call(props, "css")) {
return React3.createElement.apply(void 0, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion$1;
createElementArgArray[1] = createEmotionProps(type, props);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
}
return React3.createElement.apply(null, createElementArgArray);
};
(function(_jsx) {
var JSX;
/* @__PURE__ */ (function(_JSX) {
})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));
})(jsx || (jsx = {}));
var warnedAboutCssPropForGlobal = false;
var Global = withEmotionCache(function(props, cache) {
if (!warnedAboutCssPropForGlobal && // check for className as well since the user is
// probably using the custom createElement which
// means it will be turned into a className prop
// I don't really want to add it to the type since it shouldn't be used
("className" in props && props.className || "css" in props && props.css)) {
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
warnedAboutCssPropForGlobal = true;
}
var styles2 = props.styles;
var serialized = serializeStyles([styles2], void 0, React3.useContext(ThemeContext));
var sheetRef = React3.useRef();
useInsertionEffectWithLayoutFallback(function() {
var key = cache.key + "-global";
var sheet = new cache.sheet.constructor({
key,
nonce: cache.sheet.nonce,
container: cache.sheet.container,
speedy: cache.sheet.isSpeedy
});
var rehydrating = false;
var node3 = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
if (cache.sheet.tags.length) {
sheet.before = cache.sheet.tags[0];
}
if (node3 !== null) {
rehydrating = true;
node3.setAttribute("data-emotion", key);
sheet.hydrate([node3]);
}
sheetRef.current = [sheet, rehydrating];
return function() {
sheet.flush();
};
}, [cache]);
useInsertionEffectWithLayoutFallback(function() {
var sheetRefCurrent = sheetRef.current;
var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
if (rehydrating) {
sheetRefCurrent[1] = false;
return;
}
if (serialized.next !== void 0) {
insertStyles(cache, serialized.next, true);
}
if (sheet.tags.length) {
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
sheet.before = element;
sheet.flush();
}
cache.insert("", serialized, sheet, false);
}, [cache, serialized.name]);
return null;
});
{
Global.displayName = "EmotionGlobal";
}
function css2() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serializeStyles(args);
}
function keyframes() {
var insertable = css2.apply(void 0, arguments);
var name = "animation-" + insertable.name;
return {
name,
styles: "@keyframes " + name + "{" + insertable.styles + "}",
anim: 1,
toString: function toString() {
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
}
};
}
var classnames = function classnames2(args) {
var len = args.length;
var i = 0;
var cls = "";
for (; i < len; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case "boolean":
break;
case "object": {
if (Array.isArray(arg)) {
toAdd = classnames2(arg);
} else {
if (arg.styles !== void 0 && arg.name !== void 0) {
console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.");
}
toAdd = "";
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += " ");
toAdd += k;
}
}
}
break;
}
default: {
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += " ");
cls += toAdd;
}
}
return cls;
};
function merge2(registered, css4, className) {
var registeredStyles = [];
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css4(registeredStyles);
}
var Insertion3 = function Insertion4(_ref2) {
var cache = _ref2.cache, serializedArr = _ref2.serializedArr;
useInsertionEffectAlwaysWithSyncFallback(function() {
for (var i = 0; i < serializedArr.length; i++) {
insertStyles(cache, serializedArr[i], false);
}
});
return null;
};
var ClassNames = withEmotionCache(function(props, cache) {
var hasRendered = false;
var serializedArr = [];
var css4 = function css5() {
if (hasRendered && isDevelopment3) {
throw new Error("css can only be used during render");
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serializeStyles(args, cache.registered);
serializedArr.push(serialized);
registerStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var cx2 = function cx3() {
if (hasRendered && isDevelopment3) {
throw new Error("cx can only be used during render");
}
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return merge2(cache.registered, css4, classnames(args));
};
var content = {
css: css4,
cx: cx2,
theme: React3.useContext(ThemeContext)
};
var ele = props.children(content);
hasRendered = true;
return React3.createElement(React3.Fragment, null, React3.createElement(Insertion3, {
cache,
serializedArr
}), ele);
});
{
ClassNames.displayName = "EmotionClassNames";
}
{
isBrowser4 = typeof document !== "undefined";
isTestEnv = typeof jest !== "undefined" || typeof vi !== "undefined";
if (isBrowser4 && !isTestEnv) {
globalContext = typeof globalThis !== "undefined" ? globalThis : isBrowser4 ? window : global;
globalKey = "__EMOTION_REACT_" + pkg.version.split(".")[0] + "__";
if (globalContext[globalKey]) {
console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.");
}
globalContext[globalKey] = true;
}
}
var isBrowser4;
var isTestEnv;
var globalContext;
var globalKey;
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-provider.mjs
var import_react27 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-context.mjs
var import_react25 = __toESM(require_react(), 1);
var ColorModeContext = (0, import_react25.createContext)({});
ColorModeContext.displayName = "ColorModeContext";
function useColorMode() {
const context = (0, import_react25.useContext)(ColorModeContext);
if (context === void 0) {
throw new Error("useColorMode must be used within a ColorModeProvider");
}
return context;
}
function useColorModeValue(light, dark) {
const { colorMode } = useColorMode();
return colorMode === "dark" ? dark : light;
}
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode.utils.mjs
var classNames = {
light: "chakra-ui-light",
dark: "chakra-ui-dark"
};
function getColorModeUtils(options = {}) {
const { preventTransition = true, nonce } = options;
const utils = {
setDataset: (value) => {
const cleanup = preventTransition ? utils.preventTransition() : void 0;
document.documentElement.dataset.theme = value;
document.documentElement.style.colorScheme = value;
cleanup == null ? void 0 : cleanup();
},
setClassName(dark) {
document.body.classList.add(dark ? classNames.dark : classNames.light);
document.body.classList.remove(dark ? classNames.light : classNames.dark);
},
query() {
return window.matchMedia("(prefers-color-scheme: dark)");
},
getSystemTheme(fallback) {
const dark = utils.query().matches ?? fallback === "dark";
return dark ? "dark" : "light";
},
addListener(fn2) {
const mql = utils.query();
const listener = (e) => {
fn2(e.matches ? "dark" : "light");
};
if (typeof mql.addListener === "function")
mql.addListener(listener);
else
mql.addEventListener("change", listener);
return () => {
if (typeof mql.removeListener === "function")
mql.removeListener(listener);
else
mql.removeEventListener("change", listener);
};
},
preventTransition() {
const css4 = document.createElement("style");
css4.appendChild(
document.createTextNode(
`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`
)
);
if (nonce !== void 0) {
css4.nonce = nonce;
}
document.head.appendChild(css4);
return () => {
(() => window.getComputedStyle(document.body))();
requestAnimationFrame(() => {
requestAnimationFrame(() => {
document.head.removeChild(css4);
});
});
};
}
};
return utils;
}
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/storage-manager.mjs
var STORAGE_KEY = "chakra-ui-color-mode";
function createLocalStorageManager(key) {
return {
ssr: false,
type: "localStorage",
get(init) {
if (!(globalThis == null ? void 0 : globalThis.document))
return init;
let value;
try {
value = localStorage.getItem(key) || init;
} catch (e) {
}
return value || init;
},
set(value) {
try {
localStorage.setItem(key, value);
} catch (e) {
}
}
};
}
var localStorageManager = createLocalStorageManager(STORAGE_KEY);
function parseCookie(cookie, key) {
const match3 = cookie.match(new RegExp(`(^| )${key}=([^;]+)`));
return match3 == null ? void 0 : match3[2];
}
function createCookieStorageManager(key, cookie) {
return {
ssr: !!cookie,
type: "cookie",
get(init) {
if (cookie)
return parseCookie(cookie, key);
if (!(globalThis == null ? void 0 : globalThis.document))
return init;
return parseCookie(document.cookie, key) || init;
},
set(value) {
document.cookie = `${key}=${value}; max-age=31536000; path=/`;
}
};
}
var cookieStorageManager = createCookieStorageManager(STORAGE_KEY);
var cookieStorageManagerSSR = (cookie) => createCookieStorageManager(STORAGE_KEY, cookie);
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-provider.mjs
var noop = () => {
};
var useSafeLayoutEffect3 = isBrowser() ? import_react27.useLayoutEffect : import_react27.useEffect;
function getTheme3(manager, fallback) {
return manager.type === "cookie" && manager.ssr ? manager.get(fallback) : fallback;
}
var ColorModeProvider = function ColorModeProvider2(props) {
const {
value,
children,
options: {
useSystemColorMode,
initialColorMode,
disableTransitionOnChange
} = {},
colorModeManager = localStorageManager
} = props;
const cache = __unsafe_useEmotionCache();
const defaultColorMode = initialColorMode === "dark" ? "dark" : "light";
const [colorMode, rawSetColorMode] = (0, import_react27.useState)(
() => getTheme3(colorModeManager, defaultColorMode)
);
const [resolvedColorMode, setResolvedColorMode] = (0, import_react27.useState)(
() => getTheme3(colorModeManager)
);
const { getSystemTheme, setClassName, setDataset, addListener } = (0, import_react27.useMemo)(
() => getColorModeUtils({
preventTransition: disableTransitionOnChange,
nonce: cache == null ? void 0 : cache.nonce
}),
[disableTransitionOnChange, cache == null ? void 0 : cache.nonce]
);
const resolvedValue = initialColorMode === "system" && !colorMode ? resolvedColorMode : colorMode;
const setColorMode = (0, import_react27.useCallback)(
(value2) => {
const resolved = value2 === "system" ? getSystemTheme() : value2;
rawSetColorMode(resolved);
setClassName(resolved === "dark");
setDataset(resolved);
colorModeManager.set(resolved);
},
[colorModeManager, getSystemTheme, setClassName, setDataset]
);
useSafeLayoutEffect3(() => {
if (initialColorMode === "system") {
setResolvedColorMode(getSystemTheme());
}
}, []);
(0, import_react27.useEffect)(() => {
const managerValue = colorModeManager.get();
if (managerValue) {
setColorMode(managerValue);
return;
}
if (initialColorMode === "system") {
setColorMode("system");
return;
}
setColorMode(defaultColorMode);
}, [colorModeManager, defaultColorMode, initialColorMode, setColorMode]);
const toggleColorMode = (0, import_react27.useCallback)(() => {
setColorMode(resolvedValue === "dark" ? "light" : "dark");
}, [resolvedValue, setColorMode]);
(0, import_react27.useEffect)(() => {
if (!useSystemColorMode)
return;
return addListener(setColorMode);
}, [useSystemColorMode, addListener, setColorMode]);
const context = (0, import_react27.useMemo)(
() => ({
colorMode: value ?? resolvedValue,
toggleColorMode: value ? noop : toggleColorMode,
setColorMode: value ? noop : setColorMode,
forced: value !== void 0
}),
[resolvedValue, toggleColorMode, setColorMode, value]
);
return (0, import_jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, children });
};
ColorModeProvider.displayName = "ColorModeProvider";
function DarkMode(props) {
const context = (0, import_react27.useMemo)(
() => ({
colorMode: "dark",
toggleColorMode: noop,
setColorMode: noop,
forced: true
}),
[]
);
return (0, import_jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, ...props });
}
DarkMode.displayName = "DarkMode";
function LightMode(props) {
const context = (0, import_react27.useMemo)(
() => ({
colorMode: "light",
toggleColorMode: noop,
setColorMode: noop,
forced: true
}),
[]
);
return (0, import_jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, ...props });
}
LightMode.displayName = "LightMode";
// ../../node_modules/@chakra-ui/react/dist/esm/css-reset/css-reset.mjs
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var css3 = String.raw;
var vhPolyfill = css3`
:root,
:host {
--chakra-vh: 100vh;
}
@supports (height: -webkit-fill-available) {
:root,
:host {
--chakra-vh: -webkit-fill-available;
}
}
@supports (height: -moz-fill-available) {
:root,
:host {
--chakra-vh: -moz-fill-available;
}
}
@supports (height: 100dvh) {
:root,
:host {
--chakra-vh: 100dvh;
}
}
`;
var CSSPolyfill = () => (0, import_jsx_runtime2.jsx)(Global, { styles: vhPolyfill });
var CSSReset = ({ scope = "" }) => (0, import_jsx_runtime2.jsx)(
Global,
{
styles: css3`
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
font-family: system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
touch-action: manipulation;
}
body {
position: relative;
min-height: 100%;
margin: 0;
font-feature-settings: "kern";
}
${scope} :where(*, *::before, *::after) {
border-width: 0;
border-style: solid;
box-sizing: border-box;
word-wrap: break-word;
}
main {
display: block;
}
${scope} hr {
border-top-width: 1px;
box-sizing: content-box;
height: 0;
overflow: visible;
}
${scope} :where(pre, code, kbd,samp) {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 1em;
}
${scope} a {
background-color: transparent;
color: inherit;
text-decoration: inherit;
}
${scope} abbr[title] {
border-bottom: none;
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
${scope} :where(b, strong) {
font-weight: bold;
}
${scope} small {
font-size: 80%;
}
${scope} :where(sub,sup) {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
${scope} sub {
bottom: -0.25em;
}
${scope} sup {
top: -0.5em;
}
${scope} img {
border-style: none;
}
${scope} :where(button, input, optgroup, select, textarea) {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0;
}
${scope} :where(button, input) {
overflow: visible;
}
${scope} :where(button, select) {
text-transform: none;
}
${scope} :where(
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner
) {
border-style: none;
padding: 0;
}
${scope} fieldset {
padding: 0.35em 0.75em 0.625em;
}
${scope} legend {
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
${scope} progress {
vertical-align: baseline;
}
${scope} textarea {
overflow: auto;
}
${scope} :where([type="checkbox"], [type="radio"]) {
box-sizing: border-box;
padding: 0;
}
${scope} input[type="number"]::-webkit-inner-spin-button,
${scope} input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
}
${scope} input[type="number"] {
-moz-appearance: textfield;
}
${scope} input[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
${scope} input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none !important;
}
${scope} ::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
${scope} details {
display: block;
}
${scope} summary {
display: list-item;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
${scope} :where(
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre
) {
margin: 0;
}
${scope} button {
background: transparent;
padding: 0;
}
${scope} fieldset {
margin: 0;
padding: 0;
}
${scope} :where(ol, ul) {
margin: 0;
padding: 0;
}
${scope} textarea {
resize: vertical;
}
${scope} :where(button, [role="button"]) {
cursor: pointer;
}
${scope} button::-moz-focus-inner {
border: 0 !important;
}
${scope} table {
border-collapse: collapse;
}
${scope} :where(h1, h2, h3, h4, h5, h6) {
font-size: inherit;
font-weight: inherit;
}
${scope} :where(button, input, optgroup, select, textarea) {
padding: 0;
line-height: inherit;
color: inherit;
}
${scope} :where(img, svg, video, canvas, audio, iframe, embed, object) {
display: block;
}
${scope} :where(img, video) {
max-width: 100%;
height: auto;
}
[data-js-focus-visible]
:focus:not([data-focus-visible-added]):not(
[data-focus-visible-disabled]
) {
outline: none;
box-shadow: none;
}
${scope} select::-ms-expand {
display: none;
}
${vhPolyfill}
`
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/system/providers.mjs
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
var import_react30 = __toESM(require_react(), 1);
function ThemeProvider3(props) {
const { cssVarsRoot, theme: theme2, children } = props;
const computedTheme = (0, import_react30.useMemo)(() => toCSSVar(theme2), [theme2]);
return (0, import_jsx_runtime3.jsxs)(ThemeProvider, { theme: computedTheme, children: [
(0, import_jsx_runtime3.jsx)(CSSVars, { root: cssVarsRoot }),
children
] });
}
function CSSVars({ root = ":host, :root" }) {
const selector = [root, `[data-theme]`].join(",");
return (0, import_jsx_runtime3.jsx)(Global, { styles: (theme2) => ({ [selector]: theme2.__cssVars }) });
}
var [StylesProvider, useStyles] = createContext({
name: "StylesContext",
errorMessage: "useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "
});
function createStylesContext(componentName) {
return createContext({
name: `${componentName}StylesContext`,
errorMessage: `useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${componentName} />" `
});
}
function GlobalStyle() {
const { colorMode } = useColorMode();
return (0, import_jsx_runtime3.jsx)(
Global,
{
styles: (theme2) => {
const styleObjectOrFn = memoizedGet(theme2, "styles.global");
const globalStyles = runIfFn(styleObjectOrFn, { theme: theme2, colorMode });
if (!globalStyles)
return void 0;
const styles2 = css(globalStyles)(theme2);
return styles2;
}
}
);
}
// ../../node_modules/@chakra-ui/react/dist/esm/portal/portal-manager.mjs
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
var [PortalManagerContextProvider, usePortalManager] = createContext({
strict: false,
name: "PortalManagerContext"
});
function PortalManager(props) {
const { children, zIndex } = props;
return (0, import_jsx_runtime4.jsx)(PortalManagerContextProvider, { value: { zIndex }, children });
}
PortalManager.displayName = "PortalManager";
// ../../node_modules/@chakra-ui/react/dist/esm/env/env.mjs
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var import_react31 = __toESM(require_react(), 1);
var EnvironmentContext = (0, import_react31.createContext)({
getDocument() {
return document;
},
getWindow() {
return window;
}
});
EnvironmentContext.displayName = "EnvironmentContext";
function useEnvironment({ defer } = {}) {
const [, forceUpdate] = (0, import_react31.useReducer)((c) => c + 1, 0);
useSafeLayoutEffect(() => {
if (!defer)
return;
forceUpdate();
}, [defer]);
return (0, import_react31.useContext)(EnvironmentContext);
}
function EnvironmentProvider(props) {
const { children, environment: environmentProp, disabled } = props;
const ref = (0, import_react31.useRef)(null);
const context = (0, import_react31.useMemo)(() => {
if (environmentProp)
return environmentProp;
return {
getDocument: () => {
var _a8;
return ((_a8 = ref.current) == null ? void 0 : _a8.ownerDocument) ?? document;
},
getWindow: () => {
var _a8;
return ((_a8 = ref.current) == null ? void 0 : _a8.ownerDocument.defaultView) ?? window;
}
};
}, [environmentProp]);
const showSpan = !disabled || !environmentProp;
return (0, import_jsx_runtime5.jsxs)(EnvironmentContext.Provider, { value: context, children: [
children,
showSpan && (0, import_jsx_runtime5.jsx)("span", { id: "__chakra_env", hidden: true, ref })
] });
}
EnvironmentProvider.displayName = "EnvironmentProvider";
// ../../node_modules/@chakra-ui/react/dist/esm/provider/provider.mjs
var Provider = (props) => {
const {
children,
colorModeManager,
portalZIndex,
resetScope,
resetCSS = true,
theme: theme2 = {},
environment,
cssVarsRoot,
disableEnvironment,
disableGlobalStyle
} = props;
const _children = (0, import_jsx_runtime6.jsx)(
EnvironmentProvider,
{
environment,
disabled: disableEnvironment,
children
}
);
return (0, import_jsx_runtime6.jsx)(ThemeProvider3, { theme: theme2, cssVarsRoot, children: (0, import_jsx_runtime6.jsxs)(
ColorModeProvider,
{
colorModeManager,
options: theme2.config,
children: [
resetCSS ? (0, import_jsx_runtime6.jsx)(CSSReset, { scope: resetScope }) : (0, import_jsx_runtime6.jsx)(CSSPolyfill, {}),
!disableGlobalStyle && (0, import_jsx_runtime6.jsx)(GlobalStyle, {}),
portalZIndex ? (0, import_jsx_runtime6.jsx)(PortalManager, { zIndex: portalZIndex, children: _children }) : _children
]
}
) });
};
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.provider.mjs
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/framer-motion/dist/es/motion/index.mjs
var React4 = __toESM(require_react(), 1);
var import_react42 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
var import_react32 = __toESM(require_react(), 1);
var MotionConfigContext = (0, import_react32.createContext)({
transformPagePoint: (p) => p,
isStatic: false,
reducedMotion: "never"
});
// ../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs
var import_react33 = __toESM(require_react(), 1);
var MotionContext = (0, import_react33.createContext)({});
// ../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
var import_react37 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs
var import_react34 = __toESM(require_react(), 1);
var PresenceContext = (0, import_react34.createContext)(null);
// ../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
var import_react35 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/is-browser.mjs
var isBrowser3 = typeof document !== "undefined";
// ../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs
var useIsomorphicLayoutEffect = isBrowser3 ? import_react35.useLayoutEffect : import_react35.useEffect;
// ../../node_modules/framer-motion/dist/es/context/LazyContext.mjs
var import_react36 = __toESM(require_react(), 1);
var LazyContext = (0, import_react36.createContext)({ strict: false });
// ../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs
var camelToDash = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
// ../../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs
var optimizedAppearDataId = "framerAppearId";
var optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId);
// ../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs
function useVisualElement(Component2, visualState, props, createVisualElement2) {
const { visualElement: parent } = (0, import_react37.useContext)(MotionContext);
const lazyContext = (0, import_react37.useContext)(LazyContext);
const presenceContext = (0, import_react37.useContext)(PresenceContext);
const reducedMotionConfig = (0, import_react37.useContext)(MotionConfigContext).reducedMotion;
const visualElementRef = (0, import_react37.useRef)();
createVisualElement2 = createVisualElement2 || lazyContext.renderer;
if (!visualElementRef.current && createVisualElement2) {
visualElementRef.current = createVisualElement2(Component2, {
visualState,
parent,
props,
presenceContext,
blockInitialAnimation: presenceContext ? presenceContext.initial === false : false,
reducedMotionConfig
});
}
const visualElement = visualElementRef.current;
(0, import_react37.useInsertionEffect)(() => {
visualElement && visualElement.update(props, presenceContext);
});
const wantsHandoff = (0, import_react37.useRef)(Boolean(props[optimizedAppearDataAttribute] && !window.HandoffComplete));
useIsomorphicLayoutEffect(() => {
if (!visualElement)
return;
visualElement.render();
if (wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
});
(0, import_react37.useEffect)(() => {
if (!visualElement)
return;
visualElement.updateFeatures();
if (!wantsHandoff.current && visualElement.animationState) {
visualElement.animationState.animateChanges();
}
if (wantsHandoff.current) {
wantsHandoff.current = false;
window.HandoffComplete = true;
}
});
return visualElement;
}
// ../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs
var import_react38 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs
function isRefObject4(ref) {
return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current");
}
// ../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs
function useMotionRef(visualState, visualElement, externalRef) {
return (0, import_react38.useCallback)(
(instance) => {
instance && visualState.mount && visualState.mount(instance);
if (visualElement) {
instance ? visualElement.mount(instance) : visualElement.unmount();
}
if (externalRef) {
if (typeof externalRef === "function") {
externalRef(instance);
} else if (isRefObject4(externalRef)) {
externalRef.current = instance;
}
}
},
/**
* Only pass a new ref callback to React if we've received a visual element
* factory. Otherwise we'll be mounting/remounting every time externalRef
* or other dependencies change.
*/
[visualElement]
);
}
// ../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
var import_react39 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs
function isVariantLabel(v) {
return typeof v === "string" || Array.isArray(v);
}
// ../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs
function isAnimationControls(v) {
return v !== null && typeof v === "object" && typeof v.start === "function";
}
// ../../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs
var variantPriorityOrder = [
"animate",
"whileInView",
"whileFocus",
"whileHover",
"whileTap",
"whileDrag",
"exit"
];
var variantProps = ["initial", ...variantPriorityOrder];
// ../../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs
function isControllingVariants(props) {
return isAnimationControls(props.animate) || variantProps.some((name) => isVariantLabel(props[name]));
}
function isVariantNode(props) {
return Boolean(isControllingVariants(props) || props.variants);
}
// ../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs
function getCurrentTreeVariants(props, context) {
if (isControllingVariants(props)) {
const { initial, animate: animate2 } = props;
return {
initial: initial === false || isVariantLabel(initial) ? initial : void 0,
animate: isVariantLabel(animate2) ? animate2 : void 0
};
}
return props.inherit !== false ? context : {};
}
// ../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs
function useCreateMotionContext(props) {
const { initial, animate: animate2 } = getCurrentTreeVariants(props, (0, import_react39.useContext)(MotionContext));
return (0, import_react39.useMemo)(() => ({ initial, animate: animate2 }), [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate2)]);
}
function variantLabelsAsDependency(prop) {
return Array.isArray(prop) ? prop.join(" ") : prop;
}
// ../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs
var featureProps = {
animation: [
"animate",
"variants",
"whileHover",
"whileTap",
"exit",
"whileInView",
"whileFocus",
"whileDrag"
],
exit: ["exit"],
drag: ["drag", "dragControls"],
focus: ["whileFocus"],
hover: ["whileHover", "onHoverStart", "onHoverEnd"],
tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
layout: ["layout", "layoutId"]
};
var featureDefinitions = {};
for (const key in featureProps) {
featureDefinitions[key] = {
isEnabled: (props) => featureProps[key].some((name) => !!props[name])
};
}
// ../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs
function loadFeatures(features) {
for (const key in features) {
featureDefinitions[key] = {
...featureDefinitions[key],
...features[key]
};
}
}
// ../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs
var import_react40 = __toESM(require_react(), 1);
var LayoutGroupContext = (0, import_react40.createContext)({});
// ../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs
var import_react41 = __toESM(require_react(), 1);
var SwitchLayoutGroupContext = (0, import_react41.createContext)({});
// ../../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs
var motionComponentSymbol = Symbol.for("motionComponentSymbol");
// ../../node_modules/framer-motion/dist/es/motion/index.mjs
function createMotionComponent({ preloadedFeatures: preloadedFeatures2, createVisualElement: createVisualElement2, useRender, useVisualState: useVisualState2, Component: Component2 }) {
preloadedFeatures2 && loadFeatures(preloadedFeatures2);
function MotionComponent(props, externalRef) {
let MeasureLayout2;
const configAndProps = {
...(0, import_react42.useContext)(MotionConfigContext),
...props,
layoutId: useLayoutId(props)
};
const { isStatic } = configAndProps;
const context = useCreateMotionContext(props);
const visualState = useVisualState2(props, isStatic);
if (!isStatic && isBrowser3) {
context.visualElement = useVisualElement(Component2, visualState, configAndProps, createVisualElement2);
const initialLayoutGroupConfig = (0, import_react42.useContext)(SwitchLayoutGroupContext);
const isStrict = (0, import_react42.useContext)(LazyContext).strict;
if (context.visualElement) {
MeasureLayout2 = context.visualElement.loadFeatures(
// Note: Pass the full new combined props to correctly re-render dynamic feature components.
configAndProps,
isStrict,
preloadedFeatures2,
initialLayoutGroupConfig
);
}
}
return React4.createElement(
MotionContext.Provider,
{ value: context },
MeasureLayout2 && context.visualElement ? React4.createElement(MeasureLayout2, { visualElement: context.visualElement, ...configAndProps }) : null,
useRender(Component2, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic, context.visualElement)
);
}
const ForwardRefComponent = (0, import_react42.forwardRef)(MotionComponent);
ForwardRefComponent[motionComponentSymbol] = Component2;
return ForwardRefComponent;
}
function useLayoutId({ layoutId }) {
const layoutGroupId = (0, import_react42.useContext)(LayoutGroupContext).id;
return layoutGroupId && layoutId !== void 0 ? layoutGroupId + "-" + layoutId : layoutId;
}
// ../../node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs
function createMotionProxy(createConfig) {
function custom(Component2, customMotionComponentConfig = {}) {
return createMotionComponent(createConfig(Component2, customMotionComponentConfig));
}
if (typeof Proxy === "undefined") {
return custom;
}
const componentCache = /* @__PURE__ */ new Map();
return new Proxy(custom, {
/**
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
* The prop name is passed through as `key` and we can use that to generate a `motion`
* DOM component with that name.
*/
get: (_target, key) => {
if (!componentCache.has(key)) {
componentCache.set(key, custom(key));
}
return componentCache.get(key);
}
});
}
// ../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs
var lowercaseSVGElements = [
"animate",
"circle",
"defs",
"desc",
"ellipse",
"g",
"image",
"line",
"filter",
"marker",
"mask",
"metadata",
"path",
"pattern",
"polygon",
"polyline",
"rect",
"stop",
"switch",
"symbol",
"svg",
"text",
"tspan",
"use",
"view"
];
// ../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs
function isSVGComponent(Component2) {
if (
/**
* If it's not a string, it's a custom React component. Currently we only support
* HTML custom React components.
*/
typeof Component2 !== "string" || /**
* If it contains a dash, the element is a custom HTML webcomponent.
*/
Component2.includes("-")
) {
return false;
} else if (
/**
* If it's in our list of lowercase SVG tags, it's an SVG component
*/
lowercaseSVGElements.indexOf(Component2) > -1 || /**
* If it contains a capital letter, it's an SVG component
*/
/[A-Z]/.test(Component2)
) {
return true;
}
return false;
}
// ../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs
var import_react45 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/html/use-props.mjs
var import_react43 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs
var scaleCorrectors = {};
function addScaleCorrector(correctors) {
Object.assign(scaleCorrectors, correctors);
}
// ../../node_modules/framer-motion/dist/es/render/html/utils/transform.mjs
var transformPropOrder = [
"transformPerspective",
"x",
"y",
"z",
"translateX",
"translateY",
"translateZ",
"scale",
"scaleX",
"scaleY",
"rotate",
"rotateX",
"rotateY",
"rotateZ",
"skew",
"skewX",
"skewY"
];
var transformProps = new Set(transformPropOrder);
// ../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs
function isForcedMotionValue(key, { layout: layout3, layoutId }) {
return transformProps.has(key) || key.startsWith("origin") || (layout3 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
}
// ../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs
var isMotionValue = (value) => Boolean(value && value.getVelocity);
// ../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs
var translateAlias = {
x: "translateX",
y: "translateY",
z: "translateZ",
transformPerspective: "perspective"
};
var numTransforms = transformPropOrder.length;
function buildTransform(transform3, { enableHardwareAcceleration = true, allowTransformNone = true }, transformIsDefault, transformTemplate2) {
let transformString = "";
for (let i = 0; i < numTransforms; i++) {
const key = transformPropOrder[i];
if (transform3[key] !== void 0) {
const transformName = translateAlias[key] || key;
transformString += `${transformName}(${transform3[key]}) `;
}
}
if (enableHardwareAcceleration && !transform3.z) {
transformString += "translateZ(0)";
}
transformString = transformString.trim();
if (transformTemplate2) {
transformString = transformTemplate2(transform3, transformIsDefault ? "" : transformString);
} else if (allowTransformNone && transformIsDefault) {
transformString = "none";
}
return transformString;
}
// ../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs
var checkStringStartsWith = (token2) => (key) => typeof key === "string" && key.startsWith(token2);
var isCSSVariableName = checkStringStartsWith("--");
var isCSSVariableToken = checkStringStartsWith("var(--");
var cssVariableRegex = /var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g;
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs
var getValueAsType = (value, type) => {
return type && typeof value === "number" ? type.transform(value) : value;
};
// ../../node_modules/framer-motion/dist/es/utils/clamp.mjs
var clamp = (min2, max2, v) => Math.min(Math.max(v, min2), max2);
// ../../node_modules/framer-motion/dist/es/value/types/numbers/index.mjs
var number = {
test: (v) => typeof v === "number",
parse: parseFloat,
transform: (v) => v
};
var alpha = {
...number,
transform: (v) => clamp(0, 1, v)
};
var scale = {
...number,
default: 1
};
// ../../node_modules/framer-motion/dist/es/value/types/utils.mjs
var sanitize = (v) => Math.round(v * 1e5) / 1e5;
var floatRegex = /(-)?([\d]*\.?[\d])+/g;
var colorRegex = /(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi;
var singleColorRegex = /^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;
function isString2(v) {
return typeof v === "string";
}
// ../../node_modules/framer-motion/dist/es/value/types/numbers/units.mjs
var createUnitType = (unit) => ({
test: (v) => isString2(v) && v.endsWith(unit) && v.split(" ").length === 1,
parse: parseFloat,
transform: (v) => `${v}${unit}`
});
var degrees = createUnitType("deg");
var percent = createUnitType("%");
var px2 = createUnitType("px");
var vh = createUnitType("vh");
var vw = createUnitType("vw");
var progressPercentage = {
...percent,
parse: (v) => percent.parse(v) / 100,
transform: (v) => percent.transform(v * 100)
};
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs
var int = {
...number,
transform: Math.round
};
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs
var numberValueTypes = {
// Border props
borderWidth: px2,
borderTopWidth: px2,
borderRightWidth: px2,
borderBottomWidth: px2,
borderLeftWidth: px2,
borderRadius: px2,
radius: px2,
borderTopLeftRadius: px2,
borderTopRightRadius: px2,
borderBottomRightRadius: px2,
borderBottomLeftRadius: px2,
// Positioning props
width: px2,
maxWidth: px2,
height: px2,
maxHeight: px2,
size: px2,
top: px2,
right: px2,
bottom: px2,
left: px2,
// Spacing props
padding: px2,
paddingTop: px2,
paddingRight: px2,
paddingBottom: px2,
paddingLeft: px2,
margin: px2,
marginTop: px2,
marginRight: px2,
marginBottom: px2,
marginLeft: px2,
// Transform props
rotate: degrees,
rotateX: degrees,
rotateY: degrees,
rotateZ: degrees,
scale,
scaleX: scale,
scaleY: scale,
scaleZ: scale,
skew: degrees,
skewX: degrees,
skewY: degrees,
distance: px2,
translateX: px2,
translateY: px2,
translateZ: px2,
x: px2,
y: px2,
z: px2,
perspective: px2,
transformPerspective: px2,
opacity: alpha,
originX: progressPercentage,
originY: progressPercentage,
originZ: px2,
// Misc
zIndex: int,
// SVG
fillOpacity: alpha,
strokeOpacity: alpha,
numOctaves: int
};
// ../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs
function buildHTMLStyles(state2, latestValues, options, transformTemplate2) {
const { style, vars: vars2, transform: transform3, transformOrigin: transformOrigin2 } = state2;
let hasTransform2 = false;
let hasTransformOrigin = false;
let transformIsNone = true;
for (const key in latestValues) {
const value = latestValues[key];
if (isCSSVariableName(key)) {
vars2[key] = value;
continue;
}
const valueType = numberValueTypes[key];
const valueAsType = getValueAsType(value, valueType);
if (transformProps.has(key)) {
hasTransform2 = true;
transform3[key] = valueAsType;
if (!transformIsNone)
continue;
if (value !== (valueType.default || 0))
transformIsNone = false;
} else if (key.startsWith("origin")) {
hasTransformOrigin = true;
transformOrigin2[key] = valueAsType;
} else {
style[key] = valueAsType;
}
}
if (!latestValues.transform) {
if (hasTransform2 || transformTemplate2) {
style.transform = buildTransform(state2.transform, options, transformIsNone, transformTemplate2);
} else if (style.transform) {
style.transform = "none";
}
}
if (hasTransformOrigin) {
const { originX = "50%", originY = "50%", originZ = 0 } = transformOrigin2;
style.transformOrigin = `${originX} ${originY} ${originZ}`;
}
}
// ../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs
var createHtmlRenderState = () => ({
style: {},
transform: {},
transformOrigin: {},
vars: {}
});
// ../../node_modules/framer-motion/dist/es/render/html/use-props.mjs
function copyRawValuesOnly(target, source, props) {
for (const key in source) {
if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
target[key] = source[key];
}
}
}
function useInitialMotionValues({ transformTemplate: transformTemplate2 }, visualState, isStatic) {
return (0, import_react43.useMemo)(() => {
const state2 = createHtmlRenderState();
buildHTMLStyles(state2, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate2);
return Object.assign({}, state2.vars, state2.style);
}, [visualState]);
}
function useStyle(props, visualState, isStatic) {
const styleProp = props.style || {};
const style = {};
copyRawValuesOnly(style, styleProp, props);
Object.assign(style, useInitialMotionValues(props, visualState, isStatic));
return props.transformValues ? props.transformValues(style) : style;
}
function useHTMLProps(props, visualState, isStatic) {
const htmlProps = {};
const style = useStyle(props, visualState, isStatic);
if (props.drag && props.dragListener !== false) {
htmlProps.draggable = false;
style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none";
style.touchAction = props.drag === true ? "none" : `pan-${props.drag === "x" ? "y" : "x"}`;
}
if (props.tabIndex === void 0 && (props.onTap || props.onTapStart || props.whileTap)) {
htmlProps.tabIndex = 0;
}
htmlProps.style = style;
return htmlProps;
}
// ../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs
var validMotionProps = /* @__PURE__ */ new Set([
"animate",
"exit",
"variants",
"initial",
"style",
"values",
"variants",
"transition",
"transformTemplate",
"transformValues",
"custom",
"inherit",
"onBeforeLayoutMeasure",
"onAnimationStart",
"onAnimationComplete",
"onUpdate",
"onDragStart",
"onDrag",
"onDragEnd",
"onMeasureDragConstraints",
"onDirectionLock",
"onDragTransitionEnd",
"_dragX",
"_dragY",
"onHoverStart",
"onHoverEnd",
"onViewportEnter",
"onViewportLeave",
"globalTapTarget",
"ignoreStrict",
"viewport"
]);
function isValidMotionProp(key) {
return key.startsWith("while") || key.startsWith("drag") && key !== "draggable" || key.startsWith("layout") || key.startsWith("onTap") || key.startsWith("onPan") || key.startsWith("onLayout") || validMotionProps.has(key);
}
// ../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs
var shouldForward = (key) => !isValidMotionProp(key);
function loadExternalIsValidProp(isValidProp) {
if (!isValidProp)
return;
shouldForward = (key) => key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key);
}
try {
loadExternalIsValidProp((init_is_prop_valid_browser_esm(), __toCommonJS(is_prop_valid_browser_esm_exports)).default);
} catch (_a8) {
}
function filterProps(props, isDom3, forwardMotionProps) {
const filteredProps = {};
for (const key in props) {
if (key === "values" && typeof props.values === "object")
continue;
if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom3 && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners
props["draggable"] && key.startsWith("onDrag")) {
filteredProps[key] = props[key];
}
}
return filteredProps;
}
// ../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs
var import_react44 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs
function calcOrigin(origin, offset2, size2) {
return typeof origin === "string" ? origin : px2.transform(offset2 + size2 * origin);
}
function calcSVGTransformOrigin(dimensions, originX, originY) {
const pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
const pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
return `${pxOriginX} ${pxOriginY}`;
}
// ../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs
var dashKeys = {
offset: "stroke-dashoffset",
array: "stroke-dasharray"
};
var camelKeys = {
offset: "strokeDashoffset",
array: "strokeDasharray"
};
function buildSVGPath(attrs, length2, spacing2 = 1, offset2 = 0, useDashCase = true) {
attrs.pathLength = 1;
const keys2 = useDashCase ? dashKeys : camelKeys;
attrs[keys2.offset] = px2.transform(-offset2);
const pathLength = px2.transform(length2);
const pathSpacing = px2.transform(spacing2);
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
}
// ../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs
function buildSVGAttrs(state2, {
attrX,
attrY,
attrScale,
originX,
originY,
pathLength,
pathSpacing = 1,
pathOffset = 0,
// This is object creation, which we try to avoid per-frame.
...latest
}, options, isSVGTag2, transformTemplate2) {
buildHTMLStyles(state2, latest, options, transformTemplate2);
if (isSVGTag2) {
if (state2.style.viewBox) {
state2.attrs.viewBox = state2.style.viewBox;
}
return;
}
state2.attrs = state2.style;
state2.style = {};
const { attrs, style, dimensions } = state2;
if (attrs.transform) {
if (dimensions)
style.transform = attrs.transform;
delete attrs.transform;
}
if (dimensions && (originX !== void 0 || originY !== void 0 || style.transform)) {
style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== void 0 ? originX : 0.5, originY !== void 0 ? originY : 0.5);
}
if (attrX !== void 0)
attrs.x = attrX;
if (attrY !== void 0)
attrs.y = attrY;
if (attrScale !== void 0)
attrs.scale = attrScale;
if (pathLength !== void 0) {
buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false);
}
}
// ../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs
var createSvgRenderState = () => ({
...createHtmlRenderState(),
attrs: {}
});
// ../../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs
var isSVGTag = (tag) => typeof tag === "string" && tag.toLowerCase() === "svg";
// ../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs
function useSVGProps(props, visualState, _isStatic, Component2) {
const visualProps = (0, import_react44.useMemo)(() => {
const state2 = createSvgRenderState();
buildSVGAttrs(state2, visualState, { enableHardwareAcceleration: false }, isSVGTag(Component2), props.transformTemplate);
return {
...state2.attrs,
style: { ...state2.style }
};
}, [visualState]);
if (props.style) {
const rawStyles = {};
copyRawValuesOnly(rawStyles, props.style, props);
visualProps.style = { ...rawStyles, ...visualProps.style };
}
return visualProps;
}
// ../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs
function createUseRender(forwardMotionProps = false) {
const useRender = (Component2, props, ref, { latestValues }, isStatic) => {
const useVisualProps = isSVGComponent(Component2) ? useSVGProps : useHTMLProps;
const visualProps = useVisualProps(props, latestValues, isStatic, Component2);
const filteredProps = filterProps(props, typeof Component2 === "string", forwardMotionProps);
const elementProps = {
...filteredProps,
...visualProps,
ref
};
const { children } = props;
const renderedChildren = (0, import_react45.useMemo)(() => isMotionValue(children) ? children.get() : children, [children]);
return (0, import_react45.createElement)(Component2, {
...elementProps,
children: renderedChildren
});
};
return useRender;
}
// ../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs
function renderHTML(element, { style, vars: vars2 }, styleProp, projection) {
Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
for (const key in vars2) {
element.style.setProperty(key, vars2[key]);
}
}
// ../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs
var camelCaseAttributes = /* @__PURE__ */ new Set([
"baseFrequency",
"diffuseConstant",
"kernelMatrix",
"kernelUnitLength",
"keySplines",
"keyTimes",
"limitingConeAngle",
"markerHeight",
"markerWidth",
"numOctaves",
"targetX",
"targetY",
"surfaceScale",
"specularConstant",
"specularExponent",
"stdDeviation",
"tableValues",
"viewBox",
"gradientTransform",
"pathLength",
"startOffset",
"textLength",
"lengthAdjust"
]);
// ../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs
function renderSVG(element, renderState, _styleProp, projection) {
renderHTML(element, renderState, void 0, projection);
for (const key in renderState.attrs) {
element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
}
}
// ../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs
function scrapeMotionValuesFromProps(props, prevProps) {
const { style } = props;
const newValues = {};
for (const key in style) {
if (isMotionValue(style[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props)) {
newValues[key] = style[key];
}
}
return newValues;
}
// ../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs
function scrapeMotionValuesFromProps2(props, prevProps) {
const newValues = scrapeMotionValuesFromProps(props, prevProps);
for (const key in props) {
if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {
const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key;
newValues[targetKey] = props[key];
}
}
return newValues;
}
// ../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
var import_react47 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs
function resolveVariantFromProps(props, definition, custom, currentValues2 = {}, currentVelocity = {}) {
if (typeof definition === "function") {
definition = definition(custom !== void 0 ? custom : props.custom, currentValues2, currentVelocity);
}
if (typeof definition === "string") {
definition = props.variants && props.variants[definition];
}
if (typeof definition === "function") {
definition = definition(custom !== void 0 ? custom : props.custom, currentValues2, currentVelocity);
}
return definition;
}
// ../../node_modules/framer-motion/dist/es/utils/use-constant.mjs
var import_react46 = __toESM(require_react(), 1);
function useConstant(init) {
const ref = (0, import_react46.useRef)(null);
if (ref.current === null) {
ref.current = init();
}
return ref.current;
}
// ../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs
var isKeyframesTarget = (v) => {
return Array.isArray(v);
};
// ../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs
var isCustomValue = (v) => {
return Boolean(v && typeof v === "object" && v.mix && v.toValue);
};
var resolveFinalValueInKeyframes = (v) => {
return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
};
// ../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs
function resolveMotionValue(value) {
const unwrappedValue = isMotionValue(value) ? value.get() : value;
return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue;
}
// ../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs
function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps3, createRenderState, onMount }, props, context, presenceContext) {
const state2 = {
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps3),
renderState: createRenderState()
};
if (onMount) {
state2.mount = (instance) => onMount(props, instance, state2);
}
return state2;
}
var makeUseVisualState = (config2) => (props, isStatic) => {
const context = (0, import_react47.useContext)(MotionContext);
const presenceContext = (0, import_react47.useContext)(PresenceContext);
const make = () => makeState(config2, props, context, presenceContext);
return isStatic ? make() : useConstant(make);
};
function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
const values = {};
const motionValues = scrapeMotionValues(props, {});
for (const key in motionValues) {
values[key] = resolveMotionValue(motionValues[key]);
}
let { initial, animate: animate2 } = props;
const isControllingVariants$1 = isControllingVariants(props);
const isVariantNode$1 = isVariantNode(props);
if (context && isVariantNode$1 && !isControllingVariants$1 && props.inherit !== false) {
if (initial === void 0)
initial = context.initial;
if (animate2 === void 0)
animate2 = context.animate;
}
let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === false : false;
isInitialAnimationBlocked = isInitialAnimationBlocked || initial === false;
const variantToSet = isInitialAnimationBlocked ? animate2 : initial;
if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) {
const list2 = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
list2.forEach((definition) => {
const resolved = resolveVariantFromProps(props, definition);
if (!resolved)
return;
const { transitionEnd, transition: transition3, ...target } = resolved;
for (const key in target) {
let valueTarget = target[key];
if (Array.isArray(valueTarget)) {
const index2 = isInitialAnimationBlocked ? valueTarget.length - 1 : 0;
valueTarget = valueTarget[index2];
}
if (valueTarget !== null) {
values[key] = valueTarget;
}
}
for (const key in transitionEnd)
values[key] = transitionEnd[key];
});
}
return values;
}
// ../../node_modules/framer-motion/dist/es/utils/noop.mjs
var noop2 = (any2) => any2;
// ../../node_modules/framer-motion/dist/es/frameloop/render-step.mjs
var Queue = class {
constructor() {
this.order = [];
this.scheduled = /* @__PURE__ */ new Set();
}
add(process2) {
if (!this.scheduled.has(process2)) {
this.scheduled.add(process2);
this.order.push(process2);
return true;
}
}
remove(process2) {
const index2 = this.order.indexOf(process2);
if (index2 !== -1) {
this.order.splice(index2, 1);
this.scheduled.delete(process2);
}
}
clear() {
this.order.length = 0;
this.scheduled.clear();
}
};
function createRenderStep2(runNextFrame2) {
let thisFrame = new Queue();
let nextFrame = new Queue();
let numToRun = 0;
let isProcessing2 = false;
let flushNextFrame = false;
const toKeepAlive = /* @__PURE__ */ new WeakSet();
const step = {
/**
* Schedule a process to run on the next frame.
*/
schedule: (callback, keepAlive = false, immediate = false) => {
const addToCurrentFrame = immediate && isProcessing2;
const queue = addToCurrentFrame ? thisFrame : nextFrame;
if (keepAlive)
toKeepAlive.add(callback);
if (queue.add(callback) && addToCurrentFrame && isProcessing2) {
numToRun = thisFrame.order.length;
}
return callback;
},
/**
* Cancel the provided callback from running on the next frame.
*/
cancel: (callback) => {
nextFrame.remove(callback);
toKeepAlive.delete(callback);
},
/**
* Execute all schedule callbacks.
*/
process: (frameData2) => {
if (isProcessing2) {
flushNextFrame = true;
return;
}
isProcessing2 = true;
[thisFrame, nextFrame] = [nextFrame, thisFrame];
nextFrame.clear();
numToRun = thisFrame.order.length;
if (numToRun) {
for (let i = 0; i < numToRun; i++) {
const callback = thisFrame.order[i];
callback(frameData2);
if (toKeepAlive.has(callback)) {
step.schedule(callback);
runNextFrame2();
}
}
}
isProcessing2 = false;
if (flushNextFrame) {
flushNextFrame = false;
step.process(frameData2);
}
}
};
return step;
}
// ../../node_modules/framer-motion/dist/es/frameloop/batcher.mjs
var stepsOrder2 = [
"prepare",
"read",
"update",
"preRender",
"render",
"postRender"
];
var maxElapsed2 = 40;
function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
let runNextFrame2 = false;
let useDefaultElapsed2 = true;
const state2 = {
delta: 0,
timestamp: 0,
isProcessing: false
};
const steps3 = stepsOrder2.reduce((acc, key) => {
acc[key] = createRenderStep2(() => runNextFrame2 = true);
return acc;
}, {});
const processStep2 = (stepId) => steps3[stepId].process(state2);
const processBatch = () => {
const timestamp = performance.now();
runNextFrame2 = false;
state2.delta = useDefaultElapsed2 ? 1e3 / 60 : Math.max(Math.min(timestamp - state2.timestamp, maxElapsed2), 1);
state2.timestamp = timestamp;
state2.isProcessing = true;
stepsOrder2.forEach(processStep2);
state2.isProcessing = false;
if (runNextFrame2 && allowKeepAlive) {
useDefaultElapsed2 = false;
scheduleNextBatch(processBatch);
}
};
const wake = () => {
runNextFrame2 = true;
useDefaultElapsed2 = true;
if (!state2.isProcessing) {
scheduleNextBatch(processBatch);
}
};
const schedule = stepsOrder2.reduce((acc, key) => {
const step = steps3[key];
acc[key] = (process2, keepAlive = false, immediate = false) => {
if (!runNextFrame2)
wake();
return step.schedule(process2, keepAlive, immediate);
};
return acc;
}, {});
const cancel = (process2) => stepsOrder2.forEach((key) => steps3[key].cancel(process2));
return { schedule, cancel, state: state2, steps: steps3 };
}
// ../../node_modules/framer-motion/dist/es/frameloop/frame.mjs
var { schedule: frame2, cancel: cancelFrame, state: frameData, steps: steps2 } = createRenderBatcher(typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : noop2, true);
// ../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs
var svgMotionConfig = {
useVisualState: makeUseVisualState({
scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2,
createRenderState: createSvgRenderState,
onMount: (props, instance, { renderState, latestValues }) => {
frame2.read(() => {
try {
renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect();
} catch (e) {
renderState.dimensions = {
x: 0,
y: 0,
width: 0,
height: 0
};
}
});
frame2.render(() => {
buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, isSVGTag(instance.tagName), props.transformTemplate);
renderSVG(instance, renderState);
});
}
})
};
// ../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs
var htmlMotionConfig = {
useVisualState: makeUseVisualState({
scrapeMotionValuesFromProps,
createRenderState: createHtmlRenderState
})
};
// ../../node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs
function createDomMotionConfig(Component2, { forwardMotionProps = false }, preloadedFeatures2, createVisualElement2) {
const baseConfig = isSVGComponent(Component2) ? svgMotionConfig : htmlMotionConfig;
return {
...baseConfig,
preloadedFeatures: preloadedFeatures2,
useRender: createUseRender(forwardMotionProps),
createVisualElement: createVisualElement2,
Component: Component2
};
}
// ../../node_modules/framer-motion/dist/es/events/add-dom-event.mjs
function addDomEvent2(target, eventName, handler, options = { passive: true }) {
target.addEventListener(eventName, handler, options);
return () => target.removeEventListener(eventName, handler);
}
// ../../node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs
var isPrimaryPointer = (event) => {
if (event.pointerType === "mouse") {
return typeof event.button !== "number" || event.button <= 0;
} else {
return event.isPrimary !== false;
}
};
// ../../node_modules/framer-motion/dist/es/events/event-info.mjs
function extractEventInfo(event, pointType = "page") {
return {
point: {
x: event[pointType + "X"],
y: event[pointType + "Y"]
}
};
}
var addPointerInfo = (handler) => {
return (event) => isPrimaryPointer(event) && handler(event, extractEventInfo(event));
};
// ../../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs
function addPointerEvent2(target, eventName, handler, options) {
return addDomEvent2(target, eventName, addPointerInfo(handler), options);
}
// ../../node_modules/framer-motion/dist/es/utils/pipe.mjs
var combineFunctions = (a, b) => (v) => b(a(v));
var pipe3 = (...transformers) => transformers.reduce(combineFunctions);
// ../../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs
function createLock(name) {
let lock = null;
return () => {
const openLock = () => {
lock = null;
};
if (lock === null) {
lock = name;
return openLock;
}
return false;
};
}
var globalHorizontalLock = createLock("dragHorizontal");
var globalVerticalLock = createLock("dragVertical");
function getGlobalLock(drag2) {
let lock = false;
if (drag2 === "y") {
lock = globalVerticalLock();
} else if (drag2 === "x") {
lock = globalHorizontalLock();
} else {
const openHorizontal = globalHorizontalLock();
const openVertical = globalVerticalLock();
if (openHorizontal && openVertical) {
lock = () => {
openHorizontal();
openVertical();
};
} else {
if (openHorizontal)
openHorizontal();
if (openVertical)
openVertical();
}
}
return lock;
}
function isDragActive() {
const openGestureLock = getGlobalLock(true);
if (!openGestureLock)
return true;
openGestureLock();
return false;
}
// ../../node_modules/framer-motion/dist/es/motion/features/Feature.mjs
var Feature = class {
constructor(node3) {
this.isMounted = false;
this.node = node3;
}
update() {
}
};
// ../../node_modules/framer-motion/dist/es/gestures/hover.mjs
function addHoverEvent(node3, isActive) {
const eventName = "pointer" + (isActive ? "enter" : "leave");
const callbackName = "onHover" + (isActive ? "Start" : "End");
const handleEvent = (event, info) => {
if (event.pointerType === "touch" || isDragActive())
return;
const props = node3.getProps();
if (node3.animationState && props.whileHover) {
node3.animationState.setActive("whileHover", isActive);
}
if (props[callbackName]) {
frame2.update(() => props[callbackName](event, info));
}
};
return addPointerEvent2(node3.current, eventName, handleEvent, {
passive: !node3.getProps()[callbackName]
});
}
var HoverGesture = class extends Feature {
mount() {
this.unmount = pipe3(addHoverEvent(this.node, true), addHoverEvent(this.node, false));
}
unmount() {
}
};
// ../../node_modules/framer-motion/dist/es/gestures/focus.mjs
var FocusGesture = class extends Feature {
constructor() {
super(...arguments);
this.isActive = false;
}
onFocus() {
let isFocusVisible2 = false;
try {
isFocusVisible2 = this.node.current.matches(":focus-visible");
} catch (e) {
isFocusVisible2 = true;
}
if (!isFocusVisible2 || !this.node.animationState)
return;
this.node.animationState.setActive("whileFocus", true);
this.isActive = true;
}
onBlur() {
if (!this.isActive || !this.node.animationState)
return;
this.node.animationState.setActive("whileFocus", false);
this.isActive = false;
}
mount() {
this.unmount = pipe3(addDomEvent2(this.node.current, "focus", () => this.onFocus()), addDomEvent2(this.node.current, "blur", () => this.onBlur()));
}
unmount() {
}
};
// ../../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs
var isNodeOrChild = (parent, child) => {
if (!child) {
return false;
} else if (parent === child) {
return true;
} else {
return isNodeOrChild(parent, child.parentElement);
}
};
// ../../node_modules/framer-motion/dist/es/gestures/press.mjs
function fireSyntheticPointerEvent(name, handler) {
if (!handler)
return;
const syntheticPointerEvent = new PointerEvent("pointer" + name);
handler(syntheticPointerEvent, extractEventInfo(syntheticPointerEvent));
}
var PressGesture = class extends Feature {
constructor() {
super(...arguments);
this.removeStartListeners = noop2;
this.removeEndListeners = noop2;
this.removeAccessibleListeners = noop2;
this.startPointerPress = (startEvent, startInfo) => {
if (this.isPressing)
return;
this.removeEndListeners();
const props = this.node.getProps();
const endPointerPress = (endEvent, endInfo) => {
if (!this.checkPressEnd())
return;
const { onTap, onTapCancel, globalTapTarget } = this.node.getProps();
frame2.update(() => {
!globalTapTarget && !isNodeOrChild(this.node.current, endEvent.target) ? onTapCancel && onTapCancel(endEvent, endInfo) : onTap && onTap(endEvent, endInfo);
});
};
const removePointerUpListener = addPointerEvent2(window, "pointerup", endPointerPress, { passive: !(props.onTap || props["onPointerUp"]) });
const removePointerCancelListener = addPointerEvent2(window, "pointercancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo), { passive: !(props.onTapCancel || props["onPointerCancel"]) });
this.removeEndListeners = pipe3(removePointerUpListener, removePointerCancelListener);
this.startPress(startEvent, startInfo);
};
this.startAccessiblePress = () => {
const handleKeydown = (keydownEvent) => {
if (keydownEvent.key !== "Enter" || this.isPressing)
return;
const handleKeyup = (keyupEvent) => {
if (keyupEvent.key !== "Enter" || !this.checkPressEnd())
return;
fireSyntheticPointerEvent("up", (event, info) => {
const { onTap } = this.node.getProps();
if (onTap) {
frame2.update(() => onTap(event, info));
}
});
};
this.removeEndListeners();
this.removeEndListeners = addDomEvent2(this.node.current, "keyup", handleKeyup);
fireSyntheticPointerEvent("down", (event, info) => {
this.startPress(event, info);
});
};
const removeKeydownListener = addDomEvent2(this.node.current, "keydown", handleKeydown);
const handleBlur = () => {
if (!this.isPressing)
return;
fireSyntheticPointerEvent("cancel", (cancelEvent, cancelInfo) => this.cancelPress(cancelEvent, cancelInfo));
};
const removeBlurListener = addDomEvent2(this.node.current, "blur", handleBlur);
this.removeAccessibleListeners = pipe3(removeKeydownListener, removeBlurListener);
};
}
startPress(event, info) {
this.isPressing = true;
const { onTapStart, whileTap } = this.node.getProps();
if (whileTap && this.node.animationState) {
this.node.animationState.setActive("whileTap", true);
}
if (onTapStart) {
frame2.update(() => onTapStart(event, info));
}
}
checkPressEnd() {
this.removeEndListeners();
this.isPressing = false;
const props = this.node.getProps();
if (props.whileTap && this.node.animationState) {
this.node.animationState.setActive("whileTap", false);
}
return !isDragActive();
}
cancelPress(event, info) {
if (!this.checkPressEnd())
return;
const { onTapCancel } = this.node.getProps();
if (onTapCancel) {
frame2.update(() => onTapCancel(event, info));
}
}
mount() {
const props = this.node.getProps();
const removePointerListener = addPointerEvent2(props.globalTapTarget ? window : this.node.current, "pointerdown", this.startPointerPress, { passive: !(props.onTapStart || props["onPointerStart"]) });
const removeFocusListener = addDomEvent2(this.node.current, "focus", this.startAccessiblePress);
this.removeStartListeners = pipe3(removePointerListener, removeFocusListener);
}
unmount() {
this.removeStartListeners();
this.removeEndListeners();
this.removeAccessibleListeners();
}
};
// ../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs
var observerCallbacks = /* @__PURE__ */ new WeakMap();
var observers = /* @__PURE__ */ new WeakMap();
var fireObserverCallback = (entry) => {
const callback = observerCallbacks.get(entry.target);
callback && callback(entry);
};
var fireAllObserverCallbacks = (entries) => {
entries.forEach(fireObserverCallback);
};
function initIntersectionObserver({ root, ...options }) {
const lookupRoot = root || document;
if (!observers.has(lookupRoot)) {
observers.set(lookupRoot, {});
}
const rootObservers = observers.get(lookupRoot);
const key = JSON.stringify(options);
if (!rootObservers[key]) {
rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, { root, ...options });
}
return rootObservers[key];
}
function observeIntersection(element, options, callback) {
const rootInteresectionObserver = initIntersectionObserver(options);
observerCallbacks.set(element, callback);
rootInteresectionObserver.observe(element);
return () => {
observerCallbacks.delete(element);
rootInteresectionObserver.unobserve(element);
};
}
// ../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs
var thresholdNames = {
some: 0,
all: 1
};
var InViewFeature = class extends Feature {
constructor() {
super(...arguments);
this.hasEnteredView = false;
this.isInView = false;
}
startObserver() {
this.unmount();
const { viewport: viewport2 = {} } = this.node.getProps();
const { root, margin: rootMargin, amount = "some", once } = viewport2;
const options = {
root: root ? root.current : void 0,
rootMargin,
threshold: typeof amount === "number" ? amount : thresholdNames[amount]
};
const onIntersectionUpdate = (entry) => {
const { isIntersecting } = entry;
if (this.isInView === isIntersecting)
return;
this.isInView = isIntersecting;
if (once && !isIntersecting && this.hasEnteredView) {
return;
} else if (isIntersecting) {
this.hasEnteredView = true;
}
if (this.node.animationState) {
this.node.animationState.setActive("whileInView", isIntersecting);
}
const { onViewportEnter, onViewportLeave } = this.node.getProps();
const callback = isIntersecting ? onViewportEnter : onViewportLeave;
callback && callback(entry);
};
return observeIntersection(this.node.current, options, onIntersectionUpdate);
}
mount() {
this.startObserver();
}
update() {
if (typeof IntersectionObserver === "undefined")
return;
const { props, prevProps } = this.node;
const hasOptionsChanged = ["amount", "margin", "root"].some(hasViewportOptionChanged(props, prevProps));
if (hasOptionsChanged) {
this.startObserver();
}
}
unmount() {
}
};
function hasViewportOptionChanged({ viewport: viewport2 = {} }, { viewport: prevViewport = {} } = {}) {
return (name) => viewport2[name] !== prevViewport[name];
}
// ../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs
var gestureAnimations = {
inView: {
Feature: InViewFeature
},
tap: {
Feature: PressGesture
},
focus: {
Feature: FocusGesture
},
hover: {
Feature: HoverGesture
}
};
// ../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs
function shallowCompare(next2, prev2) {
if (!Array.isArray(prev2))
return false;
const prevLength = prev2.length;
if (prevLength !== next2.length)
return false;
for (let i = 0; i < prevLength; i++) {
if (prev2[i] !== next2[i])
return false;
}
return true;
}
// ../../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs
function getCurrent(visualElement) {
const current = {};
visualElement.values.forEach((value, key) => current[key] = value.get());
return current;
}
function getVelocity2(visualElement) {
const velocity = {};
visualElement.values.forEach((value, key) => velocity[key] = value.getVelocity());
return velocity;
}
function resolveVariant(visualElement, definition, custom) {
const props = visualElement.getProps();
return resolveVariantFromProps(props, definition, custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity2(visualElement));
}
// ../../node_modules/framer-motion/dist/es/utils/errors.mjs
var warning = noop2;
var invariant = noop2;
if (true) {
warning = (check, message) => {
if (!check && typeof console !== "undefined") {
console.warn(message);
}
};
invariant = (check, message) => {
if (!check) {
throw new Error(message);
}
};
}
// ../../node_modules/framer-motion/dist/es/utils/time-conversion.mjs
var secondsToMilliseconds = (seconds) => seconds * 1e3;
var millisecondsToSeconds = (milliseconds) => milliseconds / 1e3;
// ../../node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs
var instantAnimationState = {
current: false
};
// ../../node_modules/framer-motion/dist/es/easing/utils/is-bezier-definition.mjs
var isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] === "number";
// ../../node_modules/framer-motion/dist/es/animation/animators/waapi/easing.mjs
function isWaapiSupportedEasing(easing) {
return Boolean(!easing || typeof easing === "string" && supportedWaapiEasing[easing] || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing));
}
var cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
var supportedWaapiEasing = {
linear: "linear",
ease: "ease",
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out",
circIn: cubicBezierAsString([0, 0.65, 0.55, 1]),
circOut: cubicBezierAsString([0.55, 0, 1, 0.45]),
backIn: cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
backOut: cubicBezierAsString([0.33, 1.53, 0.69, 0.99])
};
function mapEasingToNativeEasing(easing) {
if (!easing)
return void 0;
return isBezierDefinition(easing) ? cubicBezierAsString(easing) : Array.isArray(easing) ? easing.map(mapEasingToNativeEasing) : supportedWaapiEasing[easing];
}
// ../../node_modules/framer-motion/dist/es/animation/animators/waapi/index.mjs
function animateStyle(element, valueName, keyframes3, { delay: delay2 = 0, duration, repeat = 0, repeatType = "loop", ease: ease2, times } = {}) {
const keyframeOptions = { [valueName]: keyframes3 };
if (times)
keyframeOptions.offset = times;
const easing = mapEasingToNativeEasing(ease2);
if (Array.isArray(easing))
keyframeOptions.easing = easing;
return element.animate(keyframeOptions, {
delay: delay2,
duration,
easing: !Array.isArray(easing) ? easing : "linear",
fill: "both",
iterations: repeat + 1,
direction: repeatType === "reverse" ? "alternate" : "normal"
});
}
// ../../node_modules/framer-motion/dist/es/animation/animators/waapi/utils/get-final-keyframe.mjs
function getFinalKeyframe(keyframes3, { repeat, repeatType = "loop" }) {
const index2 = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : keyframes3.length - 1;
return keyframes3[index2];
}
// ../../node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs
var calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2;
var subdivisionPrecision = 1e-7;
var subdivisionMaxIterations = 12;
function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) {
let currentX;
let currentT;
let i = 0;
do {
currentT = lowerBound + (upperBound - lowerBound) / 2;
currentX = calcBezier(currentT, mX1, mX2) - x;
if (currentX > 0) {
upperBound = currentT;
} else {
lowerBound = currentT;
}
} while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations);
return currentT;
}
function cubicBezier(mX1, mY1, mX2, mY2) {
if (mX1 === mY1 && mX2 === mY2)
return noop2;
const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2);
}
// ../../node_modules/framer-motion/dist/es/easing/ease.mjs
var easeIn = cubicBezier(0.42, 0, 1, 1);
var easeOut = cubicBezier(0, 0, 0.58, 1);
var easeInOut = cubicBezier(0.42, 0, 0.58, 1);
// ../../node_modules/framer-motion/dist/es/easing/utils/is-easing-array.mjs
var isEasingArray = (ease2) => {
return Array.isArray(ease2) && typeof ease2[0] !== "number";
};
// ../../node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs
var mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
// ../../node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs
var reverseEasing = (easing) => (p) => 1 - easing(1 - p);
// ../../node_modules/framer-motion/dist/es/easing/circ.mjs
var circIn = (p) => 1 - Math.sin(Math.acos(p));
var circOut = reverseEasing(circIn);
var circInOut = mirrorEasing(circIn);
// ../../node_modules/framer-motion/dist/es/easing/back.mjs
var backOut = cubicBezier(0.33, 1.53, 0.69, 0.99);
var backIn = reverseEasing(backOut);
var backInOut = mirrorEasing(backIn);
// ../../node_modules/framer-motion/dist/es/easing/anticipate.mjs
var anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
// ../../node_modules/framer-motion/dist/es/easing/utils/map.mjs
var easingLookup = {
linear: noop2,
easeIn,
easeInOut,
easeOut,
circIn,
circInOut,
circOut,
backIn,
backInOut,
backOut,
anticipate
};
var easingDefinitionToFunction = (definition) => {
if (Array.isArray(definition)) {
invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
const [x1, y1, x2, y2] = definition;
return cubicBezier(x1, y1, x2, y2);
} else if (typeof definition === "string") {
invariant(easingLookup[definition] !== void 0, `Invalid easing type '${definition}'`);
return easingLookup[definition];
}
return definition;
};
// ../../node_modules/framer-motion/dist/es/value/types/color/utils.mjs
var isColorString = (type, testProp) => (v) => {
return Boolean(isString2(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && Object.prototype.hasOwnProperty.call(v, testProp));
};
var splitColor = (aName, bName, cName) => (v) => {
if (!isString2(v))
return v;
const [a, b, c, alpha2] = v.match(floatRegex);
return {
[aName]: parseFloat(a),
[bName]: parseFloat(b),
[cName]: parseFloat(c),
alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1
};
};
// ../../node_modules/framer-motion/dist/es/value/types/color/rgba.mjs
var clampRgbUnit = (v) => clamp(0, 255, v);
var rgbUnit = {
...number,
transform: (v) => Math.round(clampRgbUnit(v))
};
var rgba2 = {
test: isColorString("rgb", "red"),
parse: splitColor("red", "green", "blue"),
transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => "rgba(" + rgbUnit.transform(red) + ", " + rgbUnit.transform(green) + ", " + rgbUnit.transform(blue) + ", " + sanitize(alpha.transform(alpha$1)) + ")"
};
// ../../node_modules/framer-motion/dist/es/value/types/color/hex.mjs
function parseHex(v) {
let r2 = "";
let g = "";
let b = "";
let a = "";
if (v.length > 5) {
r2 = v.substring(1, 3);
g = v.substring(3, 5);
b = v.substring(5, 7);
a = v.substring(7, 9);
} else {
r2 = v.substring(1, 2);
g = v.substring(2, 3);
b = v.substring(3, 4);
a = v.substring(4, 5);
r2 += r2;
g += g;
b += b;
a += a;
}
return {
red: parseInt(r2, 16),
green: parseInt(g, 16),
blue: parseInt(b, 16),
alpha: a ? parseInt(a, 16) / 255 : 1
};
}
var hex = {
test: isColorString("#"),
parse: parseHex,
transform: rgba2.transform
};
// ../../node_modules/framer-motion/dist/es/value/types/color/hsla.mjs
var hsla2 = {
test: isColorString("hsl", "hue"),
parse: splitColor("hue", "saturation", "lightness"),
transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {
return "hsla(" + Math.round(hue) + ", " + percent.transform(sanitize(saturation)) + ", " + percent.transform(sanitize(lightness)) + ", " + sanitize(alpha.transform(alpha$1)) + ")";
}
};
// ../../node_modules/framer-motion/dist/es/value/types/color/index.mjs
var color2 = {
test: (v) => rgba2.test(v) || hex.test(v) || hsla2.test(v),
parse: (v) => {
if (rgba2.test(v)) {
return rgba2.parse(v);
} else if (hsla2.test(v)) {
return hsla2.parse(v);
} else {
return hex.parse(v);
}
},
transform: (v) => {
return isString2(v) ? v : v.hasOwnProperty("red") ? rgba2.transform(v) : hsla2.transform(v);
}
};
// ../../node_modules/framer-motion/dist/es/utils/mix.mjs
var mix2 = (from2, to, progress3) => -progress3 * from2 + progress3 * to + from2;
// ../../node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs
function hueToRgb(p, q, t2) {
if (t2 < 0)
t2 += 1;
if (t2 > 1)
t2 -= 1;
if (t2 < 1 / 6)
return p + (q - p) * 6 * t2;
if (t2 < 1 / 2)
return q;
if (t2 < 2 / 3)
return p + (q - p) * (2 / 3 - t2) * 6;
return p;
}
function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
hue /= 360;
saturation /= 100;
lightness /= 100;
let red = 0;
let green = 0;
let blue = 0;
if (!saturation) {
red = green = blue = lightness;
} else {
const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation;
const p = 2 * lightness - q;
red = hueToRgb(p, q, hue + 1 / 3);
green = hueToRgb(p, q, hue);
blue = hueToRgb(p, q, hue - 1 / 3);
}
return {
red: Math.round(red * 255),
green: Math.round(green * 255),
blue: Math.round(blue * 255),
alpha: alpha2
};
}
// ../../node_modules/framer-motion/dist/es/utils/mix-color.mjs
var mixLinearColor = (from2, to, v) => {
const fromExpo = from2 * from2;
return Math.sqrt(Math.max(0, v * (to * to - fromExpo) + fromExpo));
};
var colorTypes = [hex, rgba2, hsla2];
var getColorType = (v) => colorTypes.find((type) => type.test(v));
function asRGBA(color3) {
const type = getColorType(color3);
invariant(Boolean(type), `'${color3}' is not an animatable color. Use the equivalent color code instead.`);
let model = type.parse(color3);
if (type === hsla2) {
model = hslaToRgba(model);
}
return model;
}
var mixColor = (from2, to) => {
const fromRGBA = asRGBA(from2);
const toRGBA = asRGBA(to);
const blended = { ...fromRGBA };
return (v) => {
blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v);
blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v);
blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v);
blended.alpha = mix2(fromRGBA.alpha, toRGBA.alpha, v);
return rgba2.transform(blended);
};
};
// ../../node_modules/framer-motion/dist/es/value/types/complex/index.mjs
function test(v) {
var _a8, _b3;
return isNaN(v) && isString2(v) && (((_a8 = v.match(floatRegex)) === null || _a8 === void 0 ? void 0 : _a8.length) || 0) + (((_b3 = v.match(colorRegex)) === null || _b3 === void 0 ? void 0 : _b3.length) || 0) > 0;
}
var cssVarTokeniser = {
regex: cssVariableRegex,
countKey: "Vars",
token: "${v}",
parse: noop2
};
var colorTokeniser = {
regex: colorRegex,
countKey: "Colors",
token: "${c}",
parse: color2.parse
};
var numberTokeniser = {
regex: floatRegex,
countKey: "Numbers",
token: "${n}",
parse: number.parse
};
function tokenise(info, { regex, countKey, token: token2, parse: parse4 }) {
const matches = info.tokenised.match(regex);
if (!matches)
return;
info["num" + countKey] = matches.length;
info.tokenised = info.tokenised.replace(regex, token2);
info.values.push(...matches.map(parse4));
}
function analyseComplexValue(value) {
const originalValue = value.toString();
const info = {
value: originalValue,
tokenised: originalValue,
values: [],
numVars: 0,
numColors: 0,
numNumbers: 0
};
if (info.value.includes("var(--"))
tokenise(info, cssVarTokeniser);
tokenise(info, colorTokeniser);
tokenise(info, numberTokeniser);
return info;
}
function parseComplexValue(v) {
return analyseComplexValue(v).values;
}
function createTransformer(source) {
const { values, numColors, numVars, tokenised } = analyseComplexValue(source);
const numValues = values.length;
return (v) => {
let output = tokenised;
for (let i = 0; i < numValues; i++) {
if (i < numVars) {
output = output.replace(cssVarTokeniser.token, v[i]);
} else if (i < numVars + numColors) {
output = output.replace(colorTokeniser.token, color2.transform(v[i]));
} else {
output = output.replace(numberTokeniser.token, sanitize(v[i]));
}
}
return output;
};
}
var convertNumbersToZero = (v) => typeof v === "number" ? 0 : v;
function getAnimatableNone(v) {
const parsed = parseComplexValue(v);
const transformer = createTransformer(v);
return transformer(parsed.map(convertNumbersToZero));
}
var complex = {
test,
parse: parseComplexValue,
createTransformer,
getAnimatableNone
};
// ../../node_modules/framer-motion/dist/es/utils/mix-complex.mjs
var mixImmediate = (origin, target) => (p) => `${p > 0 ? target : origin}`;
function getMixer(origin, target) {
if (typeof origin === "number") {
return (v) => mix2(origin, target, v);
} else if (color2.test(origin)) {
return mixColor(origin, target);
} else {
return origin.startsWith("var(") ? mixImmediate(origin, target) : mixComplex(origin, target);
}
}
var mixArray = (from2, to) => {
const output = [...from2];
const numValues = output.length;
const blendValue = from2.map((fromThis, i) => getMixer(fromThis, to[i]));
return (v) => {
for (let i = 0; i < numValues; i++) {
output[i] = blendValue[i](v);
}
return output;
};
};
var mixObject = (origin, target) => {
const output = { ...origin, ...target };
const blendValue = {};
for (const key in output) {
if (origin[key] !== void 0 && target[key] !== void 0) {
blendValue[key] = getMixer(origin[key], target[key]);
}
}
return (v) => {
for (const key in blendValue) {
output[key] = blendValue[key](v);
}
return output;
};
};
var mixComplex = (origin, target) => {
const template = complex.createTransformer(target);
const originStats = analyseComplexValue(origin);
const targetStats = analyseComplexValue(target);
const canInterpolate = originStats.numVars === targetStats.numVars && originStats.numColors === targetStats.numColors && originStats.numNumbers >= targetStats.numNumbers;
if (canInterpolate) {
return pipe3(mixArray(originStats.values, targetStats.values), template);
} else {
warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);
return mixImmediate(origin, target);
}
};
// ../../node_modules/framer-motion/dist/es/utils/progress.mjs
var progress = (from2, to, value) => {
const toFromDifference = to - from2;
return toFromDifference === 0 ? 1 : (value - from2) / toFromDifference;
};
// ../../node_modules/framer-motion/dist/es/utils/interpolate.mjs
var mixNumber = (from2, to) => (p) => mix2(from2, to, p);
function detectMixerFactory(v) {
if (typeof v === "number") {
return mixNumber;
} else if (typeof v === "string") {
return color2.test(v) ? mixColor : mixComplex;
} else if (Array.isArray(v)) {
return mixArray;
} else if (typeof v === "object") {
return mixObject;
}
return mixNumber;
}
function createMixers(output, ease2, customMixer) {
const mixers = [];
const mixerFactory = customMixer || detectMixerFactory(output[0]);
const numMixers = output.length - 1;
for (let i = 0; i < numMixers; i++) {
let mixer = mixerFactory(output[i], output[i + 1]);
if (ease2) {
const easingFunction = Array.isArray(ease2) ? ease2[i] || noop2 : ease2;
mixer = pipe3(easingFunction, mixer);
}
mixers.push(mixer);
}
return mixers;
}
function interpolate(input, output, { clamp: isClamp = true, ease: ease2, mixer } = {}) {
const inputLength = input.length;
invariant(inputLength === output.length, "Both input and output ranges must be the same length");
if (inputLength === 1)
return () => output[0];
if (input[0] > input[inputLength - 1]) {
input = [...input].reverse();
output = [...output].reverse();
}
const mixers = createMixers(output, ease2, mixer);
const numMixers = mixers.length;
const interpolator = (v) => {
let i = 0;
if (numMixers > 1) {
for (; i < input.length - 2; i++) {
if (v < input[i + 1])
break;
}
}
const progressInRange = progress(input[i], input[i + 1], v);
return mixers[i](progressInRange);
};
return isClamp ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v)) : interpolator;
}
// ../../node_modules/framer-motion/dist/es/utils/offsets/fill.mjs
function fillOffset(offset2, remaining) {
const min2 = offset2[offset2.length - 1];
for (let i = 1; i <= remaining; i++) {
const offsetProgress = progress(0, remaining, i);
offset2.push(mix2(min2, 1, offsetProgress));
}
}
// ../../node_modules/framer-motion/dist/es/utils/offsets/default.mjs
function defaultOffset(arr) {
const offset2 = [0];
fillOffset(offset2, arr.length - 1);
return offset2;
}
// ../../node_modules/framer-motion/dist/es/utils/offsets/time.mjs
function convertOffsetToTimes(offset2, duration) {
return offset2.map((o) => o * duration);
}
// ../../node_modules/framer-motion/dist/es/animation/generators/keyframes.mjs
function defaultEasing(values, easing) {
return values.map(() => easing || easeInOut).splice(0, values.length - 1);
}
function keyframes2({ duration = 300, keyframes: keyframeValues, times, ease: ease2 = "easeInOut" }) {
const easingFunctions = isEasingArray(ease2) ? ease2.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease2);
const state2 = {
done: false,
value: keyframeValues[0]
};
const absoluteTimes = convertOffsetToTimes(
// Only use the provided offsets if they're the correct length
// TODO Maybe we should warn here if there's a length mismatch
times && times.length === keyframeValues.length ? times : defaultOffset(keyframeValues),
duration
);
const mapTimeToKeyframe = interpolate(absoluteTimes, keyframeValues, {
ease: Array.isArray(easingFunctions) ? easingFunctions : defaultEasing(keyframeValues, easingFunctions)
});
return {
calculatedDuration: duration,
next: (t2) => {
state2.value = mapTimeToKeyframe(t2);
state2.done = t2 >= duration;
return state2;
}
};
}
// ../../node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs
function velocityPerSecond(velocity, frameDuration) {
return frameDuration ? velocity * (1e3 / frameDuration) : 0;
}
// ../../node_modules/framer-motion/dist/es/animation/generators/utils/velocity.mjs
var velocitySampleDuration = 5;
function calcGeneratorVelocity(resolveValue, t2, current) {
const prevT = Math.max(t2 - velocitySampleDuration, 0);
return velocityPerSecond(current - resolveValue(prevT), t2 - prevT);
}
// ../../node_modules/framer-motion/dist/es/animation/generators/spring/find.mjs
var safeMin = 1e-3;
var minDuration = 0.01;
var maxDuration = 10;
var minDamping = 0.05;
var maxDamping = 1;
function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
let envelope;
let derivative;
warning(duration <= secondsToMilliseconds(maxDuration), "Spring duration must be 10 seconds or less");
let dampingRatio = 1 - bounce;
dampingRatio = clamp(minDamping, maxDamping, dampingRatio);
duration = clamp(minDuration, maxDuration, millisecondsToSeconds(duration));
if (dampingRatio < 1) {
envelope = (undampedFreq2) => {
const exponentialDecay = undampedFreq2 * dampingRatio;
const delta = exponentialDecay * duration;
const a = exponentialDecay - velocity;
const b = calcAngularFreq(undampedFreq2, dampingRatio);
const c = Math.exp(-delta);
return safeMin - a / b * c;
};
derivative = (undampedFreq2) => {
const exponentialDecay = undampedFreq2 * dampingRatio;
const delta = exponentialDecay * duration;
const d = delta * velocity + velocity;
const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration;
const f = Math.exp(-delta);
const g = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio);
const factor = -envelope(undampedFreq2) + safeMin > 0 ? -1 : 1;
return factor * ((d - e) * f) / g;
};
} else {
envelope = (undampedFreq2) => {
const a = Math.exp(-undampedFreq2 * duration);
const b = (undampedFreq2 - velocity) * duration + 1;
return -safeMin + a * b;
};
derivative = (undampedFreq2) => {
const a = Math.exp(-undampedFreq2 * duration);
const b = (velocity - undampedFreq2) * (duration * duration);
return a * b;
};
}
const initialGuess = 5 / duration;
const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
duration = secondsToMilliseconds(duration);
if (isNaN(undampedFreq)) {
return {
stiffness: 100,
damping: 10,
duration
};
} else {
const stiffness = Math.pow(undampedFreq, 2) * mass;
return {
stiffness,
damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
duration
};
}
}
var rootIterations = 12;
function approximateRoot(envelope, derivative, initialGuess) {
let result = initialGuess;
for (let i = 1; i < rootIterations; i++) {
result = result - envelope(result) / derivative(result);
}
return result;
}
function calcAngularFreq(undampedFreq, dampingRatio) {
return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
}
// ../../node_modules/framer-motion/dist/es/animation/generators/spring/index.mjs
var durationKeys = ["duration", "bounce"];
var physicsKeys = ["stiffness", "damping", "mass"];
function isSpringType(options, keys2) {
return keys2.some((key) => options[key] !== void 0);
}
function getSpringOptions(options) {
let springOptions = {
velocity: 0,
stiffness: 100,
damping: 10,
mass: 1,
isResolvedFromDuration: false,
...options
};
if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) {
const derived = findSpring(options);
springOptions = {
...springOptions,
...derived,
mass: 1
};
springOptions.isResolvedFromDuration = true;
}
return springOptions;
}
function spring({ keyframes: keyframes3, restDelta, restSpeed, ...options }) {
const origin = keyframes3[0];
const target = keyframes3[keyframes3.length - 1];
const state2 = { done: false, value: origin };
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
...options,
velocity: -millisecondsToSeconds(options.velocity || 0)
});
const initialVelocity = velocity || 0;
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
const initialDelta = target - origin;
const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale ? 0.01 : 2);
restDelta || (restDelta = isGranularScale ? 5e-3 : 0.5);
let resolveSpring;
if (dampingRatio < 1) {
const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
resolveSpring = (t2) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2);
return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t2) + initialDelta * Math.cos(angularFreq * t2));
};
} else if (dampingRatio === 1) {
resolveSpring = (t2) => target - Math.exp(-undampedAngularFreq * t2) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t2);
} else {
const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
resolveSpring = (t2) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t2);
const freqForT = Math.min(dampedAngularFreq * t2, 300);
return target - envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT)) / dampedAngularFreq;
};
}
return {
calculatedDuration: isResolvedFromDuration ? duration || null : null,
next: (t2) => {
const current = resolveSpring(t2);
if (!isResolvedFromDuration) {
let currentVelocity = initialVelocity;
if (t2 !== 0) {
if (dampingRatio < 1) {
currentVelocity = calcGeneratorVelocity(resolveSpring, t2, current);
} else {
currentVelocity = 0;
}
}
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
const isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
state2.done = isBelowVelocityThreshold && isBelowDisplacementThreshold;
} else {
state2.done = t2 >= duration;
}
state2.value = state2.done ? target : current;
return state2;
}
};
}
// ../../node_modules/framer-motion/dist/es/animation/generators/inertia.mjs
function inertia({ keyframes: keyframes3, velocity = 0, power = 0.8, timeConstant = 325, bounceDamping = 10, bounceStiffness = 500, modifyTarget, min: min2, max: max2, restDelta = 0.5, restSpeed }) {
const origin = keyframes3[0];
const state2 = {
done: false,
value: origin
};
const isOutOfBounds = (v) => min2 !== void 0 && v < min2 || max2 !== void 0 && v > max2;
const nearestBoundary = (v) => {
if (min2 === void 0)
return max2;
if (max2 === void 0)
return min2;
return Math.abs(min2 - v) < Math.abs(max2 - v) ? min2 : max2;
};
let amplitude = power * velocity;
const ideal = origin + amplitude;
const target = modifyTarget === void 0 ? ideal : modifyTarget(ideal);
if (target !== ideal)
amplitude = target - origin;
const calcDelta = (t2) => -amplitude * Math.exp(-t2 / timeConstant);
const calcLatest = (t2) => target + calcDelta(t2);
const applyFriction = (t2) => {
const delta = calcDelta(t2);
const latest = calcLatest(t2);
state2.done = Math.abs(delta) <= restDelta;
state2.value = state2.done ? target : latest;
};
let timeReachedBoundary;
let spring$1;
const checkCatchBoundary = (t2) => {
if (!isOutOfBounds(state2.value))
return;
timeReachedBoundary = t2;
spring$1 = spring({
keyframes: [state2.value, nearestBoundary(state2.value)],
velocity: calcGeneratorVelocity(calcLatest, t2, state2.value),
damping: bounceDamping,
stiffness: bounceStiffness,
restDelta,
restSpeed
});
};
checkCatchBoundary(0);
return {
calculatedDuration: null,
next: (t2) => {
let hasUpdatedFrame = false;
if (!spring$1 && timeReachedBoundary === void 0) {
hasUpdatedFrame = true;
applyFriction(t2);
checkCatchBoundary(t2);
}
if (timeReachedBoundary !== void 0 && t2 > timeReachedBoundary) {
return spring$1.next(t2 - timeReachedBoundary);
} else {
!hasUpdatedFrame && applyFriction(t2);
return state2;
}
}
};
}
// ../../node_modules/framer-motion/dist/es/animation/animators/js/driver-frameloop.mjs
var frameloopDriver = (update) => {
const passTimestamp = ({ timestamp }) => update(timestamp);
return {
start: () => frame2.update(passTimestamp, true),
stop: () => cancelFrame(passTimestamp),
/**
* If we're processing this frame we can use the
* framelocked timestamp to keep things in sync.
*/
now: () => frameData.isProcessing ? frameData.timestamp : performance.now()
};
};
// ../../node_modules/framer-motion/dist/es/animation/generators/utils/calc-duration.mjs
var maxGeneratorDuration = 2e4;
function calcGeneratorDuration(generator) {
let duration = 0;
const timeStep = 50;
let state2 = generator.next(duration);
while (!state2.done && duration < maxGeneratorDuration) {
duration += timeStep;
state2 = generator.next(duration);
}
return duration >= maxGeneratorDuration ? Infinity : duration;
}
// ../../node_modules/framer-motion/dist/es/animation/animators/js/index.mjs
var types = {
decay: inertia,
inertia,
tween: keyframes2,
keyframes: keyframes2,
spring
};
function animateValue({ autoplay = true, delay: delay2 = 0, driver = frameloopDriver, keyframes: keyframes$1, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", onPlay, onStop, onComplete, onUpdate, ...options }) {
let speed = 1;
let hasStopped = false;
let resolveFinishedPromise;
let currentFinishedPromise;
const updateFinishedPromise = () => {
currentFinishedPromise = new Promise((resolve) => {
resolveFinishedPromise = resolve;
});
};
updateFinishedPromise();
let animationDriver;
const generatorFactory = types[type] || keyframes2;
let mapNumbersToKeyframes;
if (generatorFactory !== keyframes2 && typeof keyframes$1[0] !== "number") {
if (true) {
invariant(keyframes$1.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`);
}
mapNumbersToKeyframes = interpolate([0, 100], keyframes$1, {
clamp: false
});
keyframes$1 = [0, 100];
}
const generator = generatorFactory({ ...options, keyframes: keyframes$1 });
let mirroredGenerator;
if (repeatType === "mirror") {
mirroredGenerator = generatorFactory({
...options,
keyframes: [...keyframes$1].reverse(),
velocity: -(options.velocity || 0)
});
}
let playState = "idle";
let holdTime = null;
let startTime = null;
let cancelTime = null;
if (generator.calculatedDuration === null && repeat) {
generator.calculatedDuration = calcGeneratorDuration(generator);
}
const { calculatedDuration } = generator;
let resolvedDuration = Infinity;
let totalDuration = Infinity;
if (calculatedDuration !== null) {
resolvedDuration = calculatedDuration + repeatDelay;
totalDuration = resolvedDuration * (repeat + 1) - repeatDelay;
}
let currentTime = 0;
const tick = (timestamp) => {
if (startTime === null)
return;
if (speed > 0)
startTime = Math.min(startTime, timestamp);
if (speed < 0)
startTime = Math.min(timestamp - totalDuration / speed, startTime);
if (holdTime !== null) {
currentTime = holdTime;
} else {
currentTime = Math.round(timestamp - startTime) * speed;
}
const timeWithoutDelay = currentTime - delay2 * (speed >= 0 ? 1 : -1);
const isInDelayPhase = speed >= 0 ? timeWithoutDelay < 0 : timeWithoutDelay > totalDuration;
currentTime = Math.max(timeWithoutDelay, 0);
if (playState === "finished" && holdTime === null) {
currentTime = totalDuration;
}
let elapsed = currentTime;
let frameGenerator = generator;
if (repeat) {
const progress3 = Math.min(currentTime, totalDuration) / resolvedDuration;
let currentIteration = Math.floor(progress3);
let iterationProgress = progress3 % 1;
if (!iterationProgress && progress3 >= 1) {
iterationProgress = 1;
}
iterationProgress === 1 && currentIteration--;
currentIteration = Math.min(currentIteration, repeat + 1);
const isOddIteration = Boolean(currentIteration % 2);
if (isOddIteration) {
if (repeatType === "reverse") {
iterationProgress = 1 - iterationProgress;
if (repeatDelay) {
iterationProgress -= repeatDelay / resolvedDuration;
}
} else if (repeatType === "mirror") {
frameGenerator = mirroredGenerator;
}
}
elapsed = clamp(0, 1, iterationProgress) * resolvedDuration;
}
const state2 = isInDelayPhase ? { done: false, value: keyframes$1[0] } : frameGenerator.next(elapsed);
if (mapNumbersToKeyframes) {
state2.value = mapNumbersToKeyframes(state2.value);
}
let { done } = state2;
if (!isInDelayPhase && calculatedDuration !== null) {
done = speed >= 0 ? currentTime >= totalDuration : currentTime <= 0;
}
const isAnimationFinished = holdTime === null && (playState === "finished" || playState === "running" && done);
if (onUpdate) {
onUpdate(state2.value);
}
if (isAnimationFinished) {
finish();
}
return state2;
};
const stopAnimationDriver = () => {
animationDriver && animationDriver.stop();
animationDriver = void 0;
};
const cancel = () => {
playState = "idle";
stopAnimationDriver();
resolveFinishedPromise();
updateFinishedPromise();
startTime = cancelTime = null;
};
const finish = () => {
playState = "finished";
onComplete && onComplete();
stopAnimationDriver();
resolveFinishedPromise();
};
const play = () => {
if (hasStopped)
return;
if (!animationDriver)
animationDriver = driver(tick);
const now = animationDriver.now();
onPlay && onPlay();
if (holdTime !== null) {
startTime = now - holdTime;
} else if (!startTime || playState === "finished") {
startTime = now;
}
if (playState === "finished") {
updateFinishedPromise();
}
cancelTime = startTime;
holdTime = null;
playState = "running";
animationDriver.start();
};
if (autoplay) {
play();
}
const controls = {
then(resolve, reject) {
return currentFinishedPromise.then(resolve, reject);
},
get time() {
return millisecondsToSeconds(currentTime);
},
set time(newTime) {
newTime = secondsToMilliseconds(newTime);
currentTime = newTime;
if (holdTime !== null || !animationDriver || speed === 0) {
holdTime = newTime;
} else {
startTime = animationDriver.now() - newTime / speed;
}
},
get duration() {
const duration = generator.calculatedDuration === null ? calcGeneratorDuration(generator) : generator.calculatedDuration;
return millisecondsToSeconds(duration);
},
get speed() {
return speed;
},
set speed(newSpeed) {
if (newSpeed === speed || !animationDriver)
return;
speed = newSpeed;
controls.time = millisecondsToSeconds(currentTime);
},
get state() {
return playState;
},
play,
pause: () => {
playState = "paused";
holdTime = currentTime;
},
stop: () => {
hasStopped = true;
if (playState === "idle")
return;
playState = "idle";
onStop && onStop();
cancel();
},
cancel: () => {
if (cancelTime !== null)
tick(cancelTime);
cancel();
},
complete: () => {
playState = "finished";
},
sample: (elapsed) => {
startTime = 0;
return tick(elapsed);
}
};
return controls;
}
// ../../node_modules/framer-motion/dist/es/utils/memo.mjs
function memo(callback) {
let result;
return () => {
if (result === void 0)
result = callback();
return result;
};
}
// ../../node_modules/framer-motion/dist/es/animation/animators/waapi/create-accelerated-animation.mjs
var supportsWaapi = memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
var acceleratedValues = /* @__PURE__ */ new Set([
"opacity",
"clipPath",
"filter",
"transform",
"backgroundColor"
]);
var sampleDelta = 10;
var maxDuration2 = 2e4;
var requiresPregeneratedKeyframes = (valueName, options) => options.type === "spring" || valueName === "backgroundColor" || !isWaapiSupportedEasing(options.ease);
function createAcceleratedAnimation(value, valueName, { onUpdate, onComplete, ...options }) {
const canAccelerateAnimation = supportsWaapi() && acceleratedValues.has(valueName) && !options.repeatDelay && options.repeatType !== "mirror" && options.damping !== 0 && options.type !== "inertia";
if (!canAccelerateAnimation)
return false;
let hasStopped = false;
let resolveFinishedPromise;
let currentFinishedPromise;
let pendingCancel = false;
const updateFinishedPromise = () => {
currentFinishedPromise = new Promise((resolve) => {
resolveFinishedPromise = resolve;
});
};
updateFinishedPromise();
let { keyframes: keyframes3, duration = 300, ease: ease2, times } = options;
if (requiresPregeneratedKeyframes(valueName, options)) {
const sampleAnimation = animateValue({
...options,
repeat: 0,
delay: 0
});
let state2 = { done: false, value: keyframes3[0] };
const pregeneratedKeyframes = [];
let t2 = 0;
while (!state2.done && t2 < maxDuration2) {
state2 = sampleAnimation.sample(t2);
pregeneratedKeyframes.push(state2.value);
t2 += sampleDelta;
}
times = void 0;
keyframes3 = pregeneratedKeyframes;
duration = t2 - sampleDelta;
ease2 = "linear";
}
const animation = animateStyle(value.owner.current, valueName, keyframes3, {
...options,
duration,
/**
* This function is currently not called if ease is provided
* as a function so the cast is safe.
*
* However it would be possible for a future refinement to port
* in easing pregeneration from Motion One for browsers that
* support the upcoming `linear()` easing function.
*/
ease: ease2,
times
});
const cancelAnimation = () => {
pendingCancel = false;
animation.cancel();
};
const safeCancel = () => {
pendingCancel = true;
frame2.update(cancelAnimation);
resolveFinishedPromise();
updateFinishedPromise();
};
animation.onfinish = () => {
if (pendingCancel)
return;
value.set(getFinalKeyframe(keyframes3, options));
onComplete && onComplete();
safeCancel();
};
const controls = {
then(resolve, reject) {
return currentFinishedPromise.then(resolve, reject);
},
attachTimeline(timeline) {
animation.timeline = timeline;
animation.onfinish = null;
return noop2;
},
get time() {
return millisecondsToSeconds(animation.currentTime || 0);
},
set time(newTime) {
animation.currentTime = secondsToMilliseconds(newTime);
},
get speed() {
return animation.playbackRate;
},
set speed(newSpeed) {
animation.playbackRate = newSpeed;
},
get duration() {
return millisecondsToSeconds(duration);
},
play: () => {
if (hasStopped)
return;
animation.play();
cancelFrame(cancelAnimation);
},
pause: () => animation.pause(),
stop: () => {
hasStopped = true;
if (animation.playState === "idle")
return;
const { currentTime } = animation;
if (currentTime) {
const sampleAnimation = animateValue({
...options,
autoplay: false
});
value.setWithVelocity(sampleAnimation.sample(currentTime - sampleDelta).value, sampleAnimation.sample(currentTime).value, sampleDelta);
}
safeCancel();
},
complete: () => {
if (pendingCancel)
return;
animation.finish();
},
cancel: safeCancel
};
return controls;
}
// ../../node_modules/framer-motion/dist/es/animation/animators/instant.mjs
function createInstantAnimation({ keyframes: keyframes3, delay: delay2, onUpdate, onComplete }) {
const setValue = () => {
onUpdate && onUpdate(keyframes3[keyframes3.length - 1]);
onComplete && onComplete();
return {
time: 0,
speed: 1,
duration: 0,
play: noop2,
pause: noop2,
stop: noop2,
then: (resolve) => {
resolve();
return Promise.resolve();
},
cancel: noop2,
complete: noop2
};
};
return delay2 ? animateValue({
keyframes: [0, 1],
duration: 0,
delay: delay2,
onComplete: setValue
}) : setValue();
}
// ../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs
var underDampedSpring = {
type: "spring",
stiffness: 500,
damping: 25,
restSpeed: 10
};
var criticallyDampedSpring = (target) => ({
type: "spring",
stiffness: 550,
damping: target === 0 ? 2 * Math.sqrt(550) : 30,
restSpeed: 10
});
var keyframesTransition = {
type: "keyframes",
duration: 0.8
};
var ease = {
type: "keyframes",
ease: [0.25, 0.1, 0.35, 1],
duration: 0.3
};
var getDefaultTransition = (valueKey, { keyframes: keyframes3 }) => {
if (keyframes3.length > 2) {
return keyframesTransition;
} else if (transformProps.has(valueKey)) {
return valueKey.startsWith("scale") ? criticallyDampedSpring(keyframes3[1]) : underDampedSpring;
}
return ease;
};
// ../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs
var isAnimatable = (key, value) => {
if (key === "zIndex")
return false;
if (typeof value === "number" || Array.isArray(value))
return true;
if (typeof value === "string" && // It's animatable if we have a string
(complex.test(value) || value === "0") && // And it contains numbers and/or colors
!value.startsWith("url(")) {
return true;
}
return false;
};
// ../../node_modules/framer-motion/dist/es/value/types/complex/filter.mjs
var maxDefaults = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
function applyDefaultFilter(v) {
const [name, value] = v.slice(0, -1).split("(");
if (name === "drop-shadow")
return v;
const [number2] = value.match(floatRegex) || [];
if (!number2)
return v;
const unit = value.replace(number2, "");
let defaultValue = maxDefaults.has(name) ? 1 : 0;
if (number2 !== value)
defaultValue *= 100;
return name + "(" + defaultValue + unit + ")";
}
var functionRegex = /([a-z-]*)\(.*?\)/g;
var filter3 = {
...complex,
getAnimatableNone: (v) => {
const functions = v.match(functionRegex);
return functions ? functions.map(applyDefaultFilter).join(" ") : v;
}
};
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs
var defaultValueTypes = {
...numberValueTypes,
// Color props
color: color2,
backgroundColor: color2,
outlineColor: color2,
fill: color2,
stroke: color2,
// Border props
borderColor: color2,
borderTopColor: color2,
borderRightColor: color2,
borderBottomColor: color2,
borderLeftColor: color2,
filter: filter3,
WebkitFilter: filter3
};
var getDefaultValueType = (key) => defaultValueTypes[key];
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs
function getAnimatableNone2(key, value) {
let defaultValueType = getDefaultValueType(key);
if (defaultValueType !== filter3)
defaultValueType = complex;
return defaultValueType.getAnimatableNone ? defaultValueType.getAnimatableNone(value) : void 0;
}
// ../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs
var isZeroValueString = (v) => /^0[^.\s]+$/.test(v);
// ../../node_modules/framer-motion/dist/es/animation/utils/is-none.mjs
function isNone(value) {
if (typeof value === "number") {
return value === 0;
} else if (value !== null) {
return value === "none" || value === "0" || isZeroValueString(value);
}
}
// ../../node_modules/framer-motion/dist/es/animation/utils/keyframes.mjs
function getKeyframes(value, valueName, target, transition3) {
const isTargetAnimatable = isAnimatable(valueName, target);
let keyframes3;
if (Array.isArray(target)) {
keyframes3 = [...target];
} else {
keyframes3 = [null, target];
}
const defaultOrigin = transition3.from !== void 0 ? transition3.from : value.get();
let animatableTemplateValue = void 0;
const noneKeyframeIndexes = [];
for (let i = 0; i < keyframes3.length; i++) {
if (keyframes3[i] === null) {
keyframes3[i] = i === 0 ? defaultOrigin : keyframes3[i - 1];
}
if (isNone(keyframes3[i])) {
noneKeyframeIndexes.push(i);
}
if (typeof keyframes3[i] === "string" && keyframes3[i] !== "none" && keyframes3[i] !== "0") {
animatableTemplateValue = keyframes3[i];
}
}
if (isTargetAnimatable && noneKeyframeIndexes.length && animatableTemplateValue) {
for (let i = 0; i < noneKeyframeIndexes.length; i++) {
const index2 = noneKeyframeIndexes[i];
keyframes3[index2] = getAnimatableNone2(valueName, animatableTemplateValue);
}
}
return keyframes3;
}
// ../../node_modules/framer-motion/dist/es/animation/utils/transitions.mjs
function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from: from2, elapsed, ...transition3 }) {
return !!Object.keys(transition3).length;
}
function getValueTransition(transition3, key) {
return transition3[key] || transition3["default"] || transition3;
}
// ../../node_modules/framer-motion/dist/es/utils/GlobalConfig.mjs
var MotionGlobalConfig = {
skipAnimations: false
};
// ../../node_modules/framer-motion/dist/es/animation/interfaces/motion-value.mjs
var animateMotionValue = (valueName, value, target, transition3 = {}) => {
return (onComplete) => {
const valueTransition = getValueTransition(transition3, valueName) || {};
const delay2 = valueTransition.delay || transition3.delay || 0;
let { elapsed = 0 } = transition3;
elapsed = elapsed - secondsToMilliseconds(delay2);
const keyframes3 = getKeyframes(value, valueName, target, valueTransition);
const originKeyframe = keyframes3[0];
const targetKeyframe = keyframes3[keyframes3.length - 1];
const isOriginAnimatable = isAnimatable(valueName, originKeyframe);
const isTargetAnimatable = isAnimatable(valueName, targetKeyframe);
warning(isOriginAnimatable === isTargetAnimatable, `You are trying to animate ${valueName} from "${originKeyframe}" to "${targetKeyframe}". ${originKeyframe} is not an animatable value - to enable this animation set ${originKeyframe} to a value animatable to ${targetKeyframe} via the \`style\` property.`);
let options = {
keyframes: keyframes3,
velocity: value.getVelocity(),
ease: "easeOut",
...valueTransition,
delay: -elapsed,
onUpdate: (v) => {
value.set(v);
valueTransition.onUpdate && valueTransition.onUpdate(v);
},
onComplete: () => {
onComplete();
valueTransition.onComplete && valueTransition.onComplete();
}
};
if (!isTransitionDefined(valueTransition)) {
options = {
...options,
...getDefaultTransition(valueName, options)
};
}
if (options.duration) {
options.duration = secondsToMilliseconds(options.duration);
}
if (options.repeatDelay) {
options.repeatDelay = secondsToMilliseconds(options.repeatDelay);
}
if (!isOriginAnimatable || !isTargetAnimatable || instantAnimationState.current || valueTransition.type === false || MotionGlobalConfig.skipAnimations) {
return createInstantAnimation(instantAnimationState.current ? { ...options, delay: 0 } : options);
}
if (
/**
* If this is a handoff animation, the optimised animation will be running via
* WAAPI. Therefore, this animation must be JS to ensure it runs "under" the
* optimised animation.
*/
!transition3.isHandoff && value.owner && value.owner.current instanceof HTMLElement && /**
* If we're outputting values to onUpdate then we can't use WAAPI as there's
* no way to read the value from WAAPI every frame.
*/
!value.owner.getProps().onUpdate
) {
const acceleratedAnimation = createAcceleratedAnimation(value, valueName, options);
if (acceleratedAnimation)
return acceleratedAnimation;
}
return animateValue(options);
};
};
// ../../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs
function isWillChangeMotionValue(value) {
return Boolean(isMotionValue(value) && value.add);
}
// ../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs
var isNumericalString = (v) => /^\-?\d*\.?\d+$/.test(v);
// ../../node_modules/framer-motion/dist/es/utils/array.mjs
function addUniqueItem(arr, item) {
if (arr.indexOf(item) === -1)
arr.push(item);
}
function removeItem(arr, item) {
const index2 = arr.indexOf(item);
if (index2 > -1)
arr.splice(index2, 1);
}
function moveItem([...arr], fromIndex, toIndex) {
const startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex;
if (startIndex >= 0 && startIndex < arr.length) {
const endIndex = toIndex < 0 ? arr.length + toIndex : toIndex;
const [item] = arr.splice(fromIndex, 1);
arr.splice(endIndex, 0, item);
}
return arr;
}
// ../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs
var SubscriptionManager = class {
constructor() {
this.subscriptions = [];
}
add(handler) {
addUniqueItem(this.subscriptions, handler);
return () => removeItem(this.subscriptions, handler);
}
notify(a, b, c) {
const numSubscriptions = this.subscriptions.length;
if (!numSubscriptions)
return;
if (numSubscriptions === 1) {
this.subscriptions[0](a, b, c);
} else {
for (let i = 0; i < numSubscriptions; i++) {
const handler = this.subscriptions[i];
handler && handler(a, b, c);
}
}
}
getSize() {
return this.subscriptions.length;
}
clear() {
this.subscriptions.length = 0;
}
};
// ../../node_modules/framer-motion/dist/es/utils/warn-once.mjs
var warned = /* @__PURE__ */ new Set();
function warnOnce(condition, message, element) {
if (condition || warned.has(message))
return;
console.warn(message);
if (element)
console.warn(element);
warned.add(message);
}
// ../../node_modules/framer-motion/dist/es/value/index.mjs
var isFloat = (value) => {
return !isNaN(parseFloat(value));
};
var collectMotionValues = {
current: void 0
};
var MotionValue = class {
/**
* @param init - The initiating value
* @param config - Optional configuration options
*
* - `transformer`: A function to transform incoming values with.
*
* @internal
*/
constructor(init, options = {}) {
this.version = "10.18.0";
this.timeDelta = 0;
this.lastUpdated = 0;
this.canTrackVelocity = false;
this.events = {};
this.updateAndNotify = (v, render = true) => {
this.prev = this.current;
this.current = v;
const { delta, timestamp } = frameData;
if (this.lastUpdated !== timestamp) {
this.timeDelta = delta;
this.lastUpdated = timestamp;
frame2.postRender(this.scheduleVelocityCheck);
}
if (this.prev !== this.current && this.events.change) {
this.events.change.notify(this.current);
}
if (this.events.velocityChange) {
this.events.velocityChange.notify(this.getVelocity());
}
if (render && this.events.renderRequest) {
this.events.renderRequest.notify(this.current);
}
};
this.scheduleVelocityCheck = () => frame2.postRender(this.velocityCheck);
this.velocityCheck = ({ timestamp }) => {
if (timestamp !== this.lastUpdated) {
this.prev = this.current;
if (this.events.velocityChange) {
this.events.velocityChange.notify(this.getVelocity());
}
}
};
this.hasAnimated = false;
this.prev = this.current = init;
this.canTrackVelocity = isFloat(this.current);
this.owner = options.owner;
}
/**
* Adds a function that will be notified when the `MotionValue` is updated.
*
* It returns a function that, when called, will cancel the subscription.
*
* When calling `onChange` inside a React component, it should be wrapped with the
* `useEffect` hook. As it returns an unsubscribe function, this should be returned
* from the `useEffect` function to ensure you don't add duplicate subscribers..
*
* ```jsx
* export const MyComponent = () => {
* const x = useMotionValue(0)
* const y = useMotionValue(0)
* const opacity = useMotionValue(1)
*
* useEffect(() => {
* function updateOpacity() {
* const maxXY = Math.max(x.get(), y.get())
* const newOpacity = transform(maxXY, [0, 100], [1, 0])
* opacity.set(newOpacity)
* }
*
* const unsubscribeX = x.on("change", updateOpacity)
* const unsubscribeY = y.on("change", updateOpacity)
*
* return () => {
* unsubscribeX()
* unsubscribeY()
* }
* }, [])
*
* return
* }
* ```
*
* @param subscriber - A function that receives the latest value.
* @returns A function that, when called, will cancel this subscription.
*
* @deprecated
*/
onChange(subscription) {
if (true) {
warnOnce(false, `value.onChange(callback) is deprecated. Switch to value.on("change", callback).`);
}
return this.on("change", subscription);
}
on(eventName, callback) {
if (!this.events[eventName]) {
this.events[eventName] = new SubscriptionManager();
}
const unsubscribe = this.events[eventName].add(callback);
if (eventName === "change") {
return () => {
unsubscribe();
frame2.read(() => {
if (!this.events.change.getSize()) {
this.stop();
}
});
};
}
return unsubscribe;
}
clearListeners() {
for (const eventManagers in this.events) {
this.events[eventManagers].clear();
}
}
/**
* Attaches a passive effect to the `MotionValue`.
*
* @internal
*/
attach(passiveEffect, stopPassiveEffect) {
this.passiveEffect = passiveEffect;
this.stopPassiveEffect = stopPassiveEffect;
}
/**
* Sets the state of the `MotionValue`.
*
* @remarks
*
* ```jsx
* const x = useMotionValue(0)
* x.set(10)
* ```
*
* @param latest - Latest value to set.
* @param render - Whether to notify render subscribers. Defaults to `true`
*
* @public
*/
set(v, render = true) {
if (!render || !this.passiveEffect) {
this.updateAndNotify(v, render);
} else {
this.passiveEffect(v, this.updateAndNotify);
}
}
setWithVelocity(prev2, current, delta) {
this.set(current);
this.prev = prev2;
this.timeDelta = delta;
}
/**
* Set the state of the `MotionValue`, stopping any active animations,
* effects, and resets velocity to `0`.
*/
jump(v) {
this.updateAndNotify(v);
this.prev = v;
this.stop();
if (this.stopPassiveEffect)
this.stopPassiveEffect();
}
/**
* Returns the latest state of `MotionValue`
*
* @returns - The latest state of `MotionValue`
*
* @public
*/
get() {
if (collectMotionValues.current) {
collectMotionValues.current.push(this);
}
return this.current;
}
/**
* @public
*/
getPrevious() {
return this.prev;
}
/**
* Returns the latest velocity of `MotionValue`
*
* @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
*
* @public
*/
getVelocity() {
return this.canTrackVelocity ? (
// These casts could be avoided if parseFloat would be typed better
velocityPerSecond(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta)
) : 0;
}
/**
* Registers a new animation to control this `MotionValue`. Only one
* animation can drive a `MotionValue` at one time.
*
* ```jsx
* value.start()
* ```
*
* @param animation - A function that starts the provided animation
*
* @internal
*/
start(startAnimation) {
this.stop();
return new Promise((resolve) => {
this.hasAnimated = true;
this.animation = startAnimation(resolve);
if (this.events.animationStart) {
this.events.animationStart.notify();
}
}).then(() => {
if (this.events.animationComplete) {
this.events.animationComplete.notify();
}
this.clearAnimation();
});
}
/**
* Stop the currently active animation.
*
* @public
*/
stop() {
if (this.animation) {
this.animation.stop();
if (this.events.animationCancel) {
this.events.animationCancel.notify();
}
}
this.clearAnimation();
}
/**
* Returns `true` if this value is currently animating.
*
* @public
*/
isAnimating() {
return !!this.animation;
}
clearAnimation() {
delete this.animation;
}
/**
* Destroy and clean up subscribers to this `MotionValue`.
*
* The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
* handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
* created a `MotionValue` via the `motionValue` function.
*
* @public
*/
destroy() {
this.clearListeners();
this.stop();
if (this.stopPassiveEffect) {
this.stopPassiveEffect();
}
}
};
function motionValue(init, options) {
return new MotionValue(init, options);
}
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs
var testValueType = (v) => (type) => type.test(v);
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs
var auto = {
test: (v) => v === "auto",
parse: (v) => v
};
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs
var dimensionValueTypes = [number, px2, percent, degrees, vw, vh, auto];
var findDimensionValueType = (v) => dimensionValueTypes.find(testValueType(v));
// ../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs
var valueTypes = [...dimensionValueTypes, color2, complex];
var findValueType = (v) => valueTypes.find(testValueType(v));
// ../../node_modules/framer-motion/dist/es/render/utils/setters.mjs
function setMotionValue(visualElement, key, value) {
if (visualElement.hasValue(key)) {
visualElement.getValue(key).set(value);
} else {
visualElement.addValue(key, motionValue(value));
}
}
function setTarget(visualElement, definition) {
const resolved = resolveVariant(visualElement, definition);
let { transitionEnd = {}, transition: transition3 = {}, ...target } = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {};
target = { ...target, ...transitionEnd };
for (const key in target) {
const value = resolveFinalValueInKeyframes(target[key]);
setMotionValue(visualElement, key, value);
}
}
function checkTargetForNewValues(visualElement, target, origin) {
var _a8, _b3;
const newValueKeys = Object.keys(target).filter((key) => !visualElement.hasValue(key));
const numNewValues = newValueKeys.length;
if (!numNewValues)
return;
for (let i = 0; i < numNewValues; i++) {
const key = newValueKeys[i];
const targetValue = target[key];
let value = null;
if (Array.isArray(targetValue)) {
value = targetValue[0];
}
if (value === null) {
value = (_b3 = (_a8 = origin[key]) !== null && _a8 !== void 0 ? _a8 : visualElement.readValue(key)) !== null && _b3 !== void 0 ? _b3 : target[key];
}
if (value === void 0 || value === null)
continue;
if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) {
value = parseFloat(value);
} else if (!findValueType(value) && complex.test(targetValue)) {
value = getAnimatableNone2(key, targetValue);
}
visualElement.addValue(key, motionValue(value, { owner: visualElement }));
if (origin[key] === void 0) {
origin[key] = value;
}
if (value !== null)
visualElement.setBaseTarget(key, value);
}
}
function getOriginFromTransition(key, transition3) {
if (!transition3)
return;
const valueTransition = transition3[key] || transition3["default"] || transition3;
return valueTransition.from;
}
function getOrigin(target, transition3, visualElement) {
const origin = {};
for (const key in target) {
const transitionOrigin = getOriginFromTransition(key, transition3);
if (transitionOrigin !== void 0) {
origin[key] = transitionOrigin;
} else {
const value = visualElement.getValue(key);
if (value) {
origin[key] = value.get();
}
}
}
return origin;
}
// ../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-target.mjs
function shouldBlockAnimation({ protectedKeys, needsAnimating }, key) {
const shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
needsAnimating[key] = false;
return shouldBlock;
}
function hasKeyframesChanged(value, target) {
const current = value.get();
if (Array.isArray(target)) {
for (let i = 0; i < target.length; i++) {
if (target[i] !== current)
return true;
}
} else {
return current !== target;
}
}
function animateTarget(visualElement, definition, { delay: delay2 = 0, transitionOverride, type } = {}) {
let { transition: transition3 = visualElement.getDefaultTransition(), transitionEnd, ...target } = visualElement.makeTargetAnimatable(definition);
const willChange = visualElement.getValue("willChange");
if (transitionOverride)
transition3 = transitionOverride;
const animations2 = [];
const animationTypeState = type && visualElement.animationState && visualElement.animationState.getState()[type];
for (const key in target) {
const value = visualElement.getValue(key);
const valueTarget = target[key];
if (!value || valueTarget === void 0 || animationTypeState && shouldBlockAnimation(animationTypeState, key)) {
continue;
}
const valueTransition = {
delay: delay2,
elapsed: 0,
...getValueTransition(transition3 || {}, key)
};
if (window.HandoffAppearAnimations) {
const appearId = visualElement.getProps()[optimizedAppearDataAttribute];
if (appearId) {
const elapsed = window.HandoffAppearAnimations(appearId, key, value, frame2);
if (elapsed !== null) {
valueTransition.elapsed = elapsed;
valueTransition.isHandoff = true;
}
}
}
let canSkip = !valueTransition.isHandoff && !hasKeyframesChanged(value, valueTarget);
if (valueTransition.type === "spring" && (value.getVelocity() || valueTransition.velocity)) {
canSkip = false;
}
if (value.animation) {
canSkip = false;
}
if (canSkip)
continue;
value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key) ? { type: false } : valueTransition));
const animation = value.animation;
if (isWillChangeMotionValue(willChange)) {
willChange.add(key);
animation.then(() => willChange.remove(key));
}
animations2.push(animation);
}
if (transitionEnd) {
Promise.all(animations2).then(() => {
transitionEnd && setTarget(visualElement, transitionEnd);
});
}
return animations2;
}
// ../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element-variant.mjs
function animateVariant(visualElement, variant, options = {}) {
const resolved = resolveVariant(visualElement, variant, options.custom);
let { transition: transition3 = visualElement.getDefaultTransition() || {} } = resolved || {};
if (options.transitionOverride) {
transition3 = options.transitionOverride;
}
const getAnimation = resolved ? () => Promise.all(animateTarget(visualElement, resolved, options)) : () => Promise.resolve();
const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size ? (forwardDelay = 0) => {
const { delayChildren = 0, staggerChildren, staggerDirection } = transition3;
return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
} : () => Promise.resolve();
const { when } = transition3;
if (when) {
const [first, last] = when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation];
return first().then(() => last());
} else {
return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
}
}
function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
const animations2 = [];
const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
const generateStaggerDuration = staggerDirection === 1 ? (i = 0) => i * staggerChildren : (i = 0) => maxStaggerDuration - i * staggerChildren;
Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i) => {
child.notify("AnimationStart", variant);
animations2.push(animateVariant(child, variant, {
...options,
delay: delayChildren + generateStaggerDuration(i)
}).then(() => child.notify("AnimationComplete", variant)));
});
return Promise.all(animations2);
}
function sortByTreeOrder(a, b) {
return a.sortNodePosition(b);
}
// ../../node_modules/framer-motion/dist/es/animation/interfaces/visual-element.mjs
function animateVisualElement(visualElement, definition, options = {}) {
visualElement.notify("AnimationStart", definition);
let animation;
if (Array.isArray(definition)) {
const animations2 = definition.map((variant) => animateVariant(visualElement, variant, options));
animation = Promise.all(animations2);
} else if (typeof definition === "string") {
animation = animateVariant(visualElement, definition, options);
} else {
const resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition;
animation = Promise.all(animateTarget(visualElement, resolvedDefinition, options));
}
return animation.then(() => visualElement.notify("AnimationComplete", definition));
}
// ../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs
var reversePriorityOrder = [...variantPriorityOrder].reverse();
var numAnimationTypes = variantPriorityOrder.length;
function animateList(visualElement) {
return (animations2) => Promise.all(animations2.map(({ animation, options }) => animateVisualElement(visualElement, animation, options)));
}
function createAnimationState(visualElement) {
let animate2 = animateList(visualElement);
const state2 = createState();
let isInitialRender = true;
const buildResolvedTypeValues = (acc, definition) => {
const resolved = resolveVariant(visualElement, definition);
if (resolved) {
const { transition: transition3, transitionEnd, ...target } = resolved;
acc = { ...acc, ...target, ...transitionEnd };
}
return acc;
};
function setAnimateFunction(makeAnimator) {
animate2 = makeAnimator(visualElement);
}
function animateChanges(options, changedActiveType) {
const props = visualElement.getProps();
const context = visualElement.getVariantContext(true) || {};
const animations2 = [];
const removedKeys = /* @__PURE__ */ new Set();
let encounteredKeys = {};
let removedVariantIndex = Infinity;
for (let i = 0; i < numAnimationTypes; i++) {
const type = reversePriorityOrder[i];
const typeState = state2[type];
const prop = props[type] !== void 0 ? props[type] : context[type];
const propIsVariant = isVariantLabel(prop);
const activeDelta = type === changedActiveType ? typeState.isActive : null;
if (activeDelta === false)
removedVariantIndex = i;
let isInherited = prop === context[type] && prop !== props[type] && propIsVariant;
if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) {
isInherited = false;
}
typeState.protectedKeys = { ...encounteredKeys };
if (
// If it isn't active and hasn't *just* been set as inactive
!typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type
!prop && !typeState.prevProp || // Or if the prop doesn't define an animation
isAnimationControls(prop) || typeof prop === "boolean"
) {
continue;
}
const variantDidChange = checkVariantsDidChange(typeState.prevProp, prop);
let shouldAnimateType = variantDidChange || // If we're making this variant active, we want to always make it active
type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || // If we removed a higher-priority variant (i is in reverse order)
i > removedVariantIndex && propIsVariant;
let handledRemovedValues = false;
const definitionList = Array.isArray(prop) ? prop : [prop];
let resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});
if (activeDelta === false)
resolvedValues = {};
const { prevResolvedValues = {} } = typeState;
const allKeys = {
...prevResolvedValues,
...resolvedValues
};
const markToAnimate = (key) => {
shouldAnimateType = true;
if (removedKeys.has(key)) {
handledRemovedValues = true;
removedKeys.delete(key);
}
typeState.needsAnimating[key] = true;
};
for (const key in allKeys) {
const next2 = resolvedValues[key];
const prev2 = prevResolvedValues[key];
if (encounteredKeys.hasOwnProperty(key))
continue;
let valueHasChanged = false;
if (isKeyframesTarget(next2) && isKeyframesTarget(prev2)) {
valueHasChanged = !shallowCompare(next2, prev2);
} else {
valueHasChanged = next2 !== prev2;
}
if (valueHasChanged) {
if (next2 !== void 0) {
markToAnimate(key);
} else {
removedKeys.add(key);
}
} else if (next2 !== void 0 && removedKeys.has(key)) {
markToAnimate(key);
} else {
typeState.protectedKeys[key] = true;
}
}
typeState.prevProp = prop;
typeState.prevResolvedValues = resolvedValues;
if (typeState.isActive) {
encounteredKeys = { ...encounteredKeys, ...resolvedValues };
}
if (isInitialRender && visualElement.blockInitialAnimation) {
shouldAnimateType = false;
}
if (shouldAnimateType && (!isInherited || handledRemovedValues)) {
animations2.push(...definitionList.map((animation) => ({
animation,
options: { type, ...options }
})));
}
}
if (removedKeys.size) {
const fallbackAnimation = {};
removedKeys.forEach((key) => {
const fallbackTarget = visualElement.getBaseTarget(key);
if (fallbackTarget !== void 0) {
fallbackAnimation[key] = fallbackTarget;
}
});
animations2.push({ animation: fallbackAnimation });
}
let shouldAnimate = Boolean(animations2.length);
if (isInitialRender && (props.initial === false || props.initial === props.animate) && !visualElement.manuallyAnimateOnMount) {
shouldAnimate = false;
}
isInitialRender = false;
return shouldAnimate ? animate2(animations2) : Promise.resolve();
}
function setActive(type, isActive, options) {
var _a8;
if (state2[type].isActive === isActive)
return Promise.resolve();
(_a8 = visualElement.variantChildren) === null || _a8 === void 0 ? void 0 : _a8.forEach((child) => {
var _a9;
return (_a9 = child.animationState) === null || _a9 === void 0 ? void 0 : _a9.setActive(type, isActive);
});
state2[type].isActive = isActive;
const animations2 = animateChanges(options, type);
for (const key in state2) {
state2[key].protectedKeys = {};
}
return animations2;
}
return {
animateChanges,
setActive,
setAnimateFunction,
getState: () => state2
};
}
function checkVariantsDidChange(prev2, next2) {
if (typeof next2 === "string") {
return next2 !== prev2;
} else if (Array.isArray(next2)) {
return !shallowCompare(next2, prev2);
}
return false;
}
function createTypeState(isActive = false) {
return {
isActive,
protectedKeys: {},
needsAnimating: {},
prevResolvedValues: {}
};
}
function createState() {
return {
animate: createTypeState(true),
whileInView: createTypeState(),
whileHover: createTypeState(),
whileTap: createTypeState(),
whileDrag: createTypeState(),
whileFocus: createTypeState(),
exit: createTypeState()
};
}
// ../../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs
var AnimationFeature = class extends Feature {
/**
* We dynamically generate the AnimationState manager as it contains a reference
* to the underlying animation library. We only want to load that if we load this,
* so people can optionally code split it out using the `m` component.
*/
constructor(node3) {
super(node3);
node3.animationState || (node3.animationState = createAnimationState(node3));
}
updateAnimationControlsSubscription() {
const { animate: animate2 } = this.node.getProps();
this.unmount();
if (isAnimationControls(animate2)) {
this.unmount = animate2.subscribe(this.node);
}
}
/**
* Subscribe any provided AnimationControls to the component's VisualElement
*/
mount() {
this.updateAnimationControlsSubscription();
}
update() {
const { animate: animate2 } = this.node.getProps();
const { animate: prevAnimate } = this.node.prevProps || {};
if (animate2 !== prevAnimate) {
this.updateAnimationControlsSubscription();
}
}
unmount() {
}
};
// ../../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs
var id = 0;
var ExitAnimationFeature = class extends Feature {
constructor() {
super(...arguments);
this.id = id++;
}
update() {
if (!this.node.presenceContext)
return;
const { isPresent: isPresent2, onExitComplete, custom } = this.node.presenceContext;
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
if (!this.node.animationState || isPresent2 === prevIsPresent) {
return;
}
const exitAnimation = this.node.animationState.setActive("exit", !isPresent2, { custom: custom !== null && custom !== void 0 ? custom : this.node.getProps().custom });
if (onExitComplete && !isPresent2) {
exitAnimation.then(() => onExitComplete(this.id));
}
}
mount() {
const { register } = this.node.presenceContext || {};
if (register) {
this.unmount = register(this.id);
}
}
unmount() {
}
};
// ../../node_modules/framer-motion/dist/es/motion/features/animations.mjs
var animations = {
animation: {
Feature: AnimationFeature
},
exit: {
Feature: ExitAnimationFeature
}
};
// ../../node_modules/framer-motion/dist/es/utils/distance.mjs
var distance2 = (a, b) => Math.abs(a - b);
function distance2D(a, b) {
const xDelta = distance2(a.x, b.x);
const yDelta = distance2(a.y, b.y);
return Math.sqrt(xDelta ** 2 + yDelta ** 2);
}
// ../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs
var PanSession = class {
constructor(event, handlers2, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {
this.startEvent = null;
this.lastMoveEvent = null;
this.lastMoveEventInfo = null;
this.handlers = {};
this.contextWindow = window;
this.updatePoint = () => {
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
const info2 = getPanInfo2(this.lastMoveEventInfo, this.history);
const isPanStarted = this.startEvent !== null;
const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3;
if (!isPanStarted && !isDistancePastThreshold)
return;
const { point: point2 } = info2;
const { timestamp: timestamp2 } = frameData;
this.history.push({ ...point2, timestamp: timestamp2 });
const { onStart, onMove } = this.handlers;
if (!isPanStarted) {
onStart && onStart(this.lastMoveEvent, info2);
this.startEvent = this.lastMoveEvent;
}
onMove && onMove(this.lastMoveEvent, info2);
};
this.handlePointerMove = (event2, info2) => {
this.lastMoveEvent = event2;
this.lastMoveEventInfo = transformPoint(info2, this.transformPagePoint);
frame2.update(this.updatePoint, true);
};
this.handlePointerUp = (event2, info2) => {
this.end();
const { onEnd, onSessionEnd, resumeAnimation } = this.handlers;
if (this.dragSnapToOrigin)
resumeAnimation && resumeAnimation();
if (!(this.lastMoveEvent && this.lastMoveEventInfo))
return;
const panInfo = getPanInfo2(event2.type === "pointercancel" ? this.lastMoveEventInfo : transformPoint(info2, this.transformPagePoint), this.history);
if (this.startEvent && onEnd) {
onEnd(event2, panInfo);
}
onSessionEnd && onSessionEnd(event2, panInfo);
};
if (!isPrimaryPointer(event))
return;
this.dragSnapToOrigin = dragSnapToOrigin;
this.handlers = handlers2;
this.transformPagePoint = transformPagePoint;
this.contextWindow = contextWindow || window;
const info = extractEventInfo(event);
const initialInfo = transformPoint(info, this.transformPagePoint);
const { point } = initialInfo;
const { timestamp } = frameData;
this.history = [{ ...point, timestamp }];
const { onSessionStart } = handlers2;
onSessionStart && onSessionStart(event, getPanInfo2(initialInfo, this.history));
this.removeListeners = pipe3(addPointerEvent2(this.contextWindow, "pointermove", this.handlePointerMove), addPointerEvent2(this.contextWindow, "pointerup", this.handlePointerUp), addPointerEvent2(this.contextWindow, "pointercancel", this.handlePointerUp));
}
updateHandlers(handlers2) {
this.handlers = handlers2;
}
end() {
this.removeListeners && this.removeListeners();
cancelFrame(this.updatePoint);
}
};
function transformPoint(info, transformPagePoint) {
return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
}
function subtractPoint(a, b) {
return { x: a.x - b.x, y: a.y - b.y };
}
function getPanInfo2({ point }, history) {
return {
point,
delta: subtractPoint(point, lastDevicePoint(history)),
offset: subtractPoint(point, startDevicePoint(history)),
velocity: getVelocity3(history, 0.1)
};
}
function startDevicePoint(history) {
return history[0];
}
function lastDevicePoint(history) {
return history[history.length - 1];
}
function getVelocity3(history, timeDelta) {
if (history.length < 2) {
return { x: 0, y: 0 };
}
let i = history.length - 1;
let timestampedPoint = null;
const lastPoint = lastDevicePoint(history);
while (i >= 0) {
timestampedPoint = history[i];
if (lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta)) {
break;
}
i--;
}
if (!timestampedPoint) {
return { x: 0, y: 0 };
}
const time = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
if (time === 0) {
return { x: 0, y: 0 };
}
const currentVelocity = {
x: (lastPoint.x - timestampedPoint.x) / time,
y: (lastPoint.y - timestampedPoint.y) / time
};
if (currentVelocity.x === Infinity) {
currentVelocity.x = 0;
}
if (currentVelocity.y === Infinity) {
currentVelocity.y = 0;
}
return currentVelocity;
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs
function calcLength(axis) {
return axis.max - axis.min;
}
function isNear(value, target = 0, maxDistance = 0.01) {
return Math.abs(value - target) <= maxDistance;
}
function calcAxisDelta(delta, source, target, origin = 0.5) {
delta.origin = origin;
delta.originPoint = mix2(source.min, source.max, delta.origin);
delta.scale = calcLength(target) / calcLength(source);
if (isNear(delta.scale, 1, 1e-4) || isNaN(delta.scale))
delta.scale = 1;
delta.translate = mix2(target.min, target.max, delta.origin) - delta.originPoint;
if (isNear(delta.translate) || isNaN(delta.translate))
delta.translate = 0;
}
function calcBoxDelta(delta, source, target, origin) {
calcAxisDelta(delta.x, source.x, target.x, origin ? origin.originX : void 0);
calcAxisDelta(delta.y, source.y, target.y, origin ? origin.originY : void 0);
}
function calcRelativeAxis(target, relative, parent) {
target.min = parent.min + relative.min;
target.max = target.min + calcLength(relative);
}
function calcRelativeBox(target, relative, parent) {
calcRelativeAxis(target.x, relative.x, parent.x);
calcRelativeAxis(target.y, relative.y, parent.y);
}
function calcRelativeAxisPosition(target, layout3, parent) {
target.min = layout3.min - parent.min;
target.max = target.min + calcLength(layout3);
}
function calcRelativePosition(target, layout3, parent) {
calcRelativeAxisPosition(target.x, layout3.x, parent.x);
calcRelativeAxisPosition(target.y, layout3.y, parent.y);
}
// ../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs
function applyConstraints(point, { min: min2, max: max2 }, elastic) {
if (min2 !== void 0 && point < min2) {
point = elastic ? mix2(min2, point, elastic.min) : Math.max(point, min2);
} else if (max2 !== void 0 && point > max2) {
point = elastic ? mix2(max2, point, elastic.max) : Math.min(point, max2);
}
return point;
}
function calcRelativeAxisConstraints(axis, min2, max2) {
return {
min: min2 !== void 0 ? axis.min + min2 : void 0,
max: max2 !== void 0 ? axis.max + max2 - (axis.max - axis.min) : void 0
};
}
function calcRelativeConstraints(layoutBox, { top: top2, left: left2, bottom: bottom2, right: right2 }) {
return {
x: calcRelativeAxisConstraints(layoutBox.x, left2, right2),
y: calcRelativeAxisConstraints(layoutBox.y, top2, bottom2)
};
}
function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
let min2 = constraintsAxis.min - layoutAxis.min;
let max2 = constraintsAxis.max - layoutAxis.max;
if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) {
[min2, max2] = [max2, min2];
}
return { min: min2, max: max2 };
}
function calcViewportConstraints(layoutBox, constraintsBox) {
return {
x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y)
};
}
function calcOrigin2(source, target) {
let origin = 0.5;
const sourceLength = calcLength(source);
const targetLength = calcLength(target);
if (targetLength > sourceLength) {
origin = progress(target.min, target.max - sourceLength, source.min);
} else if (sourceLength > targetLength) {
origin = progress(source.min, source.max - targetLength, target.min);
}
return clamp(0, 1, origin);
}
function rebaseAxisConstraints(layout3, constraints) {
const relativeConstraints = {};
if (constraints.min !== void 0) {
relativeConstraints.min = constraints.min - layout3.min;
}
if (constraints.max !== void 0) {
relativeConstraints.max = constraints.max - layout3.min;
}
return relativeConstraints;
}
var defaultElastic = 0.35;
function resolveDragElastic(dragElastic = defaultElastic) {
if (dragElastic === false) {
dragElastic = 0;
} else if (dragElastic === true) {
dragElastic = defaultElastic;
}
return {
x: resolveAxisElastic(dragElastic, "left", "right"),
y: resolveAxisElastic(dragElastic, "top", "bottom")
};
}
function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
return {
min: resolvePointElastic(dragElastic, minLabel),
max: resolvePointElastic(dragElastic, maxLabel)
};
}
function resolvePointElastic(dragElastic, label) {
return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0;
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/models.mjs
var createAxisDelta = () => ({
translate: 0,
scale: 1,
origin: 0,
originPoint: 0
});
var createDelta = () => ({
x: createAxisDelta(),
y: createAxisDelta()
});
var createAxis = () => ({ min: 0, max: 0 });
var createBox = () => ({
x: createAxis(),
y: createAxis()
});
// ../../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs
function eachAxis(callback) {
return [callback("x"), callback("y")];
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs
function convertBoundingBoxToBox({ top: top2, left: left2, right: right2, bottom: bottom2 }) {
return {
x: { min: left2, max: right2 },
y: { min: top2, max: bottom2 }
};
}
function convertBoxToBoundingBox({ x, y }) {
return { top: y.min, right: x.max, bottom: y.max, left: x.min };
}
function transformBoxPoints(point, transformPoint2) {
if (!transformPoint2)
return point;
const topLeft = transformPoint2({ x: point.left, y: point.top });
const bottomRight = transformPoint2({ x: point.right, y: point.bottom });
return {
top: topLeft.y,
left: topLeft.x,
bottom: bottomRight.y,
right: bottomRight.x
};
}
// ../../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs
function isIdentityScale(scale3) {
return scale3 === void 0 || scale3 === 1;
}
function hasScale({ scale: scale3, scaleX, scaleY }) {
return !isIdentityScale(scale3) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY);
}
function hasTransform(values) {
return hasScale(values) || has2DTranslate(values) || values.z || values.rotate || values.rotateX || values.rotateY;
}
function has2DTranslate(values) {
return is2DTranslate(values.x) || is2DTranslate(values.y);
}
function is2DTranslate(value) {
return value && value !== "0%";
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs
function scalePoint(point, scale3, originPoint) {
const distanceFromOrigin = point - originPoint;
const scaled = scale3 * distanceFromOrigin;
return originPoint + scaled;
}
function applyPointDelta(point, translate, scale3, originPoint, boxScale) {
if (boxScale !== void 0) {
point = scalePoint(point, boxScale, originPoint);
}
return scalePoint(point, scale3, originPoint) + translate;
}
function applyAxisDelta(axis, translate = 0, scale3 = 1, originPoint, boxScale) {
axis.min = applyPointDelta(axis.min, translate, scale3, originPoint, boxScale);
axis.max = applyPointDelta(axis.max, translate, scale3, originPoint, boxScale);
}
function applyBoxDelta(box, { x, y }) {
applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);
applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);
}
function applyTreeDeltas(box, treeScale, treePath, isSharedTransition = false) {
const treeLength = treePath.length;
if (!treeLength)
return;
treeScale.x = treeScale.y = 1;
let node3;
let delta;
for (let i = 0; i < treeLength; i++) {
node3 = treePath[i];
delta = node3.projectionDelta;
const instance = node3.instance;
if (instance && instance.style && instance.style.display === "contents") {
continue;
}
if (isSharedTransition && node3.options.layoutScroll && node3.scroll && node3 !== node3.root) {
transformBox(box, {
x: -node3.scroll.offset.x,
y: -node3.scroll.offset.y
});
}
if (delta) {
treeScale.x *= delta.x.scale;
treeScale.y *= delta.y.scale;
applyBoxDelta(box, delta);
}
if (isSharedTransition && hasTransform(node3.latestValues)) {
transformBox(box, node3.latestValues);
}
}
treeScale.x = snapToDefault(treeScale.x);
treeScale.y = snapToDefault(treeScale.y);
}
function snapToDefault(scale3) {
if (Number.isInteger(scale3))
return scale3;
return scale3 > 1.0000000000001 || scale3 < 0.999999999999 ? scale3 : 1;
}
function translateAxis(axis, distance3) {
axis.min = axis.min + distance3;
axis.max = axis.max + distance3;
}
function transformAxis(axis, transforms2, [key, scaleKey, originKey]) {
const axisOrigin = transforms2[originKey] !== void 0 ? transforms2[originKey] : 0.5;
const originPoint = mix2(axis.min, axis.max, axisOrigin);
applyAxisDelta(axis, transforms2[key], transforms2[scaleKey], originPoint, transforms2.scale);
}
var xKeys = ["x", "scaleX", "originX"];
var yKeys = ["y", "scaleY", "originY"];
function transformBox(box, transform3) {
transformAxis(box.x, transform3, xKeys);
transformAxis(box.y, transform3, yKeys);
}
// ../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs
function measureViewportBox(instance, transformPoint2) {
return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint2));
}
function measurePageBox(element, rootProjectionNode2, transformPagePoint) {
const viewportBox = measureViewportBox(element, transformPagePoint);
const { scroll: scroll3 } = rootProjectionNode2;
if (scroll3) {
translateAxis(viewportBox.x, scroll3.offset.x);
translateAxis(viewportBox.y, scroll3.offset.y);
}
return viewportBox;
}
// ../../node_modules/framer-motion/dist/es/utils/get-context-window.mjs
var getContextWindow = ({ current }) => {
return current ? current.ownerDocument.defaultView : null;
};
// ../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs
var elementDragControls = /* @__PURE__ */ new WeakMap();
var VisualElementDragControls = class {
constructor(visualElement) {
this.openGlobalLock = null;
this.isDragging = false;
this.currentDirection = null;
this.originPoint = { x: 0, y: 0 };
this.constraints = false;
this.hasMutatedConstraints = false;
this.elastic = createBox();
this.visualElement = visualElement;
}
start(originEvent, { snapToCursor = false } = {}) {
const { presenceContext } = this.visualElement;
if (presenceContext && presenceContext.isPresent === false)
return;
const onSessionStart = (event) => {
const { dragSnapToOrigin: dragSnapToOrigin2 } = this.getProps();
dragSnapToOrigin2 ? this.pauseAnimation() : this.stopAnimation();
if (snapToCursor) {
this.snapToCursor(extractEventInfo(event, "page").point);
}
};
const onStart = (event, info) => {
const { drag: drag2, dragPropagation, onDragStart } = this.getProps();
if (drag2 && !dragPropagation) {
if (this.openGlobalLock)
this.openGlobalLock();
this.openGlobalLock = getGlobalLock(drag2);
if (!this.openGlobalLock)
return;
}
this.isDragging = true;
this.currentDirection = null;
this.resolveConstraints();
if (this.visualElement.projection) {
this.visualElement.projection.isAnimationBlocked = true;
this.visualElement.projection.target = void 0;
}
eachAxis((axis) => {
let current = this.getAxisMotionValue(axis).get() || 0;
if (percent.test(current)) {
const { projection } = this.visualElement;
if (projection && projection.layout) {
const measuredAxis = projection.layout.layoutBox[axis];
if (measuredAxis) {
const length2 = calcLength(measuredAxis);
current = length2 * (parseFloat(current) / 100);
}
}
}
this.originPoint[axis] = current;
});
if (onDragStart) {
frame2.update(() => onDragStart(event, info), false, true);
}
const { animationState } = this.visualElement;
animationState && animationState.setActive("whileDrag", true);
};
const onMove = (event, info) => {
const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps();
if (!dragPropagation && !this.openGlobalLock)
return;
const { offset: offset2 } = info;
if (dragDirectionLock && this.currentDirection === null) {
this.currentDirection = getCurrentDirection(offset2);
if (this.currentDirection !== null) {
onDirectionLock && onDirectionLock(this.currentDirection);
}
return;
}
this.updateAxis("x", info.point, offset2);
this.updateAxis("y", info.point, offset2);
this.visualElement.render();
onDrag && onDrag(event, info);
};
const onSessionEnd = (event, info) => this.stop(event, info);
const resumeAnimation = () => eachAxis((axis) => {
var _a8;
return this.getAnimationState(axis) === "paused" && ((_a8 = this.getAxisMotionValue(axis).animation) === null || _a8 === void 0 ? void 0 : _a8.play());
});
const { dragSnapToOrigin } = this.getProps();
this.panSession = new PanSession(originEvent, {
onSessionStart,
onStart,
onMove,
onSessionEnd,
resumeAnimation
}, {
transformPagePoint: this.visualElement.getTransformPagePoint(),
dragSnapToOrigin,
contextWindow: getContextWindow(this.visualElement)
});
}
stop(event, info) {
const isDragging = this.isDragging;
this.cancel();
if (!isDragging)
return;
const { velocity } = info;
this.startAnimation(velocity);
const { onDragEnd } = this.getProps();
if (onDragEnd) {
frame2.update(() => onDragEnd(event, info));
}
}
cancel() {
this.isDragging = false;
const { projection, animationState } = this.visualElement;
if (projection) {
projection.isAnimationBlocked = false;
}
this.panSession && this.panSession.end();
this.panSession = void 0;
const { dragPropagation } = this.getProps();
if (!dragPropagation && this.openGlobalLock) {
this.openGlobalLock();
this.openGlobalLock = null;
}
animationState && animationState.setActive("whileDrag", false);
}
updateAxis(axis, _point, offset2) {
const { drag: drag2 } = this.getProps();
if (!offset2 || !shouldDrag(axis, drag2, this.currentDirection))
return;
const axisValue = this.getAxisMotionValue(axis);
let next2 = this.originPoint[axis] + offset2[axis];
if (this.constraints && this.constraints[axis]) {
next2 = applyConstraints(next2, this.constraints[axis], this.elastic[axis]);
}
axisValue.set(next2);
}
resolveConstraints() {
var _a8;
const { dragConstraints, dragElastic } = this.getProps();
const layout3 = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(false) : (_a8 = this.visualElement.projection) === null || _a8 === void 0 ? void 0 : _a8.layout;
const prevConstraints = this.constraints;
if (dragConstraints && isRefObject4(dragConstraints)) {
if (!this.constraints) {
this.constraints = this.resolveRefConstraints();
}
} else {
if (dragConstraints && layout3) {
this.constraints = calcRelativeConstraints(layout3.layoutBox, dragConstraints);
} else {
this.constraints = false;
}
}
this.elastic = resolveDragElastic(dragElastic);
if (prevConstraints !== this.constraints && layout3 && this.constraints && !this.hasMutatedConstraints) {
eachAxis((axis) => {
if (this.getAxisMotionValue(axis)) {
this.constraints[axis] = rebaseAxisConstraints(layout3.layoutBox[axis], this.constraints[axis]);
}
});
}
}
resolveRefConstraints() {
const { dragConstraints: constraints, onMeasureDragConstraints } = this.getProps();
if (!constraints || !isRefObject4(constraints))
return false;
const constraintsElement = constraints.current;
invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
const { projection } = this.visualElement;
if (!projection || !projection.layout)
return false;
const constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint());
let measuredConstraints = calcViewportConstraints(projection.layout.layoutBox, constraintsBox);
if (onMeasureDragConstraints) {
const userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints));
this.hasMutatedConstraints = !!userConstraints;
if (userConstraints) {
measuredConstraints = convertBoundingBoxToBox(userConstraints);
}
}
return measuredConstraints;
}
startAnimation(velocity) {
const { drag: drag2, dragMomentum, dragElastic, dragTransition, dragSnapToOrigin, onDragTransitionEnd } = this.getProps();
const constraints = this.constraints || {};
const momentumAnimations = eachAxis((axis) => {
if (!shouldDrag(axis, drag2, this.currentDirection)) {
return;
}
let transition3 = constraints && constraints[axis] || {};
if (dragSnapToOrigin)
transition3 = { min: 0, max: 0 };
const bounceStiffness = dragElastic ? 200 : 1e6;
const bounceDamping = dragElastic ? 40 : 1e7;
const inertia2 = {
type: "inertia",
velocity: dragMomentum ? velocity[axis] : 0,
bounceStiffness,
bounceDamping,
timeConstant: 750,
restDelta: 1,
restSpeed: 10,
...dragTransition,
...transition3
};
return this.startAxisValueAnimation(axis, inertia2);
});
return Promise.all(momentumAnimations).then(onDragTransitionEnd);
}
startAxisValueAnimation(axis, transition3) {
const axisValue = this.getAxisMotionValue(axis);
return axisValue.start(animateMotionValue(axis, axisValue, 0, transition3));
}
stopAnimation() {
eachAxis((axis) => this.getAxisMotionValue(axis).stop());
}
pauseAnimation() {
eachAxis((axis) => {
var _a8;
return (_a8 = this.getAxisMotionValue(axis).animation) === null || _a8 === void 0 ? void 0 : _a8.pause();
});
}
getAnimationState(axis) {
var _a8;
return (_a8 = this.getAxisMotionValue(axis).animation) === null || _a8 === void 0 ? void 0 : _a8.state;
}
/**
* Drag works differently depending on which props are provided.
*
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
* - Otherwise, we apply the delta to the x/y motion values.
*/
getAxisMotionValue(axis) {
const dragKey = "_drag" + axis.toUpperCase();
const props = this.visualElement.getProps();
const externalMotionValue = props[dragKey];
return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (props.initial ? props.initial[axis] : void 0) || 0);
}
snapToCursor(point) {
eachAxis((axis) => {
const { drag: drag2 } = this.getProps();
if (!shouldDrag(axis, drag2, this.currentDirection))
return;
const { projection } = this.visualElement;
const axisValue = this.getAxisMotionValue(axis);
if (projection && projection.layout) {
const { min: min2, max: max2 } = projection.layout.layoutBox[axis];
axisValue.set(point[axis] - mix2(min2, max2, 0.5));
}
});
}
/**
* When the viewport resizes we want to check if the measured constraints
* have changed and, if so, reposition the element within those new constraints
* relative to where it was before the resize.
*/
scalePositionWithinConstraints() {
if (!this.visualElement.current)
return;
const { drag: drag2, dragConstraints } = this.getProps();
const { projection } = this.visualElement;
if (!isRefObject4(dragConstraints) || !projection || !this.constraints)
return;
this.stopAnimation();
const boxProgress = { x: 0, y: 0 };
eachAxis((axis) => {
const axisValue = this.getAxisMotionValue(axis);
if (axisValue) {
const latest = axisValue.get();
boxProgress[axis] = calcOrigin2({ min: latest, max: latest }, this.constraints[axis]);
}
});
const { transformTemplate: transformTemplate2 } = this.visualElement.getProps();
this.visualElement.current.style.transform = transformTemplate2 ? transformTemplate2({}, "") : "none";
projection.root && projection.root.updateScroll();
projection.updateLayout();
this.resolveConstraints();
eachAxis((axis) => {
if (!shouldDrag(axis, drag2, null))
return;
const axisValue = this.getAxisMotionValue(axis);
const { min: min2, max: max2 } = this.constraints[axis];
axisValue.set(mix2(min2, max2, boxProgress[axis]));
});
}
addListeners() {
if (!this.visualElement.current)
return;
elementDragControls.set(this.visualElement, this);
const element = this.visualElement.current;
const stopPointerListener = addPointerEvent2(element, "pointerdown", (event) => {
const { drag: drag2, dragListener = true } = this.getProps();
drag2 && dragListener && this.start(event);
});
const measureDragConstraints = () => {
const { dragConstraints } = this.getProps();
if (isRefObject4(dragConstraints)) {
this.constraints = this.resolveRefConstraints();
}
};
const { projection } = this.visualElement;
const stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints);
if (projection && !projection.layout) {
projection.root && projection.root.updateScroll();
projection.updateLayout();
}
measureDragConstraints();
const stopResizeListener = addDomEvent2(window, "resize", () => this.scalePositionWithinConstraints());
const stopLayoutUpdateListener = projection.addEventListener("didUpdate", ({ delta, hasLayoutChanged }) => {
if (this.isDragging && hasLayoutChanged) {
eachAxis((axis) => {
const motionValue2 = this.getAxisMotionValue(axis);
if (!motionValue2)
return;
this.originPoint[axis] += delta[axis].translate;
motionValue2.set(motionValue2.get() + delta[axis].translate);
});
this.visualElement.render();
}
});
return () => {
stopResizeListener();
stopPointerListener();
stopMeasureLayoutListener();
stopLayoutUpdateListener && stopLayoutUpdateListener();
};
}
getProps() {
const props = this.visualElement.getProps();
const { drag: drag2 = false, dragDirectionLock = false, dragPropagation = false, dragConstraints = false, dragElastic = defaultElastic, dragMomentum = true } = props;
return {
...props,
drag: drag2,
dragDirectionLock,
dragPropagation,
dragConstraints,
dragElastic,
dragMomentum
};
}
};
function shouldDrag(direction2, drag2, currentDirection) {
return (drag2 === true || drag2 === direction2) && (currentDirection === null || currentDirection === direction2);
}
function getCurrentDirection(offset2, lockThreshold = 10) {
let direction2 = null;
if (Math.abs(offset2.y) > lockThreshold) {
direction2 = "y";
} else if (Math.abs(offset2.x) > lockThreshold) {
direction2 = "x";
}
return direction2;
}
// ../../node_modules/framer-motion/dist/es/gestures/drag/index.mjs
var DragGesture = class extends Feature {
constructor(node3) {
super(node3);
this.removeGroupControls = noop2;
this.removeListeners = noop2;
this.controls = new VisualElementDragControls(node3);
}
mount() {
const { dragControls } = this.node.getProps();
if (dragControls) {
this.removeGroupControls = dragControls.subscribe(this.controls);
}
this.removeListeners = this.controls.addListeners() || noop2;
}
unmount() {
this.removeGroupControls();
this.removeListeners();
}
};
// ../../node_modules/framer-motion/dist/es/gestures/pan/index.mjs
var asyncHandler = (handler) => (event, info) => {
if (handler) {
frame2.update(() => handler(event, info));
}
};
var PanGesture = class extends Feature {
constructor() {
super(...arguments);
this.removePointerDownListener = noop2;
}
onPointerDown(pointerDownEvent) {
this.session = new PanSession(pointerDownEvent, this.createPanHandlers(), {
transformPagePoint: this.node.getTransformPagePoint(),
contextWindow: getContextWindow(this.node)
});
}
createPanHandlers() {
const { onPanSessionStart, onPanStart, onPan, onPanEnd } = this.node.getProps();
return {
onSessionStart: asyncHandler(onPanSessionStart),
onStart: asyncHandler(onPanStart),
onMove: onPan,
onEnd: (event, info) => {
delete this.session;
if (onPanEnd) {
frame2.update(() => onPanEnd(event, info));
}
}
};
}
mount() {
this.removePointerDownListener = addPointerEvent2(this.node.current, "pointerdown", (event) => this.onPointerDown(event));
}
update() {
this.session && this.session.updateHandlers(this.createPanHandlers());
}
unmount() {
this.removePointerDownListener();
this.session && this.session.end();
}
};
// ../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
var import_react49 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs
var import_react48 = __toESM(require_react(), 1);
function usePresence() {
const context = (0, import_react48.useContext)(PresenceContext);
if (context === null)
return [true, null];
const { isPresent: isPresent2, onExitComplete, register } = context;
const id3 = (0, import_react48.useId)();
(0, import_react48.useEffect)(() => register(id3), []);
const safeToRemove = () => onExitComplete && onExitComplete(id3);
return !isPresent2 && onExitComplete ? [false, safeToRemove] : [true];
}
function useIsPresent() {
return isPresent((0, import_react48.useContext)(PresenceContext));
}
function isPresent(context) {
return context === null ? true : context.isPresent;
}
// ../../node_modules/framer-motion/dist/es/projection/node/state.mjs
var globalProjectionState = {
/**
* Global flag as to whether the tree has animated since the last time
* we resized the window
*/
hasAnimatedSinceResize: true,
/**
* We set this to true once, on the first update. Any nodes added to the tree beyond that
* update will be given a `data-projection-id` attribute.
*/
hasEverUpdated: false
};
// ../../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs
function pixelsToPercent(pixels, axis) {
if (axis.max === axis.min)
return 0;
return pixels / (axis.max - axis.min) * 100;
}
var correctBorderRadius = {
correct: (latest, node3) => {
if (!node3.target)
return latest;
if (typeof latest === "string") {
if (px2.test(latest)) {
latest = parseFloat(latest);
} else {
return latest;
}
}
const x = pixelsToPercent(latest, node3.target.x);
const y = pixelsToPercent(latest, node3.target.y);
return `${x}% ${y}%`;
}
};
// ../../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs
var correctBoxShadow = {
correct: (latest, { treeScale, projectionDelta }) => {
const original = latest;
const shadow = complex.parse(latest);
if (shadow.length > 5)
return original;
const template = complex.createTransformer(latest);
const offset2 = typeof shadow[0] !== "number" ? 1 : 0;
const xScale = projectionDelta.x.scale * treeScale.x;
const yScale = projectionDelta.y.scale * treeScale.y;
shadow[0 + offset2] /= xScale;
shadow[1 + offset2] /= yScale;
const averageScale = mix2(xScale, yScale, 0.5);
if (typeof shadow[2 + offset2] === "number")
shadow[2 + offset2] /= averageScale;
if (typeof shadow[3 + offset2] === "number")
shadow[3 + offset2] /= averageScale;
return template(shadow);
}
};
// ../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
var MeasureLayoutWithContext = class extends import_react49.default.Component {
/**
* This only mounts projection nodes for components that
* need measuring, we might want to do it for all components
* in order to incorporate transforms
*/
componentDidMount() {
const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
const { projection } = visualElement;
addScaleCorrector(defaultScaleCorrectors);
if (projection) {
if (layoutGroup.group)
layoutGroup.group.add(projection);
if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
switchLayoutGroup.register(projection);
}
projection.root.didUpdate();
projection.addEventListener("animationComplete", () => {
this.safeToRemove();
});
projection.setOptions({
...projection.options,
onExitComplete: () => this.safeToRemove()
});
}
globalProjectionState.hasEverUpdated = true;
}
getSnapshotBeforeUpdate(prevProps) {
const { layoutDependency, visualElement, drag: drag2, isPresent: isPresent2 } = this.props;
const projection = visualElement.projection;
if (!projection)
return null;
projection.isPresent = isPresent2;
if (drag2 || prevProps.layoutDependency !== layoutDependency || layoutDependency === void 0) {
projection.willUpdate();
} else {
this.safeToRemove();
}
if (prevProps.isPresent !== isPresent2) {
if (isPresent2) {
projection.promote();
} else if (!projection.relegate()) {
frame2.postRender(() => {
const stack = projection.getStack();
if (!stack || !stack.members.length) {
this.safeToRemove();
}
});
}
}
return null;
}
componentDidUpdate() {
const { projection } = this.props.visualElement;
if (projection) {
projection.root.didUpdate();
queueMicrotask(() => {
if (!projection.currentAnimation && projection.isLead()) {
this.safeToRemove();
}
});
}
}
componentWillUnmount() {
const { visualElement, layoutGroup, switchLayoutGroup: promoteContext } = this.props;
const { projection } = visualElement;
if (projection) {
projection.scheduleCheckAfterUnmount();
if (layoutGroup && layoutGroup.group)
layoutGroup.group.remove(projection);
if (promoteContext && promoteContext.deregister)
promoteContext.deregister(projection);
}
}
safeToRemove() {
const { safeToRemove } = this.props;
safeToRemove && safeToRemove();
}
render() {
return null;
}
};
function MeasureLayout(props) {
const [isPresent2, safeToRemove] = usePresence();
const layoutGroup = (0, import_react49.useContext)(LayoutGroupContext);
return import_react49.default.createElement(MeasureLayoutWithContext, { ...props, layoutGroup, switchLayoutGroup: (0, import_react49.useContext)(SwitchLayoutGroupContext), isPresent: isPresent2, safeToRemove });
}
var defaultScaleCorrectors = {
borderRadius: {
...correctBorderRadius,
applyTo: [
"borderTopLeftRadius",
"borderTopRightRadius",
"borderBottomLeftRadius",
"borderBottomRightRadius"
]
},
borderTopLeftRadius: correctBorderRadius,
borderTopRightRadius: correctBorderRadius,
borderBottomLeftRadius: correctBorderRadius,
borderBottomRightRadius: correctBorderRadius,
boxShadow: correctBoxShadow
};
// ../../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs
var borders2 = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"];
var numBorders = borders2.length;
var asNumber = (value) => typeof value === "string" ? parseFloat(value) : value;
var isPx = (value) => typeof value === "number" || px2.test(value);
function mixValues(target, follow, lead, progress3, shouldCrossfadeOpacity, isOnlyMember) {
if (shouldCrossfadeOpacity) {
target.opacity = mix2(
0,
// TODO Reinstate this if only child
lead.opacity !== void 0 ? lead.opacity : 1,
easeCrossfadeIn(progress3)
);
target.opacityExit = mix2(follow.opacity !== void 0 ? follow.opacity : 1, 0, easeCrossfadeOut(progress3));
} else if (isOnlyMember) {
target.opacity = mix2(follow.opacity !== void 0 ? follow.opacity : 1, lead.opacity !== void 0 ? lead.opacity : 1, progress3);
}
for (let i = 0; i < numBorders; i++) {
const borderLabel = `border${borders2[i]}Radius`;
let followRadius = getRadius(follow, borderLabel);
let leadRadius = getRadius(lead, borderLabel);
if (followRadius === void 0 && leadRadius === void 0)
continue;
followRadius || (followRadius = 0);
leadRadius || (leadRadius = 0);
const canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius);
if (canMix) {
target[borderLabel] = Math.max(mix2(asNumber(followRadius), asNumber(leadRadius), progress3), 0);
if (percent.test(leadRadius) || percent.test(followRadius)) {
target[borderLabel] += "%";
}
} else {
target[borderLabel] = leadRadius;
}
}
if (follow.rotate || lead.rotate) {
target.rotate = mix2(follow.rotate || 0, lead.rotate || 0, progress3);
}
}
function getRadius(values, radiusName) {
return values[radiusName] !== void 0 ? values[radiusName] : values.borderRadius;
}
var easeCrossfadeIn = compress(0, 0.5, circOut);
var easeCrossfadeOut = compress(0.5, 0.95, noop2);
function compress(min2, max2, easing) {
return (p) => {
if (p < min2)
return 0;
if (p > max2)
return 1;
return easing(progress(min2, max2, p));
};
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs
function copyAxisInto(axis, originAxis) {
axis.min = originAxis.min;
axis.max = originAxis.max;
}
function copyBoxInto(box, originBox) {
copyAxisInto(box.x, originBox.x);
copyAxisInto(box.y, originBox.y);
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs
function removePointDelta(point, translate, scale3, originPoint, boxScale) {
point -= translate;
point = scalePoint(point, 1 / scale3, originPoint);
if (boxScale !== void 0) {
point = scalePoint(point, 1 / boxScale, originPoint);
}
return point;
}
function removeAxisDelta(axis, translate = 0, scale3 = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {
if (percent.test(translate)) {
translate = parseFloat(translate);
const relativeProgress = mix2(sourceAxis.min, sourceAxis.max, translate / 100);
translate = relativeProgress - sourceAxis.min;
}
if (typeof translate !== "number")
return;
let originPoint = mix2(originAxis.min, originAxis.max, origin);
if (axis === originAxis)
originPoint -= translate;
axis.min = removePointDelta(axis.min, translate, scale3, originPoint, boxScale);
axis.max = removePointDelta(axis.max, translate, scale3, originPoint, boxScale);
}
function removeAxisTransforms(axis, transforms2, [key, scaleKey, originKey], origin, sourceAxis) {
removeAxisDelta(axis, transforms2[key], transforms2[scaleKey], transforms2[originKey], transforms2.scale, origin, sourceAxis);
}
var xKeys2 = ["x", "scaleX", "originX"];
var yKeys2 = ["y", "scaleY", "originY"];
function removeBoxTransforms(box, transforms2, originBox, sourceBox) {
removeAxisTransforms(box.x, transforms2, xKeys2, originBox ? originBox.x : void 0, sourceBox ? sourceBox.x : void 0);
removeAxisTransforms(box.y, transforms2, yKeys2, originBox ? originBox.y : void 0, sourceBox ? sourceBox.y : void 0);
}
// ../../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs
function isAxisDeltaZero(delta) {
return delta.translate === 0 && delta.scale === 1;
}
function isDeltaZero(delta) {
return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
}
function boxEquals(a, b) {
return a.x.min === b.x.min && a.x.max === b.x.max && a.y.min === b.y.min && a.y.max === b.y.max;
}
function boxEqualsRounded(a, b) {
return Math.round(a.x.min) === Math.round(b.x.min) && Math.round(a.x.max) === Math.round(b.x.max) && Math.round(a.y.min) === Math.round(b.y.min) && Math.round(a.y.max) === Math.round(b.y.max);
}
function aspectRatio(box) {
return calcLength(box.x) / calcLength(box.y);
}
// ../../node_modules/framer-motion/dist/es/projection/shared/stack.mjs
var NodeStack = class {
constructor() {
this.members = [];
}
add(node3) {
addUniqueItem(this.members, node3);
node3.scheduleRender();
}
remove(node3) {
removeItem(this.members, node3);
if (node3 === this.prevLead) {
this.prevLead = void 0;
}
if (node3 === this.lead) {
const prevLead = this.members[this.members.length - 1];
if (prevLead) {
this.promote(prevLead);
}
}
}
relegate(node3) {
const indexOfNode = this.members.findIndex((member) => node3 === member);
if (indexOfNode === 0)
return false;
let prevLead;
for (let i = indexOfNode; i >= 0; i--) {
const member = this.members[i];
if (member.isPresent !== false) {
prevLead = member;
break;
}
}
if (prevLead) {
this.promote(prevLead);
return true;
} else {
return false;
}
}
promote(node3, preserveFollowOpacity) {
const prevLead = this.lead;
if (node3 === prevLead)
return;
this.prevLead = prevLead;
this.lead = node3;
node3.show();
if (prevLead) {
prevLead.instance && prevLead.scheduleRender();
node3.scheduleRender();
node3.resumeFrom = prevLead;
if (preserveFollowOpacity) {
node3.resumeFrom.preserveOpacity = true;
}
if (prevLead.snapshot) {
node3.snapshot = prevLead.snapshot;
node3.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues;
}
if (node3.root && node3.root.isUpdating) {
node3.isLayoutDirty = true;
}
const { crossfade } = node3.options;
if (crossfade === false) {
prevLead.hide();
}
}
}
exitAnimationComplete() {
this.members.forEach((node3) => {
const { options, resumingFrom } = node3;
options.onExitComplete && options.onExitComplete();
if (resumingFrom) {
resumingFrom.options.onExitComplete && resumingFrom.options.onExitComplete();
}
});
}
scheduleRender() {
this.members.forEach((node3) => {
node3.instance && node3.scheduleRender(false);
});
}
/**
* Clear any leads that have been removed this render to prevent them from being
* used in future animations and to prevent memory leaks
*/
removeLeadSnapshot() {
if (this.lead && this.lead.snapshot) {
this.lead.snapshot = void 0;
}
}
};
// ../../node_modules/framer-motion/dist/es/projection/styles/transform.mjs
function buildProjectionTransform(delta, treeScale, latestTransform) {
let transform3 = "";
const xTranslate = delta.x.translate / treeScale.x;
const yTranslate = delta.y.translate / treeScale.y;
if (xTranslate || yTranslate) {
transform3 = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `;
}
if (treeScale.x !== 1 || treeScale.y !== 1) {
transform3 += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;
}
if (latestTransform) {
const { rotate: rotate2, rotateX, rotateY } = latestTransform;
if (rotate2)
transform3 += `rotate(${rotate2}deg) `;
if (rotateX)
transform3 += `rotateX(${rotateX}deg) `;
if (rotateY)
transform3 += `rotateY(${rotateY}deg) `;
}
const elementScaleX = delta.x.scale * treeScale.x;
const elementScaleY = delta.y.scale * treeScale.y;
if (elementScaleX !== 1 || elementScaleY !== 1) {
transform3 += `scale(${elementScaleX}, ${elementScaleY})`;
}
return transform3 || "none";
}
// ../../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs
var compareByDepth = (a, b) => a.depth - b.depth;
// ../../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs
var FlatTree = class {
constructor() {
this.children = [];
this.isDirty = false;
}
add(child) {
addUniqueItem(this.children, child);
this.isDirty = true;
}
remove(child) {
removeItem(this.children, child);
this.isDirty = true;
}
forEach(callback) {
this.isDirty && this.children.sort(compareByDepth);
this.isDirty = false;
this.children.forEach(callback);
}
};
// ../../node_modules/framer-motion/dist/es/utils/delay.mjs
function delay(callback, timeout) {
const start2 = performance.now();
const checkElapsed = ({ timestamp }) => {
const elapsed = timestamp - start2;
if (elapsed >= timeout) {
cancelFrame(checkElapsed);
callback(elapsed - timeout);
}
};
frame2.read(checkElapsed, true);
return () => cancelFrame(checkElapsed);
}
// ../../node_modules/framer-motion/dist/es/debug/record.mjs
function record(data) {
if (window.MotionDebug) {
window.MotionDebug.record(data);
}
}
// ../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-element.mjs
function isSVGElement(element) {
return element instanceof SVGElement && element.tagName !== "svg";
}
// ../../node_modules/framer-motion/dist/es/animation/interfaces/single-value.mjs
function animateSingleValue(value, keyframes3, options) {
const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
motionValue$1.start(animateMotionValue("", motionValue$1, keyframes3, options));
return motionValue$1.animation;
}
// ../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs
var transformAxes = ["", "X", "Y", "Z"];
var hiddenVisibility = { visibility: "hidden" };
var animationTarget = 1e3;
var id2 = 0;
var projectionFrameData = {
type: "projectionFrame",
totalNodes: 0,
resolvedTargetDeltas: 0,
recalculatedProjection: 0
};
function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform }) {
return class ProjectionNode {
constructor(latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
this.id = id2++;
this.animationId = 0;
this.children = /* @__PURE__ */ new Set();
this.options = {};
this.isTreeAnimating = false;
this.isAnimationBlocked = false;
this.isLayoutDirty = false;
this.isProjectionDirty = false;
this.isSharedProjectionDirty = false;
this.isTransformDirty = false;
this.updateManuallyBlocked = false;
this.updateBlockedByResize = false;
this.isUpdating = false;
this.isSVG = false;
this.needsReset = false;
this.shouldResetTransform = false;
this.treeScale = { x: 1, y: 1 };
this.eventHandlers = /* @__PURE__ */ new Map();
this.hasTreeAnimated = false;
this.updateScheduled = false;
this.projectionUpdateScheduled = false;
this.checkUpdateFailed = () => {
if (this.isUpdating) {
this.isUpdating = false;
this.clearAllSnapshots();
}
};
this.updateProjection = () => {
this.projectionUpdateScheduled = false;
projectionFrameData.totalNodes = projectionFrameData.resolvedTargetDeltas = projectionFrameData.recalculatedProjection = 0;
this.nodes.forEach(propagateDirtyNodes);
this.nodes.forEach(resolveTargetDelta);
this.nodes.forEach(calcProjection);
this.nodes.forEach(cleanDirtyNodes);
record(projectionFrameData);
};
this.hasProjected = false;
this.isVisible = true;
this.animationProgress = 0;
this.sharedNodes = /* @__PURE__ */ new Map();
this.latestValues = latestValues;
this.root = parent ? parent.root || parent : this;
this.path = parent ? [...parent.path, parent] : [];
this.parent = parent;
this.depth = parent ? parent.depth + 1 : 0;
for (let i = 0; i < this.path.length; i++) {
this.path[i].shouldResetTransform = true;
}
if (this.root === this)
this.nodes = new FlatTree();
}
addEventListener(name, handler) {
if (!this.eventHandlers.has(name)) {
this.eventHandlers.set(name, new SubscriptionManager());
}
return this.eventHandlers.get(name).add(handler);
}
notifyListeners(name, ...args) {
const subscriptionManager = this.eventHandlers.get(name);
subscriptionManager && subscriptionManager.notify(...args);
}
hasListeners(name) {
return this.eventHandlers.has(name);
}
/**
* Lifecycles
*/
mount(instance, isLayoutDirty = this.root.hasTreeAnimated) {
if (this.instance)
return;
this.isSVG = isSVGElement(instance);
this.instance = instance;
const { layoutId, layout: layout3, visualElement } = this.options;
if (visualElement && !visualElement.current) {
visualElement.mount(instance);
}
this.root.nodes.add(this);
this.parent && this.parent.children.add(this);
if (isLayoutDirty && (layout3 || layoutId)) {
this.isLayoutDirty = true;
}
if (attachResizeListener) {
let cancelDelay;
const resizeUnblockUpdate = () => this.root.updateBlockedByResize = false;
attachResizeListener(instance, () => {
this.root.updateBlockedByResize = true;
cancelDelay && cancelDelay();
cancelDelay = delay(resizeUnblockUpdate, 250);
if (globalProjectionState.hasAnimatedSinceResize) {
globalProjectionState.hasAnimatedSinceResize = false;
this.nodes.forEach(finishAnimation);
}
});
}
if (layoutId) {
this.root.registerSharedNode(layoutId, this);
}
if (this.options.animate !== false && visualElement && (layoutId || layout3)) {
this.addEventListener("didUpdate", ({ delta, hasLayoutChanged, hasRelativeTargetChanged, layout: newLayout }) => {
if (this.isTreeAnimationBlocked()) {
this.target = void 0;
this.relativeTarget = void 0;
return;
}
const layoutTransition = this.options.transition || visualElement.getDefaultTransition() || defaultLayoutTransition;
const { onLayoutAnimationStart, onLayoutAnimationComplete } = visualElement.getProps();
const targetChanged = !this.targetLayout || !boxEqualsRounded(this.targetLayout, newLayout) || hasRelativeTargetChanged;
const hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged;
if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || hasOnlyRelativeTargetChanged || hasLayoutChanged && (targetChanged || !this.currentAnimation)) {
if (this.resumeFrom) {
this.resumingFrom = this.resumeFrom;
this.resumingFrom.resumingFrom = void 0;
}
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
const animationOptions = {
...getValueTransition(layoutTransition, "layout"),
onPlay: onLayoutAnimationStart,
onComplete: onLayoutAnimationComplete
};
if (visualElement.shouldReduceMotion || this.options.layoutRoot) {
animationOptions.delay = 0;
animationOptions.type = false;
}
this.startAnimation(animationOptions);
} else {
if (!hasLayoutChanged) {
finishAnimation(this);
}
if (this.isLead() && this.options.onExitComplete) {
this.options.onExitComplete();
}
}
this.targetLayout = newLayout;
});
}
}
unmount() {
this.options.layoutId && this.willUpdate();
this.root.nodes.remove(this);
const stack = this.getStack();
stack && stack.remove(this);
this.parent && this.parent.children.delete(this);
this.instance = void 0;
cancelFrame(this.updateProjection);
}
// only on the root
blockUpdate() {
this.updateManuallyBlocked = true;
}
unblockUpdate() {
this.updateManuallyBlocked = false;
}
isUpdateBlocked() {
return this.updateManuallyBlocked || this.updateBlockedByResize;
}
isTreeAnimationBlocked() {
return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || false;
}
// Note: currently only running on root node
startUpdate() {
if (this.isUpdateBlocked())
return;
this.isUpdating = true;
this.nodes && this.nodes.forEach(resetRotation);
this.animationId++;
}
getTransformTemplate() {
const { visualElement } = this.options;
return visualElement && visualElement.getProps().transformTemplate;
}
willUpdate(shouldNotifyListeners = true) {
this.root.hasTreeAnimated = true;
if (this.root.isUpdateBlocked()) {
this.options.onExitComplete && this.options.onExitComplete();
return;
}
!this.root.isUpdating && this.root.startUpdate();
if (this.isLayoutDirty)
return;
this.isLayoutDirty = true;
for (let i = 0; i < this.path.length; i++) {
const node3 = this.path[i];
node3.shouldResetTransform = true;
node3.updateScroll("snapshot");
if (node3.options.layoutRoot) {
node3.willUpdate(false);
}
}
const { layoutId, layout: layout3 } = this.options;
if (layoutId === void 0 && !layout3)
return;
const transformTemplate2 = this.getTransformTemplate();
this.prevTransformTemplateValue = transformTemplate2 ? transformTemplate2(this.latestValues, "") : void 0;
this.updateSnapshot();
shouldNotifyListeners && this.notifyListeners("willUpdate");
}
update() {
this.updateScheduled = false;
const updateWasBlocked = this.isUpdateBlocked();
if (updateWasBlocked) {
this.unblockUpdate();
this.clearAllSnapshots();
this.nodes.forEach(clearMeasurements);
return;
}
if (!this.isUpdating) {
this.nodes.forEach(clearIsLayoutDirty);
}
this.isUpdating = false;
this.nodes.forEach(resetTransformStyle);
this.nodes.forEach(updateLayout);
this.nodes.forEach(notifyLayoutUpdate);
this.clearAllSnapshots();
const now = performance.now();
frameData.delta = clamp(0, 1e3 / 60, now - frameData.timestamp);
frameData.timestamp = now;
frameData.isProcessing = true;
steps2.update.process(frameData);
steps2.preRender.process(frameData);
steps2.render.process(frameData);
frameData.isProcessing = false;
}
didUpdate() {
if (!this.updateScheduled) {
this.updateScheduled = true;
queueMicrotask(() => this.update());
}
}
clearAllSnapshots() {
this.nodes.forEach(clearSnapshot);
this.sharedNodes.forEach(removeLeadSnapshots);
}
scheduleUpdateProjection() {
if (!this.projectionUpdateScheduled) {
this.projectionUpdateScheduled = true;
frame2.preRender(this.updateProjection, false, true);
}
}
scheduleCheckAfterUnmount() {
frame2.postRender(() => {
if (this.isLayoutDirty) {
this.root.didUpdate();
} else {
this.root.checkUpdateFailed();
}
});
}
/**
* Update measurements
*/
updateSnapshot() {
if (this.snapshot || !this.instance)
return;
this.snapshot = this.measure();
}
updateLayout() {
if (!this.instance)
return;
this.updateScroll();
if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) {
return;
}
if (this.resumeFrom && !this.resumeFrom.instance) {
for (let i = 0; i < this.path.length; i++) {
const node3 = this.path[i];
node3.updateScroll();
}
}
const prevLayout = this.layout;
this.layout = this.measure(false);
this.layoutCorrected = createBox();
this.isLayoutDirty = false;
this.projectionDelta = void 0;
this.notifyListeners("measure", this.layout.layoutBox);
const { visualElement } = this.options;
visualElement && visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : void 0);
}
updateScroll(phase = "measure") {
let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === phase) {
needsMeasurement = false;
}
if (needsMeasurement) {
this.scroll = {
animationId: this.root.animationId,
phase,
isRoot: checkIsScrollRoot(this.instance),
offset: measureScroll(this.instance)
};
}
}
resetTransform() {
if (!resetTransform)
return;
const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;
const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
const transformTemplate2 = this.getTransformTemplate();
const transformTemplateValue = transformTemplate2 ? transformTemplate2(this.latestValues, "") : void 0;
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) {
resetTransform(this.instance, transformTemplateValue);
this.shouldResetTransform = false;
this.scheduleRender();
}
}
measure(removeTransform = true) {
const pageBox = this.measurePageBox();
let layoutBox = this.removeElementScroll(pageBox);
if (removeTransform) {
layoutBox = this.removeTransform(layoutBox);
}
roundBox(layoutBox);
return {
animationId: this.root.animationId,
measuredBox: pageBox,
layoutBox,
latestValues: {},
source: this.id
};
}
measurePageBox() {
const { visualElement } = this.options;
if (!visualElement)
return createBox();
const box = visualElement.measureViewportBox();
const { scroll: scroll3 } = this.root;
if (scroll3) {
translateAxis(box.x, scroll3.offset.x);
translateAxis(box.y, scroll3.offset.y);
}
return box;
}
removeElementScroll(box) {
const boxWithoutScroll = createBox();
copyBoxInto(boxWithoutScroll, box);
for (let i = 0; i < this.path.length; i++) {
const node3 = this.path[i];
const { scroll: scroll3, options } = node3;
if (node3 !== this.root && scroll3 && options.layoutScroll) {
if (scroll3.isRoot) {
copyBoxInto(boxWithoutScroll, box);
const { scroll: rootScroll } = this.root;
if (rootScroll) {
translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);
translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);
}
}
translateAxis(boxWithoutScroll.x, scroll3.offset.x);
translateAxis(boxWithoutScroll.y, scroll3.offset.y);
}
}
return boxWithoutScroll;
}
applyTransform(box, transformOnly = false) {
const withTransforms = createBox();
copyBoxInto(withTransforms, box);
for (let i = 0; i < this.path.length; i++) {
const node3 = this.path[i];
if (!transformOnly && node3.options.layoutScroll && node3.scroll && node3 !== node3.root) {
transformBox(withTransforms, {
x: -node3.scroll.offset.x,
y: -node3.scroll.offset.y
});
}
if (!hasTransform(node3.latestValues))
continue;
transformBox(withTransforms, node3.latestValues);
}
if (hasTransform(this.latestValues)) {
transformBox(withTransforms, this.latestValues);
}
return withTransforms;
}
removeTransform(box) {
const boxWithoutTransform = createBox();
copyBoxInto(boxWithoutTransform, box);
for (let i = 0; i < this.path.length; i++) {
const node3 = this.path[i];
if (!node3.instance)
continue;
if (!hasTransform(node3.latestValues))
continue;
hasScale(node3.latestValues) && node3.updateSnapshot();
const sourceBox = createBox();
const nodeBox = node3.measurePageBox();
copyBoxInto(sourceBox, nodeBox);
removeBoxTransforms(boxWithoutTransform, node3.latestValues, node3.snapshot ? node3.snapshot.layoutBox : void 0, sourceBox);
}
if (hasTransform(this.latestValues)) {
removeBoxTransforms(boxWithoutTransform, this.latestValues);
}
return boxWithoutTransform;
}
setTargetDelta(delta) {
this.targetDelta = delta;
this.root.scheduleUpdateProjection();
this.isProjectionDirty = true;
}
setOptions(options) {
this.options = {
...this.options,
...options,
crossfade: options.crossfade !== void 0 ? options.crossfade : true
};
}
clearMeasurements() {
this.scroll = void 0;
this.layout = void 0;
this.snapshot = void 0;
this.prevTransformTemplateValue = void 0;
this.targetDelta = void 0;
this.target = void 0;
this.isLayoutDirty = false;
}
forceRelativeParentToResolveTarget() {
if (!this.relativeParent)
return;
if (this.relativeParent.resolvedRelativeTargetAt !== frameData.timestamp) {
this.relativeParent.resolveTargetDelta(true);
}
}
resolveTargetDelta(forceRecalculation = false) {
var _a8;
const lead = this.getLead();
this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
const isShared = Boolean(this.resumingFrom) || this !== lead;
const canSkip = !(forceRecalculation || isShared && this.isSharedProjectionDirty || this.isProjectionDirty || ((_a8 = this.parent) === null || _a8 === void 0 ? void 0 : _a8.isProjectionDirty) || this.attemptToResolveRelativeTarget);
if (canSkip)
return;
const { layout: layout3, layoutId } = this.options;
if (!this.layout || !(layout3 || layoutId))
return;
this.resolvedRelativeTargetAt = frameData.timestamp;
if (!this.targetDelta && !this.relativeTarget) {
const relativeParent = this.getClosestProjectingParent();
if (relativeParent && relativeParent.layout && this.animationProgress !== 1) {
this.relativeParent = relativeParent;
this.forceRelativeParentToResolveTarget();
this.relativeTarget = createBox();
this.relativeTargetOrigin = createBox();
calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
} else {
this.relativeParent = this.relativeTarget = void 0;
}
}
if (!this.relativeTarget && !this.targetDelta)
return;
if (!this.target) {
this.target = createBox();
this.targetWithTransforms = createBox();
}
if (this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target) {
this.forceRelativeParentToResolveTarget();
calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);
} else if (this.targetDelta) {
if (Boolean(this.resumingFrom)) {
this.target = this.applyTransform(this.layout.layoutBox);
} else {
copyBoxInto(this.target, this.layout.layoutBox);
}
applyBoxDelta(this.target, this.targetDelta);
} else {
copyBoxInto(this.target, this.layout.layoutBox);
}
if (this.attemptToResolveRelativeTarget) {
this.attemptToResolveRelativeTarget = false;
const relativeParent = this.getClosestProjectingParent();
if (relativeParent && Boolean(relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !relativeParent.options.layoutScroll && relativeParent.target && this.animationProgress !== 1) {
this.relativeParent = relativeParent;
this.forceRelativeParentToResolveTarget();
this.relativeTarget = createBox();
this.relativeTargetOrigin = createBox();
calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
} else {
this.relativeParent = this.relativeTarget = void 0;
}
}
projectionFrameData.resolvedTargetDeltas++;
}
getClosestProjectingParent() {
if (!this.parent || hasScale(this.parent.latestValues) || has2DTranslate(this.parent.latestValues)) {
return void 0;
}
if (this.parent.isProjecting()) {
return this.parent;
} else {
return this.parent.getClosestProjectingParent();
}
}
isProjecting() {
return Boolean((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
}
calcProjection() {
var _a8;
const lead = this.getLead();
const isShared = Boolean(this.resumingFrom) || this !== lead;
let canSkip = true;
if (this.isProjectionDirty || ((_a8 = this.parent) === null || _a8 === void 0 ? void 0 : _a8.isProjectionDirty)) {
canSkip = false;
}
if (isShared && (this.isSharedProjectionDirty || this.isTransformDirty)) {
canSkip = false;
}
if (this.resolvedRelativeTargetAt === frameData.timestamp) {
canSkip = false;
}
if (canSkip)
return;
const { layout: layout3, layoutId } = this.options;
this.isTreeAnimating = Boolean(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation);
if (!this.isTreeAnimating) {
this.targetDelta = this.relativeTarget = void 0;
}
if (!this.layout || !(layout3 || layoutId))
return;
copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
const prevTreeScaleX = this.treeScale.x;
const prevTreeScaleY = this.treeScale.y;
applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
if (lead.layout && !lead.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
lead.target = lead.layout.layoutBox;
}
const { target } = lead;
if (!target) {
if (this.projectionTransform) {
this.projectionDelta = createDelta();
this.projectionTransform = "none";
this.scheduleRender();
}
return;
}
if (!this.projectionDelta) {
this.projectionDelta = createDelta();
this.projectionDeltaWithTransform = createDelta();
}
const prevProjectionTransform = this.projectionTransform;
calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);
this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);
if (this.projectionTransform !== prevProjectionTransform || this.treeScale.x !== prevTreeScaleX || this.treeScale.y !== prevTreeScaleY) {
this.hasProjected = true;
this.scheduleRender();
this.notifyListeners("projectionUpdate", target);
}
projectionFrameData.recalculatedProjection++;
}
hide() {
this.isVisible = false;
}
show() {
this.isVisible = true;
}
scheduleRender(notifyAll = true) {
this.options.scheduleRender && this.options.scheduleRender();
if (notifyAll) {
const stack = this.getStack();
stack && stack.scheduleRender();
}
if (this.resumingFrom && !this.resumingFrom.instance) {
this.resumingFrom = void 0;
}
}
setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
const snapshot = this.snapshot;
const snapshotLatestValues = snapshot ? snapshot.latestValues : {};
const mixedValues = { ...this.latestValues };
const targetDelta = createDelta();
if (!this.relativeParent || !this.relativeParent.options.layoutRoot) {
this.relativeTarget = this.relativeTargetOrigin = void 0;
}
this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
const relativeLayout = createBox();
const snapshotSource = snapshot ? snapshot.source : void 0;
const layoutSource = this.layout ? this.layout.source : void 0;
const isSharedLayoutAnimation = snapshotSource !== layoutSource;
const stack = this.getStack();
const isOnlyMember = !stack || stack.members.length <= 1;
const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade));
this.animationProgress = 0;
let prevRelativeTarget;
this.mixTargetDelta = (latest) => {
const progress3 = latest / 1e3;
mixAxisDelta(targetDelta.x, delta.x, progress3);
mixAxisDelta(targetDelta.y, delta.y, progress3);
this.setTargetDelta(targetDelta);
if (this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout) {
calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress3);
if (prevRelativeTarget && boxEquals(this.relativeTarget, prevRelativeTarget)) {
this.isProjectionDirty = false;
}
if (!prevRelativeTarget)
prevRelativeTarget = createBox();
copyBoxInto(prevRelativeTarget, this.relativeTarget);
}
if (isSharedLayoutAnimation) {
this.animationValues = mixedValues;
mixValues(mixedValues, snapshotLatestValues, this.latestValues, progress3, shouldCrossfadeOpacity, isOnlyMember);
}
this.root.scheduleUpdateProjection();
this.scheduleRender();
this.animationProgress = progress3;
};
this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
}
startAnimation(options) {
this.notifyListeners("animationStart");
this.currentAnimation && this.currentAnimation.stop();
if (this.resumingFrom && this.resumingFrom.currentAnimation) {
this.resumingFrom.currentAnimation.stop();
}
if (this.pendingAnimation) {
cancelFrame(this.pendingAnimation);
this.pendingAnimation = void 0;
}
this.pendingAnimation = frame2.update(() => {
globalProjectionState.hasAnimatedSinceResize = true;
this.currentAnimation = animateSingleValue(0, animationTarget, {
...options,
onUpdate: (latest) => {
this.mixTargetDelta(latest);
options.onUpdate && options.onUpdate(latest);
},
onComplete: () => {
options.onComplete && options.onComplete();
this.completeAnimation();
}
});
if (this.resumingFrom) {
this.resumingFrom.currentAnimation = this.currentAnimation;
}
this.pendingAnimation = void 0;
});
}
completeAnimation() {
if (this.resumingFrom) {
this.resumingFrom.currentAnimation = void 0;
this.resumingFrom.preserveOpacity = void 0;
}
const stack = this.getStack();
stack && stack.exitAnimationComplete();
this.resumingFrom = this.currentAnimation = this.animationValues = void 0;
this.notifyListeners("animationComplete");
}
finishAnimation() {
if (this.currentAnimation) {
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
this.currentAnimation.stop();
}
this.completeAnimation();
}
applyTransformsToTarget() {
const lead = this.getLead();
let { targetWithTransforms, target, layout: layout3, latestValues } = lead;
if (!targetWithTransforms || !target || !layout3)
return;
if (this !== lead && this.layout && layout3 && shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout3.layoutBox)) {
target = this.target || createBox();
const xLength = calcLength(this.layout.layoutBox.x);
target.x.min = lead.target.x.min;
target.x.max = target.x.min + xLength;
const yLength = calcLength(this.layout.layoutBox.y);
target.y.min = lead.target.y.min;
target.y.max = target.y.min + yLength;
}
copyBoxInto(targetWithTransforms, target);
transformBox(targetWithTransforms, latestValues);
calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);
}
registerSharedNode(layoutId, node3) {
if (!this.sharedNodes.has(layoutId)) {
this.sharedNodes.set(layoutId, new NodeStack());
}
const stack = this.sharedNodes.get(layoutId);
stack.add(node3);
const config2 = node3.options.initialPromotionConfig;
node3.promote({
transition: config2 ? config2.transition : void 0,
preserveFollowOpacity: config2 && config2.shouldPreserveFollowOpacity ? config2.shouldPreserveFollowOpacity(node3) : void 0
});
}
isLead() {
const stack = this.getStack();
return stack ? stack.lead === this : true;
}
getLead() {
var _a8;
const { layoutId } = this.options;
return layoutId ? ((_a8 = this.getStack()) === null || _a8 === void 0 ? void 0 : _a8.lead) || this : this;
}
getPrevLead() {
var _a8;
const { layoutId } = this.options;
return layoutId ? (_a8 = this.getStack()) === null || _a8 === void 0 ? void 0 : _a8.prevLead : void 0;
}
getStack() {
const { layoutId } = this.options;
if (layoutId)
return this.root.sharedNodes.get(layoutId);
}
promote({ needsReset, transition: transition3, preserveFollowOpacity } = {}) {
const stack = this.getStack();
if (stack)
stack.promote(this, preserveFollowOpacity);
if (needsReset) {
this.projectionDelta = void 0;
this.needsReset = true;
}
if (transition3)
this.setOptions({ transition: transition3 });
}
relegate() {
const stack = this.getStack();
if (stack) {
return stack.relegate(this);
} else {
return false;
}
}
resetRotation() {
const { visualElement } = this.options;
if (!visualElement)
return;
let hasRotate = false;
const { latestValues } = visualElement;
if (latestValues.rotate || latestValues.rotateX || latestValues.rotateY || latestValues.rotateZ) {
hasRotate = true;
}
if (!hasRotate)
return;
const resetValues = {};
for (let i = 0; i < transformAxes.length; i++) {
const key = "rotate" + transformAxes[i];
if (latestValues[key]) {
resetValues[key] = latestValues[key];
visualElement.setStaticValue(key, 0);
}
}
visualElement.render();
for (const key in resetValues) {
visualElement.setStaticValue(key, resetValues[key]);
}
visualElement.scheduleRender();
}
getProjectionStyles(styleProp) {
var _a8, _b3;
if (!this.instance || this.isSVG)
return void 0;
if (!this.isVisible) {
return hiddenVisibility;
}
const styles2 = {
visibility: ""
};
const transformTemplate2 = this.getTransformTemplate();
if (this.needsReset) {
this.needsReset = false;
styles2.opacity = "";
styles2.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
styles2.transform = transformTemplate2 ? transformTemplate2(this.latestValues, "") : "none";
return styles2;
}
const lead = this.getLead();
if (!this.projectionDelta || !this.layout || !lead.target) {
const emptyStyles = {};
if (this.options.layoutId) {
emptyStyles.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1;
emptyStyles.pointerEvents = resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "";
}
if (this.hasProjected && !hasTransform(this.latestValues)) {
emptyStyles.transform = transformTemplate2 ? transformTemplate2({}, "") : "none";
this.hasProjected = false;
}
return emptyStyles;
}
const valuesToRender = lead.animationValues || lead.latestValues;
this.applyTransformsToTarget();
styles2.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
if (transformTemplate2) {
styles2.transform = transformTemplate2(valuesToRender, styles2.transform);
}
const { x, y } = this.projectionDelta;
styles2.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
if (lead.animationValues) {
styles2.opacity = lead === this ? (_b3 = (_a8 = valuesToRender.opacity) !== null && _a8 !== void 0 ? _a8 : this.latestValues.opacity) !== null && _b3 !== void 0 ? _b3 : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit;
} else {
styles2.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0;
}
for (const key in scaleCorrectors) {
if (valuesToRender[key] === void 0)
continue;
const { correct, applyTo } = scaleCorrectors[key];
const corrected = styles2.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead);
if (applyTo) {
const num = applyTo.length;
for (let i = 0; i < num; i++) {
styles2[applyTo[i]] = corrected;
}
} else {
styles2[key] = corrected;
}
}
if (this.options.layoutId) {
styles2.pointerEvents = lead === this ? resolveMotionValue(styleProp === null || styleProp === void 0 ? void 0 : styleProp.pointerEvents) || "" : "none";
}
return styles2;
}
clearSnapshot() {
this.resumeFrom = this.snapshot = void 0;
}
// Only run on root
resetTree() {
this.root.nodes.forEach((node3) => {
var _a8;
return (_a8 = node3.currentAnimation) === null || _a8 === void 0 ? void 0 : _a8.stop();
});
this.root.nodes.forEach(clearMeasurements);
this.root.sharedNodes.clear();
}
};
}
function updateLayout(node3) {
node3.updateLayout();
}
function notifyLayoutUpdate(node3) {
var _a8;
const snapshot = ((_a8 = node3.resumeFrom) === null || _a8 === void 0 ? void 0 : _a8.snapshot) || node3.snapshot;
if (node3.isLead() && node3.layout && snapshot && node3.hasListeners("didUpdate")) {
const { layoutBox: layout3, measuredBox: measuredLayout } = node3.layout;
const { animationType } = node3.options;
const isShared = snapshot.source !== node3.layout.source;
if (animationType === "size") {
eachAxis((axis) => {
const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis];
const length2 = calcLength(axisSnapshot);
axisSnapshot.min = layout3[axis].min;
axisSnapshot.max = axisSnapshot.min + length2;
});
} else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout3)) {
eachAxis((axis) => {
const axisSnapshot = isShared ? snapshot.measuredBox[axis] : snapshot.layoutBox[axis];
const length2 = calcLength(layout3[axis]);
axisSnapshot.max = axisSnapshot.min + length2;
if (node3.relativeTarget && !node3.currentAnimation) {
node3.isProjectionDirty = true;
node3.relativeTarget[axis].max = node3.relativeTarget[axis].min + length2;
}
});
}
const layoutDelta = createDelta();
calcBoxDelta(layoutDelta, layout3, snapshot.layoutBox);
const visualDelta = createDelta();
if (isShared) {
calcBoxDelta(visualDelta, node3.applyTransform(measuredLayout, true), snapshot.measuredBox);
} else {
calcBoxDelta(visualDelta, layout3, snapshot.layoutBox);
}
const hasLayoutChanged = !isDeltaZero(layoutDelta);
let hasRelativeTargetChanged = false;
if (!node3.resumeFrom) {
const relativeParent = node3.getClosestProjectingParent();
if (relativeParent && !relativeParent.resumeFrom) {
const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
if (parentSnapshot && parentLayout) {
const relativeSnapshot = createBox();
calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
const relativeLayout = createBox();
calcRelativePosition(relativeLayout, layout3, parentLayout.layoutBox);
if (!boxEqualsRounded(relativeSnapshot, relativeLayout)) {
hasRelativeTargetChanged = true;
}
if (relativeParent.options.layoutRoot) {
node3.relativeTarget = relativeLayout;
node3.relativeTargetOrigin = relativeSnapshot;
node3.relativeParent = relativeParent;
}
}
}
}
node3.notifyListeners("didUpdate", {
layout: layout3,
snapshot,
delta: visualDelta,
layoutDelta,
hasLayoutChanged,
hasRelativeTargetChanged
});
} else if (node3.isLead()) {
const { onExitComplete } = node3.options;
onExitComplete && onExitComplete();
}
node3.options.transition = void 0;
}
function propagateDirtyNodes(node3) {
projectionFrameData.totalNodes++;
if (!node3.parent)
return;
if (!node3.isProjecting()) {
node3.isProjectionDirty = node3.parent.isProjectionDirty;
}
node3.isSharedProjectionDirty || (node3.isSharedProjectionDirty = Boolean(node3.isProjectionDirty || node3.parent.isProjectionDirty || node3.parent.isSharedProjectionDirty));
node3.isTransformDirty || (node3.isTransformDirty = node3.parent.isTransformDirty);
}
function cleanDirtyNodes(node3) {
node3.isProjectionDirty = node3.isSharedProjectionDirty = node3.isTransformDirty = false;
}
function clearSnapshot(node3) {
node3.clearSnapshot();
}
function clearMeasurements(node3) {
node3.clearMeasurements();
}
function clearIsLayoutDirty(node3) {
node3.isLayoutDirty = false;
}
function resetTransformStyle(node3) {
const { visualElement } = node3.options;
if (visualElement && visualElement.getProps().onBeforeLayoutMeasure) {
visualElement.notify("BeforeLayoutMeasure");
}
node3.resetTransform();
}
function finishAnimation(node3) {
node3.finishAnimation();
node3.targetDelta = node3.relativeTarget = node3.target = void 0;
node3.isProjectionDirty = true;
}
function resolveTargetDelta(node3) {
node3.resolveTargetDelta();
}
function calcProjection(node3) {
node3.calcProjection();
}
function resetRotation(node3) {
node3.resetRotation();
}
function removeLeadSnapshots(stack) {
stack.removeLeadSnapshot();
}
function mixAxisDelta(output, delta, p) {
output.translate = mix2(delta.translate, 0, p);
output.scale = mix2(delta.scale, 1, p);
output.origin = delta.origin;
output.originPoint = delta.originPoint;
}
function mixAxis(output, from2, to, p) {
output.min = mix2(from2.min, to.min, p);
output.max = mix2(from2.max, to.max, p);
}
function mixBox(output, from2, to, p) {
mixAxis(output.x, from2.x, to.x, p);
mixAxis(output.y, from2.y, to.y, p);
}
function hasOpacityCrossfade(node3) {
return node3.animationValues && node3.animationValues.opacityExit !== void 0;
}
var defaultLayoutTransition = {
duration: 0.45,
ease: [0.4, 0, 0.1, 1]
};
var userAgentContains = (string2) => typeof navigator !== "undefined" && navigator.userAgent.toLowerCase().includes(string2);
var roundPoint = userAgentContains("applewebkit/") && !userAgentContains("chrome/") ? Math.round : noop2;
function roundAxis(axis) {
axis.min = roundPoint(axis.min);
axis.max = roundPoint(axis.max);
}
function roundBox(box) {
roundAxis(box.x);
roundAxis(box.y);
}
function shouldAnimatePositionOnly(animationType, snapshot, layout3) {
return animationType === "position" || animationType === "preserve-aspect" && !isNear(aspectRatio(snapshot), aspectRatio(layout3), 0.2);
}
// ../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs
var DocumentProjectionNode = createProjectionNode({
attachResizeListener: (ref, notify) => addDomEvent2(ref, "resize", notify),
measureScroll: () => ({
x: document.documentElement.scrollLeft || document.body.scrollLeft,
y: document.documentElement.scrollTop || document.body.scrollTop
}),
checkIsScrollRoot: () => true
});
// ../../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs
var rootProjectionNode = {
current: void 0
};
var HTMLProjectionNode = createProjectionNode({
measureScroll: (instance) => ({
x: instance.scrollLeft,
y: instance.scrollTop
}),
defaultParent: () => {
if (!rootProjectionNode.current) {
const documentNode = new DocumentProjectionNode({});
documentNode.mount(window);
documentNode.setOptions({ layoutScroll: true });
rootProjectionNode.current = documentNode;
}
return rootProjectionNode.current;
},
resetTransform: (instance, value) => {
instance.style.transform = value !== void 0 ? value : "none";
},
checkIsScrollRoot: (instance) => Boolean(window.getComputedStyle(instance).position === "fixed")
});
// ../../node_modules/framer-motion/dist/es/motion/features/drag.mjs
var drag = {
pan: {
Feature: PanGesture
},
drag: {
Feature: DragGesture,
ProjectionNode: HTMLProjectionNode,
MeasureLayout
}
};
// ../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs
var splitCSSVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
function parseCSSVariable(current) {
const match3 = splitCSSVariableRegex.exec(current);
if (!match3)
return [,];
const [, token2, fallback] = match3;
return [token2, fallback];
}
var maxDepth = 4;
function getVariableValue(current, element, depth = 1) {
invariant(depth <= maxDepth, `Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`);
const [token2, fallback] = parseCSSVariable(current);
if (!token2)
return;
const resolved = window.getComputedStyle(element).getPropertyValue(token2);
if (resolved) {
const trimmed = resolved.trim();
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
} else if (isCSSVariableToken(fallback)) {
return getVariableValue(fallback, element, depth + 1);
} else {
return fallback;
}
}
function resolveCSSVariables(visualElement, { ...target }, transitionEnd) {
const element = visualElement.current;
if (!(element instanceof Element))
return { target, transitionEnd };
if (transitionEnd) {
transitionEnd = { ...transitionEnd };
}
visualElement.values.forEach((value) => {
const current = value.get();
if (!isCSSVariableToken(current))
return;
const resolved = getVariableValue(current, element);
if (resolved)
value.set(resolved);
});
for (const key in target) {
const current = target[key];
if (!isCSSVariableToken(current))
continue;
const resolved = getVariableValue(current, element);
if (!resolved)
continue;
target[key] = resolved;
if (!transitionEnd)
transitionEnd = {};
if (transitionEnd[key] === void 0) {
transitionEnd[key] = current;
}
}
return { target, transitionEnd };
}
// ../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs
var positionalKeys = /* @__PURE__ */ new Set([
"width",
"height",
"top",
"left",
"right",
"bottom",
"x",
"y",
"translateX",
"translateY"
]);
var isPositionalKey = (key) => positionalKeys.has(key);
var hasPositionalKey = (target) => {
return Object.keys(target).some(isPositionalKey);
};
var isNumOrPxType = (v) => v === number || v === px2;
var getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]);
var getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform3 }) => {
if (transform3 === "none" || !transform3)
return 0;
const matrix3d = transform3.match(/^matrix3d\((.+)\)$/);
if (matrix3d) {
return getPosFromMatrix(matrix3d[1], pos3);
} else {
const matrix = transform3.match(/^matrix\((.+)\)$/);
if (matrix) {
return getPosFromMatrix(matrix[1], pos2);
} else {
return 0;
}
}
};
var transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]);
var nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
function removeNonTranslationalTransform(visualElement) {
const removedTransforms = [];
nonTranslationalTransformKeys.forEach((key) => {
const value = visualElement.getValue(key);
if (value !== void 0) {
removedTransforms.push([key, value.get()]);
value.set(key.startsWith("scale") ? 1 : 0);
}
});
if (removedTransforms.length)
visualElement.render();
return removedTransforms;
}
var positionalValues = {
// Dimensions
width: ({ x }, { paddingLeft = "0", paddingRight = "0" }) => x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
height: ({ y }, { paddingTop = "0", paddingBottom = "0" }) => y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
top: (_bbox, { top: top2 }) => parseFloat(top2),
left: (_bbox, { left: left2 }) => parseFloat(left2),
bottom: ({ y }, { top: top2 }) => parseFloat(top2) + (y.max - y.min),
right: ({ x }, { left: left2 }) => parseFloat(left2) + (x.max - x.min),
// Transform
x: getTranslateFromMatrix(4, 13),
y: getTranslateFromMatrix(5, 14)
};
positionalValues.translateX = positionalValues.x;
positionalValues.translateY = positionalValues.y;
var convertChangedValueTypes = (target, visualElement, changedKeys) => {
const originBbox = visualElement.measureViewportBox();
const element = visualElement.current;
const elementComputedStyle = getComputedStyle(element);
const { display } = elementComputedStyle;
const origin = {};
if (display === "none") {
visualElement.setStaticValue("display", target.display || "block");
}
changedKeys.forEach((key) => {
origin[key] = positionalValues[key](originBbox, elementComputedStyle);
});
visualElement.render();
const targetBbox = visualElement.measureViewportBox();
changedKeys.forEach((key) => {
const value = visualElement.getValue(key);
value && value.jump(origin[key]);
target[key] = positionalValues[key](targetBbox, elementComputedStyle);
});
return target;
};
var checkAndConvertChangedValueTypes = (visualElement, target, origin = {}, transitionEnd = {}) => {
target = { ...target };
transitionEnd = { ...transitionEnd };
const targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
let removedTransformValues = [];
let hasAttemptedToRemoveTransformValues = false;
const changedValueTypeKeys = [];
targetPositionalKeys.forEach((key) => {
const value = visualElement.getValue(key);
if (!visualElement.hasValue(key))
return;
let from2 = origin[key];
let fromType = findDimensionValueType(from2);
const to = target[key];
let toType;
if (isKeyframesTarget(to)) {
const numKeyframes = to.length;
const fromIndex = to[0] === null ? 1 : 0;
from2 = to[fromIndex];
fromType = findDimensionValueType(from2);
for (let i = fromIndex; i < numKeyframes; i++) {
if (to[i] === null)
break;
if (!toType) {
toType = findDimensionValueType(to[i]);
invariant(toType === fromType || isNumOrPxType(fromType) && isNumOrPxType(toType), "Keyframes must be of the same dimension as the current value");
} else {
invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type");
}
}
} else {
toType = findDimensionValueType(to);
}
if (fromType !== toType) {
if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {
const current = value.get();
if (typeof current === "string") {
value.set(parseFloat(current));
}
if (typeof to === "string") {
target[key] = parseFloat(to);
} else if (Array.isArray(to) && toType === px2) {
target[key] = to.map(parseFloat);
}
} else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) && (toType === null || toType === void 0 ? void 0 : toType.transform) && (from2 === 0 || to === 0)) {
if (from2 === 0) {
value.set(toType.transform(from2));
} else {
target[key] = fromType.transform(to);
}
} else {
if (!hasAttemptedToRemoveTransformValues) {
removedTransformValues = removeNonTranslationalTransform(visualElement);
hasAttemptedToRemoveTransformValues = true;
}
changedValueTypeKeys.push(key);
transitionEnd[key] = transitionEnd[key] !== void 0 ? transitionEnd[key] : target[key];
value.jump(to);
}
}
});
if (changedValueTypeKeys.length) {
const scrollY = changedValueTypeKeys.indexOf("height") >= 0 ? window.pageYOffset : null;
const convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
if (removedTransformValues.length) {
removedTransformValues.forEach(([key, value]) => {
visualElement.getValue(key).set(value);
});
}
visualElement.render();
if (isBrowser3 && scrollY !== null) {
window.scrollTo({ top: scrollY });
}
return { target: convertedTarget, transitionEnd };
} else {
return { target, transitionEnd };
}
};
function unitConversion(visualElement, target, origin, transitionEnd) {
return hasPositionalKey(target) ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) : { target, transitionEnd };
}
// ../../node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs
var parseDomVariant = (visualElement, target, origin, transitionEnd) => {
const resolved = resolveCSSVariables(visualElement, target, transitionEnd);
target = resolved.target;
transitionEnd = resolved.transitionEnd;
return unitConversion(visualElement, target, origin, transitionEnd);
};
// ../../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs
var prefersReducedMotion = { current: null };
var hasReducedMotionListener = { current: false };
// ../../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs
function initPrefersReducedMotion() {
hasReducedMotionListener.current = true;
if (!isBrowser3)
return;
if (window.matchMedia) {
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches;
motionMediaQuery.addListener(setReducedMotionPreferences);
setReducedMotionPreferences();
} else {
prefersReducedMotion.current = false;
}
}
// ../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs
function updateMotionValuesFromProps(element, next2, prev2) {
const { willChange } = next2;
for (const key in next2) {
const nextValue = next2[key];
const prevValue = prev2[key];
if (isMotionValue(nextValue)) {
element.addValue(key, nextValue);
if (isWillChangeMotionValue(willChange)) {
willChange.add(key);
}
if (true) {
warnOnce(nextValue.version === "10.18.0", `Attempting to mix Framer Motion versions ${nextValue.version} with 10.18.0 may not work as expected.`);
}
} else if (isMotionValue(prevValue)) {
element.addValue(key, motionValue(nextValue, { owner: element }));
if (isWillChangeMotionValue(willChange)) {
willChange.remove(key);
}
} else if (prevValue !== nextValue) {
if (element.hasValue(key)) {
const existingValue = element.getValue(key);
!existingValue.hasAnimated && existingValue.set(nextValue);
} else {
const latestValue = element.getStaticValue(key);
element.addValue(key, motionValue(latestValue !== void 0 ? latestValue : nextValue, { owner: element }));
}
}
}
for (const key in prev2) {
if (next2[key] === void 0)
element.removeValue(key);
}
return next2;
}
// ../../node_modules/framer-motion/dist/es/render/store.mjs
var visualElementStore = /* @__PURE__ */ new WeakMap();
// ../../node_modules/framer-motion/dist/es/render/VisualElement.mjs
var featureNames = Object.keys(featureDefinitions);
var numFeatures = featureNames.length;
var propEventHandlers = [
"AnimationStart",
"AnimationComplete",
"Update",
"BeforeLayoutMeasure",
"LayoutMeasure",
"LayoutAnimationStart",
"LayoutAnimationComplete"
];
var numVariantProps = variantProps.length;
var VisualElement = class {
constructor({ parent, props, presenceContext, reducedMotionConfig, visualState }, options = {}) {
this.current = null;
this.children = /* @__PURE__ */ new Set();
this.isVariantNode = false;
this.isControllingVariants = false;
this.shouldReduceMotion = null;
this.values = /* @__PURE__ */ new Map();
this.features = {};
this.valueSubscriptions = /* @__PURE__ */ new Map();
this.prevMotionValues = {};
this.events = {};
this.propEventSubscriptions = {};
this.notifyUpdate = () => this.notify("Update", this.latestValues);
this.render = () => {
if (!this.current)
return;
this.triggerBuild();
this.renderInstance(this.current, this.renderState, this.props.style, this.projection);
};
this.scheduleRender = () => frame2.render(this.render, false, true);
const { latestValues, renderState } = visualState;
this.latestValues = latestValues;
this.baseTarget = { ...latestValues };
this.initialValues = props.initial ? { ...latestValues } : {};
this.renderState = renderState;
this.parent = parent;
this.props = props;
this.presenceContext = presenceContext;
this.depth = parent ? parent.depth + 1 : 0;
this.reducedMotionConfig = reducedMotionConfig;
this.options = options;
this.isControllingVariants = isControllingVariants(props);
this.isVariantNode = isVariantNode(props);
if (this.isVariantNode) {
this.variantChildren = /* @__PURE__ */ new Set();
}
this.manuallyAnimateOnMount = Boolean(parent && parent.current);
const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {});
for (const key in initialMotionValues) {
const value = initialMotionValues[key];
if (latestValues[key] !== void 0 && isMotionValue(value)) {
value.set(latestValues[key], false);
if (isWillChangeMotionValue(willChange)) {
willChange.add(key);
}
}
}
}
/**
* This method takes React props and returns found MotionValues. For example, HTML
* MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
*
* This isn't an abstract method as it needs calling in the constructor, but it is
* intended to be one.
*/
scrapeMotionValuesFromProps(_props, _prevProps) {
return {};
}
mount(instance) {
this.current = instance;
visualElementStore.set(instance, this);
if (this.projection && !this.projection.instance) {
this.projection.mount(instance);
}
if (this.parent && this.isVariantNode && !this.isControllingVariants) {
this.removeFromVariantTree = this.parent.addVariantChild(this);
}
this.values.forEach((value, key) => this.bindToMotionValue(key, value));
if (!hasReducedMotionListener.current) {
initPrefersReducedMotion();
}
this.shouldReduceMotion = this.reducedMotionConfig === "never" ? false : this.reducedMotionConfig === "always" ? true : prefersReducedMotion.current;
if (true) {
warnOnce(this.shouldReduceMotion !== true, "You have Reduced Motion enabled on your device. Animations may not appear as expected.");
}
if (this.parent)
this.parent.children.add(this);
this.update(this.props, this.presenceContext);
}
unmount() {
visualElementStore.delete(this.current);
this.projection && this.projection.unmount();
cancelFrame(this.notifyUpdate);
cancelFrame(this.render);
this.valueSubscriptions.forEach((remove) => remove());
this.removeFromVariantTree && this.removeFromVariantTree();
this.parent && this.parent.children.delete(this);
for (const key in this.events) {
this.events[key].clear();
}
for (const key in this.features) {
this.features[key].unmount();
}
this.current = null;
}
bindToMotionValue(key, value) {
const valueIsTransform = transformProps.has(key);
const removeOnChange = value.on("change", (latestValue) => {
this.latestValues[key] = latestValue;
this.props.onUpdate && frame2.update(this.notifyUpdate, false, true);
if (valueIsTransform && this.projection) {
this.projection.isTransformDirty = true;
}
});
const removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
this.valueSubscriptions.set(key, () => {
removeOnChange();
removeOnRenderRequest();
});
}
sortNodePosition(other) {
if (!this.current || !this.sortInstanceNodePosition || this.type !== other.type) {
return 0;
}
return this.sortInstanceNodePosition(this.current, other.current);
}
loadFeatures({ children, ...renderedProps }, isStrict, preloadedFeatures2, initialLayoutGroupConfig) {
let ProjectionNodeConstructor;
let MeasureLayout2;
if (preloadedFeatures2 && isStrict) {
const strictMessage = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
renderedProps.ignoreStrict ? warning(false, strictMessage) : invariant(false, strictMessage);
}
for (let i = 0; i < numFeatures; i++) {
const name = featureNames[i];
const { isEnabled, Feature: FeatureConstructor, ProjectionNode, MeasureLayout: MeasureLayoutComponent } = featureDefinitions[name];
if (ProjectionNode)
ProjectionNodeConstructor = ProjectionNode;
if (isEnabled(renderedProps)) {
if (!this.features[name] && FeatureConstructor) {
this.features[name] = new FeatureConstructor(this);
}
if (MeasureLayoutComponent) {
MeasureLayout2 = MeasureLayoutComponent;
}
}
}
if ((this.type === "html" || this.type === "svg") && !this.projection && ProjectionNodeConstructor) {
this.projection = new ProjectionNodeConstructor(this.latestValues, this.parent && this.parent.projection);
const { layoutId, layout: layout3, drag: drag2, dragConstraints, layoutScroll, layoutRoot } = renderedProps;
this.projection.setOptions({
layoutId,
layout: layout3,
alwaysMeasureLayout: Boolean(drag2) || dragConstraints && isRefObject4(dragConstraints),
visualElement: this,
scheduleRender: () => this.scheduleRender(),
/**
* TODO: Update options in an effect. This could be tricky as it'll be too late
* to update by the time layout animations run.
* We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
* ensuring it gets called if there's no potential layout animations.
*
*/
animationType: typeof layout3 === "string" ? layout3 : "both",
initialPromotionConfig: initialLayoutGroupConfig,
layoutScroll,
layoutRoot
});
}
return MeasureLayout2;
}
updateFeatures() {
for (const key in this.features) {
const feature = this.features[key];
if (feature.isMounted) {
feature.update();
} else {
feature.mount();
feature.isMounted = true;
}
}
}
triggerBuild() {
this.build(this.renderState, this.latestValues, this.options, this.props);
}
/**
* Measure the current viewport box with or without transforms.
* Only measures axis-aligned boxes, rotate and skew must be manually
* removed with a re-render to work.
*/
measureViewportBox() {
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : createBox();
}
getStaticValue(key) {
return this.latestValues[key];
}
setStaticValue(key, value) {
this.latestValues[key] = value;
}
/**
* Make a target animatable by Popmotion. For instance, if we're
* trying to animate width from 100px to 100vw we need to measure 100vw
* in pixels to determine what we really need to animate to. This is also
* pluggable to support Framer's custom value types like Color,
* and CSS variables.
*/
makeTargetAnimatable(target, canMutate = true) {
return this.makeTargetAnimatableFromInstance(target, this.props, canMutate);
}
/**
* Update the provided props. Ensure any newly-added motion values are
* added to our map, old ones removed, and listeners updated.
*/
update(props, presenceContext) {
if (props.transformTemplate || this.props.transformTemplate) {
this.scheduleRender();
}
this.prevProps = this.props;
this.props = props;
this.prevPresenceContext = this.presenceContext;
this.presenceContext = presenceContext;
for (let i = 0; i < propEventHandlers.length; i++) {
const key = propEventHandlers[i];
if (this.propEventSubscriptions[key]) {
this.propEventSubscriptions[key]();
delete this.propEventSubscriptions[key];
}
const listener = props["on" + key];
if (listener) {
this.propEventSubscriptions[key] = this.on(key, listener);
}
}
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps), this.prevMotionValues);
if (this.handleChildMotionValue) {
this.handleChildMotionValue();
}
}
getProps() {
return this.props;
}
/**
* Returns the variant definition with a given name.
*/
getVariant(name) {
return this.props.variants ? this.props.variants[name] : void 0;
}
/**
* Returns the defined default transition on this component.
*/
getDefaultTransition() {
return this.props.transition;
}
getTransformPagePoint() {
return this.props.transformPagePoint;
}
getClosestVariantNode() {
return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
}
getVariantContext(startAtParent = false) {
if (startAtParent) {
return this.parent ? this.parent.getVariantContext() : void 0;
}
if (!this.isControllingVariants) {
const context2 = this.parent ? this.parent.getVariantContext() || {} : {};
if (this.props.initial !== void 0) {
context2.initial = this.props.initial;
}
return context2;
}
const context = {};
for (let i = 0; i < numVariantProps; i++) {
const name = variantProps[i];
const prop = this.props[name];
if (isVariantLabel(prop) || prop === false) {
context[name] = prop;
}
}
return context;
}
/**
* Add a child visual element to our set of children.
*/
addVariantChild(child) {
const closestVariantNode = this.getClosestVariantNode();
if (closestVariantNode) {
closestVariantNode.variantChildren && closestVariantNode.variantChildren.add(child);
return () => closestVariantNode.variantChildren.delete(child);
}
}
/**
* Add a motion value and bind it to this visual element.
*/
addValue(key, value) {
if (value !== this.values.get(key)) {
this.removeValue(key);
this.bindToMotionValue(key, value);
}
this.values.set(key, value);
this.latestValues[key] = value.get();
}
/**
* Remove a motion value and unbind any active subscriptions.
*/
removeValue(key) {
this.values.delete(key);
const unsubscribe = this.valueSubscriptions.get(key);
if (unsubscribe) {
unsubscribe();
this.valueSubscriptions.delete(key);
}
delete this.latestValues[key];
this.removeValueFromRenderState(key, this.renderState);
}
/**
* Check whether we have a motion value for this key
*/
hasValue(key) {
return this.values.has(key);
}
getValue(key, defaultValue) {
if (this.props.values && this.props.values[key]) {
return this.props.values[key];
}
let value = this.values.get(key);
if (value === void 0 && defaultValue !== void 0) {
value = motionValue(defaultValue, { owner: this });
this.addValue(key, value);
}
return value;
}
/**
* If we're trying to animate to a previously unencountered value,
* we need to check for it in our state and as a last resort read it
* directly from the instance (which might have performance implications).
*/
readValue(key) {
var _a8;
return this.latestValues[key] !== void 0 || !this.current ? this.latestValues[key] : (_a8 = this.getBaseTargetFromProps(this.props, key)) !== null && _a8 !== void 0 ? _a8 : this.readValueFromInstance(this.current, key, this.options);
}
/**
* Set the base target to later animate back to. This is currently
* only hydrated on creation and when we first read a value.
*/
setBaseTarget(key, value) {
this.baseTarget[key] = value;
}
/**
* Find the base target for a value thats been removed from all animation
* props.
*/
getBaseTarget(key) {
var _a8;
const { initial } = this.props;
const valueFromInitial = typeof initial === "string" || typeof initial === "object" ? (_a8 = resolveVariantFromProps(this.props, initial)) === null || _a8 === void 0 ? void 0 : _a8[key] : void 0;
if (initial && valueFromInitial !== void 0) {
return valueFromInitial;
}
const target = this.getBaseTargetFromProps(this.props, key);
if (target !== void 0 && !isMotionValue(target))
return target;
return this.initialValues[key] !== void 0 && valueFromInitial === void 0 ? void 0 : this.baseTarget[key];
}
on(eventName, callback) {
if (!this.events[eventName]) {
this.events[eventName] = new SubscriptionManager();
}
return this.events[eventName].add(callback);
}
notify(eventName, ...args) {
if (this.events[eventName]) {
this.events[eventName].notify(...args);
}
}
};
// ../../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs
var DOMVisualElement = class extends VisualElement {
sortInstanceNodePosition(a, b) {
return a.compareDocumentPosition(b) & 2 ? 1 : -1;
}
getBaseTargetFromProps(props, key) {
return props.style ? props.style[key] : void 0;
}
removeValueFromRenderState(key, { vars: vars2, style }) {
delete vars2[key];
delete style[key];
}
makeTargetAnimatableFromInstance({ transition: transition3, transitionEnd, ...target }, { transformValues }, isMounted) {
let origin = getOrigin(target, transition3 || {}, this);
if (transformValues) {
if (transitionEnd)
transitionEnd = transformValues(transitionEnd);
if (target)
target = transformValues(target);
if (origin)
origin = transformValues(origin);
}
if (isMounted) {
checkTargetForNewValues(this, target, origin);
const parsed = parseDomVariant(this, target, origin, transitionEnd);
transitionEnd = parsed.transitionEnd;
target = parsed.target;
}
return {
transition: transition3,
transitionEnd,
...target
};
}
};
// ../../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs
function getComputedStyle2(element) {
return window.getComputedStyle(element);
}
var HTMLVisualElement = class extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "html";
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
const defaultType = getDefaultValueType(key);
return defaultType ? defaultType.default || 0 : 0;
} else {
const computedStyle = getComputedStyle2(instance);
const value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
return typeof value === "string" ? value.trim() : value;
}
}
measureInstanceViewportBox(instance, { transformPagePoint }) {
return measureViewportBox(instance, transformPagePoint);
}
build(renderState, latestValues, options, props) {
buildHTMLStyles(renderState, latestValues, options, props.transformTemplate);
}
scrapeMotionValuesFromProps(props, prevProps) {
return scrapeMotionValuesFromProps(props, prevProps);
}
handleChildMotionValue() {
if (this.childSubscription) {
this.childSubscription();
delete this.childSubscription;
}
const { children } = this.props;
if (isMotionValue(children)) {
this.childSubscription = children.on("change", (latest) => {
if (this.current)
this.current.textContent = `${latest}`;
});
}
}
renderInstance(instance, renderState, styleProp, projection) {
renderHTML(instance, renderState, styleProp, projection);
}
};
// ../../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs
var SVGVisualElement = class extends DOMVisualElement {
constructor() {
super(...arguments);
this.type = "svg";
this.isSVGTag = false;
}
getBaseTargetFromProps(props, key) {
return props[key];
}
readValueFromInstance(instance, key) {
if (transformProps.has(key)) {
const defaultType = getDefaultValueType(key);
return defaultType ? defaultType.default || 0 : 0;
}
key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
return instance.getAttribute(key);
}
measureInstanceViewportBox() {
return createBox();
}
scrapeMotionValuesFromProps(props, prevProps) {
return scrapeMotionValuesFromProps2(props, prevProps);
}
build(renderState, latestValues, options, props) {
buildSVGAttrs(renderState, latestValues, options, this.isSVGTag, props.transformTemplate);
}
renderInstance(instance, renderState, styleProp, projection) {
renderSVG(instance, renderState, styleProp, projection);
}
mount(instance) {
this.isSVGTag = isSVGTag(instance.tagName);
super.mount(instance);
}
};
// ../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs
var createDomVisualElement = (Component2, options) => {
return isSVGComponent(Component2) ? new SVGVisualElement(options, { enableHardwareAcceleration: false }) : new HTMLVisualElement(options, { enableHardwareAcceleration: true });
};
// ../../node_modules/framer-motion/dist/es/motion/features/layout.mjs
var layout2 = {
layout: {
ProjectionNode: HTMLProjectionNode,
MeasureLayout
}
};
// ../../node_modules/framer-motion/dist/es/render/dom/motion.mjs
var preloadedFeatures = {
...animations,
...gestureAnimations,
...drag,
...layout2
};
var motion = createMotionProxy((Component2, config2) => createDomMotionConfig(Component2, config2, preloadedFeatures, createDomVisualElement));
// ../../node_modules/framer-motion/dist/es/render/dom/motion-minimal.mjs
var m = createMotionProxy(createDomMotionConfig);
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
var React7 = __toESM(require_react(), 1);
var import_react55 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/use-force-update.mjs
var import_react51 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs
var import_react50 = __toESM(require_react(), 1);
function useIsMounted() {
const isMounted = (0, import_react50.useRef)(false);
useIsomorphicLayoutEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
}
// ../../node_modules/framer-motion/dist/es/utils/use-force-update.mjs
function useForceUpdate() {
const isMounted = useIsMounted();
const [forcedRenderCount, setForcedRenderCount] = (0, import_react51.useState)(0);
const forceRender = (0, import_react51.useCallback)(() => {
isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
}, [forcedRenderCount]);
const deferredForceRender = (0, import_react51.useCallback)(() => frame2.postRender(forceRender), [forceRender]);
return [deferredForceRender, forcedRenderCount];
}
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
var React6 = __toESM(require_react(), 1);
var import_react53 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
var React5 = __toESM(require_react(), 1);
var import_react52 = __toESM(require_react(), 1);
var PopChildMeasure = class extends React5.Component {
getSnapshotBeforeUpdate(prevProps) {
const element = this.props.childRef.current;
if (element && prevProps.isPresent && !this.props.isPresent) {
const size2 = this.props.sizeRef.current;
size2.height = element.offsetHeight || 0;
size2.width = element.offsetWidth || 0;
size2.top = element.offsetTop;
size2.left = element.offsetLeft;
}
return null;
}
/**
* Required with getSnapshotBeforeUpdate to stop React complaining.
*/
componentDidUpdate() {
}
render() {
return this.props.children;
}
};
function PopChild({ children, isPresent: isPresent2 }) {
const id3 = (0, import_react52.useId)();
const ref = (0, import_react52.useRef)(null);
const size2 = (0, import_react52.useRef)({
width: 0,
height: 0,
top: 0,
left: 0
});
(0, import_react52.useInsertionEffect)(() => {
const { width, height, top: top2, left: left2 } = size2.current;
if (isPresent2 || !ref.current || !width || !height)
return;
ref.current.dataset.motionPopId = id3;
const style = document.createElement("style");
document.head.appendChild(style);
if (style.sheet) {
style.sheet.insertRule(`
[data-motion-pop-id="${id3}"] {
position: absolute !important;
width: ${width}px !important;
height: ${height}px !important;
top: ${top2}px !important;
left: ${left2}px !important;
}
`);
}
return () => {
document.head.removeChild(style);
};
}, [isPresent2]);
return React5.createElement(PopChildMeasure, { isPresent: isPresent2, childRef: ref, sizeRef: size2 }, React5.cloneElement(children, { ref }));
}
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
var PresenceChild = ({ children, initial, isPresent: isPresent2, onExitComplete, custom, presenceAffectsLayout, mode: mode2 }) => {
const presenceChildren = useConstant(newChildrenMap);
const id3 = (0, import_react53.useId)();
const context = (0, import_react53.useMemo)(
() => ({
id: id3,
initial,
isPresent: isPresent2,
custom,
onExitComplete: (childId) => {
presenceChildren.set(childId, true);
for (const isComplete of presenceChildren.values()) {
if (!isComplete)
return;
}
onExitComplete && onExitComplete();
},
register: (childId) => {
presenceChildren.set(childId, false);
return () => presenceChildren.delete(childId);
}
}),
/**
* If the presence of a child affects the layout of the components around it,
* we want to make a new context value to ensure they get re-rendered
* so they can detect that layout change.
*/
presenceAffectsLayout ? void 0 : [isPresent2]
);
(0, import_react53.useMemo)(() => {
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
}, [isPresent2]);
React6.useEffect(() => {
!isPresent2 && !presenceChildren.size && onExitComplete && onExitComplete();
}, [isPresent2]);
if (mode2 === "popLayout") {
children = React6.createElement(PopChild, { isPresent: isPresent2 }, children);
}
return React6.createElement(PresenceContext.Provider, { value: context }, children);
};
function newChildrenMap() {
return /* @__PURE__ */ new Map();
}
// ../../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs
var import_react54 = __toESM(require_react(), 1);
function useUnmountEffect(callback) {
return (0, import_react54.useEffect)(() => () => callback(), []);
}
// ../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
var getChildKey = (child) => child.key || "";
function updateChildLookup(children, allChildren) {
children.forEach((child) => {
const key = getChildKey(child);
allChildren.set(key, child);
});
}
function onlyElements(children) {
const filtered = [];
import_react55.Children.forEach(children, (child) => {
if ((0, import_react55.isValidElement)(child))
filtered.push(child);
});
return filtered;
}
var AnimatePresence = ({ children, custom, initial = true, onExitComplete, exitBeforeEnter, presenceAffectsLayout = true, mode: mode2 = "sync" }) => {
invariant(!exitBeforeEnter, "Replace exitBeforeEnter with mode='wait'");
const forceRender = (0, import_react55.useContext)(LayoutGroupContext).forceRender || useForceUpdate()[0];
const isMounted = useIsMounted();
const filteredChildren = onlyElements(children);
let childrenToRender = filteredChildren;
const exitingChildren = (0, import_react55.useRef)(/* @__PURE__ */ new Map()).current;
const presentChildren = (0, import_react55.useRef)(childrenToRender);
const allChildren = (0, import_react55.useRef)(/* @__PURE__ */ new Map()).current;
const isInitialRender = (0, import_react55.useRef)(true);
useIsomorphicLayoutEffect(() => {
isInitialRender.current = false;
updateChildLookup(filteredChildren, allChildren);
presentChildren.current = childrenToRender;
});
useUnmountEffect(() => {
isInitialRender.current = true;
allChildren.clear();
exitingChildren.clear();
});
if (isInitialRender.current) {
return React7.createElement(React7.Fragment, null, childrenToRender.map((child) => React7.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? void 0 : false, presenceAffectsLayout, mode: mode2 }, child)));
}
childrenToRender = [...childrenToRender];
const presentKeys = presentChildren.current.map(getChildKey);
const targetKeys = filteredChildren.map(getChildKey);
const numPresent = presentKeys.length;
for (let i = 0; i < numPresent; i++) {
const key = presentKeys[i];
if (targetKeys.indexOf(key) === -1 && !exitingChildren.has(key)) {
exitingChildren.set(key, void 0);
}
}
if (mode2 === "wait" && exitingChildren.size) {
childrenToRender = [];
}
exitingChildren.forEach((component, key) => {
if (targetKeys.indexOf(key) !== -1)
return;
const child = allChildren.get(key);
if (!child)
return;
const insertionIndex = presentKeys.indexOf(key);
let exitingComponent = component;
if (!exitingComponent) {
const onExit = () => {
exitingChildren.delete(key);
const leftOverKeys = Array.from(allChildren.keys()).filter((childKey) => !targetKeys.includes(childKey));
leftOverKeys.forEach((leftOverKey) => allChildren.delete(leftOverKey));
presentChildren.current = filteredChildren.filter((presentChild) => {
const presentChildKey = getChildKey(presentChild);
return (
// filter out the node exiting
presentChildKey === key || // filter out the leftover children
leftOverKeys.includes(presentChildKey)
);
});
if (!exitingChildren.size) {
if (isMounted.current === false)
return;
forceRender();
onExitComplete && onExitComplete();
}
};
exitingComponent = React7.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom, presenceAffectsLayout, mode: mode2 }, child);
exitingChildren.set(key, exitingComponent);
}
childrenToRender.splice(insertionIndex, 0, exitingComponent);
});
childrenToRender = childrenToRender.map((child) => {
const key = child.key;
return exitingChildren.has(key) ? child : React7.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout, mode: mode2 }, child);
});
if (mode2 === "wait" && childrenToRender.length > 1) {
console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
}
return React7.createElement(React7.Fragment, null, exitingChildren.size ? childrenToRender : childrenToRender.map((child) => (0, import_react55.cloneElement)(child)));
};
// ../../node_modules/framer-motion/dist/es/components/MotionConfig/index.mjs
var React8 = __toESM(require_react(), 1);
var import_react56 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/components/LazyMotion/index.mjs
var React9 = __toESM(require_react(), 1);
var import_react57 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/components/LayoutGroup/index.mjs
var React10 = __toESM(require_react(), 1);
var import_react59 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/context/DeprecatedLayoutGroupContext.mjs
var import_react58 = __toESM(require_react(), 1);
var DeprecatedLayoutGroupContext = (0, import_react58.createContext)(null);
// ../../node_modules/framer-motion/dist/es/components/Reorder/Group.mjs
var React11 = __toESM(require_react(), 1);
var import_react61 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/context/ReorderContext.mjs
var import_react60 = __toESM(require_react(), 1);
var ReorderContext = (0, import_react60.createContext)(null);
// ../../node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.mjs
function checkReorder(order2, value, offset2, velocity) {
if (!velocity)
return order2;
const index2 = order2.findIndex((item2) => item2.value === value);
if (index2 === -1)
return order2;
const nextOffset = velocity > 0 ? 1 : -1;
const nextItem = order2[index2 + nextOffset];
if (!nextItem)
return order2;
const item = order2[index2];
const nextLayout = nextItem.layout;
const nextItemCenter = mix2(nextLayout.min, nextLayout.max, 0.5);
if (nextOffset === 1 && item.layout.max + offset2 > nextItemCenter || nextOffset === -1 && item.layout.min + offset2 < nextItemCenter) {
return moveItem(order2, index2, index2 + nextOffset);
}
return order2;
}
// ../../node_modules/framer-motion/dist/es/components/Reorder/Group.mjs
function ReorderGroup({ children, as = "ul", axis = "y", onReorder, values, ...props }, externalRef) {
const Component2 = useConstant(() => motion(as));
const order2 = [];
const isReordering = (0, import_react61.useRef)(false);
invariant(Boolean(values), "Reorder.Group must be provided a values prop");
const context = {
axis,
registerItem: (value, layout3) => {
const idx = order2.findIndex((entry) => value === entry.value);
if (idx !== -1) {
order2[idx].layout = layout3[axis];
} else {
order2.push({ value, layout: layout3[axis] });
}
order2.sort(compareMin);
},
updateOrder: (item, offset2, velocity) => {
if (isReordering.current)
return;
const newOrder = checkReorder(order2, item, offset2, velocity);
if (order2 !== newOrder) {
isReordering.current = true;
onReorder(newOrder.map(getValue).filter((value) => values.indexOf(value) !== -1));
}
}
};
(0, import_react61.useEffect)(() => {
isReordering.current = false;
});
return React11.createElement(
Component2,
{ ...props, ref: externalRef, ignoreStrict: true },
React11.createElement(ReorderContext.Provider, { value: context }, children)
);
}
var Group = (0, import_react61.forwardRef)(ReorderGroup);
function getValue(item) {
return item.value;
}
function compareMin(a, b) {
return a.layout.min - b.layout.min;
}
// ../../node_modules/framer-motion/dist/es/components/Reorder/Item.mjs
var React12 = __toESM(require_react(), 1);
var import_react63 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/value/use-motion-value.mjs
var import_react62 = __toESM(require_react(), 1);
function useMotionValue(initial) {
const value = useConstant(() => motionValue(initial));
const { isStatic } = (0, import_react62.useContext)(MotionConfigContext);
if (isStatic) {
const [, setLatest] = (0, import_react62.useState)(initial);
(0, import_react62.useEffect)(() => value.on("change", setLatest), []);
}
return value;
}
// ../../node_modules/framer-motion/dist/es/utils/transform.mjs
var isCustomValueType = (v) => {
return v && typeof v === "object" && v.mix;
};
var getMixer2 = (v) => isCustomValueType(v) ? v.mix : void 0;
function transform2(...args) {
const useImmediate = !Array.isArray(args[0]);
const argOffset = useImmediate ? 0 : -1;
const inputValue = args[0 + argOffset];
const inputRange = args[1 + argOffset];
const outputRange = args[2 + argOffset];
const options = args[3 + argOffset];
const interpolator = interpolate(inputRange, outputRange, {
mixer: getMixer2(outputRange[0]),
...options
});
return useImmediate ? interpolator(inputValue) : interpolator;
}
// ../../node_modules/framer-motion/dist/es/value/use-combine-values.mjs
function useCombineMotionValues(values, combineValues) {
const value = useMotionValue(combineValues());
const updateValue = () => value.set(combineValues());
updateValue();
useIsomorphicLayoutEffect(() => {
const scheduleUpdate = () => frame2.update(updateValue, false, true);
const subscriptions = values.map((v) => v.on("change", scheduleUpdate));
return () => {
subscriptions.forEach((unsubscribe) => unsubscribe());
cancelFrame(updateValue);
};
});
return value;
}
// ../../node_modules/framer-motion/dist/es/value/use-computed.mjs
function useComputed(compute) {
collectMotionValues.current = [];
compute();
const value = useCombineMotionValues(collectMotionValues.current, compute);
collectMotionValues.current = void 0;
return value;
}
// ../../node_modules/framer-motion/dist/es/value/use-transform.mjs
function useTransform(input, inputRangeOrTransformer, outputRange, options) {
if (typeof input === "function") {
return useComputed(input);
}
const transformer = typeof inputRangeOrTransformer === "function" ? inputRangeOrTransformer : transform2(inputRangeOrTransformer, outputRange, options);
return Array.isArray(input) ? useListTransform(input, transformer) : useListTransform([input], ([latest]) => transformer(latest));
}
function useListTransform(values, transformer) {
const latest = useConstant(() => []);
return useCombineMotionValues(values, () => {
latest.length = 0;
const numValues = values.length;
for (let i = 0; i < numValues; i++) {
latest[i] = values[i].get();
}
return transformer(latest);
});
}
// ../../node_modules/framer-motion/dist/es/components/Reorder/Item.mjs
function useDefaultMotionValue(value, defaultValue = 0) {
return isMotionValue(value) ? value : useMotionValue(defaultValue);
}
function ReorderItem({ children, style = {}, value, as = "li", onDrag, layout: layout3 = true, ...props }, externalRef) {
const Component2 = useConstant(() => motion(as));
const context = (0, import_react63.useContext)(ReorderContext);
const point = {
x: useDefaultMotionValue(style.x),
y: useDefaultMotionValue(style.y)
};
const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group");
const { axis, registerItem, updateOrder } = context;
return React12.createElement(Component2, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout3, onDrag: (event, gesturePoint) => {
const { velocity } = gesturePoint;
velocity[axis] && updateOrder(value, point[axis].get(), velocity[axis]);
onDrag && onDrag(event, gesturePoint);
}, onLayoutMeasure: (measured) => registerItem(value, measured), ref: externalRef, ignoreStrict: true }, children);
}
var Item = (0, import_react63.forwardRef)(ReorderItem);
// ../../node_modules/framer-motion/dist/es/render/dom/features-animation.mjs
var domAnimation = {
renderer: createDomVisualElement,
...animations,
...gestureAnimations
};
// ../../node_modules/framer-motion/dist/es/render/dom/features-max.mjs
var domMax = {
...domAnimation,
...drag,
...layout2
};
// ../../node_modules/framer-motion/dist/es/value/use-spring.mjs
var import_react64 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/use-motion-value-event.mjs
var import_react65 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/value/use-scroll.mjs
var import_react66 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/dom/utils/resolve-element.mjs
function resolveElements(elements, scope, selectorCache) {
var _a8;
if (typeof elements === "string") {
let root = document;
if (scope) {
invariant(Boolean(scope.current), "Scope provided, but no element detected.");
root = scope.current;
}
if (selectorCache) {
(_a8 = selectorCache[elements]) !== null && _a8 !== void 0 ? _a8 : selectorCache[elements] = root.querySelectorAll(elements);
elements = selectorCache[elements];
} else {
elements = root.querySelectorAll(elements);
}
} else if (elements instanceof Element) {
elements = [elements];
}
return Array.from(elements || []);
}
// ../../node_modules/framer-motion/dist/es/utils/use-animation-frame.mjs
var import_react67 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs
var import_react68 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion-config.mjs
var import_react69 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/render/dom/scroll/observe.mjs
function observeTimeline(update, timeline) {
let prevProgress;
const onFrame = () => {
const { currentTime } = timeline;
const percentage = currentTime === null ? 0 : currentTime.value;
const progress3 = percentage / 100;
if (prevProgress !== progress3) {
update(progress3);
}
prevProgress = progress3;
};
frame2.update(onFrame, true);
return () => cancelFrame(onFrame);
}
// ../../node_modules/framer-motion/dist/es/render/dom/scroll/supports.mjs
var supportsScrollTimeline = memo(() => window.ScrollTimeline !== void 0);
// ../../node_modules/framer-motion/dist/es/animation/GroupPlaybackControls.mjs
var GroupPlaybackControls = class {
constructor(animations2) {
this.animations = animations2.filter(Boolean);
}
then(onResolve, onReject) {
return Promise.all(this.animations).then(onResolve).catch(onReject);
}
/**
* TODO: Filter out cancelled or stopped animations before returning
*/
getAll(propName) {
return this.animations[0][propName];
}
setAll(propName, newValue) {
for (let i = 0; i < this.animations.length; i++) {
this.animations[i][propName] = newValue;
}
}
attachTimeline(timeline) {
const cancelAll = this.animations.map((animation) => {
if (supportsScrollTimeline() && animation.attachTimeline) {
animation.attachTimeline(timeline);
} else {
animation.pause();
return observeTimeline((progress3) => {
animation.time = animation.duration * progress3;
}, timeline);
}
});
return () => {
cancelAll.forEach((cancelTimeline, i) => {
if (cancelTimeline)
cancelTimeline();
this.animations[i].stop();
});
};
}
get time() {
return this.getAll("time");
}
set time(time) {
this.setAll("time", time);
}
get speed() {
return this.getAll("speed");
}
set speed(speed) {
this.setAll("speed", speed);
}
get duration() {
let max2 = 0;
for (let i = 0; i < this.animations.length; i++) {
max2 = Math.max(max2, this.animations[i].duration);
}
return max2;
}
runAll(methodName) {
this.animations.forEach((controls) => controls[methodName]());
}
play() {
this.runAll("play");
}
pause() {
this.runAll("pause");
}
stop() {
this.runAll("stop");
}
cancel() {
this.runAll("cancel");
}
complete() {
this.runAll("complete");
}
};
// ../../node_modules/framer-motion/dist/es/animation/utils/is-dom-keyframes.mjs
function isDOMKeyframes(keyframes3) {
return typeof keyframes3 === "object" && !Array.isArray(keyframes3);
}
// ../../node_modules/framer-motion/dist/es/animation/utils/create-visual-element.mjs
function createVisualElement(element) {
const options = {
presenceContext: null,
props: {},
visualState: {
renderState: {
transform: {},
transformOrigin: {},
style: {},
vars: {},
attrs: {}
},
latestValues: {}
}
};
const node3 = isSVGElement(element) ? new SVGVisualElement(options, {
enableHardwareAcceleration: false
}) : new HTMLVisualElement(options, {
enableHardwareAcceleration: true
});
node3.mount(element);
visualElementStore.set(element, node3);
}
// ../../node_modules/framer-motion/dist/es/easing/utils/create-generator-easing.mjs
function createGeneratorEasing(options, scale3 = 100) {
const generator = spring({ keyframes: [0, scale3], ...options });
const duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
return {
type: "keyframes",
ease: (progress3) => generator.next(duration * progress3).value / scale3,
duration: millisecondsToSeconds(duration)
};
}
// ../../node_modules/framer-motion/dist/es/animation/sequence/utils/calc-time.mjs
function calcNextTime(current, next2, prev2, labels) {
var _a8;
if (typeof next2 === "number") {
return next2;
} else if (next2.startsWith("-") || next2.startsWith("+")) {
return Math.max(0, current + parseFloat(next2));
} else if (next2 === "<") {
return prev2;
} else {
return (_a8 = labels.get(next2)) !== null && _a8 !== void 0 ? _a8 : current;
}
}
// ../../node_modules/framer-motion/dist/es/utils/wrap.mjs
var wrap3 = (min2, max2, v) => {
const rangeSize = max2 - min2;
return ((v - min2) % rangeSize + rangeSize) % rangeSize + min2;
};
// ../../node_modules/framer-motion/dist/es/easing/utils/get-easing-for-segment.mjs
function getEasingForSegment(easing, i) {
return isEasingArray(easing) ? easing[wrap3(0, easing.length, i)] : easing;
}
// ../../node_modules/framer-motion/dist/es/animation/sequence/utils/edit.mjs
function eraseKeyframes(sequence, startTime, endTime) {
for (let i = 0; i < sequence.length; i++) {
const keyframe = sequence[i];
if (keyframe.at > startTime && keyframe.at < endTime) {
removeItem(sequence, keyframe);
i--;
}
}
}
function addKeyframes(sequence, keyframes3, easing, offset2, startTime, endTime) {
eraseKeyframes(sequence, startTime, endTime);
for (let i = 0; i < keyframes3.length; i++) {
sequence.push({
value: keyframes3[i],
at: mix2(startTime, endTime, offset2[i]),
easing: getEasingForSegment(easing, i)
});
}
}
// ../../node_modules/framer-motion/dist/es/animation/sequence/utils/sort.mjs
function compareByTime(a, b) {
if (a.at === b.at) {
if (a.value === null)
return 1;
if (b.value === null)
return -1;
return 0;
} else {
return a.at - b.at;
}
}
// ../../node_modules/framer-motion/dist/es/animation/sequence/create.mjs
var defaultSegmentEasing = "easeInOut";
function createAnimationsFromSequence(sequence, { defaultTransition: defaultTransition2 = {}, ...sequenceTransition } = {}, scope) {
const defaultDuration = defaultTransition2.duration || 0.3;
const animationDefinitions = /* @__PURE__ */ new Map();
const sequences = /* @__PURE__ */ new Map();
const elementCache = {};
const timeLabels = /* @__PURE__ */ new Map();
let prevTime = 0;
let currentTime = 0;
let totalDuration = 0;
for (let i = 0; i < sequence.length; i++) {
const segment = sequence[i];
if (typeof segment === "string") {
timeLabels.set(segment, currentTime);
continue;
} else if (!Array.isArray(segment)) {
timeLabels.set(segment.name, calcNextTime(currentTime, segment.at, prevTime, timeLabels));
continue;
}
let [subject, keyframes3, transition3 = {}] = segment;
if (transition3.at !== void 0) {
currentTime = calcNextTime(currentTime, transition3.at, prevTime, timeLabels);
}
let maxDuration3 = 0;
const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numElements = 0) => {
const valueKeyframesAsList = keyframesAsList(valueKeyframes);
const { delay: delay2 = 0, times = defaultOffset(valueKeyframesAsList), type = "keyframes", ...remainingTransition } = valueTransition;
let { ease: ease2 = defaultTransition2.ease || "easeOut", duration } = valueTransition;
const calculatedDelay = typeof delay2 === "function" ? delay2(elementIndex, numElements) : delay2;
const numKeyframes = valueKeyframesAsList.length;
if (numKeyframes <= 2 && type === "spring") {
let absoluteDelta = 100;
if (numKeyframes === 2 && isNumberKeyframesArray(valueKeyframesAsList)) {
const delta = valueKeyframesAsList[1] - valueKeyframesAsList[0];
absoluteDelta = Math.abs(delta);
}
const springTransition = { ...remainingTransition };
if (duration !== void 0) {
springTransition.duration = secondsToMilliseconds(duration);
}
const springEasing = createGeneratorEasing(springTransition, absoluteDelta);
ease2 = springEasing.ease;
duration = springEasing.duration;
}
duration !== null && duration !== void 0 ? duration : duration = defaultDuration;
const startTime = currentTime + calculatedDelay;
const targetTime = startTime + duration;
if (times.length === 1 && times[0] === 0) {
times[1] = 1;
}
const remainder = times.length - valueKeyframesAsList.length;
remainder > 0 && fillOffset(times, remainder);
valueKeyframesAsList.length === 1 && valueKeyframesAsList.unshift(null);
addKeyframes(valueSequence, valueKeyframesAsList, ease2, times, startTime, targetTime);
maxDuration3 = Math.max(calculatedDelay + duration, maxDuration3);
totalDuration = Math.max(targetTime, totalDuration);
};
if (isMotionValue(subject)) {
const subjectSequence = getSubjectSequence(subject, sequences);
resolveValueSequence(keyframes3, transition3, getValueSequence("default", subjectSequence));
} else {
const elements = resolveElements(subject, scope, elementCache);
const numElements = elements.length;
for (let elementIndex = 0; elementIndex < numElements; elementIndex++) {
keyframes3 = keyframes3;
transition3 = transition3;
const element = elements[elementIndex];
const subjectSequence = getSubjectSequence(element, sequences);
for (const key in keyframes3) {
resolveValueSequence(keyframes3[key], getValueTransition2(transition3, key), getValueSequence(key, subjectSequence), elementIndex, numElements);
}
}
}
prevTime = currentTime;
currentTime += maxDuration3;
}
sequences.forEach((valueSequences, element) => {
for (const key in valueSequences) {
const valueSequence = valueSequences[key];
valueSequence.sort(compareByTime);
const keyframes3 = [];
const valueOffset = [];
const valueEasing = [];
for (let i = 0; i < valueSequence.length; i++) {
const { at, value, easing } = valueSequence[i];
keyframes3.push(value);
valueOffset.push(progress(0, totalDuration, at));
valueEasing.push(easing || "easeOut");
}
if (valueOffset[0] !== 0) {
valueOffset.unshift(0);
keyframes3.unshift(keyframes3[0]);
valueEasing.unshift(defaultSegmentEasing);
}
if (valueOffset[valueOffset.length - 1] !== 1) {
valueOffset.push(1);
keyframes3.push(null);
}
if (!animationDefinitions.has(element)) {
animationDefinitions.set(element, {
keyframes: {},
transition: {}
});
}
const definition = animationDefinitions.get(element);
definition.keyframes[key] = keyframes3;
definition.transition[key] = {
...defaultTransition2,
duration: totalDuration,
ease: valueEasing,
times: valueOffset,
...sequenceTransition
};
}
});
return animationDefinitions;
}
function getSubjectSequence(subject, sequences) {
!sequences.has(subject) && sequences.set(subject, {});
return sequences.get(subject);
}
function getValueSequence(name, sequences) {
if (!sequences[name])
sequences[name] = [];
return sequences[name];
}
function keyframesAsList(keyframes3) {
return Array.isArray(keyframes3) ? keyframes3 : [keyframes3];
}
function getValueTransition2(transition3, key) {
return transition3[key] ? { ...transition3, ...transition3[key] } : { ...transition3 };
}
var isNumber2 = (keyframe) => typeof keyframe === "number";
var isNumberKeyframesArray = (keyframes3) => keyframes3.every(isNumber2);
// ../../node_modules/framer-motion/dist/es/animation/animate.mjs
function animateElements(elementOrSelector, keyframes3, options, scope) {
const elements = resolveElements(elementOrSelector, scope);
const numElements = elements.length;
invariant(Boolean(numElements), "No valid element provided.");
const animations2 = [];
for (let i = 0; i < numElements; i++) {
const element = elements[i];
if (!visualElementStore.has(element)) {
createVisualElement(element);
}
const visualElement = visualElementStore.get(element);
const transition3 = { ...options };
if (typeof transition3.delay === "function") {
transition3.delay = transition3.delay(i, numElements);
}
animations2.push(...animateTarget(visualElement, { ...keyframes3, transition: transition3 }, {}));
}
return new GroupPlaybackControls(animations2);
}
var isSequence = (value) => Array.isArray(value) && Array.isArray(value[0]);
function animateSequence(sequence, options, scope) {
const animations2 = [];
const animationDefinitions = createAnimationsFromSequence(sequence, options, scope);
animationDefinitions.forEach(({ keyframes: keyframes3, transition: transition3 }, subject) => {
let animation;
if (isMotionValue(subject)) {
animation = animateSingleValue(subject, keyframes3.default, transition3.default);
} else {
animation = animateElements(subject, keyframes3, transition3);
}
animations2.push(animation);
});
return new GroupPlaybackControls(animations2);
}
var createScopedAnimate = (scope) => {
function scopedAnimate(valueOrElementOrSequence, keyframes3, options) {
let animation;
if (isSequence(valueOrElementOrSequence)) {
animation = animateSequence(valueOrElementOrSequence, keyframes3, scope);
} else if (isDOMKeyframes(keyframes3)) {
animation = animateElements(valueOrElementOrSequence, keyframes3, options, scope);
} else {
animation = animateSingleValue(valueOrElementOrSequence, keyframes3, options);
}
if (scope) {
scope.animations.push(animation);
}
return animation;
}
return scopedAnimate;
};
var animate = createScopedAnimate();
// ../../node_modules/framer-motion/dist/es/utils/use-cycle.mjs
var import_react70 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/use-in-view.mjs
var import_react71 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/events/use-dom-event.mjs
var import_react72 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/utils/use-instant-transition.mjs
var import_react73 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/projection/use-reset-projection.mjs
var React13 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/animation/hooks/use-animated-state.mjs
var import_react74 = __toESM(require_react(), 1);
var createObject = () => ({});
var useVisualState = makeUseVisualState({
scrapeMotionValuesFromProps: createObject,
createRenderState: createObject
});
// ../../node_modules/framer-motion/dist/es/value/use-inverted-scale.mjs
var import_react75 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/components/AnimateSharedLayout.mjs
var React14 = __toESM(require_react(), 1);
// ../../node_modules/framer-motion/dist/es/frameloop/index-legacy.mjs
var cancelSync2 = stepsOrder2.reduce((acc, key) => {
acc[key] = (process2) => cancelFrame(process2);
return acc;
}, {});
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.provider.mjs
var import_react87 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.component.mjs
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
var import_react80 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.utils.mjs
var findById = (arr, id3) => arr.find((toast) => toast.id === id3);
function findToast(toasts, id3) {
const position3 = getToastPosition(toasts, id3);
const index2 = position3 ? toasts[position3].findIndex((toast) => toast.id === id3) : -1;
return {
position: position3,
index: index2
};
}
function getToastPosition(toasts, id3) {
for (const [position3, values] of Object.entries(toasts)) {
if (findById(values, id3)) {
return position3;
}
}
}
function getToastStyle(position3) {
const isRighty = position3.includes("right");
const isLefty = position3.includes("left");
let alignItems = "center";
if (isRighty)
alignItems = "flex-end";
if (isLefty)
alignItems = "flex-start";
return {
display: "flex",
flexDirection: "column",
alignItems
};
}
function getToastListStyle(position3) {
const isTopOrBottom = position3 === "top" || position3 === "bottom";
const margin = isTopOrBottom ? "0 auto" : void 0;
const top2 = position3.includes("top") ? "env(safe-area-inset-top, 0px)" : void 0;
const bottom2 = position3.includes("bottom") ? "env(safe-area-inset-bottom, 0px)" : void 0;
const right2 = !position3.includes("left") ? "env(safe-area-inset-right, 0px)" : void 0;
const left2 = !position3.includes("right") ? "env(safe-area-inset-left, 0px)" : void 0;
return {
position: "fixed",
zIndex: "var(--toast-z-index, 5500)",
pointerEvents: "none",
display: "flex",
flexDirection: "column",
margin,
top: top2,
bottom: bottom2,
right: right2,
left: left2
};
}
// ../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.development.esm.js
var React15 = __toESM(require_react());
// ../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
var reactPropsRegex2 = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
var isPropValid = memoize3(
function(prop) {
return reactPropsRegex2.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
// ../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.development.esm.js
var isDevelopment4 = true;
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent2(key) {
return key !== "theme";
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp2(tag) {
return typeof tag === "string" && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps2(tag, options, isReal) {
var shouldForwardProp2;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp2 = tag.__emotion_forwardProp && optionsShouldForwardProp ? function(propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp2 !== "function" && isReal) {
shouldForwardProp2 = tag.__emotion_forwardProp;
}
return shouldForwardProp2;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR2 = `You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
var Insertion5 = function Insertion6(_ref2) {
var cache = _ref2.cache, serialized = _ref2.serialized, isStringTag = _ref2.isStringTag;
registerStyles(cache, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function() {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var createStyled = function createStyled2(tag, options) {
{
if (tag === void 0) {
throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== void 0) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp2 = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp2 || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp("as");
return function() {
var args = arguments;
var styles2 = isReal && tag.__emotion_styles !== void 0 ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== void 0) {
styles2.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === void 0) {
styles2.push.apply(styles2, args);
} else {
var templateStringsArr = args[0];
if (templateStringsArr[0] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR2);
}
styles2.push(templateStringsArr[0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (templateStringsArr[i] === void 0) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR2);
}
styles2.push(args[i], templateStringsArr[i]);
}
}
var Styled = withEmotionCache(function(props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = "";
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React15.useContext(ThemeContext);
}
if (typeof props.className === "string") {
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(styles2.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== void 0) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp2 === void 0 ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === "as") continue;
if (finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
if (ref) {
newProps.ref = ref;
}
return React15.createElement(React15.Fragment, null, React15.createElement(Insertion5, {
cache,
serialized,
isStringTag: typeof FinalTag === "string"
}), React15.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== void 0 ? identifierName : "Styled(" + (typeof baseTag === "string" ? baseTag : baseTag.displayName || baseTag.name || "Component") + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles2;
Styled.__emotion_forwardProp = shouldForwardProp2;
Object.defineProperty(Styled, "toString", {
value: function value() {
if (targetClassName === void 0 && isDevelopment4) {
return "NO_COMPONENT_SELECTOR";
}
return "." + targetClassName;
}
});
Styled.withComponent = function(nextTag, nextOptions) {
var newStyled = createStyled2(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
}));
return newStyled.apply(void 0, styles2);
};
return Styled;
};
};
// ../../node_modules/@emotion/styled/dist/emotion-styled.browser.development.esm.js
var import_react78 = __toESM(require_react());
var tags = [
"a",
"abbr",
"address",
"area",
"article",
"aside",
"audio",
"b",
"base",
"bdi",
"bdo",
"big",
"blockquote",
"body",
"br",
"button",
"canvas",
"caption",
"cite",
"code",
"col",
"colgroup",
"data",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"embed",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"hr",
"html",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"legend",
"li",
"link",
"main",
"map",
"mark",
"marquee",
"menu",
"menuitem",
"meta",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"param",
"picture",
"pre",
"progress",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"small",
"source",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"track",
"u",
"ul",
"var",
"video",
"wbr",
// SVG
"circle",
"clipPath",
"defs",
"ellipse",
"foreignObject",
"g",
"image",
"line",
"linearGradient",
"mask",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"stop",
"svg",
"text",
"tspan"
];
var styled = createStyled.bind(null);
tags.forEach(function(tagName) {
styled[tagName] = styled(tagName);
});
// ../../node_modules/@chakra-ui/react/dist/esm/system/system.mjs
var import_react79 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/system/should-forward-prop.mjs
var allPropNames = /* @__PURE__ */ new Set([
...propNames,
"textStyle",
"layerStyle",
"apply",
"noOfLines",
"focusBorderColor",
"errorBorderColor",
"as",
"__css",
"css",
"sx"
]);
var validHTMLProps = /* @__PURE__ */ new Set([
"htmlWidth",
"htmlHeight",
"htmlSize",
"htmlTranslate"
]);
function shouldForwardProp(prop) {
return (validHTMLProps.has(prop) || !allPropNames.has(prop)) && prop[0] !== "_";
}
// ../../node_modules/@chakra-ui/react/dist/esm/system/system.mjs
var emotion_styled = interopDefault(styled);
var toCSSObject = ({ baseStyle: baseStyle44 }) => (props) => {
const { theme: theme2, css: cssProp, __css, sx, ...restProps } = props;
const [styleProps2] = splitProps(restProps, isStyleProp);
const finalBaseStyle = runIfFn(baseStyle44, props);
const finalStyles = assignAfter(
{},
__css,
finalBaseStyle,
compact(styleProps2),
sx
);
const computedCSS = css(finalStyles)(props.theme);
return cssProp ? [computedCSS, cssProp] : computedCSS;
};
function styled2(component, options) {
const { baseStyle: baseStyle44, ...styledOptions } = options ?? {};
if (!styledOptions.shouldForwardProp) {
styledOptions.shouldForwardProp = shouldForwardProp;
}
const styleObject = toCSSObject({ baseStyle: baseStyle44 });
const Component2 = emotion_styled(
component,
styledOptions
)(styleObject);
const chakraComponent = (0, import_react79.forwardRef)(
function ChakraComponent2(props, ref) {
const { children, ...restProps } = props;
const { colorMode, forced } = useColorMode();
const dataTheme = forced ? colorMode : void 0;
return (0, import_react79.createElement)(
Component2,
{ ref, "data-theme": dataTheme, ...restProps },
children
);
}
);
return chakraComponent;
}
// ../../node_modules/@chakra-ui/react/dist/esm/system/factory.mjs
function factory() {
const cache = /* @__PURE__ */ new Map();
return new Proxy(styled2, {
/**
* @example
* const Div = chakra("div")
* const WithChakra = chakra(AnotherComponent)
*/
apply(target, thisArg, argArray) {
return styled2(...argArray);
},
/**
* @example
*
*/
get(_, element) {
if (!cache.has(element)) {
cache.set(element, styled2(element));
}
return cache.get(element);
}
});
}
var chakra = factory();
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.component.mjs
var toastMotionVariants = {
initial: (props) => {
const { position: position3 } = props;
const dir = ["top", "bottom"].includes(position3) ? "y" : "x";
let factor = ["top-right", "bottom-right"].includes(position3) ? 1 : -1;
if (position3 === "bottom")
factor = 1;
return {
opacity: 0,
[dir]: factor * 24
};
},
animate: {
opacity: 1,
y: 0,
x: 0,
scale: 1,
transition: {
duration: 0.4,
ease: [0.4, 0, 0.2, 1]
}
},
exit: {
opacity: 0,
scale: 0.85,
transition: {
duration: 0.2,
ease: [0.4, 0, 1, 1]
}
}
};
var ToastComponent = (0, import_react80.memo)((props) => {
const {
id: id3,
message,
onCloseComplete,
onRequestRemove,
requestClose = false,
position: position3 = "bottom",
duration = 5e3,
containerStyle,
motionVariants: motionVariants2 = toastMotionVariants,
toastSpacing = "0.5rem"
} = props;
const [delay2, setDelay] = (0, import_react80.useState)(duration);
const isPresent2 = useIsPresent();
useUpdateEffect(() => {
if (!isPresent2) {
onCloseComplete == null ? void 0 : onCloseComplete();
}
}, [isPresent2]);
useUpdateEffect(() => {
setDelay(duration);
}, [duration]);
const onMouseEnter = () => setDelay(null);
const onMouseLeave = () => setDelay(duration);
const close = () => {
if (isPresent2)
onRequestRemove();
};
(0, import_react80.useEffect)(() => {
if (isPresent2 && requestClose) {
onRequestRemove();
}
}, [isPresent2, requestClose, onRequestRemove]);
useTimeout(close, delay2);
const containerStyles = (0, import_react80.useMemo)(
() => ({
pointerEvents: "auto",
maxWidth: 560,
minWidth: 300,
margin: toastSpacing,
...containerStyle
}),
[containerStyle, toastSpacing]
);
const toastStyle = (0, import_react80.useMemo)(() => getToastStyle(position3), [position3]);
return (0, import_jsx_runtime7.jsx)(
motion.div,
{
layout: true,
className: "chakra-toast",
variants: motionVariants2,
initial: "initial",
animate: "animate",
exit: "exit",
onHoverStart: onMouseEnter,
onHoverEnd: onMouseLeave,
custom: { position: position3 },
style: toastStyle,
children: (0, import_jsx_runtime7.jsx)(
chakra.div,
{
role: "status",
"aria-atomic": "true",
className: "chakra-toast__inner",
__css: containerStyles,
children: runIfFn(message, { id: id3, onClose: close })
}
)
}
);
});
ToastComponent.displayName = "ToastComponent";
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.mjs
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-icons.mjs
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/system/forward-ref.mjs
var import_react81 = __toESM(require_react(), 1);
function forwardRef7(component) {
return (0, import_react81.forwardRef)(component);
}
// ../../node_modules/@chakra-ui/react/dist/esm/system/use-style-config.mjs
var import_react84 = __toESM(require_react(), 1);
var import_react_fast_compare = __toESM(require_react_fast_compare(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/system/use-theme.mjs
var import_react83 = __toESM(require_react(), 1);
function useTheme2() {
const theme2 = (0, import_react83.useContext)(
ThemeContext
);
if (!theme2) {
throw Error(
"useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``"
);
}
return theme2;
}
// ../../node_modules/@chakra-ui/react/dist/esm/system/hooks.mjs
function useChakra() {
const colorModeResult = useColorMode();
const theme2 = useTheme2();
return { ...colorModeResult, theme: theme2 };
}
function getBreakpointValue(theme2, value, fallback) {
if (value == null)
return value;
const getValue2 = (val) => {
var _a8, _b3;
return (_b3 = (_a8 = theme2.__breakpoints) == null ? void 0 : _a8.asArray) == null ? void 0 : _b3[val];
};
return getValue2(value) ?? getValue2(fallback) ?? fallback;
}
function getTokenValue(theme2, value, fallback) {
if (value == null)
return value;
const getValue2 = (val) => {
var _a8, _b3;
return (_b3 = (_a8 = theme2.__cssMap) == null ? void 0 : _a8[val]) == null ? void 0 : _b3.value;
};
return getValue2(value) ?? getValue2(fallback) ?? fallback;
}
function useToken(scale3, token2, fallback) {
const theme2 = useTheme2();
return getToken(scale3, token2, fallback)(theme2);
}
function getToken(scale3, token2, fallback) {
const _token = Array.isArray(token2) ? token2 : [token2];
const _fallback = Array.isArray(fallback) ? fallback : [fallback];
return (theme2) => {
const fallbackArr = _fallback.filter(Boolean);
const result = _token.map((token22, index2) => {
if (scale3 === "breakpoints") {
return getBreakpointValue(theme2, token22, fallbackArr[index2] ?? token22);
}
const path = `${scale3}.${token22}`;
return getTokenValue(theme2, path, fallbackArr[index2] ?? token22);
});
return Array.isArray(token2) ? result : result[0];
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/system/use-style-config.mjs
function omitReactElements(props) {
return Object.fromEntries(
Object.entries(props).filter(([key, value]) => {
return value !== void 0 && key !== "children" && !(0, import_react84.isValidElement)(value);
})
);
}
function useStyleConfigImpl(themeKey, props = {}) {
const { styleConfig: styleConfigProp, ...rest } = props;
const { theme: theme2, colorMode } = useChakra();
const themeStyleConfig = themeKey ? memoizedGet(theme2, `components.${themeKey}`) : void 0;
const styleConfig = styleConfigProp || themeStyleConfig;
const mergedProps = (0, import_lodash.default)(
{ theme: theme2, colorMode },
(styleConfig == null ? void 0 : styleConfig.defaultProps) ?? {},
omitReactElements(rest),
(obj, src) => !obj ? src : void 0
);
const stylesRef = (0, import_react84.useRef)({});
if (styleConfig) {
const getStyles4 = resolveStyleConfig(styleConfig);
const styles2 = getStyles4(mergedProps);
const isStyleEqual = (0, import_react_fast_compare.default)(stylesRef.current, styles2);
if (!isStyleEqual) {
stylesRef.current = styles2;
}
}
return stylesRef.current;
}
function useStyleConfig(themeKey, props = {}) {
return useStyleConfigImpl(themeKey, props);
}
function useMultiStyleConfig(themeKey, props = {}) {
return useStyleConfigImpl(themeKey, props);
}
// ../../node_modules/@chakra-ui/react/dist/esm/icon/icon.mjs
var fallbackIcon = {
path: (0, import_jsx_runtime8.jsxs)("g", { stroke: "currentColor", strokeWidth: "1.5", children: [
(0, import_jsx_runtime8.jsx)(
"path",
{
strokeLinecap: "round",
fill: "none",
d: "M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
}
),
(0, import_jsx_runtime8.jsx)(
"path",
{
fill: "currentColor",
strokeLinecap: "round",
d: "M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
}
),
(0, import_jsx_runtime8.jsx)("circle", { fill: "none", strokeMiterlimit: "10", cx: "12", cy: "12", r: "11.25" })
] }),
viewBox: "0 0 24 24"
};
var Icon = forwardRef7((props, ref) => {
const {
as: element,
viewBox,
color: color3 = "currentColor",
focusable = false,
children,
className,
__css,
...rest
} = props;
const _className = cx("chakra-icon", className);
const customStyles = useStyleConfig("Icon", props);
const styles2 = {
w: "1em",
h: "1em",
display: "inline-block",
lineHeight: "1em",
flexShrink: 0,
color: color3,
...__css,
...customStyles
};
const shared = {
ref,
focusable,
className: _className,
__css: styles2
};
const _viewBox = viewBox ?? fallbackIcon.viewBox;
if (element && typeof element !== "string") {
return (0, import_jsx_runtime8.jsx)(chakra.svg, { as: element, ...shared, ...rest });
}
const _path = children ?? fallbackIcon.path;
return (0, import_jsx_runtime8.jsx)(chakra.svg, { verticalAlign: "middle", viewBox: _viewBox, ...shared, ...rest, children: _path });
});
Icon.displayName = "Icon";
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-icons.mjs
function CheckIcon(props) {
return (0, import_jsx_runtime9.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: (0, import_jsx_runtime9.jsx)(
"path",
{
fill: "currentColor",
d: "M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"
}
) });
}
function InfoIcon(props) {
return (0, import_jsx_runtime9.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: (0, import_jsx_runtime9.jsx)(
"path",
{
fill: "currentColor",
d: "M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"
}
) });
}
function WarningIcon(props) {
return (0, import_jsx_runtime9.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: (0, import_jsx_runtime9.jsx)(
"path",
{
fill: "currentColor",
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
}
) });
}
// ../../node_modules/@chakra-ui/react/dist/esm/spinner/spinner.mjs
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
var spin = keyframes({
"0%": {
transform: "rotate(0deg)"
},
"100%": {
transform: "rotate(360deg)"
}
});
var Spinner = forwardRef7((props, ref) => {
const styles2 = useStyleConfig("Spinner", props);
const {
label = "Loading...",
thickness = "2px",
speed = "0.45s",
emptyColor = "transparent",
className,
...rest
} = omitThemingProps(props);
const _className = cx("chakra-spinner", className);
const spinnerStyles = {
display: "inline-block",
borderColor: "currentColor",
borderStyle: "solid",
borderRadius: "99999px",
borderWidth: thickness,
borderBottomColor: emptyColor,
borderLeftColor: emptyColor,
animation: `${spin} ${speed} linear infinite`,
...styles2
};
return (0, import_jsx_runtime10.jsx)(
chakra.div,
{
ref,
__css: spinnerStyles,
className: _className,
...rest,
children: label && (0, import_jsx_runtime10.jsx)(chakra.span, { srOnly: true, children: label })
}
);
});
Spinner.displayName = "Spinner";
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-context.mjs
var [AlertProvider, useAlertContext] = createContext({
name: "AlertContext",
hookName: "useAlertContext",
providerName: ""
});
var [AlertStylesProvider, useAlertStyles] = createContext({
name: `AlertStylesContext`,
hookName: `useAlertStyles`,
providerName: ""
});
var STATUSES = {
info: { icon: InfoIcon, colorScheme: "blue" },
warning: { icon: WarningIcon, colorScheme: "orange" },
success: { icon: CheckIcon, colorScheme: "green" },
error: { icon: WarningIcon, colorScheme: "red" },
loading: { icon: Spinner, colorScheme: "blue" }
};
function getStatusColorScheme(status) {
return STATUSES[status].colorScheme;
}
function getStatusIcon(status) {
return STATUSES[status].icon;
}
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert.mjs
var Alert = forwardRef7(function Alert2(props, ref) {
const { status = "info", addRole = true, ...rest } = omitThemingProps(props);
const colorScheme = props.colorScheme ?? getStatusColorScheme(status);
const styles2 = useMultiStyleConfig("Alert", { ...props, colorScheme });
const alertStyles = defineStyle({
width: "100%",
display: "flex",
alignItems: "center",
position: "relative",
overflow: "hidden",
...styles2.container
});
return (0, import_jsx_runtime11.jsx)(AlertProvider, { value: { status }, children: (0, import_jsx_runtime11.jsx)(AlertStylesProvider, { value: styles2, children: (0, import_jsx_runtime11.jsx)(
chakra.div,
{
"data-status": status,
role: addRole ? "alert" : void 0,
ref,
...rest,
className: cx("chakra-alert", props.className),
__css: alertStyles
}
) }) });
});
Alert.displayName = "Alert";
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-icon.mjs
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
function AlertIcon(props) {
const { status } = useAlertContext();
const BaseIcon = getStatusIcon(status);
const styles2 = useAlertStyles();
const css4 = status === "loading" ? styles2.spinner : styles2.icon;
return (0, import_jsx_runtime12.jsx)(
chakra.span,
{
display: "inherit",
"data-status": status,
...props,
className: cx("chakra-alert__icon", props.className),
__css: css4,
children: props.children || (0, import_jsx_runtime12.jsx)(BaseIcon, { h: "100%", w: "100%" })
}
);
}
AlertIcon.displayName = "AlertIcon";
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-title.mjs
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var AlertTitle = forwardRef7(
function AlertTitle2(props, ref) {
const styles2 = useAlertStyles();
const { status } = useAlertContext();
return (0, import_jsx_runtime13.jsx)(
chakra.div,
{
ref,
"data-status": status,
...props,
className: cx("chakra-alert__title", props.className),
__css: styles2.title
}
);
}
);
AlertTitle.displayName = "AlertTitle";
// ../../node_modules/@chakra-ui/react/dist/esm/alert/alert-description.mjs
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var AlertDescription = forwardRef7(
function AlertDescription2(props, ref) {
const { status } = useAlertContext();
const styles2 = useAlertStyles();
const descriptionStyles = defineStyle({
display: "inline",
...styles2.description
});
return (0, import_jsx_runtime14.jsx)(
chakra.div,
{
ref,
"data-status": status,
...props,
className: cx("chakra-alert__desc", props.className),
__css: descriptionStyles
}
);
}
);
AlertDescription.displayName = "AlertDescription";
// ../../node_modules/@chakra-ui/react/dist/esm/close-button/close-button.mjs
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
function CloseIcon(props) {
return (0, import_jsx_runtime15.jsx)(Icon, { focusable: "false", "aria-hidden": true, ...props, children: (0, import_jsx_runtime15.jsx)(
"path",
{
fill: "currentColor",
d: "M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"
}
) });
}
var CloseButton = forwardRef7(
function CloseButton2(props, ref) {
const styles2 = useStyleConfig("CloseButton", props);
const { children, isDisabled, __css, ...rest } = omitThemingProps(props);
const baseStyle44 = {
outline: 0,
display: "flex",
alignItems: "center",
justifyContent: "center",
flexShrink: 0
};
return (0, import_jsx_runtime15.jsx)(
chakra.button,
{
type: "button",
"aria-label": "Close",
ref,
disabled: isDisabled,
__css: {
...baseStyle44,
...styles2,
...__css
},
...rest,
children: children || (0, import_jsx_runtime15.jsx)(CloseIcon, { width: "1em", height: "1em" })
}
);
}
);
CloseButton.displayName = "CloseButton";
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.mjs
var Toast = (props) => {
const {
status,
variant = "solid",
id: id3,
title,
isClosable,
onClose,
description,
colorScheme,
icon
} = props;
const ids = id3 ? {
root: `toast-${id3}`,
title: `toast-${id3}-title`,
description: `toast-${id3}-description`
} : void 0;
return (0, import_jsx_runtime16.jsxs)(
Alert,
{
addRole: false,
status,
variant,
id: ids == null ? void 0 : ids.root,
alignItems: "start",
borderRadius: "md",
boxShadow: "lg",
paddingEnd: 8,
textAlign: "start",
width: "auto",
colorScheme,
children: [
(0, import_jsx_runtime16.jsx)(AlertIcon, { children: icon }),
(0, import_jsx_runtime16.jsxs)(chakra.div, { flex: "1", maxWidth: "100%", children: [
title && (0, import_jsx_runtime16.jsx)(AlertTitle, { id: ids == null ? void 0 : ids.title, children: title }),
description && (0, import_jsx_runtime16.jsx)(AlertDescription, { id: ids == null ? void 0 : ids.description, display: "block", children: description })
] }),
isClosable && (0, import_jsx_runtime16.jsx)(
CloseButton,
{
size: "sm",
onClick: onClose,
position: "absolute",
insetEnd: 1,
top: 1
}
)
]
}
);
};
function createRenderToast(options = {}) {
const { render, toastComponent: ToastComponent2 = Toast } = options;
const renderToast = (props) => {
if (typeof render === "function") {
return render({ ...props, ...options });
}
return (0, import_jsx_runtime16.jsx)(ToastComponent2, { ...props, ...options });
};
return renderToast;
}
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.store.mjs
var initialState = {
top: [],
"top-left": [],
"top-right": [],
"bottom-left": [],
bottom: [],
"bottom-right": []
};
var toastStore = createStore(initialState);
function createStore(initialState2) {
let state2 = initialState2;
const listeners = /* @__PURE__ */ new Set();
const setState = (setStateFn) => {
state2 = setStateFn(state2);
listeners.forEach((l) => l());
};
return {
getState: () => state2,
subscribe: (listener) => {
listeners.add(listener);
return () => {
setState(() => initialState2);
listeners.delete(listener);
};
},
/**
* Delete a toast record at its position
*/
removeToast: (id3, position3) => {
setState((prevState) => ({
...prevState,
// id may be string or number
// eslint-disable-next-line eqeqeq
[position3]: prevState[position3].filter((toast) => toast.id != id3)
}));
},
notify: (message, options) => {
const toast = createToast(message, options);
const { position: position3, id: id3 } = toast;
setState((prevToasts) => {
const isTop = position3.includes("top");
const toasts = isTop ? [toast, ...prevToasts[position3] ?? []] : [...prevToasts[position3] ?? [], toast];
return {
...prevToasts,
[position3]: toasts
};
});
return id3;
},
update: (id3, options) => {
if (!id3)
return;
setState((prevState) => {
const nextState = { ...prevState };
const { position: position3, index: index2 } = findToast(nextState, id3);
if (position3 && index2 !== -1) {
nextState[position3][index2] = {
...nextState[position3][index2],
...options,
message: createRenderToast(options)
};
}
return nextState;
});
},
closeAll: ({ positions } = {}) => {
setState((prev2) => {
const allPositions = [
"bottom",
"bottom-right",
"bottom-left",
"top",
"top-left",
"top-right"
];
const positionsToClose = positions ?? allPositions;
return positionsToClose.reduce(
(acc, position3) => {
acc[position3] = prev2[position3].map((toast) => ({
...toast,
requestClose: true
}));
return acc;
},
{ ...prev2 }
);
});
},
close: (id3) => {
setState((prevState) => {
const position3 = getToastPosition(prevState, id3);
if (!position3)
return prevState;
return {
...prevState,
[position3]: prevState[position3].map((toast) => {
if (toast.id == id3) {
return {
...toast,
requestClose: true
};
}
return toast;
})
};
});
},
isActive: (id3) => Boolean(findToast(toastStore.getState(), id3).position)
};
}
var counter = 0;
function createToast(message, options = {}) {
counter += 1;
const id3 = options.id ?? counter;
const position3 = options.position ?? "bottom";
return {
id: id3,
message,
position: position3,
duration: options.duration,
onCloseComplete: options.onCloseComplete,
onRequestRemove: () => toastStore.removeToast(String(id3), position3),
status: options.status,
requestClose: false,
containerStyle: options.containerStyle
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/portal/portal.mjs
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var import_react86 = __toESM(require_react(), 1);
var import_react_dom = __toESM(require_react_dom(), 1);
var [PortalContextProvider, usePortalContext] = createContext({
strict: false,
name: "PortalContext"
});
var PORTAL_CLASSNAME = "chakra-portal";
var PORTAL_SELECTOR = `.chakra-portal`;
var Container = (props) => (0, import_jsx_runtime17.jsx)(
"div",
{
className: "chakra-portal-zIndex",
style: {
position: "absolute",
zIndex: props.zIndex,
top: 0,
left: 0,
right: 0
// NB: Don't add `bottom: 0`, it makes the entire app unusable
// @see https://github.com/chakra-ui/chakra-ui/issues/3201
},
children: props.children
}
);
var DefaultPortal = (props) => {
const { appendToParentPortal, children } = props;
const [tempNode, setTempNode] = (0, import_react86.useState)(null);
const portal = (0, import_react86.useRef)(null);
const [, forceUpdate] = (0, import_react86.useState)({});
(0, import_react86.useEffect)(() => forceUpdate({}), []);
const parentPortal = usePortalContext();
const manager = usePortalManager();
useSafeLayoutEffect(() => {
if (!tempNode)
return;
const doc = tempNode.ownerDocument;
const host = appendToParentPortal ? parentPortal ?? doc.body : doc.body;
if (!host)
return;
portal.current = doc.createElement("div");
portal.current.className = PORTAL_CLASSNAME;
host.appendChild(portal.current);
forceUpdate({});
const portalNode = portal.current;
return () => {
if (host.contains(portalNode)) {
host.removeChild(portalNode);
}
};
}, [tempNode]);
const _children = (manager == null ? void 0 : manager.zIndex) ? (0, import_jsx_runtime17.jsx)(Container, { zIndex: manager == null ? void 0 : manager.zIndex, children }) : children;
return portal.current ? (0, import_react_dom.createPortal)(
(0, import_jsx_runtime17.jsx)(PortalContextProvider, { value: portal.current, children: _children }),
portal.current
) : (0, import_jsx_runtime17.jsx)(
"span",
{
ref: (el) => {
if (el)
setTempNode(el);
}
}
);
};
var ContainerPortal = (props) => {
const { children, containerRef, appendToParentPortal } = props;
const containerEl = containerRef.current;
const host = containerEl ?? (typeof window !== "undefined" ? document.body : void 0);
const portal = (0, import_react86.useMemo)(() => {
const node3 = containerEl == null ? void 0 : containerEl.ownerDocument.createElement("div");
if (node3)
node3.className = PORTAL_CLASSNAME;
return node3;
}, [containerEl]);
const [, forceUpdate] = (0, import_react86.useState)({});
useSafeLayoutEffect(() => forceUpdate({}), []);
useSafeLayoutEffect(() => {
if (!portal || !host)
return;
host.appendChild(portal);
return () => {
host.removeChild(portal);
};
}, [portal, host]);
if (host && portal) {
return (0, import_react_dom.createPortal)(
(0, import_jsx_runtime17.jsx)(PortalContextProvider, { value: appendToParentPortal ? portal : null, children }),
portal
);
}
return null;
};
function Portal(props) {
const portalProps = {
appendToParentPortal: true,
...props
};
const { containerRef, ...rest } = portalProps;
return containerRef ? (0, import_jsx_runtime17.jsx)(ContainerPortal, { containerRef, ...rest }) : (0, import_jsx_runtime17.jsx)(DefaultPortal, { ...rest });
}
Portal.className = PORTAL_CLASSNAME;
Portal.selector = PORTAL_SELECTOR;
Portal.displayName = "Portal";
// ../../node_modules/@chakra-ui/react/dist/esm/toast/toast.provider.mjs
var [ToastOptionProvider, useToastOptionContext] = createContext({
name: `ToastOptionsContext`,
strict: false
});
var ToastProvider = (props) => {
const state2 = (0, import_react87.useSyncExternalStore)(
toastStore.subscribe,
toastStore.getState,
toastStore.getState
);
const {
motionVariants: motionVariants2,
component: Component2 = ToastComponent,
portalProps,
animatePresenceProps
} = props;
const stateKeys = Object.keys(state2);
const toastList = stateKeys.map((position3) => {
const toasts = state2[position3];
return (0, import_jsx_runtime18.jsx)(
"div",
{
role: "region",
"aria-live": "polite",
"aria-label": `Notifications-${position3}`,
id: `chakra-toast-manager-${position3}`,
style: getToastListStyle(position3),
children: (0, import_jsx_runtime18.jsx)(AnimatePresence, { ...animatePresenceProps, initial: false, children: toasts.map((toast) => (0, import_jsx_runtime18.jsx)(
Component2,
{
motionVariants: motionVariants2,
...toast
},
toast.id
)) })
},
position3
);
});
return (0, import_jsx_runtime18.jsx)(Portal, { ...portalProps, children: toastList });
};
// ../../node_modules/@chakra-ui/react/dist/esm/provider/create-provider.mjs
var createProvider = (providerTheme) => {
return function ChakraProvider2({
children,
theme: theme2 = providerTheme,
toastOptions,
...restProps
}) {
return (0, import_jsx_runtime19.jsxs)(Provider, { theme: theme2, ...restProps, children: [
(0, import_jsx_runtime19.jsx)(ToastOptionProvider, { value: toastOptions == null ? void 0 : toastOptions.defaultOptions, children }),
(0, import_jsx_runtime19.jsx)(ToastProvider, { ...toastOptions })
] });
};
};
// ../../node_modules/@chakra-ui/react/dist/esm/chakra-base-provider.mjs
var ChakraBaseProvider = createProvider(baseTheme);
// ../../node_modules/@chakra-ui/react/dist/esm/chakra-provider.mjs
var ChakraProvider = createProvider(theme);
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion.mjs
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var import_react91 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/descendant/use-descendant.mjs
var import_react89 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/descendant/utils.mjs
var import_react88 = __toESM(require_react(), 1);
function sortNodes(nodes) {
return nodes.sort((a, b) => {
const compare = a.compareDocumentPosition(b);
if (compare & Node.DOCUMENT_POSITION_FOLLOWING || compare & Node.DOCUMENT_POSITION_CONTAINED_BY) {
return -1;
}
if (compare & Node.DOCUMENT_POSITION_PRECEDING || compare & Node.DOCUMENT_POSITION_CONTAINS) {
return 1;
}
if (compare & Node.DOCUMENT_POSITION_DISCONNECTED || compare & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC) {
throw Error("Cannot sort the given nodes.");
} else {
return 0;
}
});
}
var isElement = (el) => typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE;
function getNextIndex2(current, max2, loop) {
let next2 = current + 1;
if (loop && next2 >= max2)
next2 = 0;
return next2;
}
function getPrevIndex(current, max2, loop) {
let next2 = current - 1;
if (loop && next2 < 0)
next2 = max2;
return next2;
}
var useSafeLayoutEffect4 = typeof window !== "undefined" ? import_react88.useLayoutEffect : import_react88.useEffect;
var cast2 = (value) => value;
// ../../node_modules/@chakra-ui/react/dist/esm/descendant/descendant.mjs
var __defProp2 = Object.defineProperty;
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField2 = (obj, key, value) => {
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var DescendantsManager = class {
constructor() {
__publicField2(this, "descendants", /* @__PURE__ */ new Map());
__publicField2(this, "register", (nodeOrOptions) => {
if (nodeOrOptions == null)
return;
if (isElement(nodeOrOptions)) {
return this.registerNode(nodeOrOptions);
}
return (node3) => {
this.registerNode(node3, nodeOrOptions);
};
});
__publicField2(this, "unregister", (node3) => {
this.descendants.delete(node3);
const sorted = sortNodes(Array.from(this.descendants.keys()));
this.assignIndex(sorted);
});
__publicField2(this, "destroy", () => {
this.descendants.clear();
});
__publicField2(this, "assignIndex", (descendants) => {
this.descendants.forEach((descendant) => {
const index2 = descendants.indexOf(descendant.node);
descendant.index = index2;
descendant.node.dataset["index"] = descendant.index.toString();
});
});
__publicField2(this, "count", () => this.descendants.size);
__publicField2(this, "enabledCount", () => this.enabledValues().length);
__publicField2(this, "values", () => {
const values = Array.from(this.descendants.values());
return values.sort((a, b) => a.index - b.index);
});
__publicField2(this, "enabledValues", () => {
return this.values().filter((descendant) => !descendant.disabled);
});
__publicField2(this, "item", (index2) => {
if (this.count() === 0)
return void 0;
return this.values()[index2];
});
__publicField2(this, "enabledItem", (index2) => {
if (this.enabledCount() === 0)
return void 0;
return this.enabledValues()[index2];
});
__publicField2(this, "first", () => this.item(0));
__publicField2(this, "firstEnabled", () => this.enabledItem(0));
__publicField2(this, "last", () => this.item(this.descendants.size - 1));
__publicField2(this, "lastEnabled", () => {
const lastIndex = this.enabledValues().length - 1;
return this.enabledItem(lastIndex);
});
__publicField2(this, "indexOf", (node3) => {
var _a8;
if (!node3)
return -1;
return ((_a8 = this.descendants.get(node3)) == null ? void 0 : _a8.index) ?? -1;
});
__publicField2(this, "enabledIndexOf", (node3) => {
if (node3 == null)
return -1;
return this.enabledValues().findIndex((i) => i.node.isSameNode(node3));
});
__publicField2(this, "next", (index2, loop = true) => {
const next2 = getNextIndex2(index2, this.count(), loop);
return this.item(next2);
});
__publicField2(this, "nextEnabled", (index2, loop = true) => {
const item = this.item(index2);
if (!item)
return;
const enabledIndex = this.enabledIndexOf(item.node);
const nextEnabledIndex = getNextIndex2(
enabledIndex,
this.enabledCount(),
loop
);
return this.enabledItem(nextEnabledIndex);
});
__publicField2(this, "prev", (index2, loop = true) => {
const prev2 = getPrevIndex(index2, this.count() - 1, loop);
return this.item(prev2);
});
__publicField2(this, "prevEnabled", (index2, loop = true) => {
const item = this.item(index2);
if (!item)
return;
const enabledIndex = this.enabledIndexOf(item.node);
const prevEnabledIndex = getPrevIndex(
enabledIndex,
this.enabledCount() - 1,
loop
);
return this.enabledItem(prevEnabledIndex);
});
__publicField2(this, "registerNode", (node3, options) => {
if (!node3 || this.descendants.has(node3))
return;
const keys2 = Array.from(this.descendants.keys()).concat(node3);
const sorted = sortNodes(keys2);
if (options == null ? void 0 : options.disabled) {
options.disabled = !!options.disabled;
}
const descendant = { node: node3, index: -1, ...options };
this.descendants.set(node3, descendant);
this.assignIndex(sorted);
});
}
};
// ../../node_modules/@chakra-ui/react/dist/esm/descendant/use-descendant.mjs
function createDescendantContext() {
const [DescendantsContextProvider, useDescendantsContext] = createContext({
name: "DescendantsProvider",
errorMessage: "useDescendantsContext must be used within DescendantsProvider"
});
const useDescendant = (options) => {
const descendants = useDescendantsContext();
const [index2, setIndex] = (0, import_react89.useState)(-1);
const ref = (0, import_react89.useRef)(null);
useSafeLayoutEffect4(() => {
return () => {
if (!ref.current)
return;
descendants.unregister(ref.current);
};
}, []);
useSafeLayoutEffect4(() => {
if (!ref.current)
return;
const dataIndex = Number(ref.current.dataset["index"]);
if (index2 != dataIndex && !Number.isNaN(dataIndex)) {
setIndex(dataIndex);
}
});
const refCallback = options ? cast2(descendants.register(options)) : cast2(descendants.register);
return {
descendants,
index: index2,
enabledIndex: descendants.enabledIndexOf(ref.current),
register: mergeRefs(refCallback, ref)
};
};
const useDescendants = () => {
const descendants = (0, import_react89.useRef)(new DescendantsManager());
useSafeLayoutEffect4(() => {
return () => descendants.current.destroy();
});
return descendants.current;
};
return [
// context provider
DescendantsContextProvider,
// call this when you need to read from context
useDescendantsContext,
// descendants state information, to be called and passed to `ContextProvider`
useDescendants,
// descendant index information
useDescendant
];
}
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-context.mjs
var [AccordionStylesProvider, useAccordionStyles] = createContext({
name: "AccordionStylesContext",
hookName: "useAccordionStyles",
providerName: ""
});
var [AccordionItemProvider, useAccordionItemContext] = createContext({
name: "AccordionItemContext",
hookName: "useAccordionItemContext",
providerName: ""
});
var [
AccordionDescendantsProvider,
useAccordionDescendantsContext,
useAccordionDescendants,
useAccordionDescendant
] = createDescendantContext();
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/use-accordion.mjs
var import_react90 = __toESM(require_react(), 1);
function useAccordion(props) {
const {
onChange,
defaultIndex,
index: indexProp,
allowMultiple,
allowToggle,
...htmlProps
} = props;
allowMultipleWarning(props);
allowMultipleAndAllowToggleWarning(props);
const descendants = useAccordionDescendants();
const [focusedIndex, setFocusedIndex] = (0, import_react90.useState)(-1);
(0, import_react90.useEffect)(() => {
return () => {
setFocusedIndex(-1);
};
}, []);
const [index2, setIndex] = useControllableState({
value: indexProp,
defaultValue() {
if (allowMultiple)
return defaultIndex ?? [];
return defaultIndex ?? -1;
},
onChange
});
const getAccordionItemProps = (idx) => {
let isOpen = false;
if (idx !== null) {
isOpen = Array.isArray(index2) ? index2.includes(idx) : index2 === idx;
}
const onChange2 = (isOpen2) => {
if (idx === null)
return;
if (allowMultiple && Array.isArray(index2)) {
const nextState = isOpen2 ? index2.concat(idx) : index2.filter((i) => i !== idx);
setIndex(nextState);
} else if (isOpen2) {
setIndex(idx);
} else if (allowToggle) {
setIndex(-1);
}
};
return { isOpen, onChange: onChange2 };
};
return {
index: index2,
setIndex,
htmlProps,
getAccordionItemProps,
focusedIndex,
setFocusedIndex,
descendants
};
}
var [AccordionProvider, useAccordionContext] = createContext({
name: "AccordionContext",
hookName: "useAccordionContext",
providerName: "Accordion"
});
function useAccordionItem(props) {
const { isDisabled, isFocusable: isFocusable2, id: id3, ...htmlProps } = props;
const { getAccordionItemProps, setFocusedIndex } = useAccordionContext();
const buttonRef = (0, import_react90.useRef)(null);
const reactId = (0, import_react90.useId)();
const uid = id3 ?? reactId;
const buttonId = `accordion-button-${uid}`;
const panelId = `accordion-panel-${uid}`;
focusableNotDisabledWarning(props);
const { register, index: index2, descendants } = useAccordionDescendant({
disabled: isDisabled && !isFocusable2
});
const { isOpen, onChange } = getAccordionItemProps(
index2 === -1 ? null : index2
);
warnIfOpenAndDisabled({ isOpen, isDisabled });
const onOpen = () => {
onChange == null ? void 0 : onChange(true);
};
const onClose = () => {
onChange == null ? void 0 : onChange(false);
};
const onClick = (0, import_react90.useCallback)(() => {
onChange == null ? void 0 : onChange(!isOpen);
setFocusedIndex(index2);
}, [index2, setFocusedIndex, isOpen, onChange]);
const onKeyDown = (0, import_react90.useCallback)(
(event) => {
const keyMap = {
ArrowDown: () => {
const next2 = descendants.nextEnabled(index2);
next2 == null ? void 0 : next2.node.focus();
},
ArrowUp: () => {
const prev2 = descendants.prevEnabled(index2);
prev2 == null ? void 0 : prev2.node.focus();
},
Home: () => {
const first = descendants.firstEnabled();
first == null ? void 0 : first.node.focus();
},
End: () => {
const last = descendants.lastEnabled();
last == null ? void 0 : last.node.focus();
}
};
const action = keyMap[event.key];
if (action) {
event.preventDefault();
action(event);
}
},
[descendants, index2]
);
const onFocus3 = (0, import_react90.useCallback)(() => {
setFocusedIndex(index2);
}, [setFocusedIndex, index2]);
const getButtonProps = (0, import_react90.useCallback)(
function getButtonProps2(props2 = {}, ref = null) {
return {
...props2,
type: "button",
ref: mergeRefs(register, buttonRef, ref),
id: buttonId,
disabled: !!isDisabled,
"aria-expanded": !!isOpen,
"aria-controls": panelId,
onClick: callAllHandlers(props2.onClick, onClick),
onFocus: callAllHandlers(props2.onFocus, onFocus3),
onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDown)
};
},
[
buttonId,
isDisabled,
isOpen,
onClick,
onFocus3,
onKeyDown,
panelId,
register
]
);
const getPanelProps = (0, import_react90.useCallback)(
function getPanelProps2(props2 = {}, ref = null) {
return {
...props2,
ref,
role: "region",
id: panelId,
"aria-labelledby": buttonId,
hidden: !isOpen
};
},
[buttonId, isOpen, panelId]
);
return {
isOpen,
isDisabled,
isFocusable: isFocusable2,
onOpen,
onClose,
getButtonProps,
getPanelProps,
htmlProps
};
}
function allowMultipleWarning(props) {
const index2 = props.index || props.defaultIndex;
const condition = index2 != null && !Array.isArray(index2) && props.allowMultiple;
warn({
condition: !!condition,
message: `If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof index2},`
});
}
function allowMultipleAndAllowToggleWarning(props) {
warn({
condition: !!(props.allowMultiple && props.allowToggle),
message: `If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not`
});
}
function focusableNotDisabledWarning(props) {
warn({
condition: !!(props.isFocusable && !props.isDisabled),
message: `Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
`
});
}
function warnIfOpenAndDisabled(props) {
warn({
condition: props.isOpen && !!props.isDisabled,
message: "Cannot open a disabled accordion item"
});
}
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion.mjs
var Accordion = forwardRef7(function Accordion2({ children, reduceMotion, ...props }, ref) {
const styles2 = useMultiStyleConfig("Accordion", props);
const ownProps = omitThemingProps(props);
const { htmlProps, descendants, ...context } = useAccordion(ownProps);
const ctx = (0, import_react91.useMemo)(
() => ({ ...context, reduceMotion: !!reduceMotion }),
[context, reduceMotion]
);
return (0, import_jsx_runtime20.jsx)(AccordionDescendantsProvider, { value: descendants, children: (0, import_jsx_runtime20.jsx)(AccordionProvider, { value: ctx, children: (0, import_jsx_runtime20.jsx)(AccordionStylesProvider, { value: styles2, children: (0, import_jsx_runtime20.jsx)(
chakra.div,
{
ref,
...htmlProps,
className: cx("chakra-accordion", props.className),
__css: styles2.root,
children
}
) }) }) });
});
Accordion.displayName = "Accordion";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-button.mjs
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var AccordionButton = forwardRef7(
function AccordionButton2(props, ref) {
const { getButtonProps } = useAccordionItemContext();
const buttonProps = getButtonProps(props, ref);
const styles2 = useAccordionStyles();
const buttonStyles = {
display: "flex",
alignItems: "center",
width: "100%",
outline: 0,
...styles2.button
};
return (0, import_jsx_runtime21.jsx)(
chakra.button,
{
...buttonProps,
className: cx("chakra-accordion__button", props.className),
__css: buttonStyles
}
);
}
);
AccordionButton.displayName = "AccordionButton";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-icon.mjs
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
function AccordionIcon(props) {
const { isOpen, isDisabled } = useAccordionItemContext();
const { reduceMotion } = useAccordionContext();
const _className = cx("chakra-accordion__icon", props.className);
const styles2 = useAccordionStyles();
const iconStyles = {
opacity: isDisabled ? 0.4 : 1,
transform: isOpen ? "rotate(-180deg)" : void 0,
transition: reduceMotion ? void 0 : "transform 0.2s",
transformOrigin: "center",
...styles2.icon
};
return (0, import_jsx_runtime22.jsx)(
Icon,
{
viewBox: "0 0 24 24",
"aria-hidden": true,
className: _className,
__css: iconStyles,
...props,
children: (0, import_jsx_runtime22.jsx)(
"path",
{
fill: "currentColor",
d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"
}
)
}
);
}
AccordionIcon.displayName = "AccordionIcon";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-item.mjs
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var import_react92 = __toESM(require_react(), 1);
var AccordionItem = forwardRef7(
function AccordionItem2(props, ref) {
const { children, className } = props;
const { htmlProps, ...context } = useAccordionItem(props);
const styles2 = useAccordionStyles();
const containerStyles = defineStyle({
...styles2.container,
overflowAnchor: "none"
});
const ctx = (0, import_react92.useMemo)(() => context, [context]);
return (0, import_jsx_runtime23.jsx)(AccordionItemProvider, { value: ctx, children: (0, import_jsx_runtime23.jsx)(
chakra.div,
{
ref,
...htmlProps,
className: cx("chakra-accordion__item", className),
__css: containerStyles,
children: typeof children === "function" ? children({
isExpanded: !!context.isOpen,
isDisabled: !!context.isDisabled
}) : children
}
) });
}
);
AccordionItem.displayName = "AccordionItem";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-panel.mjs
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/transition/collapse.mjs
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
var import_react93 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/transition/transition-utils.mjs
var TRANSITION_EASINGS = {
ease: [0.25, 0.1, 0.25, 1],
easeIn: [0.4, 0, 1, 1],
easeOut: [0, 0, 0.2, 1],
easeInOut: [0.4, 0, 0.2, 1]
};
var TRANSITION_VARIANTS = {
scale: {
enter: { scale: 1 },
exit: { scale: 0.95 }
},
fade: {
enter: { opacity: 1 },
exit: { opacity: 0 }
},
pushLeft: {
enter: { x: "100%" },
exit: { x: "-30%" }
},
pushRight: {
enter: { x: "-100%" },
exit: { x: "30%" }
},
pushUp: {
enter: { y: "100%" },
exit: { y: "-30%" }
},
pushDown: {
enter: { y: "-100%" },
exit: { y: "30%" }
},
slideLeft: {
position: { left: 0, top: 0, bottom: 0, width: "100%" },
enter: { x: 0, y: 0 },
exit: { x: "-100%", y: 0 }
},
slideRight: {
position: { right: 0, top: 0, bottom: 0, width: "100%" },
enter: { x: 0, y: 0 },
exit: { x: "100%", y: 0 }
},
slideUp: {
position: { top: 0, left: 0, right: 0, maxWidth: "100vw" },
enter: { x: 0, y: 0 },
exit: { x: 0, y: "-100%" }
},
slideDown: {
position: { bottom: 0, left: 0, right: 0, maxWidth: "100vw" },
enter: { x: 0, y: 0 },
exit: { x: 0, y: "100%" }
}
};
function getSlideTransition(options) {
const side = (options == null ? void 0 : options.direction) ?? "right";
switch (side) {
case "right":
return TRANSITION_VARIANTS.slideRight;
case "left":
return TRANSITION_VARIANTS.slideLeft;
case "bottom":
return TRANSITION_VARIANTS.slideDown;
case "top":
return TRANSITION_VARIANTS.slideUp;
default:
return TRANSITION_VARIANTS.slideRight;
}
}
var TRANSITION_DEFAULTS = {
enter: {
duration: 0.2,
ease: TRANSITION_EASINGS.easeOut
},
exit: {
duration: 0.1,
ease: TRANSITION_EASINGS.easeIn
}
};
var withDelay = {
enter: (transition3, delay2) => ({
...transition3,
delay: typeof delay2 === "number" ? delay2 : delay2 == null ? void 0 : delay2["enter"]
}),
exit: (transition3, delay2) => ({
...transition3,
delay: typeof delay2 === "number" ? delay2 : delay2 == null ? void 0 : delay2["exit"]
})
};
// ../../node_modules/@chakra-ui/react/dist/esm/transition/collapse.mjs
var isNumeric2 = (value) => value != null && parseInt(value.toString(), 10) > 0;
var defaultTransitions = {
exit: {
height: { duration: 0.2, ease: TRANSITION_EASINGS.ease },
opacity: { duration: 0.3, ease: TRANSITION_EASINGS.ease }
},
enter: {
height: { duration: 0.3, ease: TRANSITION_EASINGS.ease },
opacity: { duration: 0.4, ease: TRANSITION_EASINGS.ease }
}
};
var variants13 = {
exit: ({
animateOpacity,
startingHeight,
transition: transition3,
transitionEnd,
delay: delay2
}) => ({
...animateOpacity && { opacity: isNumeric2(startingHeight) ? 1 : 0 },
height: startingHeight,
transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit,
transition: (transition3 == null ? void 0 : transition3.exit) ?? withDelay.exit(defaultTransitions.exit, delay2)
}),
enter: ({
animateOpacity,
endingHeight,
transition: transition3,
transitionEnd,
delay: delay2
}) => ({
...animateOpacity && { opacity: 1 },
height: endingHeight,
transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter,
transition: (transition3 == null ? void 0 : transition3.enter) ?? withDelay.enter(defaultTransitions.enter, delay2)
})
};
var Collapse = (0, import_react93.forwardRef)(
(props, ref) => {
const {
in: isOpen,
unmountOnExit,
animateOpacity = true,
startingHeight = 0,
endingHeight = "auto",
style,
className,
transition: transition3,
transitionEnd,
animatePresenceProps,
...rest
} = props;
const [mounted, setMounted] = (0, import_react93.useState)(false);
(0, import_react93.useEffect)(() => {
const timeout = setTimeout(() => {
setMounted(true);
});
return () => clearTimeout(timeout);
}, []);
warn({
condition: Number(startingHeight) > 0 && !!unmountOnExit,
message: `startingHeight and unmountOnExit are mutually exclusive. You can't use them together`
});
const hasStartingHeight = parseFloat(startingHeight.toString()) > 0;
const custom = {
startingHeight,
endingHeight,
animateOpacity,
transition: !mounted ? { enter: { duration: 0 } } : transition3,
transitionEnd: {
enter: transitionEnd == null ? void 0 : transitionEnd.enter,
exit: unmountOnExit ? transitionEnd == null ? void 0 : transitionEnd.exit : {
...transitionEnd == null ? void 0 : transitionEnd.exit,
display: hasStartingHeight ? "block" : "none"
}
}
};
const show = unmountOnExit ? isOpen : true;
const animate2 = isOpen || unmountOnExit ? "enter" : "exit";
return (0, import_jsx_runtime24.jsx)(
AnimatePresence,
{
...animatePresenceProps,
initial: false,
custom,
children: show && (0, import_jsx_runtime24.jsx)(
motion.div,
{
ref,
...rest,
className: cx("chakra-collapse", className),
style: {
overflow: "hidden",
display: "block",
...style
},
custom,
variants: variants13,
initial: unmountOnExit ? "exit" : false,
animate: animate2,
exit: "exit"
}
)
}
);
}
);
Collapse.displayName = "Collapse";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/accordion-panel.mjs
var AccordionPanel = forwardRef7(
function AccordionPanel2(props, ref) {
const { className, motionProps, ...rest } = props;
const { reduceMotion } = useAccordionContext();
const { getPanelProps, isOpen } = useAccordionItemContext();
const panelProps = getPanelProps(rest, ref);
const _className = cx("chakra-accordion__panel", className);
const styles2 = useAccordionStyles();
if (!reduceMotion) {
delete panelProps.hidden;
}
const child = (0, import_jsx_runtime25.jsx)(chakra.div, { ...panelProps, __css: styles2.panel, className: _className });
if (!reduceMotion) {
return (0, import_jsx_runtime25.jsx)(Collapse, { in: isOpen, ...motionProps, children: child });
}
return child;
}
);
AccordionPanel.displayName = "AccordionPanel";
// ../../node_modules/@chakra-ui/react/dist/esm/accordion/use-accordion-item-state.mjs
function useAccordionItemState() {
const { isOpen, isDisabled, onClose, onOpen } = useAccordionItemContext();
return { isOpen, onClose, isDisabled, onOpen };
}
// ../../node_modules/@chakra-ui/react/dist/esm/aspect-ratio/aspect-ratio.mjs
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
var import_react94 = __toESM(require_react(), 1);
var AspectRatio = forwardRef7(
function(props, ref) {
const { ratio = 4 / 3, children, className, ...rest } = props;
const child = import_react94.Children.only(children);
const _className = cx("chakra-aspect-ratio", className);
return (0, import_jsx_runtime26.jsx)(
chakra.div,
{
ref,
position: "relative",
className: _className,
_before: {
height: 0,
content: `""`,
display: "block",
paddingBottom: mapResponsive(ratio, (r2) => `${1 / r2 * 100}%`)
},
__css: {
"& > *:not(style)": {
overflow: "hidden",
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "100%"
},
"& > img, & > video": {
objectFit: "cover"
}
},
...rest,
children: child
}
);
}
);
AspectRatio.displayName = "AspectRatio";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var import_react97 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-context.mjs
var [AvatarStylesProvider, useAvatarStyles] = createContext({
name: `AvatarStylesContext`,
hookName: `useAvatarStyles`,
providerName: ""
});
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-image.mjs
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var import_react96 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-name.mjs
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
function initials(name) {
const names = name.trim().split(" ");
const firstName = names[0] ?? "";
const lastName = names.length > 1 ? names[names.length - 1] : "";
return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
}
function AvatarName(props) {
const { name, getInitials, ...rest } = props;
const styles2 = useAvatarStyles();
return (0, import_jsx_runtime27.jsx)(chakra.div, { role: "img", "aria-label": name, ...rest, __css: styles2.label, children: name ? getInitials == null ? void 0 : getInitials(name) : null });
}
AvatarName.displayName = "AvatarName";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/generic-avatar-icon.mjs
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var GenericAvatarIcon = (props) => (0, import_jsx_runtime28.jsxs)(
chakra.svg,
{
viewBox: "0 0 128 128",
color: "#fff",
width: "100%",
height: "100%",
className: "chakra-avatar__svg",
...props,
children: [
(0, import_jsx_runtime28.jsx)(
"path",
{
fill: "currentColor",
d: "M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"
}
),
(0, import_jsx_runtime28.jsx)(
"path",
{
fill: "currentColor",
d: "M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"
}
)
]
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/image/use-image.mjs
var import_react95 = __toESM(require_react(), 1);
function useImage(props) {
const {
loading,
src,
srcSet,
onLoad,
onError,
crossOrigin,
sizes: sizes24,
ignoreFallback
} = props;
const [status, setStatus] = (0, import_react95.useState)("pending");
(0, import_react95.useEffect)(() => {
setStatus(src ? "loading" : "pending");
}, [src]);
const imageRef = (0, import_react95.useRef)(null);
const load = (0, import_react95.useCallback)(() => {
if (!src)
return;
flush();
const img = new Image();
img.src = src;
if (crossOrigin)
img.crossOrigin = crossOrigin;
if (srcSet)
img.srcset = srcSet;
if (sizes24)
img.sizes = sizes24;
if (loading)
img.loading = loading;
img.onload = (event) => {
flush();
setStatus("loaded");
onLoad == null ? void 0 : onLoad(event);
};
img.onerror = (error) => {
flush();
setStatus("failed");
onError == null ? void 0 : onError(error);
};
imageRef.current = img;
}, [src, crossOrigin, srcSet, sizes24, onLoad, onError, loading]);
const flush = () => {
if (imageRef.current) {
imageRef.current.onload = null;
imageRef.current.onerror = null;
imageRef.current = null;
}
};
useSafeLayoutEffect(() => {
if (ignoreFallback)
return void 0;
if (status === "loading") {
load();
}
return () => {
flush();
};
}, [status, load, ignoreFallback]);
return ignoreFallback ? "loaded" : status;
}
var shouldShowFallbackImage = (status, fallbackStrategy) => status !== "loaded" && fallbackStrategy === "beforeLoadOrError" || status === "failed" && fallbackStrategy === "onError";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-image.mjs
function AvatarImage(props) {
const {
src,
srcSet,
onError,
onLoad,
getInitials,
name,
borderRadius,
loading,
iconLabel,
icon = (0, import_jsx_runtime29.jsx)(GenericAvatarIcon, {}),
ignoreFallback,
referrerPolicy,
crossOrigin
} = props;
const status = useImage({ src, onError, crossOrigin, ignoreFallback });
const hasLoaded = status === "loaded";
const showFallback = !src || !hasLoaded;
if (showFallback) {
return name ? (0, import_jsx_runtime29.jsx)(
AvatarName,
{
className: "chakra-avatar__initials",
getInitials,
name
}
) : (0, import_react96.cloneElement)(icon, {
role: "img",
"aria-label": iconLabel
});
}
return (0, import_jsx_runtime29.jsx)(
chakra.img,
{
src,
srcSet,
alt: name ?? iconLabel,
onLoad,
referrerPolicy,
crossOrigin: crossOrigin ?? void 0,
className: "chakra-avatar__img",
loading,
__css: {
width: "100%",
height: "100%",
objectFit: "cover",
borderRadius
}
}
);
}
AvatarImage.displayName = "AvatarImage";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar.mjs
var baseStyle43 = defineStyle({
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
textAlign: "center",
textTransform: "uppercase",
fontWeight: "medium",
position: "relative",
flexShrink: 0
});
var Avatar = forwardRef7((props, ref) => {
const styles2 = useMultiStyleConfig("Avatar", props);
const [isLoaded, setIsLoaded] = (0, import_react97.useState)(false);
const {
src,
srcSet,
name,
showBorder,
borderRadius = "full",
onError,
onLoad: onLoadProp,
getInitials = initials,
icon = (0, import_jsx_runtime30.jsx)(GenericAvatarIcon, {}),
iconLabel = " avatar",
loading,
children,
borderColor,
ignoreFallback,
crossOrigin,
referrerPolicy,
...rest
} = omitThemingProps(props);
const avatarStyles = {
borderRadius,
borderWidth: showBorder ? "2px" : void 0,
...baseStyle43,
...styles2.container
};
if (borderColor) {
avatarStyles.borderColor = borderColor;
}
return (0, import_jsx_runtime30.jsx)(
chakra.span,
{
ref,
...rest,
className: cx("chakra-avatar", props.className),
"data-loaded": dataAttr(isLoaded),
__css: avatarStyles,
children: (0, import_jsx_runtime30.jsxs)(AvatarStylesProvider, { value: styles2, children: [
(0, import_jsx_runtime30.jsx)(
AvatarImage,
{
src,
srcSet,
loading,
onLoad: callAllHandlers(onLoadProp, () => {
setIsLoaded(true);
}),
onError,
getInitials,
name,
borderRadius,
icon,
iconLabel,
ignoreFallback,
crossOrigin,
referrerPolicy
}
),
children
] })
}
);
});
Avatar.displayName = "Avatar";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-badge.mjs
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var placementMap = {
"top-start": {
top: "0",
insetStart: "0",
transform: "translate(-25%, -25%)"
},
"top-end": {
top: "0",
insetEnd: "0",
transform: "translate(25%, -25%)"
},
"bottom-start": {
bottom: "0",
insetStart: "0",
transform: "translate(-25%, 25%)"
},
"bottom-end": {
bottom: "0",
insetEnd: "0",
transform: "translate(25%, 25%)"
}
};
var AvatarBadge = forwardRef7(
function AvatarBadge2(props, ref) {
const { placement = "bottom-end", className, ...rest } = props;
const styles2 = useAvatarStyles();
const placementStyles = placementMap[placement];
const badgeStyles = {
position: "absolute",
display: "flex",
alignItems: "center",
justifyContent: "center",
...placementStyles,
...styles2.badge
};
return (0, import_jsx_runtime31.jsx)(
chakra.div,
{
ref,
...rest,
className: cx("chakra-avatar__badge", className),
__css: badgeStyles
}
);
}
);
AvatarBadge.displayName = "AvatarBadge";
// ../../node_modules/@chakra-ui/react/dist/esm/avatar/avatar-group.mjs
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var import_react98 = __toESM(require_react(), 1);
var AvatarGroup = forwardRef7(
function AvatarGroup2(props, ref) {
const styles2 = useMultiStyleConfig("Avatar", props);
const {
children,
borderColor,
max: max2,
spacing: spacing2 = "-0.75rem",
borderRadius = "full",
...rest
} = omitThemingProps(props);
const validChildren = getValidChildren(children);
const childrenWithinMax = max2 != null ? validChildren.slice(0, max2) : validChildren;
const excess = max2 != null ? validChildren.length - max2 : 0;
const reversedChildren = childrenWithinMax.reverse();
const clones = reversedChildren.map((child, index2) => {
const isFirstAvatar = index2 === 0;
const childProps = {
marginEnd: isFirstAvatar ? 0 : spacing2,
size: props.size,
borderColor: child.props.borderColor ?? borderColor,
showBorder: true
};
return (0, import_react98.cloneElement)(child, compact(childProps));
});
const groupStyles = {
display: "flex",
alignItems: "center",
justifyContent: "flex-end",
flexDirection: "row-reverse",
...styles2.group
};
const excessStyles = {
borderRadius,
marginStart: spacing2,
...baseStyle43,
...styles2.excessLabel
};
return (0, import_jsx_runtime32.jsxs)(
chakra.div,
{
ref,
role: "group",
__css: groupStyles,
...rest,
className: cx("chakra-avatar__group", props.className),
children: [
excess > 0 && (0, import_jsx_runtime32.jsx)(chakra.span, { className: "chakra-avatar__excess", __css: excessStyles, children: `+${excess}` }),
clones
]
}
);
}
);
AvatarGroup.displayName = "AvatarGroup";
// ../../node_modules/@chakra-ui/react/dist/esm/badge/badge.mjs
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var Badge = forwardRef7(function Badge2(props, ref) {
const styles2 = useStyleConfig("Badge", props);
const { className, ...rest } = omitThemingProps(props);
return (0, import_jsx_runtime33.jsx)(
chakra.span,
{
ref,
className: cx("chakra-badge", props.className),
...rest,
__css: {
display: "inline-block",
whiteSpace: "nowrap",
verticalAlign: "middle",
...styles2
}
}
);
});
Badge.displayName = "Badge";
// ../../node_modules/@chakra-ui/react/dist/esm/box/box.mjs
var Box = chakra("div");
Box.displayName = "Box";
// ../../node_modules/@chakra-ui/react/dist/esm/box/square.mjs
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var Square = forwardRef7(
function Square2(props, ref) {
const { size: size2, centerContent = true, ...rest } = props;
const styles2 = centerContent ? { display: "flex", alignItems: "center", justifyContent: "center" } : {};
return (0, import_jsx_runtime34.jsx)(
Box,
{
ref,
boxSize: size2,
__css: {
...styles2,
flexShrink: 0,
flexGrow: 0
},
...rest
}
);
}
);
Square.displayName = "Square";
// ../../node_modules/@chakra-ui/react/dist/esm/box/circle.mjs
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
var Circle = forwardRef7(
function Circle2(props, ref) {
const { size: size2, ...rest } = props;
return (0, import_jsx_runtime35.jsx)(Square, { size: size2, ref, borderRadius: "9999px", ...rest });
}
);
Circle.displayName = "Circle";
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
var import_react99 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-context.mjs
var [BreadcrumbStylesProvider, useBreadcrumbStyles] = createContext({
name: `BreadcrumbStylesContext`,
errorMessage: `useBreadcrumbStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
});
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb.mjs
var Breadcrumb = forwardRef7(
function Breadcrumb2(props, ref) {
const styles2 = useMultiStyleConfig("Breadcrumb", props);
const ownProps = omitThemingProps(props);
const {
children,
spacing: spacing2 = "0.5rem",
separator = "/",
className,
listProps,
...rest
} = ownProps;
const validChildren = getValidChildren(children);
const count = validChildren.length;
const clones = validChildren.map(
(child, index2) => (0, import_react99.cloneElement)(child, {
separator,
spacing: spacing2,
isLastChild: count === index2 + 1
})
);
const _className = cx("chakra-breadcrumb", className);
return (0, import_jsx_runtime36.jsx)(
chakra.nav,
{
ref,
"aria-label": "breadcrumb",
className: _className,
__css: styles2.container,
...rest,
children: (0, import_jsx_runtime36.jsx)(BreadcrumbStylesProvider, { value: styles2, children: (0, import_jsx_runtime36.jsx)(
chakra.ol,
{
className: "chakra-breadcrumb__list",
...listProps,
__css: {
display: "flex",
alignItems: "center",
...styles2.list
},
children: clones
}
) })
}
);
}
);
Breadcrumb.displayName = "Breadcrumb";
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
var import_react100 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-link.mjs
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
var BreadcrumbLink = forwardRef7(
function BreadcrumbLink2(props, ref) {
const { isCurrentPage, as, className, href, ...rest } = props;
const styles2 = useBreadcrumbStyles();
const sharedProps = {
ref,
as,
className: cx("chakra-breadcrumb__link", className),
...rest
};
if (isCurrentPage) {
return (0, import_jsx_runtime37.jsx)(chakra.span, { "aria-current": "page", __css: styles2.link, ...sharedProps });
}
return (0, import_jsx_runtime37.jsx)(chakra.a, { __css: styles2.link, href, ...sharedProps });
}
);
BreadcrumbLink.displayName = "BreadcrumbLink";
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-separator.mjs
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
var BreadcrumbSeparator = forwardRef7(
function BreadcrumbSeparator2(props, ref) {
const { spacing: spacing2, ...rest } = props;
const styles2 = useBreadcrumbStyles();
const separatorStyles = defineStyle({
mx: spacing2,
...styles2.separator
});
return (0, import_jsx_runtime38.jsx)(
chakra.span,
{
ref,
role: "presentation",
...rest,
__css: separatorStyles
}
);
}
);
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
// ../../node_modules/@chakra-ui/react/dist/esm/breadcrumb/breadcrumb-item.mjs
var BreadcrumbItem = forwardRef7(
function BreadcrumbItem2(props, ref) {
const {
isCurrentPage,
separator,
isLastChild,
spacing: spacing2,
children,
className,
...rest
} = props;
const validChildren = getValidChildren(children);
const clones = validChildren.map((child) => {
if (child.type === BreadcrumbLink) {
return (0, import_react100.cloneElement)(child, {
isCurrentPage
});
}
if (child.type === BreadcrumbSeparator) {
return (0, import_react100.cloneElement)(child, {
spacing: spacing2,
children: child.props.children || separator
});
}
return child;
});
const styles2 = useBreadcrumbStyles();
const itemStyles = defineStyle({
display: "inline-flex",
alignItems: "center",
...styles2.item
});
const _className = cx("chakra-breadcrumb__list-item", className);
return (0, import_jsx_runtime39.jsxs)(chakra.li, { ref, className: _className, ...rest, __css: itemStyles, children: [
clones,
!isLastChild && (0, import_jsx_runtime39.jsx)(BreadcrumbSeparator, { spacing: spacing2, children: separator })
] });
}
);
BreadcrumbItem.displayName = "BreadcrumbItem";
// ../../node_modules/@chakra-ui/react/dist/esm/button/button.mjs
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
var import_react104 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/button/button-context.mjs
var [ButtonGroupProvider, useButtonGroup] = createContext({
strict: false,
name: "ButtonGroupContext"
});
// ../../node_modules/@chakra-ui/react/dist/esm/button/button-icon.mjs
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
var import_react101 = __toESM(require_react(), 1);
function ButtonIcon(props) {
const { children, className, ...rest } = props;
const _children = (0, import_react101.isValidElement)(children) ? (0, import_react101.cloneElement)(children, {
"aria-hidden": true,
focusable: false
}) : children;
const _className = cx("chakra-button__icon", className);
return (0, import_jsx_runtime40.jsx)(
chakra.span,
{
display: "inline-flex",
alignSelf: "center",
flexShrink: 0,
...rest,
className: _className,
children: _children
}
);
}
ButtonIcon.displayName = "ButtonIcon";
// ../../node_modules/@chakra-ui/react/dist/esm/button/button-spinner.mjs
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
var import_react102 = __toESM(require_react(), 1);
function ButtonSpinner(props) {
const {
label,
placement,
spacing: spacing2 = "0.5rem",
children = (0, import_jsx_runtime41.jsx)(Spinner, { color: "currentColor", width: "1em", height: "1em" }),
className,
__css,
...rest
} = props;
const _className = cx("chakra-button__spinner", className);
const marginProp = placement === "start" ? "marginEnd" : "marginStart";
const spinnerStyles = (0, import_react102.useMemo)(
() => defineStyle({
display: "flex",
alignItems: "center",
position: label ? "relative" : "absolute",
[marginProp]: label ? spacing2 : 0,
fontSize: "1em",
lineHeight: "normal",
...__css
}),
[__css, label, marginProp, spacing2]
);
return (0, import_jsx_runtime41.jsx)(chakra.div, { className: _className, ...rest, __css: spinnerStyles, children });
}
ButtonSpinner.displayName = "ButtonSpinner";
// ../../node_modules/@chakra-ui/react/dist/esm/button/use-button-type.mjs
var import_react103 = __toESM(require_react(), 1);
function useButtonType(value) {
const [isButton, setIsButton] = (0, import_react103.useState)(!value);
const refCallback = (0, import_react103.useCallback)((node3) => {
if (!node3)
return;
setIsButton(node3.tagName === "BUTTON");
}, []);
const type = isButton ? "button" : void 0;
return { ref: refCallback, type };
}
// ../../node_modules/@chakra-ui/react/dist/esm/button/button.mjs
var Button = forwardRef7((props, ref) => {
const group = useButtonGroup();
const styles2 = useStyleConfig("Button", { ...group, ...props });
const {
isDisabled = group == null ? void 0 : group.isDisabled,
isLoading,
isActive,
children,
leftIcon,
rightIcon,
loadingText,
iconSpacing: iconSpacing2 = "0.5rem",
type,
spinner,
spinnerPlacement = "start",
className,
as,
shouldWrapChildren,
...rest
} = omitThemingProps(props);
const buttonStyles = (0, import_react104.useMemo)(() => {
const _focus = { ...styles2 == null ? void 0 : styles2["_focus"], zIndex: 1 };
return {
display: "inline-flex",
appearance: "none",
alignItems: "center",
justifyContent: "center",
userSelect: "none",
position: "relative",
whiteSpace: "nowrap",
verticalAlign: "middle",
outline: "none",
...styles2,
...!!group && { _focus }
};
}, [styles2, group]);
const { ref: _ref2, type: defaultType } = useButtonType(as);
const contentProps = {
rightIcon,
leftIcon,
iconSpacing: iconSpacing2,
children,
shouldWrapChildren
};
return (0, import_jsx_runtime42.jsxs)(
chakra.button,
{
disabled: isDisabled || isLoading,
ref: useMergeRefs(ref, _ref2),
as,
type: type ?? defaultType,
"data-active": dataAttr(isActive),
"data-loading": dataAttr(isLoading),
__css: buttonStyles,
className: cx("chakra-button", className),
...rest,
children: [
isLoading && spinnerPlacement === "start" && (0, import_jsx_runtime42.jsx)(
ButtonSpinner,
{
className: "chakra-button__spinner--start",
label: loadingText,
placement: "start",
spacing: iconSpacing2,
children: spinner
}
),
isLoading ? loadingText || (0, import_jsx_runtime42.jsx)(chakra.span, { opacity: 0, children: (0, import_jsx_runtime42.jsx)(ButtonContent, { ...contentProps }) }) : (0, import_jsx_runtime42.jsx)(ButtonContent, { ...contentProps }),
isLoading && spinnerPlacement === "end" && (0, import_jsx_runtime42.jsx)(
ButtonSpinner,
{
className: "chakra-button__spinner--end",
label: loadingText,
placement: "end",
spacing: iconSpacing2,
children: spinner
}
)
]
}
);
});
Button.displayName = "Button";
function ButtonContent(props) {
const { leftIcon, rightIcon, children, iconSpacing: iconSpacing2, shouldWrapChildren } = props;
if (!shouldWrapChildren) {
return (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
leftIcon && (0, import_jsx_runtime42.jsx)(ButtonIcon, { marginEnd: iconSpacing2, children: leftIcon }),
children,
rightIcon && (0, import_jsx_runtime42.jsx)(ButtonIcon, { marginStart: iconSpacing2, children: rightIcon })
] });
}
return (0, import_jsx_runtime42.jsxs)("span", { style: { display: "contents" }, children: [
leftIcon && (0, import_jsx_runtime42.jsx)(ButtonIcon, { marginEnd: iconSpacing2, children: leftIcon }),
children,
rightIcon && (0, import_jsx_runtime42.jsx)(ButtonIcon, { marginStart: iconSpacing2, children: rightIcon })
] });
}
// ../../node_modules/@chakra-ui/react/dist/esm/button/button-group.mjs
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
var import_react105 = __toESM(require_react(), 1);
var attachedStyles = {
horizontal: {
"> *:first-of-type:not(:last-of-type)": { borderEndRadius: 0 },
"> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 },
"> *:not(:first-of-type):last-of-type": { borderStartRadius: 0 }
},
vertical: {
"> *:first-of-type:not(:last-of-type)": { borderBottomRadius: 0 },
"> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 },
"> *:not(:first-of-type):last-of-type": { borderTopRadius: 0 }
}
};
var gapStyles = {
horizontal: (spacing2) => ({
"& > *:not(style) ~ *:not(style)": { marginStart: spacing2 }
}),
vertical: (spacing2) => ({
"& > *:not(style) ~ *:not(style)": { marginTop: spacing2 }
})
};
var ButtonGroup = forwardRef7(
function ButtonGroup2(props, ref) {
const {
size: size2,
colorScheme,
variant,
className,
spacing: spacing2 = "0.5rem",
isAttached,
isDisabled,
orientation = "horizontal",
...rest
} = props;
const _className = cx("chakra-button__group", className);
const context = (0, import_react105.useMemo)(
() => ({ size: size2, colorScheme, variant, isDisabled }),
[size2, colorScheme, variant, isDisabled]
);
let groupStyles = {
display: "inline-flex",
...isAttached ? attachedStyles[orientation] : gapStyles[orientation](spacing2)
};
const isVertical = orientation === "vertical";
return (0, import_jsx_runtime43.jsx)(ButtonGroupProvider, { value: context, children: (0, import_jsx_runtime43.jsx)(
chakra.div,
{
ref,
role: "group",
__css: groupStyles,
className: _className,
"data-attached": isAttached ? "" : void 0,
"data-orientation": orientation,
flexDir: isVertical ? "column" : void 0,
...rest
}
) });
}
);
ButtonGroup.displayName = "ButtonGroup";
// ../../node_modules/@chakra-ui/react/dist/esm/button/icon-button.mjs
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
var import_react106 = __toESM(require_react(), 1);
var IconButton = forwardRef7(
(props, ref) => {
const { icon, children, isRound, "aria-label": ariaLabel, ...rest } = props;
const element = icon || children;
const _children = (0, import_react106.isValidElement)(element) ? (0, import_react106.cloneElement)(element, {
"aria-hidden": true,
focusable: false
}) : null;
return (0, import_jsx_runtime44.jsx)(
Button,
{
px: "0",
py: "0",
borderRadius: isRound ? "full" : void 0,
ref,
"aria-label": ariaLabel,
...rest,
children: _children
}
);
}
);
IconButton.displayName = "IconButton";
// ../../node_modules/@chakra-ui/react/dist/esm/card/card.mjs
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/card/card-context.mjs
var [CardStylesProvider, useCardStyles] = createStylesContext("Card");
// ../../node_modules/@chakra-ui/react/dist/esm/card/card.mjs
var Card = forwardRef7(function Card2(props, ref) {
const {
className,
children,
direction: direction2 = "column",
justify,
align,
...rest
} = omitThemingProps(props);
const styles2 = useMultiStyleConfig("Card", props);
return (0, import_jsx_runtime45.jsx)(
chakra.div,
{
ref,
className: cx("chakra-card", className),
__css: {
display: "flex",
flexDirection: direction2,
justifyContent: justify,
alignItems: align,
position: "relative",
minWidth: 0,
wordWrap: "break-word",
...styles2.container
},
...rest,
children: (0, import_jsx_runtime45.jsx)(CardStylesProvider, { value: styles2, children })
}
);
});
// ../../node_modules/@chakra-ui/react/dist/esm/card/card-body.mjs
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
var CardBody = forwardRef7(
function CardBody2(props, ref) {
const { className, ...rest } = props;
const styles2 = useCardStyles();
return (0, import_jsx_runtime46.jsx)(
chakra.div,
{
ref,
className: cx("chakra-card__body", className),
__css: styles2.body,
...rest
}
);
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/card/card-footer.mjs
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
var CardFooter = forwardRef7(
function CardFooter2(props, ref) {
const { className, justify, ...rest } = props;
const styles2 = useCardStyles();
return (0, import_jsx_runtime47.jsx)(
chakra.div,
{
ref,
className: cx("chakra-card__footer", className),
__css: {
display: "flex",
justifyContent: justify,
...styles2.footer
},
...rest
}
);
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/card/card-header.mjs
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
var CardHeader = forwardRef7(
function CardHeader2(props, ref) {
const { className, ...rest } = props;
const styles2 = useCardStyles();
return (0, import_jsx_runtime48.jsx)(
chakra.div,
{
ref,
className: cx("chakra-card__header", className),
__css: styles2.header,
...rest
}
);
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/center/center.mjs
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
var Center = chakra("div", {
baseStyle: {
display: "flex",
alignItems: "center",
justifyContent: "center"
}
});
Center.displayName = "Center";
var centerStyles = {
horizontal: {
insetStart: "50%",
transform: "translateX(-50%)"
},
vertical: {
top: "50%",
transform: "translateY(-50%)"
},
both: {
insetStart: "50%",
top: "50%",
transform: "translate(-50%, -50%)"
}
};
var AbsoluteCenter = forwardRef7(
function AbsoluteCenter2(props, ref) {
const { axis = "both", ...rest } = props;
return (0, import_jsx_runtime49.jsx)(
chakra.div,
{
ref,
__css: centerStyles[axis],
...rest,
position: "absolute"
}
);
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
var import_react111 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-context.mjs
var [CheckboxGroupProvider, useCheckboxGroupContext] = createContext({
name: "CheckboxGroupContext",
strict: false
});
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-icon.mjs
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
function CheckIcon2(props) {
return (0, import_jsx_runtime50.jsx)(
chakra.svg,
{
width: "1.2em",
viewBox: "0 0 12 10",
style: {
fill: "none",
strokeWidth: 2,
stroke: "currentColor",
strokeDasharray: 16
},
...props,
children: (0, import_jsx_runtime50.jsx)("polyline", { points: "1.5 6 4.5 9 10.5 1" })
}
);
}
function IndeterminateIcon(props) {
return (0, import_jsx_runtime50.jsx)(
chakra.svg,
{
width: "1.2em",
viewBox: "0 0 24 24",
style: { stroke: "currentColor", strokeWidth: 4 },
...props,
children: (0, import_jsx_runtime50.jsx)("line", { x1: "21", x2: "3", y1: "12", y2: "12" })
}
);
}
function CheckboxIcon(props) {
const { isIndeterminate, isChecked, ...rest } = props;
const BaseIcon = isIndeterminate ? IndeterminateIcon : CheckIcon2;
return isChecked || isIndeterminate ? (0, import_jsx_runtime50.jsx)(
chakra.div,
{
style: {
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%"
},
children: (0, import_jsx_runtime50.jsx)(BaseIcon, { ...rest })
}
) : null;
}
// ../../node_modules/@zag-js/dom-query/dist/index.mjs
function itemById(v, id3) {
return v.find((node3) => node3.id === id3);
}
function indexOfId(v, id3) {
const item = itemById(v, id3);
return item ? v.indexOf(item) : -1;
}
var getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? "";
var match2 = (valueText, query2) => valueText.trim().toLowerCase().startsWith(query2.toLowerCase());
var wrap4 = (v, idx) => {
return v.map((_, index2) => v[(Math.max(idx, 0) + index2) % v.length]);
};
function getByText(v, text, currentId) {
const index2 = currentId ? indexOfId(v, currentId) : -1;
let items = currentId ? wrap4(v, index2) : v;
const isSingleKey = text.length === 1;
if (isSingleKey) {
items = items.filter((item) => item.id !== currentId);
}
return items.find((item) => match2(getValueText(item), text));
}
function getByTypeaheadImpl(_items, options) {
const { state: state2, activeId, key, timeout = 350 } = options;
const search = state2.keysSoFar + key;
const isRepeated = search.length > 1 && Array.from(search).every((char2) => char2 === search[0]);
const query2 = isRepeated ? search[0] : search;
let items = _items.slice();
const next2 = getByText(items, query2, activeId);
function cleanup() {
clearTimeout(state2.timer);
state2.timer = -1;
}
function update(value) {
state2.keysSoFar = value;
cleanup();
if (value !== "") {
state2.timer = +setTimeout(() => {
update("");
cleanup();
}, timeout);
}
}
update(search);
return next2;
}
var getByTypeahead = Object.assign(getByTypeaheadImpl, {
defaultOptions: { keysSoFar: "", timer: -1 },
isValidEvent: isValidTypeaheadEvent
});
function isValidTypeaheadEvent(event) {
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
var isDom2 = () => typeof document !== "undefined";
// ../../node_modules/@zag-js/focus-visible/dist/index.mjs
var hasSetup = false;
var modality = null;
var hasEventBeforeFocus = false;
var hasBlurredWindowRecently = false;
var handlers = /* @__PURE__ */ new Set();
function trigger(modality2, event) {
handlers.forEach((handler) => handler(modality2, event));
}
var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
function isValidKey(e) {
return !(e.metaKey || !isMac && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
}
function onKeyboardEvent(event) {
hasEventBeforeFocus = true;
if (isValidKey(event)) {
modality = "keyboard";
trigger("keyboard", event);
}
}
function onPointerEvent(event) {
modality = "pointer";
if (event.type === "mousedown" || event.type === "pointerdown") {
hasEventBeforeFocus = true;
const target = event.composedPath ? event.composedPath()[0] : event.target;
let matches = false;
try {
matches = target.matches(":focus-visible");
} catch {
}
if (matches)
return;
trigger("pointer", event);
}
}
function isVirtualClick(event) {
if (event.mozInputSource === 0 && event.isTrusted)
return true;
return event.detail === 0 && !event.pointerType;
}
function onClickEvent(e) {
if (isVirtualClick(e)) {
hasEventBeforeFocus = true;
modality = "virtual";
}
}
function onWindowFocus(event) {
if (event.target === window || event.target === document) {
return;
}
if (event.target instanceof Element && event.target.hasAttribute("tabindex")) {
return;
}
if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {
modality = "virtual";
trigger("virtual", event);
}
hasEventBeforeFocus = false;
hasBlurredWindowRecently = false;
}
function onWindowBlur() {
hasEventBeforeFocus = false;
hasBlurredWindowRecently = true;
}
function isFocusVisible() {
return modality !== "pointer";
}
function setupGlobalFocusEvents() {
if (!isDom2() || hasSetup) {
return;
}
const { focus } = HTMLElement.prototype;
HTMLElement.prototype.focus = function focusElement(...args) {
hasEventBeforeFocus = true;
focus.apply(this, args);
};
document.addEventListener("keydown", onKeyboardEvent, true);
document.addEventListener("keyup", onKeyboardEvent, true);
document.addEventListener("click", onClickEvent, true);
window.addEventListener("focus", onWindowFocus, true);
window.addEventListener("blur", onWindowBlur, false);
if (typeof PointerEvent !== "undefined") {
document.addEventListener("pointerdown", onPointerEvent, true);
document.addEventListener("pointermove", onPointerEvent, true);
document.addEventListener("pointerup", onPointerEvent, true);
} else {
document.addEventListener("mousedown", onPointerEvent, true);
document.addEventListener("mousemove", onPointerEvent, true);
document.addEventListener("mouseup", onPointerEvent, true);
}
hasSetup = true;
}
function trackFocusVisible(fn2) {
setupGlobalFocusEvents();
fn2(isFocusVisible());
const handler = () => fn2(isFocusVisible());
handlers.add(handler);
return () => {
handlers.delete(handler);
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/use-checkbox.mjs
var import_react108 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/form-control/form-control.mjs
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
var import_react107 = __toESM(require_react(), 1);
var [FormControlStylesProvider, useFormControlStyles] = createContext({
name: `FormControlStylesContext`,
errorMessage: `useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
});
var [FormControlProvider, useFormControlContext] = createContext({
strict: false,
name: "FormControlContext"
});
function useFormControlProvider(props) {
const {
id: idProp,
isRequired,
isInvalid,
isDisabled,
isReadOnly,
...htmlProps
} = props;
const uuid = (0, import_react107.useId)();
const id3 = idProp || `field-${uuid}`;
const labelId = `${id3}-label`;
const feedbackId = `${id3}-feedback`;
const helpTextId = `${id3}-helptext`;
const [hasFeedbackText, setHasFeedbackText] = (0, import_react107.useState)(false);
const [hasHelpText, setHasHelpText] = (0, import_react107.useState)(false);
const [isFocused, setFocus] = (0, import_react107.useState)(false);
const getHelpTextProps = (0, import_react107.useCallback)(
(props2 = {}, forwardedRef = null) => ({
id: helpTextId,
...props2,
/**
* Notify the field context when the help text is rendered on screen,
* so we can apply the correct `aria-describedby` to the field (e.g. input, textarea).
*/
ref: mergeRefs(forwardedRef, (node3) => {
if (!node3)
return;
setHasHelpText(true);
})
}),
[helpTextId]
);
const getLabelProps = (0, import_react107.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...props2,
ref: forwardedRef,
"data-focus": dataAttr(isFocused),
"data-disabled": dataAttr(isDisabled),
"data-invalid": dataAttr(isInvalid),
"data-readonly": dataAttr(isReadOnly),
id: props2.id !== void 0 ? props2.id : labelId,
htmlFor: props2.htmlFor !== void 0 ? props2.htmlFor : id3
}),
[id3, isDisabled, isFocused, isInvalid, isReadOnly, labelId]
);
const getErrorMessageProps = (0, import_react107.useCallback)(
(props2 = {}, forwardedRef = null) => ({
id: feedbackId,
...props2,
/**
* Notify the field context when the error message is rendered on screen,
* so we can apply the correct `aria-describedby` to the field (e.g. input, textarea).
*/
ref: mergeRefs(forwardedRef, (node3) => {
if (!node3)
return;
setHasFeedbackText(true);
}),
"aria-live": "polite"
}),
[feedbackId]
);
const getRootProps = (0, import_react107.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...props2,
...htmlProps,
ref: forwardedRef,
role: "group",
"data-focus": dataAttr(isFocused),
"data-disabled": dataAttr(isDisabled),
"data-invalid": dataAttr(isInvalid),
"data-readonly": dataAttr(isReadOnly)
}),
[htmlProps, isDisabled, isFocused, isInvalid, isReadOnly]
);
const getRequiredIndicatorProps = (0, import_react107.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...props2,
ref: forwardedRef,
role: "presentation",
"aria-hidden": true,
children: props2.children || "*"
}),
[]
);
return {
isRequired: !!isRequired,
isInvalid: !!isInvalid,
isReadOnly: !!isReadOnly,
isDisabled: !!isDisabled,
isFocused: !!isFocused,
onFocus: () => setFocus(true),
onBlur: () => setFocus(false),
hasFeedbackText,
setHasFeedbackText,
hasHelpText,
setHasHelpText,
id: id3,
labelId,
feedbackId,
helpTextId,
htmlProps,
getHelpTextProps,
getErrorMessageProps,
getRootProps,
getLabelProps,
getRequiredIndicatorProps
};
}
var FormControl = forwardRef7(
function FormControl2(props, ref) {
const styles2 = useMultiStyleConfig("Form", props);
const ownProps = omitThemingProps(props);
const {
getRootProps,
htmlProps: _,
...context
} = useFormControlProvider(ownProps);
const className = cx("chakra-form-control", props.className);
return (0, import_jsx_runtime51.jsx)(FormControlProvider, { value: context, children: (0, import_jsx_runtime51.jsx)(FormControlStylesProvider, { value: styles2, children: (0, import_jsx_runtime51.jsx)(
chakra.div,
{
...getRootProps({}, ref),
className,
__css: styles2["container"]
}
) }) });
}
);
FormControl.displayName = "FormControl";
var FormHelperText = forwardRef7(
function FormHelperText2(props, ref) {
const field = useFormControlContext();
const styles2 = useFormControlStyles();
const className = cx("chakra-form__helper-text", props.className);
return (0, import_jsx_runtime51.jsx)(
chakra.div,
{
...field == null ? void 0 : field.getHelpTextProps(props, ref),
__css: styles2.helperText,
className
}
);
}
);
FormHelperText.displayName = "FormHelperText";
// ../../node_modules/@chakra-ui/react/dist/esm/form-control/use-form-control.mjs
function useFormControl(props) {
const { isDisabled, isInvalid, isReadOnly, isRequired, ...rest } = useFormControlProps(props);
return {
...rest,
disabled: isDisabled,
readOnly: isReadOnly,
required: isRequired,
"aria-invalid": ariaAttr(isInvalid),
"aria-required": ariaAttr(isRequired),
"aria-readonly": ariaAttr(isReadOnly)
};
}
function useFormControlProps(props) {
const field = useFormControlContext();
const {
id: id3,
disabled,
readOnly,
required,
isRequired,
isInvalid,
isReadOnly,
isDisabled,
onFocus: onFocus3,
onBlur: onBlur3,
...rest
} = props;
const labelIds = props["aria-describedby"] ? [props["aria-describedby"]] : [];
if ((field == null ? void 0 : field.hasFeedbackText) && (field == null ? void 0 : field.isInvalid)) {
labelIds.push(field.feedbackId);
}
if (field == null ? void 0 : field.hasHelpText) {
labelIds.push(field.helpTextId);
}
return {
...rest,
"aria-describedby": labelIds.join(" ") || void 0,
id: id3 ?? (field == null ? void 0 : field.id),
isDisabled: disabled ?? isDisabled ?? (field == null ? void 0 : field.isDisabled),
isReadOnly: readOnly ?? isReadOnly ?? (field == null ? void 0 : field.isReadOnly),
isRequired: required ?? isRequired ?? (field == null ? void 0 : field.isRequired),
isInvalid: isInvalid ?? (field == null ? void 0 : field.isInvalid),
onFocus: callAllHandlers(field == null ? void 0 : field.onFocus, onFocus3),
onBlur: callAllHandlers(field == null ? void 0 : field.onBlur, onBlur3)
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/visually-hidden/visually-hidden.style.mjs
var visuallyHiddenStyle = {
border: "0",
clip: "rect(0, 0, 0, 0)",
height: "1px",
width: "1px",
margin: "-1px",
padding: "0",
overflow: "hidden",
whiteSpace: "nowrap",
position: "absolute"
};
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/use-checkbox.mjs
function useCheckbox(props = {}) {
const formControlProps = useFormControlProps(props);
const {
isDisabled,
isReadOnly,
isRequired,
isInvalid,
id: id3,
onBlur: onBlur3,
onFocus: onFocus3,
"aria-describedby": ariaDescribedBy
} = formControlProps;
const {
defaultChecked,
isChecked: checkedProp,
isFocusable: isFocusable2,
onChange,
isIndeterminate,
name,
value,
tabIndex = void 0,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy,
"aria-invalid": ariaInvalid,
...rest
} = props;
const htmlProps = omit(rest, [
"isDisabled",
"isReadOnly",
"isRequired",
"isInvalid",
"id",
"onBlur",
"onFocus",
"aria-describedby"
]);
const onChangeProp = useCallbackRef(onChange);
const onBlurProp = useCallbackRef(onBlur3);
const onFocusProp = useCallbackRef(onFocus3);
const [isFocused, setFocused] = (0, import_react108.useState)(false);
const [isHovered, setHovered] = (0, import_react108.useState)(false);
const [isActive, setActive] = (0, import_react108.useState)(false);
const isFocusVisibleRef = (0, import_react108.useRef)(false);
(0, import_react108.useEffect)(() => {
return trackFocusVisible((state22) => {
isFocusVisibleRef.current = state22;
});
}, []);
const inputRef = (0, import_react108.useRef)(null);
const [rootIsLabelElement, setRootIsLabelElement] = (0, import_react108.useState)(true);
const [checkedState, setCheckedState] = (0, import_react108.useState)(!!defaultChecked);
const isControlled = checkedProp !== void 0;
const isChecked = isControlled ? checkedProp : checkedState;
const handleChange = (0, import_react108.useCallback)(
(event) => {
if (isReadOnly || isDisabled) {
event.preventDefault();
return;
}
if (!isControlled) {
if (isChecked) {
setCheckedState(event.currentTarget.checked);
} else {
setCheckedState(isIndeterminate ? true : event.currentTarget.checked);
}
}
onChangeProp == null ? void 0 : onChangeProp(event);
},
[
isReadOnly,
isDisabled,
isChecked,
isControlled,
isIndeterminate,
onChangeProp
]
);
useSafeLayoutEffect(() => {
if (inputRef.current) {
inputRef.current.indeterminate = Boolean(isIndeterminate);
}
}, [isIndeterminate]);
useUpdateEffect(() => {
if (isDisabled) {
setFocused(false);
}
}, [isDisabled, setFocused]);
useSafeLayoutEffect(() => {
const el = inputRef.current;
if (!(el == null ? void 0 : el.form))
return;
const formResetListener = () => {
setCheckedState(!!defaultChecked);
};
el.form.addEventListener("reset", formResetListener);
return () => {
var _a8;
return (_a8 = el.form) == null ? void 0 : _a8.removeEventListener("reset", formResetListener);
};
}, []);
const trulyDisabled = isDisabled && !isFocusable2;
const onKeyDown = (0, import_react108.useCallback)(
(event) => {
if (event.key === " ") {
setActive(true);
}
},
[setActive]
);
const onKeyUp = (0, import_react108.useCallback)(
(event) => {
if (event.key === " ") {
setActive(false);
}
},
[setActive]
);
useSafeLayoutEffect(() => {
if (!inputRef.current)
return;
const notInSync = inputRef.current.checked !== isChecked;
if (notInSync) {
setCheckedState(inputRef.current.checked);
}
}, [inputRef.current]);
const getCheckboxProps = (0, import_react108.useCallback)(
(props2 = {}, forwardedRef = null) => {
const onPressDown = (event) => {
if (isFocused) {
event.preventDefault();
}
setActive(true);
};
return {
...props2,
ref: forwardedRef,
"data-active": dataAttr(isActive),
"data-hover": dataAttr(isHovered),
"data-checked": dataAttr(isChecked),
"data-focus": dataAttr(isFocused),
"data-focus-visible": dataAttr(isFocused && isFocusVisibleRef.current),
"data-indeterminate": dataAttr(isIndeterminate),
"data-disabled": dataAttr(isDisabled),
"data-invalid": dataAttr(isInvalid),
"data-readonly": dataAttr(isReadOnly),
"aria-hidden": true,
onMouseDown: callAllHandlers(props2.onMouseDown, onPressDown),
onMouseUp: callAllHandlers(props2.onMouseUp, () => setActive(false)),
onMouseEnter: callAllHandlers(
props2.onMouseEnter,
() => setHovered(true)
),
onMouseLeave: callAllHandlers(
props2.onMouseLeave,
() => setHovered(false)
)
};
},
[
isActive,
isChecked,
isDisabled,
isFocused,
isHovered,
isIndeterminate,
isInvalid,
isReadOnly
]
);
const getIndicatorProps = (0, import_react108.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...props2,
ref: forwardedRef,
"data-active": dataAttr(isActive),
"data-hover": dataAttr(isHovered),
"data-checked": dataAttr(isChecked),
"data-focus": dataAttr(isFocused),
"data-focus-visible": dataAttr(isFocused && isFocusVisibleRef.current),
"data-indeterminate": dataAttr(isIndeterminate),
"data-disabled": dataAttr(isDisabled),
"data-invalid": dataAttr(isInvalid),
"data-readonly": dataAttr(isReadOnly)
}),
[
isActive,
isChecked,
isDisabled,
isFocused,
isHovered,
isIndeterminate,
isInvalid,
isReadOnly
]
);
const getRootProps = (0, import_react108.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...htmlProps,
...props2,
ref: mergeRefs(forwardedRef, (node3) => {
if (!node3)
return;
setRootIsLabelElement(node3.tagName === "LABEL");
}),
onClick: callAllHandlers(props2.onClick, () => {
var _a8;
if (!rootIsLabelElement) {
(_a8 = inputRef.current) == null ? void 0 : _a8.click();
requestAnimationFrame(() => {
var _a9;
(_a9 = inputRef.current) == null ? void 0 : _a9.focus({ preventScroll: true });
});
}
}),
"data-disabled": dataAttr(isDisabled),
"data-checked": dataAttr(isChecked),
"data-invalid": dataAttr(isInvalid)
}),
[htmlProps, isDisabled, isChecked, isInvalid, rootIsLabelElement]
);
const getInputProps = (0, import_react108.useCallback)(
(props2 = {}, forwardedRef = null) => {
return {
...props2,
ref: mergeRefs(inputRef, forwardedRef),
type: "checkbox",
name,
value,
id: id3,
tabIndex,
onChange: callAllHandlers(props2.onChange, handleChange),
onBlur: callAllHandlers(
props2.onBlur,
onBlurProp,
() => setFocused(false)
),
onFocus: callAllHandlers(
props2.onFocus,
onFocusProp,
() => setFocused(true)
),
onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDown),
onKeyUp: callAllHandlers(props2.onKeyUp, onKeyUp),
required: isRequired,
checked: isChecked,
disabled: trulyDisabled,
readOnly: isReadOnly,
"aria-label": ariaLabel,
"aria-labelledby": ariaLabelledBy,
"aria-invalid": ariaInvalid ? Boolean(ariaInvalid) : isInvalid,
"aria-describedby": ariaDescribedBy,
"aria-disabled": isDisabled,
"aria-checked": isIndeterminate ? "mixed" : isChecked,
style: visuallyHiddenStyle
};
},
[
name,
value,
id3,
tabIndex,
handleChange,
onBlurProp,
onFocusProp,
onKeyDown,
onKeyUp,
isRequired,
isChecked,
trulyDisabled,
isReadOnly,
ariaLabel,
ariaLabelledBy,
ariaInvalid,
isInvalid,
ariaDescribedBy,
isDisabled,
isIndeterminate
]
);
const getLabelProps = (0, import_react108.useCallback)(
(props2 = {}, forwardedRef = null) => ({
...props2,
ref: forwardedRef,
onMouseDown: callAllHandlers(props2.onMouseDown, stopEvent),
"data-disabled": dataAttr(isDisabled),
"data-checked": dataAttr(isChecked),
"data-invalid": dataAttr(isInvalid)
}),
[isChecked, isDisabled, isInvalid]
);
const state2 = {
isInvalid,
isFocused,
isChecked,
isActive,
isHovered,
isIndeterminate,
isDisabled,
isReadOnly,
isRequired
};
return {
state: state2,
getRootProps,
getCheckboxProps,
getIndicatorProps,
getInputProps,
getLabelProps,
htmlProps
};
}
function stopEvent(event) {
event.preventDefault();
event.stopPropagation();
}
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/use-initial-animation-state.mjs
var import_react109 = __toESM(require_react(), 1);
function useInitialAnimationState(isChecked) {
const [previousIsChecked, setPreviousIsChecked] = (0, import_react109.useState)(isChecked);
const [shouldAnimate, setShouldAnimate] = (0, import_react109.useState)(false);
if (isChecked !== previousIsChecked) {
setShouldAnimate(true);
setPreviousIsChecked(isChecked);
}
return shouldAnimate;
}
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox.mjs
var controlStyles = {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
verticalAlign: "top",
userSelect: "none",
flexShrink: 0
};
var rootStyles = {
cursor: "pointer",
display: "inline-flex",
alignItems: "center",
verticalAlign: "top",
position: "relative"
};
var checkAnim = keyframes({
from: {
opacity: 0,
strokeDashoffset: 16,
transform: "scale(0.95)"
},
to: {
opacity: 1,
strokeDashoffset: 0,
transform: "scale(1)"
}
});
var indeterminateOpacityAnim = keyframes({
from: {
opacity: 0
},
to: {
opacity: 1
}
});
var indeterminateScaleAnim = keyframes({
from: {
transform: "scaleX(0.65)"
},
to: {
transform: "scaleX(1)"
}
});
var Checkbox = forwardRef7(
function Checkbox2(props, ref) {
const group = useCheckboxGroupContext();
const mergedProps = { ...group, ...props };
const styles2 = useMultiStyleConfig("Checkbox", mergedProps);
const ownProps = omitThemingProps(props);
const {
spacing: spacing2 = "0.5rem",
className,
children,
iconColor,
iconSize,
icon = (0, import_jsx_runtime52.jsx)(CheckboxIcon, {}),
isChecked: isCheckedProp,
isDisabled = group == null ? void 0 : group.isDisabled,
onChange: onChangeProp,
inputProps,
...rest
} = ownProps;
let isChecked = isCheckedProp;
if ((group == null ? void 0 : group.value) && ownProps.value) {
isChecked = group.value.includes(ownProps.value);
}
let onChange = onChangeProp;
if ((group == null ? void 0 : group.onChange) && ownProps.value) {
onChange = callAll(group.onChange, onChangeProp);
}
const {
state: state2,
getInputProps,
getCheckboxProps,
getLabelProps,
getRootProps
} = useCheckbox({
...rest,
isDisabled,
isChecked,
onChange
});
const shouldAnimate = useInitialAnimationState(state2.isChecked);
const iconStyles = (0, import_react111.useMemo)(
() => ({
animation: !shouldAnimate ? void 0 : state2.isIndeterminate ? `${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear` : `${checkAnim} 200ms linear`,
...styles2.icon,
...compact({
fontSize: iconSize,
color: iconColor
})
}),
[iconColor, iconSize, shouldAnimate, state2.isIndeterminate, styles2.icon]
);
const clonedIcon = (0, import_react111.cloneElement)(icon, {
__css: iconStyles,
isIndeterminate: state2.isIndeterminate,
isChecked: state2.isChecked
});
return (0, import_jsx_runtime52.jsxs)(
chakra.label,
{
__css: { ...rootStyles, ...styles2.container },
className: cx("chakra-checkbox", className),
...getRootProps(),
children: [
(0, import_jsx_runtime52.jsx)(
"input",
{
className: "chakra-checkbox__input",
...getInputProps(inputProps, ref)
}
),
(0, import_jsx_runtime52.jsx)(
chakra.span,
{
__css: { ...controlStyles, ...styles2.control },
className: "chakra-checkbox__control",
...getCheckboxProps(),
children: clonedIcon
}
),
children && (0, import_jsx_runtime52.jsx)(
chakra.span,
{
className: "chakra-checkbox__label",
...getLabelProps(),
__css: {
marginStart: spacing2,
...styles2.label
},
children
}
)
]
}
);
}
);
Checkbox.displayName = "Checkbox";
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-group.mjs
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
var import_react113 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/use-checkbox-group.mjs
var import_react112 = __toESM(require_react(), 1);
function isInputEvent2(value) {
return value && isObject(value) && isObject(value.target);
}
function useCheckboxGroup(props = {}) {
const {
defaultValue,
value: valueProp,
onChange,
isDisabled,
isNative
} = props;
const onChangeProp = useCallbackRef(onChange);
const [value, setValue] = useControllableState({
value: valueProp,
defaultValue: defaultValue || [],
onChange: onChangeProp
});
const handleChange = (0, import_react112.useCallback)(
(eventOrValue) => {
if (!value)
return;
const isChecked = isInputEvent2(eventOrValue) ? eventOrValue.target.checked : !value.includes(eventOrValue);
const selectedValue = isInputEvent2(eventOrValue) ? eventOrValue.target.value : eventOrValue;
const nextValue = isChecked ? [...value, selectedValue] : value.filter((v) => String(v) !== String(selectedValue));
setValue(nextValue);
},
[setValue, value]
);
const getCheckboxProps = (0, import_react112.useCallback)(
(props2 = {}) => {
const checkedKey = isNative ? "checked" : "isChecked";
return {
...props2,
[checkedKey]: value.some((val) => String(props2.value) === String(val)),
onChange: handleChange
};
},
[handleChange, isNative, value]
);
return {
value,
isDisabled,
onChange: handleChange,
setValue,
getCheckboxProps
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/checkbox/checkbox-group.mjs
function CheckboxGroup(props) {
const { colorScheme, size: size2, variant, children, isDisabled } = props;
const { value, onChange } = useCheckboxGroup(props);
const group = (0, import_react113.useMemo)(
() => ({
size: size2,
onChange,
colorScheme,
value,
variant,
isDisabled
}),
[size2, onChange, colorScheme, value, variant, isDisabled]
);
return (0, import_jsx_runtime53.jsx)(CheckboxGroupProvider, { value: group, children });
}
CheckboxGroup.displayName = "CheckboxGroup";
// ../../node_modules/@chakra-ui/react/dist/esm/code/code.mjs
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
var Code = forwardRef7(function Code2(props, ref) {
const styles2 = useStyleConfig("Code", props);
const { className, ...rest } = omitThemingProps(props);
return (0, import_jsx_runtime54.jsx)(
chakra.code,
{
ref,
className: cx("chakra-code", props.className),
...rest,
__css: {
display: "inline-block",
...styles2
}
}
);
});
Code.displayName = "Code";
// ../../node_modules/@chakra-ui/react/dist/esm/color-mode/color-mode-script.mjs
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
var VALID_VALUES = /* @__PURE__ */ new Set(["dark", "light", "system"]);
function normalize3(initialColorMode) {
let value = initialColorMode;
if (!VALID_VALUES.has(value))
value = "light";
return value;
}
function getScriptSrc(props = {}) {
const {
initialColorMode = "light",
type = "localStorage",
storageKey: key = "chakra-ui-color-mode"
} = props;
const init = normalize3(initialColorMode);
const isCookie = type === "cookie";
const cookieScript = `(function(){try{var a=function(o){var l="(prefers-color-scheme: dark)",v=window.matchMedia(l).matches?"dark":"light",e=o==="system"?v:o,d=document.documentElement,m=document.body,i="chakra-ui-light",n="chakra-ui-dark",s=e==="dark";return m.classList.add(s?n:i),m.classList.remove(s?i:n),d.style.colorScheme=e,d.dataset.theme=e,e},u=a,h="${init}",r="${key}",t=document.cookie.match(new RegExp("(^| )".concat(r,"=([^;]+)"))),c=t?t[2]:null;c?a(c):document.cookie="".concat(r,"=").concat(a(h),"; max-age=31536000; path=/")}catch(a){}})();
`;
const localStorageScript = `(function(){try{var a=function(c){var v="(prefers-color-scheme: dark)",h=window.matchMedia(v).matches?"dark":"light",r=c==="system"?h:c,o=document.documentElement,s=document.body,l="chakra-ui-light",d="chakra-ui-dark",i=r==="dark";return s.classList.add(i?d:l),s.classList.remove(i?l:d),o.style.colorScheme=r,o.dataset.theme=r,r},n=a,m="${init}",e="${key}",t=localStorage.getItem(e);t?a(t):localStorage.setItem(e,a(m))}catch(a){}})();
`;
const fn2 = isCookie ? cookieScript : localStorageScript;
return `!${fn2}`.trim();
}
function ColorModeScript(props = {}) {
const { nonce } = props;
return (0, import_jsx_runtime55.jsx)(
"script",
{
id: "chakra-script",
nonce,
dangerouslySetInnerHTML: { __html: getScriptSrc(props) }
}
);
}
// ../../node_modules/@chakra-ui/react/dist/esm/container/container.mjs
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
var Container2 = forwardRef7(
function Container22(props, ref) {
const { className, centerContent, ...rest } = omitThemingProps(props);
const styles2 = useStyleConfig("Container", props);
return (0, import_jsx_runtime56.jsx)(
chakra.div,
{
ref,
className: cx("chakra-container", className),
...rest,
__css: {
...styles2,
...centerContent && {
display: "flex",
flexDirection: "column",
alignItems: "center"
}
}
}
);
}
);
Container2.displayName = "Container";
// ../../node_modules/@chakra-ui/react/dist/esm/control-box/control-box.mjs
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
var ControlBox = (props) => {
const {
type = "checkbox",
_hover,
_invalid,
_disabled,
_focus,
_checked,
_child = { opacity: 0 },
_checkedAndChild = { opacity: 1 },
_checkedAndDisabled,
_checkedAndFocus,
_checkedAndHover,
children,
...rest
} = props;
const checkedAndDisabled = `input[type=${type}]:checked:disabled + &`;
const checkedAndHover = `input[type=${type}]:checked:hover:not(:disabled) + &`;
const checkedAndFocus = `input[type=${type}]:checked:focus + &`;
const disabled = `input[type=${type}]:disabled + &`;
const focus = `input[type=${type}]:focus + &`;
const hover = `input[type=${type}]:hover:not(:disabled):not(:checked) + &`;
const checked = `input[type=${type}]:checked + &, input[type=${type}][aria-checked=mixed] + &`;
const invalid = `input[type=${type}][aria-invalid=true] + &`;
const child = `& > *`;
return (0, import_jsx_runtime57.jsx)(
chakra.div,
{
...rest,
"aria-hidden": true,
__css: {
display: "inline-flex",
alignItems: "center",
justifyContent: "center",
transitionProperty: "common",
transitionDuration: "fast",
flexShrink: 0,
[focus]: _focus,
[hover]: _hover,
[disabled]: _disabled,
[invalid]: _invalid,
[checkedAndDisabled]: _checkedAndDisabled,
[checkedAndFocus]: _checkedAndFocus,
[checkedAndHover]: _checkedAndHover,
[child]: _child,
[checked]: {
..._checked,
[child]: _checkedAndChild
}
},
children
}
);
};
ControlBox.displayName = "ControlBox";
// ../../node_modules/@chakra-ui/react/dist/esm/divider/divider.mjs
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
var Divider = forwardRef7(
function Divider2(props, ref) {
const {
borderLeftWidth,
borderBottomWidth,
borderTopWidth,
borderRightWidth,
borderWidth,
borderStyle,
borderColor,
...styles2
} = useStyleConfig("Divider", props);
const {
className,
orientation = "horizontal",
__css,
...rest
} = omitThemingProps(props);
const dividerStyles = {
vertical: {
borderLeftWidth: borderLeftWidth || borderRightWidth || borderWidth || "1px",
height: "100%"
},
horizontal: {
borderBottomWidth: borderBottomWidth || borderTopWidth || borderWidth || "1px",
width: "100%"
}
};
return (0, import_jsx_runtime58.jsx)(
chakra.hr,
{
ref,
"aria-orientation": orientation,
...rest,
__css: {
...styles2,
border: "0",
borderColor,
borderStyle,
...dividerStyles[orientation],
...__css
},
className: cx("chakra-divider", className)
}
);
}
);
Divider.displayName = "Divider";
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable.mjs
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable-context.mjs
var [EditableStylesProvider, useEditableStyles] = createContext({
name: `EditableStylesContext`,
errorMessage: `useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
});
var [EditableProvider, useEditableContext] = createContext({
name: "EditableContext",
errorMessage: "useEditableContext: context is undefined. Seems you forgot to wrap the editable components in ``"
});
// ../../node_modules/@chakra-ui/react/dist/esm/editable/use-editable.mjs
var import_react114 = __toESM(require_react(), 1);
function contains2(parent, child) {
if (!parent)
return false;
return parent === child || parent.contains(child);
}
function useEditable(props = {}) {
const {
onChange: onChangeProp,
onCancel: onCancelProp,
onSubmit: onSubmitProp,
onBlur: onBlurProp,
value: valueProp,
isDisabled,
defaultValue,
startWithEditView,
isPreviewFocusable = true,
submitOnBlur = true,
selectAllOnFocus = true,
placeholder,
onEdit: onEditCallback,
finalFocusRef,
...htmlProps
} = props;
const onEditProp = useCallbackRef(onEditCallback);
const defaultIsEditing = Boolean(startWithEditView && !isDisabled);
const [isEditing, setIsEditing] = (0, import_react114.useState)(defaultIsEditing);
const [value, setValue] = useControllableState({
defaultValue: defaultValue || "",
value: valueProp,
onChange: onChangeProp
});
const [prevValue, setPrevValue] = (0, import_react114.useState)(value);
const inputRef = (0, import_react114.useRef)(null);
const previewRef = (0, import_react114.useRef)(null);
const editButtonRef = (0, import_react114.useRef)(null);
const cancelButtonRef = (0, import_react114.useRef)(null);
const submitButtonRef = (0, import_react114.useRef)(null);
useFocusOnPointerDown({
ref: inputRef,
enabled: isEditing,
elements: [cancelButtonRef, submitButtonRef]
});
const isInteractive = !isEditing && !isDisabled;
useSafeLayoutEffect(() => {
var _a8, _b3;
if (isEditing) {
(_a8 = inputRef.current) == null ? void 0 : _a8.focus();
if (selectAllOnFocus)
(_b3 = inputRef.current) == null ? void 0 : _b3.select();
}
}, []);
useUpdateEffect(() => {
var _a8, _b3, _c3, _d3;
if (!isEditing) {
if (finalFocusRef) {
(_a8 = finalFocusRef.current) == null ? void 0 : _a8.focus();
} else {
(_b3 = editButtonRef.current) == null ? void 0 : _b3.focus();
}
return;
}
(_c3 = inputRef.current) == null ? void 0 : _c3.focus();
if (selectAllOnFocus) {
(_d3 = inputRef.current) == null ? void 0 : _d3.select();
}
onEditProp == null ? void 0 : onEditProp();
}, [isEditing, onEditProp, selectAllOnFocus]);
const onEdit = (0, import_react114.useCallback)(() => {
if (isInteractive) {
setIsEditing(true);
}
}, [isInteractive]);
const onUpdatePrevValue = (0, import_react114.useCallback)(() => {
setPrevValue(value);
}, [value]);
const onCancel = (0, import_react114.useCallback)(() => {
setIsEditing(false);
setValue(prevValue);
onCancelProp == null ? void 0 : onCancelProp(prevValue);
onBlurProp == null ? void 0 : onBlurProp(prevValue);
}, [onCancelProp, onBlurProp, setValue, prevValue]);
const onSubmit = (0, import_react114.useCallback)(() => {
setIsEditing(false);
setPrevValue(value);
onSubmitProp == null ? void 0 : onSubmitProp(value);
onBlurProp == null ? void 0 : onBlurProp(prevValue);
}, [value, onSubmitProp, onBlurProp, prevValue]);
(0, import_react114.useEffect)(() => {
if (isEditing)
return;
const inputEl = inputRef.current;
if ((inputEl == null ? void 0 : inputEl.ownerDocument.activeElement) === inputEl) {
inputEl == null ? void 0 : inputEl.blur();
}
}, [isEditing]);
const onChange = (0, import_react114.useCallback)(
(event) => {
setValue(event.currentTarget.value);
},
[setValue]
);
const onKeyDown = (0, import_react114.useCallback)(
(event) => {
const eventKey = event.key;
const keyMap = {
Escape: onCancel,
Enter: (event2) => {
if (!event2.shiftKey && !event2.metaKey) {
onSubmit();
}
}
};
const action = keyMap[eventKey];
if (action) {
event.preventDefault();
action(event);
}
},
[onCancel, onSubmit]
);
const onKeyDownWithoutSubmit = (0, import_react114.useCallback)(
(event) => {
const eventKey = event.key;
const keyMap = {
Escape: onCancel
};
const action = keyMap[eventKey];
if (action) {
event.preventDefault();
action(event);
}
},
[onCancel]
);
const isValueEmpty = value.length === 0;
const onBlur3 = (0, import_react114.useCallback)(
(event) => {
if (!isEditing)
return;
const doc = event.currentTarget.ownerDocument;
const relatedTarget = event.relatedTarget ?? doc.activeElement;
const targetIsCancel = contains2(cancelButtonRef.current, relatedTarget);
const targetIsSubmit = contains2(submitButtonRef.current, relatedTarget);
const isValidBlur = !targetIsCancel && !targetIsSubmit;
if (isValidBlur) {
if (submitOnBlur) {
onSubmit();
} else {
onCancel();
}
}
},
[submitOnBlur, onSubmit, onCancel, isEditing]
);
const getPreviewProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => {
const tabIndex = isInteractive && isPreviewFocusable ? 0 : void 0;
return {
...props2,
ref: mergeRefs(ref, previewRef),
children: isValueEmpty ? placeholder : value,
hidden: isEditing,
"aria-disabled": ariaAttr(isDisabled),
tabIndex,
onFocus: callAllHandlers(props2.onFocus, onEdit, onUpdatePrevValue)
};
},
[
isDisabled,
isEditing,
isInteractive,
isPreviewFocusable,
isValueEmpty,
onEdit,
onUpdatePrevValue,
placeholder,
value
]
);
const getInputProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
hidden: !isEditing,
placeholder,
ref: mergeRefs(ref, inputRef),
disabled: isDisabled,
"aria-disabled": ariaAttr(isDisabled),
value,
onBlur: callAllHandlers(props2.onBlur, onBlur3),
onChange: callAllHandlers(props2.onChange, onChange),
onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDown),
onFocus: callAllHandlers(props2.onFocus, onUpdatePrevValue)
}),
[
isDisabled,
isEditing,
onBlur3,
onChange,
onKeyDown,
onUpdatePrevValue,
placeholder,
value
]
);
const getTextareaProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
hidden: !isEditing,
placeholder,
ref: mergeRefs(ref, inputRef),
disabled: isDisabled,
"aria-disabled": ariaAttr(isDisabled),
value,
onBlur: callAllHandlers(props2.onBlur, onBlur3),
onChange: callAllHandlers(props2.onChange, onChange),
onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDownWithoutSubmit),
onFocus: callAllHandlers(props2.onFocus, onUpdatePrevValue)
}),
[
isDisabled,
isEditing,
onBlur3,
onChange,
onKeyDownWithoutSubmit,
onUpdatePrevValue,
placeholder,
value
]
);
const getEditButtonProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => ({
"aria-label": "Edit",
...props2,
type: "button",
onClick: callAllHandlers(props2.onClick, onEdit),
ref: mergeRefs(ref, editButtonRef),
disabled: isDisabled
}),
[onEdit, isDisabled]
);
const getSubmitButtonProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
"aria-label": "Submit",
ref: mergeRefs(submitButtonRef, ref),
type: "button",
onClick: callAllHandlers(props2.onClick, onSubmit),
disabled: isDisabled
}),
[onSubmit, isDisabled]
);
const getCancelButtonProps = (0, import_react114.useCallback)(
(props2 = {}, ref = null) => ({
"aria-label": "Cancel",
id: "cancel",
...props2,
ref: mergeRefs(cancelButtonRef, ref),
type: "button",
onClick: callAllHandlers(props2.onClick, onCancel),
disabled: isDisabled
}),
[onCancel, isDisabled]
);
return {
isEditing,
isDisabled,
isValueEmpty,
value,
onEdit,
onCancel,
onSubmit,
getPreviewProps,
getInputProps,
getTextareaProps,
getEditButtonProps,
getSubmitButtonProps,
getCancelButtonProps,
htmlProps
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable.mjs
var Editable = forwardRef7(
function Editable2(props, ref) {
const styles2 = useMultiStyleConfig("Editable", props);
const ownProps = omitThemingProps(props);
const { htmlProps, ...context } = useEditable(ownProps);
const { isEditing, onSubmit, onCancel, onEdit } = context;
const _className = cx("chakra-editable", props.className);
const children = runIfFn(props.children, {
isEditing,
onSubmit,
onCancel,
onEdit
});
return (0, import_jsx_runtime59.jsx)(EditableProvider, { value: context, children: (0, import_jsx_runtime59.jsx)(EditableStylesProvider, { value: styles2, children: (0, import_jsx_runtime59.jsx)(
chakra.div,
{
ref,
...htmlProps,
className: _className,
children
}
) }) });
}
);
Editable.displayName = "Editable";
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable-input.mjs
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/editable/shared.mjs
var commonStyles = {
fontSize: "inherit",
fontWeight: "inherit",
textAlign: "inherit",
bg: "transparent"
};
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable-input.mjs
var EditableInput = forwardRef7(
function EditableInput2(props, ref) {
const { getInputProps } = useEditableContext();
const styles2 = useEditableStyles();
const inputProps = getInputProps(props, ref);
const _className = cx("chakra-editable__input", props.className);
return (0, import_jsx_runtime60.jsx)(
chakra.input,
{
...inputProps,
__css: {
outline: 0,
...commonStyles,
...styles2.input
},
className: _className
}
);
}
);
EditableInput.displayName = "EditableInput";
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable-preview.mjs
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
var EditablePreview = forwardRef7(
function EditablePreview2(props, ref) {
const { getPreviewProps } = useEditableContext();
const styles2 = useEditableStyles();
const previewProps = getPreviewProps(props, ref);
const _className = cx("chakra-editable__preview", props.className);
return (0, import_jsx_runtime61.jsx)(
chakra.span,
{
...previewProps,
__css: {
cursor: "text",
display: "inline-block",
...commonStyles,
...styles2.preview
},
className: _className
}
);
}
);
EditablePreview.displayName = "EditablePreview";
// ../../node_modules/@chakra-ui/react/dist/esm/editable/editable-textarea.mjs
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
var EditableTextarea = forwardRef7(
function EditableTextarea2(props, ref) {
const { getTextareaProps } = useEditableContext();
const styles2 = useEditableStyles();
const textareaProps = getTextareaProps(props, ref);
const _className = cx("chakra-editable__textarea", props.className);
return (0, import_jsx_runtime62.jsx)(
chakra.textarea,
{
...textareaProps,
__css: {
outline: 0,
...commonStyles,
...styles2.textarea
},
className: _className
}
);
}
);
EditableTextarea.displayName = "EditableTextarea";
// ../../node_modules/@chakra-ui/react/dist/esm/editable/use-editable-controls.mjs
function useEditableControls() {
const {
isEditing,
getEditButtonProps,
getCancelButtonProps,
getSubmitButtonProps
} = useEditableContext();
return {
isEditing,
getEditButtonProps,
getCancelButtonProps,
getSubmitButtonProps
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/editable/use-editable-state.mjs
function useEditableState() {
const { isEditing, onSubmit, onCancel, onEdit, isDisabled } = useEditableContext();
return {
isEditing,
onSubmit,
onCancel,
onEdit,
isDisabled
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/extend-theme/extend-theme.mjs
function isFunction4(value) {
return typeof value === "function";
}
function pipe4(...fns) {
return (v) => fns.reduce((a, b) => b(a), v);
}
var createExtendTheme = (theme2) => {
return function extendTheme2(...extensions) {
let overrides = [...extensions];
let activeTheme = extensions[extensions.length - 1];
if (isChakraTheme(activeTheme) && // this ensures backward compatibility
// previously only `extendTheme(override, activeTheme?)` was allowed
overrides.length > 1) {
overrides = overrides.slice(0, overrides.length - 1);
} else {
activeTheme = theme2;
}
return pipe4(
...overrides.map(
(extension) => (prevTheme) => isFunction4(extension) ? extension(prevTheme) : mergeThemeOverride(prevTheme, extension)
)
)(activeTheme);
};
};
var extendTheme = createExtendTheme(theme);
var extendBaseTheme = createExtendTheme(baseTheme);
function mergeThemeOverride(...overrides) {
return (0, import_lodash.default)({}, ...overrides, mergeThemeCustomizer);
}
function mergeThemeCustomizer(source, override, key, object2) {
if ((isFunction4(source) || isFunction4(override)) && Object.prototype.hasOwnProperty.call(object2, key)) {
return (...args) => {
const sourceValue = isFunction4(source) ? source(...args) : source;
const overrideValue = isFunction4(override) ? override(...args) : override;
return (0, import_lodash.default)({}, sourceValue, overrideValue, mergeThemeCustomizer);
};
}
if (isObject(source) && isArray(override)) {
return override;
}
if (isArray(source) && isObject(override)) {
return override;
}
return void 0;
}
// ../../node_modules/@chakra-ui/react/dist/esm/extend-theme/with-default-color-scheme.mjs
function withDefaultColorScheme({
colorScheme,
components: components2
}) {
return (theme2) => {
let names = Object.keys(theme2.components || {});
if (Array.isArray(components2)) {
names = components2;
} else if (isObject(components2)) {
names = Object.keys(components2);
}
return mergeThemeOverride(theme2, {
components: Object.fromEntries(
names.map((componentName) => {
const withColorScheme = {
defaultProps: {
colorScheme
}
};
return [componentName, withColorScheme];
})
)
});
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/extend-theme/with-default-size.mjs
function withDefaultSize({
size: size2,
components: components2
}) {
return (theme2) => {
let names = Object.keys(theme2.components || {});
if (Array.isArray(components2)) {
names = components2;
} else if (isObject(components2)) {
names = Object.keys(components2);
}
return mergeThemeOverride(theme2, {
components: Object.fromEntries(
names.map((componentName) => {
const withSize = {
defaultProps: {
size: size2
}
};
return [componentName, withSize];
})
)
});
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/extend-theme/with-default-variant.mjs
function withDefaultVariant({
variant,
components: components2
}) {
return (theme2) => {
let names = Object.keys(theme2.components || {});
if (Array.isArray(components2)) {
names = components2;
} else if (isObject(components2)) {
names = Object.keys(components2);
}
return mergeThemeOverride(theme2, {
components: Object.fromEntries(
names.map((componentName) => {
const withVariant = {
defaultProps: {
variant
}
};
return [componentName, withVariant];
})
)
});
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/extend-theme/with-default-props.mjs
function pipe5(...fns) {
return (v) => fns.reduce((a, b) => b(a), v);
}
function withDefaultProps({
defaultProps: { colorScheme, variant, size: size2 },
components: components2
}) {
const identity = (t2) => t2;
const fns = [
colorScheme ? withDefaultColorScheme({ colorScheme, components: components2 }) : identity,
size2 ? withDefaultSize({ size: size2, components: components2 }) : identity,
variant ? withDefaultVariant({ variant, components: components2 }) : identity
];
return (theme2) => mergeThemeOverride(pipe5(...fns)(theme2));
}
// ../../node_modules/@chakra-ui/react/dist/esm/flex/flex.mjs
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
var Flex = forwardRef7(function Flex2(props, ref) {
const { direction: direction2, align, justify, wrap: wrap5, basis, grow, shrink, ...rest } = props;
const styles2 = {
display: "flex",
flexDirection: direction2,
alignItems: align,
justifyContent: justify,
flexWrap: wrap5,
flexBasis: basis,
flexGrow: grow,
flexShrink: shrink
};
return (0, import_jsx_runtime63.jsx)(chakra.div, { ref, __css: styles2, ...rest });
});
Flex.displayName = "Flex";
// ../../node_modules/@chakra-ui/react/dist/esm/focus-lock/focus-lock.mjs
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(r2, e) {
if (null == r2) return {};
var t2 = {};
for (var n in r2) if ({}.hasOwnProperty.call(r2, n)) {
if (-1 !== e.indexOf(n)) continue;
t2[n] = r2[n];
}
return t2;
}
// ../../node_modules/react-focus-lock/dist/es2015/Combination.js
var import_react123 = __toESM(require_react());
// ../../node_modules/react-focus-lock/dist/es2015/Lock.js
var import_react120 = __toESM(require_react());
var import_prop_types2 = __toESM(require_prop_types());
// ../../node_modules/focus-lock/dist/es2015/constants.js
var FOCUS_GROUP = "data-focus-lock";
var FOCUS_DISABLED = "data-focus-lock-disabled";
var FOCUS_ALLOW = "data-no-focus-lock";
var FOCUS_AUTO = "data-autofocus-inside";
var FOCUS_NO_AUTOFOCUS = "data-no-autofocus";
// ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
function assignRef2(ref, value) {
if (typeof ref === "function") {
ref(value);
} else if (ref) {
ref.current = value;
}
return ref;
}
// ../../node_modules/use-callback-ref/dist/es2015/useRef.js
var import_react115 = __toESM(require_react());
function useCallbackRef2(initialValue, callback) {
var ref = (0, import_react115.useState)(function() {
return {
// value
value: initialValue,
// last callback
callback,
// "memoized" public interface
facade: {
get current() {
return ref.value;
},
set current(value) {
var last = ref.value;
if (last !== value) {
ref.value = value;
ref.callback(value, last);
}
}
}
};
})[0];
ref.callback = callback;
return ref.facade;
}
// ../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js
var React16 = __toESM(require_react());
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? React16.useLayoutEffect : React16.useEffect;
var currentValues = /* @__PURE__ */ new WeakMap();
function useMergeRefs2(refs, defaultValue) {
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
return refs.forEach(function(ref) {
return assignRef2(ref, newValue);
});
});
useIsomorphicLayoutEffect2(function() {
var oldValue = currentValues.get(callbackRef);
if (oldValue) {
var prevRefs_1 = new Set(oldValue);
var nextRefs_1 = new Set(refs);
var current_1 = callbackRef.current;
prevRefs_1.forEach(function(ref) {
if (!nextRefs_1.has(ref)) {
assignRef2(ref, null);
}
});
nextRefs_1.forEach(function(ref) {
if (!prevRefs_1.has(ref)) {
assignRef2(ref, current_1);
}
});
}
currentValues.set(callbackRef, refs);
}, [refs]);
return callbackRef;
}
// ../../node_modules/react-focus-lock/dist/es2015/FocusGuard.js
var import_react116 = __toESM(require_react());
var import_prop_types = __toESM(require_prop_types());
var hiddenGuard = {
width: "1px",
height: "0px",
padding: 0,
overflow: "hidden",
position: "fixed",
top: "1px",
left: "1px"
};
var InFocusGuard = function InFocusGuard2(_ref2) {
var _ref$children = _ref2.children, children = _ref$children === void 0 ? null : _ref$children;
return import_react116.default.createElement(import_react116.Fragment, null, import_react116.default.createElement("div", {
key: "guard-first",
"data-focus-guard": true,
"data-focus-auto-guard": true,
style: hiddenGuard
}), children, children && import_react116.default.createElement("div", {
key: "guard-last",
"data-focus-guard": true,
"data-focus-auto-guard": true,
style: hiddenGuard
}));
};
InFocusGuard.propTypes = true ? {
children: import_prop_types.default.node
} : {};
// ../../node_modules/use-sidecar/dist/es2015/hoc.js
var React18 = __toESM(require_react());
// ../../node_modules/use-sidecar/dist/es2015/hook.js
var import_react117 = __toESM(require_react());
// ../../node_modules/use-sidecar/dist/es2015/medium.js
function ItoI(a) {
return a;
}
function innerCreateMedium(defaults2, middleware2) {
if (middleware2 === void 0) {
middleware2 = ItoI;
}
var buffer = [];
var assigned = false;
var medium = {
read: function() {
if (assigned) {
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
}
if (buffer.length) {
return buffer[buffer.length - 1];
}
return defaults2;
},
useMedium: function(data) {
var item = middleware2(data, assigned);
buffer.push(item);
return function() {
buffer = buffer.filter(function(x) {
return x !== item;
});
};
},
assignSyncMedium: function(cb) {
assigned = true;
while (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
}
buffer = {
push: function(x) {
return cb(x);
},
filter: function() {
return buffer;
}
};
},
assignMedium: function(cb) {
assigned = true;
var pendingQueue = [];
if (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
pendingQueue = buffer;
}
var executeQueue = function() {
var cbs2 = pendingQueue;
pendingQueue = [];
cbs2.forEach(cb);
};
var cycle = function() {
return Promise.resolve().then(executeQueue);
};
cycle();
buffer = {
push: function(x) {
pendingQueue.push(x);
cycle();
},
filter: function(filter4) {
pendingQueue = pendingQueue.filter(filter4);
return buffer;
}
};
}
};
return medium;
}
function createMedium(defaults2, middleware2) {
if (middleware2 === void 0) {
middleware2 = ItoI;
}
return innerCreateMedium(defaults2, middleware2);
}
function createSidecarMedium(options) {
if (options === void 0) {
options = {};
}
var medium = innerCreateMedium(null);
medium.options = __assign({ async: true, ssr: false }, options);
return medium;
}
// ../../node_modules/use-sidecar/dist/es2015/renderProp.js
var React19 = __toESM(require_react());
var import_react118 = __toESM(require_react());
// ../../node_modules/use-sidecar/dist/es2015/exports.js
var React20 = __toESM(require_react());
var SideCar = function(_a8) {
var sideCar2 = _a8.sideCar, rest = __rest(_a8, ["sideCar"]);
if (!sideCar2) {
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
}
var Target = sideCar2.read();
if (!Target) {
throw new Error("Sidecar medium not found");
}
return React20.createElement(Target, __assign({}, rest));
};
SideCar.isSideCarExport = true;
function exportSidecar(medium, exported) {
medium.useMedium(exported);
return SideCar;
}
// ../../node_modules/react-focus-lock/dist/es2015/medium.js
var mediumFocus = createMedium({}, function(_ref2) {
var target = _ref2.target, currentTarget = _ref2.currentTarget;
return {
target,
currentTarget
};
});
var mediumBlur = createMedium();
var mediumEffect = createMedium();
var mediumSidecar = createSidecarMedium({
async: true,
ssr: typeof document !== "undefined"
});
// ../../node_modules/react-focus-lock/dist/es2015/scope.js
var import_react119 = __toESM(require_react());
var focusScope = (0, import_react119.createContext)(void 0);
// ../../node_modules/react-focus-lock/dist/es2015/Lock.js
var emptyArray = [];
var FocusLock = (0, import_react120.forwardRef)(function FocusLockUI(props, parentRef) {
var _extends2;
var _useState = (0, import_react120.useState)(), realObserved = _useState[0], setObserved = _useState[1];
var observed = (0, import_react120.useRef)();
var isActive = (0, import_react120.useRef)(false);
var originalFocusedElement = (0, import_react120.useRef)(null);
var _useState2 = (0, import_react120.useState)({}), update = _useState2[1];
var children = props.children, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$noFocusGuards = props.noFocusGuards, noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards, _props$persistentFocu = props.persistentFocus, persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu, _props$crossFrame = props.crossFrame, crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame, _props$autoFocus = props.autoFocus, autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus, allowTextSelection = props.allowTextSelection, group = props.group, className = props.className, whiteList = props.whiteList, hasPositiveIndices = props.hasPositiveIndices, _props$shards = props.shards, shards = _props$shards === void 0 ? emptyArray : _props$shards, _props$as = props.as, Container3 = _props$as === void 0 ? "div" : _props$as, _props$lockProps = props.lockProps, containerProps = _props$lockProps === void 0 ? {} : _props$lockProps, SideCar2 = props.sideCar, _props$returnFocus = props.returnFocus, shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus, focusOptions = props.focusOptions, onActivationCallback = props.onActivation, onDeactivationCallback = props.onDeactivation;
var _useState3 = (0, import_react120.useState)({}), id3 = _useState3[0];
var onActivation = (0, import_react120.useCallback)(function(_ref2) {
var captureFocusRestore2 = _ref2.captureFocusRestore;
if (!originalFocusedElement.current) {
var _document;
var activeElement = (_document = document) == null ? void 0 : _document.activeElement;
originalFocusedElement.current = activeElement;
if (activeElement !== document.body) {
originalFocusedElement.current = captureFocusRestore2(activeElement);
}
}
if (observed.current && onActivationCallback) {
onActivationCallback(observed.current);
}
isActive.current = true;
update();
}, [onActivationCallback]);
var onDeactivation = (0, import_react120.useCallback)(function() {
isActive.current = false;
if (onDeactivationCallback) {
onDeactivationCallback(observed.current);
}
update();
}, [onDeactivationCallback]);
var returnFocus = (0, import_react120.useCallback)(function(allowDefer) {
var focusRestore = originalFocusedElement.current;
if (focusRestore) {
var returnFocusTo = (typeof focusRestore === "function" ? focusRestore() : focusRestore) || document.body;
var howToReturnFocus = typeof shouldReturnFocus === "function" ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;
if (howToReturnFocus) {
var returnFocusOptions = typeof howToReturnFocus === "object" ? howToReturnFocus : void 0;
originalFocusedElement.current = null;
if (allowDefer) {
Promise.resolve().then(function() {
return returnFocusTo.focus(returnFocusOptions);
});
} else {
returnFocusTo.focus(returnFocusOptions);
}
}
}
}, [shouldReturnFocus]);
var onFocus3 = (0, import_react120.useCallback)(function(event) {
if (isActive.current) {
mediumFocus.useMedium(event);
}
}, []);
var onBlur3 = mediumBlur.useMedium;
var setObserveNode = (0, import_react120.useCallback)(function(newObserved) {
if (observed.current !== newObserved) {
observed.current = newObserved;
setObserved(newObserved);
}
}, []);
if (true) {
if (typeof allowTextSelection !== "undefined") {
console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default");
}
(0, import_react120.useEffect)(function() {
if (!observed.current && typeof Container3 !== "string") {
console.error("FocusLock: could not obtain ref to internal node");
}
}, []);
}
var lockProps = _extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && "disabled", _extends2[FOCUS_GROUP] = group, _extends2), containerProps);
var hasLeadingGuards = noFocusGuards !== true;
var hasTailingGuards = hasLeadingGuards && noFocusGuards !== "tail";
var mergedRef = useMergeRefs2([parentRef, setObserveNode]);
var focusScopeValue = (0, import_react120.useMemo)(function() {
return {
observed,
shards,
enabled: !disabled,
active: isActive.current
};
}, [disabled, isActive.current, shards, realObserved]);
return import_react120.default.createElement(import_react120.Fragment, null, hasLeadingGuards && [
import_react120.default.createElement("div", {
key: "guard-first",
"data-focus-guard": true,
tabIndex: disabled ? -1 : 0,
style: hiddenGuard
}),
hasPositiveIndices ? import_react120.default.createElement("div", {
key: "guard-nearest",
"data-focus-guard": true,
tabIndex: disabled ? -1 : 1,
style: hiddenGuard
}) : null
], !disabled && import_react120.default.createElement(SideCar2, {
id: id3,
sideCar: mediumSidecar,
observed: realObserved,
disabled,
persistentFocus,
crossFrame,
autoFocus,
whiteList,
shards,
onActivation,
onDeactivation,
returnFocus,
focusOptions,
noFocusGuards
}), import_react120.default.createElement(Container3, _extends({
ref: mergedRef
}, lockProps, {
className,
onBlur: onBlur3,
onFocus: onFocus3
}), import_react120.default.createElement(focusScope.Provider, {
value: focusScopeValue
}, children)), hasTailingGuards && import_react120.default.createElement("div", {
"data-focus-guard": true,
tabIndex: disabled ? -1 : 0,
style: hiddenGuard
}));
});
FocusLock.propTypes = true ? {
children: import_prop_types2.node,
disabled: import_prop_types2.bool,
returnFocus: (0, import_prop_types2.oneOfType)([import_prop_types2.bool, import_prop_types2.object, import_prop_types2.func]),
focusOptions: import_prop_types2.object,
noFocusGuards: import_prop_types2.bool,
hasPositiveIndices: import_prop_types2.bool,
allowTextSelection: import_prop_types2.bool,
autoFocus: import_prop_types2.bool,
persistentFocus: import_prop_types2.bool,
crossFrame: import_prop_types2.bool,
group: import_prop_types2.string,
className: import_prop_types2.string,
whiteList: import_prop_types2.func,
shards: (0, import_prop_types2.arrayOf)(import_prop_types2.any),
as: (0, import_prop_types2.oneOfType)([import_prop_types2.string, import_prop_types2.func, import_prop_types2.object]),
lockProps: import_prop_types2.object,
onActivation: import_prop_types2.func,
onDeactivation: import_prop_types2.func,
sideCar: import_prop_types2.any.isRequired
} : {};
var Lock_default = FocusLock;
// ../../node_modules/react-focus-lock/dist/es2015/Trap.js
var import_react122 = __toESM(require_react());
var import_prop_types3 = __toESM(require_prop_types());
// ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(t2, e) {
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e2) {
return t3.__proto__ = e2, t3;
}, _setPrototypeOf(t2, e);
}
// ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
function _inheritsLoose(t2, o) {
t2.prototype = Object.create(o.prototype), t2.prototype.constructor = t2, _setPrototypeOf(t2, o);
}
// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
return typeof o2;
} : function(o2) {
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
}, _typeof(o);
}
// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
function toPrimitive(t2, r2) {
if ("object" != _typeof(t2) || !t2) return t2;
var e = t2[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t2, r2 || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r2 ? String : Number)(t2);
}
// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
function toPropertyKey(t2) {
var i = toPrimitive(t2, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
function _defineProperty(e, r2, t2) {
return (r2 = toPropertyKey(r2)) in e ? Object.defineProperty(e, r2, {
value: t2,
enumerable: true,
configurable: true,
writable: true
}) : e[r2] = t2, e;
}
// ../../node_modules/react-clientside-effect/lib/index.es.js
var import_react121 = __toESM(require_react());
function withSideEffect(reducePropsToState2, handleStateChangeOnClient2) {
if (true) {
if (typeof reducePropsToState2 !== "function") {
throw new Error("Expected reducePropsToState to be a function.");
}
if (typeof handleStateChangeOnClient2 !== "function") {
throw new Error("Expected handleStateChangeOnClient to be a function.");
}
}
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || "Component";
}
return function wrap5(WrappedComponent) {
if (true) {
if (typeof WrappedComponent !== "function") {
throw new Error("Expected WrappedComponent to be a React component.");
}
}
var mountedInstances = [];
var state2;
function emitChange() {
state2 = reducePropsToState2(mountedInstances.map(function(instance) {
return instance.props;
}));
handleStateChangeOnClient2(state2);
}
var SideEffect = function(_PureComponent) {
_inheritsLoose(SideEffect2, _PureComponent);
function SideEffect2() {
return _PureComponent.apply(this, arguments) || this;
}
SideEffect2.peek = function peek2() {
return state2;
};
var _proto = SideEffect2.prototype;
_proto.componentDidMount = function componentDidMount() {
mountedInstances.push(this);
emitChange();
};
_proto.componentDidUpdate = function componentDidUpdate() {
emitChange();
};
_proto.componentWillUnmount = function componentWillUnmount() {
var index2 = mountedInstances.indexOf(this);
mountedInstances.splice(index2, 1);
emitChange();
};
_proto.render = function render() {
return import_react121.default.createElement(WrappedComponent, this.props);
};
return SideEffect2;
}(import_react121.PureComponent);
_defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")");
return SideEffect;
};
}
var index_es_default = withSideEffect;
// ../../node_modules/focus-lock/dist/es2015/utils/array.js
var toArray = function(a) {
var ret = Array(a.length);
for (var i = 0; i < a.length; ++i) {
ret[i] = a[i];
}
return ret;
};
var asArray = function(a) {
return Array.isArray(a) ? a : [a];
};
var getFirst = function(a) {
return Array.isArray(a) ? a[0] : a;
};
// ../../node_modules/focus-lock/dist/es2015/utils/is.js
var isElementHidden = function(node3) {
if (node3.nodeType !== Node.ELEMENT_NODE) {
return false;
}
var computedStyle = window.getComputedStyle(node3, null);
if (!computedStyle || !computedStyle.getPropertyValue) {
return false;
}
return computedStyle.getPropertyValue("display") === "none" || computedStyle.getPropertyValue("visibility") === "hidden";
};
var getParentNode = function(node3) {
return node3.parentNode && node3.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
node3.parentNode.host
) : node3.parentNode;
};
var isTopNode = function(node3) {
return node3 === document || node3 && node3.nodeType === Node.DOCUMENT_NODE;
};
var isInert = function(node3) {
return node3.hasAttribute("inert");
};
var isVisibleUncached = function(node3, checkParent) {
return !node3 || isTopNode(node3) || !isElementHidden(node3) && !isInert(node3) && checkParent(getParentNode(node3));
};
var isVisibleCached = function(visibilityCache, node3) {
var cached = visibilityCache.get(node3);
if (cached !== void 0) {
return cached;
}
var result = isVisibleUncached(node3, isVisibleCached.bind(void 0, visibilityCache));
visibilityCache.set(node3, result);
return result;
};
var isAutoFocusAllowedUncached = function(node3, checkParent) {
return node3 && !isTopNode(node3) ? isAutoFocusAllowed(node3) ? checkParent(getParentNode(node3)) : false : true;
};
var isAutoFocusAllowedCached = function(cache, node3) {
var cached = cache.get(node3);
if (cached !== void 0) {
return cached;
}
var result = isAutoFocusAllowedUncached(node3, isAutoFocusAllowedCached.bind(void 0, cache));
cache.set(node3, result);
return result;
};
var getDataset = function(node3) {
return node3.dataset;
};
var isHTMLButtonElement = function(node3) {
return node3.tagName === "BUTTON";
};
var isHTMLInputElement = function(node3) {
return node3.tagName === "INPUT";
};
var isRadioElement = function(node3) {
return isHTMLInputElement(node3) && node3.type === "radio";
};
var notHiddenInput = function(node3) {
return !((isHTMLInputElement(node3) || isHTMLButtonElement(node3)) && (node3.type === "hidden" || node3.disabled));
};
var isAutoFocusAllowed = function(node3) {
var attribute = node3.getAttribute(FOCUS_NO_AUTOFOCUS);
return ![true, "true", ""].includes(attribute);
};
var isGuard = function(node3) {
var _a8;
return Boolean(node3 && ((_a8 = getDataset(node3)) === null || _a8 === void 0 ? void 0 : _a8.focusGuard));
};
var isNotAGuard = function(node3) {
return !isGuard(node3);
};
var isDefined2 = function(x) {
return Boolean(x);
};
// ../../node_modules/focus-lock/dist/es2015/utils/tabOrder.js
var tabSort = function(a, b) {
var aTab = Math.max(0, a.tabIndex);
var bTab = Math.max(0, b.tabIndex);
var tabDiff = aTab - bTab;
var indexDiff = a.index - b.index;
if (tabDiff) {
if (!aTab) {
return 1;
}
if (!bTab) {
return -1;
}
}
return tabDiff || indexDiff;
};
var getTabIndex = function(node3) {
if (node3.tabIndex < 0) {
if (!node3.hasAttribute("tabindex")) {
return 0;
}
}
return node3.tabIndex;
};
var orderByTabIndex = function(nodes, filterNegative, keepGuards) {
return toArray(nodes).map(function(node3, index2) {
var tabIndex = getTabIndex(node3);
return {
node: node3,
index: index2,
tabIndex: keepGuards && tabIndex === -1 ? (node3.dataset || {}).focusGuard ? 0 : -1 : tabIndex
};
}).filter(function(data) {
return !filterNegative || data.tabIndex >= 0;
}).sort(tabSort);
};
// ../../node_modules/focus-lock/dist/es2015/utils/tabbables.js
var tabbables = [
"button:enabled",
"select:enabled",
"textarea:enabled",
"input:enabled",
// elements with explicit roles will also use explicit tabindex
// '[role="button"]',
"a[href]",
"area[href]",
"summary",
"iframe",
"object",
"embed",
"audio[controls]",
"video[controls]",
"[tabindex]",
"[contenteditable]",
"[autofocus]"
];
// ../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js
var queryTabbables = tabbables.join(",");
var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]");
var getFocusablesWithShadowDom = function(parent, withGuards) {
return toArray((parent.shadowRoot || parent).children).reduce(function(acc, child) {
return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));
}, []);
};
var getFocusablesWithIFrame = function(parent, withGuards) {
var _a8;
if (parent instanceof HTMLIFrameElement && ((_a8 = parent.contentDocument) === null || _a8 === void 0 ? void 0 : _a8.body)) {
return getFocusables([parent.contentDocument.body], withGuards);
}
return [parent];
};
var getFocusables = function(parents, withGuards) {
return parents.reduce(function(acc, parent) {
var _a8;
var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);
var focusableWithIframes = (_a8 = []).concat.apply(_a8, focusableWithShadowDom.map(function(node3) {
return getFocusablesWithIFrame(node3, withGuards);
}));
return acc.concat(
// add all tabbables inside and within shadow DOMs in DOM order
focusableWithIframes,
// add if node is tabbable itself
parent.parentNode ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node3) {
return node3 === parent;
}) : []
);
}, []);
};
var getParentAutofocusables = function(parent) {
var parentFocus = parent.querySelectorAll("[".concat(FOCUS_AUTO, "]"));
return toArray(parentFocus).map(function(node3) {
return getFocusables([node3]);
}).reduce(function(acc, nodes) {
return acc.concat(nodes);
}, []);
};
// ../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js
var filterFocusable = function(nodes, visibilityCache) {
return toArray(nodes).filter(function(node3) {
return isVisibleCached(visibilityCache, node3);
}).filter(function(node3) {
return notHiddenInput(node3);
});
};
var filterAutoFocusable = function(nodes, cache) {
if (cache === void 0) {
cache = /* @__PURE__ */ new Map();
}
return toArray(nodes).filter(function(node3) {
return isAutoFocusAllowedCached(cache, node3);
});
};
var getTabbableNodes = function(topNodes, visibilityCache, withGuards) {
return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);
};
var getFocusableNodes = function(topNodes, visibilityCache) {
return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);
};
var parentAutofocusables = function(topNode, visibilityCache) {
return filterFocusable(getParentAutofocusables(topNode), visibilityCache);
};
var contains3 = function(scope, element) {
if (scope.shadowRoot) {
return contains3(scope.shadowRoot, element);
} else {
if (Object.getPrototypeOf(scope).contains !== void 0 && Object.getPrototypeOf(scope).contains.call(scope, element)) {
return true;
}
return toArray(scope.children).some(function(child) {
var _a8;
if (child instanceof HTMLIFrameElement) {
var iframeBody = (_a8 = child.contentDocument) === null || _a8 === void 0 ? void 0 : _a8.body;
if (iframeBody) {
return contains3(iframeBody, element);
}
return false;
}
return contains3(child, element);
});
}
};
// ../../node_modules/focus-lock/dist/es2015/utils/all-affected.js
var filterNested = function(nodes) {
var contained = /* @__PURE__ */ new Set();
var l = nodes.length;
for (var i = 0; i < l; i += 1) {
for (var j = i + 1; j < l; j += 1) {
var position3 = nodes[i].compareDocumentPosition(nodes[j]);
if ((position3 & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) {
contained.add(j);
}
if ((position3 & Node.DOCUMENT_POSITION_CONTAINS) > 0) {
contained.add(i);
}
}
}
return nodes.filter(function(_, index2) {
return !contained.has(index2);
});
};
var getTopParent = function(node3) {
return node3.parentNode ? getTopParent(node3.parentNode) : node3;
};
var getAllAffectedNodes = function(node3) {
var nodes = asArray(node3);
return nodes.filter(Boolean).reduce(function(acc, currentNode) {
var group = currentNode.getAttribute(FOCUS_GROUP);
acc.push.apply(acc, group ? filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, '="').concat(group, '"]:not([').concat(FOCUS_DISABLED, '="disabled"])')))) : [currentNode]);
return acc;
}, []);
};
// ../../node_modules/focus-lock/dist/es2015/utils/safe.js
var safeProbe = function(cb) {
try {
return cb();
} catch (e) {
return void 0;
}
};
// ../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js
var getActiveElement2 = function(inDocument) {
if (inDocument === void 0) {
inDocument = document;
}
if (!inDocument || !inDocument.activeElement) {
return void 0;
}
var activeElement = inDocument.activeElement;
return activeElement.shadowRoot ? getActiveElement2(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function() {
return activeElement.contentWindow.document;
}) ? getActiveElement2(activeElement.contentWindow.document) : activeElement;
};
// ../../node_modules/focus-lock/dist/es2015/focusInside.js
var focusInFrame = function(frame3, activeElement) {
return frame3 === activeElement;
};
var focusInsideIframe = function(topNode, activeElement) {
return Boolean(toArray(topNode.querySelectorAll("iframe")).some(function(node3) {
return focusInFrame(node3, activeElement);
}));
};
var focusInside = function(topNode, activeElement) {
if (activeElement === void 0) {
activeElement = getActiveElement2(getFirst(topNode).ownerDocument);
}
if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) {
return false;
}
return getAllAffectedNodes(topNode).some(function(node3) {
return contains3(node3, activeElement) || focusInsideIframe(node3, activeElement);
});
};
// ../../node_modules/focus-lock/dist/es2015/focusIsHidden.js
var focusIsHidden = function(inDocument) {
if (inDocument === void 0) {
inDocument = document;
}
var activeElement = getActiveElement2(inDocument);
if (!activeElement) {
return false;
}
return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function(node3) {
return contains3(node3, activeElement);
});
};
// ../../node_modules/focus-lock/dist/es2015/utils/correctFocus.js
var findSelectedRadio = function(node3, nodes) {
return nodes.filter(isRadioElement).filter(function(el) {
return el.name === node3.name;
}).filter(function(el) {
return el.checked;
})[0] || node3;
};
var correctNode = function(node3, nodes) {
if (isRadioElement(node3) && node3.name) {
return findSelectedRadio(node3, nodes);
}
return node3;
};
var correctNodes = function(nodes) {
var resultSet = /* @__PURE__ */ new Set();
nodes.forEach(function(node3) {
return resultSet.add(correctNode(node3, nodes));
});
return nodes.filter(function(node3) {
return resultSet.has(node3);
});
};
// ../../node_modules/focus-lock/dist/es2015/utils/firstFocus.js
var pickFirstFocus = function(nodes) {
if (nodes[0] && nodes.length > 1) {
return correctNode(nodes[0], nodes);
}
return nodes[0];
};
var pickFocusable = function(nodes, node3) {
return nodes.indexOf(correctNode(node3, nodes));
};
// ../../node_modules/focus-lock/dist/es2015/solver.js
var NEW_FOCUS = "NEW_FOCUS";
var newFocus = function(innerNodes, innerTabbables, outerNodes, activeElement, lastNode) {
var cnt = innerNodes.length;
var firstFocus = innerNodes[0];
var lastFocus = innerNodes[cnt - 1];
var isOnGuard = isGuard(activeElement);
if (activeElement && innerNodes.indexOf(activeElement) >= 0) {
return void 0;
}
var activeIndex = activeElement !== void 0 ? outerNodes.indexOf(activeElement) : -1;
var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;
var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;
if (activeIndex === -1) {
if (lastNodeInside !== -1) {
return lastNodeInside;
}
return NEW_FOCUS;
}
if (lastNodeInside === -1) {
return NEW_FOCUS;
}
var indexDiff = activeIndex - lastIndex;
var firstNodeIndex = outerNodes.indexOf(firstFocus);
var lastNodeIndex = outerNodes.indexOf(lastFocus);
var correctedNodes = correctNodes(outerNodes);
var currentFocusableIndex = activeElement !== void 0 ? correctedNodes.indexOf(activeElement) : -1;
var previousFocusableIndex = lastNode ? correctedNodes.indexOf(lastNode) : currentFocusableIndex;
var tabbableNodes = correctedNodes.filter(function(node3) {
return node3.tabIndex >= 0;
});
var currentTabbableIndex = activeElement !== void 0 ? tabbableNodes.indexOf(activeElement) : -1;
var previousTabbableIndex = lastNode ? tabbableNodes.indexOf(lastNode) : currentTabbableIndex;
var focusIndexDiff = currentTabbableIndex >= 0 && previousTabbableIndex >= 0 ? (
// old/new are tabbables, measure distance in tabbable space
previousTabbableIndex - currentTabbableIndex
) : (
// or else measure in focusable space
previousFocusableIndex - currentFocusableIndex
);
if (!indexDiff && lastNodeInside >= 0) {
return lastNodeInside;
}
if (innerTabbables.length === 0) {
return lastNodeInside;
}
var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {
return returnLastNode;
}
if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) {
return returnFirstNode;
}
if (indexDiff && Math.abs(focusIndexDiff) > 1) {
return lastNodeInside;
}
if (activeIndex <= firstNodeIndex) {
return returnLastNode;
}
if (activeIndex > lastNodeIndex) {
return returnFirstNode;
}
if (indexDiff) {
if (Math.abs(indexDiff) > 1) {
return lastNodeInside;
}
return (cnt + lastNodeInside + indexDiff) % cnt;
}
return void 0;
};
// ../../node_modules/focus-lock/dist/es2015/utils/auto-focus.js
var findAutoFocused = function(autoFocusables) {
return function(node3) {
var _a8;
var autofocus = (_a8 = getDataset(node3)) === null || _a8 === void 0 ? void 0 : _a8.autofocus;
return (
// @ts-expect-error
node3.autofocus || //
autofocus !== void 0 && autofocus !== "false" || //
autoFocusables.indexOf(node3) >= 0
);
};
};
var pickAutofocus = function(nodesIndexes, orderedNodes, groups) {
var nodes = nodesIndexes.map(function(_a8) {
var node3 = _a8.node;
return node3;
});
var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));
if (autoFocusable && autoFocusable.length) {
return pickFirstFocus(autoFocusable);
}
return pickFirstFocus(filterAutoFocusable(orderedNodes));
};
// ../../node_modules/focus-lock/dist/es2015/utils/parenting.js
var getParents = function(node3, parents) {
if (parents === void 0) {
parents = [];
}
parents.push(node3);
if (node3.parentNode) {
getParents(node3.parentNode.host || node3.parentNode, parents);
}
return parents;
};
var getCommonParent = function(nodeA, nodeB) {
var parentsA = getParents(nodeA);
var parentsB = getParents(nodeB);
for (var i = 0; i < parentsA.length; i += 1) {
var currentParent = parentsA[i];
if (parentsB.indexOf(currentParent) >= 0) {
return currentParent;
}
}
return false;
};
var getTopCommonParent = function(baseActiveElement, leftEntry, rightEntries) {
var activeElements = asArray(baseActiveElement);
var leftEntries = asArray(leftEntry);
var activeElement = activeElements[0];
var topCommon = false;
leftEntries.filter(Boolean).forEach(function(entry) {
topCommon = getCommonParent(topCommon || entry, entry) || topCommon;
rightEntries.filter(Boolean).forEach(function(subEntry) {
var common = getCommonParent(activeElement, subEntry);
if (common) {
if (!topCommon || contains3(common, topCommon)) {
topCommon = common;
} else {
topCommon = getCommonParent(common, topCommon);
}
}
});
});
return topCommon;
};
var allParentAutofocusables = function(entries, visibilityCache) {
return entries.reduce(function(acc, node3) {
return acc.concat(parentAutofocusables(node3, visibilityCache));
}, []);
};
// ../../node_modules/focus-lock/dist/es2015/focusSolver.js
var reorderNodes = function(srcNodes, dstNodes) {
var remap = /* @__PURE__ */ new Map();
dstNodes.forEach(function(entity) {
return remap.set(entity.node, entity);
});
return srcNodes.map(function(node3) {
return remap.get(node3);
}).filter(isDefined2);
};
var focusSolver = function(topNode, lastNode) {
var activeElement = getActiveElement2(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
var visibilityCache = /* @__PURE__ */ new Map();
var anyFocusable = getFocusableNodes(entries, visibilityCache);
var innerElements = anyFocusable.filter(function(_a8) {
var node3 = _a8.node;
return isNotAGuard(node3);
});
if (!innerElements[0]) {
return void 0;
}
var outerNodes = getFocusableNodes([commonParent], visibilityCache).map(function(_a8) {
var node3 = _a8.node;
return node3;
});
var orderedInnerElements = reorderNodes(outerNodes, innerElements);
var innerFocusables = orderedInnerElements.map(function(_a8) {
var node3 = _a8.node;
return node3;
});
var innerTabbable = orderedInnerElements.filter(function(_a8) {
var tabIndex = _a8.tabIndex;
return tabIndex >= 0;
}).map(function(_a8) {
var node3 = _a8.node;
return node3;
});
var newId = newFocus(innerFocusables, innerTabbable, outerNodes, activeElement, lastNode);
if (newId === NEW_FOCUS) {
var focusNode = (
// first try only tabbable, and the fallback to all focusable, as long as at least one element should be picked for focus
pickAutofocus(anyFocusable, innerTabbable, allParentAutofocusables(entries, visibilityCache)) || pickAutofocus(anyFocusable, innerFocusables, allParentAutofocusables(entries, visibilityCache))
);
if (focusNode) {
return { node: focusNode };
} else {
console.warn("focus-lock: cannot find any node to move focus into");
return void 0;
}
}
if (newId === void 0) {
return newId;
}
return orderedInnerElements[newId];
};
// ../../node_modules/focus-lock/dist/es2015/focusables.js
var expandFocusableNodes = function(topNode) {
var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
var commonParent = getTopCommonParent(topNode, topNode, entries);
var outerNodes = orderByTabIndex(getFocusables([commonParent], true), true, true);
var innerElements = getFocusables(entries, false);
return outerNodes.map(function(_a8) {
var node3 = _a8.node, index2 = _a8.index;
return {
node: node3,
index: index2,
lockItem: innerElements.indexOf(node3) >= 0,
guard: isGuard(node3)
};
});
};
// ../../node_modules/focus-lock/dist/es2015/commands.js
var focusOn = function(target, focusOptions) {
if (!target) {
return;
}
if ("focus" in target) {
target.focus(focusOptions);
}
if ("contentWindow" in target && target.contentWindow) {
target.contentWindow.focus();
}
};
// ../../node_modules/focus-lock/dist/es2015/moveFocusInside.js
var guardCount = 0;
var lockDisabled = false;
var moveFocusInside = function(topNode, lastNode, options) {
if (options === void 0) {
options = {};
}
var focusable = focusSolver(topNode, lastNode);
if (lockDisabled) {
return;
}
if (focusable) {
if (guardCount > 2) {
console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting");
lockDisabled = true;
setTimeout(function() {
lockDisabled = false;
}, 1);
return;
}
guardCount++;
focusOn(focusable.node, options.focusOptions);
guardCount--;
}
};
// ../../node_modules/focus-lock/dist/es2015/return-focus.js
function weakRef(value) {
if (!value)
return null;
if (typeof WeakRef === "undefined") {
return function() {
return value || null;
};
}
var w = value ? new WeakRef(value) : null;
return function() {
return (w === null || w === void 0 ? void 0 : w.deref()) || null;
};
}
var recordElementLocation = function(element) {
if (!element) {
return null;
}
var stack = [];
var currentElement = element;
while (currentElement && currentElement !== document.body) {
stack.push({
current: weakRef(currentElement),
parent: weakRef(currentElement.parentElement),
left: weakRef(currentElement.previousElementSibling),
right: weakRef(currentElement.nextElementSibling)
});
currentElement = currentElement.parentElement;
}
return {
element: weakRef(element),
stack,
ownerDocument: element.ownerDocument
};
};
var restoreFocusTo = function(location) {
var _a8, _b3, _c3, _d3, _e2;
if (!location) {
return void 0;
}
var stack = location.stack, ownerDocument = location.ownerDocument;
var visibilityCache = /* @__PURE__ */ new Map();
for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {
var line2 = stack_1[_i];
var parent_1 = (_a8 = line2.parent) === null || _a8 === void 0 ? void 0 : _a8.call(line2);
if (parent_1 && ownerDocument.contains(parent_1)) {
var left2 = (_b3 = line2.left) === null || _b3 === void 0 ? void 0 : _b3.call(line2);
var savedCurrent = line2.current();
var current = parent_1.contains(savedCurrent) ? savedCurrent : void 0;
var right2 = (_c3 = line2.right) === null || _c3 === void 0 ? void 0 : _c3.call(line2);
var focusables = getTabbableNodes([parent_1], visibilityCache);
var aim = (
// that is element itself
(_e2 = (_d3 = current !== null && current !== void 0 ? current : (
// or something in it's place
left2 === null || left2 === void 0 ? void 0 : left2.nextElementSibling
)) !== null && _d3 !== void 0 ? _d3 : (
// or somebody to the right, still close enough
right2
)) !== null && _e2 !== void 0 ? _e2 : (
// or somebody to the left, something?
left2
)
);
while (aim) {
for (var _f2 = 0, focusables_1 = focusables; _f2 < focusables_1.length; _f2++) {
var focusable = focusables_1[_f2];
if (aim === null || aim === void 0 ? void 0 : aim.contains(focusable.node)) {
return focusable.node;
}
}
aim = aim.nextElementSibling;
}
if (focusables.length) {
return focusables[0].node;
}
}
}
return void 0;
};
var captureFocusRestore = function(targetElement) {
var location = recordElementLocation(targetElement);
return function() {
return restoreFocusTo(location);
};
};
// ../../node_modules/focus-lock/dist/es2015/sibling.js
var getRelativeFocusable = function(element, scope, useTabbables) {
if (!element || !scope) {
console.error("no element or scope given");
return {};
}
var shards = asArray(scope);
if (shards.every(function(shard) {
return !contains3(shard, element);
})) {
console.error("Active element is not contained in the scope");
return {};
}
var focusables = useTabbables ? getTabbableNodes(shards, /* @__PURE__ */ new Map()) : getFocusableNodes(shards, /* @__PURE__ */ new Map());
var current = focusables.findIndex(function(_a8) {
var node3 = _a8.node;
return node3 === element;
});
if (current === -1) {
return void 0;
}
return {
prev: focusables[current - 1],
next: focusables[current + 1],
first: focusables[0],
last: focusables[focusables.length - 1]
};
};
var getBoundary = function(shards, useTabbables) {
var set = useTabbables ? getTabbableNodes(asArray(shards), /* @__PURE__ */ new Map()) : getFocusableNodes(asArray(shards), /* @__PURE__ */ new Map());
return {
first: set[0],
last: set[set.length - 1]
};
};
var defaultOptions2 = function(options) {
return Object.assign({
scope: document.body,
cycle: true,
onlyTabbable: true
}, options);
};
var moveFocus = function(fromElement, options, cb) {
if (options === void 0) {
options = {};
}
var newOptions = defaultOptions2(options);
var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);
if (!solution) {
return;
}
var target = cb(solution, newOptions.cycle);
if (target) {
focusOn(target.node, newOptions.focusOptions);
}
};
var focusNextElement = function(fromElement, options) {
if (options === void 0) {
options = {};
}
moveFocus(fromElement, options, function(_a8, cycle) {
var next2 = _a8.next, first = _a8.first;
return next2 || cycle && first;
});
};
var focusPrevElement = function(fromElement, options) {
if (options === void 0) {
options = {};
}
moveFocus(fromElement, options, function(_a8, cycle) {
var prev2 = _a8.prev, last = _a8.last;
return prev2 || cycle && last;
});
};
var pickBoundary = function(scope, options, what) {
var _a8;
var boundary = getBoundary(scope, (_a8 = options.onlyTabbable) !== null && _a8 !== void 0 ? _a8 : true);
var node3 = boundary[what];
if (node3) {
focusOn(node3.node, options.focusOptions);
}
};
var focusFirstElement = function(scope, options) {
if (options === void 0) {
options = {};
}
pickBoundary(scope, options, "first");
};
var focusLastElement = function(scope, options) {
if (options === void 0) {
options = {};
}
pickBoundary(scope, options, "last");
};
// ../../node_modules/react-focus-lock/dist/es2015/util.js
function deferAction(action) {
setTimeout(action, 1);
}
var inlineProp = function inlineProp2(name, value) {
var obj = {};
obj[name] = value;
return obj;
};
var extractRef = function extractRef2(ref) {
return ref && "current" in ref ? ref.current : ref;
};
// ../../node_modules/react-focus-lock/dist/es2015/Trap.js
var focusOnBody = function focusOnBody2() {
return document && document.activeElement === document.body;
};
var isFreeFocus = function isFreeFocus2() {
return focusOnBody() || focusIsHidden();
};
var lastActiveTrap = null;
var lastActiveFocus = null;
var tryRestoreFocus = function tryRestoreFocus2() {
return null;
};
var lastPortaledElement = null;
var focusWasOutsideWindow = false;
var windowFocused = false;
var defaultWhitelist = function defaultWhitelist2() {
return true;
};
var focusWhitelisted = function focusWhitelisted2(activeElement) {
return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);
};
var recordPortal = function recordPortal2(observerNode, portaledElement) {
lastPortaledElement = {
observerNode,
portaledElement
};
};
var focusIsPortaledPair = function focusIsPortaledPair2(element) {
return lastPortaledElement && lastPortaledElement.portaledElement === element;
};
function autoGuard(startIndex, end2, step, allNodes) {
var lastGuard = null;
var i = startIndex;
do {
var item = allNodes[i];
if (item.guard) {
if (item.node.dataset.focusAutoGuard) {
lastGuard = item;
}
} else if (item.lockItem) {
if (i !== startIndex) {
return;
}
lastGuard = null;
} else {
break;
}
} while ((i += step) !== end2);
if (lastGuard) {
lastGuard.node.tabIndex = 0;
}
}
var focusWasOutside = function focusWasOutside2(crossFrameOption) {
if (crossFrameOption) {
return Boolean(focusWasOutsideWindow);
}
return focusWasOutsideWindow === "meanwhile";
};
var checkInHost = function checkInHost2(check, el, boundary) {
return el && (el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) || el.parentNode && checkInHost2(check, el.parentNode, boundary));
};
var withinHost = function withinHost2(activeElement, workingArea) {
return workingArea.some(function(area) {
return checkInHost(activeElement, area, area);
});
};
var getNodeFocusables = function getNodeFocusables2(nodes) {
return getFocusableNodes(nodes, /* @__PURE__ */ new Map());
};
var isNotFocusable = function isNotFocusable2(node3) {
return !getNodeFocusables([node3.parentNode]).some(function(el) {
return el.node === node3;
});
};
var activateTrap = function activateTrap2() {
var result = false;
if (lastActiveTrap) {
var _lastActiveTrap = lastActiveTrap, observed = _lastActiveTrap.observed, persistentFocus = _lastActiveTrap.persistentFocus, autoFocus = _lastActiveTrap.autoFocus, shards = _lastActiveTrap.shards, crossFrame = _lastActiveTrap.crossFrame, focusOptions = _lastActiveTrap.focusOptions, noFocusGuards = _lastActiveTrap.noFocusGuards;
var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;
if (focusOnBody() && lastActiveFocus && lastActiveFocus !== document.body) {
if (!document.body.contains(lastActiveFocus) || isNotFocusable(lastActiveFocus)) {
var newTarget = tryRestoreFocus();
if (newTarget) {
newTarget.focus();
}
}
}
var activeElement = document && document.activeElement;
if (workingNode) {
var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));
var shouldForceRestoreFocus = function shouldForceRestoreFocus2() {
if (!focusWasOutside(crossFrame) || !noFocusGuards || !lastActiveFocus || windowFocused) {
return false;
}
var nodes = getNodeFocusables(workingArea);
var lastIndex = nodes.findIndex(function(_ref2) {
var node3 = _ref2.node;
return node3 === lastActiveFocus;
});
return lastIndex === 0 || lastIndex === nodes.length - 1;
};
if (!activeElement || focusWhitelisted(activeElement)) {
if (persistentFocus || shouldForceRestoreFocus() || !isFreeFocus() || !lastActiveFocus && autoFocus) {
if (workingNode && !(focusInside(workingArea) || activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement, workingNode))) {
if (document && !lastActiveFocus && activeElement && !autoFocus) {
if (activeElement.blur) {
activeElement.blur();
}
document.body.focus();
} else {
result = moveFocusInside(workingArea, lastActiveFocus, {
focusOptions
});
lastPortaledElement = {};
}
}
lastActiveFocus = document && document.activeElement;
if (lastActiveFocus !== document.body) {
tryRestoreFocus = captureFocusRestore(lastActiveFocus);
}
focusWasOutsideWindow = false;
}
}
if (document && activeElement !== document.activeElement && document.querySelector("[data-focus-auto-guard]")) {
var newActiveElement = document && document.activeElement;
var allNodes = expandFocusableNodes(workingArea);
var focusedIndex = allNodes.map(function(_ref2) {
var node3 = _ref2.node;
return node3;
}).indexOf(newActiveElement);
if (focusedIndex > -1) {
allNodes.filter(function(_ref3) {
var guard2 = _ref3.guard, node3 = _ref3.node;
return guard2 && node3.dataset.focusAutoGuard;
}).forEach(function(_ref4) {
var node3 = _ref4.node;
return node3.removeAttribute("tabIndex");
});
autoGuard(focusedIndex, allNodes.length, 1, allNodes);
autoGuard(focusedIndex, -1, -1, allNodes);
}
}
}
}
return result;
};
var onTrap = function onTrap2(event) {
if (activateTrap() && event) {
event.stopPropagation();
event.preventDefault();
}
};
var onBlur = function onBlur2() {
return deferAction(activateTrap);
};
var onFocus = function onFocus2(event) {
var source = event.target;
var currentNode = event.currentTarget;
if (!currentNode.contains(source)) {
recordPortal(currentNode, source);
}
};
var FocusWatcher = function FocusWatcher2() {
return null;
};
var FocusTrap = function FocusTrap2(_ref5) {
var children = _ref5.children;
return import_react122.default.createElement("div", {
onBlur,
onFocus
}, children);
};
FocusTrap.propTypes = true ? {
children: import_prop_types3.default.node.isRequired
} : {};
var onWindowFocus2 = function onWindowFocus3() {
windowFocused = true;
};
var onWindowBlur2 = function onWindowBlur3() {
windowFocused = false;
focusWasOutsideWindow = "just";
deferAction(function() {
focusWasOutsideWindow = "meanwhile";
});
};
var attachHandler = function attachHandler2() {
document.addEventListener("focusin", onTrap);
document.addEventListener("focusout", onBlur);
window.addEventListener("focus", onWindowFocus2);
window.addEventListener("blur", onWindowBlur2);
};
var detachHandler = function detachHandler2() {
document.removeEventListener("focusin", onTrap);
document.removeEventListener("focusout", onBlur);
window.removeEventListener("focus", onWindowFocus2);
window.removeEventListener("blur", onWindowBlur2);
};
function reducePropsToState(propsList) {
return propsList.filter(function(_ref6) {
var disabled = _ref6.disabled;
return !disabled;
});
}
var focusLockAPI = {
moveFocusInside,
focusInside,
focusNextElement,
focusPrevElement,
focusFirstElement,
focusLastElement,
captureFocusRestore
};
function handleStateChangeOnClient(traps) {
var trap = traps.slice(-1)[0];
if (trap && !lastActiveTrap) {
attachHandler();
}
var lastTrap = lastActiveTrap;
var sameTrap = lastTrap && trap && trap.id === lastTrap.id;
lastActiveTrap = trap;
if (lastTrap && !sameTrap) {
lastTrap.onDeactivation();
if (!traps.filter(function(_ref7) {
var id3 = _ref7.id;
return id3 === lastTrap.id;
}).length) {
lastTrap.returnFocus(!trap);
}
}
if (trap) {
lastActiveFocus = null;
if (!sameTrap || lastTrap.observed !== trap.observed) {
trap.onActivation(focusLockAPI);
}
activateTrap(true);
deferAction(activateTrap);
} else {
detachHandler();
lastActiveFocus = null;
}
}
mediumFocus.assignSyncMedium(onFocus);
mediumBlur.assignMedium(onBlur);
mediumEffect.assignMedium(function(cb) {
return cb(focusLockAPI);
});
var Trap_default = index_es_default(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);
// ../../node_modules/react-focus-lock/dist/es2015/Combination.js
var FocusLockCombination = (0, import_react123.forwardRef)(function FocusLockUICombination(props, ref) {
return import_react123.default.createElement(Lock_default, _extends({
sideCar: Trap_default,
ref
}, props));
});
var _ref = Lock_default.propTypes || {};
var sideCar = _ref.sideCar;
var propTypes = _objectWithoutPropertiesLoose(_ref, ["sideCar"]);
FocusLockCombination.propTypes = true ? propTypes : {};
var Combination_default = FocusLockCombination;
// ../../node_modules/react-focus-lock/dist/es2015/AutoFocusInside.js
var import_react124 = __toESM(require_react());
var import_prop_types4 = __toESM(require_prop_types());
var AutoFocusInside = function AutoFocusInside2(_ref2) {
var _ref$disabled = _ref2.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, children = _ref2.children, _ref$className = _ref2.className, className = _ref$className === void 0 ? void 0 : _ref$className;
return import_react124.default.createElement("div", _extends({}, inlineProp(FOCUS_AUTO, !disabled), {
className
}), children);
};
AutoFocusInside.propTypes = true ? {
children: import_prop_types4.default.node.isRequired,
disabled: import_prop_types4.default.bool,
className: import_prop_types4.default.string
} : {};
// ../../node_modules/react-focus-lock/dist/es2015/MoveFocusInside.js
var import_react125 = __toESM(require_react());
var import_prop_types5 = __toESM(require_prop_types());
var useFocusInside = function useFocusInside2(observedRef) {
(0, import_react125.useEffect)(function() {
var enabled = true;
mediumEffect.useMedium(function(car) {
var observed = observedRef && observedRef.current;
if (enabled && observed) {
if (!car.focusInside(observed)) {
car.moveFocusInside(observed, null);
}
}
});
return function() {
enabled = false;
};
}, [observedRef]);
};
function MoveFocusInside(_ref2) {
var _ref$disabled = _ref2.disabled, isDisabled = _ref$disabled === void 0 ? false : _ref$disabled, className = _ref2.className, children = _ref2.children;
var ref = (0, import_react125.useRef)(null);
useFocusInside(isDisabled ? void 0 : ref);
return import_react125.default.createElement("div", _extends({}, inlineProp(FOCUS_AUTO, !isDisabled), {
ref,
className
}), children);
}
MoveFocusInside.propTypes = true ? {
children: import_prop_types5.default.node.isRequired,
disabled: import_prop_types5.default.bool,
className: import_prop_types5.default.string
} : {};
// ../../node_modules/react-focus-lock/dist/es2015/FreeFocusInside.js
var import_react126 = __toESM(require_react());
var import_prop_types6 = __toESM(require_prop_types());
var FreeFocusInside = function FreeFocusInside2(_ref2) {
var children = _ref2.children, className = _ref2.className;
return import_react126.default.createElement("div", _extends({}, inlineProp(FOCUS_ALLOW, true), {
className
}), children);
};
FreeFocusInside.propTypes = true ? {
children: import_prop_types6.default.node.isRequired,
className: import_prop_types6.default.string
} : {};
// ../../node_modules/react-focus-lock/dist/es2015/use-focus-scope.js
var import_react127 = __toESM(require_react());
// ../../node_modules/react-focus-lock/dist/es2015/use-focus-state.js
var import_react128 = __toESM(require_react());
// ../../node_modules/react-focus-lock/dist/es2015/nano-events.js
var createNanoEvents = function createNanoEvents2() {
return {
emit: function emit(event) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
for (var i = 0, callbacks = this.events[event] || [], length2 = callbacks.length; i < length2; i++) {
callbacks[i].apply(callbacks, args);
}
},
events: {},
on: function on(event, cb) {
var _this$events, _this = this;
((_this$events = this.events)[event] || (_this$events[event] = [])).push(cb);
return function() {
var _this$events$event;
_this.events[event] = (_this$events$event = _this.events[event]) == null ? void 0 : _this$events$event.filter(function(i) {
return cb !== i;
});
};
}
};
};
// ../../node_modules/react-focus-lock/dist/es2015/use-focus-state.js
var mainbus = createNanoEvents();
// ../../node_modules/react-focus-lock/dist/es2015/index.js
var es2015_default = Combination_default;
// ../../node_modules/@chakra-ui/react/dist/esm/focus-lock/focus-lock.mjs
var import_react129 = __toESM(require_react(), 1);
var FocusTrap3 = es2015_default.default ?? es2015_default;
var FocusLock2 = (props) => {
const {
initialFocusRef,
finalFocusRef,
contentRef,
restoreFocus,
children,
isDisabled,
autoFocus,
persistentFocus,
lockFocusAcrossFrames
} = props;
const onActivation = (0, import_react129.useCallback)(() => {
if (initialFocusRef == null ? void 0 : initialFocusRef.current) {
initialFocusRef.current.focus();
} else if (contentRef == null ? void 0 : contentRef.current) {
const focusables = getAllFocusable(contentRef.current);
if (focusables.length === 0) {
requestAnimationFrame(() => {
var _a8;
(_a8 = contentRef.current) == null ? void 0 : _a8.focus();
});
}
}
}, [initialFocusRef, contentRef]);
const onDeactivation = (0, import_react129.useCallback)(() => {
var _a8;
(_a8 = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a8.focus();
}, [finalFocusRef]);
const returnFocus = restoreFocus && !finalFocusRef;
return (0, import_jsx_runtime64.jsx)(
FocusTrap3,
{
crossFrame: lockFocusAcrossFrames,
persistentFocus,
autoFocus,
disabled: isDisabled,
onActivation,
onDeactivation,
returnFocus,
children
}
);
};
FocusLock2.displayName = "FocusLock";
// ../../node_modules/@chakra-ui/react/dist/esm/form-control/form-error.mjs
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
var [FormErrorStylesProvider, useFormErrorStyles] = createContext({
name: `FormErrorStylesContext`,
errorMessage: `useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
});
var FormErrorMessage = forwardRef7(
(props, ref) => {
const styles2 = useMultiStyleConfig("FormError", props);
const ownProps = omitThemingProps(props);
const field = useFormControlContext();
if (!(field == null ? void 0 : field.isInvalid))
return null;
return (0, import_jsx_runtime65.jsx)(FormErrorStylesProvider, { value: styles2, children: (0, import_jsx_runtime65.jsx)(
chakra.div,
{
...field == null ? void 0 : field.getErrorMessageProps(ownProps, ref),
className: cx("chakra-form__error-message", props.className),
__css: {
display: "flex",
alignItems: "center",
...styles2.text
}
}
) });
}
);
FormErrorMessage.displayName = "FormErrorMessage";
var FormErrorIcon = forwardRef7((props, ref) => {
const styles2 = useFormErrorStyles();
const field = useFormControlContext();
if (!(field == null ? void 0 : field.isInvalid))
return null;
const _className = cx("chakra-form__error-icon", props.className);
return (0, import_jsx_runtime65.jsx)(
Icon,
{
ref,
"aria-hidden": true,
...props,
__css: styles2.icon,
className: _className,
children: (0, import_jsx_runtime65.jsx)(
"path",
{
fill: "currentColor",
d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"
}
)
}
);
});
FormErrorIcon.displayName = "FormErrorIcon";
// ../../node_modules/@chakra-ui/react/dist/esm/form-control/form-label.mjs
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
var FormLabel = forwardRef7(
function FormLabel2(passedProps, ref) {
const styles2 = useStyleConfig("FormLabel", passedProps);
const props = omitThemingProps(passedProps);
const {
className,
children,
requiredIndicator = (0, import_jsx_runtime66.jsx)(RequiredIndicator, {}),
optionalIndicator = null,
...rest
} = props;
const field = useFormControlContext();
const ownProps = (field == null ? void 0 : field.getLabelProps(rest, ref)) ?? { ref, ...rest };
return (0, import_jsx_runtime66.jsxs)(
chakra.label,
{
...ownProps,
className: cx("chakra-form__label", props.className),
__css: {
display: "block",
textAlign: "start",
...styles2
},
children: [
children,
(field == null ? void 0 : field.isRequired) ? requiredIndicator : optionalIndicator
]
}
);
}
);
FormLabel.displayName = "FormLabel";
var RequiredIndicator = forwardRef7(
function RequiredIndicator2(props, ref) {
const field = useFormControlContext();
const styles2 = useFormControlStyles();
if (!(field == null ? void 0 : field.isRequired))
return null;
const className = cx("chakra-form__required-indicator", props.className);
return (0, import_jsx_runtime66.jsx)(
chakra.span,
{
...field == null ? void 0 : field.getRequiredIndicatorProps(props, ref),
__css: styles2.requiredIndicator,
className
}
);
}
);
RequiredIndicator.displayName = "RequiredIndicator";
// ../../node_modules/@chakra-ui/react/dist/esm/grid/grid.mjs
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
var Grid = forwardRef7(function Grid2(props, ref) {
const {
templateAreas,
gap,
rowGap,
columnGap,
column: column2,
row,
autoFlow,
autoRows,
templateRows,
autoColumns,
templateColumns,
...rest
} = props;
const styles2 = {
display: "grid",
gridTemplateAreas: templateAreas,
gridGap: gap,
gridRowGap: rowGap,
gridColumnGap: columnGap,
gridAutoColumns: autoColumns,
gridColumn: column2,
gridRow: row,
gridAutoFlow: autoFlow,
gridAutoRows: autoRows,
gridTemplateRows: templateRows,
gridTemplateColumns: templateColumns
};
return (0, import_jsx_runtime67.jsx)(chakra.div, { ref, __css: styles2, ...rest });
});
Grid.displayName = "Grid";
// ../../node_modules/@chakra-ui/react/dist/esm/grid/grid-item.mjs
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
function spanFn(span) {
return mapResponsive(
span,
(value) => value === "auto" ? "auto" : `span ${value}/span ${value}`
);
}
var GridItem = forwardRef7(
function GridItem2(props, ref) {
const {
area,
colSpan,
colStart,
colEnd,
rowEnd,
rowSpan,
rowStart,
...rest
} = props;
const styles2 = compact({
gridArea: area,
gridColumn: spanFn(colSpan),
gridRow: spanFn(rowSpan),
gridColumnStart: colStart,
gridColumnEnd: colEnd,
gridRowStart: rowStart,
gridRowEnd: rowEnd
});
return (0, import_jsx_runtime68.jsx)(chakra.div, { ref, __css: styles2, ...rest });
}
);
GridItem.displayName = "GridItem";
// ../../node_modules/@chakra-ui/react/dist/esm/grid/simple-grid.mjs
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
var SimpleGrid = forwardRef7(
function SimpleGrid2(props, ref) {
const { columns, spacingX, spacingY, spacing: spacing2, minChildWidth, ...rest } = props;
const theme2 = useTheme2();
const templateColumns = minChildWidth ? widthToColumns(minChildWidth, theme2) : countToColumns(columns);
return (0, import_jsx_runtime69.jsx)(
Grid,
{
ref,
gap: spacing2,
columnGap: spacingX,
rowGap: spacingY,
templateColumns,
...rest
}
);
}
);
SimpleGrid.displayName = "SimpleGrid";
function toPx(n) {
return typeof n === "number" ? `${n}px` : n;
}
function widthToColumns(width, theme2) {
return mapResponsive(width, (value) => {
const _value = getToken("sizes", value, toPx(value))(theme2);
return value === null ? null : `repeat(auto-fit, minmax(${_value}, 1fr))`;
});
}
function countToColumns(count) {
return mapResponsive(
count,
(value) => value === null ? null : `repeat(${value}, minmax(0, 1fr))`
);
}
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/highlight.mjs
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
var import_react131 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/mark.mjs
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
var Mark = forwardRef7(function Mark2(props, ref) {
const styles2 = useStyleConfig("Mark", props);
const ownProps = omitThemingProps(props);
return (0, import_jsx_runtime70.jsx)(
Box,
{
ref,
...ownProps,
as: "mark",
__css: { bg: "transparent", whiteSpace: "nowrap", ...styles2 }
}
);
});
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/use-highlight.mjs
var import_react130 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/highlight-words.mjs
var escapeRegexp = (term) => term.replace(/[|\\{}()[\]^$+*?.-]/g, (char2) => `\\${char2}`);
function buildRegex(query) {
const _query = query.filter((text) => text.length !== 0).map((text) => escapeRegexp(text.trim()));
if (!_query.length) {
return null;
}
return new RegExp(`(${_query.join("|")})`, "ig");
}
function highlightWords({ text, query }) {
const regex = buildRegex(Array.isArray(query) ? query : [query]);
if (!regex) {
return [{ text, match: false }];
}
const result = text.split(regex).filter(Boolean);
return result.map((str) => ({ text: str, match: regex.test(str) }));
}
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/use-highlight.mjs
function useHighlight(props) {
const { text, query } = props;
return (0, import_react130.useMemo)(() => highlightWords({ text, query }), [text, query]);
}
// ../../node_modules/@chakra-ui/react/dist/esm/highlight/highlight.mjs
function Highlight(props) {
const { children, query, styles: styles2 } = props;
if (typeof children !== "string") {
throw new Error("The children prop of Highlight must be a string");
}
const chunks = useHighlight({ query, text: children });
return (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: chunks.map((chunk, index2) => {
return chunk.match ? (0, import_jsx_runtime71.jsx)(Mark, { sx: styles2, children: chunk.text }, index2) : (0, import_jsx_runtime71.jsx)(import_react131.Fragment, { children: chunk.text }, index2);
}) });
}
// ../../node_modules/@chakra-ui/react/dist/esm/icon/create-icon.mjs
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
var import_react132 = __toESM(require_react(), 1);
function createIcon(options) {
const {
viewBox = "0 0 24 24",
d: pathDefinition,
displayName,
defaultProps: defaultProps2 = {}
} = options;
const path = import_react132.Children.toArray(options.path);
const Comp = forwardRef7((props, ref) => (0, import_jsx_runtime72.jsx)(Icon, { ref, viewBox, ...defaultProps2, ...props, children: path.length ? path : (0, import_jsx_runtime72.jsx)("path", { fill: "currentColor", d: pathDefinition }) }));
Comp.displayName = displayName;
return Comp;
}
// ../../node_modules/@chakra-ui/react/dist/esm/image/image.mjs
var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/image/native-image.mjs
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
var NativeImage = forwardRef7(function NativeImage2(props, ref) {
const { htmlWidth, htmlHeight, alt, ...rest } = props;
return (0, import_jsx_runtime73.jsx)("img", { width: htmlWidth, height: htmlHeight, ref, alt, ...rest });
});
NativeImage.displayName = "NativeImage";
// ../../node_modules/@chakra-ui/react/dist/esm/image/image.mjs
var Image2 = forwardRef7(function Image22(props, ref) {
const {
fallbackSrc,
fallback,
src,
srcSet,
align,
fit,
loading,
ignoreFallback,
crossOrigin,
fallbackStrategy = "beforeLoadOrError",
referrerPolicy,
...rest
} = props;
const providedFallback = fallbackSrc !== void 0 || fallback !== void 0;
const shouldIgnoreFallbackImage = loading != null || // use can opt out of fallback image
ignoreFallback || // if the user doesn't provide any kind of fallback we should ignore it
!providedFallback;
const status = useImage({
...props,
crossOrigin,
ignoreFallback: shouldIgnoreFallbackImage
});
const showFallbackImage = shouldShowFallbackImage(status, fallbackStrategy);
const shared = {
ref,
objectFit: fit,
objectPosition: align,
...shouldIgnoreFallbackImage ? rest : omit(rest, ["onError", "onLoad"])
};
if (showFallbackImage) {
if (fallback)
return fallback;
return (0, import_jsx_runtime74.jsx)(
chakra.img,
{
as: NativeImage,
className: "chakra-image__placeholder",
src: fallbackSrc,
...shared
}
);
}
return (0, import_jsx_runtime74.jsx)(
chakra.img,
{
as: NativeImage,
src,
srcSet,
crossOrigin,
loading,
referrerPolicy,
className: "chakra-image",
...shared
}
);
});
Image2.displayName = "Image";
// ../../node_modules/@chakra-ui/react/dist/esm/image/img.mjs
var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
var Img = forwardRef7((props, ref) => (0, import_jsx_runtime75.jsx)(chakra.img, { ref, as: NativeImage, className: "chakra-image", ...props }));
// ../../node_modules/@chakra-ui/react/dist/esm/indicator/indicator.mjs
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
var import_react133 = __toESM(require_react(), 1);
var Indicator = forwardRef7(
function Indicator2(props, ref) {
const {
offsetX,
offsetY,
offset: offset2 = "0",
placement = "top-end",
...rest
} = props;
const styles2 = (0, import_react133.useMemo)(
() => ({
display: "inline-flex",
justifyContent: "center",
alignItems: "center",
position: "absolute",
insetBlockStart: mapResponsive(placement, (v) => {
const [side] = v.split("-");
const map = {
top: offsetY ?? offset2,
middle: "50%",
bottom: "auto"
};
return map[side];
}),
insetBlockEnd: mapResponsive(placement, (v) => {
const [side] = v.split("-");
const map = {
top: "auto",
middle: "50%",
bottom: offsetY ?? offset2
};
return map[side];
}),
insetStart: mapResponsive(placement, (v) => {
const [, align] = v.split("-");
const map = {
start: offsetX ?? offset2,
center: "50%",
end: "auto"
};
return map[align];
}),
insetEnd: mapResponsive(placement, (v) => {
const [, align] = v.split("-");
const map = {
start: "auto",
center: "50%",
end: offsetX ?? offset2
};
return map[align];
}),
translate: mapResponsive(placement, (v) => {
const [side, align] = v.split("-");
const mapX = { start: "-50%", center: "-50%", end: "50%" };
const mapY = { top: "-50%", middle: "-50%", bottom: "50%" };
return `${mapX[align]} ${mapY[side]}`;
})
}),
[offset2, offsetX, offsetY, placement]
);
return (0, import_jsx_runtime76.jsx)(chakra.div, { ref, __css: styles2, ...rest });
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/input/input.mjs
var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
var Input = forwardRef7(
function Input2(props, ref) {
const { htmlSize, ...rest } = props;
const styles2 = useMultiStyleConfig("Input", rest);
const ownProps = omitThemingProps(rest);
const input = useFormControl(ownProps);
const _className = cx("chakra-input", props.className);
return (0, import_jsx_runtime77.jsx)(
chakra.input,
{
size: htmlSize,
...input,
__css: styles2.field,
ref,
className: _className
}
);
}
);
Input.displayName = "Input";
Input.id = "Input";
// ../../node_modules/@chakra-ui/react/dist/esm/input/input-addon.mjs
var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/input/input-group.mjs
var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
var import_react134 = __toESM(require_react(), 1);
var [InputGroupStylesProvider, useInputGroupStyles] = createContext({
name: `InputGroupStylesContext`,
errorMessage: `useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `
});
var InputGroup = forwardRef7(
function InputGroup2(props, ref) {
const styles2 = useMultiStyleConfig("Input", props);
const { children, className, ...rest } = omitThemingProps(props);
const _className = cx("chakra-input__group", className);
const groupStyles = {};
const validChildren = getValidChildren(children);
const input = styles2.field;
validChildren.forEach((child) => {
if (!styles2)
return;
if (input && child.type.id === "InputLeftElement") {
groupStyles.paddingStart = input.height ?? input.h;
}
if (input && child.type.id === "InputRightElement") {
groupStyles.paddingEnd = input.height ?? input.h;
}
if (child.type.id === "InputRightAddon") {
groupStyles.borderEndRadius = 0;
}
if (child.type.id === "InputLeftAddon") {
groupStyles.borderStartRadius = 0;
}
});
const clones = validChildren.map((child) => {
var _a8, _b3;
const theming = compact({
size: ((_a8 = child.props) == null ? void 0 : _a8.size) || props.size,
variant: ((_b3 = child.props) == null ? void 0 : _b3.variant) || props.variant
});
return child.type.id !== "Input" ? (0, import_react134.cloneElement)(child, theming) : (0, import_react134.cloneElement)(child, Object.assign(theming, groupStyles, child.props));
});
return (0, import_jsx_runtime78.jsx)(
chakra.div,
{
className: _className,
ref,
__css: {
width: "100%",
display: "flex",
position: "relative",
// Parts of inputs override z-index to ensure that they stack correctly on each other
// Create a new stacking context so that these overrides don't leak out and conflict with other z-indexes
isolation: "isolate",
...styles2.group
},
"data-group": true,
...rest,
children: (0, import_jsx_runtime78.jsx)(InputGroupStylesProvider, { value: styles2, children: clones })
}
);
}
);
InputGroup.displayName = "InputGroup";
// ../../node_modules/@chakra-ui/react/dist/esm/input/input-addon.mjs
var placements = {
left: {
marginEnd: "-1px",
borderEndRadius: 0,
borderEndColor: "transparent"
},
right: {
marginStart: "-1px",
borderStartRadius: 0,
borderStartColor: "transparent"
}
};
var StyledAddon = chakra("div", {
baseStyle: {
flex: "0 0 auto",
width: "auto",
display: "flex",
alignItems: "center",
whiteSpace: "nowrap"
}
});
var InputAddon = forwardRef7(
function InputAddon2(props, ref) {
const { placement = "left", ...rest } = props;
const placementStyles = placements[placement] ?? {};
const styles2 = useInputGroupStyles();
return (0, import_jsx_runtime79.jsx)(
StyledAddon,
{
ref,
...rest,
__css: {
...styles2.addon,
...placementStyles
}
}
);
}
);
InputAddon.displayName = "InputAddon";
var InputLeftAddon = forwardRef7(
function InputLeftAddon2(props, ref) {
return (0, import_jsx_runtime79.jsx)(
InputAddon,
{
ref,
placement: "left",
...props,
className: cx("chakra-input__left-addon", props.className)
}
);
}
);
InputLeftAddon.displayName = "InputLeftAddon";
InputLeftAddon.id = "InputLeftAddon";
var InputRightAddon = forwardRef7(
function InputRightAddon2(props, ref) {
return (0, import_jsx_runtime79.jsx)(
InputAddon,
{
ref,
placement: "right",
...props,
className: cx("chakra-input__right-addon", props.className)
}
);
}
);
InputRightAddon.displayName = "InputRightAddon";
InputRightAddon.id = "InputRightAddon";
// ../../node_modules/@chakra-ui/react/dist/esm/input/input-element.mjs
var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
var StyledInputElement = chakra("div", {
baseStyle: {
display: "flex",
alignItems: "center",
justifyContent: "center",
position: "absolute",
top: "0",
zIndex: 2
}
});
var InputElement = forwardRef7(
function InputElement2(props, ref) {
const { placement = "left", ...rest } = props;
const styles2 = useInputGroupStyles();
const input = styles2.field;
const attr = placement === "left" ? "insetStart" : "insetEnd";
const elementStyles = {
[attr]: "0",
width: (input == null ? void 0 : input.height) ?? (input == null ? void 0 : input.h),
height: (input == null ? void 0 : input.height) ?? (input == null ? void 0 : input.h),
fontSize: input == null ? void 0 : input.fontSize,
...styles2.element
};
return (0, import_jsx_runtime80.jsx)(StyledInputElement, { ref, __css: elementStyles, ...rest });
}
);
InputElement.id = "InputElement";
InputElement.displayName = "InputElement";
var InputLeftElement = forwardRef7(
function InputLeftElement2(props, ref) {
const { className, ...rest } = props;
const _className = cx("chakra-input__left-element", className);
return (0, import_jsx_runtime80.jsx)(
InputElement,
{
ref,
placement: "left",
className: _className,
...rest
}
);
}
);
InputLeftElement.id = "InputLeftElement";
InputLeftElement.displayName = "InputLeftElement";
var InputRightElement = forwardRef7(
function InputRightElement2(props, ref) {
const { className, ...rest } = props;
const _className = cx("chakra-input__right-element", className);
return (0, import_jsx_runtime80.jsx)(
InputElement,
{
ref,
placement: "right",
className: _className,
...rest
}
);
}
);
InputRightElement.id = "InputRightElement";
InputRightElement.displayName = "InputRightElement";
// ../../node_modules/@chakra-ui/react/dist/esm/kbd/kbd.mjs
var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
var Kbd = forwardRef7(function Kbd2(props, ref) {
const styles2 = useStyleConfig("Kbd", props);
const { className, ...rest } = omitThemingProps(props);
return (0, import_jsx_runtime81.jsx)(
chakra.kbd,
{
ref,
className: cx("chakra-kbd", className),
...rest,
__css: {
fontFamily: "mono",
...styles2
}
}
);
});
Kbd.displayName = "Kbd";
// ../../node_modules/@chakra-ui/react/dist/esm/link/link.mjs
var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
var Link = forwardRef7(function Link2(props, ref) {
const styles2 = useStyleConfig("Link", props);
const { className, isExternal, ...rest } = omitThemingProps(props);
return (0, import_jsx_runtime82.jsx)(
chakra.a,
{
target: isExternal ? "_blank" : void 0,
rel: isExternal ? "noopener" : void 0,
ref,
className: cx("chakra-link", className),
...rest,
__css: styles2
}
);
});
Link.displayName = "Link";
// ../../node_modules/@chakra-ui/react/dist/esm/link/link-box.mjs
var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
var LinkOverlay = forwardRef7(
function LinkOverlay2(props, ref) {
const { isExternal, target, rel, className, ...rest } = props;
return (0, import_jsx_runtime83.jsx)(
chakra.a,
{
...rest,
ref,
className: cx("chakra-linkbox__overlay", className),
rel: isExternal ? "noopener noreferrer" : rel,
target: isExternal ? "_blank" : target,
__css: {
position: "static",
"&::before": {
content: "''",
cursor: "inherit",
display: "block",
position: "absolute",
top: 0,
left: 0,
zIndex: 0,
width: "100%",
height: "100%"
}
}
}
);
}
);
var LinkBox = forwardRef7(
function LinkBox2(props, ref) {
const { className, ...rest } = props;
return (0, import_jsx_runtime83.jsx)(
chakra.div,
{
ref,
position: "relative",
...rest,
className: cx("chakra-linkbox", className),
__css: {
/* Elevate the links and abbreviations up */
"a[href]:not(.chakra-linkbox__overlay), abbr[title]": {
position: "relative",
zIndex: 1
}
}
}
);
}
);
// ../../node_modules/@chakra-ui/react/dist/esm/list/list.mjs
var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1);
var [ListStylesProvider, useListStyles] = createContext({
name: `ListStylesContext`,
errorMessage: `useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "
" `
});
var List = forwardRef7(function List2(props, ref) {
const styles2 = useMultiStyleConfig("List", props);
const {
children,
styleType = "none",
stylePosition,
spacing: spacing2,
...rest
} = omitThemingProps(props);
const validChildren = getValidChildren(children);
const selector = "& > *:not(style) ~ *:not(style)";
const spacingStyle = spacing2 ? { [selector]: { mt: spacing2 } } : {};
return (0, import_jsx_runtime84.jsx)(ListStylesProvider, { value: styles2, children: (0, import_jsx_runtime84.jsx)(
chakra.ul,
{
ref,
listStyleType: styleType,
listStylePosition: stylePosition,
role: "list",
__css: { ...styles2.container, ...spacingStyle },
...rest,
children: validChildren
}
) });
});
List.displayName = "List";
var OrderedList = forwardRef7((props, ref) => {
const { as, ...rest } = props;
return (0, import_jsx_runtime84.jsx)(List, { ref, as: "ol", styleType: "decimal", marginStart: "1em", ...rest });
});
OrderedList.displayName = "OrderedList";
var UnorderedList = forwardRef7(
function UnorderedList2(props, ref) {
const { as, ...rest } = props;
return (0, import_jsx_runtime84.jsx)(List, { ref, as: "ul", styleType: "initial", marginStart: "1em", ...rest });
}
);
UnorderedList.displayName = "UnorderedList";
var ListItem = forwardRef7(
function ListItem2(props, ref) {
const styles2 = useListStyles();
return (0, import_jsx_runtime84.jsx)(chakra.li, { ref, ...props, __css: styles2.item });
}
);
ListItem.displayName = "ListItem";
var ListIcon = forwardRef7(
function ListIcon2(props, ref) {
const styles2 = useListStyles();
return (0, import_jsx_runtime84.jsx)(Icon, { ref, role: "presentation", ...props, __css: styles2.icon });
}
);
ListIcon.displayName = "ListIcon";
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/hide.mjs
var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/media-query.mjs
var getBreakpoint = (theme2, value) => {
var _a8;
return ((_a8 = theme2 == null ? void 0 : theme2.breakpoints) == null ? void 0 : _a8[value]) ?? value;
};
function useQuery(props) {
const { breakpoint = "", below, above } = props;
const theme2 = useTheme2();
const bpBelow = getBreakpoint(theme2, below);
const bpAbove = getBreakpoint(theme2, above);
let query = breakpoint;
if (bpBelow) {
query = `(max-width: ${bpBelow})`;
} else if (bpAbove) {
query = `(min-width: ${bpAbove})`;
}
return query;
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/use-media-query.mjs
var import_react135 = __toESM(require_react(), 1);
function useMediaQuery(query, options = {}) {
const { ssr = true, fallback } = options;
const { getWindow: getWindow2 } = useEnvironment();
const queries = Array.isArray(query) ? query : [query];
let fallbackValues = Array.isArray(fallback) ? fallback : [fallback];
fallbackValues = fallbackValues.filter((v) => v != null);
const [value, setValue] = (0, import_react135.useState)(() => {
return queries.map((query2, index2) => ({
media: query2,
matches: ssr ? !!fallbackValues[index2] : getWindow2().matchMedia(query2).matches
}));
});
(0, import_react135.useEffect)(() => {
const win = getWindow2();
setValue(
queries.map((query2) => ({
media: query2,
matches: win.matchMedia(query2).matches
}))
);
const mql = queries.map((query2) => win.matchMedia(query2));
const handler = (evt) => {
setValue((prev2) => {
return prev2.slice().map((item) => {
if (item.media === evt.media)
return { ...item, matches: evt.matches };
return item;
});
});
};
mql.forEach((mql2) => {
if (typeof mql2.addListener === "function") {
mql2.addListener(handler);
} else {
mql2.addEventListener("change", handler);
}
});
return () => {
mql.forEach((mql2) => {
if (typeof mql2.removeListener === "function") {
mql2.removeListener(handler);
} else {
mql2.removeEventListener("change", handler);
}
});
};
}, [getWindow2]);
return value.map((item) => item.matches);
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/visibility.mjs
function Visibility(props) {
const { breakpoint, hide: hide2, children, ssr } = props;
const [show] = useMediaQuery(breakpoint, { ssr });
const isVisible2 = hide2 ? !show : show;
const rendered = isVisible2 ? children : null;
return rendered;
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/hide.mjs
function Hide(props) {
const { children, ssr } = props;
const query = useQuery(props);
return (0, import_jsx_runtime85.jsx)(Visibility, { breakpoint: query, hide: true, ssr, children });
}
Hide.displayName = "Hide";
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/media-query.hook.mjs
function usePrefersReducedMotion(options) {
const [prefersReducedMotion2] = useMediaQuery(
"(prefers-reduced-motion: reduce)",
options
);
return prefersReducedMotion2;
}
function useColorModePreference(options) {
const [isLight2, isDark2] = useMediaQuery(
["(prefers-color-scheme: light)", "(prefers-color-scheme: dark)"],
options
);
if (isLight2)
return "light";
if (isDark2)
return "dark";
return void 0;
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/show.mjs
var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
function Show(props) {
const { children, ssr } = props;
const query = useQuery(props);
return (0, import_jsx_runtime86.jsx)(Visibility, { breakpoint: query, ssr, children });
}
Show.displayName = "Show";
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/use-breakpoint.mjs
function useBreakpoint(arg) {
var _a8;
const opts = isObject(arg) ? arg : { fallback: arg ?? "base" };
const theme2 = useTheme2();
const breakpoints3 = theme2.__breakpoints.details.map(
({ minMaxQuery, breakpoint }) => ({
breakpoint,
query: minMaxQuery.replace("@media screen and ", "")
})
);
const fallback = breakpoints3.map((bp) => bp.breakpoint === opts.fallback);
const values = useMediaQuery(
breakpoints3.map((bp) => bp.query),
{ fallback, ssr: opts.ssr }
);
const index2 = values.findIndex((value) => value == true);
return ((_a8 = breakpoints3[index2]) == null ? void 0 : _a8.breakpoint) ?? opts.fallback;
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/media-query.utils.mjs
function getClosestValue(values, breakpoint, breakpoints$1 = breakpoints) {
let index2 = Object.keys(values).indexOf(breakpoint);
if (index2 !== -1) {
return values[breakpoint];
}
let stopIndex = breakpoints$1.indexOf(breakpoint);
while (stopIndex >= 0) {
const key = breakpoints$1[stopIndex];
if (values.hasOwnProperty(key)) {
index2 = stopIndex;
break;
}
stopIndex -= 1;
}
if (index2 !== -1) {
const key = breakpoints$1[index2];
return values[key];
}
return void 0;
}
// ../../node_modules/@chakra-ui/react/dist/esm/media-query/use-breakpoint-value.mjs
function useBreakpointValue(values, arg) {
var _a8;
const opts = isObject(arg) ? arg : { fallback: arg ?? "base" };
const breakpoint = useBreakpoint(opts);
const theme2 = useTheme2();
if (!breakpoint)
return;
const breakpoints3 = Array.from(((_a8 = theme2.__breakpoints) == null ? void 0 : _a8.keys) || []);
const obj = Array.isArray(values) ? Object.fromEntries(
Object.entries(arrayToObjectNotation(values, breakpoints3)).map(
([key, value]) => [key, value]
)
) : values;
return getClosestValue(obj, breakpoint, breakpoints3);
}
// ../../node_modules/@chakra-ui/react/dist/esm/menu/menu.mjs
var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1);
var import_react141 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/menu/use-menu.mjs
var import_react140 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/menu/get-next-item-from-search.mjs
function getNextItemFromSearch(items, searchString, itemToString, currentItem) {
if (searchString == null) {
return currentItem;
}
if (!currentItem) {
const foundItem = items.find(
(item) => itemToString(item).toLowerCase().startsWith(searchString.toLowerCase())
);
return foundItem;
}
const matchingItems = items.filter(
(item) => itemToString(item).toLowerCase().startsWith(searchString.toLowerCase())
);
if (matchingItems.length > 0) {
let nextIndex;
if (matchingItems.includes(currentItem)) {
const currentIndex = matchingItems.indexOf(currentItem);
nextIndex = currentIndex + 1;
if (nextIndex === matchingItems.length) {
nextIndex = 0;
}
return matchingItems[nextIndex];
}
nextIndex = items.indexOf(matchingItems[0]);
return items[nextIndex];
}
return currentItem;
}
// ../../node_modules/@chakra-ui/react/dist/esm/menu/use-shortcut.mjs
var import_react136 = __toESM(require_react(), 1);
function isPrintableCharacter(event) {
const { key } = event;
return key.length === 1 || key.length > 1 && /[^a-zA-Z0-9]/.test(key);
}
function useShortcut(props = {}) {
const { timeout = 300, preventDefault = () => true } = props;
const [keys2, setKeys] = (0, import_react136.useState)([]);
const timeoutRef = (0, import_react136.useRef)(void 0);
const flush = () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
timeoutRef.current = null;
}
};
const clearKeysAfterDelay = () => {
flush();
timeoutRef.current = setTimeout(() => {
setKeys([]);
timeoutRef.current = null;
}, timeout);
};
(0, import_react136.useEffect)(() => flush, []);
function onKeyDown(fn2) {
return (event) => {
if (event.key === "Backspace") {
const keysCopy = [...keys2];
keysCopy.pop();
setKeys(keysCopy);
return;
}
if (isPrintableCharacter(event)) {
const keysCopy = keys2.concat(event.key);
if (preventDefault(event)) {
event.preventDefault();
event.stopPropagation();
}
setKeys(keysCopy);
fn2(keysCopy.join(""));
clearKeysAfterDelay();
}
};
}
return onKeyDown;
}
// ../../node_modules/@popperjs/core/lib/enums.js
var top = "top";
var bottom = "bottom";
var right = "right";
var left = "left";
var auto2 = "auto";
var basePlacements = [top, bottom, right, left];
var start = "start";
var end = "end";
var clippingParents = "clippingParents";
var viewport = "viewport";
var popper = "popper";
var reference = "reference";
var variationPlacements = basePlacements.reduce(function(acc, placement) {
return acc.concat([placement + "-" + start, placement + "-" + end]);
}, []);
var placements2 = [].concat(basePlacements, [auto2]).reduce(function(acc, placement) {
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
}, []);
var beforeRead = "beforeRead";
var read = "read";
var afterRead = "afterRead";
var beforeMain = "beforeMain";
var main = "main";
var afterMain = "afterMain";
var beforeWrite = "beforeWrite";
var write = "write";
var afterWrite = "afterWrite";
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
// ../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
function getNodeName(element) {
return element ? (element.nodeName || "").toLowerCase() : null;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js
function getWindow(node3) {
if (node3 == null) {
return window;
}
if (node3.toString() !== "[object Window]") {
var ownerDocument = node3.ownerDocument;
return ownerDocument ? ownerDocument.defaultView || window : window;
}
return node3;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
function isElement2(node3) {
var OwnElement = getWindow(node3).Element;
return node3 instanceof OwnElement || node3 instanceof Element;
}
function isHTMLElement2(node3) {
var OwnElement = getWindow(node3).HTMLElement;
return node3 instanceof OwnElement || node3 instanceof HTMLElement;
}
function isShadowRoot(node3) {
if (typeof ShadowRoot === "undefined") {
return false;
}
var OwnElement = getWindow(node3).ShadowRoot;
return node3 instanceof OwnElement || node3 instanceof ShadowRoot;
}
// ../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js
function applyStyles(_ref2) {
var state2 = _ref2.state;
Object.keys(state2.elements).forEach(function(name) {
var style = state2.styles[name] || {};
var attributes = state2.attributes[name] || {};
var element = state2.elements[name];
if (!isHTMLElement2(element) || !getNodeName(element)) {
return;
}
Object.assign(element.style, style);
Object.keys(attributes).forEach(function(name2) {
var value = attributes[name2];
if (value === false) {
element.removeAttribute(name2);
} else {
element.setAttribute(name2, value === true ? "" : value);
}
});
});
}
function effect2(_ref2) {
var state2 = _ref2.state;
var initialStyles = {
popper: {
position: state2.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(state2.elements.popper.style, initialStyles.popper);
state2.styles = initialStyles;
if (state2.elements.arrow) {
Object.assign(state2.elements.arrow.style, initialStyles.arrow);
}
return function() {
Object.keys(state2.elements).forEach(function(name) {
var element = state2.elements[name];
var attributes = state2.attributes[name] || {};
var styleProperties = Object.keys(state2.styles.hasOwnProperty(name) ? state2.styles[name] : initialStyles[name]);
var style = styleProperties.reduce(function(style2, property) {
style2[property] = "";
return style2;
}, {});
if (!isHTMLElement2(element) || !getNodeName(element)) {
return;
}
Object.assign(element.style, style);
Object.keys(attributes).forEach(function(attribute) {
element.removeAttribute(attribute);
});
});
};
}
var applyStyles_default = {
name: "applyStyles",
enabled: true,
phase: "write",
fn: applyStyles,
effect: effect2,
requires: ["computeStyles"]
};
// ../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js
function getBasePlacement(placement) {
return placement.split("-")[0];
}
// ../../node_modules/@popperjs/core/lib/utils/math.js
var max = Math.max;
var min = Math.min;
var round = Math.round;
// ../../node_modules/@popperjs/core/lib/utils/userAgent.js
function getUAString() {
var uaData = navigator.userAgentData;
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
return uaData.brands.map(function(item) {
return item.brand + "/" + item.version;
}).join(" ");
}
return navigator.userAgent;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
function isLayoutViewport() {
return !/^((?!chrome|android).)*safari/i.test(getUAString());
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
var clientRect = element.getBoundingClientRect();
var scaleX = 1;
var scaleY = 1;
if (includeScale && isHTMLElement2(element)) {
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
}
var _ref2 = isElement2(element) ? getWindow(element) : window, visualViewport = _ref2.visualViewport;
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
var width = clientRect.width / scaleX;
var height = clientRect.height / scaleY;
return {
width,
height,
top: y,
right: x + width,
bottom: y + height,
left: x,
x,
y
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
function getLayoutRect(element) {
var clientRect = getBoundingClientRect(element);
var width = element.offsetWidth;
var height = element.offsetHeight;
if (Math.abs(clientRect.width - width) <= 1) {
width = clientRect.width;
}
if (Math.abs(clientRect.height - height) <= 1) {
height = clientRect.height;
}
return {
x: element.offsetLeft,
y: element.offsetTop,
width,
height
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/contains.js
function contains4(parent, child) {
var rootNode = child.getRootNode && child.getRootNode();
if (parent.contains(child)) {
return true;
} else if (rootNode && isShadowRoot(rootNode)) {
var next2 = child;
do {
if (next2 && parent.isSameNode(next2)) {
return true;
}
next2 = next2.parentNode || next2.host;
} while (next2);
}
return false;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
function getComputedStyle3(element) {
return getWindow(element).getComputedStyle(element);
}
// ../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
function isTableElement(element) {
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
function getDocumentElement(element) {
return ((isElement2(element) ? element.ownerDocument : (
// $FlowFixMe[prop-missing]
element.document
)) || window.document).documentElement;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
function getParentNode2(element) {
if (getNodeName(element) === "html") {
return element;
}
return (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
element.parentNode || // DOM Element detected
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
getDocumentElement(element)
);
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
function getTrueOffsetParent(element) {
if (!isHTMLElement2(element) || // https://github.com/popperjs/popper-core/issues/837
getComputedStyle3(element).position === "fixed") {
return null;
}
return element.offsetParent;
}
function getContainingBlock(element) {
var isFirefox = /firefox/i.test(getUAString());
var isIE = /Trident/i.test(getUAString());
if (isIE && isHTMLElement2(element)) {
var elementCss = getComputedStyle3(element);
if (elementCss.position === "fixed") {
return null;
}
}
var currentNode = getParentNode2(element);
if (isShadowRoot(currentNode)) {
currentNode = currentNode.host;
}
while (isHTMLElement2(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
var css4 = getComputedStyle3(currentNode);
if (css4.transform !== "none" || css4.perspective !== "none" || css4.contain === "paint" || ["transform", "perspective"].indexOf(css4.willChange) !== -1 || isFirefox && css4.willChange === "filter" || isFirefox && css4.filter && css4.filter !== "none") {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
}
function getOffsetParent(element) {
var window2 = getWindow(element);
var offsetParent = getTrueOffsetParent(element);
while (offsetParent && isTableElement(offsetParent) && getComputedStyle3(offsetParent).position === "static") {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle3(offsetParent).position === "static")) {
return window2;
}
return offsetParent || getContainingBlock(element) || window2;
}
// ../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
function getMainAxisFromPlacement(placement) {
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
}
// ../../node_modules/@popperjs/core/lib/utils/within.js
function within(min2, value, max2) {
return max(min2, min(value, max2));
}
function withinMaxClamp(min2, value, max2) {
var v = within(min2, value, max2);
return v > max2 ? max2 : v;
}
// ../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
function getFreshSideObject() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
// ../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
function mergePaddingObject(paddingObject) {
return Object.assign({}, getFreshSideObject(), paddingObject);
}
// ../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js
function expandToHashMap(value, keys2) {
return keys2.reduce(function(hashMap, key) {
hashMap[key] = value;
return hashMap;
}, {});
}
// ../../node_modules/@popperjs/core/lib/modifiers/arrow.js
var toPaddingObject = function toPaddingObject2(padding, state2) {
padding = typeof padding === "function" ? padding(Object.assign({}, state2.rects, {
placement: state2.placement
})) : padding;
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
};
function arrow(_ref2) {
var _state$modifiersData$;
var state2 = _ref2.state, name = _ref2.name, options = _ref2.options;
var arrowElement = state2.elements.arrow;
var popperOffsets2 = state2.modifiersData.popperOffsets;
var basePlacement = getBasePlacement(state2.placement);
var axis = getMainAxisFromPlacement(basePlacement);
var isVertical = [left, right].indexOf(basePlacement) >= 0;
var len = isVertical ? "height" : "width";
if (!arrowElement || !popperOffsets2) {
return;
}
var paddingObject = toPaddingObject(options.padding, state2);
var arrowRect = getLayoutRect(arrowElement);
var minProp = axis === "y" ? top : left;
var maxProp = axis === "y" ? bottom : right;
var endDiff = state2.rects.reference[len] + state2.rects.reference[axis] - popperOffsets2[axis] - state2.rects.popper[len];
var startDiff = popperOffsets2[axis] - state2.rects.reference[axis];
var arrowOffsetParent = getOffsetParent(arrowElement);
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
var centerToReference = endDiff / 2 - startDiff / 2;
var min2 = paddingObject[minProp];
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
var offset2 = within(min2, center, max2);
var axisProp = axis;
state2.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
}
function effect3(_ref2) {
var state2 = _ref2.state, options = _ref2.options;
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
if (arrowElement == null) {
return;
}
if (typeof arrowElement === "string") {
arrowElement = state2.elements.popper.querySelector(arrowElement);
if (!arrowElement) {
return;
}
}
if (!contains4(state2.elements.popper, arrowElement)) {
return;
}
state2.elements.arrow = arrowElement;
}
var arrow_default = {
name: "arrow",
enabled: true,
phase: "main",
fn: arrow,
effect: effect3,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
// ../../node_modules/@popperjs/core/lib/utils/getVariation.js
function getVariation(placement) {
return placement.split("-")[1];
}
// ../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js
var unsetSides = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function roundOffsetsByDPR(_ref2, win) {
var x = _ref2.x, y = _ref2.y;
var dpr = win.devicePixelRatio || 1;
return {
x: round(x * dpr) / dpr || 0,
y: round(y * dpr) / dpr || 0
};
}
function mapToStyles(_ref2) {
var _Object$assign2;
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position3 = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
x,
y
}) : {
x,
y
};
x = _ref3.x;
y = _ref3.y;
var hasX = offsets.hasOwnProperty("x");
var hasY = offsets.hasOwnProperty("y");
var sideX = left;
var sideY = top;
var win = window;
if (adaptive) {
var offsetParent = getOffsetParent(popper2);
var heightProp = "clientHeight";
var widthProp = "clientWidth";
if (offsetParent === getWindow(popper2)) {
offsetParent = getDocumentElement(popper2);
if (getComputedStyle3(offsetParent).position !== "static" && position3 === "absolute") {
heightProp = "scrollHeight";
widthProp = "scrollWidth";
}
}
offsetParent = offsetParent;
if (placement === top || (placement === left || placement === right) && variation === end) {
sideY = bottom;
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : (
// $FlowFixMe[prop-missing]
offsetParent[heightProp]
);
y -= offsetY - popperRect.height;
y *= gpuAcceleration ? 1 : -1;
}
if (placement === left || (placement === top || placement === bottom) && variation === end) {
sideX = right;
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : (
// $FlowFixMe[prop-missing]
offsetParent[widthProp]
);
x -= offsetX - popperRect.width;
x *= gpuAcceleration ? 1 : -1;
}
}
var commonStyles2 = Object.assign({
position: position3
}, adaptive && unsetSides);
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
x,
y
}, getWindow(popper2)) : {
x,
y
};
x = _ref4.x;
y = _ref4.y;
if (gpuAcceleration) {
var _Object$assign;
return Object.assign({}, commonStyles2, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
}
return Object.assign({}, commonStyles2, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
}
function computeStyles(_ref5) {
var state2 = _ref5.state, options = _ref5.options;
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
var commonStyles2 = {
placement: getBasePlacement(state2.placement),
variation: getVariation(state2.placement),
popper: state2.elements.popper,
popperRect: state2.rects.popper,
gpuAcceleration,
isFixed: state2.options.strategy === "fixed"
};
if (state2.modifiersData.popperOffsets != null) {
state2.styles.popper = Object.assign({}, state2.styles.popper, mapToStyles(Object.assign({}, commonStyles2, {
offsets: state2.modifiersData.popperOffsets,
position: state2.options.strategy,
adaptive,
roundOffsets
})));
}
if (state2.modifiersData.arrow != null) {
state2.styles.arrow = Object.assign({}, state2.styles.arrow, mapToStyles(Object.assign({}, commonStyles2, {
offsets: state2.modifiersData.arrow,
position: "absolute",
adaptive: false,
roundOffsets
})));
}
state2.attributes.popper = Object.assign({}, state2.attributes.popper, {
"data-popper-placement": state2.placement
});
}
var computeStyles_default = {
name: "computeStyles",
enabled: true,
phase: "beforeWrite",
fn: computeStyles,
data: {}
};
// ../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js
var passive = {
passive: true
};
function effect4(_ref2) {
var state2 = _ref2.state, instance = _ref2.instance, options = _ref2.options;
var _options$scroll = options.scroll, scroll3 = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize2 = _options$resize === void 0 ? true : _options$resize;
var window2 = getWindow(state2.elements.popper);
var scrollParents = [].concat(state2.scrollParents.reference, state2.scrollParents.popper);
if (scroll3) {
scrollParents.forEach(function(scrollParent) {
scrollParent.addEventListener("scroll", instance.update, passive);
});
}
if (resize2) {
window2.addEventListener("resize", instance.update, passive);
}
return function() {
if (scroll3) {
scrollParents.forEach(function(scrollParent) {
scrollParent.removeEventListener("scroll", instance.update, passive);
});
}
if (resize2) {
window2.removeEventListener("resize", instance.update, passive);
}
};
}
var eventListeners_default = {
name: "eventListeners",
enabled: true,
phase: "write",
fn: function fn() {
},
effect: effect4,
data: {}
};
// ../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
var hash3 = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, function(matched) {
return hash3[matched];
});
}
// ../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
var hash4 = {
start: "end",
end: "start"
};
function getOppositeVariationPlacement(placement) {
return placement.replace(/start|end/g, function(matched) {
return hash4[matched];
});
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
function getWindowScroll(node3) {
var win = getWindow(node3);
var scrollLeft = win.pageXOffset;
var scrollTop = win.pageYOffset;
return {
scrollLeft,
scrollTop
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
function getWindowScrollBarX(element) {
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
function getViewportRect(element, strategy) {
var win = getWindow(element);
var html = getDocumentElement(element);
var visualViewport = win.visualViewport;
var width = html.clientWidth;
var height = html.clientHeight;
var x = 0;
var y = 0;
if (visualViewport) {
width = visualViewport.width;
height = visualViewport.height;
var layoutViewport = isLayoutViewport();
if (layoutViewport || !layoutViewport && strategy === "fixed") {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
return {
width,
height,
x: x + getWindowScrollBarX(element),
y
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
function getDocumentRect(element) {
var _element$ownerDocumen;
var html = getDocumentElement(element);
var winScroll = getWindowScroll(element);
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
var y = -winScroll.scrollTop;
if (getComputedStyle3(body || html).direction === "rtl") {
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
}
return {
width,
height,
x,
y
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
function isScrollParent2(element) {
var _getComputedStyle = getComputedStyle3(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
function getScrollParent2(node3) {
if (["html", "body", "#document"].indexOf(getNodeName(node3)) >= 0) {
return node3.ownerDocument.body;
}
if (isHTMLElement2(node3) && isScrollParent2(node3)) {
return node3;
}
return getScrollParent2(getParentNode2(node3));
}
// ../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
function listScrollParents(element, list2) {
var _element$ownerDocumen;
if (list2 === void 0) {
list2 = [];
}
var scrollParent = getScrollParent2(element);
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
var win = getWindow(scrollParent);
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent2(scrollParent) ? scrollParent : []) : scrollParent;
var updatedList = list2.concat(target);
return isBody ? updatedList : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
updatedList.concat(listScrollParents(getParentNode2(target)))
);
}
// ../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js
function rectToClientRect(rect) {
return Object.assign({}, rect, {
left: rect.x,
top: rect.y,
right: rect.x + rect.width,
bottom: rect.y + rect.height
});
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
function getInnerBoundingClientRect(element, strategy) {
var rect = getBoundingClientRect(element, false, strategy === "fixed");
rect.top = rect.top + element.clientTop;
rect.left = rect.left + element.clientLeft;
rect.bottom = rect.top + element.clientHeight;
rect.right = rect.left + element.clientWidth;
rect.width = element.clientWidth;
rect.height = element.clientHeight;
rect.x = rect.left;
rect.y = rect.top;
return rect;
}
function getClientRectFromMixedType(element, clippingParent, strategy) {
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement2(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
}
function getClippingParents(element) {
var clippingParents2 = listScrollParents(getParentNode2(element));
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle3(element).position) >= 0;
var clipperElement = canEscapeClipping && isHTMLElement2(element) ? getOffsetParent(element) : element;
if (!isElement2(clipperElement)) {
return [];
}
return clippingParents2.filter(function(clippingParent) {
return isElement2(clippingParent) && contains4(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
});
}
function getClippingRect(element, boundary, rootBoundary, strategy) {
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
var firstClippingParent = clippingParents2[0];
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
accRect.top = max(rect.top, accRect.top);
accRect.right = min(rect.right, accRect.right);
accRect.bottom = min(rect.bottom, accRect.bottom);
accRect.left = max(rect.left, accRect.left);
return accRect;
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
clippingRect.width = clippingRect.right - clippingRect.left;
clippingRect.height = clippingRect.bottom - clippingRect.top;
clippingRect.x = clippingRect.left;
clippingRect.y = clippingRect.top;
return clippingRect;
}
// ../../node_modules/@popperjs/core/lib/utils/computeOffsets.js
function computeOffsets(_ref2) {
var reference2 = _ref2.reference, element = _ref2.element, placement = _ref2.placement;
var basePlacement = placement ? getBasePlacement(placement) : null;
var variation = placement ? getVariation(placement) : null;
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
var offsets;
switch (basePlacement) {
case top:
offsets = {
x: commonX,
y: reference2.y - element.height
};
break;
case bottom:
offsets = {
x: commonX,
y: reference2.y + reference2.height
};
break;
case right:
offsets = {
x: reference2.x + reference2.width,
y: commonY
};
break;
case left:
offsets = {
x: reference2.x - element.width,
y: commonY
};
break;
default:
offsets = {
x: reference2.x,
y: reference2.y
};
}
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
if (mainAxis != null) {
var len = mainAxis === "y" ? "height" : "width";
switch (variation) {
case start:
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
break;
case end:
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
break;
default:
}
}
return offsets;
}
// ../../node_modules/@popperjs/core/lib/utils/detectOverflow.js
function detectOverflow(state2, options) {
if (options === void 0) {
options = {};
}
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state2.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state2.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
var altContext = elementContext === popper ? reference : popper;
var popperRect = state2.rects.popper;
var element = state2.elements[altBoundary ? altContext : elementContext];
var clippingClientRect = getClippingRect(isElement2(element) ? element : element.contextElement || getDocumentElement(state2.elements.popper), boundary, rootBoundary, strategy);
var referenceClientRect = getBoundingClientRect(state2.elements.reference);
var popperOffsets2 = computeOffsets({
reference: referenceClientRect,
element: popperRect,
strategy: "absolute",
placement
});
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
var overflowOffsets = {
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
};
var offsetData = state2.modifiersData.offset;
if (elementContext === popper && offsetData) {
var offset2 = offsetData[placement];
Object.keys(overflowOffsets).forEach(function(key) {
var multiply3 = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
overflowOffsets[key] += offset2[axis] * multiply3;
});
}
return overflowOffsets;
}
// ../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
function computeAutoPlacement(state2, options) {
if (options === void 0) {
options = {};
}
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements2 : _options$allowedAutoP;
var variation = getVariation(placement);
var placements3 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
return getVariation(placement2) === variation;
}) : basePlacements;
var allowedPlacements = placements3.filter(function(placement2) {
return allowedAutoPlacements.indexOf(placement2) >= 0;
});
if (allowedPlacements.length === 0) {
allowedPlacements = placements3;
}
var overflows = allowedPlacements.reduce(function(acc, placement2) {
acc[placement2] = detectOverflow(state2, {
placement: placement2,
boundary,
rootBoundary,
padding
})[getBasePlacement(placement2)];
return acc;
}, {});
return Object.keys(overflows).sort(function(a, b) {
return overflows[a] - overflows[b];
});
}
// ../../node_modules/@popperjs/core/lib/modifiers/flip.js
function getExpandedFallbackPlacements(placement) {
if (getBasePlacement(placement) === auto2) {
return [];
}
var oppositePlacement = getOppositePlacement(placement);
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
}
function flip(_ref2) {
var state2 = _ref2.state, options = _ref2.options, name = _ref2.name;
if (state2.modifiersData[name]._skip) {
return;
}
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
var preferredPlacement = state2.options.placement;
var basePlacement = getBasePlacement(preferredPlacement);
var isBasePlacement = basePlacement === preferredPlacement;
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
var placements3 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
return acc.concat(getBasePlacement(placement2) === auto2 ? computeAutoPlacement(state2, {
placement: placement2,
boundary,
rootBoundary,
padding,
flipVariations,
allowedAutoPlacements
}) : placement2);
}, []);
var referenceRect = state2.rects.reference;
var popperRect = state2.rects.popper;
var checksMap = /* @__PURE__ */ new Map();
var makeFallbackChecks = true;
var firstFittingPlacement = placements3[0];
for (var i = 0; i < placements3.length; i++) {
var placement = placements3[i];
var _basePlacement = getBasePlacement(placement);
var isStartVariation = getVariation(placement) === start;
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
var len = isVertical ? "width" : "height";
var overflow = detectOverflow(state2, {
placement,
boundary,
rootBoundary,
altBoundary,
padding
});
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
if (referenceRect[len] > popperRect[len]) {
mainVariationSide = getOppositePlacement(mainVariationSide);
}
var altVariationSide = getOppositePlacement(mainVariationSide);
var checks = [];
if (checkMainAxis) {
checks.push(overflow[_basePlacement] <= 0);
}
if (checkAltAxis) {
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
}
if (checks.every(function(check) {
return check;
})) {
firstFittingPlacement = placement;
makeFallbackChecks = false;
break;
}
checksMap.set(placement, checks);
}
if (makeFallbackChecks) {
var numberOfChecks = flipVariations ? 3 : 1;
var _loop = function _loop2(_i2) {
var fittingPlacement = placements3.find(function(placement2) {
var checks2 = checksMap.get(placement2);
if (checks2) {
return checks2.slice(0, _i2).every(function(check) {
return check;
});
}
});
if (fittingPlacement) {
firstFittingPlacement = fittingPlacement;
return "break";
}
};
for (var _i = numberOfChecks; _i > 0; _i--) {
var _ret = _loop(_i);
if (_ret === "break") break;
}
}
if (state2.placement !== firstFittingPlacement) {
state2.modifiersData[name]._skip = true;
state2.placement = firstFittingPlacement;
state2.reset = true;
}
}
var flip_default = {
name: "flip",
enabled: true,
phase: "main",
fn: flip,
requiresIfExists: ["offset"],
data: {
_skip: false
}
};
// ../../node_modules/@popperjs/core/lib/modifiers/hide.js
function getSideOffsets(overflow, rect, preventedOffsets) {
if (preventedOffsets === void 0) {
preventedOffsets = {
x: 0,
y: 0
};
}
return {
top: overflow.top - rect.height - preventedOffsets.y,
right: overflow.right - rect.width + preventedOffsets.x,
bottom: overflow.bottom - rect.height + preventedOffsets.y,
left: overflow.left - rect.width - preventedOffsets.x
};
}
function isAnySideFullyClipped(overflow) {
return [top, right, bottom, left].some(function(side) {
return overflow[side] >= 0;
});
}
function hide(_ref2) {
var state2 = _ref2.state, name = _ref2.name;
var referenceRect = state2.rects.reference;
var popperRect = state2.rects.popper;
var preventedOffsets = state2.modifiersData.preventOverflow;
var referenceOverflow = detectOverflow(state2, {
elementContext: "reference"
});
var popperAltOverflow = detectOverflow(state2, {
altBoundary: true
});
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
state2.modifiersData[name] = {
referenceClippingOffsets,
popperEscapeOffsets,
isReferenceHidden,
hasPopperEscaped
};
state2.attributes.popper = Object.assign({}, state2.attributes.popper, {
"data-popper-reference-hidden": isReferenceHidden,
"data-popper-escaped": hasPopperEscaped
});
}
var hide_default = {
name: "hide",
enabled: true,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: hide
};
// ../../node_modules/@popperjs/core/lib/modifiers/offset.js
function distanceAndSkiddingToXY(placement, rects, offset2) {
var basePlacement = getBasePlacement(placement);
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
var _ref2 = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
placement
})) : offset2, skidding = _ref2[0], distance3 = _ref2[1];
skidding = skidding || 0;
distance3 = (distance3 || 0) * invertDistance;
return [left, right].indexOf(basePlacement) >= 0 ? {
x: distance3,
y: skidding
} : {
x: skidding,
y: distance3
};
}
function offset(_ref2) {
var state2 = _ref2.state, options = _ref2.options, name = _ref2.name;
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
var data = placements2.reduce(function(acc, placement) {
acc[placement] = distanceAndSkiddingToXY(placement, state2.rects, offset2);
return acc;
}, {});
var _data$state$placement = data[state2.placement], x = _data$state$placement.x, y = _data$state$placement.y;
if (state2.modifiersData.popperOffsets != null) {
state2.modifiersData.popperOffsets.x += x;
state2.modifiersData.popperOffsets.y += y;
}
state2.modifiersData[name] = data;
}
var offset_default = {
name: "offset",
enabled: true,
phase: "main",
requires: ["popperOffsets"],
fn: offset
};
// ../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
function popperOffsets(_ref2) {
var state2 = _ref2.state, name = _ref2.name;
state2.modifiersData[name] = computeOffsets({
reference: state2.rects.reference,
element: state2.rects.popper,
strategy: "absolute",
placement: state2.placement
});
}
var popperOffsets_default = {
name: "popperOffsets",
enabled: true,
phase: "read",
fn: popperOffsets,
data: {}
};
// ../../node_modules/@popperjs/core/lib/utils/getAltAxis.js
function getAltAxis(axis) {
return axis === "x" ? "y" : "x";
}
// ../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
function preventOverflow(_ref2) {
var state2 = _ref2.state, options = _ref2.options, name = _ref2.name;
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
var overflow = detectOverflow(state2, {
boundary,
rootBoundary,
padding,
altBoundary
});
var basePlacement = getBasePlacement(state2.placement);
var variation = getVariation(state2.placement);
var isBasePlacement = !variation;
var mainAxis = getMainAxisFromPlacement(basePlacement);
var altAxis = getAltAxis(mainAxis);
var popperOffsets2 = state2.modifiersData.popperOffsets;
var referenceRect = state2.rects.reference;
var popperRect = state2.rects.popper;
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state2.rects, {
placement: state2.placement
})) : tetherOffset;
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
mainAxis: tetherOffsetValue,
altAxis: tetherOffsetValue
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, tetherOffsetValue);
var offsetModifierState = state2.modifiersData.offset ? state2.modifiersData.offset[state2.placement] : null;
var data = {
x: 0,
y: 0
};
if (!popperOffsets2) {
return;
}
if (checkMainAxis) {
var _offsetModifierState$;
var mainSide = mainAxis === "y" ? top : left;
var altSide = mainAxis === "y" ? bottom : right;
var len = mainAxis === "y" ? "height" : "width";
var offset2 = popperOffsets2[mainAxis];
var min2 = offset2 + overflow[mainSide];
var max2 = offset2 - overflow[altSide];
var additive = tether ? -popperRect[len] / 2 : 0;
var minLen = variation === start ? referenceRect[len] : popperRect[len];
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
var arrowElement = state2.elements.arrow;
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
width: 0,
height: 0
};
var arrowPaddingObject = state2.modifiersData["arrow#persistent"] ? state2.modifiersData["arrow#persistent"].padding : getFreshSideObject();
var arrowPaddingMin = arrowPaddingObject[mainSide];
var arrowPaddingMax = arrowPaddingObject[altSide];
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
var arrowOffsetParent = state2.elements.arrow && getOffsetParent(state2.elements.arrow);
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
var tetherMax = offset2 + maxOffset - offsetModifierValue;
var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2);
popperOffsets2[mainAxis] = preventedOffset;
data[mainAxis] = preventedOffset - offset2;
}
if (checkAltAxis) {
var _offsetModifierState$2;
var _mainSide = mainAxis === "x" ? top : left;
var _altSide = mainAxis === "x" ? bottom : right;
var _offset = popperOffsets2[altAxis];
var _len = altAxis === "y" ? "height" : "width";
var _min = _offset + overflow[_mainSide];
var _max = _offset - overflow[_altSide];
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
popperOffsets2[altAxis] = _preventedOffset;
data[altAxis] = _preventedOffset - _offset;
}
state2.modifiersData[name] = data;
}
var preventOverflow_default = {
name: "preventOverflow",
enabled: true,
phase: "main",
fn: preventOverflow,
requiresIfExists: ["offset"]
};
// ../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
function getHTMLElementScroll(element) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
function getNodeScroll(node3) {
if (node3 === getWindow(node3) || !isHTMLElement2(node3)) {
return getWindowScroll(node3);
} else {
return getHTMLElementScroll(node3);
}
}
// ../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
function isElementScaled(element) {
var rect = element.getBoundingClientRect();
var scaleX = round(rect.width) / element.offsetWidth || 1;
var scaleY = round(rect.height) / element.offsetHeight || 1;
return scaleX !== 1 || scaleY !== 1;
}
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
if (isFixed === void 0) {
isFixed = false;
}
var isOffsetParentAnElement = isHTMLElement2(offsetParent);
var offsetParentIsScaled = isHTMLElement2(offsetParent) && isElementScaled(offsetParent);
var documentElement = getDocumentElement(offsetParent);
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
var scroll3 = {
scrollLeft: 0,
scrollTop: 0
};
var offsets = {
x: 0,
y: 0
};
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
isScrollParent2(documentElement)) {
scroll3 = getNodeScroll(offsetParent);
}
if (isHTMLElement2(offsetParent)) {
offsets = getBoundingClientRect(offsetParent, true);
offsets.x += offsetParent.clientLeft;
offsets.y += offsetParent.clientTop;
} else if (documentElement) {
offsets.x = getWindowScrollBarX(documentElement);
}
}
return {
x: rect.left + scroll3.scrollLeft - offsets.x,
y: rect.top + scroll3.scrollTop - offsets.y,
width: rect.width,
height: rect.height
};
}
// ../../node_modules/@popperjs/core/lib/utils/orderModifiers.js
function order(modifiers) {
var map = /* @__PURE__ */ new Map();
var visited = /* @__PURE__ */ new Set();
var result = [];
modifiers.forEach(function(modifier) {
map.set(modifier.name, modifier);
});
function sort(modifier) {
visited.add(modifier.name);
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
requires.forEach(function(dep) {
if (!visited.has(dep)) {
var depModifier = map.get(dep);
if (depModifier) {
sort(depModifier);
}
}
});
result.push(modifier);
}
modifiers.forEach(function(modifier) {
if (!visited.has(modifier.name)) {
sort(modifier);
}
});
return result;
}
function orderModifiers(modifiers) {
var orderedModifiers = order(modifiers);
return modifierPhases.reduce(function(acc, phase) {
return acc.concat(orderedModifiers.filter(function(modifier) {
return modifier.phase === phase;
}));
}, []);
}
// ../../node_modules/@popperjs/core/lib/utils/debounce.js
function debounce(fn2) {
var pending;
return function() {
if (!pending) {
pending = new Promise(function(resolve) {
Promise.resolve().then(function() {
pending = void 0;
resolve(fn2());
});
});
}
return pending;
};
}
// ../../node_modules/@popperjs/core/lib/utils/mergeByName.js
function mergeByName(modifiers) {
var merged = modifiers.reduce(function(merged2, current) {
var existing = merged2[current.name];
merged2[current.name] = existing ? Object.assign({}, existing, current, {
options: Object.assign({}, existing.options, current.options),
data: Object.assign({}, existing.data, current.data)
}) : current;
return merged2;
}, {});
return Object.keys(merged).map(function(key) {
return merged[key];
});
}
// ../../node_modules/@popperjs/core/lib/createPopper.js
var DEFAULT_OPTIONS = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function areValidElements() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return !args.some(function(element) {
return !(element && typeof element.getBoundingClientRect === "function");
});
}
function popperGenerator(generatorOptions) {
if (generatorOptions === void 0) {
generatorOptions = {};
}
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers3 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions3 = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
return function createPopper4(reference2, popper2, options) {
if (options === void 0) {
options = defaultOptions3;
}
var state2 = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions3),
modifiersData: {},
elements: {
reference: reference2,
popper: popper2
},
attributes: {},
styles: {}
};
var effectCleanupFns = [];
var isDestroyed = false;
var instance = {
state: state2,
setOptions: function setOptions(setOptionsAction) {
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state2.options) : setOptionsAction;
cleanupModifierEffects();
state2.options = Object.assign({}, defaultOptions3, state2.options, options2);
state2.scrollParents = {
reference: isElement2(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
popper: listScrollParents(popper2)
};
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers3, state2.options.modifiers)));
state2.orderedModifiers = orderedModifiers.filter(function(m2) {
return m2.enabled;
});
runModifierEffects();
return instance.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function forceUpdate() {
if (isDestroyed) {
return;
}
var _state$elements = state2.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
if (!areValidElements(reference3, popper3)) {
return;
}
state2.rects = {
reference: getCompositeRect(reference3, getOffsetParent(popper3), state2.options.strategy === "fixed"),
popper: getLayoutRect(popper3)
};
state2.reset = false;
state2.placement = state2.options.placement;
state2.orderedModifiers.forEach(function(modifier) {
return state2.modifiersData[modifier.name] = Object.assign({}, modifier.data);
});
for (var index2 = 0; index2 < state2.orderedModifiers.length; index2++) {
if (state2.reset === true) {
state2.reset = false;
index2 = -1;
continue;
}
var _state$orderedModifie = state2.orderedModifiers[index2], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
if (typeof fn2 === "function") {
state2 = fn2({
state: state2,
options: _options,
name,
instance
}) || state2;
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: debounce(function() {
return new Promise(function(resolve) {
instance.forceUpdate();
resolve(state2);
});
}),
destroy: function destroy() {
cleanupModifierEffects();
isDestroyed = true;
}
};
if (!areValidElements(reference2, popper2)) {
return instance;
}
instance.setOptions(options).then(function(state3) {
if (!isDestroyed && options.onFirstUpdate) {
options.onFirstUpdate(state3);
}
});
function runModifierEffects() {
state2.orderedModifiers.forEach(function(_ref2) {
var name = _ref2.name, _ref$options = _ref2.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect5 = _ref2.effect;
if (typeof effect5 === "function") {
var cleanupFn = effect5({
state: state2,
name,
instance,
options: options2
});
var noopFn = function noopFn2() {
};
effectCleanupFns.push(cleanupFn || noopFn);
}
});
}
function cleanupModifierEffects() {
effectCleanupFns.forEach(function(fn2) {
return fn2();
});
effectCleanupFns = [];
}
return instance;
};
}
var createPopper = popperGenerator();
// ../../node_modules/@popperjs/core/lib/popper-lite.js
var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default];
var createPopper2 = popperGenerator({
defaultModifiers
});
// ../../node_modules/@popperjs/core/lib/popper.js
var defaultModifiers2 = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default];
var createPopper3 = popperGenerator({
defaultModifiers: defaultModifiers2
});
// ../../node_modules/@chakra-ui/react/dist/esm/popper/use-popper.mjs
var import_react137 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/popper/utils.mjs
var toVar2 = (value, fallback) => ({
var: value,
varRef: fallback ? `var(${value}, ${fallback})` : `var(${value})`
});
var cssVars = {
arrowShadowColor: toVar2("--popper-arrow-shadow-color"),
arrowSize: toVar2("--popper-arrow-size", "8px"),
arrowSizeHalf: toVar2("--popper-arrow-size-half"),
arrowBg: toVar2("--popper-arrow-bg"),
transformOrigin: toVar2("--popper-transform-origin"),
arrowOffset: toVar2("--popper-arrow-offset")
};
function getBoxShadow(placement) {
if (placement.includes("top"))
return `1px 1px 0px 0 var(--popper-arrow-shadow-color)`;
if (placement.includes("bottom"))
return `-1px -1px 0px 0 var(--popper-arrow-shadow-color)`;
if (placement.includes("right"))
return `-1px 1px 0px 0 var(--popper-arrow-shadow-color)`;
if (placement.includes("left"))
return `1px -1px 0px 0 var(--popper-arrow-shadow-color)`;
}
var transforms = {
top: "bottom center",
"top-start": "bottom left",
"top-end": "bottom right",
bottom: "top center",
"bottom-start": "top left",
"bottom-end": "top right",
left: "right center",
"left-start": "right top",
"left-end": "right bottom",
right: "left center",
"right-start": "left top",
"right-end": "left bottom"
};
var toTransformOrigin = (placement) => transforms[placement];
var defaultEventListeners = {
scroll: true,
resize: true
};
function getEventListenerOptions(value) {
let eventListeners;
if (typeof value === "object") {
eventListeners = {
enabled: true,
options: { ...defaultEventListeners, ...value }
};
} else {
eventListeners = {
enabled: value,
options: defaultEventListeners
};
}
return eventListeners;
}
// ../../node_modules/@chakra-ui/react/dist/esm/popper/modifiers.mjs
var matchWidth = {
name: "matchWidth",
enabled: true,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: ({ state: state2 }) => {
state2.styles.popper.width = `${state2.rects.reference.width}px`;
},
effect: ({ state: state2 }) => () => {
const reference2 = state2.elements.reference;
state2.elements.popper.style.width = `${reference2.offsetWidth}px`;
}
};
var transformOrigin = {
name: "transformOrigin",
enabled: true,
phase: "write",
fn: ({ state: state2 }) => {
setTransformOrigin(state2);
},
effect: ({ state: state2 }) => () => {
setTransformOrigin(state2);
}
};
var setTransformOrigin = (state2) => {
state2.elements.popper.style.setProperty(
cssVars.transformOrigin.var,
toTransformOrigin(state2.placement)
);
};
var positionArrow = {
name: "positionArrow",
enabled: true,
phase: "afterWrite",
fn: ({ state: state2 }) => {
setArrowStyles(state2);
}
};
var setArrowStyles = (state2) => {
var _a8;
if (!state2.placement)
return;
const overrides = getArrowStyle(state2.placement);
if (((_a8 = state2.elements) == null ? void 0 : _a8.arrow) && overrides) {
Object.assign(state2.elements.arrow.style, {
[overrides.property]: overrides.value,
width: cssVars.arrowSize.varRef,
height: cssVars.arrowSize.varRef,
zIndex: -1
});
const vars2 = {
[cssVars.arrowSizeHalf.var]: `calc(${cssVars.arrowSize.varRef} / 2 - 1px)`,
[cssVars.arrowOffset.var]: `calc(${cssVars.arrowSizeHalf.varRef} * -1)`
};
for (const property in vars2) {
state2.elements.arrow.style.setProperty(property, vars2[property]);
}
}
};
var getArrowStyle = (placement) => {
if (placement.startsWith("top")) {
return { property: "bottom", value: cssVars.arrowOffset.varRef };
}
if (placement.startsWith("bottom")) {
return { property: "top", value: cssVars.arrowOffset.varRef };
}
if (placement.startsWith("left")) {
return { property: "right", value: cssVars.arrowOffset.varRef };
}
if (placement.startsWith("right")) {
return { property: "left", value: cssVars.arrowOffset.varRef };
}
};
var innerArrow = {
name: "innerArrow",
enabled: true,
phase: "main",
requires: ["arrow"],
fn: ({ state: state2 }) => {
setInnerArrowStyles(state2);
},
effect: ({ state: state2 }) => () => {
setInnerArrowStyles(state2);
}
};
var setInnerArrowStyles = (state2) => {
if (!state2.elements.arrow)
return;
const inner = state2.elements.arrow.querySelector(
"[data-popper-arrow-inner]"
);
if (!inner)
return;
const boxShadow = getBoxShadow(state2.placement);
if (boxShadow) {
inner.style.setProperty("--popper-arrow-default-shadow", boxShadow);
}
Object.assign(inner.style, {
transform: "rotate(45deg)",
background: cssVars.arrowBg.varRef,
top: 0,
left: 0,
width: "100%",
height: "100%",
position: "absolute",
zIndex: "inherit",
boxShadow: `var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))`
});
};
// ../../node_modules/@chakra-ui/react/dist/esm/popper/popper.placement.mjs
var logicals = {
"start-start": { ltr: "left-start", rtl: "right-start" },
"start-end": { ltr: "left-end", rtl: "right-end" },
"end-start": { ltr: "right-start", rtl: "left-start" },
"end-end": { ltr: "right-end", rtl: "left-end" },
start: { ltr: "left", rtl: "right" },
end: { ltr: "right", rtl: "left" }
};
var opposites = {
"auto-start": "auto-end",
"auto-end": "auto-start",
"top-start": "top-end",
"top-end": "top-start",
"bottom-start": "bottom-end",
"bottom-end": "bottom-start"
};
function getPopperPlacement(placement, dir = "ltr") {
var _a8;
const value = ((_a8 = logicals[placement]) == null ? void 0 : _a8[dir]) || placement;
if (dir === "ltr")
return value;
return opposites[placement] ?? value;
}
// ../../node_modules/@chakra-ui/react/dist/esm/popper/use-popper.mjs
function usePopper(props = {}) {
const {
enabled = true,
modifiers,
placement: placementProp = "bottom",
strategy = "absolute",
arrowPadding = 8,
eventListeners = true,
offset: offset2,
gutter = 8,
flip: flip2 = true,
boundary = "clippingParents",
preventOverflow: preventOverflow2 = true,
matchWidth: matchWidth$1,
direction: direction2 = "ltr"
} = props;
const reference2 = (0, import_react137.useRef)(null);
const popper2 = (0, import_react137.useRef)(null);
const instance = (0, import_react137.useRef)(null);
const placement = getPopperPlacement(placementProp, direction2);
const cleanup = (0, import_react137.useRef)(() => {
});
const setupPopper = (0, import_react137.useCallback)(() => {
var _a8;
if (!enabled || !reference2.current || !popper2.current)
return;
(_a8 = cleanup.current) == null ? void 0 : _a8.call(cleanup);
instance.current = createPopper3(reference2.current, popper2.current, {
placement,
modifiers: [
innerArrow,
positionArrow,
transformOrigin,
{
...matchWidth,
enabled: !!matchWidth$1
},
{
name: "eventListeners",
...getEventListenerOptions(eventListeners)
},
{
name: "arrow",
options: { padding: arrowPadding }
},
{
name: "offset",
options: {
offset: offset2 ?? [0, gutter]
}
},
{
name: "flip",
enabled: !!flip2,
options: { padding: 8 }
},
{
name: "preventOverflow",
enabled: !!preventOverflow2,
options: { boundary }
},
// allow users override internal modifiers
...modifiers ?? []
],
strategy
});
instance.current.forceUpdate();
cleanup.current = instance.current.destroy;
}, [
placement,
enabled,
modifiers,
matchWidth$1,
eventListeners,
arrowPadding,
offset2,
gutter,
flip2,
preventOverflow2,
boundary,
strategy
]);
(0, import_react137.useEffect)(() => {
return () => {
var _a8;
if (!reference2.current && !popper2.current) {
(_a8 = instance.current) == null ? void 0 : _a8.destroy();
instance.current = null;
}
};
}, []);
const referenceRef = (0, import_react137.useCallback)(
(node3) => {
reference2.current = node3;
setupPopper();
},
[setupPopper]
);
const getReferenceProps = (0, import_react137.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
ref: mergeRefs(referenceRef, ref)
}),
[referenceRef]
);
const popperRef = (0, import_react137.useCallback)(
(node3) => {
popper2.current = node3;
setupPopper();
},
[setupPopper]
);
const getPopperProps = (0, import_react137.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
ref: mergeRefs(popperRef, ref),
style: {
...props2.style,
position: strategy,
minWidth: matchWidth$1 ? void 0 : "max-content",
inset: "0 auto auto 0"
}
}),
[strategy, popperRef, matchWidth$1]
);
const getArrowProps = (0, import_react137.useCallback)((props2 = {}, ref = null) => {
const { size: size2, shadowColor, bg, style, ...rest } = props2;
return {
...rest,
ref,
"data-popper-arrow": "",
style: getArrowStyle2(props2)
};
}, []);
const getArrowInnerProps = (0, import_react137.useCallback)(
(props2 = {}, ref = null) => ({
...props2,
ref,
"data-popper-arrow-inner": ""
}),
[]
);
return {
update() {
var _a8;
(_a8 = instance.current) == null ? void 0 : _a8.update();
},
forceUpdate() {
var _a8;
(_a8 = instance.current) == null ? void 0 : _a8.forceUpdate();
},
transformOrigin: cssVars.transformOrigin.varRef,
referenceRef,
popperRef,
getPopperProps,
getArrowProps,
getArrowInnerProps,
getReferenceProps
};
}
function getArrowStyle2(props) {
const { size: size2, shadowColor, bg, style } = props;
const computedStyle = { ...style, position: "absolute" };
if (size2) {
computedStyle["--popper-arrow-size"] = size2;
}
if (shadowColor) {
computedStyle["--popper-arrow-shadow-color"] = shadowColor;
}
if (bg) {
computedStyle["--popper-arrow-bg"] = bg;
}
return computedStyle;
}
// ../../node_modules/@chakra-ui/react/dist/esm/clickable/use-clickable.mjs
var import_react139 = __toESM(require_react(), 1);
// ../../node_modules/@chakra-ui/react/dist/esm/clickable/use-event-listeners.mjs
var import_react138 = __toESM(require_react(), 1);
function useEventListeners() {
const listeners = (0, import_react138.useRef)(/* @__PURE__ */ new Map());
const currentListeners = listeners.current;
const add3 = (0, import_react138.useCallback)((el, type, listener, options) => {
listeners.current.set(listener, { type, el, options });
el.addEventListener(type, listener, options);
}, []);
const remove = (0, import_react138.useCallback)(
(el, type, listener, options) => {
el.removeEventListener(type, listener, options);
listeners.current.delete(listener);
},
[]
);
(0, import_react138.useEffect)(
() => () => {
currentListeners.forEach((value, key) => {
remove(value.el, value.type, key, value.options);
});
},
[remove, currentListeners]
);
return { add: add3, remove };
}
// ../../node_modules/@chakra-ui/react/dist/esm/clickable/use-clickable.mjs
function isValidElement6(event) {
var _a8, _b3;
const target = ((_b3 = (_a8 = event.composedPath) == null ? void 0 : _a8.call(event)) == null ? void 0 : _b3[0]) ?? event.target;
const { tagName, isContentEditable } = target;
return tagName !== "INPUT" && tagName !== "TEXTAREA" && isContentEditable !== true;
}
function useClickable(props = {}) {
const {
ref: htmlRef,
isDisabled,
isFocusable: isFocusable2,
clickOnEnter = true,
clickOnSpace = true,
onMouseDown,
onMouseUp,
onClick,
onKeyDown,
onKeyUp,
tabIndex: tabIndexProp,
onMouseOver,
onMouseLeave,
...htmlProps
} = props;
const [isButton, setIsButton] = (0, import_react139.useState)(true);
const [isPressed, setIsPressed] = (0, import_react139.useState)(false);
const listeners = useEventListeners();
const refCallback = (node3) => {
if (!node3)
return;
if (node3.tagName !== "BUTTON") {
setIsButton(false);
}
};
const tabIndex = isButton ? tabIndexProp : tabIndexProp || 0;
const trulyDisabled = isDisabled && !isFocusable2;
const handleClick = (0, import_react139.useCallback)(
(event) => {
if (isDisabled) {
event.stopPropagation();
event.preventDefault();
return;
}
const self2 = event.currentTarget;
self2.focus();
onClick == null ? void 0 : onClick(event);
},
[isDisabled, onClick]
);
const onDocumentKeyUp = (0, import_react139.useCallback)(
(e) => {
if (isPressed && isValidElement6(e)) {
e.preventDefault();
e.stopPropagation();
setIsPressed(false);
listeners.remove(document, "keyup", onDocumentKeyUp, false);
}
},
[isPressed, listeners]
);
const handleKeyDown = (0, import_react139.useCallback)(
(event) => {
onKeyDown == null ? void 0 : onKeyDown(event);
if (isDisabled || event.defaultPrevented || event.metaKey) {
return;
}
if (!isValidElement6(event.nativeEvent) || isButton)
return;
const shouldClickOnEnter = clickOnEnter && event.key === "Enter";
const shouldClickOnSpace = clickOnSpace && event.key === " ";
if (shouldClickOnSpace) {
event.preventDefault();
setIsPressed(true);
}
if (shouldClickOnEnter) {
event.preventDefault();
const self2 = event.currentTarget;
self2.click();
}
listeners.add(document, "keyup", onDocumentKeyUp, false);
},
[
isDisabled,
isButton,
onKeyDown,
clickOnEnter,
clickOnSpace,
listeners,
onDocumentKeyUp
]
);
const handleKeyUp = (0, import_react139.useCallback)(
(event) => {
onKeyUp == null ? void 0 : onKeyUp(event);
if (isDisabled || event.defaultPrevented || event.metaKey)
return;
if (!isValidElement6(event.nativeEvent) || isButton)
return;
const shouldClickOnSpace = clickOnSpace && event.key === " ";
if (shouldClickOnSpace) {
event.preventDefault();
setIsPressed(false);
const self2 = event.currentTarget;
self2.click();
}
},
[clickOnSpace, isButton, isDisabled, onKeyUp]
);
const onDocumentMouseUp = (0, import_react139.useCallback)(
(event) => {
if (event.button !== 0)
return;
setIsPressed(false);
listeners.remove(document, "mouseup", onDocumentMouseUp, false);
},
[listeners]
);
const handleMouseDown = (0, import_react139.useCallback)(
(event) => {
if (event.button !== 0)
return;
if (isDisabled) {
event.stopPropagation();
event.preventDefault();
return;
}
if (!isButton) {
setIsPressed(true);
}
const target = event.currentTarget;
target.focus({ preventScroll: true });
listeners.add(document, "mouseup", onDocumentMouseUp, false);
onMouseDown == null ? void 0 : onMouseDown(event);
},
[isDisabled, isButton, onMouseDown, listeners, onDocumentMouseUp]
);
const handleMouseUp = (0, import_react139.useCallback)(
(event) => {
if (event.button !== 0)
return;
if (!isButton) {
setIsPressed(false);
}
onMouseUp == null ? void 0 : onMouseUp(event);
},
[onMouseUp, isButton]
);
const handleMouseOver = (0, import_react139.useCallback)(
(event) => {
if (isDisabled) {
event.preventDefault();
return;
}
onMouseOver == null ? void 0 : onMouseOver(event);
},
[isDisabled, onMouseOver]
);
const handleMouseLeave = (0, import_react139.useCallback)(
(event) => {
if (isPressed) {
event.preventDefault();
setIsPressed(false);
}
onMouseLeave == null ? void 0 : onMouseLeave(event);
},
[isPressed, onMouseLeave]
);
const ref = mergeRefs(htmlRef, refCallback);
if (isButton) {
return {
...htmlProps,
ref,
type: "button",
"aria-disabled": trulyDisabled ? void 0 : isDisabled,
disabled: trulyDisabled,
onClick: handleClick,
onMouseDown,
onMouseUp,
onKeyUp,
onKeyDown,
onMouseOver,
onMouseLeave
};
}
return {
...htmlProps,
ref,
role: "button",
"data-active": dataAttr(isPressed),
"aria-disabled": isDisabled ? "true" : void 0,
tabIndex: trulyDisabled ? void 0 : tabIndex,
onClick: handleClick,
onMouseDown: handleMouseDown,
onMouseUp: handleMouseUp,
onKeyUp: handleKeyUp,
onKeyDown: handleKeyDown,
onMouseOver: handleMouseOver,
onMouseLeave: handleMouseLeave
};
}
// ../../node_modules/@chakra-ui/react/dist/esm/menu/use-menu.mjs
var [
MenuDescendantsProvider,
useMenuDescendantsContext,
useMenuDescendants,
useMenuDescendant
] = createDescendantContext();
var [MenuProvider, useMenuContext] = createContext({
strict: false,
name: "MenuContext"
});
function getOwnerDocument3(node3) {
return (node3 == null ? void 0 : node3.ownerDocument) ?? document;
}
function isActiveElement2(element) {
const doc = getOwnerDocument3(element);
return doc.activeElement === element;
}
function useMenu(props = {}) {
const {
id: id3,
closeOnSelect = true,
closeOnBlur = true,
initialFocusRef,
autoSelect = true,
isLazy,
isOpen: isOpenProp,
defaultIsOpen,
onClose: onCloseProp,
onOpen: onOpenProp,
placement = "bottom-start",
lazyBehavior = "unmount",
direction: direction2,
computePositionOnMount = false,
...popperProps
} = props;
const menuRef = (0, import_react140.useRef)(null);
const buttonRef = (0, import_react140.useRef)(null);
const scrollIntoViewRef = (0, import_react140.useRef)(true);
const descendants = useMenuDescendants();
const focusMenu = (0, import_react140.useCallback)(() => {
requestAnimationFrame(() => {
var _a8;
(_a8 = menuRef.current) == null ? void 0 : _a8.focus({ preventScroll: false });
});
}, []);
const focusFirstItem = (0, import_react140.useCallback)(() => {
const id22 = setTimeout(() => {
var _a8, _b3;
if (initialFocusRef) {
(_a8 = initialFocusRef.current) == null ? void 0 : _a8.focus();
} else if (!descendants.count()) {
(_b3 = menuRef.current) == null ? void 0 : _b3.focus({ preventScroll: false });
} else {
const first = descendants.firstEnabled();
if (first)
setFocusedIndex(first.index);
}
});
timeoutIds.current.add(id22);
}, [descendants, initialFocusRef]);
const focusLastItem = (0, import_react140.useCallback)(() => {
const id22 = setTimeout(() => {
var _a8;
if (!descendants.count()) {
(_a8 = menuRef.current) == null ? void 0 : _a8.focus({ preventScroll: false });
} else {
const last = descendants.lastEnabled();
if (last)
setFocusedIndex(last.index);
}
});
timeoutIds.current.add(id22);
}, [descendants]);
const onOpenInternal = (0, import_react140.useCallback)(() => {
onOpenProp == null ? void 0 : onOpenProp();
if (autoSelect) {
focusFirstItem();
} else {
focusMenu();
}
}, [autoSelect, focusFirstItem, focusMenu, onOpenProp]);
const { isOpen, onOpen, onClose, onToggle } = useDisclosure({
isOpen: isOpenProp,
defaultIsOpen,
onClose: onCloseProp,
onOpen: onOpenInternal
});
useOutsideClick({
enabled: isOpen && closeOnBlur,
ref: menuRef,
handler: (event) => {
var _a8, _b3, _c3;
const target = ((_b3 = (_a8 = event.composedPath) == null ? void 0 : _a8.call(event)) == null ? void 0 : _b3[0]) ?? event.target;
if (!((_c3 = buttonRef.current) == null ? void 0 : _c3.contains(target))) {
onClose();
}
}
});
const popper2 = usePopper({
...popperProps,
enabled: isOpen || computePositionOnMount,
placement,
direction: direction2
});
const [focusedIndex, setFocusedIndex] = (0, import_react140.useState)(-1);
useFocusOnHide(menuRef, {
focusRef: buttonRef,
visible: isOpen,
shouldFocus: true
});
const animationState = useAnimationState({ isOpen, ref: menuRef });
const [buttonId, menuId] = useIds(id3, `menu-button`, `menu-list`);
const openAndFocusMenu = (0, import_react140.useCallback)(() => {
onOpen();
focusMenu();
}, [onOpen, focusMenu]);
const timeoutIds = (0, import_react140.useRef)(/* @__PURE__ */ new Set([]));
(0, import_react140.useEffect)(() => {
const ids = timeoutIds.current;
return () => {
ids.forEach((id22) => clearTimeout(id22));
ids.clear();
};
}, []);
useUpdateEffect(() => {
var _a8;
if (isOpen)
return;
setFocusedIndex(-1);
(_a8 = menuRef.current) == null ? void 0 : _a8.scrollTo(0, 0);
}, [isOpen]);
useUpdateEffect(() => {
if (!isOpen)
return;
if (focusedIndex === -1) {
focusMenu();
}
}, [focusedIndex, isOpen]);
(0, import_react140.useEffect)(() => {
var _a8;
if (!isOpen)
return;
const item = descendants.item(focusedIndex);
(_a8 = item == null ? void 0 : item.node) == null ? void 0 : _a8.focus({ preventScroll: !scrollIntoViewRef.current });
}, [descendants, focusedIndex, isOpen]);
const openAndFocusFirstItem = (0, import_react140.useCallback)(() => {
onOpen();
focusFirstItem();
}, [focusFirstItem, onOpen]);
const openAndFocusLastItem = (0, import_react140.useCallback)(() => {
scrollIntoViewRef.current = true;
onOpen();
focusLastItem();
}, [onOpen, focusLastItem]);
const refocus = (0, import_react140.useCallback)(() => {
var _a8, _b3;
const doc = getOwnerDocument3(menuRef.current);
const hasFocusWithin2 = (_a8 = menuRef.current) == null ? void 0 : _a8.contains(doc.activeElement);
const shouldRefocus = isOpen && !hasFocusWithin2;
if (!shouldRefocus)
return;
const node3 = (_b3 = descendants.item(focusedIndex)) == null ? void 0 : _b3.node;
node3 == null ? void 0 : node3.focus({ preventScroll: !scrollIntoViewRef.current });
}, [isOpen, focusedIndex, descendants]);
return {
openAndFocusMenu,
openAndFocusFirstItem,
openAndFocusLastItem,
onTransitionEnd: refocus,
unstable__animationState: animationState,
descendants,
popper: popper2,
buttonId,
menuId,
forceUpdate: popper2.forceUpdate,
orientation: "vertical",
isOpen,
onToggle,
onOpen,
onClose,
menuRef,
buttonRef,
focusedIndex,
closeOnSelect,
closeOnBlur,
autoSelect,
setFocusedIndex,
isLazy,
lazyBehavior,
initialFocusRef,
scrollIntoViewRef
};
}
function useMenuButton(props = {}, externalRef = null) {
const menu = useMenuContext();
const {
onToggle,
popper: popper2,
openAndFocusFirstItem,
openAndFocusLastItem,
scrollIntoViewRef
} = menu;
const onKeyDown = (0, import_react140.useCallback)(
(event) => {
const eventKey = event.key;
const keyMap = {
Enter: openAndFocusFirstItem,
ArrowDown: openAndFocusFirstItem,
ArrowUp: openAndFocusLastItem
};
const action = keyMap[eventKey];
if (action) {
scrollIntoViewRef.current = true;
event.preventDefault();
event.stopPropagation();
action(event);
}
},
[openAndFocusFirstItem, openAndFocusLastItem, scrollIntoViewRef]
);
return {
...props,
ref: mergeRefs(menu.buttonRef, externalRef, popper2.referenceRef),
id: menu.buttonId,
"data-active": dataAttr(menu.isOpen),
"aria-expanded": menu.isOpen,
"aria-haspopup": "menu",
"aria-controls": menu.menuId,
onClick: callAllHandlers(props.onClick, onToggle),
onKeyDown: callAllHandlers(props.onKeyDown, onKeyDown)
};
}
function isTargetMenuItem(target) {
var _a8;
return isHTMLElement3(target) && !!((_a8 = target == null ? void 0 : target.getAttribute("role")) == null ? void 0 : _a8.startsWith("menuitem"));
}
function useMenuList(props = {}, ref = null) {
const menu = useMenuContext();
if (!menu) {
throw new Error(
`useMenuContext: context is undefined. Seems you forgot to wrap component within