/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 679: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var reactIs = __webpack_require__(864); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ 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) { // React v16.11 and below if (reactIs.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ 554: /***/ ((module, exports, __webpack_require__) => { /* module decorator */ module = __webpack_require__.nmd(module); /** * Lodash (Custom Build) <https://lodash.com/> * Build: `lodash modularize exports="npm" -o ./` * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to identify `toStringTag` values of typed arrays. */ 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; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined, Symbol = root.Symbol, Uint8Array = root.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeMax = Math.max, nativeNow = Date.now; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (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; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, 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 (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ 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; } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = mergeWith; /***/ }), /***/ 590: /***/ ((module) => { /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */ var hasElementType = typeof Element !== 'undefined'; var hasMap = typeof Map === 'function'; var hasSet = typeof Set === 'function'; var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView; // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js function equal(a, b) { // START: fast-deep-equal es6/index.js 3.1.3 if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } // START: Modifications: // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code // to co-exist with es5. // 2. Replace `for of` with es5 compliant iteration using `for`. // Basically, take: // // ```js // for (i of a.entries()) // if (!b.has(i[0])) return false; // ``` // // ... and convert to: // // ```js // it = a.entries(); // while (!(i = it.next()).done) // if (!b.has(i.value[0])) return false; // ``` // // **Note**: `i` access switches to `i.value`. 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; } // END: Modifications if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; // START: Modifications: // Apply guards for `Object.create(null)` handling. See: // - https://github.com/FormidableLabs/react-fast-compare/issues/64 // - https://github.com/epoberezkin/fast-deep-equal/issues/49 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(); // END: Modifications keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; // END: fast-deep-equal // START: react-fast-compare // custom handling for DOM elements if (hasElementType && a instanceof Element) return false; // custom handling for React/Preact for (i = length; i-- !== 0;) { if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) { // React-specific: avoid traversing React elements' _owner // Preact-specific: avoid traversing Preact elements' __v and __o // __v = $_original / $_vnode // __o = $_owner // These properties contain circular references and are not needed when // comparing the actual elements (and not their owners) // .$$typeof and ._store on just reasonable markers of elements continue; } // all other properties should be traversed as usual if (!equal(a[keys[i]], b[keys[i]])) return false; } // END: react-fast-compare // START: fast-deep-equal return true; } return a !== a && b !== b; } // end fast-deep-equal module.exports = function isEqual(a, b) { try { return equal(a, b); } catch (error) { if (((error.message || '').match(/stack|recursion/i))) { // warn on circular references, don't crash // browsers give this different errors name and messages: // chrome/safari: "RangeError", "Maximum call stack size exceeded" // firefox: "InternalError", too much recursion" // edge: "Error", "Out of stack space" console.warn('react-fast-compare cannot handle circular refs'); return false; } // some other error. we should definitely know about these throw error; } }; /***/ }), /***/ 921: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; /***/ }), /***/ 864: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(921); } else {} /***/ }), /***/ 938: /***/ ((module) => { if (true) { module.exports = { ReactQueryDevtools: function () { return null }, ReactQueryDevtoolsPanel: function () { return null }, } } else {} /***/ }), /***/ 852: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ j: () => (/* binding */ focusManager) /* harmony export */ }); /* unused harmony export FocusManager */ /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(849); /* harmony import */ var _subscribable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(943); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(288); var FocusManager = /*#__PURE__*/function (_Subscribable) { (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(FocusManager, _Subscribable); function FocusManager() { var _this; _this = _Subscribable.call(this) || this; _this.setup = function (onFocus) { var _window; if (!_utils__WEBPACK_IMPORTED_MODULE_1__/* .isServer */ .sk && ((_window = window) == null ? void 0 : _window.addEventListener)) { var listener = function listener() { return onFocus(); }; // Listen to visibillitychange and focus window.addEventListener('visibilitychange', listener, false); window.addEventListener('focus', listener, false); return function () { // Be sure to unsubscribe if a new handler is set window.removeEventListener('visibilitychange', listener); window.removeEventListener('focus', listener); }; } }; return _this; } var _proto = FocusManager.prototype; _proto.onSubscribe = function onSubscribe() { if (!this.cleanup) { this.setEventListener(this.setup); } }; _proto.onUnsubscribe = function onUnsubscribe() { if (!this.hasListeners()) { var _this$cleanup; (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); this.cleanup = undefined; } }; _proto.setEventListener = function setEventListener(setup) { var _this$cleanup2, _this2 = this; this.setup = setup; (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); this.cleanup = setup(function (focused) { if (typeof focused === 'boolean') { _this2.setFocused(focused); } else { _this2.onFocus(); } }); }; _proto.setFocused = function setFocused(focused) { this.focused = focused; if (focused) { this.onFocus(); } }; _proto.onFocus = function onFocus() { this.listeners.forEach(function (listener) { listener(); }); }; _proto.isFocused = function isFocused() { if (typeof this.focused === 'boolean') { return this.focused; } // document global can be unavailable in react native if (typeof document === 'undefined') { return true; } return [undefined, 'visible', 'prerender'].includes(document.visibilityState); }; return FocusManager; }(_subscribable__WEBPACK_IMPORTED_MODULE_2__/* .Subscribable */ .l); var focusManager = new FocusManager(); /***/ }), /***/ 747: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ QueryClient: () => (/* reexport safe */ _queryClient__WEBPACK_IMPORTED_MODULE_0__.S) /* harmony export */ }); /* harmony import */ var _queryClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(323); /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(755); /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__); /* harmony reexport (checked) */ if(__webpack_require__.o(_types__WEBPACK_IMPORTED_MODULE_1__, "QueryClientProvider")) __webpack_require__.d(__webpack_exports__, { QueryClientProvider: function() { return _types__WEBPACK_IMPORTED_MODULE_1__.QueryClientProvider; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_types__WEBPACK_IMPORTED_MODULE_1__, "useMutation")) __webpack_require__.d(__webpack_exports__, { useMutation: function() { return _types__WEBPACK_IMPORTED_MODULE_1__.useMutation; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_types__WEBPACK_IMPORTED_MODULE_1__, "useQuery")) __webpack_require__.d(__webpack_exports__, { useQuery: function() { return _types__WEBPACK_IMPORTED_MODULE_1__.useQuery; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_types__WEBPACK_IMPORTED_MODULE_1__, "useQueryClient")) __webpack_require__.d(__webpack_exports__, { useQueryClient: function() { return _types__WEBPACK_IMPORTED_MODULE_1__.useQueryClient; } }); // Types /***/ }), /***/ 909: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ setLogger), /* harmony export */ j: () => (/* binding */ getLogger) /* harmony export */ }); // TYPES // FUNCTIONS var logger = console; function getLogger() { return logger; } function setLogger(newLogger) { logger = newLogger; } /***/ }), /***/ 262: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ R: () => (/* binding */ getDefaultState), /* harmony export */ m: () => (/* binding */ Mutation) /* harmony export */ }); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(312); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(909); /* harmony import */ var _notifyManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(101); /* harmony import */ var _retryer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(216); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(288); // TYPES // CLASS var Mutation = /*#__PURE__*/function () { function Mutation(config) { this.options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, config.defaultOptions, config.options); this.mutationId = config.mutationId; this.mutationCache = config.mutationCache; this.observers = []; this.state = config.state || getDefaultState(); this.meta = config.meta; } var _proto = Mutation.prototype; _proto.setState = function setState(state) { this.dispatch({ type: 'setState', state: state }); }; _proto.addObserver = function addObserver(observer) { if (this.observers.indexOf(observer) === -1) { this.observers.push(observer); } }; _proto.removeObserver = function removeObserver(observer) { this.observers = this.observers.filter(function (x) { return x !== observer; }); }; _proto.cancel = function cancel() { if (this.retryer) { this.retryer.cancel(); return this.retryer.promise.then(_utils__WEBPACK_IMPORTED_MODULE_1__/* .noop */ .ZT).catch(_utils__WEBPACK_IMPORTED_MODULE_1__/* .noop */ .ZT); } return Promise.resolve(); }; _proto.continue = function _continue() { if (this.retryer) { this.retryer.continue(); return this.retryer.promise; } return this.execute(); }; _proto.execute = function execute() { var _this = this; var data; var restored = this.state.status === 'loading'; var promise = Promise.resolve(); if (!restored) { this.dispatch({ type: 'loading', variables: this.options.variables }); promise = promise.then(function () { // Notify cache callback _this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this); }).then(function () { return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables); }).then(function (context) { if (context !== _this.state.context) { _this.dispatch({ type: 'loading', context: context, variables: _this.state.variables }); } }); } return promise.then(function () { return _this.executeMutation(); }).then(function (result) { data = result; // Notify cache callback _this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this); }).then(function () { return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context); }).then(function () { return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context); }).then(function () { _this.dispatch({ type: 'success', data: data }); return data; }).catch(function (error) { // Notify cache callback _this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); // Log error (0,_logger__WEBPACK_IMPORTED_MODULE_2__/* .getLogger */ .j)().error(error); return Promise.resolve().then(function () { return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context); }).then(function () { return _this.options.onSettled == null ? void 0 : _this.options.onSettled(undefined, error, _this.state.variables, _this.state.context); }).then(function () { _this.dispatch({ type: 'error', error: error }); throw error; }); }); }; _proto.executeMutation = function executeMutation() { var _this2 = this, _this$options$retry; this.retryer = new _retryer__WEBPACK_IMPORTED_MODULE_3__/* .Retryer */ .m4({ fn: function fn() { if (!_this2.options.mutationFn) { return Promise.reject('No mutationFn found'); } return _this2.options.mutationFn(_this2.state.variables); }, onFail: function onFail() { _this2.dispatch({ type: 'failed' }); }, onPause: function onPause() { _this2.dispatch({ type: 'pause' }); }, onContinue: function onContinue() { _this2.dispatch({ type: 'continue' }); }, retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0, retryDelay: this.options.retryDelay }); return this.retryer.promise; }; _proto.dispatch = function dispatch(action) { var _this3 = this; this.state = reducer(this.state, action); _notifyManager__WEBPACK_IMPORTED_MODULE_4__/* .notifyManager */ .V.batch(function () { _this3.observers.forEach(function (observer) { observer.onMutationUpdate(action); }); _this3.mutationCache.notify(_this3); }); }; return Mutation; }(); function getDefaultState() { return { context: undefined, data: undefined, error: null, failureCount: 0, isPaused: false, status: 'idle', variables: undefined }; } function reducer(state, action) { switch (action.type) { case 'failed': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { failureCount: state.failureCount + 1 }); case 'pause': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { isPaused: true }); case 'continue': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { isPaused: false }); case 'loading': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { context: action.context, data: undefined, error: null, isPaused: false, status: 'loading', variables: action.variables }); case 'success': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { data: action.data, error: null, status: 'success', isPaused: false }); case 'error': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, { data: undefined, error: action.error, failureCount: state.failureCount + 1, isPaused: false, status: 'error' }); case 'setState': return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, state, action.state); default: return state; } } /***/ }), /***/ 101: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ notifyManager) /* harmony export */ }); /* unused harmony export NotifyManager */ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(288); // TYPES // CLASS var NotifyManager = /*#__PURE__*/function () { function NotifyManager() { this.queue = []; this.transactions = 0; this.notifyFn = function (callback) { callback(); }; this.batchNotifyFn = function (callback) { callback(); }; } var _proto = NotifyManager.prototype; _proto.batch = function batch(callback) { var result; this.transactions++; try { result = callback(); } finally { this.transactions--; if (!this.transactions) { this.flush(); } } return result; }; _proto.schedule = function schedule(callback) { var _this = this; if (this.transactions) { this.queue.push(callback); } else { (0,_utils__WEBPACK_IMPORTED_MODULE_0__/* .scheduleMicrotask */ .A4)(function () { _this.notifyFn(callback); }); } } /** * All calls to the wrapped function will be batched. */ ; _proto.batchCalls = function batchCalls(callback) { var _this2 = this; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this2.schedule(function () { callback.apply(void 0, args); }); }; }; _proto.flush = function flush() { var _this3 = this; var queue = this.queue; this.queue = []; if (queue.length) { (0,_utils__WEBPACK_IMPORTED_MODULE_0__/* .scheduleMicrotask */ .A4)(function () { _this3.batchNotifyFn(function () { queue.forEach(function (callback) { _this3.notifyFn(callback); }); }); }); } } /** * Use this method to set a custom notify function. * This can be used to for example wrap notifications with `React.act` while running tests. */ ; _proto.setNotifyFunction = function setNotifyFunction(fn) { this.notifyFn = fn; } /** * Use this method to set a custom function to batch notifications together into a single tick. * By default React Query will use the batch function provided by ReactDOM or React Native. */ ; _proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn) { this.batchNotifyFn = fn; }; return NotifyManager; }(); // SINGLETON var notifyManager = new NotifyManager(); /***/ }), /***/ 68: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ N: () => (/* binding */ onlineManager) /* harmony export */ }); /* unused harmony export OnlineManager */ /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(849); /* harmony import */ var _subscribable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(943); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(288); var OnlineManager = /*#__PURE__*/function (_Subscribable) { (0,_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)(OnlineManager, _Subscribable); function OnlineManager() { var _this; _this = _Subscribable.call(this) || this; _this.setup = function (onOnline) { var _window; if (!_utils__WEBPACK_IMPORTED_MODULE_1__/* .isServer */ .sk && ((_window = window) == null ? void 0 : _window.addEventListener)) { var listener = function listener() { return onOnline(); }; // Listen to online window.addEventListener('online', listener, false); window.addEventListener('offline', listener, false); return function () { // Be sure to unsubscribe if a new handler is set window.removeEventListener('online', listener); window.removeEventListener('offline', listener); }; } }; return _this; } var _proto = OnlineManager.prototype; _proto.onSubscribe = function onSubscribe() { if (!this.cleanup) { this.setEventListener(this.setup); } }; _proto.onUnsubscribe = function onUnsubscribe() { if (!this.hasListeners()) { var _this$cleanup; (_this$cleanup = this.cleanup) == null ? void 0 : _this$cleanup.call(this); this.cleanup = undefined; } }; _proto.setEventListener = function setEventListener(setup) { var _this$cleanup2, _this2 = this; this.setup = setup; (_this$cleanup2 = this.cleanup) == null ? void 0 : _this$cleanup2.call(this); this.cleanup = setup(function (online) { if (typeof online === 'boolean') { _this2.setOnline(online); } else { _this2.onOnline(); } }); }; _proto.setOnline = function setOnline(online) { this.online = online; if (online) { this.onOnline(); } }; _proto.onOnline = function onOnline() { this.listeners.forEach(function (listener) { listener(); }); }; _proto.isOnline = function isOnline() { if (typeof this.online === 'boolean') { return this.online; } if (typeof navigator === 'undefined' || typeof navigator.onLine === 'undefined') { return true; } return navigator.onLine; }; return OnlineManager; }(_subscribable__WEBPACK_IMPORTED_MODULE_2__/* .Subscribable */ .l); var onlineManager = new OnlineManager(); /***/ }), /***/ 323: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { S: () => (/* binding */ QueryClient) }); // EXTERNAL MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(312); // EXTERNAL MODULE: ./node_modules/react-query/es/core/utils.js var utils = __webpack_require__(288); // EXTERNAL MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js + 1 modules var inheritsLoose = __webpack_require__(849); // EXTERNAL MODULE: ./node_modules/react-query/es/core/notifyManager.js var notifyManager = __webpack_require__(101); // EXTERNAL MODULE: ./node_modules/react-query/es/core/logger.js var logger = __webpack_require__(909); // EXTERNAL MODULE: ./node_modules/react-query/es/core/retryer.js var retryer = __webpack_require__(216); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/query.js // TYPES // CLASS var Query = /*#__PURE__*/function () { function Query(config) { this.abortSignalConsumed = false; this.hadObservers = false; this.defaultOptions = config.defaultOptions; this.setOptions(config.options); this.observers = []; this.cache = config.cache; this.queryKey = config.queryKey; this.queryHash = config.queryHash; this.initialState = config.state || this.getDefaultState(this.options); this.state = this.initialState; this.meta = config.meta; this.scheduleGc(); } var _proto = Query.prototype; _proto.setOptions = function setOptions(options) { var _this$options$cacheTi; this.options = (0,esm_extends/* default */.Z)({}, this.defaultOptions, options); this.meta = options == null ? void 0 : options.meta; // Default to 5 minutes if not cache time is set this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 5 * 60 * 1000); }; _proto.setDefaultOptions = function setDefaultOptions(options) { this.defaultOptions = options; }; _proto.scheduleGc = function scheduleGc() { var _this = this; this.clearGcTimeout(); if ((0,utils/* isValidTimeout */.PN)(this.cacheTime)) { this.gcTimeout = setTimeout(function () { _this.optionalRemove(); }, this.cacheTime); } }; _proto.clearGcTimeout = function clearGcTimeout() { if (this.gcTimeout) { clearTimeout(this.gcTimeout); this.gcTimeout = undefined; } }; _proto.optionalRemove = function optionalRemove() { if (!this.observers.length) { if (this.state.isFetching) { if (this.hadObservers) { this.scheduleGc(); } } else { this.cache.remove(this); } } }; _proto.setData = function setData(updater, options) { var _this$options$isDataE, _this$options; var prevData = this.state.data; // Get the new data var data = (0,utils/* functionalUpdate */.SE)(updater, prevData); // Use prev data if an isDataEqual function is defined and returns `true` if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) { data = prevData; } else if (this.options.structuralSharing !== false) { // Structurally share data between prev and new data if needed data = (0,utils/* replaceEqualDeep */.Q$)(prevData, data); } // Set data and mark it as cached this.dispatch({ data: data, type: 'success', dataUpdatedAt: options == null ? void 0 : options.updatedAt }); return data; }; _proto.setState = function setState(state, setStateOptions) { this.dispatch({ type: 'setState', state: state, setStateOptions: setStateOptions }); }; _proto.cancel = function cancel(options) { var _this$retryer; var promise = this.promise; (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options); return promise ? promise.then(utils/* noop */.ZT).catch(utils/* noop */.ZT) : Promise.resolve(); }; _proto.destroy = function destroy() { this.clearGcTimeout(); this.cancel({ silent: true }); }; _proto.reset = function reset() { this.destroy(); this.setState(this.initialState); }; _proto.isActive = function isActive() { return this.observers.some(function (observer) { return observer.options.enabled !== false; }); }; _proto.isFetching = function isFetching() { return this.state.isFetching; }; _proto.isStale = function isStale() { return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function (observer) { return observer.getCurrentResult().isStale; }); }; _proto.isStaleByTime = function isStaleByTime(staleTime) { if (staleTime === void 0) { staleTime = 0; } return this.state.isInvalidated || !this.state.dataUpdatedAt || !(0,utils/* timeUntilStale */.Kp)(this.state.dataUpdatedAt, staleTime); }; _proto.onFocus = function onFocus() { var _this$retryer2; var observer = this.observers.find(function (x) { return x.shouldFetchOnWindowFocus(); }); if (observer) { observer.refetch(); } // Continue fetch if currently paused (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue(); }; _proto.onOnline = function onOnline() { var _this$retryer3; var observer = this.observers.find(function (x) { return x.shouldFetchOnReconnect(); }); if (observer) { observer.refetch(); } // Continue fetch if currently paused (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue(); }; _proto.addObserver = function addObserver(observer) { if (this.observers.indexOf(observer) === -1) { this.observers.push(observer); this.hadObservers = true; // Stop the query from being garbage collected this.clearGcTimeout(); this.cache.notify({ type: 'observerAdded', query: this, observer: observer }); } }; _proto.removeObserver = function removeObserver(observer) { if (this.observers.indexOf(observer) !== -1) { this.observers = this.observers.filter(function (x) { return x !== observer; }); if (!this.observers.length) { // If the transport layer does not support cancellation // we'll let the query continue so the result can be cached if (this.retryer) { if (this.retryer.isTransportCancelable || this.abortSignalConsumed) { this.retryer.cancel({ revert: true }); } else { this.retryer.cancelRetry(); } } if (this.cacheTime) { this.scheduleGc(); } else { this.cache.remove(this); } } this.cache.notify({ type: 'observerRemoved', query: this, observer: observer }); } }; _proto.getObserversCount = function getObserversCount() { return this.observers.length; }; _proto.invalidate = function invalidate() { if (!this.state.isInvalidated) { this.dispatch({ type: 'invalidate' }); } }; _proto.fetch = function fetch(options, fetchOptions) { var _this2 = this, _this$options$behavio, _context$fetchOptions, _abortController$abor; if (this.state.isFetching) { if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { // Silently cancel current fetch if the user wants to cancel refetches this.cancel({ silent: true }); } else if (this.promise) { var _this$retryer4; // make sure that retries that were potentially cancelled due to unmounts can continue (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching return this.promise; } } // Update config if passed, otherwise the config from the last execution is used if (options) { this.setOptions(options); } // Use the options from the first observer with a query function if no function is found. // This can happen when the query is hydrated or created with setQueryData. if (!this.options.queryFn) { var observer = this.observers.find(function (x) { return x.options.queryFn; }); if (observer) { this.setOptions(observer.options); } } var queryKey = (0,utils/* ensureQueryKeyArray */.mc)(this.queryKey); var abortController = (0,utils/* getAbortController */.G9)(); // Create query function context var queryFnContext = { queryKey: queryKey, pageParam: undefined, meta: this.meta }; Object.defineProperty(queryFnContext, 'signal', { enumerable: true, get: function get() { if (abortController) { _this2.abortSignalConsumed = true; return abortController.signal; } return undefined; } }); // Create fetch function var fetchFn = function fetchFn() { if (!_this2.options.queryFn) { return Promise.reject('Missing queryFn'); } _this2.abortSignalConsumed = false; return _this2.options.queryFn(queryFnContext); }; // Trigger behavior hook var context = { fetchOptions: fetchOptions, options: this.options, queryKey: queryKey, state: this.state, fetchFn: fetchFn, meta: this.meta }; if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) { var _this$options$behavio2; (_this$options$behavio2 = this.options.behavior) == null ? void 0 : _this$options$behavio2.onFetch(context); } // Store state in case the current fetch needs to be reverted this.revertState = this.state; // Set to fetching state if not already in it if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) { var _context$fetchOptions2; this.dispatch({ type: 'fetch', meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta }); } // Try to fetch the data this.retryer = new retryer/* Retryer */.m4({ fn: context.fetchFn, abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController), onSuccess: function onSuccess(data) { _this2.setData(data); // Notify cache callback _this2.cache.config.onSuccess == null ? void 0 : _this2.cache.config.onSuccess(data, _this2); // Remove query after fetching if cache time is 0 if (_this2.cacheTime === 0) { _this2.optionalRemove(); } }, onError: function onError(error) { // Optimistically update state if needed if (!((0,retryer/* isCancelledError */.DV)(error) && error.silent)) { _this2.dispatch({ type: 'error', error: error }); } if (!(0,retryer/* isCancelledError */.DV)(error)) { // Notify cache callback _this2.cache.config.onError == null ? void 0 : _this2.cache.config.onError(error, _this2); // Log error (0,logger/* getLogger */.j)().error(error); } // Remove query after fetching if cache time is 0 if (_this2.cacheTime === 0) { _this2.optionalRemove(); } }, onFail: function onFail() { _this2.dispatch({ type: 'failed' }); }, onPause: function onPause() { _this2.dispatch({ type: 'pause' }); }, onContinue: function onContinue() { _this2.dispatch({ type: 'continue' }); }, retry: context.options.retry, retryDelay: context.options.retryDelay }); this.promise = this.retryer.promise; return this.promise; }; _proto.dispatch = function dispatch(action) { var _this3 = this; this.state = this.reducer(this.state, action); notifyManager/* notifyManager */.V.batch(function () { _this3.observers.forEach(function (observer) { observer.onQueryUpdate(action); }); _this3.cache.notify({ query: _this3, type: 'queryUpdated', action: action }); }); }; _proto.getDefaultState = function getDefaultState(options) { var data = typeof options.initialData === 'function' ? options.initialData() : options.initialData; var hasInitialData = typeof options.initialData !== 'undefined'; var initialDataUpdatedAt = hasInitialData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; var hasData = typeof data !== 'undefined'; return { data: data, dataUpdateCount: 0, dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0, error: null, errorUpdateCount: 0, errorUpdatedAt: 0, fetchFailureCount: 0, fetchMeta: null, isFetching: false, isInvalidated: false, isPaused: false, status: hasData ? 'success' : 'idle' }; }; _proto.reducer = function reducer(state, action) { var _action$meta, _action$dataUpdatedAt; switch (action.type) { case 'failed': return (0,esm_extends/* default */.Z)({}, state, { fetchFailureCount: state.fetchFailureCount + 1 }); case 'pause': return (0,esm_extends/* default */.Z)({}, state, { isPaused: true }); case 'continue': return (0,esm_extends/* default */.Z)({}, state, { isPaused: false }); case 'fetch': return (0,esm_extends/* default */.Z)({}, state, { fetchFailureCount: 0, fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null, isFetching: true, isPaused: false }, !state.dataUpdatedAt && { error: null, status: 'loading' }); case 'success': return (0,esm_extends/* default */.Z)({}, state, { data: action.data, dataUpdateCount: state.dataUpdateCount + 1, dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(), error: null, fetchFailureCount: 0, isFetching: false, isInvalidated: false, isPaused: false, status: 'success' }); case 'error': var error = action.error; if ((0,retryer/* isCancelledError */.DV)(error) && error.revert && this.revertState) { return (0,esm_extends/* default */.Z)({}, this.revertState); } return (0,esm_extends/* default */.Z)({}, state, { error: error, errorUpdateCount: state.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: state.fetchFailureCount + 1, isFetching: false, isPaused: false, status: 'error' }); case 'invalidate': return (0,esm_extends/* default */.Z)({}, state, { isInvalidated: true }); case 'setState': return (0,esm_extends/* default */.Z)({}, state, action.state); default: return state; } }; return Query; }(); // EXTERNAL MODULE: ./node_modules/react-query/es/core/subscribable.js var subscribable = __webpack_require__(943); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/queryCache.js // CLASS var QueryCache = /*#__PURE__*/function (_Subscribable) { (0,inheritsLoose/* default */.Z)(QueryCache, _Subscribable); function QueryCache(config) { var _this; _this = _Subscribable.call(this) || this; _this.config = config || {}; _this.queries = []; _this.queriesMap = {}; return _this; } var _proto = QueryCache.prototype; _proto.build = function build(client, options, state) { var _options$queryHash; var queryKey = options.queryKey; var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : (0,utils/* hashQueryKeyByOptions */.Rm)(queryKey, options); var query = this.get(queryHash); if (!query) { query = new Query({ cache: this, queryKey: queryKey, queryHash: queryHash, options: client.defaultQueryOptions(options), state: state, defaultOptions: client.getQueryDefaults(queryKey), meta: options.meta }); this.add(query); } return query; }; _proto.add = function add(query) { if (!this.queriesMap[query.queryHash]) { this.queriesMap[query.queryHash] = query; this.queries.push(query); this.notify({ type: 'queryAdded', query: query }); } }; _proto.remove = function remove(query) { var queryInMap = this.queriesMap[query.queryHash]; if (queryInMap) { query.destroy(); this.queries = this.queries.filter(function (x) { return x !== query; }); if (queryInMap === query) { delete this.queriesMap[query.queryHash]; } this.notify({ type: 'queryRemoved', query: query }); } }; _proto.clear = function clear() { var _this2 = this; notifyManager/* notifyManager */.V.batch(function () { _this2.queries.forEach(function (query) { _this2.remove(query); }); }); }; _proto.get = function get(queryHash) { return this.queriesMap[queryHash]; }; _proto.getAll = function getAll() { return this.queries; }; _proto.find = function find(arg1, arg2) { var _parseFilterArgs = (0,utils/* parseFilterArgs */.I6)(arg1, arg2), filters = _parseFilterArgs[0]; if (typeof filters.exact === 'undefined') { filters.exact = true; } return this.queries.find(function (query) { return (0,utils/* matchQuery */._x)(filters, query); }); }; _proto.findAll = function findAll(arg1, arg2) { var _parseFilterArgs2 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2), filters = _parseFilterArgs2[0]; return Object.keys(filters).length > 0 ? this.queries.filter(function (query) { return (0,utils/* matchQuery */._x)(filters, query); }) : this.queries; }; _proto.notify = function notify(event) { var _this3 = this; notifyManager/* notifyManager */.V.batch(function () { _this3.listeners.forEach(function (listener) { listener(event); }); }); }; _proto.onFocus = function onFocus() { var _this4 = this; notifyManager/* notifyManager */.V.batch(function () { _this4.queries.forEach(function (query) { query.onFocus(); }); }); }; _proto.onOnline = function onOnline() { var _this5 = this; notifyManager/* notifyManager */.V.batch(function () { _this5.queries.forEach(function (query) { query.onOnline(); }); }); }; return QueryCache; }(subscribable/* Subscribable */.l); // EXTERNAL MODULE: ./node_modules/react-query/es/core/mutation.js var core_mutation = __webpack_require__(262); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/mutationCache.js // TYPES // CLASS var MutationCache = /*#__PURE__*/function (_Subscribable) { (0,inheritsLoose/* default */.Z)(MutationCache, _Subscribable); function MutationCache(config) { var _this; _this = _Subscribable.call(this) || this; _this.config = config || {}; _this.mutations = []; _this.mutationId = 0; return _this; } var _proto = MutationCache.prototype; _proto.build = function build(client, options, state) { var mutation = new core_mutation/* Mutation */.m({ mutationCache: this, mutationId: ++this.mutationId, options: client.defaultMutationOptions(options), state: state, defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined, meta: options.meta }); this.add(mutation); return mutation; }; _proto.add = function add(mutation) { this.mutations.push(mutation); this.notify(mutation); }; _proto.remove = function remove(mutation) { this.mutations = this.mutations.filter(function (x) { return x !== mutation; }); mutation.cancel(); this.notify(mutation); }; _proto.clear = function clear() { var _this2 = this; notifyManager/* notifyManager */.V.batch(function () { _this2.mutations.forEach(function (mutation) { _this2.remove(mutation); }); }); }; _proto.getAll = function getAll() { return this.mutations; }; _proto.find = function find(filters) { if (typeof filters.exact === 'undefined') { filters.exact = true; } return this.mutations.find(function (mutation) { return (0,utils/* matchMutation */.X7)(filters, mutation); }); }; _proto.findAll = function findAll(filters) { return this.mutations.filter(function (mutation) { return (0,utils/* matchMutation */.X7)(filters, mutation); }); }; _proto.notify = function notify(mutation) { var _this3 = this; notifyManager/* notifyManager */.V.batch(function () { _this3.listeners.forEach(function (listener) { listener(mutation); }); }); }; _proto.onFocus = function onFocus() { this.resumePausedMutations(); }; _proto.onOnline = function onOnline() { this.resumePausedMutations(); }; _proto.resumePausedMutations = function resumePausedMutations() { var pausedMutations = this.mutations.filter(function (x) { return x.state.isPaused; }); return notifyManager/* notifyManager */.V.batch(function () { return pausedMutations.reduce(function (promise, mutation) { return promise.then(function () { return mutation.continue().catch(utils/* noop */.ZT); }); }, Promise.resolve()); }); }; return MutationCache; }(subscribable/* Subscribable */.l); // EXTERNAL MODULE: ./node_modules/react-query/es/core/focusManager.js var focusManager = __webpack_require__(852); // EXTERNAL MODULE: ./node_modules/react-query/es/core/onlineManager.js var onlineManager = __webpack_require__(68); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/infiniteQueryBehavior.js function infiniteQueryBehavior() { return { onFetch: function onFetch(context) { context.fetchFn = function () { var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2; var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage; var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore; var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam; var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward'; var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward'; var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || []; var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || []; var abortController = (0,utils/* getAbortController */.G9)(); var abortSignal = abortController == null ? void 0 : abortController.signal; var newPageParams = oldPageParams; var cancelled = false; // Get query function var queryFn = context.options.queryFn || function () { return Promise.reject('Missing queryFn'); }; var buildNewPages = function buildNewPages(pages, param, page, previous) { newPageParams = previous ? [param].concat(newPageParams) : [].concat(newPageParams, [param]); return previous ? [page].concat(pages) : [].concat(pages, [page]); }; // Create function to fetch a page var fetchPage = function fetchPage(pages, manual, param, previous) { if (cancelled) { return Promise.reject('Cancelled'); } if (typeof param === 'undefined' && !manual && pages.length) { return Promise.resolve(pages); } var queryFnContext = { queryKey: context.queryKey, signal: abortSignal, pageParam: param, meta: context.meta }; var queryFnResult = queryFn(queryFnContext); var promise = Promise.resolve(queryFnResult).then(function (page) { return buildNewPages(pages, param, page, previous); }); if ((0,retryer/* isCancelable */.LE)(queryFnResult)) { var promiseAsAny = promise; promiseAsAny.cancel = queryFnResult.cancel; } return promise; }; var promise; // Fetch first page? if (!oldPages.length) { promise = fetchPage([]); } // Fetch next page? else if (isFetchingNextPage) { var manual = typeof pageParam !== 'undefined'; var param = manual ? pageParam : getNextPageParam(context.options, oldPages); promise = fetchPage(oldPages, manual, param); } // Fetch previous page? else if (isFetchingPreviousPage) { var _manual = typeof pageParam !== 'undefined'; var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages); promise = fetchPage(oldPages, _manual, _param, true); } // Refetch pages else { (function () { newPageParams = []; var manual = typeof context.options.getNextPageParam === 'undefined'; var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages var _loop = function _loop(i) { promise = promise.then(function (pages) { var shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true; if (shouldFetchNextPage) { var _param2 = manual ? oldPageParams[i] : getNextPageParam(context.options, pages); return fetchPage(pages, manual, _param2); } return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i])); }); }; for (var i = 1; i < oldPages.length; i++) { _loop(i); } })(); } var finalPromise = promise.then(function (pages) { return { pages: pages, pageParams: newPageParams }; }); var finalPromiseAsAny = finalPromise; finalPromiseAsAny.cancel = function () { cancelled = true; abortController == null ? void 0 : abortController.abort(); if ((0,retryer/* isCancelable */.LE)(promise)) { promise.cancel(); } }; return finalPromise; }; } }; } function getNextPageParam(options, pages) { return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages); } function getPreviousPageParam(options, pages) { return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages); } /** * Checks if there is a next page. * Returns `undefined` if it cannot be determined. */ function hasNextPage(options, pages) { if (options.getNextPageParam && Array.isArray(pages)) { var nextPageParam = getNextPageParam(options, pages); return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false; } } /** * Checks if there is a previous page. * Returns `undefined` if it cannot be determined. */ function hasPreviousPage(options, pages) { if (options.getPreviousPageParam && Array.isArray(pages)) { var previousPageParam = getPreviousPageParam(options, pages); return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false; } } ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/queryClient.js // CLASS var QueryClient = /*#__PURE__*/function () { function QueryClient(config) { if (config === void 0) { config = {}; } this.queryCache = config.queryCache || new QueryCache(); this.mutationCache = config.mutationCache || new MutationCache(); this.defaultOptions = config.defaultOptions || {}; this.queryDefaults = []; this.mutationDefaults = []; } var _proto = QueryClient.prototype; _proto.mount = function mount() { var _this = this; this.unsubscribeFocus = focusManager/* focusManager */.j.subscribe(function () { if (focusManager/* focusManager */.j.isFocused() && onlineManager/* onlineManager */.N.isOnline()) { _this.mutationCache.onFocus(); _this.queryCache.onFocus(); } }); this.unsubscribeOnline = onlineManager/* onlineManager */.N.subscribe(function () { if (focusManager/* focusManager */.j.isFocused() && onlineManager/* onlineManager */.N.isOnline()) { _this.mutationCache.onOnline(); _this.queryCache.onOnline(); } }); }; _proto.unmount = function unmount() { var _this$unsubscribeFocu, _this$unsubscribeOnli; (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this); (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this); }; _proto.isFetching = function isFetching(arg1, arg2) { var _parseFilterArgs = (0,utils/* parseFilterArgs */.I6)(arg1, arg2), filters = _parseFilterArgs[0]; filters.fetching = true; return this.queryCache.findAll(filters).length; }; _proto.isMutating = function isMutating(filters) { return this.mutationCache.findAll((0,esm_extends/* default */.Z)({}, filters, { fetching: true })).length; }; _proto.getQueryData = function getQueryData(queryKey, filters) { var _this$queryCache$find; return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data; }; _proto.getQueriesData = function getQueriesData(queryKeyOrFilters) { return this.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref) { var queryKey = _ref.queryKey, state = _ref.state; var data = state.data; return [queryKey, data]; }); }; _proto.setQueryData = function setQueryData(queryKey, updater, options) { var parsedOptions = (0,utils/* parseQueryArgs */._v)(queryKey); var defaultedOptions = this.defaultQueryOptions(parsedOptions); return this.queryCache.build(this, defaultedOptions).setData(updater, options); }; _proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) { var _this2 = this; return notifyManager/* notifyManager */.V.batch(function () { return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref2) { var queryKey = _ref2.queryKey; return [queryKey, _this2.setQueryData(queryKey, updater, options)]; }); }); }; _proto.getQueryState = function getQueryState(queryKey, filters) { var _this$queryCache$find2; return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state; }; _proto.removeQueries = function removeQueries(arg1, arg2) { var _parseFilterArgs2 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2), filters = _parseFilterArgs2[0]; var queryCache = this.queryCache; notifyManager/* notifyManager */.V.batch(function () { queryCache.findAll(filters).forEach(function (query) { queryCache.remove(query); }); }); }; _proto.resetQueries = function resetQueries(arg1, arg2, arg3) { var _this3 = this; var _parseFilterArgs3 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2, arg3), filters = _parseFilterArgs3[0], options = _parseFilterArgs3[1]; var queryCache = this.queryCache; var refetchFilters = (0,esm_extends/* default */.Z)({}, filters, { active: true }); return notifyManager/* notifyManager */.V.batch(function () { queryCache.findAll(filters).forEach(function (query) { query.reset(); }); return _this3.refetchQueries(refetchFilters, options); }); }; _proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) { var _this4 = this; var _parseFilterArgs4 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2, arg3), filters = _parseFilterArgs4[0], _parseFilterArgs4$ = _parseFilterArgs4[1], cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$; if (typeof cancelOptions.revert === 'undefined') { cancelOptions.revert = true; } var promises = notifyManager/* notifyManager */.V.batch(function () { return _this4.queryCache.findAll(filters).map(function (query) { return query.cancel(cancelOptions); }); }); return Promise.all(promises).then(utils/* noop */.ZT).catch(utils/* noop */.ZT); }; _proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) { var _ref3, _filters$refetchActiv, _filters$refetchInact, _this5 = this; var _parseFilterArgs5 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2, arg3), filters = _parseFilterArgs5[0], options = _parseFilterArgs5[1]; var refetchFilters = (0,esm_extends/* default */.Z)({}, filters, { // if filters.refetchActive is not provided and filters.active is explicitly false, // e.g. invalidateQueries({ active: false }), we don't want to refetch active queries active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true, inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false }); return notifyManager/* notifyManager */.V.batch(function () { _this5.queryCache.findAll(filters).forEach(function (query) { query.invalidate(); }); return _this5.refetchQueries(refetchFilters, options); }); }; _proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) { var _this6 = this; var _parseFilterArgs6 = (0,utils/* parseFilterArgs */.I6)(arg1, arg2, arg3), filters = _parseFilterArgs6[0], options = _parseFilterArgs6[1]; var promises = notifyManager/* notifyManager */.V.batch(function () { return _this6.queryCache.findAll(filters).map(function (query) { return query.fetch(undefined, (0,esm_extends/* default */.Z)({}, options, { meta: { refetchPage: filters == null ? void 0 : filters.refetchPage } })); }); }); var promise = Promise.all(promises).then(utils/* noop */.ZT); if (!(options == null ? void 0 : options.throwOnError)) { promise = promise.catch(utils/* noop */.ZT); } return promise; }; _proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) { var parsedOptions = (0,utils/* parseQueryArgs */._v)(arg1, arg2, arg3); var defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652 if (typeof defaultedOptions.retry === 'undefined') { defaultedOptions.retry = false; } var query = this.queryCache.build(this, defaultedOptions); return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); }; _proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) { return this.fetchQuery(arg1, arg2, arg3).then(utils/* noop */.ZT).catch(utils/* noop */.ZT); }; _proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) { var parsedOptions = (0,utils/* parseQueryArgs */._v)(arg1, arg2, arg3); parsedOptions.behavior = infiniteQueryBehavior(); return this.fetchQuery(parsedOptions); }; _proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) { return this.fetchInfiniteQuery(arg1, arg2, arg3).then(utils/* noop */.ZT).catch(utils/* noop */.ZT); }; _proto.cancelMutations = function cancelMutations() { var _this7 = this; var promises = notifyManager/* notifyManager */.V.batch(function () { return _this7.mutationCache.getAll().map(function (mutation) { return mutation.cancel(); }); }); return Promise.all(promises).then(utils/* noop */.ZT).catch(utils/* noop */.ZT); }; _proto.resumePausedMutations = function resumePausedMutations() { return this.getMutationCache().resumePausedMutations(); }; _proto.executeMutation = function executeMutation(options) { return this.mutationCache.build(this, options).execute(); }; _proto.getQueryCache = function getQueryCache() { return this.queryCache; }; _proto.getMutationCache = function getMutationCache() { return this.mutationCache; }; _proto.getDefaultOptions = function getDefaultOptions() { return this.defaultOptions; }; _proto.setDefaultOptions = function setDefaultOptions(options) { this.defaultOptions = options; }; _proto.setQueryDefaults = function setQueryDefaults(queryKey, options) { var result = this.queryDefaults.find(function (x) { return (0,utils/* hashQueryKey */.yF)(queryKey) === (0,utils/* hashQueryKey */.yF)(x.queryKey); }); if (result) { result.defaultOptions = options; } else { this.queryDefaults.push({ queryKey: queryKey, defaultOptions: options }); } }; _proto.getQueryDefaults = function getQueryDefaults(queryKey) { var _this$queryDefaults$f; return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function (x) { return (0,utils/* partialMatchKey */.to)(queryKey, x.queryKey); })) == null ? void 0 : _this$queryDefaults$f.defaultOptions : undefined; }; _proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) { var result = this.mutationDefaults.find(function (x) { return (0,utils/* hashQueryKey */.yF)(mutationKey) === (0,utils/* hashQueryKey */.yF)(x.mutationKey); }); if (result) { result.defaultOptions = options; } else { this.mutationDefaults.push({ mutationKey: mutationKey, defaultOptions: options }); } }; _proto.getMutationDefaults = function getMutationDefaults(mutationKey) { var _this$mutationDefault; return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function (x) { return (0,utils/* partialMatchKey */.to)(mutationKey, x.mutationKey); })) == null ? void 0 : _this$mutationDefault.defaultOptions : undefined; }; _proto.defaultQueryOptions = function defaultQueryOptions(options) { if (options == null ? void 0 : options._defaulted) { return options; } var defaultedOptions = (0,esm_extends/* default */.Z)({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, { _defaulted: true }); if (!defaultedOptions.queryHash && defaultedOptions.queryKey) { defaultedOptions.queryHash = (0,utils/* hashQueryKeyByOptions */.Rm)(defaultedOptions.queryKey, defaultedOptions); } return defaultedOptions; }; _proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) { return this.defaultQueryOptions(options); }; _proto.defaultMutationOptions = function defaultMutationOptions(options) { if (options == null ? void 0 : options._defaulted) { return options; } return (0,esm_extends/* default */.Z)({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, { _defaulted: true }); }; _proto.clear = function clear() { this.queryCache.clear(); this.mutationCache.clear(); }; return QueryClient; }(); /***/ }), /***/ 216: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DV: () => (/* binding */ isCancelledError), /* harmony export */ LE: () => (/* binding */ isCancelable), /* harmony export */ m4: () => (/* binding */ Retryer) /* harmony export */ }); /* unused harmony export CancelledError */ /* harmony import */ var _focusManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(852); /* harmony import */ var _onlineManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(288); function defaultRetryDelay(failureCount) { return Math.min(1000 * Math.pow(2, failureCount), 30000); } function isCancelable(value) { return typeof (value == null ? void 0 : value.cancel) === 'function'; } var CancelledError = function CancelledError(options) { this.revert = options == null ? void 0 : options.revert; this.silent = options == null ? void 0 : options.silent; }; function isCancelledError(value) { return value instanceof CancelledError; } // CLASS var Retryer = function Retryer(config) { var _this = this; var cancelRetry = false; var cancelFn; var continueFn; var promiseResolve; var promiseReject; this.abort = config.abort; this.cancel = function (cancelOptions) { return cancelFn == null ? void 0 : cancelFn(cancelOptions); }; this.cancelRetry = function () { cancelRetry = true; }; this.continueRetry = function () { cancelRetry = false; }; this.continue = function () { return continueFn == null ? void 0 : continueFn(); }; this.failureCount = 0; this.isPaused = false; this.isResolved = false; this.isTransportCancelable = false; this.promise = new Promise(function (outerResolve, outerReject) { promiseResolve = outerResolve; promiseReject = outerReject; }); var resolve = function resolve(value) { if (!_this.isResolved) { _this.isResolved = true; config.onSuccess == null ? void 0 : config.onSuccess(value); continueFn == null ? void 0 : continueFn(); promiseResolve(value); } }; var reject = function reject(value) { if (!_this.isResolved) { _this.isResolved = true; config.onError == null ? void 0 : config.onError(value); continueFn == null ? void 0 : continueFn(); promiseReject(value); } }; var pause = function pause() { return new Promise(function (continueResolve) { continueFn = continueResolve; _this.isPaused = true; config.onPause == null ? void 0 : config.onPause(); }).then(function () { continueFn = undefined; _this.isPaused = false; config.onContinue == null ? void 0 : config.onContinue(); }); }; // Create loop function var run = function run() { // Do nothing if already resolved if (_this.isResolved) { return; } var promiseOrValue; // Execute query try { promiseOrValue = config.fn(); } catch (error) { promiseOrValue = Promise.reject(error); } // Create callback to cancel this fetch cancelFn = function cancelFn(cancelOptions) { if (!_this.isResolved) { reject(new CancelledError(cancelOptions)); _this.abort == null ? void 0 : _this.abort(); // Cancel transport if supported if (isCancelable(promiseOrValue)) { try { promiseOrValue.cancel(); } catch (_unused) {} } } }; // Check if the transport layer support cancellation _this.isTransportCancelable = isCancelable(promiseOrValue); Promise.resolve(promiseOrValue).then(resolve).catch(function (error) { var _config$retry, _config$retryDelay; // Stop if the fetch is already resolved if (_this.isResolved) { return; } // Do we need to retry the request? var retry = (_config$retry = config.retry) != null ? _config$retry : 3; var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay; var delay = typeof retryDelay === 'function' ? retryDelay(_this.failureCount, error) : retryDelay; var shouldRetry = retry === true || typeof retry === 'number' && _this.failureCount < retry || typeof retry === 'function' && retry(_this.failureCount, error); if (cancelRetry || !shouldRetry) { // We are done if the query does not need to be retried reject(error); return; } _this.failureCount++; // Notify on fail config.onFail == null ? void 0 : config.onFail(_this.failureCount, error); // Delay (0,_utils__WEBPACK_IMPORTED_MODULE_0__/* .sleep */ .Gh)(delay) // Pause if the document is not visible or when the device is offline .then(function () { if (!_focusManager__WEBPACK_IMPORTED_MODULE_1__/* .focusManager */ .j.isFocused() || !_onlineManager__WEBPACK_IMPORTED_MODULE_2__/* .onlineManager */ .N.isOnline()) { return pause(); } }).then(function () { if (cancelRetry) { reject(error); } else { run(); } }); }); }; // Start loop run(); }; /***/ }), /***/ 943: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ l: () => (/* binding */ Subscribable) /* harmony export */ }); var Subscribable = /*#__PURE__*/function () { function Subscribable() { this.listeners = []; } var _proto = Subscribable.prototype; _proto.subscribe = function subscribe(listener) { var _this = this; var callback = listener || function () { return undefined; }; this.listeners.push(callback); this.onSubscribe(); return function () { _this.listeners = _this.listeners.filter(function (x) { return x !== callback; }); _this.onUnsubscribe(); }; }; _proto.hasListeners = function hasListeners() { return this.listeners.length > 0; }; _proto.onSubscribe = function onSubscribe() {// Do nothing }; _proto.onUnsubscribe = function onUnsubscribe() {// Do nothing }; return Subscribable; }(); /***/ }), /***/ 755: /***/ (() => { /***/ }), /***/ 288: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ A4: () => (/* binding */ scheduleMicrotask), /* harmony export */ G9: () => (/* binding */ getAbortController), /* harmony export */ Gh: () => (/* binding */ sleep), /* harmony export */ I6: () => (/* binding */ parseFilterArgs), /* harmony export */ Kp: () => (/* binding */ timeUntilStale), /* harmony export */ PN: () => (/* binding */ isValidTimeout), /* harmony export */ Q$: () => (/* binding */ replaceEqualDeep), /* harmony export */ Rm: () => (/* binding */ hashQueryKeyByOptions), /* harmony export */ SE: () => (/* binding */ functionalUpdate), /* harmony export */ VS: () => (/* binding */ shallowEqualObjects), /* harmony export */ X7: () => (/* binding */ matchMutation), /* harmony export */ ZT: () => (/* binding */ noop), /* harmony export */ _v: () => (/* binding */ parseQueryArgs), /* harmony export */ _x: () => (/* binding */ matchQuery), /* harmony export */ lV: () => (/* binding */ parseMutationArgs), /* harmony export */ mc: () => (/* binding */ ensureQueryKeyArray), /* harmony export */ sk: () => (/* binding */ isServer), /* harmony export */ to: () => (/* binding */ partialMatchKey), /* harmony export */ yF: () => (/* binding */ hashQueryKey) /* harmony export */ }); /* unused harmony exports difference, replaceAt, parseMutationFilterArgs, mapQueryStatusFilter, stableValueHash, partialDeepEqual, isPlainObject, isQueryKey, isError */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(312); // TYPES // UTILS var isServer = typeof window === 'undefined'; function noop() { return undefined; } function functionalUpdate(updater, input) { return typeof updater === 'function' ? updater(input) : updater; } function isValidTimeout(value) { return typeof value === 'number' && value >= 0 && value !== Infinity; } function ensureQueryKeyArray(value) { return Array.isArray(value) ? value : [value]; } function difference(array1, array2) { return array1.filter(function (x) { return array2.indexOf(x) === -1; }); } function replaceAt(array, index, value) { var copy = array.slice(0); copy[index] = value; return copy; } function timeUntilStale(updatedAt, staleTime) { return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); } function parseQueryArgs(arg1, arg2, arg3) { if (!isQueryKey(arg1)) { return arg1; } if (typeof arg2 === 'function') { return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg3, { queryKey: arg1, queryFn: arg2 }); } return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg2, { queryKey: arg1 }); } function parseMutationArgs(arg1, arg2, arg3) { if (isQueryKey(arg1)) { if (typeof arg2 === 'function') { return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg3, { mutationKey: arg1, mutationFn: arg2 }); } return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg2, { mutationKey: arg1 }); } if (typeof arg1 === 'function') { return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg2, { mutationFn: arg1 }); } return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg1); } function parseFilterArgs(arg1, arg2, arg3) { return isQueryKey(arg1) ? [(0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)({}, arg2, { queryKey: arg1 }), arg3] : [arg1 || {}, arg2]; } function parseMutationFilterArgs(arg1, arg2) { return isQueryKey(arg1) ? _extends({}, arg2, { mutationKey: arg1 }) : arg1; } function mapQueryStatusFilter(active, inactive) { if (active === true && inactive === true || active == null && inactive == null) { return 'all'; } else if (active === false && inactive === false) { return 'none'; } else { // At this point, active|inactive can only be true|false or false|true // so, when only one value is provided, the missing one has to be the negated value var isActive = active != null ? active : !inactive; return isActive ? 'active' : 'inactive'; } } function matchQuery(filters, query) { var active = filters.active, exact = filters.exact, fetching = filters.fetching, inactive = filters.inactive, predicate = filters.predicate, queryKey = filters.queryKey, stale = filters.stale; if (isQueryKey(queryKey)) { if (exact) { if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { return false; } } else if (!partialMatchKey(query.queryKey, queryKey)) { return false; } } var queryStatusFilter = mapQueryStatusFilter(active, inactive); if (queryStatusFilter === 'none') { return false; } else if (queryStatusFilter !== 'all') { var isActive = query.isActive(); if (queryStatusFilter === 'active' && !isActive) { return false; } if (queryStatusFilter === 'inactive' && isActive) { return false; } } if (typeof stale === 'boolean' && query.isStale() !== stale) { return false; } if (typeof fetching === 'boolean' && query.isFetching() !== fetching) { return false; } if (predicate && !predicate(query)) { return false; } return true; } function matchMutation(filters, mutation) { var exact = filters.exact, fetching = filters.fetching, predicate = filters.predicate, mutationKey = filters.mutationKey; if (isQueryKey(mutationKey)) { if (!mutation.options.mutationKey) { return false; } if (exact) { if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) { return false; } } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { return false; } } if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) { return false; } if (predicate && !predicate(mutation)) { return false; } return true; } function hashQueryKeyByOptions(queryKey, options) { var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey; return hashFn(queryKey); } /** * Default query keys hash function. */ function hashQueryKey(queryKey) { var asArray = ensureQueryKeyArray(queryKey); return stableValueHash(asArray); } /** * Hashes the value into a stable hash. */ function stableValueHash(value) { return JSON.stringify(value, function (_, val) { return isPlainObject(val) ? Object.keys(val).sort().reduce(function (result, key) { result[key] = val[key]; return result; }, {}) : val; }); } /** * Checks if key `b` partially matches with key `a`. */ function partialMatchKey(a, b) { return partialDeepEqual(ensureQueryKeyArray(a), ensureQueryKeyArray(b)); } /** * Checks if `b` partially matches with `a`. */ function partialDeepEqual(a, b) { if (a === b) { return true; } if (typeof a !== typeof b) { return false; } if (a && b && typeof a === 'object' && typeof b === 'object') { return !Object.keys(b).some(function (key) { return !partialDeepEqual(a[key], b[key]); }); } return false; } /** * This function returns `a` if `b` is deeply equal. * If not, it will replace any deeply equal children of `b` with those of `a`. * This can be used for structural sharing between JSON values for example. */ function replaceEqualDeep(a, b) { if (a === b) { return a; } var array = Array.isArray(a) && Array.isArray(b); if (array || isPlainObject(a) && isPlainObject(b)) { var aSize = array ? a.length : Object.keys(a).length; var bItems = array ? b : Object.keys(b); var bSize = bItems.length; var copy = array ? [] : {}; var equalItems = 0; for (var i = 0; i < bSize; i++) { var key = array ? i : bItems[i]; copy[key] = replaceEqualDeep(a[key], b[key]); if (copy[key] === a[key]) { equalItems++; } } return aSize === bSize && equalItems === aSize ? a : copy; } return b; } /** * Shallow compare objects. Only works with objects that always have the same properties. */ function shallowEqualObjects(a, b) { if (a && !b || b && !a) { return false; } for (var key in a) { if (a[key] !== b[key]) { return false; } } return true; } // Copied from: https://github.com/jonschlinkert/is-plain-object function isPlainObject(o) { if (!hasObjectPrototype(o)) { return false; } // If has modified constructor var ctor = o.constructor; if (typeof ctor === 'undefined') { return true; } // If has modified prototype var prot = ctor.prototype; if (!hasObjectPrototype(prot)) { return false; } // If constructor does not have an Object-specific method if (!prot.hasOwnProperty('isPrototypeOf')) { return false; } // Most likely a plain Object return true; } function hasObjectPrototype(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isQueryKey(value) { return typeof value === 'string' || Array.isArray(value); } function isError(value) { return value instanceof Error; } function sleep(timeout) { return new Promise(function (resolve) { setTimeout(resolve, timeout); }); } /** * Schedules a microtask. * This can be useful to schedule state updates after rendering. */ function scheduleMicrotask(callback) { Promise.resolve().then(callback).catch(function (error) { return setTimeout(function () { throw error; }); }); } function getAbortController() { if (typeof AbortController === 'function') { return new AbortController(); } } /***/ }), /***/ 767: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ QueryClient: () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_0__.QueryClient), /* harmony export */ QueryClientProvider: () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_1__.QueryClientProvider), /* harmony export */ useMutation: () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_1__.useMutation), /* harmony export */ useQuery: () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_1__.useQuery), /* harmony export */ useQueryClient: () => (/* reexport safe */ _react__WEBPACK_IMPORTED_MODULE_1__.useQueryClient) /* harmony export */ }); /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(747); /* harmony reexport (checked) */ if(__webpack_require__.o(_core__WEBPACK_IMPORTED_MODULE_0__, "QueryClientProvider")) __webpack_require__.d(__webpack_exports__, { QueryClientProvider: function() { return _core__WEBPACK_IMPORTED_MODULE_0__.QueryClientProvider; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_core__WEBPACK_IMPORTED_MODULE_0__, "useMutation")) __webpack_require__.d(__webpack_exports__, { useMutation: function() { return _core__WEBPACK_IMPORTED_MODULE_0__.useMutation; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_core__WEBPACK_IMPORTED_MODULE_0__, "useQuery")) __webpack_require__.d(__webpack_exports__, { useQuery: function() { return _core__WEBPACK_IMPORTED_MODULE_0__.useQuery; } }); /* harmony reexport (checked) */ if(__webpack_require__.o(_core__WEBPACK_IMPORTED_MODULE_0__, "useQueryClient")) __webpack_require__.d(__webpack_exports__, { useQueryClient: function() { return _core__WEBPACK_IMPORTED_MODULE_0__.useQueryClient; } }); /* harmony import */ var _react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(618); /***/ }), /***/ 618: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { QueryClientProvider: () => (/* reexport */ QueryClientProvider), useMutation: () => (/* reexport */ useMutation), useQuery: () => (/* reexport */ useQuery), useQueryClient: () => (/* reexport */ useQueryClient) }); // UNUSED EXPORTS: Hydrate, QueryErrorResetBoundary, useHydrate, useInfiniteQuery, useIsFetching, useIsMutating, useQueries, useQueryErrorResetBoundary // EXTERNAL MODULE: ./node_modules/react-query/es/core/notifyManager.js var notifyManager = __webpack_require__(101); // EXTERNAL MODULE: external "ReactDOM" var external_ReactDOM_ = __webpack_require__(850); var external_ReactDOM_default = /*#__PURE__*/__webpack_require__.n(external_ReactDOM_); ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/reactBatchedUpdates.js var unstable_batchedUpdates = (external_ReactDOM_default()).unstable_batchedUpdates; ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/setBatchUpdatesFn.js notifyManager/* notifyManager */.V.setBatchNotifyFunction(unstable_batchedUpdates); // EXTERNAL MODULE: ./node_modules/react-query/es/core/logger.js var logger = __webpack_require__(909); ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/logger.js var logger_logger = console; ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/setLogger.js (0,logger/* setLogger */.E)(logger_logger); // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(196); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/QueryClientProvider.js var defaultContext = /*#__PURE__*/external_React_default().createContext(undefined); var QueryClientSharingContext = /*#__PURE__*/external_React_default().createContext(false); // if contextSharing is on, we share the first and at least one // instance of the context across the window // to ensure that if React Query is used across // different bundles or microfrontends they will // all use the same **instance** of context, regardless // of module scoping. function getQueryClientContext(contextSharing) { if (contextSharing && typeof window !== 'undefined') { if (!window.ReactQueryClientContext) { window.ReactQueryClientContext = defaultContext; } return window.ReactQueryClientContext; } return defaultContext; } var useQueryClient = function useQueryClient() { var queryClient = external_React_default().useContext(getQueryClientContext(external_React_default().useContext(QueryClientSharingContext))); if (!queryClient) { throw new Error('No QueryClient set, use QueryClientProvider to set one'); } return queryClient; }; var QueryClientProvider = function QueryClientProvider(_ref) { var client = _ref.client, _ref$contextSharing = _ref.contextSharing, contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing, children = _ref.children; external_React_default().useEffect(function () { client.mount(); return function () { client.unmount(); }; }, [client]); var Context = getQueryClientContext(contextSharing); return /*#__PURE__*/external_React_default().createElement(QueryClientSharingContext.Provider, { value: contextSharing }, /*#__PURE__*/external_React_default().createElement(Context.Provider, { value: client }, children)); }; // EXTERNAL MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(312); // EXTERNAL MODULE: ./node_modules/react-query/es/core/utils.js var utils = __webpack_require__(288); // EXTERNAL MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js + 1 modules var inheritsLoose = __webpack_require__(849); // EXTERNAL MODULE: ./node_modules/react-query/es/core/mutation.js var mutation = __webpack_require__(262); // EXTERNAL MODULE: ./node_modules/react-query/es/core/subscribable.js var subscribable = __webpack_require__(943); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/mutationObserver.js // CLASS var MutationObserver = /*#__PURE__*/function (_Subscribable) { (0,inheritsLoose/* default */.Z)(MutationObserver, _Subscribable); function MutationObserver(client, options) { var _this; _this = _Subscribable.call(this) || this; _this.client = client; _this.setOptions(options); _this.bindMethods(); _this.updateResult(); return _this; } var _proto = MutationObserver.prototype; _proto.bindMethods = function bindMethods() { this.mutate = this.mutate.bind(this); this.reset = this.reset.bind(this); }; _proto.setOptions = function setOptions(options) { this.options = this.client.defaultMutationOptions(options); }; _proto.onUnsubscribe = function onUnsubscribe() { if (!this.listeners.length) { var _this$currentMutation; (_this$currentMutation = this.currentMutation) == null ? void 0 : _this$currentMutation.removeObserver(this); } }; _proto.onMutationUpdate = function onMutationUpdate(action) { this.updateResult(); // Determine which callbacks to trigger var notifyOptions = { listeners: true }; if (action.type === 'success') { notifyOptions.onSuccess = true; } else if (action.type === 'error') { notifyOptions.onError = true; } this.notify(notifyOptions); }; _proto.getCurrentResult = function getCurrentResult() { return this.currentResult; }; _proto.reset = function reset() { this.currentMutation = undefined; this.updateResult(); this.notify({ listeners: true }); }; _proto.mutate = function mutate(variables, options) { this.mutateOptions = options; if (this.currentMutation) { this.currentMutation.removeObserver(this); } this.currentMutation = this.client.getMutationCache().build(this.client, (0,esm_extends/* default */.Z)({}, this.options, { variables: typeof variables !== 'undefined' ? variables : this.options.variables })); this.currentMutation.addObserver(this); return this.currentMutation.execute(); }; _proto.updateResult = function updateResult() { var state = this.currentMutation ? this.currentMutation.state : (0,mutation/* getDefaultState */.R)(); var result = (0,esm_extends/* default */.Z)({}, state, { isLoading: state.status === 'loading', isSuccess: state.status === 'success', isError: state.status === 'error', isIdle: state.status === 'idle', mutate: this.mutate, reset: this.reset }); this.currentResult = result; }; _proto.notify = function notify(options) { var _this2 = this; notifyManager/* notifyManager */.V.batch(function () { // First trigger the mutate callbacks if (_this2.mutateOptions) { if (options.onSuccess) { _this2.mutateOptions.onSuccess == null ? void 0 : _this2.mutateOptions.onSuccess(_this2.currentResult.data, _this2.currentResult.variables, _this2.currentResult.context); _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(_this2.currentResult.data, null, _this2.currentResult.variables, _this2.currentResult.context); } else if (options.onError) { _this2.mutateOptions.onError == null ? void 0 : _this2.mutateOptions.onError(_this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); _this2.mutateOptions.onSettled == null ? void 0 : _this2.mutateOptions.onSettled(undefined, _this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); } } // Then trigger the listeners if (options.listeners) { _this2.listeners.forEach(function (listener) { listener(_this2.currentResult); }); } }); }; return MutationObserver; }(subscribable/* Subscribable */.l); ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/utils.js function shouldThrowError(suspense, _useErrorBoundary, params) { // Allow useErrorBoundary function to override throwing behavior on a per-error basis if (typeof _useErrorBoundary === 'function') { return _useErrorBoundary.apply(void 0, params); } // Allow useErrorBoundary to override suspense's throwing behavior if (typeof _useErrorBoundary === 'boolean') return _useErrorBoundary; // If suspense is enabled default to throwing errors return !!suspense; } ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/useMutation.js // HOOK function useMutation(arg1, arg2, arg3) { var mountedRef = external_React_default().useRef(false); var _React$useState = external_React_default().useState(0), forceUpdate = _React$useState[1]; var options = (0,utils/* parseMutationArgs */.lV)(arg1, arg2, arg3); var queryClient = useQueryClient(); var obsRef = external_React_default().useRef(); if (!obsRef.current) { obsRef.current = new MutationObserver(queryClient, options); } else { obsRef.current.setOptions(options); } var currentResult = obsRef.current.getCurrentResult(); external_React_default().useEffect(function () { mountedRef.current = true; var unsubscribe = obsRef.current.subscribe(notifyManager/* notifyManager */.V.batchCalls(function () { if (mountedRef.current) { forceUpdate(function (x) { return x + 1; }); } })); return function () { mountedRef.current = false; unsubscribe(); }; }, []); var mutate = external_React_default().useCallback(function (variables, mutateOptions) { obsRef.current.mutate(variables, mutateOptions).catch(utils/* noop */.ZT); }, []); if (currentResult.error && shouldThrowError(undefined, obsRef.current.options.useErrorBoundary, [currentResult.error])) { throw currentResult.error; } return (0,esm_extends/* default */.Z)({}, currentResult, { mutate: mutate, mutateAsync: currentResult.mutate }); } // EXTERNAL MODULE: ./node_modules/react-query/es/core/focusManager.js var focusManager = __webpack_require__(852); // EXTERNAL MODULE: ./node_modules/react-query/es/core/retryer.js var retryer = __webpack_require__(216); ;// CONCATENATED MODULE: ./node_modules/react-query/es/core/queryObserver.js var QueryObserver = /*#__PURE__*/function (_Subscribable) { (0,inheritsLoose/* default */.Z)(QueryObserver, _Subscribable); function QueryObserver(client, options) { var _this; _this = _Subscribable.call(this) || this; _this.client = client; _this.options = options; _this.trackedProps = []; _this.selectError = null; _this.bindMethods(); _this.setOptions(options); return _this; } var _proto = QueryObserver.prototype; _proto.bindMethods = function bindMethods() { this.remove = this.remove.bind(this); this.refetch = this.refetch.bind(this); }; _proto.onSubscribe = function onSubscribe() { if (this.listeners.length === 1) { this.currentQuery.addObserver(this); if (shouldFetchOnMount(this.currentQuery, this.options)) { this.executeFetch(); } this.updateTimers(); } }; _proto.onUnsubscribe = function onUnsubscribe() { if (!this.listeners.length) { this.destroy(); } }; _proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() { return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect); }; _proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() { return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus); }; _proto.destroy = function destroy() { this.listeners = []; this.clearTimers(); this.currentQuery.removeObserver(this); }; _proto.setOptions = function setOptions(options, notifyOptions) { var prevOptions = this.options; var prevQuery = this.currentQuery; this.options = this.client.defaultQueryObserverOptions(options); if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') { throw new Error('Expected enabled to be a boolean'); } // Keep previous query key if the user does not supply one if (!this.options.queryKey) { this.options.queryKey = prevOptions.queryKey; } this.updateQuery(); var mounted = this.hasListeners(); // Fetch if there are subscribers if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) { this.executeFetch(); } // Update result this.updateResult(notifyOptions); // Update stale interval if needed if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) { this.updateStaleTimeout(); } var nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) { this.updateRefetchInterval(nextRefetchInterval); } }; _proto.getOptimisticResult = function getOptimisticResult(options) { var defaultedOptions = this.client.defaultQueryObserverOptions(options); var query = this.client.getQueryCache().build(this.client, defaultedOptions); return this.createResult(query, defaultedOptions); }; _proto.getCurrentResult = function getCurrentResult() { return this.currentResult; }; _proto.trackResult = function trackResult(result, defaultedOptions) { var _this2 = this; var trackedResult = {}; var trackProp = function trackProp(key) { if (!_this2.trackedProps.includes(key)) { _this2.trackedProps.push(key); } }; Object.keys(result).forEach(function (key) { Object.defineProperty(trackedResult, key, { configurable: false, enumerable: true, get: function get() { trackProp(key); return result[key]; } }); }); if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) { trackProp('error'); } return trackedResult; }; _proto.getNextResult = function getNextResult(options) { var _this3 = this; return new Promise(function (resolve, reject) { var unsubscribe = _this3.subscribe(function (result) { if (!result.isFetching) { unsubscribe(); if (result.isError && (options == null ? void 0 : options.throwOnError)) { reject(result.error); } else { resolve(result); } } }); }); }; _proto.getCurrentQuery = function getCurrentQuery() { return this.currentQuery; }; _proto.remove = function remove() { this.client.getQueryCache().remove(this.currentQuery); }; _proto.refetch = function refetch(options) { return this.fetch((0,esm_extends/* default */.Z)({}, options, { meta: { refetchPage: options == null ? void 0 : options.refetchPage } })); }; _proto.fetchOptimistic = function fetchOptimistic(options) { var _this4 = this; var defaultedOptions = this.client.defaultQueryObserverOptions(options); var query = this.client.getQueryCache().build(this.client, defaultedOptions); return query.fetch().then(function () { return _this4.createResult(query, defaultedOptions); }); }; _proto.fetch = function fetch(fetchOptions) { var _this5 = this; return this.executeFetch(fetchOptions).then(function () { _this5.updateResult(); return _this5.currentResult; }); }; _proto.executeFetch = function executeFetch(fetchOptions) { // Make sure we reference the latest query as the current one might have been removed this.updateQuery(); // Fetch var promise = this.currentQuery.fetch(this.options, fetchOptions); if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { promise = promise.catch(utils/* noop */.ZT); } return promise; }; _proto.updateStaleTimeout = function updateStaleTimeout() { var _this6 = this; this.clearStaleTimeout(); if (utils/* isServer */.sk || this.currentResult.isStale || !(0,utils/* isValidTimeout */.PN)(this.options.staleTime)) { return; } var time = (0,utils/* timeUntilStale */.Kp)(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration. // To mitigate this issue we always add 1 ms to the timeout. var timeout = time + 1; this.staleTimeoutId = setTimeout(function () { if (!_this6.currentResult.isStale) { _this6.updateResult(); } }, timeout); }; _proto.computeRefetchInterval = function computeRefetchInterval() { var _this$options$refetch; return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false; }; _proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) { var _this7 = this; this.clearRefetchInterval(); this.currentRefetchInterval = nextInterval; if (utils/* isServer */.sk || this.options.enabled === false || !(0,utils/* isValidTimeout */.PN)(this.currentRefetchInterval) || this.currentRefetchInterval === 0) { return; } this.refetchIntervalId = setInterval(function () { if (_this7.options.refetchIntervalInBackground || focusManager/* focusManager */.j.isFocused()) { _this7.executeFetch(); } }, this.currentRefetchInterval); }; _proto.updateTimers = function updateTimers() { this.updateStaleTimeout(); this.updateRefetchInterval(this.computeRefetchInterval()); }; _proto.clearTimers = function clearTimers() { this.clearStaleTimeout(); this.clearRefetchInterval(); }; _proto.clearStaleTimeout = function clearStaleTimeout() { if (this.staleTimeoutId) { clearTimeout(this.staleTimeoutId); this.staleTimeoutId = undefined; } }; _proto.clearRefetchInterval = function clearRefetchInterval() { if (this.refetchIntervalId) { clearInterval(this.refetchIntervalId); this.refetchIntervalId = undefined; } }; _proto.createResult = function createResult(query, options) { var prevQuery = this.currentQuery; var prevOptions = this.options; var prevResult = this.currentResult; var prevResultState = this.currentResultState; var prevResultOptions = this.currentResultOptions; var queryChange = query !== prevQuery; var queryInitialState = queryChange ? query.state : this.currentQueryInitialState; var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult; var state = query.state; var dataUpdatedAt = state.dataUpdatedAt, error = state.error, errorUpdatedAt = state.errorUpdatedAt, isFetching = state.isFetching, status = state.status; var isPreviousData = false; var isPlaceholderData = false; var data; // Optimistically set result in fetching state if needed if (options.optimisticResults) { var mounted = this.hasListeners(); var fetchOnMount = !mounted && shouldFetchOnMount(query, options); var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); if (fetchOnMount || fetchOptionally) { isFetching = true; if (!dataUpdatedAt) { status = 'loading'; } } } // Keep previous data if needed if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== 'error') { data = prevQueryResult.data; dataUpdatedAt = prevQueryResult.dataUpdatedAt; status = prevQueryResult.status; isPreviousData = true; } // Select data if needed else if (options.select && typeof state.data !== 'undefined') { // Memoize select result if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) { data = this.selectResult; } else { try { this.selectFn = options.select; data = options.select(state.data); if (options.structuralSharing !== false) { data = (0,utils/* replaceEqualDeep */.Q$)(prevResult == null ? void 0 : prevResult.data, data); } this.selectResult = data; this.selectError = null; } catch (selectError) { (0,logger/* getLogger */.j)().error(selectError); this.selectError = selectError; } } } // Use query data else { data = state.data; } // Show placeholder data if needed if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && (status === 'loading' || status === 'idle')) { var placeholderData; // Memoize placeholder data if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { placeholderData = prevResult.data; } else { placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData; if (options.select && typeof placeholderData !== 'undefined') { try { placeholderData = options.select(placeholderData); if (options.structuralSharing !== false) { placeholderData = (0,utils/* replaceEqualDeep */.Q$)(prevResult == null ? void 0 : prevResult.data, placeholderData); } this.selectError = null; } catch (selectError) { (0,logger/* getLogger */.j)().error(selectError); this.selectError = selectError; } } } if (typeof placeholderData !== 'undefined') { status = 'success'; data = placeholderData; isPlaceholderData = true; } } if (this.selectError) { error = this.selectError; data = this.selectResult; errorUpdatedAt = Date.now(); status = 'error'; } var result = { status: status, isLoading: status === 'loading', isSuccess: status === 'success', isError: status === 'error', isIdle: status === 'idle', data: data, dataUpdatedAt: dataUpdatedAt, error: error, errorUpdatedAt: errorUpdatedAt, failureCount: state.fetchFailureCount, errorUpdateCount: state.errorUpdateCount, isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, isFetching: isFetching, isRefetching: isFetching && status !== 'loading', isLoadingError: status === 'error' && state.dataUpdatedAt === 0, isPlaceholderData: isPlaceholderData, isPreviousData: isPreviousData, isRefetchError: status === 'error' && state.dataUpdatedAt !== 0, isStale: isStale(query, options), refetch: this.refetch, remove: this.remove }; return result; }; _proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) { if (!prevResult) { return true; } var _this$options = this.options, notifyOnChangeProps = _this$options.notifyOnChangeProps, notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions; if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) { return true; } if (notifyOnChangeProps === 'tracked' && !this.trackedProps.length) { return true; } var includedProps = notifyOnChangeProps === 'tracked' ? this.trackedProps : notifyOnChangeProps; return Object.keys(result).some(function (key) { var typedKey = key; var changed = result[typedKey] !== prevResult[typedKey]; var isIncluded = includedProps == null ? void 0 : includedProps.some(function (x) { return x === key; }); var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function (x) { return x === key; }); return changed && !isExcluded && (!includedProps || isIncluded); }); }; _proto.updateResult = function updateResult(notifyOptions) { var prevResult = this.currentResult; this.currentResult = this.createResult(this.currentQuery, this.options); this.currentResultState = this.currentQuery.state; this.currentResultOptions = this.options; // Only notify if something has changed if ((0,utils/* shallowEqualObjects */.VS)(this.currentResult, prevResult)) { return; } // Determine which callbacks to trigger var defaultNotifyOptions = { cache: true }; if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) { defaultNotifyOptions.listeners = true; } this.notify((0,esm_extends/* default */.Z)({}, defaultNotifyOptions, notifyOptions)); }; _proto.updateQuery = function updateQuery() { var query = this.client.getQueryCache().build(this.client, this.options); if (query === this.currentQuery) { return; } var prevQuery = this.currentQuery; this.currentQuery = query; this.currentQueryInitialState = query.state; this.previousQueryResult = this.currentResult; if (this.hasListeners()) { prevQuery == null ? void 0 : prevQuery.removeObserver(this); query.addObserver(this); } }; _proto.onQueryUpdate = function onQueryUpdate(action) { var notifyOptions = {}; if (action.type === 'success') { notifyOptions.onSuccess = true; } else if (action.type === 'error' && !(0,retryer/* isCancelledError */.DV)(action.error)) { notifyOptions.onError = true; } this.updateResult(notifyOptions); if (this.hasListeners()) { this.updateTimers(); } }; _proto.notify = function notify(notifyOptions) { var _this8 = this; notifyManager/* notifyManager */.V.batch(function () { // First trigger the configuration callbacks if (notifyOptions.onSuccess) { _this8.options.onSuccess == null ? void 0 : _this8.options.onSuccess(_this8.currentResult.data); _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(_this8.currentResult.data, null); } else if (notifyOptions.onError) { _this8.options.onError == null ? void 0 : _this8.options.onError(_this8.currentResult.error); _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(undefined, _this8.currentResult.error); } // Then trigger the listeners if (notifyOptions.listeners) { _this8.listeners.forEach(function (listener) { listener(_this8.currentResult); }); } // Then the cache listeners if (notifyOptions.cache) { _this8.client.getQueryCache().notify({ query: _this8.currentQuery, type: 'observerResultsUpdated' }); } }); }; return QueryObserver; }(subscribable/* Subscribable */.l); function shouldLoadOnMount(query, options) { return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false); } function shouldFetchOnMount(query, options) { return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount); } function shouldFetchOn(query, options, field) { if (options.enabled !== false) { var value = typeof field === 'function' ? field(query) : field; return value === 'always' || value !== false && isStale(query, options); } return false; } function shouldFetchOptionally(query, prevQuery, options, prevOptions) { return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error') && isStale(query, options); } function isStale(query, options) { return query.isStaleByTime(options.staleTime); } ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/QueryErrorResetBoundary.js // CONTEXT function createValue() { var _isReset = false; return { clearReset: function clearReset() { _isReset = false; }, reset: function reset() { _isReset = true; }, isReset: function isReset() { return _isReset; } }; } var QueryErrorResetBoundaryContext = /*#__PURE__*/external_React_default().createContext(createValue()); // HOOK var useQueryErrorResetBoundary = function useQueryErrorResetBoundary() { return external_React_default().useContext(QueryErrorResetBoundaryContext); }; // COMPONENT var QueryErrorResetBoundary = function QueryErrorResetBoundary(_ref) { var children = _ref.children; var value = React.useMemo(function () { return createValue(); }, []); return /*#__PURE__*/React.createElement(QueryErrorResetBoundaryContext.Provider, { value: value }, typeof children === 'function' ? children(value) : children); }; ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/useBaseQuery.js function useBaseQuery(options, Observer) { var mountedRef = external_React_default().useRef(false); var _React$useState = external_React_default().useState(0), forceUpdate = _React$useState[1]; var queryClient = useQueryClient(); var errorResetBoundary = useQueryErrorResetBoundary(); var defaultedOptions = queryClient.defaultQueryObserverOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options defaultedOptions.optimisticResults = true; // Include callbacks in batch renders if (defaultedOptions.onError) { defaultedOptions.onError = notifyManager/* notifyManager */.V.batchCalls(defaultedOptions.onError); } if (defaultedOptions.onSuccess) { defaultedOptions.onSuccess = notifyManager/* notifyManager */.V.batchCalls(defaultedOptions.onSuccess); } if (defaultedOptions.onSettled) { defaultedOptions.onSettled = notifyManager/* notifyManager */.V.batchCalls(defaultedOptions.onSettled); } if (defaultedOptions.suspense) { // Always set stale time when using suspense to prevent // fetching again when directly mounting after suspending if (typeof defaultedOptions.staleTime !== 'number') { defaultedOptions.staleTime = 1000; } // Set cache time to 1 if the option has been set to 0 // when using suspense to prevent infinite loop of fetches if (defaultedOptions.cacheTime === 0) { defaultedOptions.cacheTime = 1; } } if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) { // Prevent retrying failed query if the error boundary has not been reset yet if (!errorResetBoundary.isReset()) { defaultedOptions.retryOnMount = false; } } var _React$useState2 = external_React_default().useState(function () { return new Observer(queryClient, defaultedOptions); }), observer = _React$useState2[0]; var result = observer.getOptimisticResult(defaultedOptions); external_React_default().useEffect(function () { mountedRef.current = true; errorResetBoundary.clearReset(); var unsubscribe = observer.subscribe(notifyManager/* notifyManager */.V.batchCalls(function () { if (mountedRef.current) { forceUpdate(function (x) { return x + 1; }); } })); // Update result to make sure we did not miss any query updates // between creating the observer and subscribing to it. observer.updateResult(); return function () { mountedRef.current = false; unsubscribe(); }; }, [errorResetBoundary, observer]); external_React_default().useEffect(function () { // Do not notify on updates because of changes in the options because // these changes should already be reflected in the optimistic result. observer.setOptions(defaultedOptions, { listeners: false }); }, [defaultedOptions, observer]); // Handle suspense if (defaultedOptions.suspense && result.isLoading) { throw observer.fetchOptimistic(defaultedOptions).then(function (_ref) { var data = _ref.data; defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data); defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null); }).catch(function (error) { errorResetBoundary.clearReset(); defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error); defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error); }); } // Handle error boundary if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, [result.error, observer.getCurrentQuery()])) { throw result.error; } // Handle result property usage tracking if (defaultedOptions.notifyOnChangeProps === 'tracked') { result = observer.trackResult(result, defaultedOptions); } return result; } ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/useQuery.js // HOOK function useQuery(arg1, arg2, arg3) { var parsedOptions = (0,utils/* parseQueryArgs */._v)(arg1, arg2, arg3); return useBaseQuery(parsedOptions, QueryObserver); } ;// CONCATENATED MODULE: ./node_modules/react-query/es/react/index.js // Side effects // Types /***/ }), /***/ 251: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var f=__webpack_require__(196),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q; /***/ }), /***/ 893: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(251); } else {} /***/ }), /***/ 196: /***/ ((module) => { "use strict"; module.exports = window["React"]; /***/ }), /***/ 850: /***/ ((module) => { "use strict"; module.exports = window["ReactDOM"]; /***/ }), /***/ 312: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Z: () => (/* binding */ _extends) /* harmony export */ }); function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /***/ }), /***/ 849: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Z: () => (/* binding */ _inheritsLoose) }); ;// CONCATENATED MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } ;// CONCATENATED MODULE: ./node_modules/react-query/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { /******/ __webpack_require__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ var scriptUrl; /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; /******/ var document = __webpack_require__.g.document; /******/ if (!scriptUrl && document) { /******/ if (document.currentScript) /******/ scriptUrl = document.currentScript.src; /******/ if (!scriptUrl) { /******/ var scripts = document.getElementsByTagName("script"); /******/ if(scripts.length) { /******/ var i = scripts.length - 1; /******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src; /******/ } /******/ } /******/ } /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); /******/ __webpack_require__.p = scriptUrl; /******/ })(); /******/ /******/ /* webpack/runtime/nonce */ /******/ (() => { /******/ __webpack_require__.nc = undefined; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; ;// CONCATENATED MODULE: external ["wp","domReady"] const external_wp_domReady_namespaceObject = window["wp"]["domReady"]; var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject); ;// CONCATENATED MODULE: external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(196); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); ;// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); tag.setAttribute('data-s', ''); return tag; } var StyleSheet = /*#__PURE__*/function () { // Using Node instead of HTMLElement since container may be a ShadowRoot function StyleSheet(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 === undefined ? "production" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.prepend = options.prepend; this.insertionPoint = options.insertionPoint; this.before = null; } var _proto = StyleSheet.prototype; _proto.hydrate = function hydrate(nodes) { nodes.forEach(this._insertTag); }; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; if (false) { var isImportRule; } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { if (false) {} } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode && tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; if (false) {} }; return StyleSheet; }(); ;// CONCATENATED MODULE: ./node_modules/stylis/src/Utility.js /** * @param {number} * @return {number} */ var abs = Math.abs /** * @param {number} * @return {string} */ var Utility_from = String.fromCharCode /** * @param {object} * @return {object} */ var Utility_assign = Object.assign /** * @param {string} value * @param {number} length * @return {number} */ function hash (value, length) { return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0 } /** * @param {string} value * @return {string} */ function trim (value) { return value.trim() } /** * @param {string} value * @param {RegExp} pattern * @return {string?} */ function Utility_match (value, pattern) { return (value = pattern.exec(value)) ? value[0] : value } /** * @param {string} value * @param {(string|RegExp)} pattern * @param {string} replacement * @return {string} */ function Utility_replace (value, pattern, replacement) { return value.replace(pattern, replacement) } /** * @param {string} value * @param {string} search * @return {number} */ function indexof (value, search) { return value.indexOf(search) } /** * @param {string} value * @param {number} index * @return {number} */ function Utility_charat (value, index) { return value.charCodeAt(index) | 0 } /** * @param {string} value * @param {number} begin * @param {number} end * @return {string} */ function Utility_substr (value, begin, end) { return value.slice(begin, end) } /** * @param {string} value * @return {number} */ function Utility_strlen (value) { return value.length } /** * @param {any[]} value * @return {number} */ function Utility_sizeof (value) { return value.length } /** * @param {any} value * @param {any[]} array * @return {any} */ function Utility_append (value, array) { return array.push(value), value } /** * @param {string[]} array * @param {function} callback * @return {string} */ function Utility_combine (array, callback) { return array.map(callback).join('') } ;// CONCATENATED MODULE: ./node_modules/stylis/src/Tokenizer.js var line = 1 var column = 1 var Tokenizer_length = 0 var position = 0 var character = 0 var characters = '' /** * @param {string} value * @param {object | null} root * @param {object | null} parent * @param {string} type * @param {string[] | string} props * @param {object[] | string} children * @param {number} length */ function node (value, root, parent, type, props, children, length) { return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''} } /** * @param {object} root * @param {object} props * @return {object} */ function Tokenizer_copy (root, props) { return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props) } /** * @return {number} */ function Tokenizer_char () { return character } /** * @return {number} */ function prev () { character = position > 0 ? Utility_charat(characters, --position) : 0 if (column--, character === 10) column = 1, line-- return character } /** * @return {number} */ function next () { character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0 if (column++, character === 10) column = 1, line++ return character } /** * @return {number} */ function peek () { return Utility_charat(characters, position) } /** * @return {number} */ function caret () { return position } /** * @param {number} begin * @param {number} end * @return {string} */ function slice (begin, end) { return Utility_substr(characters, begin, end) } /** * @param {number} type * @return {number} */ function token (type) { switch (type) { // \0 \t \n \r \s whitespace token case 0: case 9: case 10: case 13: case 32: return 5 // ! + , / > @ ~ isolate token case 33: case 43: case 44: case 47: case 62: case 64: case 126: // ; { } breakpoint token case 59: case 123: case 125: return 4 // : accompanied token case 58: return 3 // " ' ( [ opening delimit token case 34: case 39: case 40: case 91: return 2 // ) ] closing delimit token case 41: case 93: return 1 } return 0 } /** * @param {string} value * @return {any[]} */ function alloc (value) { return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, [] } /** * @param {any} value * @return {any} */ function dealloc (value) { return characters = '', value } /** * @param {number} type * @return {string} */ function delimit (type) { return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) } /** * @param {string} value * @return {string[]} */ function Tokenizer_tokenize (value) { return dealloc(tokenizer(alloc(value))) } /** * @param {number} type * @return {string} */ function whitespace (type) { while (character = peek()) if (character < 33) next() else break return token(type) > 2 || token(character) > 3 ? '' : ' ' } /** * @param {string[]} children * @return {string[]} */ function tokenizer (children) { while (next()) switch (token(character)) { case 0: append(identifier(position - 1), children) break case 2: append(delimit(character), children) break default: append(from(character), children) } return children } /** * @param {number} index * @param {number} count * @return {string} */ function escaping (index, count) { while (--count && next()) // not 0-9 A-F a-f if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97)) break return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) } /** * @param {number} type * @return {number} */ function delimiter (type) { while (next()) switch (character) { // ] ) " ' case type: return position // " ' 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 position } /** * @param {number} type * @param {number} index * @return {number} */ function commenter (type, index) { while (next()) // // if (type + character === 47 + 10) break // /* else if (type + character === 42 + 42 && peek() === 47) break return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next()) } /** * @param {number} index * @return {string} */ function identifier (index) { while (!token(peek())) next() return slice(index, position) } ;// CONCATENATED MODULE: ./node_modules/stylis/src/Enum.js var Enum_MS = '-ms-' var Enum_MOZ = '-moz-' var Enum_WEBKIT = '-webkit-' var COMMENT = 'comm' var Enum_RULESET = 'rule' var Enum_DECLARATION = 'decl' var PAGE = '@page' var MEDIA = '@media' var IMPORT = '@import' var CHARSET = '@charset' var VIEWPORT = '@viewport' var SUPPORTS = '@supports' var DOCUMENT = '@document' var NAMESPACE = '@namespace' var Enum_KEYFRAMES = '@keyframes' var FONT_FACE = '@font-face' var COUNTER_STYLE = '@counter-style' var FONT_FEATURE_VALUES = '@font-feature-values' var LAYER = '@layer' ;// CONCATENATED MODULE: ./node_modules/stylis/src/Serializer.js /** * @param {object[]} children * @param {function} callback * @return {string} */ function Serializer_serialize (children, callback) { var output = '' var length = Utility_sizeof(children) for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || '' return output } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback * @return {string} */ function stringify (element, index, children, callback) { switch (element.type) { case LAYER: if (element.children.length) break case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value case COMMENT: return '' case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}' case Enum_RULESET: element.value = element.props.join(',') } return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' } ;// CONCATENATED MODULE: ./node_modules/stylis/src/Middleware.js /** * @param {function[]} collection * @return {function} */ function middleware (collection) { var length = Utility_sizeof(collection) return function (element, index, children, callback) { var output = '' for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || '' return output } } /** * @param {function} callback * @return {function} */ function rulesheet (callback) { return function (element) { if (!element.root) if (element = element.return) callback(element) } } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback */ function prefixer (element, index, children, callback) { if (element.length > -1) if (!element.return) switch (element.type) { case DECLARATION: element.return = prefix(element.value, element.length, children) return case KEYFRAMES: return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback) case RULESET: if (element.length) return combine(element.props, function (value) { switch (match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback) // :placeholder case '::placeholder': return serialize([ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}) ], callback) } return '' }) } } /** * @param {object} element * @param {number} index * @param {object[]} children */ function namespace (element) { switch (element.type) { case RULESET: element.props = element.props.map(function (value) { return combine(tokenize(value), function (value, index, children) { switch (charat(value, 0)) { // \f case 12: return substr(value, 1, strlen(value)) // \0 ( + > ~ case 0: case 40: case 43: case 62: case 126: return value // : case 58: if (children[++index] === 'global') children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1) // \s case 32: return index === 1 ? '' : value default: switch (index) { case 0: element = value return sizeof(children) > 1 ? '' : value case index = sizeof(children) - 1: case 2: return index === 2 ? value + element + element : value + element default: return value } } }) }) } } ;// CONCATENATED MODULE: ./node_modules/stylis/src/Parser.js /** * @param {string} value * @return {object[]} */ function compile (value) { return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value)) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {string[]} rule * @param {string[]} rules * @param {string[]} rulesets * @param {number[]} pseudo * @param {number[]} points * @param {string[]} declarations * @return {object} */ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { var index = 0 var offset = 0 var length = pseudo var atrule = 0 var property = 0 var previous = 0 var variable = 1 var scanning = 1 var ampersand = 1 var character = 0 var type = '' var props = rules var children = rulesets var reference = rule var characters = type while (scanning) switch (previous = character, character = next()) { // ( case 40: if (previous != 108 && Utility_charat(characters, length - 1) == 58) { if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1 break } // " ' [ case 34: case 39: case 91: characters += delimit(character) break // \t \n \r \s case 9: case 10: case 13: case 32: characters += whitespace(previous) break // \ case 92: characters += escaping(caret() - 1, 7) continue // / case 47: switch (peek()) { case 42: case 47: Utility_append(comment(commenter(next(), caret()), root, parent), declarations) break default: characters += '/' } break // { case 123 * variable: points[index++] = Utility_strlen(characters) * ampersand // } ; \0 case 125 * variable: case 59: case 0: switch (character) { // \0 } case 0: case 125: scanning = 0 // ; case 59 + offset: if (ampersand == -1) characters = Utility_replace(characters, /\f/g, '') if (property > 0 && (Utility_strlen(characters) - length)) Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations) break // @ ; case 59: characters += ';' // { rule/at-rule default: Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets) if (character === 123) if (offset === 0) parse(characters, root, reference, reference, props, rulesets, length, points, children) else switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) { // d l m s case 100: case 108: case 109: case 115: parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) break default: parse(characters, reference, reference, reference, [''], children, 0, points, children) } } index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo break // : case 58: length = 1 + Utility_strlen(characters), property = previous default: if (variable < 1) if (character == 123) --variable else if (character == 125 && variable++ == 0 && prev() == 125) continue switch (characters += Utility_from(character), character * variable) { // & case 38: ampersand = offset > 0 ? 1 : (characters += '\f', -1) break // , case 44: points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1 break // @ case 64: // - if (peek() === 45) characters += delimit(next()) atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++ break // - case 45: if (previous === 45 && Utility_strlen(characters) == 2) variable = 0 } } return rulesets } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} index * @param {number} offset * @param {string[]} rules * @param {number[]} points * @param {string} type * @param {string[]} props * @param {string[]} children * @param {number} length * @return {object} */ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) { var post = offset - 1 var rule = offset === 0 ? rules : [''] var size = Utility_sizeof(rule) for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x]))) props[k++] = z return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length) } /** * @param {number} value * @param {object} root * @param {object?} parent * @return {object} */ function comment (value, root, parent) { return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} length * @return {object} */ function declaration (value, root, parent, length) { return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length) } ;// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { var previous = 0; var character = 0; while (true) { previous = character; character = peek(); // &\f if (previous === 38 && character === 12) { points[index] = 1; } if (token(character)) { break; } next(); } return slice(begin, position); }; var toRules = function toRules(parsed, points) { // pretend we've started with a comma var index = -1; var character = 44; do { switch (token(character)) { case 0: // &\f if (character === 38 && peek() === 12) { // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings // stylis inserts \f after & to know when & where it should replace this sequence with the context selector // and when it should just concatenate the outer and inner selectors // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here points[index] = 1; } parsed[index] += identifierWithPointTracking(position - 1, points, index); break; case 2: parsed[index] += delimit(character); break; case 4: // comma if (character === 44) { // colon parsed[++index] = peek() === 58 ? '&\f' : ''; points[index] = parsed[index].length; break; } // fallthrough default: parsed[index] += Utility_from(character); } } while (character = next()); return parsed; }; var getRules = function getRules(value, points) { return dealloc(toRules(alloc(value), points)); }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 var fixedElements = /* #__PURE__ */new WeakMap(); var compat = function compat(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, parent = element.parent; var isImplicitRule = element.column === parent.column && element.line === parent.line; while (parent.type !== 'rule') { parent = parent.parent; if (!parent) return; } // short-circuit for the simplest case if (element.props.length === 1 && value.charCodeAt(0) !== 58 /* colon */ && !fixedElements.get(parent)) { return; } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" 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 removeLabel(element) { if (element.type === 'decl') { var value = element.value; if ( // charcode for l value.charCodeAt(0) === 108 && // charcode for b value.charCodeAt(2) === 98) { // this ignores label 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 isIgnoringComment(element) { return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; }; var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { return function (element, index, 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; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` // // considering this input: // .a { // .b /* comm */ {} // color: hotpink; // } // we get output corresponding to this: // .a { // & { // /* comm */ // color: hotpink; // } // .b {} // } var commentContainer = isNested ? element.parent.children : // global rule at the root level children; for (var i = commentContainer.length - 1; i >= 0; i--) { var node = commentContainer[i]; if (node.line < element.line) { break; } // it is quite weird but comments are *usually* put at `column: element.column - 1` // so we seek *from the end* for the node that is earlier than the rule's `element` and check that // this will also match inputs like this: // .a { // /* comm */ // .b {} // } // // but that is fine // // it would be the easiest to change the placement of the comment to be the first child of the rule: // .a { // .b { /* comm */ } // } // with such inputs we wouldn't have to search for the comment at all // TODO: consider changing this comment placement in the next major version if (node.column < element.column) { if (isIgnoringComment(node)) { 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 isImportRule(element) { return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; }; var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { for (var i = index - 1; i >= 0; i--) { if (!isImportRule(children[i])) { return true; } } return false; }; // use this to remove incorrect elements from further processing // so they don't get handed to the `sheet` (or anything else) // as that could potentially lead to additional logs which in turn could be overhelming to the user var nullifyElement = function nullifyElement(element) { element.type = ''; element.value = ''; element["return"] = ''; element.children = ''; element.props = ''; }; var incorrectImportAlarm = function incorrectImportAlarm(element, index, 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(index, children)) { console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); nullifyElement(element); } }; /* eslint-disable no-fallthrough */ function emotion_cache_browser_esm_prefix(value, length) { switch (hash(value, length)) { // color-adjust case 5103: return Enum_WEBKIT + 'print-' + value + value; // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return Enum_WEBKIT + value + value; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value; // flex, flex-direction case 6828: case 4268: return Enum_WEBKIT + value + Enum_MS + value + value; // order case 6165: return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value; // align-items case 5187: return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value; // align-self case 5443: return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value; // align-content case 4675: return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value; // flex-shrink case 5548: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value; // flex-basis case 5292: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value; // flex-grow case 6060: return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value; // transition case 4554: return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value; // cursor case 6187: return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value; // background, background-image case 5495: case 3959: return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1'); // justify-content case 4968: return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value; // (min|max)?(width|height|inline-size|block-size) case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: // stretch, max-content, min-content, fill-available if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) { // (m)ax-content, (m)in-content case 109: // - if (Utility_charat(value, length + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; // (s)tretch case 115: return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value; } break; // position: sticky case 4949: // (s)ticky? if (Utility_charat(value, length + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) { // stic(k)y case 107: return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value; // (inline-)?fl(e)x case 101: return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value; } break; // writing-mode case 5936: switch (Utility_charat(value, length + 11)) { // vertical-l(r) case 114: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; // vertical-r(l) case 108: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; // horizontal(-)tb case 45: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; } return Enum_WEBKIT + value + Enum_MS + value + value; } return value; } var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) { if (element.length > -1) if (!element["return"]) switch (element.type) { case Enum_DECLARATION: element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length); break; case Enum_KEYFRAMES: return Serializer_serialize([Tokenizer_copy(element, { value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT) })], callback); case Enum_RULESET: if (element.length) return Utility_combine(element.props, function (value) { switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')] })], callback); // :placeholder case '::placeholder': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')] })], callback); } return ''; }); } }; var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer]; var emotion_cache_browser_esm_createCache = function createCache(options) { var key = options.key; if (false) {} if (key === 'css') { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure // that creating a cache works inside of render of a React component Array.prototype.forEach.call(ssrStyles, function (node) { // we want to only move elements which have a space in the data-emotion attribute value // because that indicates that it is an Emotion 11 server-side rendered style elements // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles // will not result in the Emotion 10 styles being destroyed var dataEmotionAttribute = node.getAttribute('data-emotion'); if (dataEmotionAttribute.indexOf(' ') === -1) { return; } document.head.appendChild(node); node.setAttribute('data-s', ''); }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; if (false) {} var inserted = {}; var container; var nodesToHydrate = []; { container = 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 (node) { var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe for (var i = 1; i < attrib.length; i++) { inserted[attrib[i]] = true; } nodesToHydrate.push(node); }); } var _insert; var omnipresentPlugins = [compat, removeLabel]; if (false) {} { var currentSheet; var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) { currentSheet.insert(rule); })]; var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); var stylis = function stylis(styles) { return Serializer_serialize(compile(styles), serializer); }; _insert = function insert(selector, serialized, sheet, shouldCache) { currentSheet = sheet; if (false) {} stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache.inserted[serialized.name] = true; } }; } var cache = { key: key, sheet: new StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy, prepend: options.prepend, insertionPoint: options.insertionPoint }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; cache.sheet.hydrate(nodesToHydrate); return cache; }; ;// CONCATENATED MODULE: ./node_modules/@emotion/react/node_modules/@babel/runtime/helpers/esm/extends.js function extends_extends() { extends_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return extends_extends.apply(this, arguments); } ;// CONCATENATED MODULE: ./node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js var weakMemoize = function weakMemoize(func) { // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps var cache = new WeakMap(); return function (arg) { if (cache.has(arg)) { // $FlowFixMe return cache.get(arg); } var ret = func(arg); cache.set(arg, ret); return ret; }; }; ;// CONCATENATED MODULE: ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js var isBrowser = "object" !== 'undefined'; function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) { var rawClassName = ''; classNames.split(' ').forEach(function (className) { if (registered[className] !== undefined) { registeredStyles.push(registered[className] + ";"); } else { rawClassName += className + " "; } }); return rawClassName; } var emotion_utils_browser_esm_registerStyles = function registerStyles(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 isBrowser === false ) && cache.registered[className] === undefined) { cache.registered[className] = serialized.styles; } }; var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) { emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); var className = cache.key + "-" + serialized.name; if (cache.inserted[serialized.name] === undefined) { var current = serialized; do { cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); current = current.next; } while (current !== undefined); } }; ;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/emotion-hash.esm.js /* eslint-disable */ // Inspired by https://github.com/garycourt/murmurhash-js // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 function murmur2(str) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. // const m = 0x5bd1e995; // const r = 24; // Initialize the hash var h = 0; // Mix 4 bytes at a time into the hash var k, i = 0, len = str.length; for (; len >= 4; ++i, len -= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); k ^= /* k >>> r: */ k >>> 24; h = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Handle the last few bytes of the input array switch (len) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h ^= h >>> 13; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); return ((h ^ h >>> 15) >>> 0).toString(36); } ;// CONCATENATED MODULE: ./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, 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 }; ;// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js function memoize(fn) { var cache = Object.create(null); return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } ;// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://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 isCustomProperty(property) { return property.charCodeAt(1) === 45; }; var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; var processStyleName = /* #__PURE__ */memoize(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); var processStyleValue = function processStyleValue(key, value) { switch (key) { case 'animation': case 'animationName': { if (typeof value === 'string') { return value.replace(animationRegex, function (match, 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; }; if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('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 ''; } if (interpolation.__emotion_styles !== undefined) { if (false) {} return interpolation; } switch (typeof interpolation) { case 'boolean': { return ''; } case 'object': { if (interpolation.anim === 1) { cursor = { name: interpolation.name, styles: interpolation.styles, next: cursor }; return interpolation.name; } if (interpolation.styles !== undefined) { var next = interpolation.next; if (next !== undefined) { // not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while (next !== undefined) { cursor = { name: next.name, styles: next.styles, next: cursor }; next = next.next; } } var styles = interpolation.styles + ";"; if (false) {} return styles; } return createStringFromObject(mergedProps, registered, interpolation); } case 'function': { if (mergedProps !== undefined) { var previousCursor = cursor; var result = interpolation(mergedProps); cursor = previousCursor; return handleInterpolation(mergedProps, registered, result); } else if (false) {} break; } case 'string': if (false) { var replaced, matched; } break; } // finalize string values (regular strings and functions interpolated into css calls) if (registered == null) { return interpolation; } var cached = registered[interpolation]; return cached !== undefined ? cached : interpolation; } function createStringFromObject(mergedProps, registered, obj) { var string = ''; if (Array.isArray(obj)) { for (var i = 0; i < obj.length; i++) { string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; } } else { for (var _key in obj) { var value = obj[_key]; if (typeof value !== 'object') { if (registered != null && registered[value] !== undefined) { string += _key + "{" + registered[value] + "}"; } else if (isProcessableValue(value)) { string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; } } else { if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {} if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { for (var _i = 0; _i < value.length; _i++) { if (isProcessableValue(value[_i])) { string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; } } } else { var interpolated = handleInterpolation(mergedProps, registered, value); switch (_key) { case 'animation': case 'animationName': { string += processStyleName(_key) + ":" + interpolated + ";"; break; } default: { if (false) {} string += _key + "{" + interpolated + "}"; } } } } } } return string; } var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g; var sourceMapPattern; if (false) {} // this is the cursor for keyframes // keyframes are stored on the SerializedStyles object as a linked list var cursor; var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { return args[0]; } var stringMode = true; var styles = ''; cursor = undefined; var strings = args[0]; if (strings == null || strings.raw === undefined) { stringMode = false; styles += handleInterpolation(mergedProps, registered, strings); } else { if (false) {} styles += strings[0]; } // we start at 1 since we've already handled the first arg for (var i = 1; i < args.length; i++) { styles += handleInterpolation(mergedProps, registered, args[i]); if (stringMode) { if (false) {} styles += strings[i]; } } var sourceMap; if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time labelPattern.lastIndex = 0; var identifierName = ''; var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 while ((match = labelPattern.exec(styles)) !== null) { identifierName += '-' + // $FlowFixMe we know it's not null match[1]; } var name = murmur2(styles) + identifierName; if (false) {} return { name: name, styles: styles, next: cursor }; }; ;// CONCATENATED MODULE: ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js var syncFallback = function syncFallback(create) { return create(); }; var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false; var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; var useInsertionEffectWithLayoutFallback = useInsertionEffect || external_React_.useLayoutEffect; ;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js var emotion_element_c39617d8_browser_esm_isBrowser = "object" !== 'undefined'; var emotion_element_c39617d8_browser_esm_hasOwnProperty = {}.hasOwnProperty; var EmotionCacheContext = /* #__PURE__ */external_React_.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' ? /* #__PURE__ */emotion_cache_browser_esm_createCache({ key: 'css' }) : null); if (false) {} var emotion_element_c39617d8_browser_esm_CacheProvider = EmotionCacheContext.Provider; var __unsafe_useEmotionCache = function useEmotionCache() { return useContext(EmotionCacheContext); }; var emotion_element_c39617d8_browser_esm_withEmotionCache = function withEmotionCache(func) { // $FlowFixMe return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { // the cache will never be null in the browser var cache = (0,external_React_.useContext)(EmotionCacheContext); return func(props, cache, ref); }); }; if (!emotion_element_c39617d8_browser_esm_isBrowser) { emotion_element_c39617d8_browser_esm_withEmotionCache = function withEmotionCache(func) { return function (props) { var cache = (0,external_React_.useContext)(EmotionCacheContext); if (cache === null) { // yes, we're potentially creating this on every render // it doesn't actually matter though since it's only on the server // so there will only every be a single render // that could change in the future because of suspense and etc. but for now, // this works and i don't want to optimise for a future thing that we aren't sure about cache = emotion_cache_browser_esm_createCache({ key: 'css' }); return /*#__PURE__*/external_React_.createElement(EmotionCacheContext.Provider, { value: cache }, func(props, cache)); } else { return func(props, cache); } }; }; } var emotion_element_c39617d8_browser_esm_ThemeContext = /* #__PURE__ */external_React_.createContext({}); if (false) {} var useTheme = function useTheme() { return React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); }; var getTheme = function getTheme(outerTheme, theme) { if (typeof theme === 'function') { var mergedTheme = theme(outerTheme); if (false) {} return mergedTheme; } if (false) {} return extends_extends({}, outerTheme, theme); }; var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) { return weakMemoize(function (theme) { return getTheme(outerTheme, theme); }); }); var ThemeProvider = function ThemeProvider(props) { var theme = external_React_.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); if (props.theme !== theme) { theme = createCacheWithTheme(theme)(props.theme); } return /*#__PURE__*/external_React_.createElement(emotion_element_c39617d8_browser_esm_ThemeContext.Provider, { value: theme }, props.children); }; function withTheme(Component) { var componentName = Component.displayName || Component.name || 'Component'; var render = function render(props, ref) { var theme = React.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); return /*#__PURE__*/React.createElement(Component, _extends({ theme: theme, ref: ref }, props)); }; // $FlowFixMe var WithTheme = /*#__PURE__*/React.forwardRef(render); WithTheme.displayName = "WithTheme(" + componentName + ")"; return hoistNonReactStatics(WithTheme, Component); } var getLastPart = function getLastPart(functionName) { // The match may be something like 'Object.createEmotionProps' or // 'Loader.prototype.render' var parts = functionName.split('.'); return parts[parts.length - 1]; }; var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { // V8 var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); if (match) return getLastPart(match[1]); // Safari / Firefox match = /^([A-Za-z0-9$.]+)@/.exec(line); if (match) return getLastPart(match[1]); return undefined; }; var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS // identifiers, thus we only need to replace what is a valid character for JS, // but not for CSS. var sanitizeIdentifier = function sanitizeIdentifier(identifier) { return identifier.replace(/\$/g, '-'); }; var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { if (!stackTrace) return undefined; var lines = stackTrace.split('\n'); for (var i = 0; i < lines.length; i++) { var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" if (!functionName) continue; // If we reach one of these, we have gone too far and should quit if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an // uppercase letter if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); } return undefined; }; var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; var createEmotionProps = function createEmotionProps(type, props) { if (false) {} var newProps = {}; for (var key in props) { if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key)) { newProps[key] = props[key]; } } newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when // the label hasn't already been computed if (false) { var label; } return newProps; }; var Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () { return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag); }); return null; }; var Emotion = /* #__PURE__ */emotion_element_c39617d8_browser_esm_withEmotionCache(function (props, cache, ref) { var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { cssProp = cache.registered[cssProp]; } var WrappedComponent = props[typePropName]; var registeredStyles = [cssProp]; var className = ''; if (typeof props.className === 'string') { className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, registeredStyles, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = emotion_serialize_browser_esm_serializeStyles(registeredStyles, undefined, external_React_.useContext(emotion_element_c39617d8_browser_esm_ThemeContext)); if (false) { var labelFromStack; } className += cache.key + "-" + serialized.name; var newProps = {}; for (var key in props) { if (emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, /*#__PURE__*/external_React_.createElement(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' }), /*#__PURE__*/external_React_.createElement(WrappedComponent, newProps)); }); if (false) {} var Emotion$1 = Emotion; // EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js var hoist_non_react_statics_cjs = __webpack_require__(679); ;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js var pkg = { name: "@emotion/react", version: "11.11.1", main: "dist/emotion-react.cjs.js", module: "dist/emotion-react.esm.js", browser: { "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" }, exports: { ".": { module: { worker: "./dist/emotion-react.worker.esm.js", browser: "./dist/emotion-react.browser.esm.js", "default": "./dist/emotion-react.esm.js" }, "import": "./dist/emotion-react.cjs.mjs", "default": "./dist/emotion-react.cjs.js" }, "./jsx-runtime": { module: { worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js", browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", "default": "./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": { module: { worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js", browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", "default": "./_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": { module: { worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js", browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", "default": "./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" } }, types: "types/index.d.ts", files: [ "src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.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.11.0", "@emotion/cache": "^11.11.0", "@emotion/serialize": "^1.1.2", "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", "@emotion/utils": "^1.2.1", "@emotion/weak-memoize": "^0.3.1", "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.11.0", "@emotion/css-prettifier": "1.1.3", "@emotion/server": "11.11.0", "@emotion/styled": "11.11.0", "html-tag-names": "^1.1.2", react: "16.14.0", "svg-tag-names": "^1.1.1", typescript: "^4.5.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.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js" ], umdName: "emotionReact", exports: { envConditions: [ "browser", "worker" ], 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 jsx(type, props) { var args = arguments; if (props == null || !emotion_element_c39617d8_browser_esm_hasOwnProperty.call(props, 'css')) { // $FlowFixMe return external_React_.createElement.apply(undefined, 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]; } // $FlowFixMe return external_React_.createElement.apply(null, createElementArgArray); }; var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild // initial client-side render from SSR, use place of hydrating tag var Global = /* #__PURE__ */emotion_element_c39617d8_browser_esm_withEmotionCache(function (props, cache) { if (false) {} var styles = props.styles; var serialized = emotion_serialize_browser_esm_serializeStyles([styles], undefined, external_React_.useContext(emotion_element_c39617d8_browser_esm_ThemeContext)); if (!emotion_element_c39617d8_browser_esm_isBrowser) { var _ref; var serializedNames = serialized.name; var serializedStyles = serialized.styles; var next = serialized.next; while (next !== undefined) { serializedNames += ' ' + next.name; serializedStyles += next.styles; next = next.next; } var shouldCache = cache.compat === true; var rules = cache.insert("", { name: serializedNames, styles: serializedStyles }, cache.sheet, shouldCache); if (shouldCache) { return null; } return /*#__PURE__*/external_React_.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { __html: rules }, _ref.nonce = cache.sheet.nonce, _ref)); } // yes, i know these hooks are used conditionally // but it is based on a constant that will never change at runtime // it's effectively like having two implementations and switching them out // so it's not actually breaking anything var sheetRef = external_React_.useRef(); useInsertionEffectWithLayoutFallback(function () { var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 var sheet = new cache.sheet.constructor({ key: key, nonce: cache.sheet.nonce, container: cache.sheet.container, speedy: cache.sheet.isSpeedy }); var rehydrating = false; // $FlowFixMe var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); if (cache.sheet.tags.length) { sheet.before = cache.sheet.tags[0]; } if (node !== null) { rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s node.setAttribute('data-emotion', key); sheet.hydrate([node]); } 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 !== undefined) { // insert keyframes emotion_utils_browser_esm_insertStyles(cache, serialized.next, true); } if (sheet.tags.length) { // if this doesn't exist then it will be null so the style element will be appended var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; sheet.before = element; sheet.flush(); } cache.insert("", serialized, sheet, false); }, [cache, serialized.name]); return null; }); if (false) {} function css() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return emotion_serialize_browser_esm_serializeStyles(args); } var keyframes = function keyframes() { var insertable = css.apply(void 0, arguments); var name = "animation-" + insertable.name; // $FlowFixMe return { name: name, styles: "@keyframes " + name + "{" + insertable.styles + "}", anim: 1, toString: function toString() { return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; } }; }; var classnames = function classnames(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 = classnames(arg); } else { if (false) {} 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 merge(registered, css, className) { var registeredStyles = []; var rawClassName = getRegisteredStyles(registered, registeredStyles, className); if (registeredStyles.length < 2) { return className; } return rawClassName + css(registeredStyles); } var emotion_react_browser_esm_Insertion = function Insertion(_ref) { var cache = _ref.cache, serializedArr = _ref.serializedArr; useInsertionEffectAlwaysWithSyncFallback(function () { for (var i = 0; i < serializedArr.length; i++) { insertStyles(cache, serializedArr[i], false); } }); return null; }; var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) { var hasRendered = false; var serializedArr = []; var css = function css() { if (hasRendered && "production" !== 'production') {} 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); // registration has to happen here as the result of this might get consumed by `cx` registerStyles(cache, serialized, false); return cache.key + "-" + serialized.name; }; var cx = function cx() { if (hasRendered && "production" !== 'production') {} for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return merge(cache.registered, css, classnames(args)); }; var content = { css: css, cx: cx, theme: React.useContext(ThemeContext) }; var ele = props.children(content); hasRendered = true; return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(emotion_react_browser_esm_Insertion, { cache: cache, serializedArr: serializedArr }), ele); }))); if (false) {} if (false) { var globalKey, globalContext, isTestEnv, emotion_react_browser_esm_isBrowser; } // EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js var jsx_runtime = __webpack_require__(893); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/css-reset/dist/chunk-B4LBJQ3X.mjs 'use client' // src/css-reset.tsx ; var chunk_B4LBJQ3X_css = String.raw; var vhPolyfill = chunk_B4LBJQ3X_css` :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 = () => /* @__PURE__ */ (0,jsx_runtime.jsx)(Global, { styles: vhPolyfill }); var CSSReset = ({ scope = "" }) => /* @__PURE__ */ (0,jsx_runtime.jsx)( Global, { styles: chunk_B4LBJQ3X_css` 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} ` } ); var css_reset_default = (/* unused pure expression or super */ null && (CSSReset)); //# sourceMappingURL=chunk-B4LBJQ3X.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-context/dist/index.mjs 'use client' // src/index.ts ; 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,external_React_.createContext)(defaultValue); Context.displayName = name; function useContext() { var _a; const context = (0,external_React_.useContext)(Context); if (!context && strict) { const error = new Error( errorMessage != null ? errorMessage : getErrorMessage(hookName, providerName) ); error.name = "ContextError"; (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, error, useContext); throw error; } return context; } return [Context.Provider, useContext, Context]; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/portal/dist/chunk-HK66PB7M.mjs 'use client' // src/portal-manager.tsx ; var [PortalManagerContextProvider, usePortalManager] = createContext({ strict: false, name: "PortalManagerContext" }); function PortalManager(props) { const { children, zIndex } = props; return /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalManagerContextProvider, { value: { zIndex }, children }); } PortalManager.displayName = "PortalManager"; //# sourceMappingURL=chunk-HK66PB7M.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/color-mode/dist/chunk-UQDW7KKV.mjs 'use client' // src/color-mode-context.ts ; var ColorModeContext = (0,external_React_.createContext)({}); ColorModeContext.displayName = "ColorModeContext"; function useColorMode() { const context = (0,external_React_.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; } //# sourceMappingURL=chunk-UQDW7KKV.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-utils/dist/chunk-ITIKTQWJ.mjs // src/context.ts function chunk_ITIKTQWJ_createContext(options = {}) { const { strict = true, errorMessage = "useContext: `context` is undefined. Seems you forgot to wrap component within the Provider", name } = options; const Context = (0,external_React_.createContext)(void 0); Context.displayName = name; function useContext() { var _a; const context = (0,external_React_.useContext)(Context); if (!context && strict) { const error = new Error(errorMessage); error.name = "ContextError"; (_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, error, useContext); throw error; } return context; } return [ Context.Provider, useContext, Context ]; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/shared-utils/dist/index.mjs // src/index.ts var cx = (...classNames) => classNames.filter(Boolean).join(" "); function isDev() { return "production" !== "production"; } function isObject(value) { const type = typeof value; return value != null && (type === "object" || type === "function") && !Array.isArray(value); } var warn = (options) => { const { condition, message } = options; if (condition && isDev()) { console.warn(message); } }; function dist_runIfFn(valueOrFn, ...args) { return isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn; } var isFunction = (value) => typeof value === "function"; var dataAttr = (condition) => condition ? "" : void 0; var ariaAttr = (condition) => condition ? true : void 0; function callAllHandlers(...fns) { return function func(event) { fns.some((fn) => { fn == null ? void 0 : fn(event); return event == null ? void 0 : event.defaultPrevented; }); }; } function callAll(...fns) { return function mergedFn(arg) { fns.forEach((fn) => { fn == null ? void 0 : fn(arg); }); }; } // EXTERNAL MODULE: ./node_modules/lodash.mergewith/index.js var lodash_mergewith = __webpack_require__(554); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/styled-system/dist/index.mjs // src/utils/create-transform.ts var isImportant = (value) => /!(important)?$/.test(value); var withoutImportant = (value) => typeof value === "string" ? value.replace(/!(important)?$/, "").trim() : value; var tokenToCSSVar = (scale, value) => (theme) => { const valueStr = String(value); const important = isImportant(valueStr); const valueWithoutImportant = withoutImportant(valueStr); const key = scale ? `${scale}.${valueWithoutImportant}` : valueWithoutImportant; let transformed = isObject(theme.__cssMap) && key in theme.__cssMap ? theme.__cssMap[key].varRef : value; transformed = withoutImportant(transformed); return important ? `${transformed} !important` : transformed; }; function createTransform(options) { const { scale, transform: transform2, compose } = options; const fn = (value, theme) => { var _a; const _value = tokenToCSSVar(scale, value)(theme); let result = (_a = transform2 == null ? void 0 : transform2(_value, theme)) != null ? _a : _value; if (compose) { result = compose(result, theme); } return result; }; return fn; } // src/utils/pipe.ts var pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v); // src/utils/prop-config.ts function toConfig(scale, transform2) { return (property) => { const result = { property, scale }; result.transform = createTransform({ scale, transform: transform2 }); return result; }; } var getRtl = ({ rtl, ltr }) => (theme) => theme.direction === "rtl" ? rtl : ltr; function logical(options) { const { property, scale, transform: transform2 } = options; return { scale, property: getRtl(property), transform: scale ? createTransform({ scale, compose: transform2 }) : transform2 }; } // src/utils/templates.ts 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" } }; // src/utils/parse-gradient.ts 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, theme) { 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 direction = maybeDirection in directionMap ? directionMap[maybeDirection] : maybeDirection; stops.unshift(direction); 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 color2 = key in theme.__cssMap ? theme.__cssMap[key].varRef : _color; return _stopOrFunc ? [ color2, ...Array.isArray(_stopOrFunc) ? _stopOrFunc : [_stopOrFunc] ].join(" ") : color2; }); return `${_type}(${_values.join(", ")})`; } var isCSSFunction = (value) => { return typeof value === "string" && value.includes("(") && value.includes(")"); }; var gradientTransform = (value, theme) => parseGradient(value, theme != null ? theme : {}); // src/utils/transform-functions.ts function isCssVar(value) { return /^var\(--.+\)$/.test(value); } var analyzeCSSValue = (value) => { const num = parseFloat(value.toString()); const unit = value.toString().replace(String(num), ""); return { unitless: !unit, value: num, unit }; }; var wrap = (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 } = analyzeCSSValue(value); return unitless || typeof value === "number" ? `${value}px` : value; }, fraction(value) { return !(typeof value === "number") || value > 1 ? value : `${value * 100}%`; }, float(value, theme) { const map = { left: "right", right: "left" }; return theme.direction === "rtl" ? map[value] : value; }, degree(value) { if (isCssVar(value) || value == null) return value; const unitless = typeof value === "string" && !value.endsWith("deg"); return typeof value === "number" || unitless ? `${value}deg` : value; }, gradient: gradientTransform, blur: wrap("blur"), opacity: wrap("opacity"), brightness: wrap("brightness"), contrast: wrap("contrast"), dropShadow: wrap("drop-shadow"), grayscale: wrap("grayscale"), hueRotate: (value) => wrap("hue-rotate")(transformFunctions.degree(value)), invert: wrap("invert"), saturate: wrap("saturate"), sepia: wrap("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) { var _a; const { space: space2, divide: divide2 } = (_a = flexDirectionTemplate[value]) != null ? _a : {}; const result = { flexDirection: value }; if (space2) result[space2] = 1; if (divide2) result[divide2] = 1; return result; } }; // src/utils/index.ts 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", pipe(transformFunctions.vh, transformFunctions.px)), spaceT: toConfig("space", pipe(transformFunctions.vh, transformFunctions.px)), degreeT(property) { return { property, transform: transformFunctions.degree }; }, prop(property, scale, transform2) { return { property, scale, ...scale && { transform: createTransform({ scale, transform: transform2 }) } }; }, propT(property, transform2) { return { property, transform: transform2 }; }, sizes: toConfig("sizes", pipe(transformFunctions.vh, transformFunctions.px)), sizesT: toConfig("sizes", pipe(transformFunctions.vh, transformFunctions.fraction)), shadows: toConfig("shadows"), logical, blur: toConfig("blur", transformFunctions.blur) }; // src/config/background.ts 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 }); // src/config/border.ts 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 }); // src/config/color.ts var color = { color: t.colors("color"), textColor: t.colors("color"), fill: t.colors("fill"), stroke: t.colors("stroke") }; // src/config/effect.ts 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 }); // src/config/filter.ts var filter = { 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) }; // src/config/flexbox.ts 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 }); // src/config/grid.ts 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 }; // src/config/interactivity.ts var interactivity = { appearance: true, cursor: true, resize: true, userSelect: true, pointerEvents: true, outline: { transform: transformFunctions.outline }, outlineOffset: true, outlineColor: t.colors("outlineColor") }; // src/config/layout.ts 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, theme) => { var _a, _b, _c; const breakpoint = (_c = (_b = (_a = theme.__breakpoints) == null ? void 0 : _a.get(value)) == null ? void 0 : _b.minW) != null ? _c : value; const mq = `@media screen and (min-width: ${breakpoint})`; return { [mq]: { display: "none" } }; } }, hideBelow: { scale: "breakpoints", transform: (value, theme) => { var _a, _b, _c; const breakpoint = (_c = (_b = (_a = theme.__breakpoints) == null ? void 0 : _a.get(value)) == null ? void 0 : _b._minW) != null ? _c : 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 }); // src/config/list.ts var list = { listStyleType: true, listStylePosition: true, listStylePos: t.prop("listStylePosition"), listStyleImage: true, listStyleImg: t.prop("listStyleImage") }; // src/get.ts function get(obj, path, fallback, index) { const key = typeof path === "string" ? path.split(".") : [path]; for (index = 0; index < key.length; index += 1) { if (!obj) break; obj = obj[key[index]]; } return obj === void 0 ? fallback : obj; } var dist_memoize = (fn) => { const cache = /* @__PURE__ */ new WeakMap(); const memoizedFn = (obj, path, fallback, index) => { if (typeof obj === "undefined") { return fn(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 = fn(obj, path, fallback, index); map.set(path, value); return value; }; return memoizedFn; }; var memoizedGet = dist_memoize(get); // src/config/others.ts 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 = (theme, key, styles) => { const result = {}; const obj = memoizedGet(theme, key, {}); for (const prop in obj) { const isInStyles = prop in styles && styles[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, theme, styles) => getWithPriority(theme, `layerStyles.${value}`, styles) }, textStyle: { processResult: true, transform: (value, theme, styles) => getWithPriority(theme, `textStyles.${value}`, styles) }, apply: { processResult: true, transform: (value, theme, styles) => getWithPriority(theme, value, styles) } }; // src/config/position.ts var dist_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(dist_position, { insetStart: dist_position.insetInlineStart, insetEnd: dist_position.insetInlineEnd }); // src/config/ring.ts 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") }; // src/config/space.ts 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 }); // src/config/text-decoration.ts var textDecoration = { textDecorationColor: t.colors("textDecorationColor"), textDecoration: true, textDecor: { property: "textDecoration" }, textDecorationLine: true, textDecorationStyle: true, textDecorationThickness: true, textUnderlineOffset: true, textShadow: t.shadows("textShadow") }; // src/config/transform.ts 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") }; // src/config/transition.ts 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" ) }; // src/config/typography.ts 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" } }; // src/config/scroll.ts var dist_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"]) }; // src/create-theme-vars/calc.ts 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 subtract = (...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(subtract(x, ...operands)), multiply: (...operands) => calc(multiply(x, ...operands)), divide: (...operands) => calc(divide(x, ...operands)), negate: () => calc(negate(x)), toString: () => x.toString() }), { add, subtract, multiply, divide, negate } ); // src/create-theme-vars/css-var.ts function replaceWhiteSpace(value, replaceValue = "-") { return value.replace(/\s+/g, replaceValue); } function dist_escape(value) { const valueStr = replaceWhiteSpace(value.toString()); return escapeSymbol(escapeDot(valueStr)); } function escapeDot(value) { if (value.includes("\\.")) return value; const isDecimal = !Number.isInteger(parseFloat(value.toString())); return isDecimal ? value.replace(".", `\\.`) : value; } function escapeSymbol(value) { return value.replace(/[!-,/:-@[-^`{-~]/g, "\\$&"); } function addPrefix(value, prefix = "") { return [prefix, value].filter(Boolean).join("-"); } function toVarReference(name, fallback) { return `var(${name}${fallback ? `, ${fallback}` : ""})`; } function toVarDefinition(value, prefix = "") { return dist_escape(`--${addPrefix(value, prefix)}`); } function cssVar(name, fallback, cssVarPrefix) { const cssVariable = toVarDefinition(name, cssVarPrefix); return { variable: cssVariable, reference: toVarReference(cssVariable, fallback) }; } function defineCssVars(scope, keys2) { const vars = {}; for (const key of keys2) { if (Array.isArray(key)) { const [name, fallback] = key; vars[name] = cssVar(`${scope}-${name}`, fallback); continue; } vars[key] = cssVar(`${scope}-${key}`); } return vars; } // ../../utilities/breakpoint-utils/src/breakpoint.ts function getLastItem(array) { const length = array == null ? 0 : array.length; return length ? array[length - 1] : void 0; } function analyzeCSSValue2(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 } = analyzeCSSValue2(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 = (breakpoints) => Object.fromEntries(Object.entries(breakpoints).sort(sortByBreakpointValue)); function normalize(breakpoints) { const sorted = sortBps(breakpoints); return Object.assign(Object.values(sorted), sorted); } function keys(breakpoints) { const value = Object.keys(sortBps(breakpoints)); return new Set(value); } function subtract2(value) { var _a; if (!value) return value; value = (_a = px(value)) != null ? _a : value; const OFFSET = -0.02; return typeof value === "number" ? `${value + OFFSET}` : value.replace(/(\d+\.?\d*)/u, (m) => `${parseFloat(m) + OFFSET}`); } function toMediaQueryString(min, max) { const query = ["@media screen"]; if (min) query.push("and", `(min-width: ${px(min)})`); if (max) query.push("and", `(max-width: ${px(max)})`); return query.join(" "); } function analyzeBreakpoints(breakpoints) { var _a; if (!breakpoints) return null; breakpoints.base = (_a = breakpoints.base) != null ? _a : "0px"; const normalized = normalize(breakpoints); const queries = Object.entries(breakpoints).sort(sortByBreakpointValue).map(([breakpoint, minW], index, entry) => { var _a2; let [, maxW] = (_a2 = entry[index + 1]) != null ? _a2 : []; maxW = parseFloat(maxW) > 0 ? subtract2(maxW) : void 0; return { _minW: subtract2(minW), breakpoint, minW, maxW, maxWQuery: toMediaQueryString(null, maxW), minWQuery: toMediaQueryString(minW), minMaxQuery: toMediaQueryString(minW, maxW) }; }); const _keys = keys(breakpoints); const _keysArr = Array.from(_keys.values()); return { keys: _keys, normalized, isResponsive(test) { const keys2 = Object.keys(test); return keys2.length > 0 && keys2.every((key) => _keys.has(key)); }, asObject: sortBps(breakpoints), asArray: normalize(breakpoints), 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(test) { if (!isObject(test)) { throw new Error("toArrayValue: value must be an object"); } const result = _keysArr.map((bp) => { var _a2; return (_a2 = test[bp]) != null ? _a2 : 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(test) { if (!Array.isArray(test)) { throw new Error("toObjectValue: value must be an array"); } return test.reduce((acc, value, index) => { const key = _keysArr[index]; if (key != null && value != null) acc[key] = value; return acc; }, {}); } }; } // src/create-theme-vars/create-theme-vars.ts // src/pseudos.ts var state = { 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 = (fn) => dist_merge((v) => fn(v, "&"), "[role=group]", "[data-group]", ".group"); var toPeer = (fn) => dist_merge((v) => fn(v, "~ &"), "[data-peer]", ".peer"); var dist_merge = (fn, ...selectors) => selectors.map(fn).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", /** * 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 * <Box _before={{content:`""` }}/> * ``` */ _before: "&::before", /** * Styles for CSS selector `&::after` * * NOTE:When using this, ensure the `content` is wrapped in a backtick. * @example * ```jsx * <Box _after={{content:`""` }}/> * ``` */ _after: "&::after", /** * Styles for CSS selector `&:empty` */ _empty: "&:empty", /** * Styles to apply when the ARIA attribute `aria-expanded` is `true` * - CSS selector `&[aria-expanded=true]` */ _expanded: "&[aria-expanded=true], &[data-expanded]", /** * Styles to apply when the ARIA attribute `aria-checked` is `true` * - CSS selector `&[aria-checked=true]` */ _checked: "&[aria-checked=true], &[data-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 * <Text _firstLetter={{ textDecoration: 'underline' }}>Once upon a time</Text> * ``` */ _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]", /** * 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", /** * Styles for CSS Selector `&:placeholder-shown`. */ _placeholderShown: "&:placeholder-shown", /** * Styles for CSS Selector `&:fullscreen`. */ _fullScreen: "&: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]" }; var pseudoPropNames = Object.keys( pseudoSelectors ); // src/create-theme-vars/create-theme-vars.ts function tokenToCssVar(token, prefix) { return cssVar(String(token).replace(/\./g, "-"), void 0, prefix); } function createThemeVars(flatTokens, options) { let cssVars = {}; const cssMap = {}; for (const [token, tokenValue] of Object.entries(flatTokens)) { const { isSemantic, value } = tokenValue; const { variable, reference } = tokenToCssVar(token, options == null ? void 0 : options.cssVarPrefix); if (!isSemantic) { if (token.startsWith("space")) { const keys2 = token.split("."); const [firstKey, ...referenceKeys] = keys2; const negativeLookupKey = `${firstKey}.-${referenceKeys.join(".")}`; const negativeValue = calc.negate(value); const negatedReference = calc.negate(reference); cssMap[negativeLookupKey] = { value: negativeValue, var: variable, varRef: negatedReference }; } cssVars[variable] = value; cssMap[token] = { value, var: variable, varRef: reference }; continue; } const lookupToken = (maybeToken) => { const scale = String(token).split(".")[0]; const withScale = [scale, maybeToken].join("."); const resolvedTokenValue = flatTokens[withScale]; if (!resolvedTokenValue) return maybeToken; const { reference: reference2 } = tokenToCssVar(withScale, options == null ? void 0 : options.cssVarPrefix); return reference2; }; const normalizedValue = isObject(value) ? value : { default: value }; cssVars = lodash_mergewith( cssVars, Object.entries(normalizedValue).reduce( (acc, [conditionAlias, conditionValue]) => { var _a, _b; if (!conditionValue) return acc; const tokenReference = lookupToken(`${conditionValue}`); if (conditionAlias === "default") { acc[variable] = tokenReference; return acc; } const conditionSelector = (_b = (_a = pseudoSelectors) == null ? void 0 : _a[conditionAlias]) != null ? _b : conditionAlias; acc[conditionSelector] = { [variable]: tokenReference }; return acc; }, {} ) ); cssMap[token] = { value: reference, var: variable, varRef: reference }; } return { cssVars, cssMap }; } // ../../utilities/object-utils/src/omit.ts function omit(object, keysToOmit = []) { const clone = Object.assign({}, object); for (const key of keysToOmit) { if (key in clone) { delete clone[key]; } } return clone; } // ../../utilities/object-utils/src/pick.ts function pick(object, keysToPick) { const result = {}; for (const key of keysToPick) { if (key in object) { result[key] = object[key]; } } return result; } // ../../utilities/object-utils/src/walk-object.ts function isObject5(value) { return typeof value === "object" && value != null && !Array.isArray(value); } function walkObject(target, predicate, options = {}) { const { stop, getKey } = options; function inner(value, path = []) { var _a; if (isObject5(value) || Array.isArray(value)) { const result = {}; for (const [prop, child] of Object.entries(value)) { const key = (_a = getKey == null ? void 0 : getKey(prop)) != null ? _a : 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); } // src/create-theme-vars/theme-tokens.ts var tokens = [ "colors", "borders", "borderWidths", "borderStyles", "fonts", "fontSizes", "fontWeights", "gradients", "letterSpacings", "lineHeights", "radii", "space", "shadows", "sizes", "zIndices", "transition", "blur", "breakpoints" ]; function extractTokens(theme) { const _tokens = tokens; return pick(theme, _tokens); } function extractSemanticTokens(theme) { return theme.semanticTokens; } function omitVars(rawTheme) { const { __cssMap, __cssVars, __breakpoints, ...cleanTheme } = rawTheme; return cleanTheme; } // src/create-theme-vars/flatten-tokens.ts var isSemanticCondition = (key) => pseudoPropNames.includes(key) || "default" === key; function flattenTokens({ tokens: tokens2, semanticTokens }) { const result = {}; walkObject(tokens2, (value, path) => { if (value == null) return; result[path.join(".")] = { isSemantic: false, value }; }); walkObject( semanticTokens, (value, path) => { if (value == null) return; result[path.join(".")] = { isSemantic: true, value }; }, { stop: (value) => Object.keys(value).every(isSemanticCondition) } ); return result; } // src/create-theme-vars/to-css-var.ts function toCSSVar(rawTheme) { var _a; const theme = omitVars(rawTheme); const tokens2 = extractTokens(theme); const semanticTokens = extractSemanticTokens(theme); const flatTokens = flattenTokens({ tokens: tokens2, semanticTokens }); const cssVarPrefix = (_a = theme.config) == null ? void 0 : _a.cssVarPrefix; 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 <Global/> component to attach variables to `:root` */ cssVars } = createThemeVars(flatTokens, { cssVarPrefix }); 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(theme, { __cssVars: { ...defaultCssVars, ...cssVars }, __cssMap: cssMap, __breakpoints: analyzeBreakpoints(theme.breakpoints) }); return theme; } // src/css.ts // src/system.ts var systemProps = lodash_mergewith( {}, background, border, color, flexbox, layout, filter, ring, interactivity, grid, others, dist_position, effect, space, dist_scroll, typography, textDecoration, transform, list, transition ); var layoutSystem = Object.assign({}, space, layout, flexbox, grid, dist_position); var layoutPropNames = Object.keys( layoutSystem ); var propNames = [...Object.keys(systemProps), ...pseudoPropNames]; var styleProps = { ...systemProps, ...pseudoSelectors }; var isStyleProp = (prop) => prop in styleProps; // src/utils/expand-responsive.ts var expandResponsive = (styles) => (theme) => { if (!theme.__breakpoints) return styles; const { isResponsive, toArrayValue, media: medias } = theme.__breakpoints; const computedStyles = {}; for (const key in styles) { let value = dist_runIfFn(styles[key], theme); 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 index = 0; index < queries; index += 1) { const media = medias == null ? void 0 : medias[index]; if (!media) { computedStyles[key] = value[index]; continue; } computedStyles[media] = computedStyles[media] || {}; if (value[index] == null) { continue; } computedStyles[media][key] = value[index]; } } return computedStyles; }; // src/utils/split-by-comma.ts function splitByComma(value) { const chunks = []; let chunk = ""; let inParens = false; for (let i = 0; i < value.length; i++) { const char = value[i]; if (char === "(") { inParens = true; chunk += char; } else if (char === ")") { inParens = false; chunk += char; } else if (char === "," && !inParens) { chunks.push(chunk); chunk = ""; } else { chunk += char; } } chunk = chunk.trim(); if (chunk) { chunks.push(chunk); } return chunks; } // src/css.ts function isCssVar2(value) { return /^var\(--.+\)$/.test(value); } var isCSSVariableTokenValue = (key, value) => key.startsWith("--") && typeof value === "string" && !isCssVar2(value); var resolveTokenValue = (theme, value) => { var _a, _b; if (value == null) return value; const getVar = (val) => { var _a2, _b2; return (_b2 = (_a2 = theme.__cssMap) == null ? void 0 : _a2[val]) == null ? void 0 : _b2.varRef; }; const getValue = (val) => { var _a2; return (_a2 = getVar(val)) != null ? _a2 : val; }; const [tokenValue, fallbackValue] = splitByComma(value); value = (_b = (_a = getVar(tokenValue)) != null ? _a : getValue(fallbackValue)) != null ? _b : getValue(value); return value; }; function getCss(options) { const { configs = {}, pseudos = {}, theme } = options; const css2 = (stylesOrFn, nested = false) => { var _a, _b, _c; const _styles = dist_runIfFn(stylesOrFn, theme); const styles = expandResponsive(_styles)(theme); let computedStyles = {}; for (let key in styles) { const valueOrFn = styles[key]; let value = dist_runIfFn(valueOrFn, theme); if (key in pseudos) { key = pseudos[key]; } if (isCSSVariableTokenValue(key, value)) { value = resolveTokenValue(theme, value); } let config = configs[key]; if (config === true) { config = { property: key }; } if (isObject(value)) { computedStyles[key] = (_a = computedStyles[key]) != null ? _a : {}; computedStyles[key] = lodash_mergewith( {}, computedStyles[key], css2(value, true) ); continue; } let rawValue = (_c = (_b = config == null ? void 0 : config.transform) == null ? void 0 : _b.call(config, value, theme, _styles)) != null ? _c : value; rawValue = (config == null ? void 0 : config.processResult) ? css2(rawValue, true) : rawValue; const configProperty = dist_runIfFn(config == null ? void 0 : config.property, theme); if (!nested && (config == null ? void 0 : config.static)) { const staticStyles = dist_runIfFn(config.static, theme); computedStyles = lodash_mergewith({}, computedStyles, staticStyles); } if (configProperty && Array.isArray(configProperty)) { for (const property of configProperty) { computedStyles[property] = rawValue; } continue; } if (configProperty) { if (configProperty === "&" && isObject(rawValue)) { computedStyles = lodash_mergewith({}, computedStyles, rawValue); } else { computedStyles[configProperty] = rawValue; } continue; } if (isObject(rawValue)) { computedStyles = lodash_mergewith({}, computedStyles, rawValue); continue; } computedStyles[key] = rawValue; } return computedStyles; }; return css2; } var dist_css = (styles) => (theme) => { const cssFn = getCss({ theme, pseudos: pseudoSelectors, configs: systemProps }); return cssFn(styles); }; // src/define-styles.ts function defineStyle(styles) { return styles; } function defineStyleConfig(config) { return config; } function createMultiStyleConfigHelpers(parts) { return { definePartsStyle(config) { return config; }, defineMultiStyleConfig(config) { return { parts, ...config }; } }; } // src/style-config.ts function normalize2(value, toArray) { if (Array.isArray(value)) return value; if (isObject(value)) return toArray(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(theme) { const breakpointUtil = theme.__breakpoints; return function resolver(config, prop, value, props) { var _a, _b; 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 = !!config.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 styles = dist_runIfFn((_a = config[prop]) == null ? void 0 : _a[normalized[i]], props); if (!styles) continue; if (isMultipart) { (_b = config.parts) == null ? void 0 : _b.forEach((part) => { lodash_mergewith(result, { [part]: isSingle ? styles[part] : { [query]: styles[part] } }); }); continue; } if (!isMultipart) { if (isSingle) lodash_mergewith(result, styles); else result[query] = styles; continue; } result[query] = styles; } return result; }; } function resolveStyleConfig(config) { return (props) => { var _a; const { variant, size, theme } = props; const recipe = createResolver(theme); return lodash_mergewith( {}, dist_runIfFn((_a = config.baseStyle) != null ? _a : {}, props), recipe(config, "sizes", size, props), recipe(config, "variants", variant, props) ); }; } // src/get-css-var.ts function dist_getCSSVar(theme, scale, value) { var _a, _b, _c; return (_c = (_b = (_a = theme.__cssMap) == null ? void 0 : _a[`${scale}.${value}`]) == null ? void 0 : _b.varRef) != null ? _c : value; } // src/theming-props.ts function omitThemingProps(props) { return omit(props, ["styleConfig", "size", "variant", "colorScheme"]); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/utils/dist/chunk-YTQ3XZ3T.mjs // src/object.ts function chunk_YTQ3XZ3T_omit(object, keys) { const result = {}; Object.keys(object).forEach((key) => { if (keys.includes(key)) return; result[key] = object[key]; }); return result; } function chunk_YTQ3XZ3T_pick(object, keys) { const result = {}; keys.forEach((key) => { if (key in object) { result[key] = object[key]; } }); return result; } function split(object, keys) { const picked = {}; const omitted = {}; Object.keys(object).forEach((key) => { if (keys.includes(key)) { picked[key] = object[key]; } else { omitted[key] = object[key]; } }); return [picked, omitted]; } function chunk_YTQ3XZ3T_get(obj, path, fallback, index) { const key = typeof path === "string" ? path.split(".") : [path]; for (index = 0; index < key.length; index += 1) { if (!obj) break; obj = obj[key[index]]; } return obj === void 0 ? fallback : obj; } var chunk_YTQ3XZ3T_memoize = (fn) => { const cache = /* @__PURE__ */ new WeakMap(); const memoizedFn = (obj, path, fallback, index) => { if (typeof obj === "undefined") { return fn(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 = fn(obj, path, fallback, index); map.set(path, value); return value; }; return memoizedFn; }; var chunk_YTQ3XZ3T_memoizedGet = chunk_YTQ3XZ3T_memoize(chunk_YTQ3XZ3T_get); function getWithDefault(path, scale) { return chunk_YTQ3XZ3T_memoizedGet(scale, path, path); } function objectFilter(object, fn) { const result = {}; Object.keys(object).forEach((key) => { const value = object[key]; const shouldPass = fn(value, key, object); if (shouldPass) { result[key] = value; } }); return result; } var filterUndefined = (object) => objectFilter(object, (val) => val !== null && val !== void 0); var objectKeys = (obj) => Object.keys(obj); var fromEntries = (entries) => entries.reduce((carry, [key, value]) => { carry[key] = value; return carry; }, {}); var chunk_YTQ3XZ3T_getCSSVar = (theme, scale, value) => { var _a, _b, _c; return (_c = (_b = (_a = theme.__cssMap) == null ? void 0 : _a[`${scale}.${value}`]) == null ? void 0 : _b.varRef) != null ? _c : value; }; ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/utils/dist/chunk-Y5FGD7DM.mjs // src/assertion.ts function chunk_Y5FGD7DM_isNumber(value) { return typeof value === "number"; } function isNotNumber(value) { return typeof value !== "number" || Number.isNaN(value) || !Number.isFinite(value); } function isNumeric(value) { return value != null && value - parseFloat(value) + 1 >= 0; } function isArray(value) { return Array.isArray(value); } function isEmptyArray(value) { return isArray(value) && value.length === 0; } function chunk_Y5FGD7DM_isFunction(value) { return typeof value === "function"; } function isDefined(value) { return typeof value !== "undefined" && value !== void 0; } function isUndefined(value) { return typeof value === "undefined" || value === void 0; } function chunk_Y5FGD7DM_isObject(value) { const type = typeof value; return value != null && (type === "object" || type === "function") && !isArray(value); } function isEmptyObject(value) { return chunk_Y5FGD7DM_isObject(value) && Object.keys(value).length === 0; } function isNotEmptyObject(value) { return value && !isEmptyObject(value); } function isNull(value) { return value == null; } function isString(value) { return Object.prototype.toString.call(value) === "[object String]"; } function chunk_Y5FGD7DM_isCssVar(value) { return /^var\(--.+\)$/.test(value); } function isEmpty(value) { if (isArray(value)) return isEmptyArray(value); if (chunk_Y5FGD7DM_isObject(value)) return isEmptyObject(value); if (value == null || value === "") return true; return false; } var chunk_Y5FGD7DM_DEV_ = (/* unused pure expression or super */ null && ("production" !== "production")); var __TEST__ = (/* unused pure expression or super */ null && ("production" === "test")); function isRefObject(val) { return "current" in val; } function isInputEvent(value) { return value && chunk_Y5FGD7DM_isObject(value) && chunk_Y5FGD7DM_isObject(value.target); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/utils/dist/chunk-M3TFMUOL.mjs // src/function.ts function chunk_M3TFMUOL_runIfFn(valueOrFn, ...args) { return chunk_Y5FGD7DM_isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn; } function chunk_M3TFMUOL_callAllHandlers(...fns) { return function func(event) { fns.some((fn) => { fn == null ? void 0 : fn(event); return event == null ? void 0 : event.defaultPrevented; }); }; } function chunk_M3TFMUOL_callAll(...fns) { return function mergedFn(arg) { fns.forEach((fn) => { fn == null ? void 0 : fn(arg); }); }; } var compose = (fn1, ...fns) => fns.reduce( (f1, f2) => (...args) => f1(f2(...args)), fn1 ); function once(fn) { let result; return function func(...args) { if (fn) { result = fn.apply(this, args); fn = null; } return result; }; } var noop = () => { }; var chunk_M3TFMUOL_warn = /* @__PURE__ */ (/* unused pure expression or super */ null && (once((options) => () => { const { condition, message } = options; if (condition && __DEV__) { console.warn(message); } }))); var error = /* @__PURE__ */ (/* unused pure expression or super */ null && (once((options) => () => { const { condition, message } = options; if (condition && __DEV__) { console.error(message); } }))); var chunk_M3TFMUOL_pipe = (...fns) => (v) => fns.reduce((a, b) => b(a), v); var distance1D = (a, b) => Math.abs(a - b); var isPoint = (point) => "x" in point && "y" in point; function distance(a, b) { if (isNumber(a) && isNumber(b)) { 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; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-MFVQSVQB.mjs 'use client' // src/providers.tsx ; function chunk_MFVQSVQB_ThemeProvider(props) { const { cssVarsRoot, theme, children } = props; const computedTheme = (0,external_React_.useMemo)(() => toCSSVar(theme), [theme]); return /* @__PURE__ */ (0,jsx_runtime.jsxs)(ThemeProvider, { theme: computedTheme, children: [ /* @__PURE__ */ (0,jsx_runtime.jsx)(CSSVars, { root: cssVarsRoot }), children ] }); } function CSSVars({ root = ":host, :root" }) { const selector = [root, `[data-theme]`].join(","); return /* @__PURE__ */ (0,jsx_runtime.jsx)(Global, { styles: (theme) => ({ [selector]: theme.__cssVars }) }); } var [StylesProvider, useStyles] = chunk_ITIKTQWJ_createContext({ name: "StylesContext", errorMessage: "useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` " }); function createStylesContext(componentName) { return chunk_ITIKTQWJ_createContext({ name: `${componentName}StylesContext`, errorMessage: `useStyles: "styles" is undefined. Seems you forgot to wrap the components in "<${componentName} />" ` }); } function GlobalStyle() { const { colorMode } = useColorMode(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( Global, { styles: (theme) => { const styleObjectOrFn = chunk_YTQ3XZ3T_memoizedGet(theme, "styles.global"); const globalStyles = chunk_M3TFMUOL_runIfFn(styleObjectOrFn, { theme, colorMode }); if (!globalStyles) return void 0; const styles = dist_css(globalStyles)(theme); return styles; } } ); } //# sourceMappingURL=chunk-MFVQSVQB.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/color-mode/dist/chunk-X7ZBZ4KW.mjs 'use client' // src/color-mode.utils.ts var classNames = { light: "chakra-ui-light", dark: "chakra-ui-dark" }; function getColorModeUtils(options = {}) { const { preventTransition = true } = 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) { var _a; const dark = (_a = utils.query().matches) != null ? _a : fallback === "dark"; return dark ? "dark" : "light"; }, addListener(fn) { const mql = utils.query(); const listener = (e) => { fn(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 css = document.createElement("style"); css.appendChild( document.createTextNode( `*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}` ) ); document.head.appendChild(css); return () => { ; (() => window.getComputedStyle(document.body))(); requestAnimationFrame(() => { requestAnimationFrame(() => { document.head.removeChild(css); }); }); }; } }; return utils; } //# sourceMappingURL=chunk-X7ZBZ4KW.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/color-mode/dist/chunk-44OWBZ77.mjs 'use client' // src/storage-manager.ts 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 match = cookie.match(new RegExp(`(^| )${key}=([^;]+)`)); return match == null ? void 0 : match[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); //# sourceMappingURL=chunk-44OWBZ77.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-safe-layout-effect/dist/index.mjs 'use client' // src/index.ts ; var dist_useSafeLayoutEffect = Boolean(globalThis == null ? void 0 : globalThis.document) ? external_React_.useLayoutEffect : external_React_.useEffect; //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/color-mode/dist/chunk-AMBGAKG2.mjs 'use client' ; // src/color-mode-provider.tsx var chunk_AMBGAKG2_noop = () => { }; function chunk_AMBGAKG2_getTheme(manager, fallback) { return manager.type === "cookie" && manager.ssr ? manager.get(fallback) : fallback; } function ColorModeProvider(props) { const { value, children, options: { useSystemColorMode, initialColorMode, disableTransitionOnChange } = {}, colorModeManager = localStorageManager } = props; const defaultColorMode = initialColorMode === "dark" ? "dark" : "light"; const [colorMode, rawSetColorMode] = (0,external_React_.useState)( () => chunk_AMBGAKG2_getTheme(colorModeManager, defaultColorMode) ); const [resolvedColorMode, setResolvedColorMode] = (0,external_React_.useState)( () => chunk_AMBGAKG2_getTheme(colorModeManager) ); const { getSystemTheme, setClassName, setDataset, addListener } = (0,external_React_.useMemo)( () => getColorModeUtils({ preventTransition: disableTransitionOnChange }), [disableTransitionOnChange] ); const resolvedValue = initialColorMode === "system" && !colorMode ? resolvedColorMode : colorMode; const setColorMode = (0,external_React_.useCallback)( (value2) => { const resolved = value2 === "system" ? getSystemTheme() : value2; rawSetColorMode(resolved); setClassName(resolved === "dark"); setDataset(resolved); colorModeManager.set(resolved); }, [colorModeManager, getSystemTheme, setClassName, setDataset] ); dist_useSafeLayoutEffect(() => { if (initialColorMode === "system") { setResolvedColorMode(getSystemTheme()); } }, []); (0,external_React_.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,external_React_.useCallback)(() => { setColorMode(resolvedValue === "dark" ? "light" : "dark"); }, [resolvedValue, setColorMode]); (0,external_React_.useEffect)(() => { if (!useSystemColorMode) return; return addListener(setColorMode); }, [useSystemColorMode, addListener, setColorMode]); const context = (0,external_React_.useMemo)( () => ({ colorMode: value != null ? value : resolvedValue, toggleColorMode: value ? chunk_AMBGAKG2_noop : toggleColorMode, setColorMode: value ? chunk_AMBGAKG2_noop : setColorMode, forced: value !== void 0 }), [resolvedValue, toggleColorMode, setColorMode, value] ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, children }); } ColorModeProvider.displayName = "ColorModeProvider"; function DarkMode(props) { const context = (0,external_React_.useMemo)( () => ({ colorMode: "dark", toggleColorMode: chunk_AMBGAKG2_noop, setColorMode: chunk_AMBGAKG2_noop, forced: true }), [] ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, ...props }); } DarkMode.displayName = "DarkMode"; function LightMode(props) { const context = (0,external_React_.useMemo)( () => ({ colorMode: "light", toggleColorMode: chunk_AMBGAKG2_noop, setColorMode: chunk_AMBGAKG2_noop, forced: true }), [] ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(ColorModeContext.Provider, { value: context, ...props }); } LightMode.displayName = "LightMode"; //# sourceMappingURL=chunk-AMBGAKG2.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-env/dist/chunk-VMD3UMGK.mjs 'use client' // src/env.tsx ; var EnvironmentContext = (0,external_React_.createContext)({ getDocument() { return document; }, getWindow() { return window; } }); EnvironmentContext.displayName = "EnvironmentContext"; function useEnvironment({ defer } = {}) { const [, forceUpdate] = (0,external_React_.useReducer)((c) => c + 1, 0); dist_useSafeLayoutEffect(() => { if (!defer) return; forceUpdate(); }, [defer]); return (0,external_React_.useContext)(EnvironmentContext); } function EnvironmentProvider(props) { const { children, environment: environmentProp, disabled } = props; const ref = (0,external_React_.useRef)(null); const context = (0,external_React_.useMemo)(() => { if (environmentProp) return environmentProp; return { getDocument: () => { var _a, _b; return (_b = (_a = ref.current) == null ? void 0 : _a.ownerDocument) != null ? _b : document; }, getWindow: () => { var _a, _b; return (_b = (_a = ref.current) == null ? void 0 : _a.ownerDocument.defaultView) != null ? _b : window; } }; }, [environmentProp]); const showSpan = !disabled || !environmentProp; return /* @__PURE__ */ (0,jsx_runtime.jsxs)(EnvironmentContext.Provider, { value: context, children: [ children, showSpan && /* @__PURE__ */ (0,jsx_runtime.jsx)("span", { id: "__chakra_env", hidden: true, ref }) ] }); } EnvironmentProvider.displayName = "EnvironmentProvider"; //# sourceMappingURL=chunk-VMD3UMGK.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/provider/dist/chunk-3DDHO3UN.mjs 'use client' // src/chakra-provider.tsx ; var ChakraProvider = (props) => { const { children, colorModeManager, portalZIndex, resetScope, resetCSS = true, theme = {}, environment, cssVarsRoot, disableEnvironment, disableGlobalStyle } = props; const _children = /* @__PURE__ */ (0,jsx_runtime.jsx)( EnvironmentProvider, { environment, disabled: disableEnvironment, children } ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chunk_MFVQSVQB_ThemeProvider, { theme, cssVarsRoot, children: /* @__PURE__ */ (0,jsx_runtime.jsxs)( ColorModeProvider, { colorModeManager, options: theme.config, children: [ resetCSS ? /* @__PURE__ */ (0,jsx_runtime.jsx)(CSSReset, { scope: resetScope }) : /* @__PURE__ */ (0,jsx_runtime.jsx)(CSSPolyfill, {}), !disableGlobalStyle && /* @__PURE__ */ (0,jsx_runtime.jsx)(GlobalStyle, {}), portalZIndex ? /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalManager, { zIndex: portalZIndex, children: _children }) : _children ] } ) }); }; //# sourceMappingURL=chunk-3DDHO3UN.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-SIH73G3H.mjs // src/foundations/transition.ts 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 chunk_SIH73G3H_transition = { property: transitionProperty, easing: transitionTimingFunction, duration: transitionDuration }; var transition_default = chunk_SIH73G3H_transition; //# sourceMappingURL=chunk-SIH73G3H.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-45VJLTIL.mjs // src/foundations/z-index.ts 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 }; var z_index_default = zIndices; //# sourceMappingURL=chunk-45VJLTIL.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-B75T2J64.mjs // src/foundations/borders.ts var borders = { none: 0, "1px": "1px solid", "2px": "2px solid", "4px": "4px solid", "8px": "8px solid" }; var borders_default = borders; //# sourceMappingURL=chunk-B75T2J64.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-TXLFBUTF.mjs // src/foundations/breakpoints.ts var breakpoints = { base: "0em", sm: "30em", md: "48em", lg: "62em", xl: "80em", "2xl": "96em" }; var breakpoints_default = breakpoints; //# sourceMappingURL=chunk-TXLFBUTF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-E47HH2QS.mjs // src/foundations/colors.ts 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" }, linkedin: { 50: "#E8F4F9", 100: "#CFEDFB", 200: "#9BDAF3", 300: "#68C7EC", 400: "#34B3E4", 500: "#00A0DC", 600: "#008CC9", 700: "#0077B5", 800: "#005E93", 900: "#004471" }, facebook: { 50: "#E8F4F9", 100: "#D9DEE9", 200: "#B7C2DA", 300: "#6482C0", 400: "#4267B2", 500: "#385898", 600: "#314E89", 700: "#29487D", 800: "#223B67", 900: "#1E355B" }, messenger: { 50: "#D0E6FF", 100: "#B9DAFF", 200: "#A2CDFF", 300: "#7AB8FF", 400: "#2E90FF", 500: "#0078FF", 600: "#0063D1", 700: "#0052AC", 800: "#003C7E", 900: "#002C5C" }, whatsapp: { 50: "#dffeec", 100: "#b9f5d0", 200: "#90edb3", 300: "#65e495", 400: "#3cdd78", 500: "#22c35e", 600: "#179848", 700: "#0c6c33", 800: "#01421c", 900: "#001803" }, twitter: { 50: "#E5F4FD", 100: "#C8E9FB", 200: "#A8DCFA", 300: "#83CDF7", 400: "#57BBF5", 500: "#1DA1F2", 600: "#1A94DA", 700: "#1681BF", 800: "#136B9E", 900: "#0D4D71" }, telegram: { 50: "#E3F2F9", 100: "#C5E4F3", 200: "#A2D4EC", 300: "#7AC1E4", 400: "#47A9DA", 500: "#0088CC", 600: "#007AB8", 700: "#006BA1", 800: "#005885", 900: "#003F5E" } }; var colors_default = colors; //# sourceMappingURL=chunk-E47HH2QS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-VIVTPWHP.mjs // src/foundations/radius.ts 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" }; var radius_default = radii; //# sourceMappingURL=chunk-VIVTPWHP.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-IZUFFCXS.mjs // src/foundations/shadows.ts 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" }; var shadows_default = shadows; //# sourceMappingURL=chunk-IZUFFCXS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-HQ6WXDYV.mjs // src/foundations/blur.ts var chunk_HQ6WXDYV_blur = { none: 0, sm: "4px", base: "8px", md: "12px", lg: "16px", xl: "24px", "2xl": "40px", "3xl": "64px" }; var blur_default = chunk_HQ6WXDYV_blur; //# sourceMappingURL=chunk-HQ6WXDYV.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-6XA2KDUD.mjs // src/foundations/typography.ts var chunk_6XA2KDUD_typography = { 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" } }; var typography_default = chunk_6XA2KDUD_typography; //# sourceMappingURL=chunk-6XA2KDUD.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-V7WMN6TQ.mjs // src/foundations/spacing.ts 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" }; //# sourceMappingURL=chunk-V7WMN6TQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-NJCYBKFH.mjs // src/foundations/sizes.ts 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 }; var sizes_default = sizes; //# sourceMappingURL=chunk-NJCYBKFH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-3WO5B3NB.mjs // src/foundations/index.ts var foundations = { breakpoints: breakpoints_default, zIndices: z_index_default, radii: radius_default, blur: blur_default, colors: colors_default, ...typography_default, sizes: sizes_default, shadows: shadows_default, space: spacing, borders: borders_default, transition: transition_default }; //# sourceMappingURL=chunk-3WO5B3NB.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-Q5NOVGYN.mjs // src/components/stepper.ts var { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers([ "stepper", "step", "title", "description", "indicator", "separator", "icon", "number" ]); var $size = 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 baseStyle = definePartsStyle(({ 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: $size.reference, height: $size.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% - ${$size.reference} - 8px)`, top: `calc(${$size.reference} + 4px)`, insetStart: `calc(${$size.reference} / 2 - 1px)` } } })); var stepperTheme = defineMultiStyleConfig({ baseStyle, sizes: { xs: definePartsStyle({ stepper: { [$size.variable]: "sizes.4", [$iconSize.variable]: "sizes.3", [$titleFontSize.variable]: "fontSizes.xs", [$descFontSize.variable]: "fontSizes.xs" } }), sm: definePartsStyle({ stepper: { [$size.variable]: "sizes.6", [$iconSize.variable]: "sizes.4", [$titleFontSize.variable]: "fontSizes.sm", [$descFontSize.variable]: "fontSizes.xs" } }), md: definePartsStyle({ stepper: { [$size.variable]: "sizes.8", [$iconSize.variable]: "sizes.5", [$titleFontSize.variable]: "fontSizes.md", [$descFontSize.variable]: "fontSizes.sm" } }), lg: definePartsStyle({ stepper: { [$size.variable]: "sizes.10", [$iconSize.variable]: "sizes.6", [$titleFontSize.variable]: "fontSizes.lg", [$descFontSize.variable]: "fontSizes.md" } }) }, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-Q5NOVGYN.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/anatomy/dist/chunk-OA3DH5LS.mjs // src/anatomy.ts 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 classnames() { const value = Object.fromEntries( Object.entries(map).map(([key, part]) => [key, part.className]) ); return value; } function toPart(part) { const el = ["container", "root"].includes(part != null ? 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, get keys() { return Object.keys(map); }, __type }; } //# sourceMappingURL=chunk-OA3DH5LS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/anatomy/dist/chunk-7OOI6RFH.mjs // src/components.ts var accordionAnatomy = anatomy("accordion").parts("root", "container", "button", "panel").extend("icon"); var alertAnatomy = anatomy("alert").parts("title", "description", "container").extend("icon", "spinner"); var avatarAnatomy = anatomy("avatar").parts("label", "badge", "container").extend("excessLabel", "group"); var breadcrumbAnatomy = anatomy("breadcrumb").parts("link", "item", "container").extend("separator"); var buttonAnatomy = anatomy("button").parts(); var checkboxAnatomy = anatomy("checkbox").parts("control", "icon", "container").extend("label"); var circularProgressAnatomy = anatomy("progress").parts("track", "filledTrack").extend("label"); var drawerAnatomy = anatomy("drawer").parts("overlay", "dialogContainer", "dialog").extend("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").extend("groupTitle", "icon", "command", "divider"); var modalAnatomy = anatomy("modal").parts("overlay", "dialogContainer", "dialog").extend("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").extend("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" ); //# sourceMappingURL=chunk-7OOI6RFH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme-tools/dist/chunk-WSAJBJJ4.mjs // src/css-var.ts function isDecimal(value) { return !Number.isInteger(parseFloat(value.toString())); } function chunk_WSAJBJJ4_replaceWhiteSpace(value, replaceValue = "-") { return value.replace(/\s+/g, replaceValue); } function chunk_WSAJBJJ4_escape(value) { const valueStr = chunk_WSAJBJJ4_replaceWhiteSpace(value.toString()); if (valueStr.includes("\\.")) return value; return isDecimal(value) ? valueStr.replace(".", `\\.`) : value; } function chunk_WSAJBJJ4_addPrefix(value, prefix = "") { return [prefix, chunk_WSAJBJJ4_escape(value)].filter(Boolean).join("-"); } function toVarRef(name, fallback) { return `var(${chunk_WSAJBJJ4_escape(name)}${fallback ? `, ${fallback}` : ""})`; } function toVar(value, prefix = "") { return `--${chunk_WSAJBJJ4_addPrefix(value, prefix)}`; } function chunk_WSAJBJJ4_cssVar(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; } //# sourceMappingURL=chunk-WSAJBJJ4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme-tools/dist/chunk-XMZHFSTS.mjs // src/css-calc.ts 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 chunk_XMZHFSTS_add = (...operands) => `calc(${toExpr("+", ...operands)})`; var chunk_XMZHFSTS_subtract = (...operands) => `calc(${toExpr("-", ...operands)})`; var chunk_XMZHFSTS_multiply = (...operands) => `calc(${toExpr("*", ...operands)})`; var chunk_XMZHFSTS_divide = (...operands) => `calc(${toExpr("/", ...operands)})`; var chunk_XMZHFSTS_negate = (x) => { const value = toRef(x); if (value != null && !Number.isNaN(parseFloat(value))) { return String(value).startsWith("-") ? String(value).slice(1) : `-${value}`; } return chunk_XMZHFSTS_multiply(value, -1); }; var chunk_XMZHFSTS_calc = Object.assign( (x) => ({ add: (...operands) => chunk_XMZHFSTS_calc(chunk_XMZHFSTS_add(x, ...operands)), subtract: (...operands) => chunk_XMZHFSTS_calc(chunk_XMZHFSTS_subtract(x, ...operands)), multiply: (...operands) => chunk_XMZHFSTS_calc(chunk_XMZHFSTS_multiply(x, ...operands)), divide: (...operands) => chunk_XMZHFSTS_calc(chunk_XMZHFSTS_divide(x, ...operands)), negate: () => chunk_XMZHFSTS_calc(chunk_XMZHFSTS_negate(x)), toString: () => x.toString() }), { add: chunk_XMZHFSTS_add, subtract: chunk_XMZHFSTS_subtract, multiply: chunk_XMZHFSTS_multiply, divide: chunk_XMZHFSTS_divide, negate: chunk_XMZHFSTS_negate } ); //# sourceMappingURL=chunk-XMZHFSTS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-SG67NFYS.mjs // src/components/switch.ts var { defineMultiStyleConfig: chunk_SG67NFYS_defineMultiStyleConfig, definePartsStyle: chunk_SG67NFYS_definePartsStyle } = createMultiStyleConfigHelpers(switchAnatomy.keys); var $width = chunk_WSAJBJJ4_cssVar("switch-track-width"); var $height = chunk_WSAJBJJ4_cssVar("switch-track-height"); var $diff = chunk_WSAJBJJ4_cssVar("switch-track-diff"); var diffValue = chunk_XMZHFSTS_calc.subtract($width, $height); var $translateX = chunk_WSAJBJJ4_cssVar("switch-thumb-x"); var $bg = chunk_WSAJBJJ4_cssVar("switch-bg"); var baseStyleTrack = defineStyle((props) => { const { colorScheme: c } = props; return { borderRadius: "full", p: "0.5", width: [$width.reference], height: [$height.reference], transitionProperty: "common", transitionDuration: "fast", [$bg.variable]: "colors.gray.300", _dark: { [$bg.variable]: "colors.whiteAlpha.400" }, _focusVisible: { boxShadow: "outline" }, _disabled: { opacity: 0.4, cursor: "not-allowed" }, _checked: { [$bg.variable]: `colors.${c}.500`, _dark: { [$bg.variable]: `colors.${c}.200` } }, bg: $bg.reference }; }); var baseStyleThumb = defineStyle({ bg: "white", transitionProperty: "transform", transitionDuration: "normal", borderRadius: "inherit", width: [$height.reference], height: [$height.reference], _checked: { transform: `translateX(${$translateX.reference})` } }); var chunk_SG67NFYS_baseStyle = chunk_SG67NFYS_definePartsStyle((props) => ({ container: { [$diff.variable]: diffValue, [$translateX.variable]: $diff.reference, _rtl: { [$translateX.variable]: chunk_XMZHFSTS_calc($diff).negate().toString() } }, track: baseStyleTrack(props), thumb: baseStyleThumb })); var chunk_SG67NFYS_sizes = { sm: chunk_SG67NFYS_definePartsStyle({ container: { [$width.variable]: "1.375rem", [$height.variable]: "sizes.3" } }), md: chunk_SG67NFYS_definePartsStyle({ container: { [$width.variable]: "1.875rem", [$height.variable]: "sizes.4" } }), lg: chunk_SG67NFYS_definePartsStyle({ container: { [$width.variable]: "2.875rem", [$height.variable]: "sizes.6" } }) }; var switchTheme = chunk_SG67NFYS_defineMultiStyleConfig({ baseStyle: chunk_SG67NFYS_baseStyle, sizes: chunk_SG67NFYS_sizes, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-SG67NFYS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme-tools/dist/chunk-FNB7ZWWX.mjs // src/component.ts 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; } //# sourceMappingURL=chunk-FNB7ZWWX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-QWN3S45W.mjs // src/components/table.ts var { defineMultiStyleConfig: chunk_QWN3S45W_defineMultiStyleConfig, definePartsStyle: chunk_QWN3S45W_definePartsStyle } = createMultiStyleConfigHelpers(tableAnatomy.keys); var chunk_QWN3S45W_baseStyle = chunk_QWN3S45W_definePartsStyle({ 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 = chunk_QWN3S45W_definePartsStyle((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 = chunk_QWN3S45W_definePartsStyle((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 variants = { simple: variantSimple, striped: variantStripe, unstyled: defineStyle({}) }; var chunk_QWN3S45W_sizes = { sm: chunk_QWN3S45W_definePartsStyle({ 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: chunk_QWN3S45W_definePartsStyle({ th: { px: "6", py: "3", lineHeight: "4", fontSize: "xs" }, td: { px: "6", py: "4", lineHeight: "5" }, caption: { px: "6", py: "2", fontSize: "sm" } }), lg: chunk_QWN3S45W_definePartsStyle({ 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 = chunk_QWN3S45W_defineMultiStyleConfig({ baseStyle: chunk_QWN3S45W_baseStyle, variants, sizes: chunk_QWN3S45W_sizes, defaultProps: { variant: "simple", size: "md", colorScheme: "gray" } }); //# sourceMappingURL=chunk-QWN3S45W.mjs.map ;// CONCATENATED MODULE: ./node_modules/color2k/dist/index.exports.import.es.mjs /** * A simple guard function: * * ```js * Math.min(Math.max(low, value), high) * ``` */ function guard(low, high, value) { return Math.min(Math.max(low, value), high); } class ColorError extends Error { constructor(color) { super(`Failed to parse color: "${color}"`); } } var ColorError$1 = ColorError; /** * Parses a color into red, gree, blue, alpha parts * * @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color */ function parseToRgba(color) { if (typeof color !== 'string') throw new ColorError$1(color); if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0]; let normalizedColor = color.trim(); normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color; 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(color); if (guard(0, 100, l) !== l) throw new ColorError$1(color); return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a]; } throw new ColorError$1(color); } function index_exports_import_es_hash(str) { let hash = 5381; let i = str.length; while (i) { hash = hash * 33 ^ str.charCodeAt(--i); } /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed * integers. Since we want the results to be always positive, convert the * signed int to an unsigned by doing an unsigned bitshift. */ return (hash >>> 0) % 2341; } const colorToInt = x => parseInt(x.replace(/_/g, ''), 36); const 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, next) => { const key = colorToInt(next.substring(0, 3)); const hex = colorToInt(next.substring(3)).toString(16); // NOTE: padStart could be used here but it breaks Node 6 compat // https://github.com/ricokahler/color2k/issues/351 let prefix = ''; for (let i = 0; i < 6 - hex.length; i++) { prefix += '0'; } acc[key] = `${prefix}${hex}`; return acc; }, {}); /** * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color. */ function nameToHex(color) { const normalizedColorName = color.toLowerCase().trim(); const result = compressedColorMap[index_exports_import_es_hash(normalizedColorName)]; if (!result) throw new ColorError$1(color); return `#${result}`; } const r = (str, amount) => Array.from(Array(amount)).map(() => str).join(''); const reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i'); const hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i'); const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r(',\\s*(\\d+)\\s*', 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, 'i'); const hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i; const namedColorRegex = /^[a-z]+$/i; const roundColor = color => { return Math.round(color * 255); }; const hslToRgb = (hue, saturation, lightness) => { let l = lightness / 100; if (saturation === 0) { // achromatic return [l, l, l].map(roundColor); } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV 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); }; // taken from: /** * Parses a color in hue, saturation, lightness, and the alpha channel. * * Hue is a number between 0 and 360, saturation, lightness, and alpha are * decimal percentages between 0 and 1 */ function index_exports_import_es_parseToHsla(color) { const [red, green, blue, alpha] = parseToRgba(color).map((value, index) => // 3rd index is alpha channel which is already normalized index === 3 ? value : value / 255); const max = Math.max(red, green, blue); const min = Math.min(red, green, blue); const lightness = (max + min) / 2; // achromatic if (max === min) return [0, 0, lightness, alpha]; const delta = max - min; const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min); const hue = 60 * (red === max ? (green - blue) / delta + (green < blue ? 6 : 0) : green === max ? (blue - red) / delta + 2 : (red - green) / delta + 4); return [hue, saturation, lightness, alpha]; } /** * Takes in hsla parts and constructs an hsla string * * @param hue The color circle (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue * @param saturation Percentage of saturation, given as a decimal between 0 and 1 * @param lightness Percentage of lightness, given as a decimal between 0 and 1 * @param alpha Percentage of opacity, given as a decimal between 0 and 1 */ function index_exports_import_es_hsla(hue, saturation, lightness, alpha) { return `hsla(${(hue % 360).toFixed()}, ${guard(0, 100, saturation * 100).toFixed()}%, ${guard(0, 100, lightness * 100).toFixed()}%, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`; } /** * Adjusts the current hue of the color by the given degrees. Wraps around when * over 360. * * @param color input color * @param degrees degrees to adjust the input color, accepts degree integers * (0 - 360) and wraps around on overflow */ function adjustHue(color, degrees) { const [h, s, l, a] = index_exports_import_es_parseToHsla(color); return index_exports_import_es_hsla(h + degrees, s, l, a); } /** * Darkens using lightness. This is equivalent to subtracting the lightness * from the L in HSL. * * @param amount The amount to darken, given as a decimal between 0 and 1 */ function darken(color, amount) { const [hue, saturation, lightness, alpha] = index_exports_import_es_parseToHsla(color); return index_exports_import_es_hsla(hue, saturation, lightness - amount, alpha); } /** * Desaturates the input color by the given amount via subtracting from the `s` * in `hsla`. * * @param amount The amount to desaturate, given as a decimal between 0 and 1 */ function desaturate(color, amount) { const [h, s, l, a] = index_exports_import_es_parseToHsla(color); return index_exports_import_es_hsla(h, s - amount, l, a); } // taken from: // https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js /** * Returns a number (float) representing the luminance of a color. */ function index_exports_import_es_getLuminance(color) { if (color === 'transparent') return 0; function f(x) { const channel = x / 255; return channel <= 0.03928 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4); } const [r, g, b] = parseToRgba(color); return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b); } // taken from: /** * Returns the contrast ratio between two colors based on * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef). */ function index_exports_import_es_getContrast(color1, color2) { const luminance1 = index_exports_import_es_getLuminance(color1); const luminance2 = index_exports_import_es_getLuminance(color2); return luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05); } /** * Takes in rgba parts and returns an rgba string * * @param red The amount of red in the red channel, given in a number between 0 and 255 inclusive * @param green The amount of green in the red channel, given in a number between 0 and 255 inclusive * @param blue The amount of blue in the red channel, given in a number between 0 and 255 inclusive * @param alpha Percentage of opacity, given as a decimal between 0 and 1 */ function rgba(red, green, blue, alpha) { return `rgba(${guard(0, 255, red).toFixed()}, ${guard(0, 255, green).toFixed()}, ${guard(0, 255, blue).toFixed()}, ${parseFloat(guard(0, 1, alpha).toFixed(3))})`; } /** * Mixes two colors together. Taken from sass's implementation. */ function index_exports_import_es_mix(color1, color2, weight) { const normalize = (n, index) => // 3rd index is alpha channel which is already normalized index === 3 ? n : n / 255; const [r1, g1, b1, a1] = parseToRgba(color1).map(normalize); const [r2, g2, b2, a2] = parseToRgba(color2).map(normalize); // The formula is copied from the original Sass implementation: // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method const alphaDelta = a2 - a1; const normalizedWeight = weight * 2 - 1; const combinedWeight = normalizedWeight * alphaDelta === -1 ? normalizedWeight : normalizedWeight + alphaDelta / (1 + normalizedWeight * alphaDelta); const weight2 = (combinedWeight + 1) / 2; const weight1 = 1 - weight2; const r = (r1 * weight1 + r2 * weight2) * 255; const g = (g1 * weight1 + g2 * weight2) * 255; const b = (b1 * weight1 + b2 * weight2) * 255; const a = a2 * weight + a1 * (1 - weight); return rgba(r, g, b, a); } /** * Given a series colors, this function will return a `scale(x)` function that * accepts a percentage as a decimal between 0 and 1 and returns the color at * that percentage in the scale. * * ```js * const scale = getScale('red', 'yellow', 'green'); * console.log(scale(0)); // rgba(255, 0, 0, 1) * console.log(scale(0.5)); // rgba(255, 255, 0, 1) * console.log(scale(1)); // rgba(0, 128, 0, 1) * ``` * * If you'd like to limit the domain and range like chroma-js, we recommend * wrapping scale again. * * ```js * const _scale = getScale('red', 'yellow', 'green'); * const scale = x => _scale(x / 100); * * console.log(scale(0)); // rgba(255, 0, 0, 1) * console.log(scale(50)); // rgba(255, 255, 0, 1) * console.log(scale(100)); // rgba(0, 128, 0, 1) * ``` */ function getScale(...colors) { return n => { const lastIndex = colors.length - 1; const lowIndex = guard(0, lastIndex, Math.floor(n * lastIndex)); const highIndex = guard(0, lastIndex, Math.ceil(n * lastIndex)); const color1 = colors[lowIndex]; const color2 = colors[highIndex]; const unit = 1 / lastIndex; const weight = (n - unit * lowIndex) / unit; return index_exports_import_es_mix(color1, color2, weight); }; } const guidelines = { decorative: 1.5, readable: 3, aa: 4.5, aaa: 7 }; /** * Returns whether or not a color has bad contrast against a background * according to a given standard. */ function hasBadContrast(color, standard = 'aa', background = '#fff') { return index_exports_import_es_getContrast(color, background) < guidelines[standard]; } /** * Lightens a color by a given amount. This is equivalent to * `darken(color, -amount)` * * @param amount The amount to darken, given as a decimal between 0 and 1 */ function lighten(color, amount) { return darken(color, -amount); } /** * Takes in a color and makes it more transparent by convert to `rgba` and * decreasing the amount in the alpha channel. * * @param amount The amount to increase the transparency by, given as a decimal between 0 and 1 */ function transparentize(color, amount) { const [r, g, b, a] = parseToRgba(color); return rgba(r, g, b, a - amount); } /** * Takes a color and un-transparentizes it. Equivalent to * `transparentize(color, -amount)` * * @param amount The amount to increase the opacity by, given as a decimal between 0 and 1 */ function opacify(color, amount) { return transparentize(color, -amount); } /** * An alternative function to `readableColor`. Returns whether or not the * readable color (i.e. the color to be place on top the input color) should be * black. */ function readableColorIsBlack(color) { return index_exports_import_es_getLuminance(color) > 0.179; } /** * Returns black or white for best contrast depending on the luminosity of the * given color. */ function readableColor(color) { return readableColorIsBlack(color) ? '#000' : '#fff'; } /** * Saturates a color by converting it to `hsl` and increasing the saturation * amount. Equivalent to `desaturate(color, -amount)` * * @param color Input color * @param amount The amount to darken, given as a decimal between 0 and 1 */ function saturate(color, amount) { return desaturate(color, -amount); } /** * Takes in any color and returns it as a hex code. */ function index_exports_import_es_toHex(color) { const [r, g, b, a] = parseToRgba(color); let hex = x => { const h = guard(0, 255, x).toString(16); // NOTE: padStart could be used here but it breaks Node 6 compat // https://github.com/ricokahler/color2k/issues/351 return h.length === 1 ? `0${h}` : h; }; return `#${hex(r)}${hex(g)}${hex(b)}${a < 1 ? hex(Math.round(a * 255)) : ''}`; } /** * Takes in any color and returns it as an rgba string. */ function toRgba(color) { return rgba(...parseToRgba(color)); } /** * Takes in any color and returns it as an hsla string. */ function toHsla(color) { return index_exports_import_es_hsla(...index_exports_import_es_parseToHsla(color)); } //# sourceMappingURL=index.exports.import.es.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme-tools/dist/chunk-6IC2I3BY.mjs // src/color.ts // ../../../node_modules/.pnpm/dlv@1.1.3/node_modules/dlv/dist/dlv.es.js function dlv_es_default(t, e, l, n, r) { for (e = e.split ? e.split(".") : e, n = 0; n < e.length; n++) t = t ? t[e[n]] : r; return t === r ? l : t; } // src/color.ts var chunk_6IC2I3BY_isEmptyObject = (obj) => Object.keys(obj).length === 0; var getColor = (theme, color, fallback) => { const hex = dlv_es_default(theme, `colors.${color}`, color); try { index_exports_import_es_toHex(hex); return hex; } catch { return fallback != null ? fallback : "#000000"; } }; var getColorVar = (theme, color, fallback) => { var _a; return (_a = getCSSVar(theme, "colors", color)) != null ? _a : fallback; }; var getBrightness = (color) => { const [r, g, b] = parseToRgba(color); return (r * 299 + g * 587 + b * 114) / 1e3; }; var tone = (color) => (theme) => { const hex = getColor(theme, color); const brightness = getBrightness(hex); const isDark2 = brightness < 128; return isDark2 ? "dark" : "light"; }; var isDark = (color) => (theme) => tone(color)(theme) === "dark"; var isLight = (color) => (theme) => tone(color)(theme) === "light"; var chunk_6IC2I3BY_transparentize = (color, opacity) => (theme) => { const raw = getColor(theme, color); return transparentize(raw, 1 - opacity); }; var whiten = (color, amount) => (theme) => { const raw = getColor(theme, color); return toHex(mix(raw, "#fff", amount)); }; var blacken = (color, amount) => (theme) => { const raw = getColor(theme, color); return toHex(mix(raw, "#000", amount / 100)); }; var chunk_6IC2I3BY_darken = (color, amount) => (theme) => { const raw = getColor(theme, color); return toHex(reduceLightness(raw, amount / 100)); }; var chunk_6IC2I3BY_lighten = (color, amount) => (theme) => { const raw = getColor(theme, color); toHex(increaseLightness(raw, amount / 100)); }; var contrast = (fg, bg) => (theme) => getContrast(getColor(theme, bg), getColor(theme, fg)); var isAccessible = (textColor, bgColor, options) => (theme) => isReadable(getColor(theme, bgColor), getColor(theme, textColor), options); function isReadable(color1, color2, wcag2 = { level: "AA", size: "small" }) { var _a, _b; const readabilityLevel = readability(color1, color2); switch (((_a = wcag2.level) != null ? _a : "AA") + ((_b = wcag2.size) != null ? _b : "small")) { case "AAsmall": case "AAAlarge": return readabilityLevel >= 4.5; case "AAlarge": return readabilityLevel >= 3; case "AAAsmall": return readabilityLevel >= 7; default: return false; } } function readability(color1, color2) { return (Math.max(getLuminance(color1), getLuminance(color2)) + 0.05) / (Math.min(getLuminance(color1), getLuminance(color2)) + 0.05); } var complementary = (color) => (theme) => { const raw = getColor(theme, color); const hsl = parseToHsla(raw); const complementHsl = Object.assign(hsl, [ (hsl[0] + 180) % 360 ]); return toHex(hsla(...complementHsl)); }; function generateStripe(size = "1rem", color = "rgba(255, 255, 255, 0.15)") { return { backgroundImage: `linear-gradient( 45deg, ${color} 25%, transparent 25%, transparent 50%, ${color} 50%, ${color} 75%, transparent 75%, transparent )`, backgroundSize: `${size} ${size}` }; } var randomHex = () => `#${Math.floor(Math.random() * 16777215).toString(16).padEnd(6, "0")}`; function randomColor(opts) { const fallback = randomHex(); if (!opts || chunk_6IC2I3BY_isEmptyObject(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 hash = 0; if (str.length === 0) return hash.toString(); for (let i = 0; i < str.length; i += 1) { hash = str.charCodeAt(i) + ((hash << 5) - hash); hash = hash & hash; } let color = "#"; for (let j = 0; j < 3; j += 1) { const value = hash >> j * 8 & 255; color += `00${value.toString(16)}`.substr(-2); } return color; } function randomColorFromList(str, list) { let index = 0; if (str.length === 0) return list[0]; for (let i = 0; i < str.length; i += 1) { index = str.charCodeAt(i) + ((index << 5) - index); index = index & index; } index = (index % list.length + list.length) % list.length; return list[index]; } function randomFromList(list) { return list[Math.floor(Math.random() * list.length)]; } //# sourceMappingURL=chunk-6IC2I3BY.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-GYISOX2E.mjs // src/components/tabs.ts var $fg = cssVar("tabs-color"); var chunk_GYISOX2E_$bg = cssVar("tabs-bg"); var $border = cssVar("tabs-border-color"); var { defineMultiStyleConfig: chunk_GYISOX2E_defineMultiStyleConfig, definePartsStyle: chunk_GYISOX2E_definePartsStyle } = createMultiStyleConfigHelpers(tabsAnatomy.keys); var baseStyleRoot = 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 chunk_GYISOX2E_baseStyle = chunk_GYISOX2E_definePartsStyle((props) => ({ root: baseStyleRoot(props), tab: baseStyleTab(props), tablist: baseStyleTablist(props), tabpanel: baseStyleTabpanel })); var chunk_GYISOX2E_sizes = { sm: chunk_GYISOX2E_definePartsStyle({ tab: { py: 1, px: 4, fontSize: "sm" } }), md: chunk_GYISOX2E_definePartsStyle({ tab: { fontSize: "md", py: 2, px: 4 } }), lg: chunk_GYISOX2E_definePartsStyle({ tab: { fontSize: "lg", py: 3, px: 4 } }) }; var variantLine = chunk_GYISOX2E_definePartsStyle((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: { [$fg.variable]: `colors.${c}.600`, _dark: { [$fg.variable]: `colors.${c}.300` }, borderColor: "currentColor" }, _active: { [chunk_GYISOX2E_$bg.variable]: "colors.gray.200", _dark: { [chunk_GYISOX2E_$bg.variable]: "colors.whiteAlpha.300" } }, _disabled: { _active: { bg: "none" } }, color: $fg.reference, bg: chunk_GYISOX2E_$bg.reference } }; }); var variantEnclosed = chunk_GYISOX2E_definePartsStyle((props) => { const { colorScheme: c } = props; return { tab: { borderTopRadius: "md", border: "1px solid", borderColor: "transparent", mb: "-1px", [$border.variable]: "transparent", _selected: { [$fg.variable]: `colors.${c}.600`, [$border.variable]: `colors.white`, _dark: { [$fg.variable]: `colors.${c}.300`, [$border.variable]: `colors.gray.800` }, borderColor: "inherit", borderBottomColor: $border.reference }, color: $fg.reference }, tablist: { mb: "-1px", borderBottom: "1px solid", borderColor: "inherit" } }; }); var variantEnclosedColored = chunk_GYISOX2E_definePartsStyle((props) => { const { colorScheme: c } = props; return { tab: { border: "1px solid", borderColor: "inherit", [chunk_GYISOX2E_$bg.variable]: "colors.gray.50", _dark: { [chunk_GYISOX2E_$bg.variable]: "colors.whiteAlpha.50" }, mb: "-1px", _notLast: { marginEnd: "-1px" }, _selected: { [chunk_GYISOX2E_$bg.variable]: "colors.white", [$fg.variable]: `colors.${c}.600`, _dark: { [chunk_GYISOX2E_$bg.variable]: "colors.gray.800", [$fg.variable]: `colors.${c}.300` }, borderColor: "inherit", borderTopColor: "currentColor", borderBottomColor: "transparent" }, color: $fg.reference, bg: chunk_GYISOX2E_$bg.reference }, tablist: { mb: "-1px", borderBottom: "1px solid", borderColor: "inherit" } }; }); var variantSoftRounded = chunk_GYISOX2E_definePartsStyle((props) => { const { colorScheme: c, theme } = props; return { tab: { borderRadius: "full", fontWeight: "semibold", color: "gray.600", _selected: { color: getColor(theme, `${c}.700`), bg: getColor(theme, `${c}.100`) } } }; }); var variantSolidRounded = chunk_GYISOX2E_definePartsStyle((props) => { const { colorScheme: c } = props; return { tab: { borderRadius: "full", fontWeight: "semibold", [$fg.variable]: "colors.gray.600", _dark: { [$fg.variable]: "inherit" }, _selected: { [$fg.variable]: "colors.white", [chunk_GYISOX2E_$bg.variable]: `colors.${c}.600`, _dark: { [$fg.variable]: "colors.gray.800", [chunk_GYISOX2E_$bg.variable]: `colors.${c}.300` } }, color: $fg.reference, bg: chunk_GYISOX2E_$bg.reference } }; }); var variantUnstyled = chunk_GYISOX2E_definePartsStyle({}); var chunk_GYISOX2E_variants = { line: variantLine, enclosed: variantEnclosed, "enclosed-colored": variantEnclosedColored, "soft-rounded": variantSoftRounded, "solid-rounded": variantSolidRounded, unstyled: variantUnstyled }; var tabsTheme = chunk_GYISOX2E_defineMultiStyleConfig({ baseStyle: chunk_GYISOX2E_baseStyle, sizes: chunk_GYISOX2E_sizes, variants: chunk_GYISOX2E_variants, defaultProps: { size: "md", variant: "line", colorScheme: "blue" } }); //# sourceMappingURL=chunk-GYISOX2E.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-ZQMLTFF3.mjs // src/components/badge.ts var vars = defineCssVars("badge", ["bg", "color", "shadow"]); var chunk_ZQMLTFF3_baseStyle = defineStyle({ px: 1, textTransform: "uppercase", fontSize: "xs", borderRadius: "sm", fontWeight: "bold", bg: vars.bg.reference, color: vars.color.reference, boxShadow: vars.shadow.reference }); var variantSolid = defineStyle((props) => { const { colorScheme: c, theme } = props; const dark = chunk_6IC2I3BY_transparentize(`${c}.500`, 0.6)(theme); return { [vars.bg.variable]: `colors.${c}.500`, [vars.color.variable]: `colors.white`, _dark: { [vars.bg.variable]: dark, [vars.color.variable]: `colors.whiteAlpha.800` } }; }); var variantSubtle = defineStyle((props) => { const { colorScheme: c, theme } = props; const darkBg = chunk_6IC2I3BY_transparentize(`${c}.200`, 0.16)(theme); 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 } = props; const darkColor = chunk_6IC2I3BY_transparentize(`${c}.200`, 0.8)(theme); return { [vars.color.variable]: `colors.${c}.500`, _dark: { [vars.color.variable]: darkColor }, [vars.shadow.variable]: `inset 0 0 0px 1px ${vars.color.reference}` }; }); var chunk_ZQMLTFF3_variants = { solid: variantSolid, subtle: variantSubtle, outline: variantOutline }; var badgeTheme = defineStyleConfig({ baseStyle: chunk_ZQMLTFF3_baseStyle, variants: chunk_ZQMLTFF3_variants, defaultProps: { variant: "subtle", colorScheme: "gray" } }); //# sourceMappingURL=chunk-ZQMLTFF3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-7RVLYCMR.mjs // src/components/tag.ts var { defineMultiStyleConfig: chunk_7RVLYCMR_defineMultiStyleConfig, definePartsStyle: chunk_7RVLYCMR_definePartsStyle } = createMultiStyleConfigHelpers(tagAnatomy.keys); var chunk_7RVLYCMR_$bg = cssVar("tag-bg"); var $color = cssVar("tag-color"); var $shadow = cssVar("tag-shadow"); var $minH = cssVar("tag-min-height"); var $minW = cssVar("tag-min-width"); var $fontSize = cssVar("tag-font-size"); var $paddingX = cssVar("tag-padding-inline"); var baseStyleContainer = defineStyle({ fontWeight: "medium", lineHeight: 1.2, outline: 0, [$color.variable]: vars.color.reference, [chunk_7RVLYCMR_$bg.variable]: vars.bg.reference, [$shadow.variable]: vars.shadow.reference, color: $color.reference, bg: chunk_7RVLYCMR_$bg.reference, boxShadow: $shadow.reference, borderRadius: "md", minH: $minH.reference, minW: $minW.reference, fontSize: $fontSize.reference, px: $paddingX.reference, _focusVisible: { [$shadow.variable]: "shadows.outline" } }); var baseStyleLabel = defineStyle({ lineHeight: 1.2, overflow: "visible" }); var baseStyleCloseButton = 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 chunk_7RVLYCMR_baseStyle = chunk_7RVLYCMR_definePartsStyle({ container: baseStyleContainer, label: baseStyleLabel, closeButton: baseStyleCloseButton }); var chunk_7RVLYCMR_sizes = { sm: chunk_7RVLYCMR_definePartsStyle({ container: { [$minH.variable]: "sizes.5", [$minW.variable]: "sizes.5", [$fontSize.variable]: "fontSizes.xs", [$paddingX.variable]: "space.2" }, closeButton: { marginEnd: "-2px", marginStart: "0.35rem" } }), md: chunk_7RVLYCMR_definePartsStyle({ container: { [$minH.variable]: "sizes.6", [$minW.variable]: "sizes.6", [$fontSize.variable]: "fontSizes.sm", [$paddingX.variable]: "space.2" } }), lg: chunk_7RVLYCMR_definePartsStyle({ container: { [$minH.variable]: "sizes.8", [$minW.variable]: "sizes.8", [$fontSize.variable]: "fontSizes.md", [$paddingX.variable]: "space.3" } }) }; var chunk_7RVLYCMR_variants = { subtle: chunk_7RVLYCMR_definePartsStyle((props) => { var _a; return { container: (_a = badgeTheme.variants) == null ? void 0 : _a.subtle(props) }; }), solid: chunk_7RVLYCMR_definePartsStyle((props) => { var _a; return { container: (_a = badgeTheme.variants) == null ? void 0 : _a.solid(props) }; }), outline: chunk_7RVLYCMR_definePartsStyle((props) => { var _a; return { container: (_a = badgeTheme.variants) == null ? void 0 : _a.outline(props) }; }) }; var tagTheme = chunk_7RVLYCMR_defineMultiStyleConfig({ variants: chunk_7RVLYCMR_variants, baseStyle: chunk_7RVLYCMR_baseStyle, sizes: chunk_7RVLYCMR_sizes, defaultProps: { size: "md", variant: "subtle", colorScheme: "gray" } }); //# sourceMappingURL=chunk-7RVLYCMR.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-ICL3HPTT.mjs // src/components/input.ts var { definePartsStyle: chunk_ICL3HPTT_definePartsStyle, defineMultiStyleConfig: chunk_ICL3HPTT_defineMultiStyleConfig } = createMultiStyleConfigHelpers(inputAnatomy.keys); var chunk_ICL3HPTT_$height = cssVar("input-height"); var chunk_ICL3HPTT_$fontSize = cssVar("input-font-size"); var $padding = cssVar("input-padding"); var $borderRadius = cssVar("input-border-radius"); var chunk_ICL3HPTT_baseStyle = chunk_ICL3HPTT_definePartsStyle({ addon: { height: chunk_ICL3HPTT_$height.reference, fontSize: chunk_ICL3HPTT_$fontSize.reference, px: $padding.reference, borderRadius: $borderRadius.reference }, field: { width: "100%", height: chunk_ICL3HPTT_$height.reference, fontSize: chunk_ICL3HPTT_$fontSize.reference, px: $padding.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({ [chunk_ICL3HPTT_$fontSize.variable]: "fontSizes.lg", [$padding.variable]: "space.4", [$borderRadius.variable]: "radii.md", [chunk_ICL3HPTT_$height.variable]: "sizes.12" }), md: defineStyle({ [chunk_ICL3HPTT_$fontSize.variable]: "fontSizes.md", [$padding.variable]: "space.4", [$borderRadius.variable]: "radii.md", [chunk_ICL3HPTT_$height.variable]: "sizes.10" }), sm: defineStyle({ [chunk_ICL3HPTT_$fontSize.variable]: "fontSizes.sm", [$padding.variable]: "space.3", [$borderRadius.variable]: "radii.sm", [chunk_ICL3HPTT_$height.variable]: "sizes.8" }), xs: defineStyle({ [chunk_ICL3HPTT_$fontSize.variable]: "fontSizes.xs", [$padding.variable]: "space.2", [$borderRadius.variable]: "radii.sm", [chunk_ICL3HPTT_$height.variable]: "sizes.6" }) }; var chunk_ICL3HPTT_sizes = { lg: chunk_ICL3HPTT_definePartsStyle({ field: size.lg, group: size.lg }), md: chunk_ICL3HPTT_definePartsStyle({ field: size.md, group: size.md }), sm: chunk_ICL3HPTT_definePartsStyle({ field: size.sm, group: size.sm }), xs: chunk_ICL3HPTT_definePartsStyle({ 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 chunk_ICL3HPTT_variantOutline = chunk_ICL3HPTT_definePartsStyle((props) => { const { theme } = 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(theme, ec), boxShadow: `0 0 0 1px ${getColor(theme, ec)}` }, _focusVisible: { zIndex: 1, borderColor: getColor(theme, fc), boxShadow: `0 0 0 1px ${getColor(theme, fc)}` } }, addon: { border: "1px solid", borderColor: mode("inherit", "whiteAlpha.50")(props), bg: mode("gray.100", "whiteAlpha.300")(props) } }; }); var variantFilled = chunk_ICL3HPTT_definePartsStyle((props) => { const { theme } = 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(theme, ec) }, _focusVisible: { bg: "transparent", borderColor: getColor(theme, fc) } }, addon: { border: "2px solid", borderColor: "transparent", bg: mode("gray.100", "whiteAlpha.50")(props) } }; }); var variantFlushed = chunk_ICL3HPTT_definePartsStyle((props) => { const { theme } = 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(theme, ec), boxShadow: `0px 1px 0px 0px ${getColor(theme, ec)}` }, _focusVisible: { borderColor: getColor(theme, fc), boxShadow: `0px 1px 0px 0px ${getColor(theme, fc)}` } }, addon: { borderBottom: "2px solid", borderColor: "inherit", borderRadius: "0", px: "0", bg: "transparent" } }; }); var chunk_ICL3HPTT_variantUnstyled = chunk_ICL3HPTT_definePartsStyle({ field: { bg: "transparent", px: "0", height: "auto" }, addon: { bg: "transparent", px: "0", height: "auto" } }); var chunk_ICL3HPTT_variants = { outline: chunk_ICL3HPTT_variantOutline, filled: variantFilled, flushed: variantFlushed, unstyled: chunk_ICL3HPTT_variantUnstyled }; var inputTheme = chunk_ICL3HPTT_defineMultiStyleConfig({ baseStyle: chunk_ICL3HPTT_baseStyle, sizes: chunk_ICL3HPTT_sizes, variants: chunk_ICL3HPTT_variants, defaultProps: { size: "md", variant: "outline" } }); //# sourceMappingURL=chunk-ICL3HPTT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-KJ26FGJD.mjs // src/components/textarea.ts var _a; var chunk_KJ26FGJD_baseStyle = defineStyle({ ...(_a = inputTheme.baseStyle) == null ? void 0 : _a.field, paddingY: "2", minHeight: "20", lineHeight: "short", verticalAlign: "top" }); var _a2, _b; var chunk_KJ26FGJD_variants = { outline: defineStyle( (props) => { var _a4, _b3; return (_b3 = (_a4 = inputTheme.variants) == null ? void 0 : _a4.outline(props).field) != null ? _b3 : {}; } ), flushed: defineStyle( (props) => { var _a4, _b3; return (_b3 = (_a4 = inputTheme.variants) == null ? void 0 : _a4.flushed(props).field) != null ? _b3 : {}; } ), filled: defineStyle( (props) => { var _a4, _b3; return (_b3 = (_a4 = inputTheme.variants) == null ? void 0 : _a4.filled(props).field) != null ? _b3 : {}; } ), unstyled: (_b = (_a2 = inputTheme.variants) == null ? void 0 : _a2.unstyled.field) != null ? _b : {} }; var _a3, _b2, _c, _d, _e, _f, _g, _h; var chunk_KJ26FGJD_sizes = { xs: (_b2 = (_a3 = inputTheme.sizes) == null ? void 0 : _a3.xs.field) != null ? _b2 : {}, sm: (_d = (_c = inputTheme.sizes) == null ? void 0 : _c.sm.field) != null ? _d : {}, md: (_f = (_e = inputTheme.sizes) == null ? void 0 : _e.md.field) != null ? _f : {}, lg: (_h = (_g = inputTheme.sizes) == null ? void 0 : _g.lg.field) != null ? _h : {} }; var textareaTheme = defineStyleConfig({ baseStyle: chunk_KJ26FGJD_baseStyle, sizes: chunk_KJ26FGJD_sizes, variants: chunk_KJ26FGJD_variants, defaultProps: { size: "md", variant: "outline" } }); //# sourceMappingURL=chunk-KJ26FGJD.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-R7ZISUMV.mjs // src/components/tooltip.ts var chunk_R7ZISUMV_$bg = chunk_WSAJBJJ4_cssVar("tooltip-bg"); var chunk_R7ZISUMV_$fg = chunk_WSAJBJJ4_cssVar("tooltip-fg"); var $arrowBg = chunk_WSAJBJJ4_cssVar("popper-arrow-bg"); var chunk_R7ZISUMV_baseStyle = defineStyle({ bg: chunk_R7ZISUMV_$bg.reference, color: chunk_R7ZISUMV_$fg.reference, [chunk_R7ZISUMV_$bg.variable]: "colors.gray.700", [chunk_R7ZISUMV_$fg.variable]: "colors.whiteAlpha.900", _dark: { [chunk_R7ZISUMV_$bg.variable]: "colors.gray.300", [chunk_R7ZISUMV_$fg.variable]: "colors.gray.900" }, [$arrowBg.variable]: chunk_R7ZISUMV_$bg.reference, px: "2", py: "0.5", borderRadius: "sm", fontWeight: "medium", fontSize: "sm", boxShadow: "md", maxW: "xs", zIndex: "tooltip" }); var tooltipTheme = defineStyleConfig({ baseStyle: chunk_R7ZISUMV_baseStyle }); //# sourceMappingURL=chunk-R7ZISUMV.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-37MNRBP2.mjs // src/components/progress.ts var { defineMultiStyleConfig: chunk_37MNRBP2_defineMultiStyleConfig, definePartsStyle: chunk_37MNRBP2_definePartsStyle } = createMultiStyleConfigHelpers(progressAnatomy.keys); var filledStyle = defineStyle((props) => { const { colorScheme: c, theme: t, 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(t, bgColor)} 50%, transparent 100% )`; const addStripe = !isIndeterminate && hasStripe; return { ...addStripe && stripeStyle, ...isIndeterminate ? { bgImage: gradient } : { bgColor } }; }); var chunk_37MNRBP2_baseStyleLabel = defineStyle({ lineHeight: "1", fontSize: "0.25em", fontWeight: "bold", color: "white" }); var chunk_37MNRBP2_baseStyleTrack = defineStyle((props) => { return { bg: mode("gray.100", "whiteAlpha.300")(props) }; }); var baseStyleFilledTrack = defineStyle((props) => { return { transitionProperty: "common", transitionDuration: "slow", ...filledStyle(props) }; }); var chunk_37MNRBP2_baseStyle = chunk_37MNRBP2_definePartsStyle((props) => ({ label: chunk_37MNRBP2_baseStyleLabel, filledTrack: baseStyleFilledTrack(props), track: chunk_37MNRBP2_baseStyleTrack(props) })); var chunk_37MNRBP2_sizes = { xs: chunk_37MNRBP2_definePartsStyle({ track: { h: "1" } }), sm: chunk_37MNRBP2_definePartsStyle({ track: { h: "2" } }), md: chunk_37MNRBP2_definePartsStyle({ track: { h: "3" } }), lg: chunk_37MNRBP2_definePartsStyle({ track: { h: "4" } }) }; var progressTheme = chunk_37MNRBP2_defineMultiStyleConfig({ sizes: chunk_37MNRBP2_sizes, baseStyle: chunk_37MNRBP2_baseStyle, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-37MNRBP2.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-UV3F75RF.mjs // src/utils/run-if-fn.ts var chunk_UV3F75RF_isFunction = (value) => typeof value === "function"; function chunk_UV3F75RF_runIfFn(valueOrFn, ...args) { return chunk_UV3F75RF_isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn; } //# sourceMappingURL=chunk-UV3F75RF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-XHYVH6UO.mjs // src/components/checkbox.ts var { definePartsStyle: chunk_XHYVH6UO_definePartsStyle, defineMultiStyleConfig: chunk_XHYVH6UO_defineMultiStyleConfig } = createMultiStyleConfigHelpers(checkboxAnatomy.keys); var chunk_XHYVH6UO_$size = cssVar("checkbox-size"); var baseStyleControl = defineStyle((props) => { const { colorScheme: c } = props; return { w: chunk_XHYVH6UO_$size.reference, h: chunk_XHYVH6UO_$size.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 chunk_XHYVH6UO_baseStyleContainer = defineStyle({ _disabled: { cursor: "not-allowed" } }); var chunk_XHYVH6UO_baseStyleLabel = defineStyle({ userSelect: "none", _disabled: { opacity: 0.4 } }); var baseStyleIcon = defineStyle({ transitionProperty: "transform", transitionDuration: "normal" }); var chunk_XHYVH6UO_baseStyle = chunk_XHYVH6UO_definePartsStyle((props) => ({ icon: baseStyleIcon, container: chunk_XHYVH6UO_baseStyleContainer, control: chunk_UV3F75RF_runIfFn(baseStyleControl, props), label: chunk_XHYVH6UO_baseStyleLabel })); var chunk_XHYVH6UO_sizes = { sm: chunk_XHYVH6UO_definePartsStyle({ control: { [chunk_XHYVH6UO_$size.variable]: "sizes.3" }, label: { fontSize: "sm" }, icon: { fontSize: "3xs" } }), md: chunk_XHYVH6UO_definePartsStyle({ control: { [chunk_XHYVH6UO_$size.variable]: "sizes.4" }, label: { fontSize: "md" }, icon: { fontSize: "2xs" } }), lg: chunk_XHYVH6UO_definePartsStyle({ control: { [chunk_XHYVH6UO_$size.variable]: "sizes.5" }, label: { fontSize: "lg" }, icon: { fontSize: "2xs" } }) }; var checkboxTheme = chunk_XHYVH6UO_defineMultiStyleConfig({ baseStyle: chunk_XHYVH6UO_baseStyle, sizes: chunk_XHYVH6UO_sizes, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-XHYVH6UO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-VZUATZ4E.mjs // src/components/radio.ts var { defineMultiStyleConfig: chunk_VZUATZ4E_defineMultiStyleConfig, definePartsStyle: chunk_VZUATZ4E_definePartsStyle } = createMultiStyleConfigHelpers(radioAnatomy.keys); var chunk_VZUATZ4E_baseStyleControl = defineStyle((props) => { var _a; const controlStyle = (_a = chunk_UV3F75RF_runIfFn(checkboxTheme.baseStyle, props)) == null ? void 0 : _a.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 chunk_VZUATZ4E_baseStyle = chunk_VZUATZ4E_definePartsStyle((props) => { var _a, _b, _c, _d; return { label: (_b = (_a = checkboxTheme).baseStyle) == null ? void 0 : _b.call(_a, props).label, container: (_d = (_c = checkboxTheme).baseStyle) == null ? void 0 : _d.call(_c, props).container, control: chunk_VZUATZ4E_baseStyleControl(props) }; }); var chunk_VZUATZ4E_sizes = { md: chunk_VZUATZ4E_definePartsStyle({ control: { w: "4", h: "4" }, label: { fontSize: "md" } }), lg: chunk_VZUATZ4E_definePartsStyle({ control: { w: "5", h: "5" }, label: { fontSize: "lg" } }), sm: chunk_VZUATZ4E_definePartsStyle({ control: { width: "3", height: "3" }, label: { fontSize: "sm" } }) }; var radioTheme = chunk_VZUATZ4E_defineMultiStyleConfig({ baseStyle: chunk_VZUATZ4E_baseStyle, sizes: chunk_VZUATZ4E_sizes, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-VZUATZ4E.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-NNA4E64A.mjs // src/components/select.ts var { defineMultiStyleConfig: chunk_NNA4E64A_defineMultiStyleConfig, definePartsStyle: chunk_NNA4E64A_definePartsStyle } = createMultiStyleConfigHelpers(selectAnatomy.keys); var chunk_NNA4E64A_$bg = cssVar("select-bg"); var chunk_NNA4E64A_a; var baseStyleField = defineStyle({ ...(chunk_NNA4E64A_a = inputTheme.baseStyle) == null ? void 0 : chunk_NNA4E64A_a.field, appearance: "none", paddingBottom: "1px", lineHeight: "normal", bg: chunk_NNA4E64A_$bg.reference, [chunk_NNA4E64A_$bg.variable]: "colors.white", _dark: { [chunk_NNA4E64A_$bg.variable]: "colors.gray.700" }, "> option, > optgroup": { bg: chunk_NNA4E64A_$bg.reference } }); var chunk_NNA4E64A_baseStyleIcon = defineStyle({ width: "6", height: "100%", insetEnd: "2", position: "relative", color: "currentColor", fontSize: "xl", _disabled: { opacity: 0.5 } }); var chunk_NNA4E64A_baseStyle = chunk_NNA4E64A_definePartsStyle({ field: baseStyleField, icon: chunk_NNA4E64A_baseStyleIcon }); var iconSpacing = defineStyle({ paddingInlineEnd: "8" }); var chunk_NNA4E64A_a2, chunk_NNA4E64A_b, chunk_NNA4E64A_c, chunk_NNA4E64A_d, chunk_NNA4E64A_e, chunk_NNA4E64A_f, chunk_NNA4E64A_g, chunk_NNA4E64A_h; var chunk_NNA4E64A_sizes = { lg: { ...(chunk_NNA4E64A_a2 = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_a2.lg, field: { ...(chunk_NNA4E64A_b = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_b.lg.field, ...iconSpacing } }, md: { ...(chunk_NNA4E64A_c = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_c.md, field: { ...(chunk_NNA4E64A_d = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_d.md.field, ...iconSpacing } }, sm: { ...(chunk_NNA4E64A_e = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_e.sm, field: { ...(chunk_NNA4E64A_f = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_f.sm.field, ...iconSpacing } }, xs: { ...(chunk_NNA4E64A_g = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_g.xs, field: { ...(chunk_NNA4E64A_h = inputTheme.sizes) == null ? void 0 : chunk_NNA4E64A_h.xs.field, ...iconSpacing }, icon: { insetEnd: "1" } } }; var selectTheme = chunk_NNA4E64A_defineMultiStyleConfig({ baseStyle: chunk_NNA4E64A_baseStyle, sizes: chunk_NNA4E64A_sizes, variants: inputTheme.variants, defaultProps: inputTheme.defaultProps }); //# sourceMappingURL=chunk-NNA4E64A.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-X6XFE4TF.mjs // src/components/skeleton.ts var $startColor = cssVar("skeleton-start-color"); var $endColor = cssVar("skeleton-end-color"); var chunk_X6XFE4TF_baseStyle = 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: chunk_X6XFE4TF_baseStyle }); //# sourceMappingURL=chunk-X6XFE4TF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-ZREGO6US.mjs // src/components/skip-link.ts var chunk_ZREGO6US_$bg = cssVar("skip-link-bg"); var chunk_ZREGO6US_baseStyle = defineStyle({ borderRadius: "md", fontWeight: "semibold", _focusVisible: { boxShadow: "outline", padding: "4", position: "fixed", top: "6", insetStart: "6", [chunk_ZREGO6US_$bg.variable]: "colors.white", _dark: { [chunk_ZREGO6US_$bg.variable]: "colors.gray.700" }, bg: chunk_ZREGO6US_$bg.reference } }); var skipLinkTheme = defineStyleConfig({ baseStyle: chunk_ZREGO6US_baseStyle }); //# sourceMappingURL=chunk-ZREGO6US.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-5FA7Y3RP.mjs // src/components/slider.ts var { defineMultiStyleConfig: chunk_5FA7Y3RP_defineMultiStyleConfig, definePartsStyle: chunk_5FA7Y3RP_definePartsStyle } = createMultiStyleConfigHelpers(sliderAnatomy.keys); var $thumbSize = cssVar("slider-thumb-size"); var $trackSize = cssVar("slider-track-size"); var chunk_5FA7Y3RP_$bg = cssVar("slider-bg"); var chunk_5FA7Y3RP_baseStyleContainer = 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%" }, horizontal: { w: "100%" } }) }; }); var chunk_5FA7Y3RP_baseStyleTrack = defineStyle((props) => { const orientationStyles = orient({ orientation: props.orientation, horizontal: { h: $trackSize.reference }, vertical: { w: $trackSize.reference } }); return { ...orientationStyles, overflow: "hidden", borderRadius: "sm", [chunk_5FA7Y3RP_$bg.variable]: "colors.gray.200", _dark: { [chunk_5FA7Y3RP_$bg.variable]: "colors.whiteAlpha.200" }, _disabled: { [chunk_5FA7Y3RP_$bg.variable]: "colors.gray.300", _dark: { [chunk_5FA7Y3RP_$bg.variable]: "colors.whiteAlpha.300" } }, bg: chunk_5FA7Y3RP_$bg.reference }; }); var chunk_5FA7Y3RP_baseStyleThumb = defineStyle((props) => { const { orientation } = props; const orientationStyle = orient({ orientation, vertical: { left: "50%", transform: `translateX(-50%)`, _active: { transform: `translateX(-50%) scale(1.15)` } }, horizontal: { top: "50%", transform: `translateY(-50%)`, _active: { transform: `translateY(-50%) scale(1.15)` } } }); 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" }, _disabled: { bg: "gray.300" } }; }); var chunk_5FA7Y3RP_baseStyleFilledTrack = defineStyle((props) => { const { colorScheme: c } = props; return { width: "inherit", height: "inherit", [chunk_5FA7Y3RP_$bg.variable]: `colors.${c}.500`, _dark: { [chunk_5FA7Y3RP_$bg.variable]: `colors.${c}.200` }, bg: chunk_5FA7Y3RP_$bg.reference }; }); var chunk_5FA7Y3RP_baseStyle = chunk_5FA7Y3RP_definePartsStyle((props) => ({ container: chunk_5FA7Y3RP_baseStyleContainer(props), track: chunk_5FA7Y3RP_baseStyleTrack(props), thumb: chunk_5FA7Y3RP_baseStyleThumb(props), filledTrack: chunk_5FA7Y3RP_baseStyleFilledTrack(props) })); var sizeLg = chunk_5FA7Y3RP_definePartsStyle({ container: { [$thumbSize.variable]: `sizes.4`, [$trackSize.variable]: `sizes.1` } }); var sizeMd = chunk_5FA7Y3RP_definePartsStyle({ container: { [$thumbSize.variable]: `sizes.3.5`, [$trackSize.variable]: `sizes.1` } }); var sizeSm = chunk_5FA7Y3RP_definePartsStyle({ container: { [$thumbSize.variable]: `sizes.2.5`, [$trackSize.variable]: `sizes.0.5` } }); var chunk_5FA7Y3RP_sizes = { lg: sizeLg, md: sizeMd, sm: sizeSm }; var sliderTheme = chunk_5FA7Y3RP_defineMultiStyleConfig({ baseStyle: chunk_5FA7Y3RP_baseStyle, sizes: chunk_5FA7Y3RP_sizes, defaultProps: { size: "md", colorScheme: "blue" } }); //# sourceMappingURL=chunk-5FA7Y3RP.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-L3YAB6CV.mjs // src/components/spinner.ts var chunk_L3YAB6CV_$size = chunk_WSAJBJJ4_cssVar("spinner-size"); var chunk_L3YAB6CV_baseStyle = defineStyle({ width: [chunk_L3YAB6CV_$size.reference], height: [chunk_L3YAB6CV_$size.reference] }); var chunk_L3YAB6CV_sizes = { xs: defineStyle({ [chunk_L3YAB6CV_$size.variable]: "sizes.3" }), sm: defineStyle({ [chunk_L3YAB6CV_$size.variable]: "sizes.4" }), md: defineStyle({ [chunk_L3YAB6CV_$size.variable]: "sizes.6" }), lg: defineStyle({ [chunk_L3YAB6CV_$size.variable]: "sizes.8" }), xl: defineStyle({ [chunk_L3YAB6CV_$size.variable]: "sizes.12" }) }; var spinnerTheme = defineStyleConfig({ baseStyle: chunk_L3YAB6CV_baseStyle, sizes: chunk_L3YAB6CV_sizes, defaultProps: { size: "md" } }); //# sourceMappingURL=chunk-L3YAB6CV.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-2KWJXISX.mjs // src/components/stat.ts var { defineMultiStyleConfig: chunk_2KWJXISX_defineMultiStyleConfig, definePartsStyle: chunk_2KWJXISX_definePartsStyle } = createMultiStyleConfigHelpers(statAnatomy.keys); var chunk_2KWJXISX_baseStyleLabel = defineStyle({ fontWeight: "medium" }); var baseStyleHelpText = defineStyle({ opacity: 0.8, marginBottom: "2" }); var baseStyleNumber = defineStyle({ verticalAlign: "baseline", fontWeight: "semibold" }); var chunk_2KWJXISX_baseStyleIcon = defineStyle({ marginEnd: 1, w: "3.5", h: "3.5", verticalAlign: "middle" }); var chunk_2KWJXISX_baseStyle = chunk_2KWJXISX_definePartsStyle({ container: {}, label: chunk_2KWJXISX_baseStyleLabel, helpText: baseStyleHelpText, number: baseStyleNumber, icon: chunk_2KWJXISX_baseStyleIcon }); var chunk_2KWJXISX_sizes = { md: chunk_2KWJXISX_definePartsStyle({ label: { fontSize: "sm" }, helpText: { fontSize: "sm" }, number: { fontSize: "2xl" } }) }; var statTheme = chunk_2KWJXISX_defineMultiStyleConfig({ baseStyle: chunk_2KWJXISX_baseStyle, sizes: chunk_2KWJXISX_sizes, defaultProps: { size: "md" } }); //# sourceMappingURL=chunk-2KWJXISX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-AFCBUAM5.mjs // src/components/kbd.ts var chunk_AFCBUAM5_$bg = cssVar("kbd-bg"); var chunk_AFCBUAM5_baseStyle = defineStyle({ [chunk_AFCBUAM5_$bg.variable]: "colors.gray.100", _dark: { [chunk_AFCBUAM5_$bg.variable]: "colors.whiteAlpha.100" }, bg: chunk_AFCBUAM5_$bg.reference, borderRadius: "md", borderWidth: "1px", borderBottomWidth: "3px", fontSize: "0.8em", fontWeight: "bold", lineHeight: "normal", px: "0.4em", whiteSpace: "nowrap" }); var kbdTheme = defineStyleConfig({ baseStyle: chunk_AFCBUAM5_baseStyle }); //# sourceMappingURL=chunk-AFCBUAM5.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-V5KSHSOQ.mjs // src/components/link.ts var chunk_V5KSHSOQ_baseStyle = 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: chunk_V5KSHSOQ_baseStyle }); //# sourceMappingURL=chunk-V5KSHSOQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-MGNM2WZQ.mjs // src/components/list.ts var { defineMultiStyleConfig: chunk_MGNM2WZQ_defineMultiStyleConfig, definePartsStyle: chunk_MGNM2WZQ_definePartsStyle } = createMultiStyleConfigHelpers(listAnatomy.keys); var chunk_MGNM2WZQ_baseStyleIcon = defineStyle({ marginEnd: "2", display: "inline", verticalAlign: "text-bottom" }); var chunk_MGNM2WZQ_baseStyle = chunk_MGNM2WZQ_definePartsStyle({ icon: chunk_MGNM2WZQ_baseStyleIcon }); var listTheme = chunk_MGNM2WZQ_defineMultiStyleConfig({ baseStyle: chunk_MGNM2WZQ_baseStyle }); //# sourceMappingURL=chunk-MGNM2WZQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-N2GP2AF7.mjs // src/components/menu.ts var { defineMultiStyleConfig: chunk_N2GP2AF7_defineMultiStyleConfig, definePartsStyle: chunk_N2GP2AF7_definePartsStyle } = createMultiStyleConfigHelpers(menuAnatomy.keys); var chunk_N2GP2AF7_$bg = cssVar("menu-bg"); var chunk_N2GP2AF7_$shadow = cssVar("menu-shadow"); var baseStyleList = defineStyle({ [chunk_N2GP2AF7_$bg.variable]: "#fff", [chunk_N2GP2AF7_$shadow.variable]: "shadows.sm", _dark: { [chunk_N2GP2AF7_$bg.variable]: "colors.gray.700", [chunk_N2GP2AF7_$shadow.variable]: "shadows.dark-lg" }, color: "inherit", minW: "3xs", py: "2", zIndex: 1, borderRadius: "md", borderWidth: "1px", bg: chunk_N2GP2AF7_$bg.reference, boxShadow: chunk_N2GP2AF7_$shadow.reference }); var baseStyleItem = defineStyle({ py: "1.5", px: "3", transitionProperty: "background", transitionDuration: "ultra-fast", transitionTimingFunction: "ease-in", _focus: { [chunk_N2GP2AF7_$bg.variable]: "colors.gray.100", _dark: { [chunk_N2GP2AF7_$bg.variable]: "colors.whiteAlpha.100" } }, _active: { [chunk_N2GP2AF7_$bg.variable]: "colors.gray.200", _dark: { [chunk_N2GP2AF7_$bg.variable]: "colors.whiteAlpha.200" } }, _expanded: { [chunk_N2GP2AF7_$bg.variable]: "colors.gray.100", _dark: { [chunk_N2GP2AF7_$bg.variable]: "colors.whiteAlpha.100" } }, _disabled: { opacity: 0.4, cursor: "not-allowed" }, bg: chunk_N2GP2AF7_$bg.reference }); var baseStyleGroupTitle = defineStyle({ mx: 4, my: 2, fontWeight: "semibold", fontSize: "sm" }); var chunk_N2GP2AF7_baseStyleIcon = 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 baseStyleButton = defineStyle({ transitionProperty: "common", transitionDuration: "normal" }); var chunk_N2GP2AF7_baseStyle = chunk_N2GP2AF7_definePartsStyle({ button: baseStyleButton, list: baseStyleList, item: baseStyleItem, groupTitle: baseStyleGroupTitle, icon: chunk_N2GP2AF7_baseStyleIcon, command: baseStyleCommand, divider: baseStyleDivider }); var menuTheme = chunk_N2GP2AF7_defineMultiStyleConfig({ baseStyle: chunk_N2GP2AF7_baseStyle }); //# sourceMappingURL=chunk-N2GP2AF7.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-JN6QBAR6.mjs // src/components/modal.ts var { defineMultiStyleConfig: chunk_JN6QBAR6_defineMultiStyleConfig, definePartsStyle: chunk_JN6QBAR6_definePartsStyle } = createMultiStyleConfigHelpers(modalAnatomy.keys); var chunk_JN6QBAR6_$bg = cssVar("modal-bg"); var chunk_JN6QBAR6_$shadow = cssVar("modal-shadow"); var baseStyleOverlay = defineStyle({ bg: "blackAlpha.600", zIndex: "modal" }); var baseStyleDialogContainer = 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 baseStyleDialog = 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, [chunk_JN6QBAR6_$bg.variable]: "colors.white", [chunk_JN6QBAR6_$shadow.variable]: "shadows.lg", _dark: { [chunk_JN6QBAR6_$bg.variable]: "colors.gray.700", [chunk_JN6QBAR6_$shadow.variable]: "shadows.dark-lg" }, bg: chunk_JN6QBAR6_$bg.reference, boxShadow: chunk_JN6QBAR6_$shadow.reference }; }); var baseStyleHeader = defineStyle({ px: "6", py: "4", fontSize: "xl", fontWeight: "semibold" }); var chunk_JN6QBAR6_baseStyleCloseButton = defineStyle({ position: "absolute", top: "2", insetEnd: "3" }); var baseStyleBody = defineStyle((props) => { const { scrollBehavior } = props; return { px: "6", py: "2", flex: "1", overflow: scrollBehavior === "inside" ? "auto" : void 0 }; }); var baseStyleFooter = defineStyle({ px: "6", py: "4" }); var chunk_JN6QBAR6_baseStyle = chunk_JN6QBAR6_definePartsStyle((props) => ({ overlay: baseStyleOverlay, dialogContainer: chunk_UV3F75RF_runIfFn(baseStyleDialogContainer, props), dialog: chunk_UV3F75RF_runIfFn(baseStyleDialog, props), header: baseStyleHeader, closeButton: chunk_JN6QBAR6_baseStyleCloseButton, body: chunk_UV3F75RF_runIfFn(baseStyleBody, props), footer: baseStyleFooter })); function getSize(value) { if (value === "full") { return chunk_JN6QBAR6_definePartsStyle({ dialog: { maxW: "100vw", minH: "$100vh", my: "0", borderRadius: "0" } }); } return chunk_JN6QBAR6_definePartsStyle({ dialog: { maxW: value } }); } var chunk_JN6QBAR6_sizes = { xs: getSize("xs"), sm: getSize("sm"), md: getSize("md"), lg: getSize("lg"), xl: getSize("xl"), "2xl": getSize("2xl"), "3xl": getSize("3xl"), "4xl": getSize("4xl"), "5xl": getSize("5xl"), "6xl": getSize("6xl"), full: getSize("full") }; var modalTheme = chunk_JN6QBAR6_defineMultiStyleConfig({ baseStyle: chunk_JN6QBAR6_baseStyle, sizes: chunk_JN6QBAR6_sizes, defaultProps: { size: "md" } }); //# sourceMappingURL=chunk-JN6QBAR6.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-57T4IAPW.mjs // src/components/number-input.ts var { defineMultiStyleConfig: chunk_57T4IAPW_defineMultiStyleConfig, definePartsStyle: chunk_57T4IAPW_definePartsStyle } = createMultiStyleConfigHelpers(numberInputAnatomy.keys); var $stepperWidth = chunk_WSAJBJJ4_cssVar("number-input-stepper-width"); var $inputPadding = chunk_WSAJBJJ4_cssVar("number-input-input-padding"); var inputPaddingValue = chunk_XMZHFSTS_calc($stepperWidth).add("0.5rem").toString(); var chunk_57T4IAPW_$bg = chunk_WSAJBJJ4_cssVar("number-input-bg"); var chunk_57T4IAPW_$fg = chunk_WSAJBJJ4_cssVar("number-input-color"); var chunk_57T4IAPW_$border = chunk_WSAJBJJ4_cssVar("number-input-border-color"); var chunk_57T4IAPW_baseStyleRoot = defineStyle({ [$stepperWidth.variable]: "sizes.6", [$inputPadding.variable]: inputPaddingValue }); var chunk_57T4IAPW_baseStyleField = defineStyle( (props) => { var _a, _b; return (_b = (_a = chunk_UV3F75RF_runIfFn(inputTheme.baseStyle, props)) == null ? void 0 : _a.field) != null ? _b : {}; } ); var baseStyleStepperGroup = defineStyle({ width: $stepperWidth.reference }); var baseStyleStepper = defineStyle({ borderStart: "1px solid", borderStartColor: chunk_57T4IAPW_$border.reference, color: chunk_57T4IAPW_$fg.reference, bg: chunk_57T4IAPW_$bg.reference, [chunk_57T4IAPW_$fg.variable]: "colors.chakra-body-text", [chunk_57T4IAPW_$border.variable]: "colors.chakra-border-color", _dark: { [chunk_57T4IAPW_$fg.variable]: "colors.whiteAlpha.800", [chunk_57T4IAPW_$border.variable]: "colors.whiteAlpha.300" }, _active: { [chunk_57T4IAPW_$bg.variable]: "colors.gray.200", _dark: { [chunk_57T4IAPW_$bg.variable]: "colors.whiteAlpha.300" } }, _disabled: { opacity: 0.4, cursor: "not-allowed" } }); var chunk_57T4IAPW_baseStyle = chunk_57T4IAPW_definePartsStyle((props) => { var _a; return { root: chunk_57T4IAPW_baseStyleRoot, field: (_a = chunk_UV3F75RF_runIfFn(chunk_57T4IAPW_baseStyleField, props)) != null ? _a : {}, stepperGroup: baseStyleStepperGroup, stepper: baseStyleStepper }; }); function chunk_57T4IAPW_getSize(size) { var _a, _b, _c; const sizeStyle = (_a = inputTheme.sizes) == null ? void 0 : _a[size]; const radius = { lg: "md", md: "md", sm: "sm", xs: "sm" }; const _fontSize = (_c = (_b = sizeStyle.field) == null ? void 0 : _b.fontSize) != null ? _c : "md"; const fontSize = typography_default.fontSizes[_fontSize]; return chunk_57T4IAPW_definePartsStyle({ field: { ...sizeStyle.field, paddingInlineEnd: $inputPadding.reference, verticalAlign: "top" }, stepper: { fontSize: chunk_XMZHFSTS_calc(fontSize).multiply(0.75).toString(), _first: { borderTopEndRadius: radius[size] }, _last: { borderBottomEndRadius: radius[size], mt: "-1px", borderTopWidth: 1 } } }); } var chunk_57T4IAPW_sizes = { xs: chunk_57T4IAPW_getSize("xs"), sm: chunk_57T4IAPW_getSize("sm"), md: chunk_57T4IAPW_getSize("md"), lg: chunk_57T4IAPW_getSize("lg") }; var numberInputTheme = chunk_57T4IAPW_defineMultiStyleConfig({ baseStyle: chunk_57T4IAPW_baseStyle, sizes: chunk_57T4IAPW_sizes, variants: inputTheme.variants, defaultProps: inputTheme.defaultProps }); //# sourceMappingURL=chunk-57T4IAPW.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-OEFJDLVS.mjs // src/components/pin-input.ts var chunk_OEFJDLVS_a; var chunk_OEFJDLVS_baseStyle = defineStyle({ ...(chunk_OEFJDLVS_a = inputTheme.baseStyle) == null ? void 0 : chunk_OEFJDLVS_a.field, textAlign: "center" }); var chunk_OEFJDLVS_sizes = { 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 chunk_OEFJDLVS_a2, chunk_OEFJDLVS_b; var chunk_OEFJDLVS_variants = { outline: defineStyle( (props) => { var _a3, _b2, _c; return (_c = (_b2 = chunk_UV3F75RF_runIfFn((_a3 = inputTheme.variants) == null ? void 0 : _a3.outline, props)) == null ? void 0 : _b2.field) != null ? _c : {}; } ), flushed: defineStyle( (props) => { var _a3, _b2, _c; return (_c = (_b2 = chunk_UV3F75RF_runIfFn((_a3 = inputTheme.variants) == null ? void 0 : _a3.flushed, props)) == null ? void 0 : _b2.field) != null ? _c : {}; } ), filled: defineStyle( (props) => { var _a3, _b2, _c; return (_c = (_b2 = chunk_UV3F75RF_runIfFn((_a3 = inputTheme.variants) == null ? void 0 : _a3.filled, props)) == null ? void 0 : _b2.field) != null ? _c : {}; } ), unstyled: (chunk_OEFJDLVS_b = (chunk_OEFJDLVS_a2 = inputTheme.variants) == null ? void 0 : chunk_OEFJDLVS_a2.unstyled.field) != null ? chunk_OEFJDLVS_b : {} }; var pinInputTheme = defineStyleConfig({ baseStyle: chunk_OEFJDLVS_baseStyle, sizes: chunk_OEFJDLVS_sizes, variants: chunk_OEFJDLVS_variants, defaultProps: inputTheme.defaultProps }); //# sourceMappingURL=chunk-OEFJDLVS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-U3INMHUO.mjs // src/components/popover.ts var { defineMultiStyleConfig: chunk_U3INMHUO_defineMultiStyleConfig, definePartsStyle: chunk_U3INMHUO_definePartsStyle } = createMultiStyleConfigHelpers(popoverAnatomy.keys); var $popperBg = chunk_WSAJBJJ4_cssVar("popper-bg"); var chunk_U3INMHUO_$arrowBg = chunk_WSAJBJJ4_cssVar("popper-arrow-bg"); var $arrowShadowColor = chunk_WSAJBJJ4_cssVar("popper-arrow-shadow-color"); var baseStylePopper = defineStyle({ zIndex: 10 }); var baseStyleContent = defineStyle({ [$popperBg.variable]: `colors.white`, bg: $popperBg.reference, [chunk_U3INMHUO_$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 chunk_U3INMHUO_baseStyleHeader = defineStyle({ px: 3, py: 2, borderBottomWidth: "1px" }); var chunk_U3INMHUO_baseStyleBody = defineStyle({ px: 3, py: 2 }); var chunk_U3INMHUO_baseStyleFooter = defineStyle({ px: 3, py: 2, borderTopWidth: "1px" }); var chunk_U3INMHUO_baseStyleCloseButton = defineStyle({ position: "absolute", borderRadius: "md", top: 1, insetEnd: 2, padding: 2 }); var chunk_U3INMHUO_baseStyle = chunk_U3INMHUO_definePartsStyle({ popper: baseStylePopper, content: baseStyleContent, header: chunk_U3INMHUO_baseStyleHeader, body: chunk_U3INMHUO_baseStyleBody, footer: chunk_U3INMHUO_baseStyleFooter, closeButton: chunk_U3INMHUO_baseStyleCloseButton }); var popoverTheme = chunk_U3INMHUO_defineMultiStyleConfig({ baseStyle: chunk_U3INMHUO_baseStyle }); //# sourceMappingURL=chunk-U3INMHUO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-VWP3ZVQT.mjs // src/components/drawer.ts var { definePartsStyle: chunk_VWP3ZVQT_definePartsStyle, defineMultiStyleConfig: chunk_VWP3ZVQT_defineMultiStyleConfig } = createMultiStyleConfigHelpers(drawerAnatomy.keys); var chunk_VWP3ZVQT_$bg = cssVar("drawer-bg"); var $bs = cssVar("drawer-box-shadow"); function chunk_VWP3ZVQT_getSize(value) { if (value === "full") { return chunk_VWP3ZVQT_definePartsStyle({ dialog: { maxW: "100vw", h: "100vh" } }); } return chunk_VWP3ZVQT_definePartsStyle({ dialog: { maxW: value } }); } var chunk_VWP3ZVQT_baseStyleOverlay = defineStyle({ bg: "blackAlpha.600", zIndex: "modal" }); var chunk_VWP3ZVQT_baseStyleDialogContainer = defineStyle({ display: "flex", zIndex: "modal", justifyContent: "center" }); var chunk_VWP3ZVQT_baseStyleDialog = defineStyle((props) => { const { isFullHeight } = props; return { ...isFullHeight && { height: "100vh" }, zIndex: "modal", maxH: "100vh", color: "inherit", [chunk_VWP3ZVQT_$bg.variable]: "colors.white", [$bs.variable]: "shadows.lg", _dark: { [chunk_VWP3ZVQT_$bg.variable]: "colors.gray.700", [$bs.variable]: "shadows.dark-lg" }, bg: chunk_VWP3ZVQT_$bg.reference, boxShadow: $bs.reference }; }); var chunk_VWP3ZVQT_baseStyleHeader = defineStyle({ px: "6", py: "4", fontSize: "xl", fontWeight: "semibold" }); var chunk_VWP3ZVQT_baseStyleCloseButton = defineStyle({ position: "absolute", top: "2", insetEnd: "3" }); var chunk_VWP3ZVQT_baseStyleBody = defineStyle({ px: "6", py: "2", flex: "1", overflow: "auto" }); var chunk_VWP3ZVQT_baseStyleFooter = defineStyle({ px: "6", py: "4" }); var chunk_VWP3ZVQT_baseStyle = chunk_VWP3ZVQT_definePartsStyle((props) => ({ overlay: chunk_VWP3ZVQT_baseStyleOverlay, dialogContainer: chunk_VWP3ZVQT_baseStyleDialogContainer, dialog: chunk_UV3F75RF_runIfFn(chunk_VWP3ZVQT_baseStyleDialog, props), header: chunk_VWP3ZVQT_baseStyleHeader, closeButton: chunk_VWP3ZVQT_baseStyleCloseButton, body: chunk_VWP3ZVQT_baseStyleBody, footer: chunk_VWP3ZVQT_baseStyleFooter })); var chunk_VWP3ZVQT_sizes = { xs: chunk_VWP3ZVQT_getSize("xs"), sm: chunk_VWP3ZVQT_getSize("md"), md: chunk_VWP3ZVQT_getSize("lg"), lg: chunk_VWP3ZVQT_getSize("2xl"), xl: chunk_VWP3ZVQT_getSize("4xl"), full: chunk_VWP3ZVQT_getSize("full") }; var drawerTheme = chunk_VWP3ZVQT_defineMultiStyleConfig({ baseStyle: chunk_VWP3ZVQT_baseStyle, sizes: chunk_VWP3ZVQT_sizes, defaultProps: { size: "xs" } }); //# sourceMappingURL=chunk-VWP3ZVQT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-D6DZ26HA.mjs // src/components/editable.ts var { definePartsStyle: chunk_D6DZ26HA_definePartsStyle, defineMultiStyleConfig: chunk_D6DZ26HA_defineMultiStyleConfig } = 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 chunk_D6DZ26HA_baseStyle = chunk_D6DZ26HA_definePartsStyle({ preview: baseStylePreview, input: baseStyleInput, textarea: baseStyleTextarea }); var editableTheme = chunk_D6DZ26HA_defineMultiStyleConfig({ baseStyle: chunk_D6DZ26HA_baseStyle }); //# sourceMappingURL=chunk-D6DZ26HA.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-O6GGGS4Y.mjs // src/components/form-control.ts var { definePartsStyle: chunk_O6GGGS4Y_definePartsStyle, defineMultiStyleConfig: chunk_O6GGGS4Y_defineMultiStyleConfig } = createMultiStyleConfigHelpers(formAnatomy.keys); var chunk_O6GGGS4Y_$fg = cssVar("form-control-color"); var baseStyleRequiredIndicator = defineStyle({ marginStart: "1", [chunk_O6GGGS4Y_$fg.variable]: "colors.red.500", _dark: { [chunk_O6GGGS4Y_$fg.variable]: "colors.red.300" }, color: chunk_O6GGGS4Y_$fg.reference }); var baseStyleHelperText = defineStyle({ mt: "2", [chunk_O6GGGS4Y_$fg.variable]: "colors.gray.600", _dark: { [chunk_O6GGGS4Y_$fg.variable]: "colors.whiteAlpha.600" }, color: chunk_O6GGGS4Y_$fg.reference, lineHeight: "normal", fontSize: "sm" }); var chunk_O6GGGS4Y_baseStyle = chunk_O6GGGS4Y_definePartsStyle({ container: { width: "100%", position: "relative" }, requiredIndicator: baseStyleRequiredIndicator, helperText: baseStyleHelperText }); var formTheme = chunk_O6GGGS4Y_defineMultiStyleConfig({ baseStyle: chunk_O6GGGS4Y_baseStyle }); //# sourceMappingURL=chunk-O6GGGS4Y.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-SRBDDT7F.mjs // src/components/form-error.ts var { definePartsStyle: chunk_SRBDDT7F_definePartsStyle, defineMultiStyleConfig: chunk_SRBDDT7F_defineMultiStyleConfig } = createMultiStyleConfigHelpers(formErrorAnatomy.keys); var chunk_SRBDDT7F_$fg = cssVar("form-error-color"); var baseStyleText = defineStyle({ [chunk_SRBDDT7F_$fg.variable]: `colors.red.500`, _dark: { [chunk_SRBDDT7F_$fg.variable]: `colors.red.300` }, color: chunk_SRBDDT7F_$fg.reference, mt: "2", fontSize: "sm", lineHeight: "normal" }); var chunk_SRBDDT7F_baseStyleIcon = defineStyle({ marginEnd: "0.5em", [chunk_SRBDDT7F_$fg.variable]: `colors.red.500`, _dark: { [chunk_SRBDDT7F_$fg.variable]: `colors.red.300` }, color: chunk_SRBDDT7F_$fg.reference }); var chunk_SRBDDT7F_baseStyle = chunk_SRBDDT7F_definePartsStyle({ text: baseStyleText, icon: chunk_SRBDDT7F_baseStyleIcon }); var formErrorTheme = chunk_SRBDDT7F_defineMultiStyleConfig({ baseStyle: chunk_SRBDDT7F_baseStyle }); //# sourceMappingURL=chunk-SRBDDT7F.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-VHM7WLW6.mjs // src/components/form-label.ts var chunk_VHM7WLW6_baseStyle = defineStyle({ fontSize: "md", marginEnd: "3", mb: "2", fontWeight: "medium", transitionProperty: "common", transitionDuration: "normal", opacity: 1, _disabled: { opacity: 0.4 } }); var formLabelTheme = defineStyleConfig({ baseStyle: chunk_VHM7WLW6_baseStyle }); //# sourceMappingURL=chunk-VHM7WLW6.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-WXARPSDQ.mjs // src/components/heading.ts var chunk_WXARPSDQ_baseStyle = defineStyle({ fontFamily: "heading", fontWeight: "bold" }); var chunk_WXARPSDQ_sizes = { "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: chunk_WXARPSDQ_baseStyle, sizes: chunk_WXARPSDQ_sizes, defaultProps: { size: "xl" } }); //# sourceMappingURL=chunk-WXARPSDQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-FU5DDBRC.mjs // src/components/breadcrumb.ts var { defineMultiStyleConfig: chunk_FU5DDBRC_defineMultiStyleConfig, definePartsStyle: chunk_FU5DDBRC_definePartsStyle } = 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 chunk_FU5DDBRC_baseStyle = chunk_FU5DDBRC_definePartsStyle({ link: baseStyleLink }); var breadcrumbTheme = chunk_FU5DDBRC_defineMultiStyleConfig({ baseStyle: chunk_FU5DDBRC_baseStyle }); //# sourceMappingURL=chunk-FU5DDBRC.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-MBVM6PEK.mjs // src/components/button.ts var chunk_MBVM6PEK_baseStyle = 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 } = 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 = chunk_6IC2I3BY_transparentize(`${c}.200`, 0.12)(theme); const darkActiveBg = chunk_6IC2I3BY_transparentize(`${c}.200`, 0.24)(theme); 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 chunk_MBVM6PEK_variantOutline = 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" }, ...chunk_UV3F75RF_runIfFn(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 chunk_MBVM6PEK_variantSolid = defineStyle((props) => { var _a; 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 = "white", hoverBg = `${c}.600`, activeBg = `${c}.700` } = (_a = accessibleColorMap[c]) != null ? _a : {}; const background = mode(bg, `${c}.200`)(props); return { bg: background, color: mode(color, `gray.800`)(props), _hover: { bg: mode(hoverBg, `${c}.300`)(props), _disabled: { bg: background } }, _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 chunk_MBVM6PEK_variantUnstyled = defineStyle({ bg: "none", color: "inherit", display: "inline", lineHeight: "inherit", m: "0", p: "0" }); var chunk_MBVM6PEK_variants = { ghost: variantGhost, outline: chunk_MBVM6PEK_variantOutline, solid: chunk_MBVM6PEK_variantSolid, link: variantLink, unstyled: chunk_MBVM6PEK_variantUnstyled }; var chunk_MBVM6PEK_sizes = { 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: chunk_MBVM6PEK_baseStyle, variants: chunk_MBVM6PEK_variants, sizes: chunk_MBVM6PEK_sizes, defaultProps: { variant: "solid", size: "md", colorScheme: "gray" } }); //# sourceMappingURL=chunk-MBVM6PEK.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-F7CKIHPM.mjs // src/components/card.ts var { definePartsStyle: chunk_F7CKIHPM_definePartsStyle, defineMultiStyleConfig: chunk_F7CKIHPM_defineMultiStyleConfig } = createMultiStyleConfigHelpers(cardAnatomy.keys); var chunk_F7CKIHPM_$bg = cssVar("card-bg"); var chunk_F7CKIHPM_$padding = cssVar("card-padding"); var chunk_F7CKIHPM_$shadow = cssVar("card-shadow"); var $radius = cssVar("card-radius"); var chunk_F7CKIHPM_$border = cssVar("card-border-width", "0"); var $borderColor = cssVar("card-border-color"); var chunk_F7CKIHPM_baseStyle = chunk_F7CKIHPM_definePartsStyle({ container: { [chunk_F7CKIHPM_$bg.variable]: "colors.chakra-body-bg", backgroundColor: chunk_F7CKIHPM_$bg.reference, boxShadow: chunk_F7CKIHPM_$shadow.reference, borderRadius: $radius.reference, color: "chakra-body-text", borderWidth: chunk_F7CKIHPM_$border.reference, borderColor: $borderColor.reference }, body: { padding: chunk_F7CKIHPM_$padding.reference, flex: "1 1 0%" }, header: { padding: chunk_F7CKIHPM_$padding.reference }, footer: { padding: chunk_F7CKIHPM_$padding.reference } }); var chunk_F7CKIHPM_sizes = { sm: chunk_F7CKIHPM_definePartsStyle({ container: { [$radius.variable]: "radii.base", [chunk_F7CKIHPM_$padding.variable]: "space.3" } }), md: chunk_F7CKIHPM_definePartsStyle({ container: { [$radius.variable]: "radii.md", [chunk_F7CKIHPM_$padding.variable]: "space.5" } }), lg: chunk_F7CKIHPM_definePartsStyle({ container: { [$radius.variable]: "radii.xl", [chunk_F7CKIHPM_$padding.variable]: "space.7" } }) }; var chunk_F7CKIHPM_variants = { elevated: chunk_F7CKIHPM_definePartsStyle({ container: { [chunk_F7CKIHPM_$shadow.variable]: "shadows.base", _dark: { [chunk_F7CKIHPM_$bg.variable]: "colors.gray.700" } } }), outline: chunk_F7CKIHPM_definePartsStyle({ container: { [chunk_F7CKIHPM_$border.variable]: "1px", [$borderColor.variable]: "colors.chakra-border-color" } }), filled: chunk_F7CKIHPM_definePartsStyle({ container: { [chunk_F7CKIHPM_$bg.variable]: "colors.chakra-subtle-bg" } }), unstyled: { body: { [chunk_F7CKIHPM_$padding.variable]: 0 }, header: { [chunk_F7CKIHPM_$padding.variable]: 0 }, footer: { [chunk_F7CKIHPM_$padding.variable]: 0 } } }; var cardTheme = chunk_F7CKIHPM_defineMultiStyleConfig({ baseStyle: chunk_F7CKIHPM_baseStyle, variants: chunk_F7CKIHPM_variants, sizes: chunk_F7CKIHPM_sizes, defaultProps: { variant: "elevated", size: "md" } }); //# sourceMappingURL=chunk-F7CKIHPM.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-OB7MMEC3.mjs // src/components/close-button.ts var chunk_OB7MMEC3_$size = chunk_WSAJBJJ4_cssVar("close-button-size"); var chunk_OB7MMEC3_$bg = chunk_WSAJBJJ4_cssVar("close-button-bg"); var chunk_OB7MMEC3_baseStyle = defineStyle({ w: [chunk_OB7MMEC3_$size.reference], h: [chunk_OB7MMEC3_$size.reference], borderRadius: "md", transitionProperty: "common", transitionDuration: "normal", _disabled: { opacity: 0.4, cursor: "not-allowed", boxShadow: "none" }, _hover: { [chunk_OB7MMEC3_$bg.variable]: "colors.blackAlpha.100", _dark: { [chunk_OB7MMEC3_$bg.variable]: "colors.whiteAlpha.100" } }, _active: { [chunk_OB7MMEC3_$bg.variable]: "colors.blackAlpha.200", _dark: { [chunk_OB7MMEC3_$bg.variable]: "colors.whiteAlpha.200" } }, _focusVisible: { boxShadow: "outline" }, bg: chunk_OB7MMEC3_$bg.reference }); var chunk_OB7MMEC3_sizes = { lg: defineStyle({ [chunk_OB7MMEC3_$size.variable]: "sizes.10", fontSize: "md" }), md: defineStyle({ [chunk_OB7MMEC3_$size.variable]: "sizes.8", fontSize: "xs" }), sm: defineStyle({ [chunk_OB7MMEC3_$size.variable]: "sizes.6", fontSize: "2xs" }) }; var closeButtonTheme = defineStyleConfig({ baseStyle: chunk_OB7MMEC3_baseStyle, sizes: chunk_OB7MMEC3_sizes, defaultProps: { size: "md" } }); //# sourceMappingURL=chunk-OB7MMEC3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-K3RH7Y2L.mjs // src/components/code.ts var { variants: chunk_K3RH7Y2L_variants, defaultProps } = badgeTheme; var chunk_K3RH7Y2L_baseStyle = 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: chunk_K3RH7Y2L_baseStyle, variants: chunk_K3RH7Y2L_variants, defaultProps }); //# sourceMappingURL=chunk-K3RH7Y2L.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-TECE6HDR.mjs // src/components/container.ts var chunk_TECE6HDR_baseStyle = defineStyle({ w: "100%", mx: "auto", maxW: "prose", px: "4" }); var containerTheme = defineStyleConfig({ baseStyle: chunk_TECE6HDR_baseStyle }); //# sourceMappingURL=chunk-TECE6HDR.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-5S44M2O4.mjs // src/components/divider.ts var chunk_5S44M2O4_baseStyle = defineStyle({ opacity: 0.6, borderColor: "inherit" }); var chunk_5S44M2O4_variantSolid = defineStyle({ borderStyle: "solid" }); var variantDashed = defineStyle({ borderStyle: "dashed" }); var chunk_5S44M2O4_variants = { solid: chunk_5S44M2O4_variantSolid, dashed: variantDashed }; var dividerTheme = defineStyleConfig({ baseStyle: chunk_5S44M2O4_baseStyle, variants: chunk_5S44M2O4_variants, defaultProps: { variant: "solid" } }); //# sourceMappingURL=chunk-5S44M2O4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-J7AGDWFO.mjs // src/components/accordion.ts var { definePartsStyle: chunk_J7AGDWFO_definePartsStyle, defineMultiStyleConfig: chunk_J7AGDWFO_defineMultiStyleConfig } = createMultiStyleConfigHelpers(accordionAnatomy.keys); var chunk_J7AGDWFO_baseStyleContainer = defineStyle({ borderTopWidth: "1px", borderColor: "inherit", _last: { borderBottomWidth: "1px" } }); var chunk_J7AGDWFO_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 chunk_J7AGDWFO_baseStyleIcon = defineStyle({ fontSize: "1.25em" }); var chunk_J7AGDWFO_baseStyle = chunk_J7AGDWFO_definePartsStyle({ container: chunk_J7AGDWFO_baseStyleContainer, button: chunk_J7AGDWFO_baseStyleButton, panel: baseStylePanel, icon: chunk_J7AGDWFO_baseStyleIcon }); var accordionTheme = chunk_J7AGDWFO_defineMultiStyleConfig({ baseStyle: chunk_J7AGDWFO_baseStyle }); //# sourceMappingURL=chunk-J7AGDWFO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-BNQWYFTH.mjs // src/components/alert.ts var { definePartsStyle: chunk_BNQWYFTH_definePartsStyle, defineMultiStyleConfig: chunk_BNQWYFTH_defineMultiStyleConfig } = createMultiStyleConfigHelpers(alertAnatomy.keys); var chunk_BNQWYFTH_$fg = cssVar("alert-fg"); var chunk_BNQWYFTH_$bg = cssVar("alert-bg"); var chunk_BNQWYFTH_baseStyle = chunk_BNQWYFTH_definePartsStyle({ container: { bg: chunk_BNQWYFTH_$bg.reference, px: "4", py: "3" }, title: { fontWeight: "bold", lineHeight: "6", marginEnd: "2" }, description: { lineHeight: "6" }, icon: { color: chunk_BNQWYFTH_$fg.reference, flexShrink: 0, marginEnd: "3", w: "5", h: "6" }, spinner: { color: chunk_BNQWYFTH_$fg.reference, flexShrink: 0, marginEnd: "3", w: "5", h: "5" } }); function getBg(props) { const { theme, colorScheme: c } = props; const darkBg = chunk_6IC2I3BY_transparentize(`${c}.200`, 0.16)(theme); return { light: `colors.${c}.100`, dark: darkBg }; } var chunk_BNQWYFTH_variantSubtle = chunk_BNQWYFTH_definePartsStyle((props) => { const { colorScheme: c } = props; const bg = getBg(props); return { container: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.600`, [chunk_BNQWYFTH_$bg.variable]: bg.light, _dark: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.200`, [chunk_BNQWYFTH_$bg.variable]: bg.dark } } }; }); var variantLeftAccent = chunk_BNQWYFTH_definePartsStyle((props) => { const { colorScheme: c } = props; const bg = getBg(props); return { container: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.600`, [chunk_BNQWYFTH_$bg.variable]: bg.light, _dark: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.200`, [chunk_BNQWYFTH_$bg.variable]: bg.dark }, paddingStart: "3", borderStartWidth: "4px", borderStartColor: chunk_BNQWYFTH_$fg.reference } }; }); var variantTopAccent = chunk_BNQWYFTH_definePartsStyle((props) => { const { colorScheme: c } = props; const bg = getBg(props); return { container: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.600`, [chunk_BNQWYFTH_$bg.variable]: bg.light, _dark: { [chunk_BNQWYFTH_$fg.variable]: `colors.${c}.200`, [chunk_BNQWYFTH_$bg.variable]: bg.dark }, pt: "2", borderTopWidth: "4px", borderTopColor: chunk_BNQWYFTH_$fg.reference } }; }); var chunk_BNQWYFTH_variantSolid = chunk_BNQWYFTH_definePartsStyle((props) => { const { colorScheme: c } = props; return { container: { [chunk_BNQWYFTH_$fg.variable]: `colors.white`, [chunk_BNQWYFTH_$bg.variable]: `colors.${c}.600`, _dark: { [chunk_BNQWYFTH_$fg.variable]: `colors.gray.900`, [chunk_BNQWYFTH_$bg.variable]: `colors.${c}.200` }, color: chunk_BNQWYFTH_$fg.reference } }; }); var chunk_BNQWYFTH_variants = { subtle: chunk_BNQWYFTH_variantSubtle, "left-accent": variantLeftAccent, "top-accent": variantTopAccent, solid: chunk_BNQWYFTH_variantSolid }; var alertTheme = chunk_BNQWYFTH_defineMultiStyleConfig({ baseStyle: chunk_BNQWYFTH_baseStyle, variants: chunk_BNQWYFTH_variants, defaultProps: { variant: "subtle", colorScheme: "blue" } }); //# sourceMappingURL=chunk-BNQWYFTH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-Q5ZQE4MD.mjs // src/components/avatar.ts var { definePartsStyle: chunk_Q5ZQE4MD_definePartsStyle, defineMultiStyleConfig: chunk_Q5ZQE4MD_defineMultiStyleConfig } = createMultiStyleConfigHelpers(avatarAnatomy.keys); var chunk_Q5ZQE4MD_$border = cssVar("avatar-border-color"); var chunk_Q5ZQE4MD_$bg = cssVar("avatar-bg"); var $fs = cssVar("avatar-font-size"); var chunk_Q5ZQE4MD_$size = cssVar("avatar-size"); var baseStyleBadge = defineStyle({ borderRadius: "full", border: "0.2em solid", borderColor: chunk_Q5ZQE4MD_$border.reference, [chunk_Q5ZQE4MD_$border.variable]: "white", _dark: { [chunk_Q5ZQE4MD_$border.variable]: "colors.gray.800" } }); var baseStyleExcessLabel = defineStyle({ bg: chunk_Q5ZQE4MD_$bg.reference, fontSize: $fs.reference, width: chunk_Q5ZQE4MD_$size.reference, height: chunk_Q5ZQE4MD_$size.reference, lineHeight: "1", [chunk_Q5ZQE4MD_$bg.variable]: "colors.gray.200", _dark: { [chunk_Q5ZQE4MD_$bg.variable]: "colors.whiteAlpha.400" } }); var chunk_Q5ZQE4MD_baseStyleContainer = defineStyle((props) => { const { name, theme } = props; const bg = name ? randomColor({ string: name }) : "colors.gray.400"; const isBgDark = isDark(bg)(theme); let color = "white"; if (!isBgDark) color = "gray.800"; return { bg: chunk_Q5ZQE4MD_$bg.reference, fontSize: $fs.reference, color, borderColor: chunk_Q5ZQE4MD_$border.reference, verticalAlign: "top", width: chunk_Q5ZQE4MD_$size.reference, height: chunk_Q5ZQE4MD_$size.reference, "&:not([data-loaded])": { [chunk_Q5ZQE4MD_$bg.variable]: bg }, [chunk_Q5ZQE4MD_$border.variable]: "colors.white", _dark: { [chunk_Q5ZQE4MD_$border.variable]: "colors.gray.800" } }; }); var chunk_Q5ZQE4MD_baseStyleLabel = defineStyle({ fontSize: $fs.reference, lineHeight: "1" }); var chunk_Q5ZQE4MD_baseStyle = chunk_Q5ZQE4MD_definePartsStyle((props) => ({ badge: chunk_UV3F75RF_runIfFn(baseStyleBadge, props), excessLabel: chunk_UV3F75RF_runIfFn(baseStyleExcessLabel, props), container: chunk_UV3F75RF_runIfFn(chunk_Q5ZQE4MD_baseStyleContainer, props), label: chunk_Q5ZQE4MD_baseStyleLabel })); function chunk_Q5ZQE4MD_getSize(size) { const themeSize = size !== "100%" ? sizes_default[size] : void 0; return chunk_Q5ZQE4MD_definePartsStyle({ container: { [chunk_Q5ZQE4MD_$size.variable]: themeSize != null ? themeSize : size, [$fs.variable]: `calc(${themeSize != null ? themeSize : size} / 2.5)` }, excessLabel: { [chunk_Q5ZQE4MD_$size.variable]: themeSize != null ? themeSize : size, [$fs.variable]: `calc(${themeSize != null ? themeSize : size} / 2.5)` } }); } var chunk_Q5ZQE4MD_sizes = { "2xs": chunk_Q5ZQE4MD_getSize(4), xs: chunk_Q5ZQE4MD_getSize(6), sm: chunk_Q5ZQE4MD_getSize(8), md: chunk_Q5ZQE4MD_getSize(12), lg: chunk_Q5ZQE4MD_getSize(16), xl: chunk_Q5ZQE4MD_getSize(24), "2xl": chunk_Q5ZQE4MD_getSize(32), full: chunk_Q5ZQE4MD_getSize("100%") }; var avatarTheme = chunk_Q5ZQE4MD_defineMultiStyleConfig({ baseStyle: chunk_Q5ZQE4MD_baseStyle, sizes: chunk_Q5ZQE4MD_sizes, defaultProps: { size: "md" } }); //# sourceMappingURL=chunk-Q5ZQE4MD.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-P7SDT22G.mjs // src/components/index.ts 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 }; //# sourceMappingURL=chunk-P7SDT22G.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-5GOSZLB7.mjs // src/semantic-tokens.ts 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" } } }; //# sourceMappingURL=chunk-5GOSZLB7.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-3F7U33P5.mjs // src/styles.ts 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" } } }; //# sourceMappingURL=chunk-3F7U33P5.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/index.mjs // src/index.ts var direction = "ltr"; var config = { useSystemColorMode: false, initialColorMode: "light", cssVarPrefix: "chakra" }; var theme = { semanticTokens: semanticTokens, direction, ...foundations, components: components, styles: styles, config }; var baseTheme = { semanticTokens: semanticTokens, direction, components: {}, ...foundations, styles: styles, config }; //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-LDADOVIM.mjs 'use client' // src/toast.utils.ts var findById = (arr, id) => arr.find((toast) => toast.id === id); function findToast(toasts, id) { const position = getToastPosition(toasts, id); const index = position ? toasts[position].findIndex((toast) => toast.id === id) : -1; return { position, index }; } function getToastPosition(toasts, id) { for (const [position, values] of Object.entries(toasts)) { if (findById(values, id)) { return position; } } } var isVisible = (toasts, id) => !!getToastPosition(toasts, id); function getToastStyle(position) { const isRighty = position.includes("right"); const isLefty = position.includes("left"); let alignItems = "center"; if (isRighty) alignItems = "flex-end"; if (isLefty) alignItems = "flex-start"; return { display: "flex", flexDirection: "column", alignItems }; } function getToastListStyle(position) { const isTopOrBottom = position === "top" || position === "bottom"; const margin = isTopOrBottom ? "0 auto" : void 0; const top = position.includes("top") ? "env(safe-area-inset-top, 0px)" : void 0; const bottom = position.includes("bottom") ? "env(safe-area-inset-bottom, 0px)" : void 0; const right = !position.includes("left") ? "env(safe-area-inset-right, 0px)" : void 0; const left = !position.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, bottom, right, left }; } //# sourceMappingURL=chunk-LDADOVIM.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-callback-ref/dist/index.mjs 'use client' // src/index.ts ; function dist_useCallbackRef(callback, deps = []) { const callbackRef = (0,external_React_.useRef)(callback); (0,external_React_.useEffect)(() => { callbackRef.current = callback; }); return (0,external_React_.useCallback)((...args) => { var _a; return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args); }, deps); } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-timeout/dist/index.mjs 'use client' // src/index.ts ; function useTimeout(callback, delay) { const fn = dist_useCallbackRef(callback); (0,external_React_.useEffect)(() => { if (delay == null) return void 0; let timeoutId = null; timeoutId = window.setTimeout(() => { fn(); }, delay); return () => { if (timeoutId) { window.clearTimeout(timeoutId); } }; }, [delay, fn]); } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-update-effect/dist/index.mjs 'use client' // src/index.ts ; function dist_useUpdateEffect(callback, deps) { const renderCycleRef = (0,external_React_.useRef)(false); const effectCycleRef = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { const mounted = renderCycleRef.current; const run = mounted && effectCycleRef.current; if (run) { return callback(); } effectCycleRef.current = true; }, deps); (0,external_React_.useEffect)(() => { renderCycleRef.current = true; return () => { renderCycleRef.current = false; }; }, []); } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.mjs /** * @public */ var PresenceContext = (0,external_React_.createContext)(null); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.mjs /** * Creates a constant value over the lifecycle of a component. * * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` * you can ensure that initialisers don't execute twice or more. */ function useConstant(init) { var ref = (0,external_React_.useRef)(null); if (ref.current === null) { ref.current = init(); } return ref.current; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-id.mjs var counter = 0; var incrementId = function () { return counter++; }; var useId = function () { return useConstant(incrementId); }; /** * Ideally we'd use the following code to support React 18 optionally. * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all). * Need to come up with a different way of figuring this out. */ // export const useId = (React as any).useId // ? (React as any).useId // : () => useConstant(incrementId) ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs /** * When a component is the child of `AnimatePresence`, it can use `usePresence` * to access information about whether it's still present in the React tree. * * ```jsx * import { usePresence } from "framer-motion" * * export const Component = () => { * const [isPresent, safeToRemove] = usePresence() * * useEffect(() => { * !isPresent && setTimeout(safeToRemove, 1000) * }, [isPresent]) * * return <div /> * } * ``` * * If `isPresent` is `false`, it means that a component has been removed the tree, but * `AnimatePresence` won't really remove it until `safeToRemove` has been called. * * @public */ function usePresence() { var context = (0,external_React_.useContext)(PresenceContext); if (context === null) return [true, null]; var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register; // It's safe to call the following hooks conditionally (after an early return) because the context will always // either be null or non-null for the lifespan of the component. // Replace with useId when released in React var id = useId(); (0,external_React_.useEffect)(function () { return register(id); }, []); var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); }; return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; } /** * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. * There is no `safeToRemove` function. * * ```jsx * import { useIsPresent } from "framer-motion" * * export const Component = () => { * const isPresent = useIsPresent() * * useEffect(() => { * !isPresent && console.log("I've been removed!") * }, [isPresent]) * * return <div /> * } * ``` * * @public */ function useIsPresent() { return isPresent((0,external_React_.useContext)(PresenceContext)); } function isPresent(context) { return context === null ? true : context.isPresent; } ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function tslib_es6_read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(tslib_es6_read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function tslib_es6_spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } function next() { while (env.stack.length) { var rec = env.stack.pop(); try { var result = rec.dispose && rec.dispose.call(rec.value); if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } catch (e) { fail(e); } } if (env.hasError) throw env.error; } return next(); } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read: tslib_es6_read, __spread, __spreadArrays, __spreadArray: tslib_es6_spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/process.mjs /** * Browser-safe usage of process */ var defaultEnvironment = "production"; var env = typeof process === "undefined" || process.env === undefined ? defaultEnvironment : "production" || 0; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.mjs var createDefinition = function (propNames) { return ({ isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); }, }); }; var featureDefinitions = { measureLayout: createDefinition(["layout", "layoutId", "drag"]), animation: createDefinition([ "animate", "exit", "variants", "whileHover", "whileTap", "whileFocus", "whileDrag", "whileInView", ]), exit: createDefinition(["exit"]), drag: createDefinition(["drag", "dragControls"]), focus: createDefinition(["whileFocus"]), hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), pan: createDefinition([ "onPan", "onPanStart", "onPanSessionStart", "onPanEnd", ]), inView: createDefinition([ "whileInView", "onViewportEnter", "onViewportLeave", ]), }; function loadFeatures(features) { for (var key in features) { if (features[key] === null) continue; if (key === "projectionNodeConstructor") { featureDefinitions.projectionNodeConstructor = features[key]; } else { featureDefinitions[key].Component = features[key]; } } } ;// CONCATENATED MODULE: ./node_modules/hey-listen/dist/hey-listen.es.js var warning = function () { }; var invariant = function () { }; if (false) {} ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.mjs var LazyContext = (0,external_React_.createContext)({ strict: false }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-features.mjs var featureNames = Object.keys(featureDefinitions); var numFeatures = featureNames.length; /** * Load features via renderless components based on the provided MotionProps. */ function useFeatures(props, visualElement, preloadedFeatures) { var features = []; var lazyContext = (0,external_React_.useContext)(LazyContext); if (!visualElement) return null; /** * If we're in development mode, check to make sure we're not rendering a motion component * as a child of LazyMotion, as this will break the file-size benefits of using it. */ if (env !== "production" && preloadedFeatures && lazyContext.strict) { invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."); } for (var i = 0; i < numFeatures; i++) { var name_1 = featureNames[i]; var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component; /** * It might be possible in the future to use this moment to * dynamically request functionality. In initial tests this * was producing a lot of duplication amongst bundles. */ if (isEnabled(props) && Component) { features.push(external_React_.createElement(Component, __assign({ key: name_1 }, props, { visualElement: visualElement }))); } } return features; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs /** * @public */ var MotionConfigContext = (0,external_React_.createContext)({ transformPagePoint: function (p) { return p; }, isStatic: false, reducedMotion: "never", }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.mjs var MotionContext = (0,external_React_.createContext)({}); function useVisualElementContext() { return (0,external_React_.useContext)(MotionContext).visualElement; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.mjs var is_browser_isBrowser = typeof document !== "undefined"; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs var useIsomorphicLayoutEffect = is_browser_isBrowser ? external_React_.useLayoutEffect : external_React_.useEffect; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-reduced-motion.mjs // Does this device prefer reduced motion? Returns `null` server-side. var prefersReducedMotion = { current: null }; var hasDetected = false; function initPrefersReducedMotion() { hasDetected = true; if (!is_browser_isBrowser) return; if (window.matchMedia) { var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)"); var setReducedMotionPreferences = function () { return (prefersReducedMotion.current = motionMediaQuery_1.matches); }; motionMediaQuery_1.addListener(setReducedMotionPreferences); setReducedMotionPreferences(); } else { prefersReducedMotion.current = false; } } /** * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. * * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. * * It will actively respond to changes and re-render your components with the latest setting. * * ```jsx * export function Sidebar({ isOpen }) { * const shouldReduceMotion = useReducedMotion() * const closedX = shouldReduceMotion ? 0 : "-100%" * * return ( * <motion.div animate={{ * opacity: isOpen ? 1 : 0, * x: isOpen ? 0 : closedX * }} /> * ) * } * ``` * * @return boolean * * @public */ function useReducedMotion() { /** * Lazy initialisation of prefersReducedMotion */ !hasDetected && initPrefersReducedMotion(); var _a = tslib_es6_read((0,external_React_.useState)(prefersReducedMotion.current), 1), shouldReduceMotion = _a[0]; /** * TODO See if people miss automatically updating shouldReduceMotion setting */ return shouldReduceMotion; } function useReducedMotionConfig() { var reducedMotionPreference = useReducedMotion(); var reducedMotion = (0,external_React_.useContext)(MotionConfigContext).reducedMotion; if (reducedMotion === "never") { return false; } else if (reducedMotion === "always") { return true; } else { return reducedMotionPreference; } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs function useVisualElement(Component, visualState, props, createVisualElement) { var lazyContext = (0,external_React_.useContext)(LazyContext); var parent = useVisualElementContext(); var presenceContext = (0,external_React_.useContext)(PresenceContext); var shouldReduceMotion = useReducedMotionConfig(); var visualElementRef = (0,external_React_.useRef)(undefined); /** * If we haven't preloaded a renderer, check to see if we have one lazy-loaded */ if (!createVisualElement) createVisualElement = lazyContext.renderer; if (!visualElementRef.current && createVisualElement) { visualElementRef.current = createVisualElement(Component, { visualState: visualState, parent: parent, props: props, presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, shouldReduceMotion: shouldReduceMotion, }); } var visualElement = visualElementRef.current; useIsomorphicLayoutEffect(function () { visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); }); (0,external_React_.useEffect)(function () { var _a; (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); }); useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []); return visualElement; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.mjs function is_ref_object_isRefObject(ref) { return (typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current")); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs /** * Creates a ref function that, when called, hydrates the provided * external ref and VisualElement. */ function useMotionRef(visualState, visualElement, externalRef) { return (0,external_React_.useCallback)(function (instance) { var _a; instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); if (visualElement) { instance ? visualElement.mount(instance) : visualElement.unmount(); } if (externalRef) { if (typeof externalRef === "function") { externalRef(instance); } else if (is_ref_object_isRefObject(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]); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variants.mjs /** * Decides if the supplied variable is an array of variant labels */ function isVariantLabels(v) { return Array.isArray(v); } /** * Decides if the supplied variable is variant label */ function isVariantLabel(v) { return typeof v === "string" || isVariantLabels(v); } /** * Creates an object containing the latest state of every MotionValue on a VisualElement */ function getCurrent(visualElement) { var current = {}; visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); }); return current; } /** * Creates an object containing the latest velocity of every MotionValue on a VisualElement */ function getVelocity(visualElement) { var velocity = {}; visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); }); return velocity; } function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { var _a; if (currentValues === void 0) { currentValues = {}; } if (currentVelocity === void 0) { currentVelocity = {}; } /** * If the variant definition is a function, resolve. */ if (typeof definition === "function") { definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); } /** * If the variant definition is a variant label, or * the function returned a variant label, resolve. */ if (typeof definition === "string") { definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; } /** * At this point we've resolved both functions and variant labels, * but the resolved variant label might itself have been a function. * If so, resolve. This can only have returned a valid target object. */ if (typeof definition === "function") { definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); } return definition; } function resolveVariant(visualElement, definition, custom) { var props = visualElement.getProps(); return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement)); } function checkIfControllingVariants(props) { var _a; return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || isVariantLabel(props.initial) || isVariantLabel(props.animate) || isVariantLabel(props.whileHover) || isVariantLabel(props.whileDrag) || isVariantLabel(props.whileTap) || isVariantLabel(props.whileFocus) || isVariantLabel(props.exit)); } function checkIfVariantNode(props) { return Boolean(checkIfControllingVariants(props) || props.variants); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs function getCurrentTreeVariants(props, context) { if (checkIfControllingVariants(props)) { var initial = props.initial, animate = props.animate; return { initial: initial === false || isVariantLabel(initial) ? initial : undefined, animate: isVariantLabel(animate) ? animate : undefined, }; } return props.inherit !== false ? context : {}; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.mjs function useCreateMotionContext(props) { var _a = getCurrentTreeVariants(props, (0,external_React_.useContext)(MotionContext)), initial = _a.initial, animate = _a.animate; return (0,external_React_.useMemo)(function () { return ({ initial: initial, animate: animate }); }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); } function variantLabelsAsDependency(prop) { return Array.isArray(prop) ? prop.join(" ") : prop; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/state.mjs /** * This should only ever be modified on the client otherwise it'll * persist through server requests. If we need instanced states we * could lazy-init via root. */ 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, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/id.mjs var id = 1; function useProjectionId() { return useConstant(function () { if (globalProjectionState.hasEverUpdated) { return id++; } }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs var LayoutGroupContext = (0,external_React_.createContext)({}); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs /** * Internal, exported only for usage in Framer */ var SwitchLayoutGroupContext = (0,external_React_.createContext)({}); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-projection.mjs function useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) { var _b; var layoutId = _a.layoutId, layout = _a.layout, drag = _a.drag, dragConstraints = _a.dragConstraints, layoutScroll = _a.layoutScroll; var initialPromotionConfig = (0,external_React_.useContext)(SwitchLayoutGroupContext); if (!ProjectionNodeConstructor || !visualElement || (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) { return; } visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection); visualElement.projection.setOptions({ layoutId: layoutId, layout: layout, alwaysMeasureLayout: Boolean(drag) || (dragConstraints && is_ref_object_isRefObject(dragConstraints)), visualElement: visualElement, scheduleRender: function () { return visualElement.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 layout === "string" ? layout : "both", initialPromotionConfig: initialPromotionConfig, layoutScroll: layoutScroll, }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/VisualElementHandler.mjs var VisualElementHandler = /** @class */ (function (_super) { __extends(VisualElementHandler, _super); function VisualElementHandler() { return _super !== null && _super.apply(this, arguments) || this; } /** * Update visual element props as soon as we know this update is going to be commited. */ VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () { this.updateProps(); return null; }; VisualElementHandler.prototype.componentDidUpdate = function () { }; VisualElementHandler.prototype.updateProps = function () { var _a = this.props, visualElement = _a.visualElement, props = _a.props; if (visualElement) visualElement.setProps(props); }; VisualElementHandler.prototype.render = function () { return this.props.children; }; return VisualElementHandler; }(external_React_.Component)); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.mjs /** * Create a `motion` component. * * This function accepts a Component argument, which can be either a string (ie "div" * for `motion.div`), or an actual React component. * * Alongside this is a config option which provides a way of rendering the provided * component "offline", or outside the React render cycle. */ function motion_createMotionComponent(_a) { var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component; preloadedFeatures && loadFeatures(preloadedFeatures); function MotionComponent(props, externalRef) { var layoutId = useLayoutId(props); props = __assign(__assign({}, props), { layoutId: layoutId }); /** * If we're rendering in a static environment, we only visually update the component * as a result of a React-rerender rather than interactions or animations. This * means we don't need to load additional memory structures like VisualElement, * or any gesture/animation features. */ var config = (0,external_React_.useContext)(MotionConfigContext); var features = null; var context = useCreateMotionContext(props); /** * Create a unique projection ID for this component. If a new component is added * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing * us to measure it as soon as any layout effect flushes pending layout animations. * * Performance note: It'd be better not to have to search the DOM for these elements. * For newly-entering components it could be enough to only correct treeScale, in which * case we could mount in a scale-correction mode. This wouldn't be enough for * shared element transitions however. Perhaps for those we could revert to a root node * that gets forceRendered and layout animations are triggered on its layout effect. */ var projectionId = config.isStatic ? undefined : useProjectionId(); /** * */ var visualState = useVisualState(props, config.isStatic); if (!config.isStatic && is_browser_isBrowser) { /** * Create a VisualElement for this component. A VisualElement provides a common * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as * providing a way of rendering to these APIs outside of the React render loop * for more performant animations and interactions */ context.visualElement = useVisualElement(Component, visualState, __assign(__assign({}, config), props), createVisualElement); useProjection(projectionId, props, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor); /** * Load Motion gesture and animation features. These are rendered as renderless * components so each feature can optionally make use of React lifecycle methods. */ features = useFeatures(props, context.visualElement, preloadedFeatures); } /** * The mount order and hierarchy is specific to ensure our element ref * is hydrated by the time features fire their effects. */ return (external_React_.createElement(VisualElementHandler, { visualElement: context.visualElement, props: __assign(__assign({}, config), props) }, features, external_React_.createElement(MotionContext.Provider, { value: context }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement)))); } return (0,external_React_.forwardRef)(MotionComponent); } function useLayoutId(_a) { var _b; var layoutId = _a.layoutId; var layoutGroupId = (_b = (0,external_React_.useContext)(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id; return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs /** * Convert any React component into a `motion` component. The provided component * **must** use `React.forwardRef` to the underlying DOM component you want to animate. * * ```jsx * const Component = React.forwardRef((props, ref) => { * return <div ref={ref} /> * }) * * const MotionComponent = motion(Component) * ``` * * @public */ function createMotionProxy(createConfig) { function custom(Component, customMotionComponentConfig) { if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; } return motion_createMotionComponent(createConfig(Component, customMotionComponentConfig)); } if (typeof Proxy === "undefined") { return custom; } /** * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. * Rather than generating them anew every render. */ var componentCache = 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: function (_target, key) { /** * If this element doesn't exist in the component cache, create it and cache. */ if (!componentCache.has(key)) { componentCache.set(key, custom(key)); } return componentCache.get(key); }, }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs /** * We keep these listed seperately as we use the lowercase tag names as part * of the runtime bundle to detect SVG components */ var lowercaseSVGElements = [ "animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", ]; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs function isSVGComponent(Component) { if ( /** * If it's not a string, it's a custom React component. Currently we only support * HTML custom React components. */ typeof Component !== "string" || /** * If it contains a dash, the element is a custom HTML webcomponent. */ Component.includes("-")) { return false; } else if ( /** * If it's in our list of lowercase SVG tags, it's an SVG component */ lowercaseSVGElements.indexOf(Component) > -1 || /** * If it contains a capital letter, it's an SVG component */ /[A-Z]/.test(Component)) { return true; } return false; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs var scaleCorrectors = {}; function addScaleCorrector(correctors) { Object.assign(scaleCorrectors, correctors); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/transform.mjs /** * A list of all transformable axes. We'll use this list to generated a version * of each axes for each transform. */ var transformAxes = ["", "X", "Y", "Z"]; /** * An ordered array of each transformable value. By default, transform values * will be sorted to this order. */ var order = ["translate", "scale", "rotate", "skew"]; /** * Generate a list of every possible transform key. */ var transformProps = ["transformPerspective", "x", "y", "z"]; order.forEach(function (operationKey) { return transformAxes.forEach(function (axesKey) { return transformProps.push(operationKey + axesKey); }); }); /** * A function to use with Array.sort to sort transform keys by their default order. */ function sortTransformProps(a, b) { return transformProps.indexOf(a) - transformProps.indexOf(b); } /** * A quick lookup for transform props. */ var transformPropSet = new Set(transformProps); function isTransformProp(key) { return transformPropSet.has(key); } /** * A quick lookup for transform origin props */ var transformOriginProps = new Set(["originX", "originY", "originZ"]); function isTransformOriginProp(key) { return transformOriginProps.has(key); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs function isForcedMotionValue(key, _a) { var layout = _a.layout, layoutId = _a.layoutId; return (isTransformProp(key) || isTransformOriginProp(key) || ((layout || layoutId !== undefined) && (!!scaleCorrectors[key] || key === "opacity"))); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs var isMotionValue = function (value) { return Boolean(value !== null && typeof value === "object" && value.getVelocity); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs var translateAlias = { x: "translateX", y: "translateY", z: "translateZ", transformPerspective: "perspective", }; /** * Build a CSS transform style from individual x/y/scale etc properties. * * This outputs with a default order of transforms/scales/rotations, this can be customised by * providing a transformTemplate function. */ function buildTransform(_a, _b, transformIsDefault, transformTemplate) { var transform = _a.transform, transformKeys = _a.transformKeys; var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d; // The transform string we're going to build into. var transformString = ""; // Transform keys into their default order - this will determine the output order. transformKeys.sort(sortTransformProps); // Track whether the defined transform has a defined z so we don't add a // second to enable hardware acceleration var transformHasZ = false; // Loop over each transform and build them into transformString var numTransformKeys = transformKeys.length; for (var i = 0; i < numTransformKeys; i++) { var key = transformKeys[i]; transformString += "".concat(translateAlias[key] || key, "(").concat(transform[key], ") "); if (key === "z") transformHasZ = true; } if (!transformHasZ && enableHardwareAcceleration) { transformString += "translateZ(0)"; } else { transformString = transformString.trim(); } // If we have a custom `transform` template, pass our transform values and // generated transformString to that before returning if (transformTemplate) { transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); } else if (allowTransformNone && transformIsDefault) { transformString = "none"; } return transformString; } /** * Build a transformOrigin style. Uses the same defaults as the browser for * undefined origins. */ function buildTransformOrigin(_a) { var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d; return "".concat(originX, " ").concat(originY, " ").concat(originZ); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs /** * Returns true if the provided key is a CSS variable */ function isCSSVariable(key) { return key.startsWith("--"); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs /** * Provided a value and a ValueType, returns the value as that value type. */ var getValueAsType = function (value, type) { return type && typeof value === "number" ? type.transform(value) : value; }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/utils.mjs const clamp = (min, max) => (v) => Math.max(Math.min(v, max), min); const sanitize = (v) => (v % 1 ? Number(v.toFixed(5)) : v); const floatRegex = /(-)?([\d]*\.?[\d])+/g; const colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi; const singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i; function utils_isString(v) { return typeof v === 'string'; } ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/units.mjs const createUnitType = (unit) => ({ test: (v) => utils_isString(v) && v.endsWith(unit) && v.split(' ').length === 1, parse: parseFloat, transform: (v) => `${v}${unit}`, }); const degrees = createUnitType('deg'); const percent = createUnitType('%'); const units_px = createUnitType('px'); const vh = createUnitType('vh'); const vw = createUnitType('vw'); const progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) }); ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/index.mjs const number = { test: (v) => typeof v === 'number', parse: parseFloat, transform: (v) => v, }; const alpha = Object.assign(Object.assign({}, number), { transform: clamp(0, 1) }); const scale = Object.assign(Object.assign({}, number), { default: 1 }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs var type_int_int = __assign(__assign({}, number), { transform: Math.round }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs var numberValueTypes = { // Border props borderWidth: units_px, borderTopWidth: units_px, borderRightWidth: units_px, borderBottomWidth: units_px, borderLeftWidth: units_px, borderRadius: units_px, radius: units_px, borderTopLeftRadius: units_px, borderTopRightRadius: units_px, borderBottomRightRadius: units_px, borderBottomLeftRadius: units_px, // Positioning props width: units_px, maxWidth: units_px, height: units_px, maxHeight: units_px, size: units_px, top: units_px, right: units_px, bottom: units_px, left: units_px, // Spacing props padding: units_px, paddingTop: units_px, paddingRight: units_px, paddingBottom: units_px, paddingLeft: units_px, margin: units_px, marginTop: units_px, marginRight: units_px, marginBottom: units_px, marginLeft: units_px, // Transform props rotate: degrees, rotateX: degrees, rotateY: degrees, rotateZ: degrees, scale: scale, scaleX: scale, scaleY: scale, scaleZ: scale, skew: degrees, skewX: degrees, skewY: degrees, distance: units_px, translateX: units_px, translateY: units_px, translateZ: units_px, x: units_px, y: units_px, z: units_px, perspective: units_px, transformPerspective: units_px, opacity: alpha, originX: progressPercentage, originY: progressPercentage, originZ: units_px, // Misc zIndex: type_int_int, // SVG fillOpacity: alpha, strokeOpacity: alpha, numOctaves: type_int_int, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs function buildHTMLStyles(state, latestValues, options, transformTemplate) { var _a; var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin; // Empty the transformKeys array. As we're throwing out refs to its items // this might not be as cheap as suspected. Maybe using the array as a buffer // with a manual incrementation would be better. transformKeys.length = 0; // Track whether we encounter any transform or transformOrigin values. var hasTransform = false; var hasTransformOrigin = false; // Does the calculated transform essentially equal "none"? var transformIsNone = true; /** * Loop over all our latest animated values and decide whether to handle them * as a style or CSS variable. * * Transforms and transform origins are kept seperately for further processing. */ for (var key in latestValues) { var value = latestValues[key]; /** * If this is a CSS variable we don't do any further processing. */ if (isCSSVariable(key)) { vars[key] = value; continue; } // Convert the value to its default value type, ie 0 -> "0px" var valueType = numberValueTypes[key]; var valueAsType = getValueAsType(value, valueType); if (isTransformProp(key)) { // If this is a transform, flag to enable further transform processing hasTransform = true; transform[key] = valueAsType; transformKeys.push(key); // If we already know we have a non-default transform, early return if (!transformIsNone) continue; // Otherwise check to see if this is a default transform if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) transformIsNone = false; } else if (isTransformOriginProp(key)) { transformOrigin[key] = valueAsType; // If this is a transform origin, flag and enable further transform-origin processing hasTransformOrigin = true; } else { style[key] = valueAsType; } } if (hasTransform) { style.transform = buildTransform(state, options, transformIsNone, transformTemplate); } else if (transformTemplate) { style.transform = transformTemplate({}, ""); } else if (!latestValues.transform && style.transform) { style.transform = "none"; } if (hasTransformOrigin) { style.transformOrigin = buildTransformOrigin(transformOrigin); } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs var createHtmlRenderState = function () { return ({ style: {}, transform: {}, transformKeys: [], transformOrigin: {}, vars: {}, }); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.mjs function copyRawValuesOnly(target, source, props) { for (var key in source) { if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { target[key] = source[key]; } } } function useInitialMotionValues(_a, visualState, isStatic) { var transformTemplate = _a.transformTemplate; return (0,external_React_.useMemo)(function () { var state = createHtmlRenderState(); buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate); var vars = state.vars, style = state.style; return __assign(__assign({}, vars), style); }, [visualState]); } function useStyle(props, visualState, isStatic) { var styleProp = props.style || {}; var style = {}; /** * Copy non-Motion Values straight into style */ copyRawValuesOnly(style, styleProp, props); Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); if (props.transformValues) { style = props.transformValues(style); } return style; } function useHTMLProps(props, visualState, isStatic) { // The `any` isn't ideal but it is the type of createElement props argument var htmlProps = {}; var style = useStyle(props, visualState, isStatic); if (Boolean(props.drag) && props.dragListener !== false) { // Disable the ghost element when a user drags htmlProps.draggable = false; // Disable text selection style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; // Disable scrolling on the draggable direction style.touchAction = props.drag === true ? "none" : "pan-".concat(props.drag === "x" ? "y" : "x"); } htmlProps.style = style; return htmlProps; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs /** * A list of all valid MotionProps. * * @privateRemarks * This doesn't throw if a `MotionProp` name is missing - it should. */ var validMotionProps = new Set([ "initial", "animate", "exit", "style", "variants", "transition", "transformTemplate", "transformValues", "custom", "inherit", "layout", "layoutId", "layoutDependency", "onLayoutAnimationStart", "onLayoutAnimationComplete", "onLayoutMeasure", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "drag", "dragControls", "dragListener", "dragConstraints", "dragDirectionLock", "dragSnapToOrigin", "_dragX", "_dragY", "dragElastic", "dragMomentum", "dragPropagation", "dragTransition", "whileDrag", "onPan", "onPanStart", "onPanEnd", "onPanSessionStart", "onTap", "onTapStart", "onTapCancel", "onHoverStart", "onHoverEnd", "whileFocus", "whileTap", "whileHover", "whileInView", "onViewportEnter", "onViewportLeave", "viewport", "layoutScroll", ]); /** * Check whether a prop name is a valid `MotionProp` key. * * @param key - Name of the property to check * @returns `true` is key is a valid `MotionProp`. * * @public */ function isValidMotionProp(key) { return validMotionProps.has(key); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs var shouldForward = function (key) { return !isValidMotionProp(key); }; function loadExternalIsValidProp(isValidProp) { if (!isValidProp) return; // Explicitly filter our events shouldForward = function (key) { return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); }; } /** * Emotion and Styled Components both allow users to pass through arbitrary props to their components * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which * of these should be passed to the underlying DOM node. * * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of * `@emotion/is-prop-valid`, however to fix this problem we need to use it. * * By making it an optionalDependency we can offer this functionality only in the situations where it's * actually required. */ try { /** * We attempt to import this package but require won't be defined in esm environments, in that case * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed * in favour of explicit injection. */ loadExternalIsValidProp(require("@emotion/is-prop-valid").default); } catch (_a) { // We don't need to actually do anything here - the fallback is the existing `isPropValid`. } function filterProps(props, isDom, forwardMotionProps) { var filteredProps = {}; for (var key in props) { if (shouldForward(key) || (forwardMotionProps === true && isValidMotionProp(key)) || (!isDom && !isValidMotionProp(key)) || // If trying to use native HTML drag events, forward drag listeners (props["draggable"] && key.startsWith("onDrag"))) { filteredProps[key] = props[key]; } } return filteredProps; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs function calcOrigin(origin, offset, size) { return typeof origin === "string" ? origin : units_px.transform(offset + size * origin); } /** * The SVG transform origin defaults are different to CSS and is less intuitive, * so we use the measured dimensions of the SVG to reconcile these. */ function calcSVGTransformOrigin(dimensions, originX, originY) { var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width); var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height); return "".concat(pxOriginX, " ").concat(pxOriginY); } ;// CONCATENATED MODULE: ./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", }; /** * Build SVG path properties. Uses the path's measured length to convert * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset * and stroke-dasharray attributes. * * This function is mutative to reduce per-frame GC. */ function buildSVGPath(attrs, length, spacing, offset, useDashCase) { if (spacing === void 0) { spacing = 1; } if (offset === void 0) { offset = 0; } if (useDashCase === void 0) { useDashCase = true; } // Normalise path length by setting SVG attribute pathLength to 1 attrs.pathLength = 1; // We use dash case when setting attributes directly to the DOM node and camel case // when defining props on a React component. var keys = useDashCase ? dashKeys : camelKeys; // Build the dash offset attrs[keys.offset] = units_px.transform(-offset); // Build the dash array var pathLength = units_px.transform(length); var pathSpacing = units_px.transform(spacing); attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs /** * Build SVG visual attrbutes, like cx and style.transform */ function buildSVGAttrs(state, _a, options, transformTemplate) { var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, // This is object creation, which we try to avoid per-frame. latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); buildHTMLStyles(state, latest, options, transformTemplate); state.attrs = state.style; state.style = {}; var attrs = state.attrs, style = state.style, dimensions = state.dimensions; /** * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs * and copy it into style. */ if (attrs.transform) { if (dimensions) style.transform = attrs.transform; delete attrs.transform; } // Parse transformOrigin if (dimensions && (originX !== undefined || originY !== undefined || style.transform)) { style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); } // Treat x/y not as shortcuts but as actual attributes if (attrX !== undefined) attrs.x = attrX; if (attrY !== undefined) attrs.y = attrY; // Build SVG path if one has been defined if (pathLength !== undefined) { buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.mjs function useSVGProps(props, visualState) { var visualProps = (0,external_React_.useMemo)(function () { var state = createSvgRenderState(); buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate); return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) }); }, [visualState]); if (props.style) { var rawStyles = {}; copyRawValuesOnly(rawStyles, props.style, props); visualProps.style = __assign(__assign({}, rawStyles), visualProps.style); } return visualProps; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.mjs function createUseRender(forwardMotionProps) { if (forwardMotionProps === void 0) { forwardMotionProps = false; } var useRender = function (Component, props, projectionId, ref, _a, isStatic) { var latestValues = _a.latestValues; var useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; var visualProps = useVisualProps(props, latestValues, isStatic); var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref }); if (projectionId) { elementProps["data-projection-id"] = projectionId; } return (0,external_React_.createElement)(Component, elementProps); }; return useRender; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; var REPLACE_TEMPLATE = "$1-$2"; /** * Convert camelCase to dash-case properties. */ var camelToDash = function (str) { return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.mjs function renderHTML(element, _a, styleProp, projection) { var style = _a.style, vars = _a.vars; Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); // Loop over any CSS variables and assign those. for (var key in vars) { element.style.setProperty(key, vars[key]); } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs /** * A set of attribute names that are always read/written as camel case. */ var camelCaseAttributes = new Set([ "baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength", ]); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.mjs function renderSVG(element, renderState, _styleProp, projection) { renderHTML(element, renderState, undefined, projection); for (var key in renderState.attrs) { element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs function scrapeMotionValuesFromProps(props) { var style = props.style; var newValues = {}; for (var key in style) { if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { newValues[key] = style[key]; } } return newValues; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs function scrape_motion_values_scrapeMotionValuesFromProps(props) { var newValues = scrapeMotionValuesFromProps(props); for (var key in props) { if (isMotionValue(props[key])) { var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; newValues[targetKey] = props[key]; } } return newValues; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs function isAnimationControls(v) { return typeof v === "object" && typeof v.start === "function"; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs var isKeyframesTarget = function (v) { return Array.isArray(v); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.mjs var isCustomValue = function (v) { return Boolean(v && typeof v === "object" && v.mix && v.toValue); }; var resolveFinalValueInKeyframes = function (v) { // TODO maybe throw if v.length - 1 is placeholder token? return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs /** * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself * * TODO: Remove and move to library */ function resolveMotionValue(value) { var unwrappedValue = isMotionValue(value) ? value.get() : value; return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs function makeState(_a, props, context, presenceContext) { var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount; var state = { latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), renderState: createRenderState(), }; if (onMount) { state.mount = function (instance) { return onMount(props, instance, state); }; } return state; } var makeUseVisualState = function (config) { return function (props, isStatic) { var context = (0,external_React_.useContext)(MotionContext); var presenceContext = (0,external_React_.useContext)(PresenceContext); return isStatic ? makeState(config, props, context, presenceContext) : useConstant(function () { return makeState(config, props, context, presenceContext); }); }; }; function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { var values = {}; var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; var motionValues = scrapeMotionValues(props); for (var key in motionValues) { values[key] = resolveMotionValue(motionValues[key]); } var initial = props.initial, animate = props.animate; var isControllingVariants = checkIfControllingVariants(props); var isVariantNode = checkIfVariantNode(props); if (context && isVariantNode && !isControllingVariants && props.inherit !== false) { initial !== null && initial !== void 0 ? initial : (initial = context.initial); animate !== null && animate !== void 0 ? animate : (animate = context.animate); } var initialAnimationIsBlocked = blockInitialAnimation || initial === false; var variantToSet = initialAnimationIsBlocked ? animate : initial; if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; list.forEach(function (definition) { var resolved = resolveVariantFromProps(props, definition); if (!resolved) return; var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, ["transitionEnd", "transition"]); for (var key in target) { var valueTarget = target[key]; if (Array.isArray(valueTarget)) { /** * Take final keyframe if the initial animation is blocked because * we want to initialise at the end of that blocked animation. */ var index = initialAnimationIsBlocked ? valueTarget.length - 1 : 0; valueTarget = valueTarget[index]; } if (valueTarget !== null) { values[key] = valueTarget; } } for (var key in transitionEnd) values[key] = transitionEnd[key]; }); } return values; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.mjs var svgMotionConfig = { useVisualState: makeUseVisualState({ scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, createRenderState: createSvgRenderState, onMount: function (props, instance, _a) { var renderState = _a.renderState, latestValues = _a.latestValues; try { renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect(); } catch (e) { // Most likely trying to measure an unrendered element under Firefox renderState.dimensions = { x: 0, y: 0, width: 0, height: 0, }; } buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, props.transformTemplate); renderSVG(instance, renderState); }, }), }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.mjs var htmlMotionConfig = { useVisualState: makeUseVisualState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, createRenderState: createHtmlRenderState, }), }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs function create_config_createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) { var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b; var baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement, projectionNodeConstructor: projectionNodeConstructor, Component: Component }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/types.mjs var AnimationType; (function (AnimationType) { AnimationType["Animate"] = "animate"; AnimationType["Hover"] = "whileHover"; AnimationType["Tap"] = "whileTap"; AnimationType["Drag"] = "whileDrag"; AnimationType["Focus"] = "whileFocus"; AnimationType["InView"] = "whileInView"; AnimationType["Exit"] = "exit"; })(AnimationType || (AnimationType = {})); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-dom-event.mjs function addDomEvent(target, eventName, handler, options) { if (options === void 0) { options = { passive: true }; } target.addEventListener(eventName, handler, options); return function () { return target.removeEventListener(eventName, handler); }; } /** * Attaches an event listener directly to the provided DOM element. * * Bypassing React's event system can be desirable, for instance when attaching non-passive * event handlers. * * ```jsx * const ref = useRef(null) * * useDomEvent(ref, 'wheel', onWheel, { passive: false }) * * return <div ref={ref} /> * ``` * * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. * @param eventName - Name of the event you want listen for. * @param handler - Function to fire when receiving the event. * @param options - Options to pass to `Event.addEventListener`. * * @public */ function useDomEvent(ref, eventName, handler, options) { (0,external_React_.useEffect)(function () { var element = ref.current; if (handler && element) { return addDomEvent(element, eventName, handler, options); } }, [ref, eventName, handler, options]); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.mjs /** * * @param props * @param ref * @internal */ function useFocusGesture(_a) { var whileFocus = _a.whileFocus, visualElement = _a.visualElement; var onFocus = function () { var _a; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true); }; var onBlur = function () { var _a; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false); }; useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/event-type.mjs function isMouseEvent(event) { // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { return !!(event.pointerType === "mouse"); } return event instanceof MouseEvent; } function isTouchEvent(event) { var hasTouches = !!event.touches; return hasTouches; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.mjs /** * Filters out events not attached to the primary pointer (currently left mouse button) * @param eventHandler */ function filterPrimaryPointer(eventHandler) { return function (event) { var isMouseEvent = event instanceof MouseEvent; var isPrimaryPointer = !isMouseEvent || (isMouseEvent && event.button === 0); if (isPrimaryPointer) { eventHandler(event); } }; } var defaultPagePoint = { pageX: 0, pageY: 0 }; function pointFromTouch(e, pointType) { if (pointType === void 0) { pointType = "page"; } var primaryTouch = e.touches[0] || e.changedTouches[0]; var point = primaryTouch || defaultPagePoint; return { x: point[pointType + "X"], y: point[pointType + "Y"], }; } function pointFromMouse(point, pointType) { if (pointType === void 0) { pointType = "page"; } return { x: point[pointType + "X"], y: point[pointType + "Y"], }; } function extractEventInfo(event, pointType) { if (pointType === void 0) { pointType = "page"; } return { point: isTouchEvent(event) ? pointFromTouch(event, pointType) : pointFromMouse(event, pointType), }; } var wrapHandler = function (handler, shouldFilterPrimaryPointer) { if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; } var listener = function (event) { return handler(event, extractEventInfo(event)); }; return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/utils.mjs // We check for event support via functions in case they've been mocked by a testing suite. var supportsPointerEvents = function () { return is_browser_isBrowser && window.onpointerdown === null; }; var supportsTouchEvents = function () { return is_browser_isBrowser && window.ontouchstart === null; }; var supportsMouseEvents = function () { return is_browser_isBrowser && window.onmousedown === null; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-pointer-event.mjs var mouseEventNames = { pointerdown: "mousedown", pointermove: "mousemove", pointerup: "mouseup", pointercancel: "mousecancel", pointerover: "mouseover", pointerout: "mouseout", pointerenter: "mouseenter", pointerleave: "mouseleave", }; var touchEventNames = { pointerdown: "touchstart", pointermove: "touchmove", pointerup: "touchend", pointercancel: "touchcancel", }; function getPointerEventName(name) { if (supportsPointerEvents()) { return name; } else if (supportsTouchEvents()) { return touchEventNames[name]; } else if (supportsMouseEvents()) { return mouseEventNames[name]; } return name; } function addPointerEvent(target, eventName, handler, options) { return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); } function usePointerEvent(ref, eventName, handler, options) { return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs function createLock(name) { var lock = null; return function () { var openLock = function () { lock = null; }; if (lock === null) { lock = name; return openLock; } return false; }; } var globalHorizontalLock = createLock("dragHorizontal"); var globalVerticalLock = createLock("dragVertical"); function getGlobalLock(drag) { var lock = false; if (drag === "y") { lock = globalVerticalLock(); } else if (drag === "x") { lock = globalHorizontalLock(); } else { var openHorizontal_1 = globalHorizontalLock(); var openVertical_1 = globalVerticalLock(); if (openHorizontal_1 && openVertical_1) { lock = function () { openHorizontal_1(); openVertical_1(); }; } else { // Release the locks because we don't use them if (openHorizontal_1) openHorizontal_1(); if (openVertical_1) openVertical_1(); } } return lock; } function isDragActive() { // Check the gesture lock - if we get it, it means no drag gesture is active // and we can safely fire the tap gesture. var openGestureLock = getGlobalLock(true); if (!openGestureLock) return true; openGestureLock(); return false; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.mjs function createHoverEvent(visualElement, isActive, callback) { return function (event, info) { var _a; if (!isMouseEvent(event) || isDragActive()) return; /** * Ensure we trigger animations before firing event callback */ (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive); callback === null || callback === void 0 ? void 0 : callback(event, info); }; } function useHoverGesture(_a) { var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement; usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover ? createHoverEvent(visualElement, true, onHoverStart) : undefined, { passive: !onHoverStart }); usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover ? createHoverEvent(visualElement, false, onHoverEnd) : undefined, { passive: !onHoverEnd }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs /** * Recursively traverse up the tree to check whether the provided child node * is the parent or a descendant of it. * * @param parent - Element to find * @param child - Element to test against parent */ var isNodeOrChild = function (parent, child) { if (!child) { return false; } else if (parent === child) { return true; } else { return isNodeOrChild(parent, child.parentElement); } }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs function useUnmountEffect(callback) { return (0,external_React_.useEffect)(function () { return function () { return callback(); }; }, []); } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/pipe.mjs const combineFunctions = (a, b) => (v) => b(a(v)); const pipe_pipe = (...transformers) => transformers.reduce(combineFunctions); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.mjs /** * @param handlers - * @internal */ function useTapGesture(_a) { var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement; var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; var isPressing = (0,external_React_.useRef)(false); var cancelPointerEndListeners = (0,external_React_.useRef)(null); /** * Only set listener to passive if there are no external listeners. */ var eventOptions = { passive: !(onTapStart || onTap || onTapCancel || onPointerDown), }; function removePointerEndListener() { var _a; (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); cancelPointerEndListeners.current = null; } function checkPointerEnd() { var _a; removePointerEndListener(); isPressing.current = false; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false); return !isDragActive(); } function onPointerUp(event, info) { if (!checkPointerEnd()) return; /** * We only count this as a tap gesture if the event.target is the same * as, or a child of, this component's element */ !isNodeOrChild(visualElement.getInstance(), event.target) ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); } function onPointerCancel(event, info) { if (!checkPointerEnd()) return; onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); } function onPointerDown(event, info) { var _a; removePointerEndListener(); if (isPressing.current) return; isPressing.current = true; cancelPointerEndListeners.current = pipe_pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions)); /** * Ensure we trigger animations before firing event callback */ (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true); onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); } usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions); useUnmountEffect(removePointerEndListener); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/warn-once.mjs var warned = new Set(); function warnOnce(condition, message, element) { if (condition || warned.has(message)) return; console.warn(message); if (element) console.warn(element); warned.add(message); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs /** * Map an IntersectionHandler callback to an element. We only ever make one handler for one * element, so even though these handlers might all be triggered by different * observers, we can keep them in the same map. */ var observerCallbacks = new WeakMap(); /** * Multiple observers can be created for multiple element/document roots. Each with * different settings. So here we store dictionaries of observers to each root, * using serialised settings (threshold/margin) as lookup keys. */ var observers = new WeakMap(); var fireObserverCallback = function (entry) { var _a; (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); }; var fireAllObserverCallbacks = function (entries) { entries.forEach(fireObserverCallback); }; function initIntersectionObserver(_a) { var root = _a.root, options = __rest(_a, ["root"]); var lookupRoot = root || document; /** * If we don't have an observer lookup map for this root, create one. */ if (!observers.has(lookupRoot)) { observers.set(lookupRoot, {}); } var rootObservers = observers.get(lookupRoot); var key = JSON.stringify(options); /** * If we don't have an observer for this combination of root and settings, * create one. */ if (!rootObservers[key]) { rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, __assign({ root: root }, options)); } return rootObservers[key]; } function observeIntersection(element, options, callback) { var rootInteresectionObserver = initIntersectionObserver(options); observerCallbacks.set(element, callback); rootInteresectionObserver.observe(element); return function () { observerCallbacks.delete(element); rootInteresectionObserver.unobserve(element); }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/viewport/use-viewport.mjs function useViewport(_a) { var visualElement = _a.visualElement, whileInView = _a.whileInView, onViewportEnter = _a.onViewportEnter, onViewportLeave = _a.onViewportLeave, _b = _a.viewport, viewport = _b === void 0 ? {} : _b; var state = (0,external_React_.useRef)({ hasEnteredView: false, isInView: false, }); var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave); if (viewport.once && state.current.hasEnteredView) shouldObserve = false; var useObserver = typeof IntersectionObserver === "undefined" ? useMissingIntersectionObserver : useIntersectionObserver; useObserver(shouldObserve, state.current, visualElement, viewport); } var thresholdNames = { some: 0, all: 1, }; function useIntersectionObserver(shouldObserve, state, visualElement, _a) { var root = _a.root, rootMargin = _a.margin, _b = _a.amount, amount = _b === void 0 ? "some" : _b, once = _a.once; (0,external_React_.useEffect)(function () { if (!shouldObserve) return; var options = { root: root === null || root === void 0 ? void 0 : root.current, rootMargin: rootMargin, threshold: typeof amount === "number" ? amount : thresholdNames[amount], }; var intersectionCallback = function (entry) { var _a; var isIntersecting = entry.isIntersecting; /** * If there's been no change in the viewport state, early return. */ if (state.isInView === isIntersecting) return; state.isInView = isIntersecting; /** * Handle hasEnteredView. If this is only meant to run once, and * element isn't visible, early return. Otherwise set hasEnteredView to true. */ if (once && !isIntersecting && state.hasEnteredView) { return; } else if (isIntersecting) { state.hasEnteredView = true; } (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, isIntersecting); /** * Use the latest committed props rather than the ones in scope * when this observer is created */ var props = visualElement.getProps(); var callback = isIntersecting ? props.onViewportEnter : props.onViewportLeave; callback === null || callback === void 0 ? void 0 : callback(entry); }; return observeIntersection(visualElement.getInstance(), options, intersectionCallback); }, [shouldObserve, root, rootMargin, amount]); } /** * If IntersectionObserver is missing, we activate inView and fire onViewportEnter * on mount. This way, the page will be in the state the author expects users * to see it in for everyone. */ function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) { var _b = _a.fallback, fallback = _b === void 0 ? true : _b; (0,external_React_.useEffect)(function () { if (!shouldObserve || !fallback) return; if (env !== "production") { warnOnce(false, "IntersectionObserver not available on this device. whileInView animations will trigger on mount."); } /** * Fire this in an rAF because, at this point, the animation state * won't have flushed for the first time and there's certain logic in * there that behaves differently on the initial animation. * * This hook should be quite rarely called so setting this in an rAF * is preferred to changing the behaviour of the animation state. */ requestAnimationFrame(function () { var _a; state.hasEnteredView = true; var onViewportEnter = visualElement.getProps().onViewportEnter; onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null); (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.InView, true); }); }, [shouldObserve]); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.mjs var makeRenderlessComponent = function (hook) { return function (props) { hook(props); return null; }; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.mjs var gestureAnimations = { inView: makeRenderlessComponent(useViewport), tap: makeRenderlessComponent(useTapGesture), focus: makeRenderlessComponent(useFocusGesture), hover: makeRenderlessComponent(useHoverGesture), }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.mjs function shallowCompare(next, prev) { if (!Array.isArray(prev)) return false; var prevLength = prev.length; if (prevLength !== next.length) return false; for (var i = 0; i < prevLength; i++) { if (prev[i] !== next[i]) return false; } return true; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/clamp.mjs const clamp_clamp = (min, max, v) => Math.min(Math.max(v, min), max); ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/find-spring.mjs const safeMin = 0.001; const minDuration = 0.01; const maxDuration = 10.0; const minDamping = 0.05; const maxDamping = 1; function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) { let envelope; let derivative; warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less"); let dampingRatio = 1 - bounce; dampingRatio = clamp_clamp(minDamping, maxDamping, dampingRatio); duration = clamp_clamp(minDuration, maxDuration, duration / 1000); if (dampingRatio < 1) { envelope = (undampedFreq) => { const exponentialDecay = undampedFreq * dampingRatio; const delta = exponentialDecay * duration; const a = exponentialDecay - velocity; const b = calcAngularFreq(undampedFreq, dampingRatio); const c = Math.exp(-delta); return safeMin - (a / b) * c; }; derivative = (undampedFreq) => { const exponentialDecay = undampedFreq * dampingRatio; const delta = exponentialDecay * duration; const d = delta * velocity + velocity; const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration; const f = Math.exp(-delta); const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio); const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1; return (factor * ((d - e) * f)) / g; }; } else { envelope = (undampedFreq) => { const a = Math.exp(-undampedFreq * duration); const b = (undampedFreq - velocity) * duration + 1; return -safeMin + a * b; }; derivative = (undampedFreq) => { const a = Math.exp(-undampedFreq * duration); const b = (velocity - undampedFreq) * (duration * duration); return a * b; }; } const initialGuess = 5 / duration; const undampedFreq = approximateRoot(envelope, derivative, initialGuess); duration = duration * 1000; 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, }; } } const 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); } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/spring.mjs const durationKeys = ["duration", "bounce"]; const physicsKeys = ["stiffness", "damping", "mass"]; function isSpringType(options, keys) { return keys.some((key) => options[key] !== undefined); } function getSpringOptions(options) { let springOptions = Object.assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options); if (!isSpringType(options, physicsKeys) && isSpringType(options, durationKeys)) { const derived = findSpring(options); springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 }); springOptions.isResolvedFromDuration = true; } return springOptions; } function spring(_a) { var { from = 0.0, to = 1.0, restSpeed = 2, restDelta } = _a, options = __rest(_a, ["from", "to", "restSpeed", "restDelta"]); const state = { done: false, value: from }; let { stiffness, damping, mass, velocity, duration, isResolvedFromDuration, } = getSpringOptions(options); let resolveSpring = zero; let resolveVelocity = zero; function createSpring() { const initialVelocity = velocity ? -(velocity / 1000) : 0.0; const initialDelta = to - from; const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)); const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; if (restDelta === undefined) { restDelta = Math.min(Math.abs(to - from) / 100, 0.4); } if (dampingRatio < 1) { const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio); resolveSpring = (t) => { const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); return (to - envelope * (((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq) * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t))); }; resolveVelocity = (t) => { const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); return (dampingRatio * undampedAngularFreq * envelope * ((Math.sin(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta)) / angularFreq + initialDelta * Math.cos(angularFreq * t)) - envelope * (Math.cos(angularFreq * t) * (initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) - angularFreq * initialDelta * Math.sin(angularFreq * t))); }; } else if (dampingRatio === 1) { resolveSpring = (t) => to - Math.exp(-undampedAngularFreq * t) * (initialDelta + (initialVelocity + undampedAngularFreq * initialDelta) * t); } else { const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1); resolveSpring = (t) => { const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t); const freqForT = Math.min(dampedAngularFreq * t, 300); return (to - (envelope * ((initialVelocity + dampingRatio * undampedAngularFreq * initialDelta) * Math.sinh(freqForT) + dampedAngularFreq * initialDelta * Math.cosh(freqForT))) / dampedAngularFreq); }; } } createSpring(); return { next: (t) => { const current = resolveSpring(t); if (!isResolvedFromDuration) { const currentVelocity = resolveVelocity(t) * 1000; const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta; state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; } else { state.done = t >= duration; } state.value = state.done ? to : current; return state; }, flipTarget: () => { velocity = -velocity; [from, to] = [to, from]; createSpring(); }, }; } spring.needsInterpolation = (a, b) => typeof a === "string" || typeof b === "string"; const zero = (_t) => 0; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/progress.mjs const progress = (from, to, value) => { const toFromDifference = to - from; return toFromDifference === 0 ? 1 : (value - from) / toFromDifference; }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix.mjs const mix_mix = (from, to, progress) => -progress * from + progress * to + from; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/utils.mjs const isColorString = (type, testProp) => (v) => { return Boolean((utils_isString(v) && singleColorRegex.test(v) && v.startsWith(type)) || (testProp && Object.prototype.hasOwnProperty.call(v, testProp))); }; const splitColor = (aName, bName, cName) => (v) => { if (!utils_isString(v)) return v; const [a, b, c, alpha] = v.match(floatRegex); return { [aName]: parseFloat(a), [bName]: parseFloat(b), [cName]: parseFloat(c), alpha: alpha !== undefined ? parseFloat(alpha) : 1, }; }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/rgba.mjs const clampRgbUnit = clamp(0, 255); const rgbUnit = Object.assign(Object.assign({}, number), { transform: (v) => Math.round(clampRgbUnit(v)) }); const rgba_rgba = { 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)) + ')', }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hex.mjs function parseHex(v) { let r = ''; let g = ''; let b = ''; let a = ''; if (v.length > 5) { r = v.substr(1, 2); g = v.substr(3, 2); b = v.substr(5, 2); a = v.substr(7, 2); } else { r = v.substr(1, 1); g = v.substr(2, 1); b = v.substr(3, 1); a = v.substr(4, 1); r += r; g += g; b += b; a += a; } return { red: parseInt(r, 16), green: parseInt(g, 16), blue: parseInt(b, 16), alpha: a ? parseInt(a, 16) / 255 : 1, }; } const hex = { test: isColorString('#'), parse: parseHex, transform: rgba_rgba.transform, }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hsla.mjs const hsla_hsla = { 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)) + ')'); }, }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/hsla-to-rgba.mjs function hueToRgb(p, q, t) { if (t < 0) t += 1; if (t > 1) t -= 1; if (t < 1 / 6) return p + (q - p) * 6 * t; if (t < 1 / 2) return q; if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; return p; } function hslaToRgba({ hue, saturation, lightness, alpha }) { 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, }; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-color.mjs const mixLinearColor = (from, to, v) => { const fromExpo = from * from; const toExpo = to * to; return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo)); }; const colorTypes = [hex, rgba_rgba, hsla_hsla]; const getColorType = (v) => colorTypes.find((type) => type.test(v)); const notAnimatable = (color) => `'${color}' is not an animatable color. Use the equivalent color code instead.`; const mixColor = (from, to) => { let fromColorType = getColorType(from); let toColorType = getColorType(to); invariant(!!fromColorType, notAnimatable(from)); invariant(!!toColorType, notAnimatable(to)); let fromColor = fromColorType.parse(from); let toColor = toColorType.parse(to); if (fromColorType === hsla_hsla) { fromColor = hslaToRgba(fromColor); fromColorType = rgba_rgba; } if (toColorType === hsla_hsla) { toColor = hslaToRgba(toColor); toColorType = rgba_rgba; } const blended = Object.assign({}, fromColor); return (v) => { for (const key in blended) { if (key !== "alpha") { blended[key] = mixLinearColor(fromColor[key], toColor[key], v); } } blended.alpha = mix_mix(fromColor.alpha, toColor.alpha, v); return fromColorType.transform(blended); }; }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/index.mjs const color_color = { test: (v) => rgba_rgba.test(v) || hex.test(v) || hsla_hsla.test(v), parse: (v) => { if (rgba_rgba.test(v)) { return rgba_rgba.parse(v); } else if (hsla_hsla.test(v)) { return hsla_hsla.parse(v); } else { return hex.parse(v); } }, transform: (v) => { return utils_isString(v) ? v : v.hasOwnProperty('red') ? rgba_rgba.transform(v) : hsla_hsla.transform(v); }, }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/index.mjs const colorToken = '${c}'; const numberToken = '${n}'; function test(v) { var _a, _b, _c, _d; return (isNaN(v) && utils_isString(v) && ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0); } function analyse(v) { if (typeof v === 'number') v = `${v}`; const values = []; let numColors = 0; const colors = v.match(colorRegex); if (colors) { numColors = colors.length; v = v.replace(colorRegex, colorToken); values.push(...colors.map(color_color.parse)); } const numbers = v.match(floatRegex); if (numbers) { v = v.replace(floatRegex, numberToken); values.push(...numbers.map(number.parse)); } return { values, numColors, tokenised: v }; } function complex_parse(v) { return analyse(v).values; } function createTransformer(v) { const { values, numColors, tokenised } = analyse(v); const numValues = values.length; return (v) => { let output = tokenised; for (let i = 0; i < numValues; i++) { output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color_color.transform(v[i]) : sanitize(v[i])); } return output; }; } const convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v; function getAnimatableNone(v) { const parsed = complex_parse(v); const transformer = createTransformer(v); return transformer(parsed.map(convertNumbersToZero)); } const complex = { test, parse: complex_parse, createTransformer, getAnimatableNone }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/inc.mjs const zeroPoint = { x: 0, y: 0, z: 0 }; const isNum = (v) => typeof v === 'number'; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-complex.mjs function getMixer(origin, target) { if (isNum(origin)) { return (v) => mix_mix(origin, target, v); } else if (color_color.test(origin)) { return mixColor(origin, target); } else { return mixComplex(origin, target); } } const mixArray = (from, to) => { const output = [...from]; const numValues = output.length; const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i])); return (v) => { for (let i = 0; i < numValues; i++) { output[i] = blendValue[i](v); } return output; }; }; const mixObject = (origin, target) => { const output = Object.assign(Object.assign({}, origin), target); const blendValue = {}; for (const key in output) { if (origin[key] !== undefined && target[key] !== undefined) { blendValue[key] = getMixer(origin[key], target[key]); } } return (v) => { for (const key in blendValue) { output[key] = blendValue[key](v); } return output; }; }; function mix_complex_analyse(value) { const parsed = complex.parse(value); const numValues = parsed.length; let numNumbers = 0; let numRGB = 0; let numHSL = 0; for (let i = 0; i < numValues; i++) { if (numNumbers || typeof parsed[i] === "number") { numNumbers++; } else { if (parsed[i].hue !== undefined) { numHSL++; } else { numRGB++; } } } return { parsed, numNumbers, numRGB, numHSL }; } const mixComplex = (origin, target) => { const template = complex.createTransformer(target); const originStats = mix_complex_analyse(origin); const targetStats = mix_complex_analyse(target); const canInterpolate = originStats.numHSL === targetStats.numHSL && originStats.numRGB === targetStats.numRGB && originStats.numNumbers >= targetStats.numNumbers; if (canInterpolate) { return pipe_pipe(mixArray(originStats.parsed, targetStats.parsed), 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 (p) => `${p > 0 ? target : origin}`; } }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/interpolate.mjs const mixNumber = (from, to) => (p) => mix_mix(from, to, p); function detectMixerFactory(v) { if (typeof v === 'number') { return mixNumber; } else if (typeof v === 'string') { if (color_color.test(v)) { return mixColor; } else { return mixComplex; } } else if (Array.isArray(v)) { return mixArray; } else if (typeof v === 'object') { return mixObject; } } function createMixers(output, ease, 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 (ease) { const easingFunction = Array.isArray(ease) ? ease[i] : ease; mixer = pipe_pipe(easingFunction, mixer); } mixers.push(mixer); } return mixers; } function fastInterpolate([from, to], [mixer]) { return (v) => mixer(progress(from, to, v)); } function slowInterpolate(input, mixers) { const inputLength = input.length; const lastInputIndex = inputLength - 1; return (v) => { let mixerIndex = 0; let foundMixerIndex = false; if (v <= input[0]) { foundMixerIndex = true; } else if (v >= input[lastInputIndex]) { mixerIndex = lastInputIndex - 1; foundMixerIndex = true; } if (!foundMixerIndex) { let i = 1; for (; i < inputLength; i++) { if (input[i] > v || i === lastInputIndex) { break; } } mixerIndex = i - 1; } const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v); return mixers[mixerIndex](progressInRange); }; } function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) { const inputLength = input.length; invariant(inputLength === output.length, 'Both input and output ranges must be the same length'); invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.'); if (input[0] > input[inputLength - 1]) { input = [].concat(input); output = [].concat(output); input.reverse(); output.reverse(); } const mixers = createMixers(output, ease, mixer); const interpolator = inputLength === 2 ? fastInterpolate(input, mixers) : slowInterpolate(input, mixers); return isClamp ? (v) => interpolator(clamp_clamp(input[0], input[inputLength - 1], v)) : interpolator; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/utils.mjs const reverseEasing = easing => p => 1 - easing(1 - p); const mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2; const createExpoIn = (power) => p => Math.pow(p, power); const createBackIn = (power) => p => p * p * ((power + 1) * p - power); const createAnticipate = (power) => { const backEasing = createBackIn(power); return p => (p *= 2) < 1 ? 0.5 * backEasing(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/index.mjs const DEFAULT_OVERSHOOT_STRENGTH = 1.525; const BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0; const BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0; const BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0; const linear = p => p; const easeIn = createExpoIn(2); const easeOut = reverseEasing(easeIn); const easeInOut = mirrorEasing(easeIn); const circIn = p => 1 - Math.sin(Math.acos(p)); const circOut = reverseEasing(circIn); const circInOut = mirrorEasing(circOut); const backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH); const backOut = reverseEasing(backIn); const backInOut = mirrorEasing(backIn); const anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH); const ca = 4356.0 / 361.0; const cb = 35442.0 / 1805.0; const cc = 16061.0 / 1805.0; const bounceOut = (p) => { if (p === 1 || p === 0) return p; const p2 = p * p; return p < BOUNCE_FIRST_THRESHOLD ? 7.5625 * p2 : p < BOUNCE_SECOND_THRESHOLD ? 9.075 * p2 - 9.9 * p + 3.4 : p < BOUNCE_THIRD_THRESHOLD ? ca * p2 - cb * p + cc : 10.8 * p * p - 20.52 * p + 10.72; }; const bounceIn = reverseEasing(bounceOut); const bounceInOut = (p) => p < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0)) : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/keyframes.mjs function defaultEasing(values, easing) { return values.map(() => easing || easeInOut).splice(0, values.length - 1); } function defaultOffset(values) { const numValues = values.length; return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0); } function convertOffsetToTimes(offset, duration) { return offset.map((o) => o * duration); } function keyframes_keyframes({ from = 0, to = 1, ease, offset, duration = 300, }) { const state = { done: false, value: from }; const values = Array.isArray(to) ? to : [from, to]; const times = convertOffsetToTimes(offset && offset.length === values.length ? offset : defaultOffset(values), duration); function createInterpolator() { return interpolate(times, values, { ease: Array.isArray(ease) ? ease : defaultEasing(values, ease), }); } let interpolator = createInterpolator(); return { next: (t) => { state.value = interpolator(t); state.done = t >= duration; return state; }, flipTarget: () => { values.reverse(); interpolator = createInterpolator(); }, }; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/decay.mjs function decay({ velocity = 0, from = 0, power = 0.8, timeConstant = 350, restDelta = 0.5, modifyTarget, }) { const state = { done: false, value: from }; let amplitude = power * velocity; const ideal = from + amplitude; const target = modifyTarget === undefined ? ideal : modifyTarget(ideal); if (target !== ideal) amplitude = target - from; return { next: (t) => { const delta = -amplitude * Math.exp(-t / timeConstant); state.done = !(delta > restDelta || delta < -restDelta); state.value = state.done ? target : target + delta; return state; }, flipTarget: () => { }, }; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.mjs const types = { keyframes: keyframes_keyframes, spring: spring, decay: decay }; function detectAnimationFromOptions(config) { if (Array.isArray(config.to)) { return keyframes_keyframes; } else if (types[config.type]) { return types[config.type]; } const keys = new Set(Object.keys(config)); if (keys.has("ease") || (keys.has("duration") && !keys.has("dampingRatio"))) { return keyframes_keyframes; } else if (keys.has("dampingRatio") || keys.has("stiffness") || keys.has("mass") || keys.has("damping") || keys.has("restSpeed") || keys.has("restDelta")) { return spring; } return keyframes_keyframes; } ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/on-next-frame.mjs const defaultTimestep = (1 / 60) * 1000; const getCurrentTime = typeof performance !== "undefined" ? () => performance.now() : () => Date.now(); const onNextFrame = typeof window !== "undefined" ? (callback) => window.requestAnimationFrame(callback) : (callback) => setTimeout(() => callback(getCurrentTime()), defaultTimestep); ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/create-render-step.mjs function createRenderStep(runNextFrame) { let toRun = []; let toRunNextFrame = []; let numToRun = 0; let isProcessing = false; let flushNextFrame = false; const toKeepAlive = new WeakSet(); const step = { schedule: (callback, keepAlive = false, immediate = false) => { const addToCurrentFrame = immediate && isProcessing; const buffer = addToCurrentFrame ? toRun : toRunNextFrame; if (keepAlive) toKeepAlive.add(callback); if (buffer.indexOf(callback) === -1) { buffer.push(callback); if (addToCurrentFrame && isProcessing) numToRun = toRun.length; } return callback; }, cancel: (callback) => { const index = toRunNextFrame.indexOf(callback); if (index !== -1) toRunNextFrame.splice(index, 1); toKeepAlive.delete(callback); }, process: (frameData) => { if (isProcessing) { flushNextFrame = true; return; } isProcessing = 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(frameData); if (toKeepAlive.has(callback)) { step.schedule(callback); runNextFrame(); } } } isProcessing = false; if (flushNextFrame) { flushNextFrame = false; step.process(frameData); } }, }; return step; } ;// CONCATENATED MODULE: ./node_modules/framesync/dist/es/index.mjs const maxElapsed = 40; let useDefaultElapsed = true; let runNextFrame = false; let isProcessing = false; const es_frame = { delta: 0, timestamp: 0, }; const stepsOrder = [ "read", "update", "preRender", "render", "postRender", ]; const steps = stepsOrder.reduce((acc, key) => { acc[key] = createRenderStep(() => (runNextFrame = true)); return acc; }, {}); const sync = stepsOrder.reduce((acc, key) => { const step = steps[key]; acc[key] = (process, keepAlive = false, immediate = false) => { if (!runNextFrame) startLoop(); return step.schedule(process, keepAlive, immediate); }; return acc; }, {}); const cancelSync = stepsOrder.reduce((acc, key) => { acc[key] = steps[key].cancel; return acc; }, {}); const flushSync = stepsOrder.reduce((acc, key) => { acc[key] = () => steps[key].process(es_frame); return acc; }, {}); const processStep = (stepId) => steps[stepId].process(es_frame); const processFrame = (timestamp) => { runNextFrame = false; es_frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - es_frame.timestamp, maxElapsed), 1); es_frame.timestamp = timestamp; isProcessing = true; stepsOrder.forEach(processStep); isProcessing = false; if (runNextFrame) { useDefaultElapsed = false; onNextFrame(processFrame); } }; const startLoop = () => { runNextFrame = true; useDefaultElapsed = true; if (!isProcessing) onNextFrame(processFrame); }; const getFrameData = () => es_frame; /* harmony default export */ const es = (sync); ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/elapsed.mjs function loopElapsed(elapsed, duration, delay = 0) { return elapsed - duration - delay; } function reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) { return isForwardPlayback ? loopElapsed(duration + -elapsed, duration, delay) : duration - (elapsed - duration) + delay; } function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) { return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/index.mjs const framesync = (update) => { const passTimestamp = ({ delta }) => update(delta); return { start: () => es.update(passTimestamp, true), stop: () => cancelSync.update(passTimestamp), }; }; function animate(_a) { var _b, _c; var { from, autoplay = true, driver = framesync, elapsed = 0, repeat: repeatMax = 0, repeatType = "loop", repeatDelay = 0, onPlay, onStop, onComplete, onRepeat, onUpdate } = _a, options = __rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]); let { to } = options; let driverControls; let repeatCount = 0; let computedDuration = options.duration; let latest; let isComplete = false; let isForwardPlayback = true; let interpolateFromNumber; const animator = detectAnimationFromOptions(options); if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) { interpolateFromNumber = interpolate([0, 100], [from, to], { clamp: false, }); from = 0; to = 100; } const animation = animator(Object.assign(Object.assign({}, options), { from, to })); function repeat() { repeatCount++; if (repeatType === "reverse") { isForwardPlayback = repeatCount % 2 === 0; elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback); } else { elapsed = loopElapsed(elapsed, computedDuration, repeatDelay); if (repeatType === "mirror") animation.flipTarget(); } isComplete = false; onRepeat && onRepeat(); } function complete() { driverControls.stop(); onComplete && onComplete(); } function update(delta) { if (!isForwardPlayback) delta = -delta; elapsed += delta; if (!isComplete) { const state = animation.next(Math.max(0, elapsed)); latest = state.value; if (interpolateFromNumber) latest = interpolateFromNumber(latest); isComplete = isForwardPlayback ? state.done : elapsed <= 0; } onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest); if (isComplete) { if (repeatCount === 0) computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed); if (repeatCount < repeatMax) { hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat(); } else { complete(); } } } function play() { onPlay === null || onPlay === void 0 ? void 0 : onPlay(); driverControls = driver(update); driverControls.start(); } autoplay && play(); return { stop: () => { onStop === null || onStop === void 0 ? void 0 : onStop(); driverControls.stop(); }, }; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/velocity-per-second.mjs function velocityPerSecond(velocity, frameDuration) { return frameDuration ? velocity * (1000 / frameDuration) : 0; } ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/inertia.mjs function inertia({ from = 0, velocity = 0, min, max, power = 0.8, timeConstant = 750, bounceStiffness = 500, bounceDamping = 10, restDelta = 1, modifyTarget, driver, onUpdate, onComplete, onStop, }) { let currentAnimation; function isOutOfBounds(v) { return (min !== undefined && v < min) || (max !== undefined && v > max); } function boundaryNearest(v) { if (min === undefined) return max; if (max === undefined) return min; return Math.abs(min - v) < Math.abs(max - v) ? min : max; } function startAnimation(options) { currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); currentAnimation = animate(Object.assign(Object.assign({}, options), { driver, onUpdate: (v) => { var _a; onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v); (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v); }, onComplete, onStop })); } function startSpring(options) { startAnimation(Object.assign({ type: "spring", stiffness: bounceStiffness, damping: bounceDamping, restDelta }, options)); } if (isOutOfBounds(from)) { startSpring({ from, velocity, to: boundaryNearest(from) }); } else { let target = power * velocity + from; if (typeof modifyTarget !== "undefined") target = modifyTarget(target); const boundary = boundaryNearest(target); const heading = boundary === min ? -1 : 1; let prev; let current; const checkBoundary = (v) => { prev = current; current = v; velocity = velocityPerSecond(v - prev, getFrameData().delta); if ((heading === 1 && v > boundary) || (heading === -1 && v < boundary)) { startSpring({ from: v, to: boundary, velocity }); } }; startAnimation({ type: "decay", from, velocity, timeConstant, power, restDelta, modifyTarget, onUpdate: isOutOfBounds(target) ? checkBoundary : undefined, }); } return { stop: () => currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(), }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/time-conversion.mjs /** * Converts seconds to milliseconds * * @param seconds - Time in seconds. * @return milliseconds - Converted time in milliseconds. */ var secondsToMilliseconds = function (seconds) { return seconds * 1000; }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/cubic-bezier.mjs const a = (a1, a2) => 1.0 - 3.0 * a2 + 3.0 * a1; const b = (a1, a2) => 3.0 * a2 - 6.0 * a1; const c = (a1) => 3.0 * a1; const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t; const getSlope = (t, a1, a2) => 3.0 * a(a1, a2) * t * t + 2.0 * b(a1, a2) * t + c(a1); const subdivisionPrecision = 0.0000001; const subdivisionMaxIterations = 10; function binarySubdivide(aX, aA, aB, mX1, mX2) { let currentX; let currentT; let i = 0; do { currentT = aA + (aB - aA) / 2.0; currentX = calcBezier(currentT, mX1, mX2) - aX; if (currentX > 0.0) { aB = currentT; } else { aA = currentT; } } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); return currentT; } const newtonIterations = 8; const newtonMinSlope = 0.001; function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { for (let i = 0; i < newtonIterations; ++i) { const currentSlope = getSlope(aGuessT, mX1, mX2); if (currentSlope === 0.0) { return aGuessT; } const currentX = calcBezier(aGuessT, mX1, mX2) - aX; aGuessT -= currentX / currentSlope; } return aGuessT; } const kSplineTableSize = 11; const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); function cubicBezier(mX1, mY1, mX2, mY2) { if (mX1 === mY1 && mX2 === mY2) return linear; const sampleValues = new Float32Array(kSplineTableSize); for (let i = 0; i < kSplineTableSize; ++i) { sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); } function getTForX(aX) { let intervalStart = 0.0; let currentSample = 1; const lastSample = kSplineTableSize - 1; for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { intervalStart += kSampleStepSize; } --currentSample; const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); const guessForT = intervalStart + dist * kSampleStepSize; const initialSlope = getSlope(guessForT, mX1, mX2); if (initialSlope >= newtonMinSlope) { return newtonRaphsonIterate(aX, guessForT, mX1, mX2); } else if (initialSlope === 0.0) { return guessForT; } else { return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); } } return (t) => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/easing.mjs var easingLookup = { linear: linear, easeIn: easeIn, easeInOut: easeInOut, easeOut: easeOut, circIn: circIn, circInOut: circInOut, circOut: circOut, backIn: backIn, backInOut: backInOut, backOut: backOut, anticipate: anticipate, bounceIn: bounceIn, bounceInOut: bounceInOut, bounceOut: bounceOut, }; var easingDefinitionToFunction = function (definition) { if (Array.isArray(definition)) { // If cubic bezier definition, create bezier curve invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); var _a = tslib_es6_read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3]; return cubicBezier(x1, y1, x2, y2); } else if (typeof definition === "string") { // Else lookup from table invariant(easingLookup[definition] !== undefined, "Invalid easing type '".concat(definition, "'")); return easingLookup[definition]; } return definition; }; var isEasingArray = function (ease) { return Array.isArray(ease) && typeof ease[0] !== "number"; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs /** * Check if a value is animatable. Examples: * * ✅: 100, "100px", "#fff" * ❌: "block", "url(2.jpg)" * @param value * * @internal */ var isAnimatable = function (key, value) { // If the list of keys tat might be non-animatable grows, replace with Set if (key === "zIndex") return false; // If it's a number or a keyframes array, we can animate it. We might at some point // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, // but for now lets leave it like this for performance reasons if (typeof value === "number" || Array.isArray(value)) return true; if (typeof value === "string" && // It's animatable if we have a string complex.test(value) && // And it contains numbers and/or colors !value.startsWith("url(") // Unless it starts with "url(" ) { return true; } return false; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs var underDampedSpring = function () { return ({ type: "spring", stiffness: 500, damping: 25, restSpeed: 10, }); }; var criticallyDampedSpring = function (to) { return ({ type: "spring", stiffness: 550, damping: to === 0 ? 2 * Math.sqrt(550) : 30, restSpeed: 10, }); }; var linearTween = function () { return ({ type: "keyframes", ease: "linear", duration: 0.3, }); }; var default_transitions_keyframes = function (values) { return ({ type: "keyframes", duration: 0.8, values: values, }); }; var defaultTransitions = { x: underDampedSpring, y: underDampedSpring, z: underDampedSpring, rotate: underDampedSpring, rotateX: underDampedSpring, rotateY: underDampedSpring, rotateZ: underDampedSpring, scaleX: criticallyDampedSpring, scaleY: criticallyDampedSpring, scale: criticallyDampedSpring, opacity: linearTween, backgroundColor: linearTween, color: linearTween, default: criticallyDampedSpring, }; var getDefaultTransition = function (valueKey, to) { var transitionFactory; if (isKeyframesTarget(to)) { transitionFactory = default_transitions_keyframes; } else { transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default; } return __assign({ to: to }, transitionFactory(to)); }; ;// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/filter.mjs const maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']); function applyDefaultFilter(v) { let [name, value] = v.slice(0, -1).split('('); if (name === 'drop-shadow') return v; const [number] = value.match(floatRegex) || []; if (!number) return v; const unit = value.replace(number, ''); let defaultValue = maxDefaults.has(name) ? 1 : 0; if (number !== value) defaultValue *= 100; return name + '(' + defaultValue + unit + ')'; } const functionRegex = /([a-z-]*)\(.*?\)/g; const filter_filter = Object.assign(Object.assign({}, complex), { getAnimatableNone: (v) => { const functions = v.match(functionRegex); return functions ? functions.map(applyDefaultFilter).join(' ') : v; } }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs /** * A map of default value types for common values */ var defaultValueTypes = __assign(__assign({}, numberValueTypes), { // Color props color: color_color, backgroundColor: color_color, outlineColor: color_color, fill: color_color, stroke: color_color, // Border props borderColor: color_color, borderTopColor: color_color, borderRightColor: color_color, borderBottomColor: color_color, borderLeftColor: color_color, filter: filter_filter, WebkitFilter: filter_filter }); /** * Gets the default ValueType for the provided value key */ var getDefaultValueType = function (key) { return defaultValueTypes[key]; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs function animatable_none_getAnimatableNone(key, value) { var _a; var defaultValueType = getDefaultValueType(key); if (defaultValueType !== filter_filter) defaultValueType = complex; // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs var instantAnimationState = { current: false, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/transitions.mjs /** * Decide whether a transition is defined on a given Transition. * This filters out orchestration options and returns true * if any options are left. */ function isTransitionDefined(_a) { _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); return !!Object.keys(transition).length; } var legacyRepeatWarning = false; /** * Convert Framer Motion's Transition type into Popmotion-compatible options. */ function convertTransitionToAnimationOptions(_a) { var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); var options = __assign({}, transition); if (times) options["offset"] = times; /** * Convert any existing durations from seconds to milliseconds */ if (transition.duration) options["duration"] = secondsToMilliseconds(transition.duration); if (transition.repeatDelay) options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); /** * Map easing names to Popmotion's easing functions */ if (ease) { options["ease"] = isEasingArray(ease) ? ease.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease); } /** * Support legacy transition API */ if (transition.type === "tween") options.type = "keyframes"; /** * TODO: These options are officially removed from the API. */ if (yoyo || loop || flip) { warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); legacyRepeatWarning = true; if (yoyo) { options.repeatType = "reverse"; } else if (loop) { options.repeatType = "loop"; } else if (flip) { options.repeatType = "mirror"; } options.repeat = loop || yoyo || flip || transition.repeat; } /** * TODO: Popmotion 9 has the ability to automatically detect whether to use * a keyframes or spring animation, but does so by detecting velocity and other spring options. * It'd be good to introduce a similar thing here. */ if (transition.type !== "spring") options.type = "keyframes"; return options; } /** * Get the delay for a value by checking Transition with decreasing specificity. */ function getDelayFromTransition(transition, key) { var _a, _b; var valueTransition = getValueTransition(transition, key) || {}; return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0; } function hydrateKeyframes(options) { if (Array.isArray(options.to) && options.to[0] === null) { options.to = tslib_es6_spreadArray([], tslib_es6_read(options.to), false); options.to[0] = options.from; } return options; } function getPopmotionAnimationOptions(transition, options, key) { var _a; if (Array.isArray(options.to)) { (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8); } hydrateKeyframes(options); /** * Get a default transition if none is determined to be defined. */ if (!isTransitionDefined(transition)) { transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to)); } return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition)); } /** * */ function getAnimation(key, value, target, transition, onComplete) { var _a; var valueTransition = getValueTransition(transition, key); var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); var isTargetAnimatable = isAnimatable(key, target); if (origin === "none" && isTargetAnimatable && typeof target === "string") { /** * If we're trying to animate from "none", try and get an animatable version * of the target. This could be improved to work both ways. */ origin = animatable_none_getAnimatableNone(key, target); } else if (isZero(origin) && typeof target === "string") { origin = getZeroUnit(target); } else if (!Array.isArray(target) && isZero(target) && typeof origin === "string") { target = getZeroUnit(origin); } var isOriginAnimatable = isAnimatable(key, origin); warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate ".concat(key, " from \"").concat(origin, "\" to \"").concat(target, "\". ").concat(origin, " is not an animatable value - to enable this animation set ").concat(origin, " to a value animatable to ").concat(target, " via the `style` property.")); function start() { var options = { from: origin, to: target, velocity: value.getVelocity(), onComplete: onComplete, onUpdate: function (v) { return value.set(v); }, }; return valueTransition.type === "inertia" || valueTransition.type === "decay" ? inertia(__assign(__assign({}, options), valueTransition)) : animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) { var _a; options.onUpdate(v); (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); }, onComplete: function () { var _a; options.onComplete(); (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); } })); } function set() { var _a, _b; var finalTarget = resolveFinalValueInKeyframes(target); value.set(finalTarget); onComplete(); (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget); (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition); return { stop: function () { } }; } return !isOriginAnimatable || !isTargetAnimatable || valueTransition.type === false ? set : start; } function isZero(value) { return (value === 0 || (typeof value === "string" && parseFloat(value) === 0 && value.indexOf(" ") === -1)); } function getZeroUnit(potentialUnitType) { return typeof potentialUnitType === "number" ? 0 : animatable_none_getAnimatableNone("", potentialUnitType); } function getValueTransition(transition, key) { return transition[key] || transition["default"] || transition; } /** * Start animation on a MotionValue. This function is an interface between * Framer Motion and Popmotion */ function startAnimation(key, value, target, transition) { if (transition === void 0) { transition = {}; } if (instantAnimationState.current) { transition = { type: false }; } return value.start(function (onComplete) { var delayTimer; var controls; var animation = getAnimation(key, value, target, transition, onComplete); var delay = getDelayFromTransition(transition, key); var start = function () { return (controls = animation()); }; if (delay) { delayTimer = window.setTimeout(start, secondsToMilliseconds(delay)); } else { start(); } return function () { clearTimeout(delayTimer); controls === null || controls === void 0 ? void 0 : controls.stop(); }; }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs /** * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" */ var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs /** * Check if the value is a zero value string like "0px" or "0%" */ var isZeroValueString = function (v) { return /^0[^.\s]+$/.test(v); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/array.mjs function addUniqueItem(arr, item) { arr.indexOf(item) === -1 && arr.push(item); } function removeItem(arr, item) { var index = arr.indexOf(item); index > -1 && arr.splice(index, 1); } // Adapted from array-move function moveItem(_a, fromIndex, toIndex) { var _b = __read(_a), arr = _b.slice(0); var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; if (startIndex >= 0 && startIndex < arr.length) { var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; var _c = __read(arr.splice(fromIndex, 1), 1), item = _c[0]; arr.splice(endIndex, 0, item); } return arr; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/subscription-manager.mjs var SubscriptionManager = /** @class */ (function () { function SubscriptionManager() { this.subscriptions = []; } SubscriptionManager.prototype.add = function (handler) { var _this = this; addUniqueItem(this.subscriptions, handler); return function () { return removeItem(_this.subscriptions, handler); }; }; SubscriptionManager.prototype.notify = function (a, b, c) { var numSubscriptions = this.subscriptions.length; if (!numSubscriptions) return; if (numSubscriptions === 1) { /** * If there's only a single handler we can just call it without invoking a loop. */ this.subscriptions[0](a, b, c); } else { for (var i = 0; i < numSubscriptions; i++) { /** * Check whether the handler exists before firing as it's possible * the subscriptions were modified during this loop running. */ var handler = this.subscriptions[i]; handler && handler(a, b, c); } } }; SubscriptionManager.prototype.getSize = function () { return this.subscriptions.length; }; SubscriptionManager.prototype.clear = function () { this.subscriptions.length = 0; }; return SubscriptionManager; }()); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/index.mjs var isFloat = function (value) { return !isNaN(parseFloat(value)); }; /** * `MotionValue` is used to track the state and velocity of motion values. * * @public */ var MotionValue = /** @class */ (function () { /** * @param init - The initiating value * @param config - Optional configuration options * * - `transformer`: A function to transform incoming values with. * * @internal */ function MotionValue(init) { var _this = this; /** * This will be replaced by the build step with the latest version number. * When MotionValues are provided to motion components, warn if versions are mixed. */ this.version = "6.5.1"; /** * Duration, in milliseconds, since last updating frame. * * @internal */ this.timeDelta = 0; /** * Timestamp of the last time this `MotionValue` was updated. * * @internal */ this.lastUpdated = 0; /** * Functions to notify when the `MotionValue` updates. * * @internal */ this.updateSubscribers = new SubscriptionManager(); /** * Functions to notify when the velocity updates. * * @internal */ this.velocityUpdateSubscribers = new SubscriptionManager(); /** * Functions to notify when the `MotionValue` updates and `render` is set to `true`. * * @internal */ this.renderSubscribers = new SubscriptionManager(); /** * Tracks whether this value can output a velocity. Currently this is only true * if the value is numerical, but we might be able to widen the scope here and support * other value types. * * @internal */ this.canTrackVelocity = false; this.updateAndNotify = function (v, render) { if (render === void 0) { render = true; } _this.prev = _this.current; _this.current = v; // Update timestamp var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp; if (_this.lastUpdated !== timestamp) { _this.timeDelta = delta; _this.lastUpdated = timestamp; es.postRender(_this.scheduleVelocityCheck); } // Update update subscribers if (_this.prev !== _this.current) { _this.updateSubscribers.notify(_this.current); } // Update velocity subscribers if (_this.velocityUpdateSubscribers.getSize()) { _this.velocityUpdateSubscribers.notify(_this.getVelocity()); } // Update render subscribers if (render) { _this.renderSubscribers.notify(_this.current); } }; /** * Schedule a velocity check for the next frame. * * This is an instanced and bound function to prevent generating a new * function once per frame. * * @internal */ this.scheduleVelocityCheck = function () { return es.postRender(_this.velocityCheck); }; /** * Updates `prev` with `current` if the value hasn't been updated this frame. * This ensures velocity calculations return `0`. * * This is an instanced and bound function to prevent generating a new * function once per frame. * * @internal */ this.velocityCheck = function (_a) { var timestamp = _a.timestamp; if (timestamp !== _this.lastUpdated) { _this.prev = _this.current; _this.velocityUpdateSubscribers.notify(_this.getVelocity()); } }; this.hasAnimated = false; this.prev = this.current = init; this.canTrackVelocity = isFloat(this.current); } /** * 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.onChange(updateOpacity) * const unsubscribeY = y.onChange(updateOpacity) * * return () => { * unsubscribeX() * unsubscribeY() * } * }, []) * * return <motion.div style={{ x }} /> * } * ``` * * @privateRemarks * * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. * * ```jsx * useOnChange(x, () => {}) * ``` * * @param subscriber - A function that receives the latest value. * @returns A function that, when called, will cancel this subscription. * * @public */ MotionValue.prototype.onChange = function (subscription) { return this.updateSubscribers.add(subscription); }; MotionValue.prototype.clearListeners = function () { this.updateSubscribers.clear(); }; /** * Adds a function that will be notified when the `MotionValue` requests a render. * * @param subscriber - A function that's provided the latest value. * @returns A function that, when called, will cancel this subscription. * * @internal */ MotionValue.prototype.onRenderRequest = function (subscription) { // Render immediately subscription(this.get()); return this.renderSubscribers.add(subscription); }; /** * Attaches a passive effect to the `MotionValue`. * * @internal */ MotionValue.prototype.attach = function (passiveEffect) { this.passiveEffect = passiveEffect; }; /** * 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 */ MotionValue.prototype.set = function (v, render) { if (render === void 0) { render = true; } if (!render || !this.passiveEffect) { this.updateAndNotify(v, render); } else { this.passiveEffect(v, this.updateAndNotify); } }; /** * Returns the latest state of `MotionValue` * * @returns - The latest state of `MotionValue` * * @public */ MotionValue.prototype.get = function () { return this.current; }; /** * @public */ MotionValue.prototype.getPrevious = function () { return this.prev; }; /** * Returns the latest velocity of `MotionValue` * * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. * * @public */ MotionValue.prototype.getVelocity = function () { // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful 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 */ MotionValue.prototype.start = function (animation) { var _this = this; this.stop(); return new Promise(function (resolve) { _this.hasAnimated = true; _this.stopAnimation = animation(resolve); }).then(function () { return _this.clearAnimation(); }); }; /** * Stop the currently active animation. * * @public */ MotionValue.prototype.stop = function () { if (this.stopAnimation) this.stopAnimation(); this.clearAnimation(); }; /** * Returns `true` if this value is currently animating. * * @public */ MotionValue.prototype.isAnimating = function () { return !!this.stopAnimation; }; MotionValue.prototype.clearAnimation = function () { this.stopAnimation = null; }; /** * 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 */ MotionValue.prototype.destroy = function () { this.updateSubscribers.clear(); this.renderSubscribers.clear(); this.stop(); }; return MotionValue; }()); function motionValue(init) { return new MotionValue(init); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs /** * Tests a provided value against a ValueType */ var testValueType = function (v) { return function (type) { return type.test(v); }; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs /** * ValueType for "auto" */ var auto = { test: function (v) { return v === "auto"; }, parse: function (v) { return v; }, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs /** * A list of value types commonly used for dimensions */ var dimensionValueTypes = [number, units_px, percent, degrees, vw, vh, auto]; /** * Tests a dimensional value against the list of dimension ValueTypes */ var findDimensionValueType = function (v) { return dimensionValueTypes.find(testValueType(v)); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs /** * A list of all ValueTypes */ var valueTypes = tslib_es6_spreadArray(tslib_es6_spreadArray([], tslib_es6_read(dimensionValueTypes), false), [color_color, complex], false); /** * Tests a value against the list of ValueTypes */ var findValueType = function (v) { return valueTypes.find(testValueType(v)); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.mjs /** * Set VisualElement's MotionValue, creating a new MotionValue for it if * it doesn't exist. */ function setMotionValue(visualElement, key, value) { if (visualElement.hasValue(key)) { visualElement.getValue(key).set(value); } else { visualElement.addValue(key, motionValue(value)); } } function setTarget(visualElement, definition) { var resolved = resolveVariant(visualElement, definition); var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]); target = __assign(__assign({}, target), transitionEnd); for (var key in target) { var value = resolveFinalValueInKeyframes(target[key]); setMotionValue(visualElement, key, value); } } function setVariants(visualElement, variantLabels) { var reversedLabels = __spreadArray([], __read(variantLabels), false).reverse(); reversedLabels.forEach(function (key) { var _a; var variant = visualElement.getVariant(key); variant && setTarget(visualElement, variant); (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { setVariants(child, variantLabels); }); }); } function setValues(visualElement, definition) { if (Array.isArray(definition)) { return setVariants(visualElement, definition); } else if (typeof definition === "string") { return setVariants(visualElement, [definition]); } else { setTarget(visualElement, definition); } } function checkTargetForNewValues(visualElement, target, origin) { var _a, _b, _c; var _d; var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); }); var numNewValues = newValueKeys.length; if (!numNewValues) return; for (var i = 0; i < numNewValues; i++) { var key = newValueKeys[i]; var targetValue = target[key]; var value = null; /** * If the target is a series of keyframes, we can use the first value * in the array. If this first value is null, we'll still need to read from the DOM. */ if (Array.isArray(targetValue)) { value = targetValue[0]; } /** * If the target isn't keyframes, or the first keyframe was null, we need to * first check if an origin value was explicitly defined in the transition as "from", * if not read the value from the DOM. As an absolute fallback, take the defined target value. */ if (value === null) { value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; } /** * If value is still undefined or null, ignore it. Preferably this would throw, * but this was causing issues in Framer. */ if (value === undefined || value === null) continue; if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { // If this is a number read as a string, ie "0" or "200", convert it to a number value = parseFloat(value); } else if (!findValueType(value) && complex.test(targetValue)) { value = animatable_none_getAnimatableNone(key, targetValue); } visualElement.addValue(key, motionValue(value)); (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value); visualElement.setBaseTarget(key, value); } } function getOriginFromTransition(key, transition) { if (!transition) return; var valueTransition = transition[key] || transition["default"] || transition; return valueTransition.from; } function getOrigin(target, transition, visualElement) { var _a, _b; var origin = {}; for (var key in target) { origin[key] = (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); } return origin; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation.mjs function animateVisualElement(visualElement, definition, options) { if (options === void 0) { options = {}; } visualElement.notifyAnimationStart(definition); var animation; if (Array.isArray(definition)) { var animations = definition.map(function (variant) { return animateVariant(visualElement, variant, options); }); animation = Promise.all(animations); } else if (typeof definition === "string") { animation = animateVariant(visualElement, definition, options); } else { var resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition; animation = animateTarget(visualElement, resolvedDefinition, options); } return animation.then(function () { return visualElement.notifyAnimationComplete(definition); }); } function animateVariant(visualElement, variant, options) { var _a; if (options === void 0) { options = {}; } var resolved = resolveVariant(visualElement, variant, options.custom); var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; if (options.transitionOverride) { transition = options.transitionOverride; } /** * If we have a variant, create a callback that runs it as an animation. * Otherwise, we resolve a Promise immediately for a composable no-op. */ var getAnimation = resolved ? function () { return animateTarget(visualElement, resolved, options); } : function () { return Promise.resolve(); }; /** * If we have children, create a callback that runs all their animations. * Otherwise, we resolve a Promise immediately for a composable no-op. */ var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) ? function (forwardDelay) { if (forwardDelay === void 0) { forwardDelay = 0; } var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection; return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); } : function () { return Promise.resolve(); }; /** * If the transition explicitly defines a "when" option, we need to resolve either * this animation or all children animations before playing the other. */ var when = transition.when; if (when) { var _c = tslib_es6_read(when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1]; return first().then(last); } else { return Promise.all([getAnimation(), getChildAnimations(options.delay)]); } } /** * @internal */ function animateTarget(visualElement, definition, _a) { var _b; var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type; var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, ["transition", "transitionEnd"]); if (transitionOverride) transition = transitionOverride; var animations = []; var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); for (var key in target) { var value = visualElement.getValue(key); var valueTarget = target[key]; if (!value || valueTarget === undefined || (animationTypeState && shouldBlockAnimation(animationTypeState, key))) { continue; } var valueTransition = __assign({ delay: delay }, transition); /** * Make animation instant if this is a transform prop and we should reduce motion. */ if (visualElement.shouldReduceMotion && isTransformProp(key)) { valueTransition = __assign(__assign({}, valueTransition), { type: false, delay: 0 }); } var animation = startAnimation(key, value, valueTarget, valueTransition); animations.push(animation); } return Promise.all(animations).then(function () { transitionEnd && setTarget(visualElement, transitionEnd); }); } function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { if (delayChildren === void 0) { delayChildren = 0; } if (staggerChildren === void 0) { staggerChildren = 0; } if (staggerDirection === void 0) { staggerDirection = 1; } var animations = []; var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; var generateStaggerDuration = staggerDirection === 1 ? function (i) { if (i === void 0) { i = 0; } return i * staggerChildren; } : function (i) { if (i === void 0) { i = 0; } return maxStaggerDuration - i * staggerChildren; }; Array.from(visualElement.variantChildren) .sort(sortByTreeOrder) .forEach(function (child, i) { animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); })); }); return Promise.all(animations); } function stopAnimation(visualElement) { visualElement.forEachValue(function (value) { return value.stop(); }); } function sortByTreeOrder(a, b) { return a.sortNodePosition(b); } /** * Decide whether we should block this animation. Previously, we achieved this * just by checking whether the key was listed in protectedKeys, but this * posed problems if an animation was triggered by afterChildren and protectedKeys * had been set to true in the meantime. */ function shouldBlockAnimation(_a, key) { var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating; var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; needsAnimating[key] = false; return shouldBlock; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.mjs var variantPriorityOrder = [ AnimationType.Animate, AnimationType.InView, AnimationType.Focus, AnimationType.Hover, AnimationType.Tap, AnimationType.Drag, AnimationType.Exit, ]; var reversePriorityOrder = tslib_es6_spreadArray([], tslib_es6_read(variantPriorityOrder), false).reverse(); var numAnimationTypes = variantPriorityOrder.length; function animateList(visualElement) { return function (animations) { return Promise.all(animations.map(function (_a) { var animation = _a.animation, options = _a.options; return animateVisualElement(visualElement, animation, options); })); }; } function createAnimationState(visualElement) { var animate = animateList(visualElement); var state = createState(); var allAnimatedKeys = {}; var isInitialRender = true; /** * This function will be used to reduce the animation definitions for * each active animation type into an object of resolved values for it. */ var buildResolvedTypeValues = function (acc, definition) { var resolved = resolveVariant(visualElement, definition); if (resolved) { resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]); acc = __assign(__assign(__assign({}, acc), target), transitionEnd); } return acc; }; function isAnimated(key) { return allAnimatedKeys[key] !== undefined; } /** * This just allows us to inject mocked animation functions * @internal */ function setAnimateFunction(makeAnimator) { animate = makeAnimator(visualElement); } /** * When we receive new props, we need to: * 1. Create a list of protected keys for each type. This is a directory of * value keys that are currently being "handled" by types of a higher priority * so that whenever an animation is played of a given type, these values are * protected from being animated. * 2. Determine if an animation type needs animating. * 3. Determine if any values have been removed from a type and figure out * what to animate those to. */ function animateChanges(options, changedActiveType) { var _a; var props = visualElement.getProps(); var context = visualElement.getVariantContext(true) || {}; /** * A list of animations that we'll build into as we iterate through the animation * types. This will get executed at the end of the function. */ var animations = []; /** * Keep track of which values have been removed. Then, as we hit lower priority * animation types, we can check if they contain removed values and animate to that. */ var removedKeys = new Set(); /** * A dictionary of all encountered keys. This is an object to let us build into and * copy it without iteration. Each time we hit an animation type we set its protected * keys - the keys its not allowed to animate - to the latest version of this object. */ var encounteredKeys = {}; /** * If a variant has been removed at a given index, and this component is controlling * variant animations, we want to ensure lower-priority variants are forced to animate. */ var removedVariantIndex = Infinity; var _loop_1 = function (i) { var type = reversePriorityOrder[i]; var typeState = state[type]; var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; var propIsVariant = isVariantLabel(prop); /** * If this type has *just* changed isActive status, set activeDelta * to that status. Otherwise set to null. */ var activeDelta = type === changedActiveType ? typeState.isActive : null; if (activeDelta === false) removedVariantIndex = i; /** * If this prop is an inherited variant, rather than been set directly on the * component itself, we want to make sure we allow the parent to trigger animations. * * TODO: Can probably change this to a !isControllingVariants check */ var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; /** * */ if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { isInherited = false; } /** * Set all encountered keys so far as the protected keys for this type. This will * be any key that has been animated or otherwise handled by active, higher-priortiy types. */ typeState.protectedKeys = __assign({}, encounteredKeys); // Check if we can skip analysing this prop early 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") { return "continue"; } /** * As we go look through the values defined on this type, if we detect * a changed value or a value that was removed in a higher priority, we set * this to true and add this prop to the animation list. */ var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); var 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); /** * As animations can be set as variant lists, variants or target objects, we * coerce everything to an array if it isn't one already */ var definitionList = Array.isArray(prop) ? prop : [prop]; /** * Build an object of all the resolved values. We'll use this in the subsequent * animateChanges calls to determine whether a value has changed. */ var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); if (activeDelta === false) resolvedValues = {}; /** * Now we need to loop through all the keys in the prev prop and this prop, * and decide: * 1. If the value has changed, and needs animating * 2. If it has been removed, and needs adding to the removedKeys set * 3. If it has been removed in a higher priority type and needs animating * 4. If it hasn't been removed in a higher priority but hasn't changed, and * needs adding to the type's protectedKeys list. */ var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b; var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues); var markToAnimate = function (key) { shouldAnimateType = true; removedKeys.delete(key); typeState.needsAnimating[key] = true; }; for (var key in allKeys) { var next = resolvedValues[key]; var prev = prevResolvedValues[key]; // If we've already handled this we can just skip ahead if (encounteredKeys.hasOwnProperty(key)) continue; /** * If the value has changed, we probably want to animate it. */ if (next !== prev) { /** * If both values are keyframes, we need to shallow compare them to * detect whether any value has changed. If it has, we animate it. */ if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { if (!shallowCompare(next, prev) || variantDidChange) { markToAnimate(key); } else { /** * If it hasn't changed, we want to ensure it doesn't animate by * adding it to the list of protected keys. */ typeState.protectedKeys[key] = true; } } else if (next !== undefined) { // If next is defined and doesn't equal prev, it needs animating markToAnimate(key); } else { // If it's undefined, it's been removed. removedKeys.add(key); } } else if (next !== undefined && removedKeys.has(key)) { /** * If next hasn't changed and it isn't undefined, we want to check if it's * been removed by a higher priority */ markToAnimate(key); } else { /** * If it hasn't changed, we add it to the list of protected values * to ensure it doesn't get animated. */ typeState.protectedKeys[key] = true; } } /** * Update the typeState so next time animateChanges is called we can compare the * latest prop and resolvedValues to these. */ typeState.prevProp = prop; typeState.prevResolvedValues = resolvedValues; /** * */ if (typeState.isActive) { encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues); } if (isInitialRender && visualElement.blockInitialAnimation) { shouldAnimateType = false; } /** * If this is an inherited prop we want to hard-block animations * TODO: Test as this should probably still handle animations triggered * by removed values? */ if (shouldAnimateType && !isInherited) { animations.push.apply(animations, tslib_es6_spreadArray([], tslib_es6_read(definitionList.map(function (animation) { return ({ animation: animation, options: __assign({ type: type }, options), }); })), false)); } }; /** * Iterate through all animation types in reverse priority order. For each, we want to * detect which values it's handling and whether or not they've changed (and therefore * need to be animated). If any values have been removed, we want to detect those in * lower priority props and flag for animation. */ for (var i = 0; i < numAnimationTypes; i++) { _loop_1(i); } allAnimatedKeys = __assign({}, encounteredKeys); /** * If there are some removed value that haven't been dealt with, * we need to create a new animation that falls back either to the value * defined in the style prop, or the last read value. */ if (removedKeys.size) { var fallbackAnimation_1 = {}; removedKeys.forEach(function (key) { var fallbackTarget = visualElement.getBaseTarget(key); if (fallbackTarget !== undefined) { fallbackAnimation_1[key] = fallbackTarget; } }); animations.push({ animation: fallbackAnimation_1 }); } var shouldAnimate = Boolean(animations.length); if (isInitialRender && props.initial === false && !visualElement.manuallyAnimateOnMount) { shouldAnimate = false; } isInitialRender = false; return shouldAnimate ? animate(animations) : Promise.resolve(); } /** * Change whether a certain animation type is active. */ function setActive(type, isActive, options) { var _a; // If the active state hasn't changed, we can safely do nothing here if (state[type].isActive === isActive) return Promise.resolve(); // Propagate active change to children (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); }); state[type].isActive = isActive; var animations = animateChanges(options, type); for (var key in state) { state[key].protectedKeys = {}; } return animations; } return { isAnimated: isAnimated, animateChanges: animateChanges, setActive: setActive, setAnimateFunction: setAnimateFunction, getState: function () { return state; }, }; } function checkVariantsDidChange(prev, next) { if (typeof next === "string") { return next !== prev; } else if (isVariantLabels(next)) { return !shallowCompare(next, prev); } return false; } function createTypeState(isActive) { if (isActive === void 0) { isActive = false; } return { isActive: isActive, protectedKeys: {}, needsAnimating: {}, prevResolvedValues: {}, }; } function createState() { var _a; return _a = {}, _a[AnimationType.Animate] = createTypeState(true), _a[AnimationType.InView] = createTypeState(), _a[AnimationType.Hover] = createTypeState(), _a[AnimationType.Tap] = createTypeState(), _a[AnimationType.Drag] = createTypeState(), _a[AnimationType.Focus] = createTypeState(), _a[AnimationType.Exit] = createTypeState(), _a; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.mjs var animations = { animation: makeRenderlessComponent(function (_a) { var visualElement = _a.visualElement, animate = _a.animate; /** * 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. */ visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); /** * Subscribe any provided AnimationControls to the component's VisualElement */ if (isAnimationControls(animate)) { (0,external_React_.useEffect)(function () { return animate.subscribe(visualElement); }, [animate]); } }), exit: makeRenderlessComponent(function (props) { var custom = props.custom, visualElement = props.visualElement; var _a = tslib_es6_read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1]; var presenceContext = (0,external_React_.useContext)(PresenceContext); (0,external_React_.useEffect)(function () { var _a, _b; visualElement.isPresent = isPresent; var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom }); !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove)); }, [isPresent]); }), }; ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point.mjs const is_point_isPoint = (point) => point.hasOwnProperty('x') && point.hasOwnProperty('y'); ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point-3d.mjs const isPoint3D = (point) => is_point_isPoint(point) && point.hasOwnProperty('z'); ;// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/distance.mjs const distance_distance1D = (a, b) => Math.abs(a - b); function distance_distance(a, b) { if (isNum(a) && isNum(b)) { return distance_distance1D(a, b); } else if (is_point_isPoint(a) && is_point_isPoint(b)) { const xDelta = distance_distance1D(a.x, b.x); const yDelta = distance_distance1D(a.y, b.y); const zDelta = isPoint3D(a) && isPoint3D(b) ? distance_distance1D(a.z, b.z) : 0; return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2)); } } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/PanSession.mjs /** * @internal */ var PanSession = /** @class */ (function () { function PanSession(event, handlers, _a) { var _this = this; var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint; /** * @internal */ this.startEvent = null; /** * @internal */ this.lastMoveEvent = null; /** * @internal */ this.lastMoveEventInfo = null; /** * @internal */ this.handlers = {}; this.updatePoint = function () { if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) return; var info = getPanInfo(_this.lastMoveEventInfo, _this.history); var isPanStarted = _this.startEvent !== null; // Only start panning if the offset is larger than 3 pixels. If we make it // any larger than this we'll want to reset the pointer history // on the first update to avoid visual snapping to the cursoe. var isDistancePastThreshold = distance_distance(info.offset, { x: 0, y: 0 }) >= 3; if (!isPanStarted && !isDistancePastThreshold) return; var point = info.point; var timestamp = getFrameData().timestamp; _this.history.push(__assign(__assign({}, point), { timestamp: timestamp })); var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove; if (!isPanStarted) { onStart && onStart(_this.lastMoveEvent, info); _this.startEvent = _this.lastMoveEvent; } onMove && onMove(_this.lastMoveEvent, info); }; this.handlePointerMove = function (event, info) { _this.lastMoveEvent = event; _this.lastMoveEventInfo = transformPoint(info, _this.transformPagePoint); // Because Safari doesn't trigger mouseup events when it's above a `<select>` if (isMouseEvent(event) && event.buttons === 0) { _this.handlePointerUp(event, info); return; } // Throttle mouse move event to once per frame es.update(_this.updatePoint, true); }; this.handlePointerUp = function (event, info) { _this.end(); var _a = _this.handlers, onEnd = _a.onEnd, onSessionEnd = _a.onSessionEnd; var panInfo = getPanInfo(transformPoint(info, _this.transformPagePoint), _this.history); if (_this.startEvent && onEnd) { onEnd(event, panInfo); } onSessionEnd && onSessionEnd(event, panInfo); }; // If we have more than one touch, don't start detecting this gesture if (isTouchEvent(event) && event.touches.length > 1) return; this.handlers = handlers; this.transformPagePoint = transformPagePoint; var info = extractEventInfo(event); var initialInfo = transformPoint(info, this.transformPagePoint); var point = initialInfo.point; var timestamp = getFrameData().timestamp; this.history = [__assign(__assign({}, point), { timestamp: timestamp })]; var onSessionStart = handlers.onSessionStart; onSessionStart && onSessionStart(event, getPanInfo(initialInfo, this.history)); this.removeListeners = pipe_pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp)); } PanSession.prototype.updateHandlers = function (handlers) { this.handlers = handlers; }; PanSession.prototype.end = function () { this.removeListeners && this.removeListeners(); cancelSync.update(this.updatePoint); }; return PanSession; }()); 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 getPanInfo(_a, history) { var point = _a.point; return { point: point, delta: subtractPoint(point, lastDevicePoint(history)), offset: subtractPoint(point, startDevicePoint(history)), velocity: PanSession_getVelocity(history, 0.1), }; } function startDevicePoint(history) { return history[0]; } function lastDevicePoint(history) { return history[history.length - 1]; } function PanSession_getVelocity(history, timeDelta) { if (history.length < 2) { return { x: 0, y: 0 }; } var i = history.length - 1; var timestampedPoint = null; var 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 }; } var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000; if (time === 0) { return { x: 0, y: 0 }; } var 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; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs function calcLength(axis) { return axis.max - axis.min; } function isNear(value, target, maxDistance) { if (target === void 0) { target = 0; } if (maxDistance === void 0) { maxDistance = 0.01; } return distance_distance(value, target) < maxDistance; } function calcAxisDelta(delta, source, target, origin) { if (origin === void 0) { origin = 0.5; } delta.origin = origin; delta.originPoint = mix_mix(source.min, source.max, delta.origin); delta.scale = calcLength(target) / calcLength(source); if (isNear(delta.scale, 1, 0.0001) || isNaN(delta.scale)) delta.scale = 1; delta.translate = mix_mix(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 === null || origin === void 0 ? void 0 : origin.originX); calcAxisDelta(delta.y, source.y, target.y, origin === null || origin === void 0 ? void 0 : origin.originY); } 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, layout, parent) { target.min = layout.min - parent.min; target.max = target.min + calcLength(layout); } function calcRelativePosition(target, layout, parent) { calcRelativeAxisPosition(target.x, layout.x, parent.x); calcRelativeAxisPosition(target.y, layout.y, parent.y); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs /** * Apply constraints to a point. These constraints are both physical along an * axis, and an elastic factor that determines how much to constrain the point * by if it does lie outside the defined parameters. */ function applyConstraints(point, _a, elastic) { var min = _a.min, max = _a.max; if (min !== undefined && point < min) { // If we have a min point defined, and this is outside of that, constrain point = elastic ? mix_mix(min, point, elastic.min) : Math.max(point, min); } else if (max !== undefined && point > max) { // If we have a max point defined, and this is outside of that, constrain point = elastic ? mix_mix(max, point, elastic.max) : Math.min(point, max); } return point; } /** * Calculate constraints in terms of the viewport when defined relatively to the * measured axis. This is measured from the nearest edge, so a max constraint of 200 * on an axis with a max value of 300 would return a constraint of 500 - axis length */ function calcRelativeAxisConstraints(axis, min, max) { return { min: min !== undefined ? axis.min + min : undefined, max: max !== undefined ? axis.max + max - (axis.max - axis.min) : undefined, }; } /** * Calculate constraints in terms of the viewport when * defined relatively to the measured bounding box. */ function calcRelativeConstraints(layoutBox, _a) { var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right; return { x: calcRelativeAxisConstraints(layoutBox.x, left, right), y: calcRelativeAxisConstraints(layoutBox.y, top, bottom), }; } /** * Calculate viewport constraints when defined as another viewport-relative axis */ function calcViewportAxisConstraints(layoutAxis, constraintsAxis) { var _a; var min = constraintsAxis.min - layoutAxis.min; var max = constraintsAxis.max - layoutAxis.max; // If the constraints axis is actually smaller than the layout axis then we can // flip the constraints if (constraintsAxis.max - constraintsAxis.min < layoutAxis.max - layoutAxis.min) { _a = tslib_es6_read([max, min], 2), min = _a[0], max = _a[1]; } return { min: min, max: max }; } /** * Calculate viewport constraints when defined as another viewport-relative box */ function calcViewportConstraints(layoutBox, constraintsBox) { return { x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x), y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y), }; } /** * Calculate a transform origin relative to the source axis, between 0-1, that results * in an asthetically pleasing scale/transform needed to project from source to target. */ function constraints_calcOrigin(source, target) { var origin = 0.5; var sourceLength = calcLength(source); var 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_clamp(0, 1, origin); } /** * Rebase the calculated viewport constraints relative to the layout.min point. */ function rebaseAxisConstraints(layout, constraints) { var relativeConstraints = {}; if (constraints.min !== undefined) { relativeConstraints.min = constraints.min - layout.min; } if (constraints.max !== undefined) { relativeConstraints.max = constraints.max - layout.min; } return relativeConstraints; } var defaultElastic = 0.35; /** * Accepts a dragElastic prop and returns resolved elastic values for each axis. */ function resolveDragElastic(dragElastic) { if (dragElastic === void 0) { 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) { var _a; return typeof dragElastic === "number" ? dragElastic : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/models.mjs var createAxisDelta = function () { return ({ translate: 0, scale: 1, origin: 0, originPoint: 0, }); }; var createDelta = function () { return ({ x: createAxisDelta(), y: createAxisDelta(), }); }; var createAxis = function () { return ({ min: 0, max: 0 }); }; var createBox = function () { return ({ x: createAxis(), y: createAxis(), }); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs function eachAxis(callback) { return [callback("x"), callback("y")]; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs /** * Bounding boxes tend to be defined as top, left, right, bottom. For various operations * it's easier to consider each axis individually. This function returns a bounding box * as a map of single-axis min/max values. */ function convertBoundingBoxToBox(_a) { var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom; return { x: { min: left, max: right }, y: { min: top, max: bottom }, }; } function convertBoxToBoundingBox(_a) { var x = _a.x, y = _a.y; return { top: y.min, right: x.max, bottom: y.max, left: x.min }; } /** * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function * provided by Framer to allow measured points to be corrected for device scaling. This is used * when measuring DOM elements and DOM event points. */ function transformBoxPoints(point, transformPoint) { if (!transformPoint) return point; var topLeft = transformPoint({ x: point.left, y: point.top }); var bottomRight = transformPoint({ x: point.right, y: point.bottom }); return { top: topLeft.y, left: topLeft.x, bottom: bottomRight.y, right: bottomRight.x, }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs function isIdentityScale(scale) { return scale === undefined || scale === 1; } function hasScale(_a) { var scale = _a.scale, scaleX = _a.scaleX, scaleY = _a.scaleY; return (!isIdentityScale(scale) || !isIdentityScale(scaleX) || !isIdentityScale(scaleY)); } function hasTransform(values) { return (hasScale(values) || hasTranslate(values.x) || hasTranslate(values.y) || values.z || values.rotate || values.rotateX || values.rotateY); } function hasTranslate(value) { return value && value !== "0%"; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs /** * Scales a point based on a factor and an originPoint */ function scalePoint(point, scale, originPoint) { var distanceFromOrigin = point - originPoint; var scaled = scale * distanceFromOrigin; return originPoint + scaled; } /** * Applies a translate/scale delta to a point */ function applyPointDelta(point, translate, scale, originPoint, boxScale) { if (boxScale !== undefined) { point = scalePoint(point, boxScale, originPoint); } return scalePoint(point, scale, originPoint) + translate; } /** * Applies a translate/scale delta to an axis */ function applyAxisDelta(axis, translate, scale, originPoint, boxScale) { if (translate === void 0) { translate = 0; } if (scale === void 0) { scale = 1; } axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale); axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale); } /** * Applies a translate/scale delta to a box */ function applyBoxDelta(box, _a) { var x = _a.x, y = _a.y; applyAxisDelta(box.x, x.translate, x.scale, x.originPoint); applyAxisDelta(box.y, y.translate, y.scale, y.originPoint); } /** * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms * in a tree upon our box before then calculating how to project it into our desired viewport-relative box * * This is the final nested loop within updateLayoutDelta for future refactoring */ function applyTreeDeltas(box, treeScale, treePath, isSharedTransition) { var _a, _b; if (isSharedTransition === void 0) { isSharedTransition = false; } var treeLength = treePath.length; if (!treeLength) return; // Reset the treeScale treeScale.x = treeScale.y = 1; var node; var delta; for (var i = 0; i < treeLength; i++) { node = treePath[i]; delta = node.projectionDelta; if (((_b = (_a = node.instance) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === "contents") continue; if (isSharedTransition && node.options.layoutScroll && node.scroll && node !== node.root) { transformBox(box, { x: -node.scroll.x, y: -node.scroll.y }); } if (delta) { // Incoporate each ancestor's scale into a culmulative treeScale for this component treeScale.x *= delta.x.scale; treeScale.y *= delta.y.scale; // Apply each ancestor's calculated delta into this component's recorded layout box applyBoxDelta(box, delta); } if (isSharedTransition && hasTransform(node.latestValues)) { transformBox(box, node.latestValues); } } } function translateAxis(axis, distance) { axis.min = axis.min + distance; axis.max = axis.max + distance; } /** * Apply a transform to an axis from the latest resolved motion values. * This function basically acts as a bridge between a flat motion value map * and applyAxisDelta */ function transformAxis(axis, transforms, _a) { var _b = tslib_es6_read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5; var originPoint = mix_mix(axis.min, axis.max, axisOrigin); // Apply the axis delta to the final axis applyAxisDelta(axis, transforms[key], transforms[scaleKey], originPoint, transforms.scale); } /** * The names of the motion values we want to apply as translation, scale and origin. */ var xKeys = ["x", "scaleX", "originX"]; var yKeys = ["y", "scaleY", "originY"]; /** * Apply a transform to a box from the latest resolved motion values. */ function transformBox(box, transform) { transformAxis(box.x, transform, xKeys); transformAxis(box.y, transform, yKeys); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/utils/measure.mjs function measureViewportBox(instance, transformPoint) { return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(), transformPoint)); } function measurePageBox(element, rootProjectionNode, transformPagePoint) { var viewportBox = measureViewportBox(element, transformPagePoint); var scroll = rootProjectionNode.scroll; if (scroll) { translateAxis(viewportBox.x, scroll.x); translateAxis(viewportBox.y, scroll.y); } return viewportBox; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs var elementDragControls = new WeakMap(); /** * */ // let latestPointerEvent: AnyPointerEvent var VisualElementDragControls = /** @class */ (function () { function VisualElementDragControls(visualElement) { // This is a reference to the global drag gesture lock, ensuring only one component // can "capture" the drag of one or both axes. // TODO: Look into moving this into pansession? this.openGlobalLock = null; this.isDragging = false; this.currentDirection = null; this.originPoint = { x: 0, y: 0 }; /** * The permitted boundaries of travel, in pixels. */ this.constraints = false; this.hasMutatedConstraints = false; /** * The per-axis resolved elastic values. */ this.elastic = createBox(); this.visualElement = visualElement; } VisualElementDragControls.prototype.start = function (originEvent, _a) { var _this = this; var _b = _a === void 0 ? {} : _a, _c = _b.snapToCursor, snapToCursor = _c === void 0 ? false : _c; /** * Don't start dragging if this component is exiting */ if (this.visualElement.isPresent === false) return; var onSessionStart = function (event) { // Stop any animations on both axis values immediately. This allows the user to throw and catch // the component. _this.stopAnimation(); if (snapToCursor) { _this.snapToCursor(extractEventInfo(event, "page").point); } }; var onStart = function (event, info) { var _a; // Attempt to grab the global drag gesture lock - maybe make this part of PanSession var _b = _this.getProps(), drag = _b.drag, dragPropagation = _b.dragPropagation, onDragStart = _b.onDragStart; if (drag && !dragPropagation) { if (_this.openGlobalLock) _this.openGlobalLock(); _this.openGlobalLock = getGlobalLock(drag); // If we don 't have the lock, don't start dragging 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 = undefined; } /** * Record gesture origin */ eachAxis(function (axis) { var _a, _b; var current = _this.getAxisMotionValue(axis).get() || 0; /** * If the MotionValue is a percentage value convert to px */ if (percent.test(current)) { var measuredAxis = (_b = (_a = _this.visualElement.projection) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.actual[axis]; if (measuredAxis) { var length_1 = calcLength(measuredAxis); current = length_1 * (parseFloat(current) / 100); } } _this.originPoint[axis] = current; }); // Fire onDragStart event onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event, info); (_a = _this.visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Drag, true); }; var onMove = function (event, info) { // latestPointerEvent = event var _a = _this.getProps(), dragPropagation = _a.dragPropagation, dragDirectionLock = _a.dragDirectionLock, onDirectionLock = _a.onDirectionLock, onDrag = _a.onDrag; // If we didn't successfully receive the gesture lock, early return. if (!dragPropagation && !_this.openGlobalLock) return; var offset = info.offset; // Attempt to detect drag direction if directionLock is true if (dragDirectionLock && _this.currentDirection === null) { _this.currentDirection = getCurrentDirection(offset); // If we've successfully set a direction, notify listener if (_this.currentDirection !== null) { onDirectionLock === null || onDirectionLock === void 0 ? void 0 : onDirectionLock(_this.currentDirection); } return; } // Update each point with the latest position _this.updateAxis("x", info.point, offset); _this.updateAxis("y", info.point, offset); /** * Ideally we would leave the renderer to fire naturally at the end of * this frame but if the element is about to change layout as the result * of a re-render we want to ensure the browser can read the latest * bounding box to ensure the pointer and element don't fall out of sync. */ _this.visualElement.syncRender(); /** * This must fire after the syncRender call as it might trigger a state * change which itself might trigger a layout update. */ onDrag === null || onDrag === void 0 ? void 0 : onDrag(event, info); }; var onSessionEnd = function (event, info) { return _this.stop(event, info); }; this.panSession = new PanSession(originEvent, { onSessionStart: onSessionStart, onStart: onStart, onMove: onMove, onSessionEnd: onSessionEnd, }, { transformPagePoint: this.visualElement.getTransformPagePoint() }); }; VisualElementDragControls.prototype.stop = function (event, info) { var isDragging = this.isDragging; this.cancel(); if (!isDragging) return; var velocity = info.velocity; this.startAnimation(velocity); var onDragEnd = this.getProps().onDragEnd; onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(event, info); }; VisualElementDragControls.prototype.cancel = function () { var _a, _b; this.isDragging = false; if (this.visualElement.projection) { this.visualElement.projection.isAnimationBlocked = false; } (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end(); this.panSession = undefined; var dragPropagation = this.getProps().dragPropagation; if (!dragPropagation && this.openGlobalLock) { this.openGlobalLock(); this.openGlobalLock = null; } (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(AnimationType.Drag, false); }; VisualElementDragControls.prototype.updateAxis = function (axis, _point, offset) { var drag = this.getProps().drag; // If we're not dragging this axis, do an early return. if (!offset || !shouldDrag(axis, drag, this.currentDirection)) return; var axisValue = this.getAxisMotionValue(axis); var next = this.originPoint[axis] + offset[axis]; // Apply constraints if (this.constraints && this.constraints[axis]) { next = applyConstraints(next, this.constraints[axis], this.elastic[axis]); } axisValue.set(next); }; VisualElementDragControls.prototype.resolveConstraints = function () { var _this = this; var _a = this.getProps(), dragConstraints = _a.dragConstraints, dragElastic = _a.dragElastic; var layout = (this.visualElement.projection || {}).layout; var prevConstraints = this.constraints; if (dragConstraints && is_ref_object_isRefObject(dragConstraints)) { if (!this.constraints) { this.constraints = this.resolveRefConstraints(); } } else { if (dragConstraints && layout) { this.constraints = calcRelativeConstraints(layout.actual, dragConstraints); } else { this.constraints = false; } } this.elastic = resolveDragElastic(dragElastic); /** * If we're outputting to external MotionValues, we want to rebase the measured constraints * from viewport-relative to component-relative. */ if (prevConstraints !== this.constraints && layout && this.constraints && !this.hasMutatedConstraints) { eachAxis(function (axis) { if (_this.getAxisMotionValue(axis)) { _this.constraints[axis] = rebaseAxisConstraints(layout.actual[axis], _this.constraints[axis]); } }); } }; VisualElementDragControls.prototype.resolveRefConstraints = function () { var _a = this.getProps(), constraints = _a.dragConstraints, onMeasureDragConstraints = _a.onMeasureDragConstraints; if (!constraints || !is_ref_object_isRefObject(constraints)) return false; var 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."); var projection = this.visualElement.projection; // TODO if (!projection || !projection.layout) return false; var constraintsBox = measurePageBox(constraintsElement, projection.root, this.visualElement.getTransformPagePoint()); var measuredConstraints = calcViewportConstraints(projection.layout.actual, constraintsBox); /** * If there's an onMeasureDragConstraints listener we call it and * if different constraints are returned, set constraints to that */ if (onMeasureDragConstraints) { var userConstraints = onMeasureDragConstraints(convertBoxToBoundingBox(measuredConstraints)); this.hasMutatedConstraints = !!userConstraints; if (userConstraints) { measuredConstraints = convertBoundingBoxToBox(userConstraints); } } return measuredConstraints; }; VisualElementDragControls.prototype.startAnimation = function (velocity) { var _this = this; var _a = this.getProps(), drag = _a.drag, dragMomentum = _a.dragMomentum, dragElastic = _a.dragElastic, dragTransition = _a.dragTransition, dragSnapToOrigin = _a.dragSnapToOrigin, onDragTransitionEnd = _a.onDragTransitionEnd; var constraints = this.constraints || {}; var momentumAnimations = eachAxis(function (axis) { var _a; if (!shouldDrag(axis, drag, _this.currentDirection)) { return; } var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {}; if (dragSnapToOrigin) transition = { min: 0, max: 0 }; /** * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame * of spring animations so we should look into adding a disable spring option to `inertia`. * We could do something here where we affect the `bounceStiffness` and `bounceDamping` * using the value of `dragElastic`. */ var bounceStiffness = dragElastic ? 200 : 1000000; var bounceDamping = dragElastic ? 40 : 10000000; var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness, bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition); // If we're not animating on an externally-provided `MotionValue` we can use the // component's animation controls which will handle interactions with whileHover (etc), // otherwise we just have to animate the `MotionValue` itself. return _this.startAxisValueAnimation(axis, inertia); }); // Run all animations and then resolve the new drag constraints. return Promise.all(momentumAnimations).then(onDragTransitionEnd); }; VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) { var axisValue = this.getAxisMotionValue(axis); return startAnimation(axis, axisValue, 0, transition); }; VisualElementDragControls.prototype.stopAnimation = function () { var _this = this; eachAxis(function (axis) { return _this.getAxisMotionValue(axis).stop(); }); }; /** * 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. */ VisualElementDragControls.prototype.getAxisMotionValue = function (axis) { var _a, _b; var dragKey = "_drag" + axis.toUpperCase(); var externalMotionValue = this.visualElement.getProps()[dragKey]; return externalMotionValue ? externalMotionValue : this.visualElement.getValue(axis, (_b = (_a = this.visualElement.getProps().initial) === null || _a === void 0 ? void 0 : _a[axis]) !== null && _b !== void 0 ? _b : 0); }; VisualElementDragControls.prototype.snapToCursor = function (point) { var _this = this; eachAxis(function (axis) { var drag = _this.getProps().drag; // If we're not dragging this axis, do an early return. if (!shouldDrag(axis, drag, _this.currentDirection)) return; var projection = _this.visualElement.projection; var axisValue = _this.getAxisMotionValue(axis); if (projection && projection.layout) { var _a = projection.layout.actual[axis], min = _a.min, max = _a.max; axisValue.set(point[axis] - mix_mix(min, max, 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. */ VisualElementDragControls.prototype.scalePositionWithinConstraints = function () { var _this = this; var _a; var _b = this.getProps(), drag = _b.drag, dragConstraints = _b.dragConstraints; var projection = this.visualElement.projection; if (!is_ref_object_isRefObject(dragConstraints) || !projection || !this.constraints) return; /** * Stop current animations as there can be visual glitching if we try to do * this mid-animation */ this.stopAnimation(); /** * Record the relative position of the dragged element relative to the * constraints box and save as a progress value. */ var boxProgress = { x: 0, y: 0 }; eachAxis(function (axis) { var axisValue = _this.getAxisMotionValue(axis); if (axisValue) { var latest = axisValue.get(); boxProgress[axis] = constraints_calcOrigin({ min: latest, max: latest }, _this.constraints[axis]); } }); /** * Update the layout of this element and resolve the latest drag constraints */ var transformTemplate = this.visualElement.getProps().transformTemplate; this.visualElement.getInstance().style.transform = transformTemplate ? transformTemplate({}, "") : "none"; (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); projection.updateLayout(); this.resolveConstraints(); /** * For each axis, calculate the current progress of the layout axis * within the new constraints. */ eachAxis(function (axis) { if (!shouldDrag(axis, drag, null)) return; /** * Calculate a new transform based on the previous box progress */ var axisValue = _this.getAxisMotionValue(axis); var _a = _this.constraints[axis], min = _a.min, max = _a.max; axisValue.set(mix_mix(min, max, boxProgress[axis])); }); }; VisualElementDragControls.prototype.addListeners = function () { var _this = this; var _a; elementDragControls.set(this.visualElement, this); var element = this.visualElement.getInstance(); /** * Attach a pointerdown event listener on this DOM element to initiate drag tracking. */ var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) { var _a = _this.getProps(), drag = _a.drag, _b = _a.dragListener, dragListener = _b === void 0 ? true : _b; drag && dragListener && _this.start(event); }); var measureDragConstraints = function () { var dragConstraints = _this.getProps().dragConstraints; if (is_ref_object_isRefObject(dragConstraints)) { _this.constraints = _this.resolveRefConstraints(); } }; var projection = this.visualElement.projection; var stopMeasureLayoutListener = projection.addEventListener("measure", measureDragConstraints); if (projection && !projection.layout) { (_a = projection.root) === null || _a === void 0 ? void 0 : _a.updateScroll(); projection.updateLayout(); } measureDragConstraints(); /** * Attach a window resize listener to scale the draggable target within its defined * constraints as the window resizes. */ var stopResizeListener = addDomEvent(window, "resize", function () { return _this.scalePositionWithinConstraints(); }); /** * If the element's layout changes, calculate the delta and apply that to * the drag gesture's origin point. */ projection.addEventListener("didUpdate", (function (_a) { var delta = _a.delta, hasLayoutChanged = _a.hasLayoutChanged; if (_this.isDragging && hasLayoutChanged) { eachAxis(function (axis) { var motionValue = _this.getAxisMotionValue(axis); if (!motionValue) return; _this.originPoint[axis] += delta[axis].translate; motionValue.set(motionValue.get() + delta[axis].translate); }); _this.visualElement.syncRender(); } })); return function () { stopResizeListener(); stopPointerListener(); stopMeasureLayoutListener(); }; }; VisualElementDragControls.prototype.getProps = function () { var props = this.visualElement.getProps(); var _a = props.drag, drag = _a === void 0 ? false : _a, _b = props.dragDirectionLock, dragDirectionLock = _b === void 0 ? false : _b, _c = props.dragPropagation, dragPropagation = _c === void 0 ? false : _c, _d = props.dragConstraints, dragConstraints = _d === void 0 ? false : _d, _e = props.dragElastic, dragElastic = _e === void 0 ? defaultElastic : _e, _f = props.dragMomentum, dragMomentum = _f === void 0 ? true : _f; return __assign(__assign({}, props), { drag: drag, dragDirectionLock: dragDirectionLock, dragPropagation: dragPropagation, dragConstraints: dragConstraints, dragElastic: dragElastic, dragMomentum: dragMomentum }); }; return VisualElementDragControls; }()); function shouldDrag(direction, drag, currentDirection) { return ((drag === true || drag === direction) && (currentDirection === null || currentDirection === direction)); } /** * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower * than the provided threshold, return `null`. * * @param offset - The x/y offset from origin. * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction. */ function getCurrentDirection(offset, lockThreshold) { if (lockThreshold === void 0) { lockThreshold = 10; } var direction = null; if (Math.abs(offset.y) > lockThreshold) { direction = "y"; } else if (Math.abs(offset.x) > lockThreshold) { direction = "x"; } return direction; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/use-drag.mjs /** * A hook that allows an element to be dragged. * * @internal */ function useDrag(props) { var groupDragControls = props.dragControls, visualElement = props.visualElement; var dragControls = useConstant(function () { return new VisualElementDragControls(visualElement); }); // If we've been provided a DragControls for manual control over the drag gesture, // subscribe this component to it on mount. (0,external_React_.useEffect)(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls, groupDragControls]); // Apply the event listeners to the element (0,external_React_.useEffect)(function () { return dragControls.addListeners(); }, [dragControls]); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-pan-gesture.mjs /** * * @param handlers - * @param ref - * * @privateRemarks * Currently this sets new pan gesture functions every render. The memo route has been explored * in the past but ultimately we're still creating new functions every render. An optimisation * to explore is creating the pan gestures and loading them into a `ref`. * * @internal */ function usePanGesture(_a) { var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart, visualElement = _a.visualElement; var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart; var panSession = (0,external_React_.useRef)(null); var transformPagePoint = (0,external_React_.useContext)(MotionConfigContext).transformPagePoint; var handlers = { onSessionStart: onPanSessionStart, onStart: onPanStart, onMove: onPan, onEnd: function (event, info) { panSession.current = null; onPanEnd && onPanEnd(event, info); }, }; (0,external_React_.useEffect)(function () { if (panSession.current !== null) { panSession.current.updateHandlers(handlers); } }); function onPointerDown(event) { panSession.current = new PanSession(event, handlers, { transformPagePoint: transformPagePoint, }); } usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown); useUnmountEffect(function () { return panSession.current && panSession.current.end(); }); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.mjs var drag = { pan: makeRenderlessComponent(usePanGesture), drag: makeRenderlessComponent(useDrag), }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/lifecycles.mjs var names = [ "LayoutMeasure", "BeforeLayoutMeasure", "LayoutUpdate", "ViewportBoxUpdate", "Update", "Render", "AnimationComplete", "LayoutAnimationComplete", "AnimationStart", "LayoutAnimationStart", "SetAxisTarget", "Unmount", ]; function createLifecycles() { var managers = names.map(function () { return new SubscriptionManager(); }); var propSubscriptions = {}; var lifecycles = { clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); }, updatePropListeners: function (props) { names.forEach(function (name) { var _a; var on = "on" + name; var propListener = props[on]; // Unsubscribe existing subscription (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions); // Add new subscription if (propListener) { propSubscriptions[name] = lifecycles[on](propListener); } }); }, }; managers.forEach(function (manager, i) { lifecycles["on" + names[i]] = function (handler) { return manager.add(handler); }; lifecycles["notify" + names[i]] = function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return manager.notify.apply(manager, tslib_es6_spreadArray([], tslib_es6_read(args), false)); }; }); return lifecycles; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.mjs function updateMotionValuesFromProps(element, next, prev) { var _a; for (var key in next) { var nextValue = next[key]; var prevValue = prev[key]; if (isMotionValue(nextValue)) { /** * If this is a motion value found in props or style, we want to add it * to our visual element's motion value map. */ element.addValue(key, nextValue); /** * Check the version of the incoming motion value with this version * and warn against mismatches. */ if (false) {} } else if (isMotionValue(prevValue)) { /** * If we're swapping to a new motion value, create a new motion value * from that */ element.addValue(key, motionValue(nextValue)); } else if (prevValue !== nextValue) { /** * If this is a flat value that has changed, update the motion value * or create one if it doesn't exist. We only want to do this if we're * not handling the value with our animation state. */ if (element.hasValue(key)) { var existingValue = element.getValue(key); // TODO: Only update values that aren't being animated or even looked at !existingValue.hasAnimated && existingValue.set(nextValue); } else { element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue)); } } } // Handle removed values for (var key in prev) { if (next[key] === undefined) element.removeValue(key); } return next; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/index.mjs var visualElement = function (_a) { var _b = _a.treeType, treeType = _b === void 0 ? "" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps; return function (_a, options) { var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState, shouldReduceMotion = _a.shouldReduceMotion; if (options === void 0) { options = {}; } var isMounted = false; var latestValues = visualState.latestValues, renderState = visualState.renderState; /** * The instance of the render-specific node that will be hydrated by the * exposed React ref. So for example, this visual element can host a * HTMLElement, plain object, or Three.js object. The functions provided * in VisualElementConfig allow us to interface with this instance. */ var instance; /** * Manages the subscriptions for a visual element's lifecycle, for instance * onRender */ var lifecycles = createLifecycles(); /** * A map of all motion values attached to this visual element. Motion * values are source of truth for any given animated value. A motion * value might be provided externally by the component via props. */ var values = new Map(); /** * A map of every subscription that binds the provided or generated * motion values onChange listeners to this visual element. */ var valueSubscriptions = new Map(); /** * A reference to the previously-provided motion values as returned * from scrapeMotionValuesFromProps. We use the keys in here to determine * if any motion values need to be removed after props are updated. */ var prevMotionValues = {}; /** * When values are removed from all animation props we need to search * for a fallback value to animate to. These values are tracked in baseTarget. */ var baseTarget = __assign({}, latestValues); // Internal methods ======================== /** * On mount, this will be hydrated with a callback to disconnect * this visual element from its parent on unmount. */ var removeFromVariantTree; /** * Render the element with the latest styles outside of the React * render lifecycle */ function render() { if (!instance || !isMounted) return; triggerBuild(); renderInstance(instance, renderState, props.style, element.projection); } function triggerBuild() { build(element, renderState, latestValues, options, props); } function update() { lifecycles.notifyUpdate(latestValues); } /** * */ function bindToMotionValue(key, value) { var removeOnChange = value.onChange(function (latestValue) { latestValues[key] = latestValue; props.onUpdate && es.update(update, false, true); }); var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender); valueSubscriptions.set(key, function () { removeOnChange(); removeOnRenderRequest(); }); } /** * Any motion values that are provided to the element when created * aren't yet bound to the element, as this would technically be impure. * However, we iterate through the motion values and set them to the * initial values for this component. * * TODO: This is impure and we should look at changing this to run on mount. * Doing so will break some tests but this isn't neccessarily a breaking change, * more a reflection of the test. */ var initialMotionValues = scrapeMotionValuesFromProps(props); for (var key in initialMotionValues) { var value = initialMotionValues[key]; if (latestValues[key] !== undefined && isMotionValue(value)) { value.set(latestValues[key], false); } } /** * Determine what role this visual element should take in the variant tree. */ var isControllingVariants = checkIfControllingVariants(props); var isVariantNode = checkIfVariantNode(props); var element = __assign(__assign({ treeType: treeType, /** * This is a mirror of the internal instance prop, which keeps * VisualElement type-compatible with React's RefObject. */ current: null, /** * The depth of this visual element within the visual element tree. */ depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(), /** * */ presenceId: presenceId, shouldReduceMotion: shouldReduceMotion, /** * If this component is part of the variant tree, it should track * any children that are also part of the tree. This is essentially * a shadow tree to simplify logic around how to stagger over children. */ variantChildren: isVariantNode ? new Set() : undefined, /** * Whether this instance is visible. This can be changed imperatively * by the projection tree, is analogous to CSS's visibility in that * hidden elements should take up layout, and needs enacting by the configured * render function. */ isVisible: undefined, /** * Normally, if a component is controlled by a parent's variants, it can * rely on that ancestor to trigger animations further down the tree. * However, if a component is created after its parent is mounted, the parent * won't trigger that mount animation so the child needs to. * * TODO: This might be better replaced with a method isParentMounted */ manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()), /** * This can be set by AnimatePresence to force components that mount * at the same time as it to mount as if they have initial={false} set. */ blockInitialAnimation: blockInitialAnimation, /** * Determine whether this component has mounted yet. This is mostly used * by variant children to determine whether they need to trigger their * own animations on mount. */ isMounted: function () { return Boolean(instance); }, mount: function (newInstance) { isMounted = true; instance = element.current = newInstance; if (element.projection) { element.projection.mount(newInstance); } if (isVariantNode && parent && !isControllingVariants) { removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element); } values.forEach(function (value, key) { return bindToMotionValue(key, value); }); parent === null || parent === void 0 ? void 0 : parent.children.add(element); element.setProps(props); }, /** * */ unmount: function () { var _a; (_a = element.projection) === null || _a === void 0 ? void 0 : _a.unmount(); cancelSync.update(update); cancelSync.render(render); valueSubscriptions.forEach(function (remove) { return remove(); }); removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree(); parent === null || parent === void 0 ? void 0 : parent.children.delete(element); lifecycles.clearAllListeners(); instance = undefined; isMounted = false; }, /** * Add a child visual element to our set of children. */ addVariantChild: function (child) { var _a; var closestVariantNode = element.getClosestVariantNode(); if (closestVariantNode) { (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child); return function () { return closestVariantNode.variantChildren.delete(child); }; } }, sortNodePosition: function (other) { /** * If these nodes aren't even of the same type we can't compare their depth. */ if (!sortNodePosition || treeType !== other.treeType) return 0; return sortNodePosition(element.getInstance(), other.getInstance()); }, /** * Returns the closest variant node in the tree starting from * this visual element. */ getClosestVariantNode: function () { return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode(); }, /** * Expose the latest layoutId prop. */ getLayoutId: function () { return props.layoutId; }, /** * Returns the current instance. */ getInstance: function () { return instance; }, /** * Get/set the latest static values. */ getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); }, /** * Returns the latest motion value state. Currently only used to take * a snapshot of the visual element - perhaps this can return the whole * visual state */ getLatestValues: function () { return latestValues; }, /** * Set the visiblity of the visual element. If it's changed, schedule * a render to reflect these changes. */ setVisibility: function (visibility) { if (element.isVisible === visibility) return; element.isVisible = visibility; element.scheduleRender(); }, /** * 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: function (target, canMutate) { if (canMutate === void 0) { canMutate = true; } return makeTargetAnimatable(element, target, props, canMutate); }, /** * 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: function () { return measureViewportBox(instance, props); }, // Motion values ======================== /** * Add a motion value and bind it to this visual element. */ addValue: function (key, value) { // Remove existing value if it exists if (element.hasValue(key)) element.removeValue(key); values.set(key, value); latestValues[key] = value.get(); bindToMotionValue(key, value); }, /** * Remove a motion value and unbind any active subscriptions. */ removeValue: function (key) { var _a; values.delete(key); (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a(); valueSubscriptions.delete(key); delete latestValues[key]; removeValueFromRenderState(key, renderState); }, /** * Check whether we have a motion value for this key */ hasValue: function (key) { return values.has(key); }, /** * Get a motion value for this key. If called with a default * value, we'll create one if none exists. */ getValue: function (key, defaultValue) { var value = values.get(key); if (value === undefined && defaultValue !== undefined) { value = motionValue(defaultValue); element.addValue(key, value); } return value; }, /** * Iterate over our motion values. */ forEachValue: function (callback) { return values.forEach(callback); }, /** * 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: function (key) { var _a; return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, 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: function (key, value) { baseTarget[key] = value; }, /** * Find the base target for a value thats been removed from all animation * props. */ getBaseTarget: function (key) { if (getBaseTarget) { var target = getBaseTarget(props, key); if (target !== undefined && !isMotionValue(target)) return target; } return baseTarget[key]; } }, lifecycles), { /** * Build the renderer state based on the latest visual state. */ build: function () { triggerBuild(); return renderState; }, /** * Schedule a render on the next animation frame. */ scheduleRender: function () { es.render(render, false, true); }, /** * Synchronously fire render. It's prefered that we batch renders but * in many circumstances, like layout measurement, we need to run this * synchronously. However in those instances other measures should be taken * to batch reads/writes. */ syncRender: render, /** * Update the provided props. Ensure any newly-added motion values are * added to our map, old ones removed, and listeners updated. */ setProps: function (newProps) { if (newProps.transformTemplate || props.transformTemplate) { element.scheduleRender(); } props = newProps; lifecycles.updatePropListeners(newProps); prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues); }, getProps: function () { return props; }, // Variants ============================== /** * Returns the variant definition with a given name. */ getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; }, /** * Returns the defined default transition on this component. */ getDefaultTransition: function () { return props.transition; }, getTransformPagePoint: function () { return props.transformPagePoint; }, /** * Used by child variant nodes to get the closest ancestor variant props. */ getVariantContext: function (startAtParent) { if (startAtParent === void 0) { startAtParent = false; } if (startAtParent) return parent === null || parent === void 0 ? void 0 : parent.getVariantContext(); if (!isControllingVariants) { var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {}; if (props.initial !== undefined) { context_1.initial = props.initial; } return context_1; } var context = {}; for (var i = 0; i < numVariantProps; i++) { var name_1 = variantProps[i]; var prop = props[name_1]; if (isVariantLabel(prop) || prop === false) { context[name_1] = prop; } } return context; } }); return element; }; }; var variantProps = tslib_es6_spreadArray(["initial"], tslib_es6_read(variantPriorityOrder), false); var numVariantProps = variantProps.length; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs function css_variables_conversion_isCSSVariable(value) { return typeof value === "string" && value.startsWith("var(--"); } /** * Parse Framer's special CSS variable format into a CSS token and a fallback. * * ``` * `var(--foo, #fff)` => [`--foo`, '#fff'] * ``` * * @param current */ var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/; function parseCSSVariable(current) { var match = cssVariableRegex.exec(current); if (!match) return [,]; var _a = tslib_es6_read(match, 3), token = _a[1], fallback = _a[2]; return [token, fallback]; } var maxDepth = 4; function getVariableValue(current, element, depth) { if (depth === void 0) { depth = 1; } invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"".concat(current, "\". This may indicate a circular fallback dependency.")); var _a = tslib_es6_read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1]; // No CSS variable detected if (!token) return; // Attempt to read this CSS variable off the element var resolved = window.getComputedStyle(element).getPropertyValue(token); if (resolved) { return resolved.trim(); } else if (css_variables_conversion_isCSSVariable(fallback)) { // The fallback might itself be a CSS variable, in which case we attempt to resolve it too. return getVariableValue(fallback, element, depth + 1); } else { return fallback; } } /** * Resolve CSS variables from * * @internal */ function resolveCSSVariables(visualElement, _a, transitionEnd) { var _b; var target = __rest(_a, []); var element = visualElement.getInstance(); if (!(element instanceof Element)) return { target: target, transitionEnd: transitionEnd }; // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd` // only if they change but I think this reads clearer and this isn't a performance-critical path. if (transitionEnd) { transitionEnd = __assign({}, transitionEnd); } // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved visualElement.forEachValue(function (value) { var current = value.get(); if (!css_variables_conversion_isCSSVariable(current)) return; var resolved = getVariableValue(current, element); if (resolved) value.set(resolved); }); // Cycle through every target property and resolve CSS variables. Currently // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)` for (var key in target) { var current = target[key]; if (!css_variables_conversion_isCSSVariable(current)) continue; var resolved = getVariableValue(current, element); if (!resolved) continue; // Clone target if it hasn't already been target[key] = resolved; // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved // CSS variable. This will ensure that after the animation the component will reflect // changes in the value of the CSS variable. if (transitionEnd) (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current); } return { target: target, transitionEnd: transitionEnd }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs var positionalKeys = new Set([ "width", "height", "top", "left", "right", "bottom", "x", "y", ]); var isPositionalKey = function (key) { return positionalKeys.has(key); }; var hasPositionalKey = function (target) { return Object.keys(target).some(isPositionalKey); }; var setAndResetVelocity = function (value, to) { // Looks odd but setting it twice doesn't render, it'll just // set both prev and current to the latest value value.set(to, false); value.set(to); }; var isNumOrPxType = function (v) { return v === number || v === units_px; }; var BoundingBoxDimension; (function (BoundingBoxDimension) { BoundingBoxDimension["width"] = "width"; BoundingBoxDimension["height"] = "height"; BoundingBoxDimension["left"] = "left"; BoundingBoxDimension["right"] = "right"; BoundingBoxDimension["top"] = "top"; BoundingBoxDimension["bottom"] = "bottom"; })(BoundingBoxDimension || (BoundingBoxDimension = {})); var getPosFromMatrix = function (matrix, pos) { return parseFloat(matrix.split(", ")[pos]); }; var getTranslateFromMatrix = function (pos2, pos3) { return function (_bbox, _a) { var transform = _a.transform; if (transform === "none" || !transform) return 0; var matrix3d = transform.match(/^matrix3d\((.+)\)$/); if (matrix3d) { return getPosFromMatrix(matrix3d[1], pos3); } else { var matrix = transform.match(/^matrix\((.+)\)$/); if (matrix) { return getPosFromMatrix(matrix[1], pos2); } else { return 0; } } }; }; var transformKeys = new Set(["x", "y", "z"]); var nonTranslationalTransformKeys = transformProps.filter(function (key) { return !transformKeys.has(key); }); function removeNonTranslationalTransform(visualElement) { var removedTransforms = []; nonTranslationalTransformKeys.forEach(function (key) { var value = visualElement.getValue(key); if (value !== undefined) { removedTransforms.push([key, value.get()]); value.set(key.startsWith("scale") ? 1 : 0); } }); // Apply changes to element before measurement if (removedTransforms.length) visualElement.syncRender(); return removedTransforms; } var positionalValues = { // Dimensions width: function (_a, _b) { var x = _a.x; var _c = _b.paddingLeft, paddingLeft = _c === void 0 ? "0" : _c, _d = _b.paddingRight, paddingRight = _d === void 0 ? "0" : _d; return x.max - x.min - parseFloat(paddingLeft) - parseFloat(paddingRight); }, height: function (_a, _b) { var y = _a.y; var _c = _b.paddingTop, paddingTop = _c === void 0 ? "0" : _c, _d = _b.paddingBottom, paddingBottom = _d === void 0 ? "0" : _d; return y.max - y.min - parseFloat(paddingTop) - parseFloat(paddingBottom); }, top: function (_bbox, _a) { var top = _a.top; return parseFloat(top); }, left: function (_bbox, _a) { var left = _a.left; return parseFloat(left); }, bottom: function (_a, _b) { var y = _a.y; var top = _b.top; return parseFloat(top) + (y.max - y.min); }, right: function (_a, _b) { var x = _a.x; var left = _b.left; return parseFloat(left) + (x.max - x.min); }, // Transform x: getTranslateFromMatrix(4, 13), y: getTranslateFromMatrix(5, 14), }; var convertChangedValueTypes = function (target, visualElement, changedKeys) { var originBbox = visualElement.measureViewportBox(); var element = visualElement.getInstance(); var elementComputedStyle = getComputedStyle(element); var display = elementComputedStyle.display; var origin = {}; // If the element is currently set to display: "none", make it visible before // measuring the target bounding box if (display === "none") { visualElement.setStaticValue("display", target.display || "block"); } /** * Record origins before we render and update styles */ changedKeys.forEach(function (key) { origin[key] = positionalValues[key](originBbox, elementComputedStyle); }); // Apply the latest values (as set in checkAndConvertChangedValueTypes) visualElement.syncRender(); var targetBbox = visualElement.measureViewportBox(); changedKeys.forEach(function (key) { // Restore styles to their **calculated computed style**, not their actual // originally set style. This allows us to animate between equivalent pixel units. var value = visualElement.getValue(key); setAndResetVelocity(value, origin[key]); target[key] = positionalValues[key](targetBbox, elementComputedStyle); }); return target; }; var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) { if (origin === void 0) { origin = {}; } if (transitionEnd === void 0) { transitionEnd = {}; } target = __assign({}, target); transitionEnd = __assign({}, transitionEnd); var targetPositionalKeys = Object.keys(target).filter(isPositionalKey); // We want to remove any transform values that could affect the element's bounding box before // it's measured. We'll reapply these later. var removedTransformValues = []; var hasAttemptedToRemoveTransformValues = false; var changedValueTypeKeys = []; targetPositionalKeys.forEach(function (key) { var value = visualElement.getValue(key); if (!visualElement.hasValue(key)) return; var from = origin[key]; var fromType = findDimensionValueType(from); var to = target[key]; var toType; // TODO: The current implementation of this basically throws an error // if you try and do value conversion via keyframes. There's probably // a way of doing this but the performance implications would need greater scrutiny, // as it'd be doing multiple resize-remeasure operations. if (isKeyframesTarget(to)) { var numKeyframes = to.length; var fromIndex = to[0] === null ? 1 : 0; from = to[fromIndex]; fromType = findDimensionValueType(from); for (var i = fromIndex; i < numKeyframes; i++) { 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 they're both just number or px, convert them both to numbers rather than // relying on resize/remeasure to convert (which is wasteful in this situation) if (isNumOrPxType(fromType) && isNumOrPxType(toType)) { var 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 === units_px) { 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) && (from === 0 || to === 0)) { // If one or the other value is 0, it's safe to coerce it to the // type of the other without measurement if (from === 0) { value.set(toType.transform(from)); } else { target[key] = fromType.transform(to); } } else { // If we're going to do value conversion via DOM measurements, we first // need to remove non-positional transform values that could affect the bbox measurements. if (!hasAttemptedToRemoveTransformValues) { removedTransformValues = removeNonTranslationalTransform(visualElement); hasAttemptedToRemoveTransformValues = true; } changedValueTypeKeys.push(key); transitionEnd[key] = transitionEnd[key] !== undefined ? transitionEnd[key] : target[key]; setAndResetVelocity(value, to); } } }); if (changedValueTypeKeys.length) { var scrollY_1 = changedValueTypeKeys.indexOf("height") >= 0 ? window.pageYOffset : null; var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys); // If we removed transform values, reapply them before the next render if (removedTransformValues.length) { removedTransformValues.forEach(function (_a) { var _b = tslib_es6_read(_a, 2), key = _b[0], value = _b[1]; visualElement.getValue(key).set(value); }); } // Reapply original values visualElement.syncRender(); // Restore scroll position if (scrollY_1 !== null) window.scrollTo({ top: scrollY_1 }); return { target: convertedTarget, transitionEnd: transitionEnd }; } else { return { target: target, transitionEnd: transitionEnd }; } }; /** * Convert value types for x/y/width/height/top/left/bottom/right * * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'` * * @internal */ function unitConversion(visualElement, target, origin, transitionEnd) { return hasPositionalKey(target) ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd) : { target: target, transitionEnd: transitionEnd }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs /** * Parse a DOM variant to make it animatable. This involves resolving CSS variables * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels. */ var parseDomVariant = function (visualElement, target, origin, transitionEnd) { var resolved = resolveCSSVariables(visualElement, target, transitionEnd); target = resolved.target; transitionEnd = resolved.transitionEnd; return unitConversion(visualElement, target, origin, transitionEnd); }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/visual-element.mjs function visual_element_getComputedStyle(element) { return window.getComputedStyle(element); } var htmlConfig = { treeType: "dom", readValueFromInstance: function (domElement, key) { if (isTransformProp(key)) { var defaultType = getDefaultValueType(key); return defaultType ? defaultType.default || 0 : 0; } else { var computedStyle = visual_element_getComputedStyle(domElement); return ((isCSSVariable(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0); } }, sortNodePosition: function (a, b) { /** * compareDocumentPosition returns a bitmask, by using the bitwise & * we're returning true if 2 in that bitmask is set to true. 2 is set * to true if b preceeds a. */ return a.compareDocumentPosition(b) & 2 ? 1 : -1; }, getBaseTarget: function (props, key) { var _a; return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key]; }, measureViewportBox: function (element, _a) { var transformPagePoint = _a.transformPagePoint; return measureViewportBox(element, transformPagePoint); }, /** * Reset the transform on the current Element. This is called as part * of a batched process across the entire layout tree. To remove this write * cycle it'd be interesting to see if it's possible to "undo" all the current * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms * works */ resetTransform: function (element, domElement, props) { var transformTemplate = props.transformTemplate; domElement.style.transform = transformTemplate ? transformTemplate({}, "") : "none"; // Ensure that whatever happens next, we restore our transform on the next frame element.scheduleRender(); }, restoreTransform: function (instance, mutableState) { instance.style.transform = mutableState.style.transform; }, removeValueFromRenderState: function (key, _a) { var vars = _a.vars, style = _a.style; delete vars[key]; delete style[key]; }, /** * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color` * can be animated by Motion. */ makeTargetAnimatable: function (element, _a, _b, isMounted) { var transformValues = _b.transformValues; if (isMounted === void 0) { isMounted = true; } var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]); var origin = getOrigin(target, transition || {}, element); /** * If Framer has provided a function to convert `Color` etc value types, convert them */ if (transformValues) { if (transitionEnd) transitionEnd = transformValues(transitionEnd); if (target) target = transformValues(target); if (origin) origin = transformValues(origin); } if (isMounted) { checkTargetForNewValues(element, target, origin); var parsed = parseDomVariant(element, target, origin, transitionEnd); transitionEnd = parsed.transitionEnd; target = parsed.target; } return __assign({ transition: transition, transitionEnd: transitionEnd }, target); }, scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, build: function (element, renderState, latestValues, options, props) { if (element.isVisible !== undefined) { renderState.style.visibility = element.isVisible ? "visible" : "hidden"; } buildHTMLStyles(renderState, latestValues, options, props.transformTemplate); }, render: renderHTML, }; var htmlVisualElement = visualElement(htmlConfig); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/visual-element.mjs var svgVisualElement = visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) { return props[key]; }, readValueFromInstance: function (domElement, key) { var _a; if (isTransformProp(key)) { return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0; } key = !camelCaseAttributes.has(key) ? camelToDash(key) : key; return domElement.getAttribute(key); }, scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps, build: function (_element, renderState, latestValues, options, props) { buildSVGAttrs(renderState, latestValues, options, props.transformTemplate); }, render: renderSVG })); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs var create_visual_element_createDomVisualElement = function (Component, options) { return isSVGComponent(Component) ? svgVisualElement(options, { enableHardwareAcceleration: false }) : htmlVisualElement(options, { enableHardwareAcceleration: true }); }; ;// CONCATENATED MODULE: ./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; } /** * We always correct borderRadius as a percentage rather than pixels to reduce paints. * For example, if you are projecting a box that is 100px wide with a 10px borderRadius * into a box that is 200px wide with a 20px borderRadius, that is actually a 10% * borderRadius in both states. If we animate between the two in pixels that will trigger * a paint each time. If we animate between the two in percentage we'll avoid a paint. */ var correctBorderRadius = { correct: function (latest, node) { if (!node.target) return latest; /** * If latest is a string, if it's a percentage we can return immediately as it's * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number. */ if (typeof latest === "string") { if (units_px.test(latest)) { latest = parseFloat(latest); } else { return latest; } } /** * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that * pixel value as a percentage of each axis */ var x = pixelsToPercent(latest, node.target.x); var y = pixelsToPercent(latest, node.target.y); return "".concat(x, "% ").concat(y, "%"); }, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs var varToken = "_$css"; var correctBoxShadow = { correct: function (latest, _a) { var treeScale = _a.treeScale, projectionDelta = _a.projectionDelta; var original = latest; /** * We need to first strip and store CSS variables from the string. */ var containsCSSVariables = latest.includes("var("); var cssVariables = []; if (containsCSSVariables) { latest = latest.replace(cssVariableRegex, function (match) { cssVariables.push(match); return varToken; }); } var shadow = complex.parse(latest); // TODO: Doesn't support multiple shadows if (shadow.length > 5) return original; var template = complex.createTransformer(latest); var offset = typeof shadow[0] !== "number" ? 1 : 0; // Calculate the overall context scale var xScale = projectionDelta.x.scale * treeScale.x; var yScale = projectionDelta.y.scale * treeScale.y; shadow[0 + offset] /= xScale; shadow[1 + offset] /= yScale; /** * Ideally we'd correct x and y scales individually, but because blur and * spread apply to both we have to take a scale average and apply that instead. * We could potentially improve the outcome of this by incorporating the ratio between * the two scales. */ var averageScale = mix_mix(xScale, yScale, 0.5); // Blur if (typeof shadow[2 + offset] === "number") shadow[2 + offset] /= averageScale; // Spread if (typeof shadow[3 + offset] === "number") shadow[3 + offset] /= averageScale; var output = template(shadow); if (containsCSSVariables) { var i_1 = 0; output = output.replace(varToken, function () { var cssVariable = cssVariables[i_1]; i_1++; return cssVariable; }); } return output; }, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs var MeasureLayoutWithContext = /** @class */ (function (_super) { __extends(MeasureLayoutWithContext, _super); function MeasureLayoutWithContext() { return _super !== null && _super.apply(this, arguments) || this; } /** * This only mounts projection nodes for components that * need measuring, we might want to do it for all components * in order to incorporate transforms */ MeasureLayoutWithContext.prototype.componentDidMount = function () { var _this = this; var _a = this.props, visualElement = _a.visualElement, layoutGroup = _a.layoutGroup, switchLayoutGroup = _a.switchLayoutGroup, layoutId = _a.layoutId; var projection = visualElement.projection; addScaleCorrector(defaultScaleCorrectors); if (projection) { if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) layoutGroup.group.add(projection); if ((switchLayoutGroup === null || switchLayoutGroup === void 0 ? void 0 : switchLayoutGroup.register) && layoutId) { switchLayoutGroup.register(projection); } projection.root.didUpdate(); projection.addEventListener("animationComplete", function () { _this.safeToRemove(); }); projection.setOptions(__assign(__assign({}, projection.options), { onExitComplete: function () { return _this.safeToRemove(); } })); } globalProjectionState.hasEverUpdated = true; }; MeasureLayoutWithContext.prototype.getSnapshotBeforeUpdate = function (prevProps) { var _this = this; var _a = this.props, layoutDependency = _a.layoutDependency, visualElement = _a.visualElement, drag = _a.drag, isPresent = _a.isPresent; var projection = visualElement.projection; if (!projection) return null; /** * TODO: We use this data in relegate to determine whether to * promote a previous element. There's no guarantee its presence data * will have updated by this point - if a bug like this arises it will * have to be that we markForRelegation and then find a new lead some other way, * perhaps in didUpdate */ projection.isPresent = isPresent; if (drag || prevProps.layoutDependency !== layoutDependency || layoutDependency === undefined) { projection.willUpdate(); } else { this.safeToRemove(); } if (prevProps.isPresent !== isPresent) { if (isPresent) { projection.promote(); } else if (!projection.relegate()) { /** * If there's another stack member taking over from this one, * it's in charge of the exit animation and therefore should * be in charge of the safe to remove. Otherwise we call it here. */ es.postRender(function () { var _a; if (!((_a = projection.getStack()) === null || _a === void 0 ? void 0 : _a.members.length)) { _this.safeToRemove(); } }); } } return null; }; MeasureLayoutWithContext.prototype.componentDidUpdate = function () { var projection = this.props.visualElement.projection; if (projection) { projection.root.didUpdate(); if (!projection.currentAnimation && projection.isLead()) { this.safeToRemove(); } } }; MeasureLayoutWithContext.prototype.componentWillUnmount = function () { var _a = this.props, visualElement = _a.visualElement, layoutGroup = _a.layoutGroup, promoteContext = _a.switchLayoutGroup; var projection = visualElement.projection; if (projection) { projection.scheduleCheckAfterUnmount(); if (layoutGroup === null || layoutGroup === void 0 ? void 0 : layoutGroup.group) layoutGroup.group.remove(projection); if (promoteContext === null || promoteContext === void 0 ? void 0 : promoteContext.deregister) promoteContext.deregister(projection); } }; MeasureLayoutWithContext.prototype.safeToRemove = function () { var safeToRemove = this.props.safeToRemove; safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove(); }; MeasureLayoutWithContext.prototype.render = function () { return null; }; return MeasureLayoutWithContext; }(external_React_.Component)); function MeasureLayout(props) { var _a = tslib_es6_read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1]; var layoutGroup = (0,external_React_.useContext)(LayoutGroupContext); return (external_React_.createElement(MeasureLayoutWithContext, __assign({}, props, { layoutGroup: layoutGroup, switchLayoutGroup: (0,external_React_.useContext)(SwitchLayoutGroupContext), isPresent: isPresent, safeToRemove: safeToRemove }))); } var defaultScaleCorrectors = { borderRadius: __assign(__assign({}, correctBorderRadius), { applyTo: [ "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderBottomRightRadius", ] }), borderTopLeftRadius: correctBorderRadius, borderTopRightRadius: correctBorderRadius, borderBottomLeftRadius: correctBorderRadius, borderBottomRightRadius: correctBorderRadius, boxShadow: correctBoxShadow, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/index.mjs var layoutFeatures = { measureLayout: MeasureLayout, }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/animate.mjs /** * Animate a single value or a `MotionValue`. * * The first argument is either a `MotionValue` to animate, or an initial animation value. * * The second is either a value to animate to, or an array of keyframes to animate through. * * The third argument can be either tween or spring options, and optional lifecycle methods: `onUpdate`, `onPlay`, `onComplete`, `onRepeat` and `onStop`. * * Returns `AnimationPlaybackControls`, currently just a `stop` method. * * ```javascript * const x = useMotionValue(0) * * useEffect(() => { * const controls = animate(x, 100, { * type: "spring", * stiffness: 2000, * onComplete: v => {} * }) * * return controls.stop * }) * ``` * * @public */ function animate_animate(from, to, transition) { if (transition === void 0) { transition = {}; } var value = isMotionValue(from) ? from : motionValue(from); startAnimation("", value, to, transition); return { stop: function () { return value.stop(); }, isAnimating: function () { return value.isAnimating(); }, }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs var mix_values_borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"]; var numBorders = mix_values_borders.length; var asNumber = function (value) { return typeof value === "string" ? parseFloat(value) : value; }; var isPx = function (value) { return typeof value === "number" || units_px.test(value); }; function mixValues(target, follow, lead, progress, shouldCrossfadeOpacity, isOnlyMember) { var _a, _b, _c, _d; if (shouldCrossfadeOpacity) { target.opacity = mix_mix(0, // (follow?.opacity as number) ?? 0, // TODO Reinstate this if only child (_a = lead.opacity) !== null && _a !== void 0 ? _a : 1, easeCrossfadeIn(progress)); target.opacityExit = mix_mix((_b = follow.opacity) !== null && _b !== void 0 ? _b : 1, 0, easeCrossfadeOut(progress)); } else if (isOnlyMember) { target.opacity = mix_mix((_c = follow.opacity) !== null && _c !== void 0 ? _c : 1, (_d = lead.opacity) !== null && _d !== void 0 ? _d : 1, progress); } /** * Mix border radius */ for (var i = 0; i < numBorders; i++) { var borderLabel = "border".concat(mix_values_borders[i], "Radius"); var followRadius = getRadius(follow, borderLabel); var leadRadius = getRadius(lead, borderLabel); if (followRadius === undefined && leadRadius === undefined) continue; followRadius || (followRadius = 0); leadRadius || (leadRadius = 0); var canMix = followRadius === 0 || leadRadius === 0 || isPx(followRadius) === isPx(leadRadius); if (canMix) { target[borderLabel] = Math.max(mix_mix(asNumber(followRadius), asNumber(leadRadius), progress), 0); if (percent.test(leadRadius) || percent.test(followRadius)) { target[borderLabel] += "%"; } } else { target[borderLabel] = leadRadius; } } /** * Mix rotation */ if (follow.rotate || lead.rotate) { target.rotate = mix_mix(follow.rotate || 0, lead.rotate || 0, progress); } } function getRadius(values, radiusName) { var _a; return (_a = values[radiusName]) !== null && _a !== void 0 ? _a : values.borderRadius; } // /** // * We only want to mix the background color if there's a follow element // * that we're not crossfading opacity between. For instance with switch // * AnimateSharedLayout animations, this helps the illusion of a continuous // * element being animated but also cuts down on the number of paints triggered // * for elements where opacity is doing that work for us. // */ // if ( // !hasFollowElement && // latestLeadValues.backgroundColor && // latestFollowValues.backgroundColor // ) { // /** // * This isn't ideal performance-wise as mixColor is creating a new function every frame. // * We could probably create a mixer that runs at the start of the animation but // * the idea behind the crossfader is that it runs dynamically between two potentially // * changing targets (ie opacity or borderRadius may be animating independently via variants) // */ // leadState.backgroundColor = followState.backgroundColor = mixColor( // latestFollowValues.backgroundColor as string, // latestLeadValues.backgroundColor as string // )(p) // } var easeCrossfadeIn = compress(0, 0.5, circOut); var easeCrossfadeOut = compress(0.5, 0.95, linear); function compress(min, max, easing) { return function (p) { // Could replace ifs with clamp if (p < min) return 0; if (p > max) return 1; return easing(progress(min, max, p)); }; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/copy.mjs /** * Reset an axis to the provided origin box. * * This is a mutative operation. */ function copyAxisInto(axis, originAxis) { axis.min = originAxis.min; axis.max = originAxis.max; } /** * Reset a box to the provided origin box. * * This is a mutative operation. */ function copyBoxInto(box, originBox) { copyAxisInto(box.x, originBox.x); copyAxisInto(box.y, originBox.y); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs /** * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse */ function removePointDelta(point, translate, scale, originPoint, boxScale) { point -= translate; point = scalePoint(point, 1 / scale, originPoint); if (boxScale !== undefined) { point = scalePoint(point, 1 / boxScale, originPoint); } return point; } /** * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse */ function removeAxisDelta(axis, translate, scale, origin, boxScale, originAxis, sourceAxis) { if (translate === void 0) { translate = 0; } if (scale === void 0) { scale = 1; } if (origin === void 0) { origin = 0.5; } if (originAxis === void 0) { originAxis = axis; } if (sourceAxis === void 0) { sourceAxis = axis; } if (percent.test(translate)) { translate = parseFloat(translate); var relativeProgress = mix_mix(sourceAxis.min, sourceAxis.max, translate / 100); translate = relativeProgress - sourceAxis.min; } if (typeof translate !== "number") return; var originPoint = mix_mix(originAxis.min, originAxis.max, origin); if (axis === originAxis) originPoint -= translate; axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale); axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale); } /** * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse * and acts as a bridge between motion values and removeAxisDelta */ function removeAxisTransforms(axis, transforms, _a, origin, sourceAxis) { var _b = tslib_es6_read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2]; removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis); } /** * The names of the motion values we want to apply as translation, scale and origin. */ var delta_remove_xKeys = ["x", "scaleX", "originX"]; var delta_remove_yKeys = ["y", "scaleY", "originY"]; /** * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse * and acts as a bridge between motion values and removeAxisDelta */ function removeBoxTransforms(box, transforms, originBox, sourceBox) { removeAxisTransforms(box.x, transforms, delta_remove_xKeys, originBox === null || originBox === void 0 ? void 0 : originBox.x, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.x); removeAxisTransforms(box.y, transforms, delta_remove_yKeys, originBox === null || originBox === void 0 ? void 0 : originBox.y, sourceBox === null || sourceBox === void 0 ? void 0 : sourceBox.y); } ;// CONCATENATED MODULE: ./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); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/shared/stack.mjs var NodeStack = /** @class */ (function () { function NodeStack() { this.members = []; } NodeStack.prototype.add = function (node) { addUniqueItem(this.members, node); node.scheduleRender(); }; NodeStack.prototype.remove = function (node) { removeItem(this.members, node); if (node === this.prevLead) { this.prevLead = undefined; } if (node === this.lead) { var prevLead = this.members[this.members.length - 1]; if (prevLead) { this.promote(prevLead); } } }; NodeStack.prototype.relegate = function (node) { var indexOfNode = this.members.findIndex(function (member) { return node === member; }); if (indexOfNode === 0) return false; /** * Find the next projection node that is present */ var prevLead; for (var i = indexOfNode; i >= 0; i--) { var member = this.members[i]; if (member.isPresent !== false) { prevLead = member; break; } } if (prevLead) { this.promote(prevLead); return true; } else { return false; } }; NodeStack.prototype.promote = function (node, preserveFollowOpacity) { var _a; var prevLead = this.lead; if (node === prevLead) return; this.prevLead = prevLead; this.lead = node; node.show(); if (prevLead) { prevLead.instance && prevLead.scheduleRender(); node.scheduleRender(); node.resumeFrom = prevLead; if (preserveFollowOpacity) { node.resumeFrom.preserveOpacity = true; } if (prevLead.snapshot) { node.snapshot = prevLead.snapshot; node.snapshot.latestValues = prevLead.animationValues || prevLead.latestValues; node.snapshot.isShared = true; } if ((_a = node.root) === null || _a === void 0 ? void 0 : _a.isUpdating) { node.isLayoutDirty = true; } var crossfade = node.options.crossfade; if (crossfade === false) { prevLead.hide(); } /** * TODO: * - Test border radius when previous node was deleted * - boxShadow mixing * - Shared between element A in scrolled container and element B (scroll stays the same or changes) * - Shared between element A in transformed container and element B (transform stays the same or changes) * - Shared between element A in scrolled page and element B (scroll stays the same or changes) * --- * - Crossfade opacity of root nodes * - layoutId changes after animation * - layoutId changes mid animation */ } }; NodeStack.prototype.exitAnimationComplete = function () { this.members.forEach(function (node) { var _a, _b, _c, _d, _e; (_b = (_a = node.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); (_e = (_c = node.resumingFrom) === null || _c === void 0 ? void 0 : (_d = _c.options).onExitComplete) === null || _e === void 0 ? void 0 : _e.call(_d); }); }; NodeStack.prototype.scheduleRender = function () { this.members.forEach(function (node) { node.instance && node.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 */ NodeStack.prototype.removeLeadSnapshot = function () { if (this.lead && this.lead.snapshot) { this.lead.snapshot = undefined; } }; return NodeStack; }()); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/styles/transform.mjs var identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)"; function buildProjectionTransform(delta, treeScale, latestTransform) { /** * The translations we use to calculate are always relative to the viewport coordinate space. * But when we apply scales, we also scale the coordinate space of an element and its children. * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need * to move an element 100 pixels, we actually need to move it 200 in within that scaled space. */ var xTranslate = delta.x.translate / treeScale.x; var yTranslate = delta.y.translate / treeScale.y; var transform = "translate3d(".concat(xTranslate, "px, ").concat(yTranslate, "px, 0) "); /** * Apply scale correction for the tree transform. * This will apply scale to the screen-orientated axes. */ transform += "scale(".concat(1 / treeScale.x, ", ").concat(1 / treeScale.y, ") "); if (latestTransform) { var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY; if (rotate) transform += "rotate(".concat(rotate, "deg) "); if (rotateX) transform += "rotateX(".concat(rotateX, "deg) "); if (rotateY) transform += "rotateY(".concat(rotateY, "deg) "); } /** * Apply scale to match the size of the element to the size we want it. * This will apply scale to the element-orientated axes. */ var elementScaleX = delta.x.scale * treeScale.x; var elementScaleY = delta.y.scale * treeScale.y; transform += "scale(".concat(elementScaleX, ", ").concat(elementScaleY, ")"); return transform === identityProjection ? "none" : transform; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs var compareByDepth = function (a, b) { return a.depth - b.depth; }; ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs var FlatTree = /** @class */ (function () { function FlatTree() { this.children = []; this.isDirty = false; } FlatTree.prototype.add = function (child) { addUniqueItem(this.children, child); this.isDirty = true; }; FlatTree.prototype.remove = function (child) { removeItem(this.children, child); this.isDirty = true; }; FlatTree.prototype.forEach = function (callback) { this.isDirty && this.children.sort(compareByDepth); this.isDirty = false; this.children.forEach(callback); }; return FlatTree; }()); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs /** * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1 * which has a noticeable difference in spring animations */ var animationTarget = 1000; function createProjectionNode(_a) { var attachResizeListener = _a.attachResizeListener, defaultParent = _a.defaultParent, measureScroll = _a.measureScroll, checkIsScrollRoot = _a.checkIsScrollRoot, resetTransform = _a.resetTransform; return /** @class */ (function () { function ProjectionNode(id, latestValues, parent) { var _this = this; if (latestValues === void 0) { latestValues = {}; } if (parent === void 0) { parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent(); } /** * A Set containing all this component's children. This is used to iterate * through the children. * * TODO: This could be faster to iterate as a flat array stored on the root node. */ this.children = new Set(); /** * Options for the node. We use this to configure what kind of layout animations * we should perform (if any). */ this.options = {}; /** * We use this to detect when its safe to shut down part of a projection tree. * We have to keep projecting children for scale correction and relative projection * until all their parents stop performing layout animations. */ this.isTreeAnimating = false; this.isAnimationBlocked = false; /** * Flag to true if we think this layout has been changed. We can't always know this, * currently we set it to true every time a component renders, or if it has a layoutDependency * if that has changed between renders. Additionally, components can be grouped by LayoutGroup * and if one node is dirtied, they all are. */ this.isLayoutDirty = false; /** * Block layout updates for instant layout transitions throughout the tree. */ this.updateManuallyBlocked = false; this.updateBlockedByResize = false; /** * Set to true between the start of the first `willUpdate` call and the end of the `didUpdate` * call. */ this.isUpdating = false; /** * If this is an SVG element we currently disable projection transforms */ this.isSVG = false; /** * Flag to true (during promotion) if a node doing an instant layout transition needs to reset * its projection styles. */ this.needsReset = false; /** * Flags whether this node should have its transform reset prior to measuring. */ this.shouldResetTransform = false; /** * An object representing the calculated contextual/accumulated/tree scale. * This will be used to scale calculcated projection transforms, as these are * calculated in screen-space but need to be scaled for elements to actually * make it to their calculated destinations. * * TODO: Lazy-init */ this.treeScale = { x: 1, y: 1 }; /** * */ this.eventHandlers = new Map(); // Note: Currently only running on root node this.potentialNodes = new Map(); this.checkUpdateFailed = function () { if (_this.isUpdating) { _this.isUpdating = false; _this.clearAllSnapshots(); } }; this.updateProjection = function () { _this.nodes.forEach(resolveTargetDelta); _this.nodes.forEach(calcProjection); }; this.hasProjected = false; this.isVisible = true; this.animationProgress = 0; /** * Shared layout */ // TODO Only running on root node this.sharedNodes = new Map(); this.id = id; this.latestValues = latestValues; this.root = parent ? parent.root || parent : this; this.path = parent ? tslib_es6_spreadArray(tslib_es6_spreadArray([], tslib_es6_read(parent.path), false), [parent], false) : []; this.parent = parent; this.depth = parent ? parent.depth + 1 : 0; id && this.root.registerPotentialNode(id, this); for (var i = 0; i < this.path.length; i++) { this.path[i].shouldResetTransform = true; } if (this.root === this) this.nodes = new FlatTree(); } ProjectionNode.prototype.addEventListener = function (name, handler) { if (!this.eventHandlers.has(name)) { this.eventHandlers.set(name, new SubscriptionManager()); } return this.eventHandlers.get(name).add(handler); }; ProjectionNode.prototype.notifyListeners = function (name) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } var subscriptionManager = this.eventHandlers.get(name); subscriptionManager === null || subscriptionManager === void 0 ? void 0 : subscriptionManager.notify.apply(subscriptionManager, tslib_es6_spreadArray([], tslib_es6_read(args), false)); }; ProjectionNode.prototype.hasListeners = function (name) { return this.eventHandlers.has(name); }; ProjectionNode.prototype.registerPotentialNode = function (id, node) { this.potentialNodes.set(id, node); }; /** * Lifecycles */ ProjectionNode.prototype.mount = function (instance, isLayoutDirty) { var _this = this; var _a; if (isLayoutDirty === void 0) { isLayoutDirty = false; } if (this.instance) return; this.isSVG = instance instanceof SVGElement && instance.tagName !== "svg"; this.instance = instance; var _b = this.options, layoutId = _b.layoutId, layout = _b.layout, visualElement = _b.visualElement; if (visualElement && !visualElement.getInstance()) { visualElement.mount(instance); } this.root.nodes.add(this); (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.add(this); this.id && this.root.potentialNodes.delete(this.id); if (isLayoutDirty && (layout || layoutId)) { this.isLayoutDirty = true; } if (attachResizeListener) { var unblockTimeout_1; var resizeUnblockUpdate_1 = function () { return (_this.root.updateBlockedByResize = false); }; attachResizeListener(instance, function () { _this.root.updateBlockedByResize = true; clearTimeout(unblockTimeout_1); unblockTimeout_1 = window.setTimeout(resizeUnblockUpdate_1, 250); if (globalProjectionState.hasAnimatedSinceResize) { globalProjectionState.hasAnimatedSinceResize = false; _this.nodes.forEach(finishAnimation); } }); } if (layoutId) { this.root.registerSharedNode(layoutId, this); } // Only register the handler if it requires layout animation if (this.options.animate !== false && visualElement && (layoutId || layout)) { this.addEventListener("didUpdate", function (_a) { var _b, _c, _d, _e, _f; var delta = _a.delta, hasLayoutChanged = _a.hasLayoutChanged, hasRelativeTargetChanged = _a.hasRelativeTargetChanged, newLayout = _a.layout; if (_this.isTreeAnimationBlocked()) { _this.target = undefined; _this.relativeTarget = undefined; return; } // TODO: Check here if an animation exists var layoutTransition = (_c = (_b = _this.options.transition) !== null && _b !== void 0 ? _b : visualElement.getDefaultTransition()) !== null && _c !== void 0 ? _c : defaultLayoutTransition; var _g = visualElement.getProps(), onLayoutAnimationStart = _g.onLayoutAnimationStart, onLayoutAnimationComplete = _g.onLayoutAnimationComplete; /** * The target layout of the element might stay the same, * but its position relative to its parent has changed. */ var targetChanged = !_this.targetLayout || !boxEquals(_this.targetLayout, newLayout) || hasRelativeTargetChanged; /** * If the layout hasn't seemed to have changed, it might be that the * element is visually in the same place in the document but its position * relative to its parent has indeed changed. So here we check for that. */ var hasOnlyRelativeTargetChanged = !hasLayoutChanged && hasRelativeTargetChanged; if (((_d = _this.resumeFrom) === null || _d === void 0 ? void 0 : _d.instance) || hasOnlyRelativeTargetChanged || (hasLayoutChanged && (targetChanged || !_this.currentAnimation))) { if (_this.resumeFrom) { _this.resumingFrom = _this.resumeFrom; _this.resumingFrom.resumingFrom = undefined; } _this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged); var animationOptions = __assign(__assign({}, getValueTransition(layoutTransition, "layout")), { onPlay: onLayoutAnimationStart, onComplete: onLayoutAnimationComplete }); if (visualElement.shouldReduceMotion) { animationOptions.delay = 0; animationOptions.type = false; } _this.startAnimation(animationOptions); } else { /** * If the layout hasn't changed and we have an animation that hasn't started yet, * finish it immediately. Otherwise it will be animating from a location * that was probably never commited to screen and look like a jumpy box. */ if (!hasLayoutChanged && _this.animationProgress === 0) { _this.finishAnimation(); } _this.isLead() && ((_f = (_e = _this.options).onExitComplete) === null || _f === void 0 ? void 0 : _f.call(_e)); } _this.targetLayout = newLayout; }); } }; ProjectionNode.prototype.unmount = function () { var _a, _b; this.options.layoutId && this.willUpdate(); this.root.nodes.remove(this); (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.remove(this); (_b = this.parent) === null || _b === void 0 ? void 0 : _b.children.delete(this); this.instance = undefined; cancelSync.preRender(this.updateProjection); }; // only on the root ProjectionNode.prototype.blockUpdate = function () { this.updateManuallyBlocked = true; }; ProjectionNode.prototype.unblockUpdate = function () { this.updateManuallyBlocked = false; }; ProjectionNode.prototype.isUpdateBlocked = function () { return this.updateManuallyBlocked || this.updateBlockedByResize; }; ProjectionNode.prototype.isTreeAnimationBlocked = function () { var _a; return (this.isAnimationBlocked || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimationBlocked()) || false); }; // Note: currently only running on root node ProjectionNode.prototype.startUpdate = function () { var _a; if (this.isUpdateBlocked()) return; this.isUpdating = true; (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach(resetRotation); }; ProjectionNode.prototype.willUpdate = function (shouldNotifyListeners) { var _a, _b, _c; if (shouldNotifyListeners === void 0) { shouldNotifyListeners = true; } if (this.root.isUpdateBlocked()) { (_b = (_a = this.options).onExitComplete) === null || _b === void 0 ? void 0 : _b.call(_a); return; } !this.root.isUpdating && this.root.startUpdate(); if (this.isLayoutDirty) return; this.isLayoutDirty = true; for (var i = 0; i < this.path.length; i++) { var node = this.path[i]; node.shouldResetTransform = true; /** * TODO: Check we haven't updated the scroll * since the last didUpdate */ node.updateScroll(); } var _d = this.options, layoutId = _d.layoutId, layout = _d.layout; if (layoutId === undefined && !layout) return; var transformTemplate = (_c = this.options.visualElement) === null || _c === void 0 ? void 0 : _c.getProps().transformTemplate; this.prevTransformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); this.updateSnapshot(); shouldNotifyListeners && this.notifyListeners("willUpdate"); }; // Note: Currently only running on root node ProjectionNode.prototype.didUpdate = function () { var updateWasBlocked = this.isUpdateBlocked(); // When doing an instant transition, we skip the layout update, // but should still clean up the measurements so that the next // snapshot could be taken correctly. if (updateWasBlocked) { this.unblockUpdate(); this.clearAllSnapshots(); this.nodes.forEach(clearMeasurements); return; } if (!this.isUpdating) return; this.isUpdating = false; /** * Search for and mount newly-added projection elements. * * TODO: Every time a new component is rendered we could search up the tree for * the closest mounted node and query from there rather than document. */ if (this.potentialNodes.size) { this.potentialNodes.forEach(mountNodeEarly); this.potentialNodes.clear(); } /** * Write */ this.nodes.forEach(resetTransformStyle); /** * Read ================== */ // Update layout measurements of updated children this.nodes.forEach(updateLayout); /** * Write */ // Notify listeners that the layout is updated this.nodes.forEach(notifyLayoutUpdate); this.clearAllSnapshots(); // Flush any scheduled updates flushSync.update(); flushSync.preRender(); flushSync.render(); }; ProjectionNode.prototype.clearAllSnapshots = function () { this.nodes.forEach(clearSnapshot); this.sharedNodes.forEach(removeLeadSnapshots); }; ProjectionNode.prototype.scheduleUpdateProjection = function () { es.preRender(this.updateProjection, false, true); }; ProjectionNode.prototype.scheduleCheckAfterUnmount = function () { var _this = this; /** * If the unmounting node is in a layoutGroup and did trigger a willUpdate, * we manually call didUpdate to give a chance to the siblings to animate. * Otherwise, cleanup all snapshots to prevents future nodes from reusing them. */ es.postRender(function () { if (_this.isLayoutDirty) { _this.root.didUpdate(); } else { _this.root.checkUpdateFailed(); } }); }; /** * Update measurements */ ProjectionNode.prototype.updateSnapshot = function () { if (this.snapshot || !this.instance) return; var measured = this.measure(); var layout = this.removeTransform(this.removeElementScroll(measured)); roundBox(layout); this.snapshot = { measured: measured, layout: layout, latestValues: {}, }; }; ProjectionNode.prototype.updateLayout = function () { var _a; if (!this.instance) return; // TODO: Incorporate into a forwarded scroll offset this.updateScroll(); if (!(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty) { return; } /** * When a node is mounted, it simply resumes from the prevLead's * snapshot instead of taking a new one, but the ancestors scroll * might have updated while the prevLead is unmounted. We need to * update the scroll again to make sure the layout we measure is * up to date. */ if (this.resumeFrom && !this.resumeFrom.instance) { for (var i = 0; i < this.path.length; i++) { var node = this.path[i]; node.updateScroll(); } } var measured = this.measure(); roundBox(measured); var prevLayout = this.layout; this.layout = { measured: measured, actual: this.removeElementScroll(measured), }; this.layoutCorrected = createBox(); this.isLayoutDirty = false; this.projectionDelta = undefined; this.notifyListeners("measure", this.layout.actual); (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notifyLayoutMeasure(this.layout.actual, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.actual); }; ProjectionNode.prototype.updateScroll = function () { if (this.options.layoutScroll && this.instance) { this.isScrollRoot = checkIsScrollRoot(this.instance); this.scroll = measureScroll(this.instance); } }; ProjectionNode.prototype.resetTransform = function () { var _a; if (!resetTransform) return; var isResetRequested = this.isLayoutDirty || this.shouldResetTransform; var hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta); var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; var transformTemplateValue = transformTemplate === null || transformTemplate === void 0 ? void 0 : transformTemplate(this.latestValues, ""); var transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue; if (isResetRequested && (hasProjection || hasTransform(this.latestValues) || transformTemplateHasChanged)) { resetTransform(this.instance, transformTemplateValue); this.shouldResetTransform = false; this.scheduleRender(); } }; ProjectionNode.prototype.measure = function () { var visualElement = this.options.visualElement; if (!visualElement) return createBox(); var box = visualElement.measureViewportBox(); // Remove viewport scroll to give page-relative coordinates var scroll = this.root.scroll; if (scroll) { translateAxis(box.x, scroll.x); translateAxis(box.y, scroll.y); } return box; }; ProjectionNode.prototype.removeElementScroll = function (box) { var boxWithoutScroll = createBox(); copyBoxInto(boxWithoutScroll, box); /** * Performance TODO: Keep a cumulative scroll offset down the tree * rather than loop back up the path. */ for (var i = 0; i < this.path.length; i++) { var node = this.path[i]; var scroll_1 = node.scroll, options = node.options, isScrollRoot = node.isScrollRoot; if (node !== this.root && scroll_1 && options.layoutScroll) { /** * If this is a new scroll root, we want to remove all previous scrolls * from the viewport box. */ if (isScrollRoot) { copyBoxInto(boxWithoutScroll, box); var rootScroll = this.root.scroll; /** * Undo the application of page scroll that was originally added * to the measured bounding box. */ if (rootScroll) { translateAxis(boxWithoutScroll.x, -rootScroll.x); translateAxis(boxWithoutScroll.y, -rootScroll.y); } } translateAxis(boxWithoutScroll.x, scroll_1.x); translateAxis(boxWithoutScroll.y, scroll_1.y); } } return boxWithoutScroll; }; ProjectionNode.prototype.applyTransform = function (box, transformOnly) { if (transformOnly === void 0) { transformOnly = false; } var withTransforms = createBox(); copyBoxInto(withTransforms, box); for (var i = 0; i < this.path.length; i++) { var node = this.path[i]; if (!transformOnly && node.options.layoutScroll && node.scroll && node !== node.root) { transformBox(withTransforms, { x: -node.scroll.x, y: -node.scroll.y, }); } if (!hasTransform(node.latestValues)) continue; transformBox(withTransforms, node.latestValues); } if (hasTransform(this.latestValues)) { transformBox(withTransforms, this.latestValues); } return withTransforms; }; ProjectionNode.prototype.removeTransform = function (box) { var _a; var boxWithoutTransform = createBox(); copyBoxInto(boxWithoutTransform, box); for (var i = 0; i < this.path.length; i++) { var node = this.path[i]; if (!node.instance) continue; if (!hasTransform(node.latestValues)) continue; hasScale(node.latestValues) && node.updateSnapshot(); var sourceBox = createBox(); var nodeBox = node.measure(); copyBoxInto(sourceBox, nodeBox); removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layout, sourceBox); } if (hasTransform(this.latestValues)) { removeBoxTransforms(boxWithoutTransform, this.latestValues); } return boxWithoutTransform; }; /** * */ ProjectionNode.prototype.setTargetDelta = function (delta) { this.targetDelta = delta; this.root.scheduleUpdateProjection(); }; ProjectionNode.prototype.setOptions = function (options) { var _a; this.options = __assign(__assign(__assign({}, this.options), options), { crossfade: (_a = options.crossfade) !== null && _a !== void 0 ? _a : true }); }; ProjectionNode.prototype.clearMeasurements = function () { this.scroll = undefined; this.layout = undefined; this.snapshot = undefined; this.prevTransformTemplateValue = undefined; this.targetDelta = undefined; this.target = undefined; this.isLayoutDirty = false; }; /** * Frame calculations */ ProjectionNode.prototype.resolveTargetDelta = function () { var _a; var _b = this.options, layout = _b.layout, layoutId = _b.layoutId; /** * If we have no layout, we can't perform projection, so early return */ if (!this.layout || !(layout || layoutId)) return; /** * If we don't have a targetDelta but do have a layout, we can attempt to resolve * a relativeParent. This will allow a component to perform scale correction * even if no animation has started. */ // TODO If this is unsuccessful this currently happens every frame if (!this.targetDelta && !this.relativeTarget) { // TODO: This is a semi-repetition of further down this function, make DRY this.relativeParent = this.getClosestProjectingParent(); if (this.relativeParent && this.relativeParent.layout) { this.relativeTarget = createBox(); this.relativeTargetOrigin = createBox(); calcRelativePosition(this.relativeTargetOrigin, this.layout.actual, this.relativeParent.layout.actual); copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); } } /** * If we have no relative target or no target delta our target isn't valid * for this frame. */ if (!this.relativeTarget && !this.targetDelta) return; /** * Lazy-init target data structure */ if (!this.target) { this.target = createBox(); this.targetWithTransforms = createBox(); } /** * If we've got a relative box for this component, resolve it into a target relative to the parent. */ if (this.relativeTarget && this.relativeTargetOrigin && ((_a = this.relativeParent) === null || _a === void 0 ? void 0 : _a.target)) { calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target); /** * If we've only got a targetDelta, resolve it into a target */ } else if (this.targetDelta) { if (Boolean(this.resumingFrom)) { // TODO: This is creating a new object every frame this.target = this.applyTransform(this.layout.actual); } else { copyBoxInto(this.target, this.layout.actual); } applyBoxDelta(this.target, this.targetDelta); } else { /** * If no target, use own layout as target */ copyBoxInto(this.target, this.layout.actual); } /** * If we've been told to attempt to resolve a relative target, do so. */ if (this.attemptToResolveRelativeTarget) { this.attemptToResolveRelativeTarget = false; this.relativeParent = this.getClosestProjectingParent(); if (this.relativeParent && Boolean(this.relativeParent.resumingFrom) === Boolean(this.resumingFrom) && !this.relativeParent.options.layoutScroll && this.relativeParent.target) { this.relativeTarget = createBox(); this.relativeTargetOrigin = createBox(); calcRelativePosition(this.relativeTargetOrigin, this.target, this.relativeParent.target); copyBoxInto(this.relativeTarget, this.relativeTargetOrigin); } } }; ProjectionNode.prototype.getClosestProjectingParent = function () { if (!this.parent || hasTransform(this.parent.latestValues)) return undefined; if ((this.parent.relativeTarget || this.parent.targetDelta) && this.parent.layout) { return this.parent; } else { return this.parent.getClosestProjectingParent(); } }; ProjectionNode.prototype.calcProjection = function () { var _a; var _b = this.options, layout = _b.layout, layoutId = _b.layoutId; /** * If this section of the tree isn't animating we can * delete our target sources for the following frame. */ this.isTreeAnimating = Boolean(((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isTreeAnimating) || this.currentAnimation || this.pendingAnimation); if (!this.isTreeAnimating) { this.targetDelta = this.relativeTarget = undefined; } if (!this.layout || !(layout || layoutId)) return; var lead = this.getLead(); /** * Reset the corrected box with the latest values from box, as we're then going * to perform mutative operations on it. */ copyBoxInto(this.layoutCorrected, this.layout.actual); /** * Apply all the parent deltas to this box to produce the corrected box. This * is the layout box, as it will appear on screen as a result of the transforms of its parents. */ applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, Boolean(this.resumingFrom) || this !== lead); var target = lead.target; if (!target) return; if (!this.projectionDelta) { this.projectionDelta = createDelta(); this.projectionDeltaWithTransform = createDelta(); } var prevTreeScaleX = this.treeScale.x; var prevTreeScaleY = this.treeScale.y; var prevProjectionTransform = this.projectionTransform; /** * Update the delta between the corrected box and the target box before user-set transforms were applied. * This will allow us to calculate the corrected borderRadius and boxShadow to compensate * for our layout reprojection, but still allow them to be scaled correctly by the user. * It might be that to simplify this we may want to accept that user-set scale is also corrected * and we wouldn't have to keep and calc both deltas, OR we could support a user setting * to allow people to choose whether these styles are corrected based on just the * layout reprojection or the final bounding box. */ 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); } }; ProjectionNode.prototype.hide = function () { this.isVisible = false; // TODO: Schedule render }; ProjectionNode.prototype.show = function () { this.isVisible = true; // TODO: Schedule render }; ProjectionNode.prototype.scheduleRender = function (notifyAll) { var _a, _b, _c; if (notifyAll === void 0) { notifyAll = true; } (_b = (_a = this.options).scheduleRender) === null || _b === void 0 ? void 0 : _b.call(_a); notifyAll && ((_c = this.getStack()) === null || _c === void 0 ? void 0 : _c.scheduleRender()); if (this.resumingFrom && !this.resumingFrom.instance) { this.resumingFrom = undefined; } }; ProjectionNode.prototype.setAnimationOrigin = function (delta, hasOnlyRelativeTargetChanged) { var _this = this; var _a; if (hasOnlyRelativeTargetChanged === void 0) { hasOnlyRelativeTargetChanged = false; } var snapshot = this.snapshot; var snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {}; var mixedValues = __assign({}, this.latestValues); var targetDelta = createDelta(); this.relativeTarget = this.relativeTargetOrigin = undefined; this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged; var relativeLayout = createBox(); var isSharedLayoutAnimation = snapshot === null || snapshot === void 0 ? void 0 : snapshot.isShared; var isOnlyMember = (((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.members.length) || 0) <= 1; var shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation && !isOnlyMember && this.options.crossfade === true && !this.path.some(hasOpacityCrossfade)); this.animationProgress = 0; this.mixTargetDelta = function (latest) { var _a; var progress = latest / 1000; mixAxisDelta(targetDelta.x, delta.x, progress); mixAxisDelta(targetDelta.y, delta.y, progress); _this.setTargetDelta(targetDelta); if (_this.relativeTarget && _this.relativeTargetOrigin && _this.layout && ((_a = _this.relativeParent) === null || _a === void 0 ? void 0 : _a.layout)) { calcRelativePosition(relativeLayout, _this.layout.actual, _this.relativeParent.layout.actual); mixBox(_this.relativeTarget, _this.relativeTargetOrigin, relativeLayout, progress); } if (isSharedLayoutAnimation) { _this.animationValues = mixedValues; mixValues(mixedValues, snapshotLatestValues, _this.latestValues, progress, shouldCrossfadeOpacity, isOnlyMember); } _this.root.scheduleUpdateProjection(); _this.scheduleRender(); _this.animationProgress = progress; }; this.mixTargetDelta(0); }; ProjectionNode.prototype.startAnimation = function (options) { var _this = this; var _a, _b; this.notifyListeners("animationStart"); (_a = this.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); if (this.resumingFrom) { (_b = this.resumingFrom.currentAnimation) === null || _b === void 0 ? void 0 : _b.stop(); } if (this.pendingAnimation) { cancelSync.update(this.pendingAnimation); this.pendingAnimation = undefined; } /** * Start the animation in the next frame to have a frame with progress 0, * where the target is the same as when the animation started, so we can * calculate the relative positions correctly for instant transitions. */ this.pendingAnimation = es.update(function () { globalProjectionState.hasAnimatedSinceResize = true; _this.currentAnimation = animate_animate(0, animationTarget, __assign(__assign({}, options), { onUpdate: function (latest) { var _a; _this.mixTargetDelta(latest); (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, latest); }, onComplete: function () { var _a; (_a = options.onComplete) === null || _a === void 0 ? void 0 : _a.call(options); _this.completeAnimation(); } })); if (_this.resumingFrom) { _this.resumingFrom.currentAnimation = _this.currentAnimation; } _this.pendingAnimation = undefined; }); }; ProjectionNode.prototype.completeAnimation = function () { var _a; if (this.resumingFrom) { this.resumingFrom.currentAnimation = undefined; this.resumingFrom.preserveOpacity = undefined; } (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.exitAnimationComplete(); this.resumingFrom = this.currentAnimation = this.animationValues = undefined; this.notifyListeners("animationComplete"); }; ProjectionNode.prototype.finishAnimation = function () { var _a; if (this.currentAnimation) { (_a = this.mixTargetDelta) === null || _a === void 0 ? void 0 : _a.call(this, animationTarget); this.currentAnimation.stop(); } this.completeAnimation(); }; ProjectionNode.prototype.applyTransformsToTarget = function () { var _a = this.getLead(), targetWithTransforms = _a.targetWithTransforms, target = _a.target, layout = _a.layout, latestValues = _a.latestValues; if (!targetWithTransforms || !target || !layout) return; copyBoxInto(targetWithTransforms, target); /** * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal. * This is the final box that we will then project into by calculating a transform delta and * applying it to the corrected box. */ transformBox(targetWithTransforms, latestValues); /** * Update the delta between the corrected box and the final target box, after * user-set transforms are applied to it. This will be used by the renderer to * create a transform style that will reproject the element from its actual layout * into the desired bounding box. */ calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues); }; ProjectionNode.prototype.registerSharedNode = function (layoutId, node) { var _a, _b, _c; if (!this.sharedNodes.has(layoutId)) { this.sharedNodes.set(layoutId, new NodeStack()); } var stack = this.sharedNodes.get(layoutId); stack.add(node); node.promote({ transition: (_a = node.options.initialPromotionConfig) === null || _a === void 0 ? void 0 : _a.transition, preserveFollowOpacity: (_c = (_b = node.options.initialPromotionConfig) === null || _b === void 0 ? void 0 : _b.shouldPreserveFollowOpacity) === null || _c === void 0 ? void 0 : _c.call(_b, node), }); }; ProjectionNode.prototype.isLead = function () { var stack = this.getStack(); return stack ? stack.lead === this : true; }; ProjectionNode.prototype.getLead = function () { var _a; var layoutId = this.options.layoutId; return layoutId ? ((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.lead) || this : this; }; ProjectionNode.prototype.getPrevLead = function () { var _a; var layoutId = this.options.layoutId; return layoutId ? (_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.prevLead : undefined; }; ProjectionNode.prototype.getStack = function () { var layoutId = this.options.layoutId; if (layoutId) return this.root.sharedNodes.get(layoutId); }; ProjectionNode.prototype.promote = function (_a) { var _b = _a === void 0 ? {} : _a, needsReset = _b.needsReset, transition = _b.transition, preserveFollowOpacity = _b.preserveFollowOpacity; var stack = this.getStack(); if (stack) stack.promote(this, preserveFollowOpacity); if (needsReset) { this.projectionDelta = undefined; this.needsReset = true; } if (transition) this.setOptions({ transition: transition }); }; ProjectionNode.prototype.relegate = function () { var stack = this.getStack(); if (stack) { return stack.relegate(this); } else { return false; } }; ProjectionNode.prototype.resetRotation = function () { var visualElement = this.options.visualElement; if (!visualElement) return; // If there's no detected rotation values, we can early return without a forced render. var hasRotate = false; // Keep a record of all the values we've reset var resetValues = {}; // Check the rotate value of all axes and reset to 0 for (var i = 0; i < transformAxes.length; i++) { var axis = transformAxes[i]; var key = "rotate" + axis; // If this rotation doesn't exist as a motion value, then we don't // need to reset it if (!visualElement.getStaticValue(key)) { continue; } hasRotate = true; // Record the rotation and then temporarily set it to 0 resetValues[key] = visualElement.getStaticValue(key); visualElement.setStaticValue(key, 0); } // If there's no rotation values, we don't need to do any more. if (!hasRotate) return; // Force a render of this element to apply the transform with all rotations // set to 0. visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); // Put back all the values we reset for (var key in resetValues) { visualElement.setStaticValue(key, resetValues[key]); } // Schedule a render for the next frame. This ensures we won't visually // see the element with the reset rotate value applied. visualElement.scheduleRender(); }; ProjectionNode.prototype.getProjectionStyles = function (styleProp) { var _a, _b, _c, _d, _e, _f; if (styleProp === void 0) { styleProp = {}; } // TODO: Return lifecycle-persistent object var styles = {}; if (!this.instance || this.isSVG) return styles; if (!this.isVisible) { return { visibility: "hidden" }; } else { styles.visibility = ""; } var transformTemplate = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.getProps().transformTemplate; if (this.needsReset) { this.needsReset = false; styles.opacity = ""; styles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; styles.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none"; return styles; } var lead = this.getLead(); if (!this.projectionDelta || !this.layout || !lead.target) { var emptyStyles = {}; if (this.options.layoutId) { emptyStyles.opacity = (_b = this.latestValues.opacity) !== null && _b !== void 0 ? _b : 1; emptyStyles.pointerEvents = resolveMotionValue(styleProp.pointerEvents) || ""; } if (this.hasProjected && !hasTransform(this.latestValues)) { emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none"; this.hasProjected = false; } return emptyStyles; } var valuesToRender = lead.animationValues || lead.latestValues; this.applyTransformsToTarget(); styles.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender); if (transformTemplate) { styles.transform = transformTemplate(valuesToRender, styles.transform); } var _g = this.projectionDelta, x = _g.x, y = _g.y; styles.transformOrigin = "".concat(x.origin * 100, "% ").concat(y.origin * 100, "% 0"); if (lead.animationValues) { /** * If the lead component is animating, assign this either the entering/leaving * opacity */ styles.opacity = lead === this ? (_d = (_c = valuesToRender.opacity) !== null && _c !== void 0 ? _c : this.latestValues.opacity) !== null && _d !== void 0 ? _d : 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit; } else { /** * Or we're not animating at all, set the lead component to its actual * opacity and other components to hidden. */ styles.opacity = lead === this ? (_e = valuesToRender.opacity) !== null && _e !== void 0 ? _e : "" : (_f = valuesToRender.opacityExit) !== null && _f !== void 0 ? _f : 0; } /** * Apply scale correction */ for (var key in scaleCorrectors) { if (valuesToRender[key] === undefined) continue; var _h = scaleCorrectors[key], correct = _h.correct, applyTo = _h.applyTo; var corrected = correct(valuesToRender[key], lead); if (applyTo) { var num = applyTo.length; for (var i = 0; i < num; i++) { styles[applyTo[i]] = corrected; } } else { styles[key] = corrected; } } /** * Disable pointer events on follow components. This is to ensure * that if a follow component covers a lead component it doesn't block * pointer events on the lead. */ if (this.options.layoutId) { styles.pointerEvents = lead === this ? resolveMotionValue(styleProp.pointerEvents) || "" : "none"; } return styles; }; ProjectionNode.prototype.clearSnapshot = function () { this.resumeFrom = this.snapshot = undefined; }; // Only run on root ProjectionNode.prototype.resetTree = function () { this.root.nodes.forEach(function (node) { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); }); this.root.nodes.forEach(clearMeasurements); this.root.sharedNodes.clear(); }; return ProjectionNode; }()); } function updateLayout(node) { node.updateLayout(); } function notifyLayoutUpdate(node) { var _a, _b, _c, _d; var snapshot = (_b = (_a = node.resumeFrom) === null || _a === void 0 ? void 0 : _a.snapshot) !== null && _b !== void 0 ? _b : node.snapshot; if (node.isLead() && node.layout && snapshot && node.hasListeners("didUpdate")) { var _e = node.layout, layout_1 = _e.actual, measuredLayout = _e.measured; // TODO Maybe we want to also resize the layout snapshot so we don't trigger // animations for instance if layout="size" and an element has only changed position if (node.options.animationType === "size") { eachAxis(function (axis) { var axisSnapshot = snapshot.isShared ? snapshot.measured[axis] : snapshot.layout[axis]; var length = calcLength(axisSnapshot); axisSnapshot.min = layout_1[axis].min; axisSnapshot.max = axisSnapshot.min + length; }); } else if (node.options.animationType === "position") { eachAxis(function (axis) { var axisSnapshot = snapshot.isShared ? snapshot.measured[axis] : snapshot.layout[axis]; var length = calcLength(layout_1[axis]); axisSnapshot.max = axisSnapshot.min + length; }); } var layoutDelta = createDelta(); calcBoxDelta(layoutDelta, layout_1, snapshot.layout); var visualDelta = createDelta(); if (snapshot.isShared) { calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measured); } else { calcBoxDelta(visualDelta, layout_1, snapshot.layout); } var hasLayoutChanged = !isDeltaZero(layoutDelta); var hasRelativeTargetChanged = false; if (!node.resumeFrom) { node.relativeParent = node.getClosestProjectingParent(); /** * If the relativeParent is itself resuming from a different element then * the relative snapshot is not relavent */ if (node.relativeParent && !node.relativeParent.resumeFrom) { var _f = node.relativeParent, parentSnapshot = _f.snapshot, parentLayout = _f.layout; if (parentSnapshot && parentLayout) { var relativeSnapshot = createBox(); calcRelativePosition(relativeSnapshot, snapshot.layout, parentSnapshot.layout); var relativeLayout = createBox(); calcRelativePosition(relativeLayout, layout_1, parentLayout.actual); if (!boxEquals(relativeSnapshot, relativeLayout)) { hasRelativeTargetChanged = true; } } } } node.notifyListeners("didUpdate", { layout: layout_1, snapshot: snapshot, delta: visualDelta, layoutDelta: layoutDelta, hasLayoutChanged: hasLayoutChanged, hasRelativeTargetChanged: hasRelativeTargetChanged, }); } else if (node.isLead()) { (_d = (_c = node.options).onExitComplete) === null || _d === void 0 ? void 0 : _d.call(_c); } /** * Clearing transition * TODO: Investigate why this transition is being passed in as {type: false } from Framer * and why we need it at all */ node.options.transition = undefined; } function clearSnapshot(node) { node.clearSnapshot(); } function clearMeasurements(node) { node.clearMeasurements(); } function resetTransformStyle(node) { var visualElement = node.options.visualElement; if (visualElement === null || visualElement === void 0 ? void 0 : visualElement.getProps().onBeforeLayoutMeasure) { visualElement.notifyBeforeLayoutMeasure(); } node.resetTransform(); } function finishAnimation(node) { node.finishAnimation(); node.targetDelta = node.relativeTarget = node.target = undefined; } function resolveTargetDelta(node) { node.resolveTargetDelta(); } function calcProjection(node) { node.calcProjection(); } function resetRotation(node) { node.resetRotation(); } function removeLeadSnapshots(stack) { stack.removeLeadSnapshot(); } function mixAxisDelta(output, delta, p) { output.translate = mix_mix(delta.translate, 0, p); output.scale = mix_mix(delta.scale, 1, p); output.origin = delta.origin; output.originPoint = delta.originPoint; } function mixAxis(output, from, to, p) { output.min = mix_mix(from.min, to.min, p); output.max = mix_mix(from.max, to.max, p); } function mixBox(output, from, to, p) { mixAxis(output.x, from.x, to.x, p); mixAxis(output.y, from.y, to.y, p); } function hasOpacityCrossfade(node) { return (node.animationValues && node.animationValues.opacityExit !== undefined); } var defaultLayoutTransition = { duration: 0.45, ease: [0.4, 0, 0.1, 1], }; function mountNodeEarly(node, id) { /** * Rather than searching the DOM from document we can search the * path for the deepest mounted ancestor and search from there */ var searchNode = node.root; for (var i = node.path.length - 1; i >= 0; i--) { if (Boolean(node.path[i].instance)) { searchNode = node.path[i]; break; } } var searchElement = searchNode && searchNode !== node.root ? searchNode.instance : document; var element = searchElement.querySelector("[data-projection-id=\"".concat(id, "\"]")); if (element) node.mount(element, true); } function roundAxis(axis) { axis.min = Math.round(axis.min); axis.max = Math.round(axis.max); } function roundBox(box) { roundAxis(box.x); roundAxis(box.y); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs var DocumentProjectionNode = createProjectionNode({ attachResizeListener: function (ref, notify) { return addDomEvent(ref, "resize", notify); }, measureScroll: function () { return ({ x: document.documentElement.scrollLeft || document.body.scrollLeft, y: document.documentElement.scrollTop || document.body.scrollTop, }); }, checkIsScrollRoot: function () { return true; }, }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs var rootProjectionNode = { current: undefined, }; var HTMLProjectionNode_HTMLProjectionNode = createProjectionNode({ measureScroll: function (instance) { return ({ x: instance.scrollLeft, y: instance.scrollTop, }); }, defaultParent: function () { if (!rootProjectionNode.current) { var documentNode = new DocumentProjectionNode(0, {}); documentNode.mount(window); documentNode.setOptions({ layoutScroll: true }); rootProjectionNode.current = documentNode; } return rootProjectionNode.current; }, resetTransform: function (instance, value) { instance.style.transform = value !== null && value !== void 0 ? value : "none"; }, checkIsScrollRoot: function (instance) { return Boolean(window.getComputedStyle(instance).position === "fixed"); }, }); ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion.mjs var featureBundle = __assign(__assign(__assign(__assign({}, animations), gestureAnimations), drag), layoutFeatures); /** * HTML & SVG components, optimised for use with gestures and animation. These can be used as * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported. * * @public */ var motion = /*@__PURE__*/ createMotionProxy(function (Component, config) { return create_config_createDomMotionConfig(Component, config, featureBundle, create_visual_element_createDomVisualElement, HTMLProjectionNode_HTMLProjectionNode); }); /** * Create a DOM `motion` component with the provided string. This is primarily intended * as a full alternative to `motion` for consumers who have to support environments that don't * support `Proxy`. * * ```javascript * import { createDomMotionComponent } from "framer-motion" * * const motion = { * div: createDomMotionComponent('div') * } * ``` * * @public */ function createDomMotionComponent(key) { return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, featureBundle, createDomVisualElement, HTMLProjectionNode)); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-FDQH4LQI.mjs 'use client' // src/should-forward-prop.ts ; 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); } //# sourceMappingURL=chunk-FDQH4LQI.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/object-utils/dist/chunk-OLTBUDV5.mjs // src/assign-after.ts 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; } ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/node_modules/@babel/runtime/helpers/esm/extends.js function esm_extends_extends() { esm_extends_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return esm_extends_extends.apply(this, arguments); } ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var isPropValid = /* #__PURE__ */memoize(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */ ); ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js var testOmitPropsOnStringTag = isPropValid; var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { return key !== 'theme'; }; var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(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 composeShouldForwardProps(tag, options, isReal) { var shouldForwardProp; if (options) { var optionsShouldForwardProp = options.shouldForwardProp; shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) { return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName); } : optionsShouldForwardProp; } if (typeof shouldForwardProp !== 'function' && isReal) { shouldForwardProp = tag.__emotion_forwardProp; } return shouldForwardProp; }; var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () { return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag); }); return null; }; var createStyled = function createStyled(tag, options) { if (false) {} var isReal = tag.__emotion_real === tag; var baseTag = isReal && tag.__emotion_base || tag; var identifierName; var targetClassName; if (options !== undefined) { identifierName = options.label; targetClassName = options.target; } var shouldForwardProp = composeShouldForwardProps(tag, options, isReal); var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); var shouldUseAs = !defaultShouldForwardProp('as'); return function () { var args = arguments; var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; if (identifierName !== undefined) { styles.push("label:" + identifierName + ";"); } if (args[0] == null || args[0].raw === undefined) { styles.push.apply(styles, args); } else { if (false) {} styles.push(args[0][0]); var len = args.length; var i = 1; for (; i < len; i++) { if (false) {} styles.push(args[i], args[0][i]); } } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class var Styled = emotion_element_c39617d8_browser_esm_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 = external_React_.useContext(emotion_element_c39617d8_browser_esm_ThemeContext); } if (typeof props.className === 'string') { className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps); className += cache.key + "-" + serialized.name; if (targetClassName !== undefined) { className += " " + targetClassName; } var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp; var newProps = {}; for (var _key in props) { if (shouldUseAs && _key === 'as') continue; if ( // $FlowFixMe finalShouldForwardProp(_key)) { newProps[_key] = props[_key]; } } newProps.className = className; newProps.ref = ref; return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, /*#__PURE__*/external_React_.createElement(emotion_styled_base_browser_esm_Insertion, { cache: cache, serialized: serialized, isStringTag: typeof FinalTag === 'string' }), /*#__PURE__*/external_React_.createElement(FinalTag, newProps)); }); Styled.displayName = identifierName !== undefined ? 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 = styles; Styled.__emotion_forwardProp = shouldForwardProp; Object.defineProperty(Styled, 'toString', { value: function value() { if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string return "." + targetClassName; } }); Styled.withComponent = function (nextTag, nextOptions) { return createStyled(nextTag, esm_extends_extends({}, options, nextOptions, { shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) })).apply(void 0, styles); }; return Styled; }; }; ;// CONCATENATED MODULE: ./node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js 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 newStyled = createStyled.bind(); tags.forEach(function (tagName) { // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type newStyled[tagName] = newStyled(tagName); }); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-5PL47M24.mjs 'use client' ; // src/system.ts var chunk_5PL47M24_a; var emotion_styled = (chunk_5PL47M24_a = newStyled["default"]) != null ? chunk_5PL47M24_a : newStyled; var toCSSObject = ({ baseStyle }) => (props) => { const { theme, css: cssProp, __css, sx, ...rest } = props; const styleProps = objectFilter(rest, (_, prop) => isStyleProp(prop)); const finalBaseStyle = chunk_M3TFMUOL_runIfFn(baseStyle, props); const finalStyles = assignAfter( {}, __css, finalBaseStyle, filterUndefined(styleProps), sx ); const computedCSS = dist_css(finalStyles)(props.theme); return cssProp ? [computedCSS, cssProp] : computedCSS; }; function styled(component, options) { const { baseStyle, ...styledOptions } = options != null ? options : {}; if (!styledOptions.shouldForwardProp) { styledOptions.shouldForwardProp = shouldForwardProp; } const styleObject = toCSSObject({ baseStyle }); const Component = emotion_styled( component, styledOptions )(styleObject); const chakraComponent = external_React_.forwardRef(function ChakraComponent(props, ref) { const { colorMode, forced } = useColorMode(); return external_React_.createElement(Component, { ref, "data-theme": forced ? colorMode : void 0, ...props }); }); return chakraComponent; } //# sourceMappingURL=chunk-5PL47M24.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-ZHQNHOQS.mjs 'use client' ; // src/factory.ts function factory() { const cache = /* @__PURE__ */ new Map(); return new Proxy(styled, { /** * @example * const Div = chakra("div") * const WithChakra = chakra(AnotherComponent) */ apply(target, thisArg, argArray) { return styled(...argArray); }, /** * @example * <chakra.div /> */ get(_, element) { if (!cache.has(element)) { cache.set(element, styled(element)); } return cache.get(element); } }); } var chakra = factory(); //# sourceMappingURL=chunk-ZHQNHOQS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-VXESY33O.mjs 'use client' ; // src/toast.component.tsx var toastMotionVariants = { initial: (props) => { const { position } = props; const dir = ["top", "bottom"].includes(position) ? "y" : "x"; let factor = ["top-right", "bottom-right"].includes(position) ? 1 : -1; if (position === "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,external_React_.memo)((props) => { const { id, message, onCloseComplete, onRequestRemove, requestClose = false, position = "bottom", duration = 5e3, containerStyle, motionVariants = toastMotionVariants, toastSpacing = "0.5rem" } = props; const [delay, setDelay] = (0,external_React_.useState)(duration); const isPresent = useIsPresent(); dist_useUpdateEffect(() => { if (!isPresent) { onCloseComplete == null ? void 0 : onCloseComplete(); } }, [isPresent]); dist_useUpdateEffect(() => { setDelay(duration); }, [duration]); const onMouseEnter = () => setDelay(null); const onMouseLeave = () => setDelay(duration); const close = () => { if (isPresent) onRequestRemove(); }; (0,external_React_.useEffect)(() => { if (isPresent && requestClose) { onRequestRemove(); } }, [isPresent, requestClose, onRequestRemove]); useTimeout(close, delay); const containerStyles = (0,external_React_.useMemo)( () => ({ pointerEvents: "auto", maxWidth: 560, minWidth: 300, margin: toastSpacing, ...containerStyle }), [containerStyle, toastSpacing] ); const toastStyle = (0,external_React_.useMemo)(() => getToastStyle(position), [position]); return /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { layout: true, className: "chakra-toast", variants: motionVariants, initial: "initial", animate: "animate", exit: "exit", onHoverStart: onMouseEnter, onHoverEnd: onMouseLeave, custom: { position }, style: toastStyle, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { role: "status", "aria-atomic": "true", className: "chakra-toast__inner", __css: containerStyles, children: dist_runIfFn(message, { id, onClose: close }) } ) } ); }); ToastComponent.displayName = "ToastComponent"; //# sourceMappingURL=chunk-VXESY33O.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-LHPMGMGT.mjs 'use client' // src/toast.placement.ts function getToastPlacement(position, dir) { var _a; const computedPosition = position != null ? position : "bottom"; const logicals = { "top-start": { ltr: "top-left", rtl: "top-right" }, "top-end": { ltr: "top-right", rtl: "top-left" }, "bottom-start": { ltr: "bottom-left", rtl: "bottom-right" }, "bottom-end": { ltr: "bottom-right", rtl: "bottom-left" } }; const logical = logicals[computedPosition]; return (_a = logical == null ? void 0 : logical[dir]) != null ? _a : computedPosition; } //# sourceMappingURL=chunk-LHPMGMGT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-ZJJGQIVY.mjs 'use client' // src/forward-ref.tsx ; function forwardRef(component) { return (0,external_React_.forwardRef)(component); } //# sourceMappingURL=chunk-ZJJGQIVY.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-UIGT7YZF.mjs 'use client' // src/use-theme.ts ; function chunk_UIGT7YZF_useTheme() { const theme = (0,external_React_.useContext)( emotion_element_c39617d8_browser_esm_ThemeContext ); if (!theme) { throw Error( "useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`" ); } return theme; } //# sourceMappingURL=chunk-UIGT7YZF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-7FWEOSAE.mjs 'use client' ; // src/hooks.ts function chunk_7FWEOSAE_useChakra() { const colorModeResult = useColorMode(); const theme = chunk_UIGT7YZF_useTheme(); return { ...colorModeResult, theme }; } function getBreakpointValue(theme, value, fallback) { var _a, _b; if (value == null) return value; const getValue = (val) => { var _a2, _b2; return (_b2 = (_a2 = theme.__breakpoints) == null ? void 0 : _a2.asArray) == null ? void 0 : _b2[val]; }; return (_b = (_a = getValue(value)) != null ? _a : getValue(fallback)) != null ? _b : fallback; } function getTokenValue(theme, value, fallback) { var _a, _b; if (value == null) return value; const getValue = (val) => { var _a2, _b2; return (_b2 = (_a2 = theme.__cssMap) == null ? void 0 : _a2[val]) == null ? void 0 : _b2.value; }; return (_b = (_a = getValue(value)) != null ? _a : getValue(fallback)) != null ? _b : fallback; } function useToken(scale, token, fallback) { const theme = chunk_UIGT7YZF_useTheme(); return getToken(scale, token, fallback)(theme); } function getToken(scale, token, fallback) { const _token = Array.isArray(token) ? token : [token]; const _fallback = Array.isArray(fallback) ? fallback : [fallback]; return (theme) => { const fallbackArr = _fallback.filter(Boolean); const result = _token.map((token2, index) => { var _a, _b; if (scale === "breakpoints") { return getBreakpointValue(theme, token2, (_a = fallbackArr[index]) != null ? _a : token2); } const path = `${scale}.${token2}`; return getTokenValue(theme, path, (_b = fallbackArr[index]) != null ? _b : token2); }); return Array.isArray(token) ? result : result[0]; }; } //# sourceMappingURL=chunk-7FWEOSAE.mjs.map // EXTERNAL MODULE: ./node_modules/react-fast-compare/index.js var react_fast_compare = __webpack_require__(590); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/system/dist/chunk-DMO4EI7P.mjs 'use client' ; // src/use-style-config.ts function useStyleConfigImpl(themeKey, props = {}) { var _a; const { styleConfig: styleConfigProp, ...rest } = props; const { theme, colorMode } = chunk_7FWEOSAE_useChakra(); const themeStyleConfig = themeKey ? chunk_YTQ3XZ3T_memoizedGet(theme, `components.${themeKey}`) : void 0; const styleConfig = styleConfigProp || themeStyleConfig; const mergedProps = lodash_mergewith( { theme, colorMode }, (_a = styleConfig == null ? void 0 : styleConfig.defaultProps) != null ? _a : {}, filterUndefined(chunk_YTQ3XZ3T_omit(rest, ["children"])) ); const stylesRef = (0,external_React_.useRef)({}); if (styleConfig) { const getStyles = resolveStyleConfig(styleConfig); const styles = getStyles(mergedProps); const isStyleEqual = react_fast_compare(stylesRef.current, styles); if (!isStyleEqual) { stylesRef.current = styles; } } return stylesRef.current; } function useStyleConfig(themeKey, props = {}) { return useStyleConfigImpl(themeKey, props); } function useMultiStyleConfig(themeKey, props = {}) { return useStyleConfigImpl(themeKey, props); } function useComponentStyles__unstable(themeKey, props) { var _a; const { baseConfig, ...restProps } = props; const { theme } = useChakra(); const overrides = (_a = theme.components) == null ? void 0 : _a[themeKey]; const styleConfig = overrides ? mergeThemeOverride(overrides, baseConfig) : baseConfig; return useStyleConfigImpl(null, { ...restProps, styleConfig }); } //# sourceMappingURL=chunk-DMO4EI7P.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/icon/dist/chunk-2GBDXOMA.mjs 'use client' // src/icon.tsx ; var fallbackIcon = { path: /* @__PURE__ */ (0,jsx_runtime.jsxs)("g", { stroke: "currentColor", strokeWidth: "1.5", children: [ /* @__PURE__ */ (0,jsx_runtime.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" } ), /* @__PURE__ */ (0,jsx_runtime.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" } ), /* @__PURE__ */ (0,jsx_runtime.jsx)("circle", { fill: "none", strokeMiterlimit: "10", cx: "12", cy: "12", r: "11.25" }) ] }), viewBox: "0 0 24 24" }; var Icon = forwardRef((props, ref) => { const { as: element, viewBox, color = "currentColor", focusable = false, children, className, __css, ...rest } = props; const _className = cx("chakra-icon", className); const customStyles = useStyleConfig("Icon", props); const styles = { w: "1em", h: "1em", display: "inline-block", lineHeight: "1em", flexShrink: 0, color, ...__css, ...customStyles }; const shared = { ref, focusable, className: _className, __css: styles }; const _viewBox = viewBox != null ? viewBox : fallbackIcon.viewBox; if (element && typeof element !== "string") { return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.svg, { as: element, ...shared, ...rest }); } const _path = children != null ? children : fallbackIcon.path; return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.svg, { verticalAlign: "middle", viewBox: _viewBox, ...shared, ...rest, children: _path }); }); Icon.displayName = "Icon"; var icon_default = (/* unused pure expression or super */ null && (Icon)); //# sourceMappingURL=chunk-2GBDXOMA.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-NEDBTDT2.mjs 'use client' // src/icons.tsx ; function CheckIcon(props) { return /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.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 /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.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 /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.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" } ) }); } //# sourceMappingURL=chunk-NEDBTDT2.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/spinner/dist/chunk-5PH6ULNP.mjs 'use client' // src/spinner.tsx ; var spin = keyframes({ "0%": { transform: "rotate(0deg)" }, "100%": { transform: "rotate(360deg)" } }); var Spinner = forwardRef((props, ref) => { const styles = 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`, ...styles }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, __css: spinnerStyles, className: _className, ...rest, children: label && /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { srOnly: true, children: label }) } ); }); Spinner.displayName = "Spinner"; //# sourceMappingURL=chunk-5PH6ULNP.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-XCES3W5V.mjs 'use client' ; // src/alert-context.ts var [AlertProvider, useAlertContext] = createContext({ name: "AlertContext", hookName: "useAlertContext", providerName: "<Alert />" }); var [AlertStylesProvider, useAlertStyles] = createContext({ name: `AlertStylesContext`, hookName: `useAlertStyles`, providerName: "<Alert />" }); 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; } //# sourceMappingURL=chunk-XCES3W5V.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-3KCBMPN5.mjs 'use client' ; // src/alert.tsx var Alert = forwardRef(function Alert2(props, ref) { var _a; const { status = "info", addRole = true, ...rest } = omitThemingProps(props); const colorScheme = (_a = props.colorScheme) != null ? _a : getStatusColorScheme(status); const styles = useMultiStyleConfig("Alert", { ...props, colorScheme }); const alertStyles = { width: "100%", display: "flex", alignItems: "center", position: "relative", overflow: "hidden", ...styles.container }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AlertProvider, { value: { status }, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(AlertStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { "data-status": status, role: addRole ? "alert" : void 0, ref, ...rest, className: cx("chakra-alert", props.className), __css: alertStyles } ) }) }); }); Alert.displayName = "Alert"; //# sourceMappingURL=chunk-3KCBMPN5.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-ALC6QPCI.mjs 'use client' ; // src/alert-icon.tsx function AlertIcon(props) { const { status } = useAlertContext(); const BaseIcon = getStatusIcon(status); const styles = useAlertStyles(); const css = status === "loading" ? styles.spinner : styles.icon; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { display: "inherit", "data-status": status, ...props, className: cx("chakra-alert__icon", props.className), __css: css, children: props.children || /* @__PURE__ */ (0,jsx_runtime.jsx)(BaseIcon, { h: "100%", w: "100%" }) } ); } AlertIcon.displayName = "AlertIcon"; //# sourceMappingURL=chunk-ALC6QPCI.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-QURMB2UJ.mjs 'use client' ; // src/alert-title.tsx var AlertTitle = forwardRef( function AlertTitle2(props, ref) { const styles = useAlertStyles(); const { status } = useAlertContext(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, "data-status": status, ...props, className: cx("chakra-alert__title", props.className), __css: styles.title } ); } ); AlertTitle.displayName = "AlertTitle"; //# sourceMappingURL=chunk-QURMB2UJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/alert/dist/chunk-CUKBNH6U.mjs 'use client' ; // src/alert-description.tsx var AlertDescription = forwardRef( function AlertDescription2(props, ref) { const styles = useAlertStyles(); const { status } = useAlertContext(); const descriptionStyles = { display: "inline", ...styles.description }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, "data-status": status, ...props, className: cx("chakra-alert__desc", props.className), __css: descriptionStyles } ); } ); AlertDescription.displayName = "AlertDescription"; //# sourceMappingURL=chunk-CUKBNH6U.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/close-button/dist/chunk-37N6GCLA.mjs 'use client' // src/close-button.tsx ; function CloseIcon(props) { return /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { focusable: "false", "aria-hidden": true, ...props, children: /* @__PURE__ */ (0,jsx_runtime.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 = forwardRef( function CloseButton2(props, ref) { const styles = useStyleConfig("CloseButton", props); const { children, isDisabled, __css, ...rest } = omitThemingProps(props); const baseStyle = { outline: 0, display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.button, { type: "button", "aria-label": "Close", ref, disabled: isDisabled, __css: { ...baseStyle, ...styles, ...__css }, ...rest, children: children || /* @__PURE__ */ (0,jsx_runtime.jsx)(CloseIcon, { width: "1em", height: "1em" }) } ); } ); CloseButton.displayName = "CloseButton"; //# sourceMappingURL=chunk-37N6GCLA.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-HYCJNCPE.mjs 'use client' ; // src/toast.tsx // src/toast.store.ts var initialState = { top: [], "top-left": [], "top-right": [], "bottom-left": [], bottom: [], "bottom-right": [] }; var toastStore = createStore(initialState); function createStore(initialState2) { let state = initialState2; const listeners = /* @__PURE__ */ new Set(); const setState = (setStateFn) => { state = setStateFn(state); listeners.forEach((l) => l()); }; return { getState: () => state, subscribe: (listener) => { listeners.add(listener); return () => { setState(() => initialState2); listeners.delete(listener); }; }, /** * Delete a toast record at its position */ removeToast: (id, position) => { setState((prevState) => ({ ...prevState, // id may be string or number // eslint-disable-next-line eqeqeq [position]: prevState[position].filter((toast) => toast.id != id) })); }, notify: (message, options) => { const toast = createToast(message, options); const { position, id } = toast; setState((prevToasts) => { var _a, _b; const isTop = position.includes("top"); const toasts = isTop ? [toast, ...(_a = prevToasts[position]) != null ? _a : []] : [...(_b = prevToasts[position]) != null ? _b : [], toast]; return { ...prevToasts, [position]: toasts }; }); return id; }, update: (id, options) => { if (!id) return; setState((prevState) => { const nextState = { ...prevState }; const { position, index } = findToast(nextState, id); if (position && index !== -1) { nextState[position][index] = { ...nextState[position][index], ...options, message: createRenderToast(options) }; } return nextState; }); }, closeAll: ({ positions } = {}) => { setState((prev) => { const allPositions = [ "bottom", "bottom-right", "bottom-left", "top", "top-left", "top-right" ]; const positionsToClose = positions != null ? positions : allPositions; return positionsToClose.reduce( (acc, position) => { acc[position] = prev[position].map((toast) => ({ ...toast, requestClose: true })); return acc; }, { ...prev } ); }); }, close: (id) => { setState((prevState) => { const position = getToastPosition(prevState, id); if (!position) return prevState; return { ...prevState, [position]: prevState[position].map((toast) => { if (toast.id == id) { return { ...toast, requestClose: true }; } return toast; }) }; }); }, isActive: (id) => Boolean(findToast(toastStore.getState(), id).position) }; } var chunk_HYCJNCPE_counter = 0; function createToast(message, options = {}) { var _a, _b; chunk_HYCJNCPE_counter += 1; const id = (_a = options.id) != null ? _a : chunk_HYCJNCPE_counter; const position = (_b = options.position) != null ? _b : "bottom"; return { id, message, position, duration: options.duration, onCloseComplete: options.onCloseComplete, onRequestRemove: () => toastStore.removeToast(String(id), position), status: options.status, requestClose: false, containerStyle: options.containerStyle }; } // src/toast.tsx var Toast = (props) => { const { status, variant = "solid", id, title, isClosable, onClose, description, colorScheme, icon } = props; const ids = id ? { root: `toast-${id}`, title: `toast-${id}-title`, description: `toast-${id}-description` } : void 0; return /* @__PURE__ */ (0,jsx_runtime.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: [ /* @__PURE__ */ (0,jsx_runtime.jsx)(AlertIcon, { children: icon }), /* @__PURE__ */ (0,jsx_runtime.jsxs)(chakra.div, { flex: "1", maxWidth: "100%", children: [ title && /* @__PURE__ */ (0,jsx_runtime.jsx)(AlertTitle, { id: ids == null ? void 0 : ids.title, children: title }), description && /* @__PURE__ */ (0,jsx_runtime.jsx)(AlertDescription, { id: ids == null ? void 0 : ids.description, display: "block", children: description }) ] }), isClosable && /* @__PURE__ */ (0,jsx_runtime.jsx)( CloseButton, { size: "sm", onClick: onClose, position: "absolute", insetEnd: 1, top: 1 } ) ] } ); }; function createRenderToast(options = {}) { const { render, toastComponent: ToastComponent = Toast } = options; const renderToast = (props) => { if (typeof render === "function") { return render({ ...props, ...options }); } return /* @__PURE__ */ (0,jsx_runtime.jsx)(ToastComponent, { ...props, ...options }); }; return renderToast; } function createToastFn(dir, defaultOptions) { const normalizeToastOptions = (options) => { var _a; return { ...defaultOptions, ...options, position: getToastPlacement( (_a = options == null ? void 0 : options.position) != null ? _a : defaultOptions == null ? void 0 : defaultOptions.position, dir ) }; }; const toast = (options) => { const normalizedToastOptions = normalizeToastOptions(options); const Message = createRenderToast(normalizedToastOptions); return toastStore.notify(Message, normalizedToastOptions); }; toast.update = (id, options) => { toastStore.update(id, normalizeToastOptions(options)); }; toast.promise = (promise, options) => { const id = toast({ ...options.loading, status: "loading", duration: null }); promise.then( (data) => toast.update(id, { status: "success", duration: 5e3, ...dist_runIfFn(options.success, data) }) ).catch( (error) => toast.update(id, { status: "error", duration: 5e3, ...dist_runIfFn(options.error, error) }) ); }; toast.closeAll = toastStore.closeAll; toast.close = toastStore.close; toast.isActive = toastStore.isActive; return toast; } //# sourceMappingURL=chunk-HYCJNCPE.mjs.map ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs function useIsMounted() { var isMounted = (0,external_React_.useRef)(false); useIsomorphicLayoutEffect(function () { isMounted.current = true; return function () { isMounted.current = false; }; }, []); return isMounted; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-force-update.mjs function useForceUpdate() { var isMounted = useIsMounted(); var _a = tslib_es6_read((0,external_React_.useState)(0), 2), forcedRenderCount = _a[0], setForcedRenderCount = _a[1]; var forceRender = (0,external_React_.useCallback)(function () { isMounted.current && setForcedRenderCount(forcedRenderCount + 1); }, [forcedRenderCount]); /** * Defer this to the end of the next animation frame in case there are multiple * synchronous calls. */ var deferredForceRender = (0,external_React_.useCallback)(function () { return es.postRender(forceRender); }, [forceRender]); return [deferredForceRender, forcedRenderCount]; } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs var PresenceChild = function (_a) { var children = _a.children, initial = _a.initial, isPresent = _a.isPresent, onExitComplete = _a.onExitComplete, custom = _a.custom, presenceAffectsLayout = _a.presenceAffectsLayout; var presenceChildren = useConstant(newChildrenMap); var id = useId(); var context = (0,external_React_.useMemo)(function () { return ({ id: id, initial: initial, isPresent: isPresent, custom: custom, onExitComplete: function (childId) { var e_1, _a; presenceChildren.set(childId, true); try { for (var _b = __values(presenceChildren.values()), _c = _b.next(); !_c.done; _c = _b.next()) { var isComplete = _c.value; if (!isComplete) return; // can stop searching when any is incomplete } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(); }, register: function (childId) { presenceChildren.set(childId, false); return function () { 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 ? undefined : [isPresent]); (0,external_React_.useMemo)(function () { presenceChildren.forEach(function (_, key) { return presenceChildren.set(key, false); }); }, [isPresent]); /** * If there's no `motion` components to fire exit animations, we want to remove this * component immediately. */ external_React_.useEffect(function () { !isPresent && !presenceChildren.size && (onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete()); }, [isPresent]); return (external_React_.createElement(PresenceContext.Provider, { value: context }, children)); }; function newChildrenMap() { return new Map(); } ;// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs var getChildKey = function (child) { return child.key || ""; }; function updateChildLookup(children, allChildren) { children.forEach(function (child) { var key = getChildKey(child); allChildren.set(key, child); }); } function onlyElements(children) { var filtered = []; // We use forEach here instead of map as map mutates the component key by preprending `.$` external_React_.Children.forEach(children, function (child) { if ((0,external_React_.isValidElement)(child)) filtered.push(child); }); return filtered; } /** * `AnimatePresence` enables the animation of components that have been removed from the tree. * * When adding/removing more than a single child, every child **must** be given a unique `key` prop. * * Any `motion` components that have an `exit` property defined will animate out when removed from * the tree. * * ```jsx * import { motion, AnimatePresence } from 'framer-motion' * * export const Items = ({ items }) => ( * <AnimatePresence> * {items.map(item => ( * <motion.div * key={item.id} * initial={{ opacity: 0 }} * animate={{ opacity: 1 }} * exit={{ opacity: 0 }} * /> * ))} * </AnimatePresence> * ) * ``` * * You can sequence exit animations throughout a tree using variants. * * If a child contains multiple `motion` components with `exit` props, it will only unmount the child * once all `motion` components have finished animating out. Likewise, any components using * `usePresence` all need to call `safeToRemove`. * * @public */ var AnimatePresence = function (_a) { var children = _a.children, custom = _a.custom, _b = _a.initial, initial = _b === void 0 ? true : _b, onExitComplete = _a.onExitComplete, exitBeforeEnter = _a.exitBeforeEnter, _c = _a.presenceAffectsLayout, presenceAffectsLayout = _c === void 0 ? true : _c; // We want to force a re-render once all exiting animations have finished. We // either use a local forceRender function, or one from a parent context if it exists. var _d = tslib_es6_read(useForceUpdate(), 1), forceRender = _d[0]; var forceRenderLayoutGroup = (0,external_React_.useContext)(LayoutGroupContext).forceRender; if (forceRenderLayoutGroup) forceRender = forceRenderLayoutGroup; var isMounted = useIsMounted(); // Filter out any children that aren't ReactElements. We can only track ReactElements with a props.key var filteredChildren = onlyElements(children); var childrenToRender = filteredChildren; var exiting = new Set(); // Keep a living record of the children we're actually rendering so we // can diff to figure out which are entering and exiting var presentChildren = (0,external_React_.useRef)(childrenToRender); // A lookup table to quickly reference components by key var allChildren = (0,external_React_.useRef)(new Map()).current; // If this is the initial component render, just deal with logic surrounding whether // we play onMount animations or not. var isInitialRender = (0,external_React_.useRef)(true); useIsomorphicLayoutEffect(function () { isInitialRender.current = false; updateChildLookup(filteredChildren, allChildren); presentChildren.current = childrenToRender; }); useUnmountEffect(function () { isInitialRender.current = true; allChildren.clear(); exiting.clear(); }); if (isInitialRender.current) { return (external_React_.createElement(external_React_.Fragment, null, childrenToRender.map(function (child) { return (external_React_.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, initial: initial ? undefined : false, presenceAffectsLayout: presenceAffectsLayout }, child)); }))); } // If this is a subsequent render, deal with entering and exiting children childrenToRender = tslib_es6_spreadArray([], tslib_es6_read(childrenToRender), false); // Diff the keys of the currently-present and target children to update our // exiting list. var presentKeys = presentChildren.current.map(getChildKey); var targetKeys = filteredChildren.map(getChildKey); // Diff the present children with our target children and mark those that are exiting var numPresent = presentKeys.length; for (var i = 0; i < numPresent; i++) { var key = presentKeys[i]; if (targetKeys.indexOf(key) === -1) { exiting.add(key); } } // If we currently have exiting children, and we're deferring rendering incoming children // until after all current children have exiting, empty the childrenToRender array if (exitBeforeEnter && exiting.size) { childrenToRender = []; } // Loop through all currently exiting components and clone them to overwrite `animate` // with any `exit` prop they might have defined. exiting.forEach(function (key) { // If this component is actually entering again, early return if (targetKeys.indexOf(key) !== -1) return; var child = allChildren.get(key); if (!child) return; var insertionIndex = presentKeys.indexOf(key); var onExit = function () { allChildren.delete(key); exiting.delete(key); // Remove this child from the present children var removeIndex = presentChildren.current.findIndex(function (presentChild) { return presentChild.key === key; }); presentChildren.current.splice(removeIndex, 1); // Defer re-rendering until all exiting children have indeed left if (!exiting.size) { presentChildren.current = filteredChildren; if (isMounted.current === false) return; forceRender(); onExitComplete && onExitComplete(); } }; childrenToRender.splice(insertionIndex, 0, external_React_.createElement(PresenceChild, { key: getChildKey(child), isPresent: false, onExitComplete: onExit, custom: custom, presenceAffectsLayout: presenceAffectsLayout }, child)); }); // Add `MotionContext` even to children that don't need it to ensure we're rendering // the same tree between renders childrenToRender = childrenToRender.map(function (child) { var key = child.key; return exiting.has(key) ? (child) : (external_React_.createElement(PresenceChild, { key: getChildKey(child), isPresent: true, presenceAffectsLayout: presenceAffectsLayout }, child)); }); if (env !== "production" && exitBeforeEnter && childrenToRender.length > 1) { console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."); } return (external_React_.createElement(external_React_.Fragment, null, exiting.size ? childrenToRender : childrenToRender.map(function (child) { return (0,external_React_.cloneElement)(child); }))); }; // EXTERNAL MODULE: external "ReactDOM" var external_ReactDOM_ = __webpack_require__(850); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/portal/dist/chunk-34PD6CUK.mjs 'use client' ; // src/portal.tsx var [PortalContextProvider, usePortalContext] = createContext({ strict: false, name: "PortalContext" }); var PORTAL_CLASSNAME = "chakra-portal"; var PORTAL_SELECTOR = `.chakra-portal`; var Container = (props) => /* @__PURE__ */ (0,jsx_runtime.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,external_React_.useState)(null); const portal = (0,external_React_.useRef)(null); const [, forceUpdate] = (0,external_React_.useState)({}); (0,external_React_.useEffect)(() => forceUpdate({}), []); const parentPortal = usePortalContext(); const manager = usePortalManager(); dist_useSafeLayoutEffect(() => { if (!tempNode) return; const doc = tempNode.ownerDocument; const host = appendToParentPortal ? parentPortal != null ? 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) ? /* @__PURE__ */ (0,jsx_runtime.jsx)(Container, { zIndex: manager == null ? void 0 : manager.zIndex, children }) : children; return portal.current ? (0,external_ReactDOM_.createPortal)( /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalContextProvider, { value: portal.current, children: _children }), portal.current ) : /* @__PURE__ */ (0,jsx_runtime.jsx)( "span", { ref: (el) => { if (el) setTempNode(el); } } ); }; var ContainerPortal = (props) => { const { children, containerRef, appendToParentPortal } = props; const containerEl = containerRef.current; const host = containerEl != null ? containerEl : typeof window !== "undefined" ? document.body : void 0; const portal = (0,external_React_.useMemo)(() => { const node = containerEl == null ? void 0 : containerEl.ownerDocument.createElement("div"); if (node) node.className = PORTAL_CLASSNAME; return node; }, [containerEl]); const [, forceUpdate] = (0,external_React_.useState)({}); dist_useSafeLayoutEffect(() => forceUpdate({}), []); dist_useSafeLayoutEffect(() => { if (!portal || !host) return; host.appendChild(portal); return () => { host.removeChild(portal); }; }, [portal, host]); if (host && portal) { return (0,external_ReactDOM_.createPortal)( /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalContextProvider, { value: appendToParentPortal ? portal : null, children }), portal ); } return null; }; function Portal(props) { const portalProps = { appendToParentPortal: true, ...props }; const { containerRef, ...rest } = portalProps; return containerRef ? /* @__PURE__ */ (0,jsx_runtime.jsx)(ContainerPortal, { containerRef, ...rest }) : /* @__PURE__ */ (0,jsx_runtime.jsx)(DefaultPortal, { ...rest }); } Portal.className = PORTAL_CLASSNAME; Portal.selector = PORTAL_SELECTOR; Portal.displayName = "Portal"; //# sourceMappingURL=chunk-34PD6CUK.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-3Y4YXCR2.mjs 'use client' ; // src/toast.provider.tsx var [ToastOptionProvider, useToastOptionContext] = createContext({ name: `ToastOptionsContext`, strict: false }); var ToastProvider = (props) => { const state = (0,external_React_.useSyncExternalStore)( toastStore.subscribe, toastStore.getState, toastStore.getState ); const { motionVariants, component: Component = ToastComponent, portalProps } = props; const stateKeys = Object.keys(state); const toastList = stateKeys.map((position) => { const toasts = state[position]; return /* @__PURE__ */ (0,jsx_runtime.jsx)( "div", { role: "region", "aria-live": "polite", "aria-label": `Notifications-${position}`, id: `chakra-toast-manager-${position}`, style: getToastListStyle(position), children: /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { initial: false, children: toasts.map((toast) => /* @__PURE__ */ (0,jsx_runtime.jsx)( Component, { motionVariants, ...toast }, toast.id )) }) }, position ); }); return /* @__PURE__ */ (0,jsx_runtime.jsx)(Portal, { ...portalProps, children: toastList }); }; //# sourceMappingURL=chunk-3Y4YXCR2.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react/dist/chunk-QAITB7GG.mjs 'use client' // src/chakra-provider.tsx ; var createChakraProvider = (providerTheme) => { return function ChakraProvider2({ children, theme = providerTheme, toastOptions, ...restProps }) { return /* @__PURE__ */ (0,jsx_runtime.jsxs)(ChakraProvider, { theme, ...restProps, children: [ /* @__PURE__ */ (0,jsx_runtime.jsx)(ToastOptionProvider, { value: toastOptions == null ? void 0 : toastOptions.defaultOptions, children }), /* @__PURE__ */ (0,jsx_runtime.jsx)(ToastProvider, { ...toastOptions }) ] }); }; }; var chunk_QAITB7GG_ChakraProvider = createChakraProvider(theme); var ChakraBaseProvider = createChakraProvider(baseTheme); //# sourceMappingURL=chunk-QAITB7GG.mjs.map // EXTERNAL MODULE: ./node_modules/react-query/es/index.js var react_query_es = __webpack_require__(767); // EXTERNAL MODULE: ./node_modules/react-query/devtools/index.js var devtools = __webpack_require__(938); ;// CONCATENATED MODULE: ./node_modules/@remix-run/router/dist/router.js /** * @remix-run/router v1.12.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ function router_extends() { router_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return router_extends.apply(this, arguments); } //////////////////////////////////////////////////////////////////////////////// //#region Types and Constants //////////////////////////////////////////////////////////////////////////////// /** * Actions represent the type of change to a location value. */ var Action; (function (Action) { /** * A POP indicates a change to an arbitrary index in the history stack, such * as a back or forward navigation. It does not describe the direction of the * navigation, only that the current index changed. * * Note: This is the default action for newly created history objects. */ Action["Pop"] = "POP"; /** * A PUSH indicates a new entry being added to the history stack, such as when * a link is clicked and a new page loads. When this happens, all subsequent * entries in the stack are lost. */ Action["Push"] = "PUSH"; /** * A REPLACE indicates the entry at the current index in the history stack * being replaced by a new one. */ Action["Replace"] = "REPLACE"; })(Action || (Action = {})); const PopStateEventType = "popstate"; /** * Memory history stores the current location in memory. It is designed for use * in stateful non-browser environments like tests and React Native. */ function router_createMemoryHistory(options) { if (options === void 0) { options = {}; } let { initialEntries = ["/"], initialIndex, v5Compat = false } = options; let entries; // Declare so we can access from createMemoryLocation entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined)); let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex); let action = Action.Pop; let listener = null; function clampIndex(n) { return Math.min(Math.max(n, 0), entries.length - 1); } function getCurrentLocation() { return entries[index]; } function createMemoryLocation(to, state, key) { if (state === void 0) { state = null; } let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key); router_warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to)); return location; } function createHref(to) { return typeof to === "string" ? to : router_createPath(to); } let history = { get index() { return index; }, get action() { return action; }, get location() { return getCurrentLocation(); }, createHref, createURL(to) { return new URL(createHref(to), "http://localhost"); }, encodeLocation(to) { let path = typeof to === "string" ? parsePath(to) : to; return { pathname: path.pathname || "", search: path.search || "", hash: path.hash || "" }; }, push(to, state) { action = Action.Push; let nextLocation = createMemoryLocation(to, state); index += 1; entries.splice(index, entries.length, nextLocation); if (v5Compat && listener) { listener({ action, location: nextLocation, delta: 1 }); } }, replace(to, state) { action = Action.Replace; let nextLocation = createMemoryLocation(to, state); entries[index] = nextLocation; if (v5Compat && listener) { listener({ action, location: nextLocation, delta: 0 }); } }, go(delta) { action = Action.Pop; let nextIndex = clampIndex(index + delta); let nextLocation = entries[nextIndex]; index = nextIndex; if (listener) { listener({ action, location: nextLocation, delta }); } }, listen(fn) { listener = fn; return () => { listener = null; }; } }; return history; } /** * Browser history stores the location in regular URLs. This is the standard for * most web apps, but it requires some configuration on the server to ensure you * serve the same app at multiple URLs. * * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory */ function router_createBrowserHistory(options) { if (options === void 0) { options = {}; } function createBrowserLocation(window, globalHistory) { let { pathname, search, hash } = window.location; return createLocation("", { pathname, search, hash }, // state defaults to `null` because `window.history.state` does globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); } function createBrowserHref(window, to) { return typeof to === "string" ? to : router_createPath(to); } return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options); } /** * Hash history stores the location in window.location.hash. This makes it ideal * for situations where you don't want to send the location to the server for * some reason, either because you do cannot configure it or the URL space is * reserved for something else. * * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory */ function router_createHashHistory(options) { if (options === void 0) { options = {}; } function createHashLocation(window, globalHistory) { let { pathname = "/", search = "", hash = "" } = parsePath(window.location.hash.substr(1)); // Hash URL should always have a leading / just like window.location.pathname // does, so if an app ends up at a route like /#something then we add a // leading slash so all of our path-matching behaves the same as if it would // in a browser router. This is particularly important when there exists a // root splat route (<Route path="*">) since that matches internally against // "/*" and we'd expect /#something to 404 in a hash router app. if (!pathname.startsWith("/") && !pathname.startsWith(".")) { pathname = "/" + pathname; } return createLocation("", { pathname, search, hash }, // state defaults to `null` because `window.history.state` does globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default"); } function createHashHref(window, to) { let base = window.document.querySelector("base"); let href = ""; if (base && base.getAttribute("href")) { let url = window.location.href; let hashIndex = url.indexOf("#"); href = hashIndex === -1 ? url : url.slice(0, hashIndex); } return href + "#" + (typeof to === "string" ? to : router_createPath(to)); } function validateHashLocation(location, to) { router_warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")"); } return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options); } function router_invariant(value, message) { if (value === false || value === null || typeof value === "undefined") { throw new Error(message); } } function router_warning(cond, message) { if (!cond) { // eslint-disable-next-line no-console if (typeof console !== "undefined") console.warn(message); try { // Welcome to debugging history! // // This error is thrown as a convenience, so you can more easily // find the source for a warning that appears in the console by // enabling "pause on exceptions" in your JavaScript debugger. throw new Error(message); // eslint-disable-next-line no-empty } catch (e) {} } } function createKey() { return Math.random().toString(36).substr(2, 8); } /** * For browser-based histories, we combine the state and key into an object */ function getHistoryState(location, index) { return { usr: location.state, key: location.key, idx: index }; } /** * Creates a Location object with a unique key from the given Path */ function createLocation(current, to, state, key) { if (state === void 0) { state = null; } let location = router_extends({ pathname: typeof current === "string" ? current : current.pathname, search: "", hash: "" }, typeof to === "string" ? parsePath(to) : to, { state, // TODO: This could be cleaned up. push/replace should probably just take // full Locations now and avoid the need to run through this flow at all // But that's a pretty big refactor to the current test suite so going to // keep as is for the time being and just let any incoming keys take precedence key: to && to.key || key || createKey() }); return location; } /** * Creates a string URL path from the given pathname, search, and hash components. */ function router_createPath(_ref) { let { pathname = "/", search = "", hash = "" } = _ref; if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search; if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash; return pathname; } /** * Parses a string URL path into its separate pathname, search, and hash components. */ function parsePath(path) { let parsedPath = {}; if (path) { let hashIndex = path.indexOf("#"); if (hashIndex >= 0) { parsedPath.hash = path.substr(hashIndex); path = path.substr(0, hashIndex); } let searchIndex = path.indexOf("?"); if (searchIndex >= 0) { parsedPath.search = path.substr(searchIndex); path = path.substr(0, searchIndex); } if (path) { parsedPath.pathname = path; } } return parsedPath; } function getUrlBasedHistory(getLocation, createHref, validateLocation, options) { if (options === void 0) { options = {}; } let { window = document.defaultView, v5Compat = false } = options; let globalHistory = window.history; let action = Action.Pop; let listener = null; let index = getIndex(); // Index should only be null when we initialize. If not, it's because the // user called history.pushState or history.replaceState directly, in which // case we should log a warning as it will result in bugs. if (index == null) { index = 0; globalHistory.replaceState(router_extends({}, globalHistory.state, { idx: index }), ""); } function getIndex() { let state = globalHistory.state || { idx: null }; return state.idx; } function handlePop() { action = Action.Pop; let nextIndex = getIndex(); let delta = nextIndex == null ? null : nextIndex - index; index = nextIndex; if (listener) { listener({ action, location: history.location, delta }); } } function push(to, state) { action = Action.Push; let location = createLocation(history.location, to, state); if (validateLocation) validateLocation(location, to); index = getIndex() + 1; let historyState = getHistoryState(location, index); let url = history.createHref(location); // try...catch because iOS limits us to 100 pushState calls :/ try { globalHistory.pushState(historyState, "", url); } catch (error) { // If the exception is because `state` can't be serialized, let that throw // outwards just like a replace call would so the dev knows the cause // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal if (error instanceof DOMException && error.name === "DataCloneError") { throw error; } // They are going to lose state here, but there is no real // way to warn them about it since the page will refresh... window.location.assign(url); } if (v5Compat && listener) { listener({ action, location: history.location, delta: 1 }); } } function replace(to, state) { action = Action.Replace; let location = createLocation(history.location, to, state); if (validateLocation) validateLocation(location, to); index = getIndex(); let historyState = getHistoryState(location, index); let url = history.createHref(location); globalHistory.replaceState(historyState, "", url); if (v5Compat && listener) { listener({ action, location: history.location, delta: 0 }); } } function createURL(to) { // window.location.origin is "null" (the literal string value) in Firefox // under certain conditions, notably when serving from a local HTML file // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297 let base = window.location.origin !== "null" ? window.location.origin : window.location.href; let href = typeof to === "string" ? to : router_createPath(to); router_invariant(base, "No window.location.(origin|href) available to create URL for href: " + href); return new URL(href, base); } let history = { get action() { return action; }, get location() { return getLocation(window, globalHistory); }, listen(fn) { if (listener) { throw new Error("A history only accepts one active listener"); } window.addEventListener(PopStateEventType, handlePop); listener = fn; return () => { window.removeEventListener(PopStateEventType, handlePop); listener = null; }; }, createHref(to) { return createHref(window, to); }, createURL, encodeLocation(to) { // Encode a Location the same way window.location would let url = createURL(to); return { pathname: url.pathname, search: url.search, hash: url.hash }; }, push, replace, go(n) { return globalHistory.go(n); } }; return history; } //#endregion var ResultType; (function (ResultType) { ResultType["data"] = "data"; ResultType["deferred"] = "deferred"; ResultType["redirect"] = "redirect"; ResultType["error"] = "error"; })(ResultType || (ResultType = {})); const immutableRouteKeys = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]); function isIndexRoute(route) { return route.index === true; } // Walk the route tree generating unique IDs where necessary, so we are working // solely with AgnosticDataRouteObject's within the Router function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) { if (parentPath === void 0) { parentPath = []; } if (manifest === void 0) { manifest = {}; } return routes.map((route, index) => { let treePath = [...parentPath, index]; let id = typeof route.id === "string" ? route.id : treePath.join("-"); router_invariant(route.index !== true || !route.children, "Cannot specify children on an index route"); router_invariant(!manifest[id], "Found a route id collision on id \"" + id + "\". Route " + "id's must be globally unique within Data Router usages"); if (isIndexRoute(route)) { let indexRoute = router_extends({}, route, mapRouteProperties(route), { id }); manifest[id] = indexRoute; return indexRoute; } else { let pathOrLayoutRoute = router_extends({}, route, mapRouteProperties(route), { id, children: undefined }); manifest[id] = pathOrLayoutRoute; if (route.children) { pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest); } return pathOrLayoutRoute; } }); } /** * Matches the given routes to a location and returns the match data. * * @see https://reactrouter.com/utils/match-routes */ function matchRoutes(routes, locationArg, basename) { if (basename === void 0) { basename = "/"; } let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; let pathname = router_stripBasename(location.pathname || "/", basename); if (pathname == null) { return null; } let branches = flattenRoutes(routes); rankRouteBranches(branches); let matches = null; for (let i = 0; matches == null && i < branches.length; ++i) { matches = matchRouteBranch(branches[i], // Incoming pathnames are generally encoded from either window.location // or from router.navigate, but we want to match against the unencoded // paths in the route definitions. Memory router locations won't be // encoded here but there also shouldn't be anything to decode so this // should be a safe operation. This avoids needing matchRoutes to be // history-aware. safelyDecodeURI(pathname)); } return matches; } function convertRouteMatchToUiMatch(match, loaderData) { let { route, pathname, params } = match; return { id: route.id, pathname, params, data: loaderData[route.id], handle: route.handle }; } function flattenRoutes(routes, branches, parentsMeta, parentPath) { if (branches === void 0) { branches = []; } if (parentsMeta === void 0) { parentsMeta = []; } if (parentPath === void 0) { parentPath = ""; } let flattenRoute = (route, index, relativePath) => { let meta = { relativePath: relativePath === undefined ? route.path || "" : relativePath, caseSensitive: route.caseSensitive === true, childrenIndex: index, route }; if (meta.relativePath.startsWith("/")) { router_invariant(meta.relativePath.startsWith(parentPath), "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes."); meta.relativePath = meta.relativePath.slice(parentPath.length); } let path = router_joinPaths([parentPath, meta.relativePath]); let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array, so we traverse the // route tree depth-first and child routes appear before their parents in // the "flattened" version. if (route.children && route.children.length > 0) { router_invariant( // Our types know better, but runtime JS may not! // @ts-expect-error route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")); flattenRoutes(route.children, branches, routesMeta, path); } // Routes without a path shouldn't ever match by themselves unless they are // index routes, so don't add them to the list of possible branches. if (route.path == null && !route.index) { return; } branches.push({ path, score: computeScore(path, route.index), routesMeta }); }; routes.forEach((route, index) => { var _route$path; // coarse-grain check for optional params if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) { flattenRoute(route, index); } else { for (let exploded of explodeOptionalSegments(route.path)) { flattenRoute(route, index, exploded); } } }); return branches; } /** * Computes all combinations of optional path segments for a given path, * excluding combinations that are ambiguous and of lower priority. * * For example, `/one/:two?/three/:four?/:five?` explodes to: * - `/one/three` * - `/one/:two/three` * - `/one/three/:four` * - `/one/three/:five` * - `/one/:two/three/:four` * - `/one/:two/three/:five` * - `/one/three/:four/:five` * - `/one/:two/three/:four/:five` */ function explodeOptionalSegments(path) { let segments = path.split("/"); if (segments.length === 0) return []; let [first, ...rest] = segments; // Optional path segments are denoted by a trailing `?` let isOptional = first.endsWith("?"); // Compute the corresponding required segment: `foo?` -> `foo` let required = first.replace(/\?$/, ""); if (rest.length === 0) { // Intepret empty string as omitting an optional segment // `["one", "", "three"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three` return isOptional ? [required, ""] : [required]; } let restExploded = explodeOptionalSegments(rest.join("/")); let result = []; // All child paths with the prefix. Do this for all children before the // optional version for all children, so we get consistent ordering where the // parent optional aspect is preferred as required. Otherwise, we can get // child sections interspersed where deeper optional segments are higher than // parent optional segments, where for example, /:two would explode _earlier_ // then /:one. By always including the parent as required _for all children_ // first, we avoid this issue result.push(...restExploded.map(subpath => subpath === "" ? required : [required, subpath].join("/"))); // Then, if this is an optional value, add all child versions without if (isOptional) { result.push(...restExploded); } // for absolute paths, ensure `/` instead of empty segment return result.map(exploded => path.startsWith("/") && exploded === "" ? "/" : exploded); } function rankRouteBranches(branches) { branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex))); } const paramRe = /^:\w+$/; const dynamicSegmentValue = 3; const indexRouteValue = 2; const emptySegmentValue = 1; const staticSegmentValue = 10; const splatPenalty = -2; const isSplat = s => s === "*"; function computeScore(path, index) { let segments = path.split("/"); let initialScore = segments.length; if (segments.some(isSplat)) { initialScore += splatPenalty; } if (index) { initialScore += indexRouteValue; } return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore); } function compareIndexes(a, b) { let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); return siblings ? // If two routes are siblings, we should try to match the earlier sibling // first. This allows people to have fine-grained control over the matching // behavior by simply putting routes with identical paths in the order they // want them tried. a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index, // so they sort equally. 0; } function matchRouteBranch(branch, pathname) { let { routesMeta } = branch; let matchedParams = {}; let matchedPathname = "/"; let matches = []; for (let i = 0; i < routesMeta.length; ++i) { let meta = routesMeta[i]; let end = i === routesMeta.length - 1; let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; let match = router_matchPath({ path: meta.relativePath, caseSensitive: meta.caseSensitive, end }, remainingPathname); if (!match) return null; Object.assign(matchedParams, match.params); let route = meta.route; matches.push({ // TODO: Can this as be avoided? params: matchedParams, pathname: router_joinPaths([matchedPathname, match.pathname]), pathnameBase: normalizePathname(router_joinPaths([matchedPathname, match.pathnameBase])), route }); if (match.pathnameBase !== "/") { matchedPathname = router_joinPaths([matchedPathname, match.pathnameBase]); } } return matches; } /** * Returns a path with params interpolated. * * @see https://reactrouter.com/utils/generate-path */ function generatePath(originalPath, params) { if (params === void 0) { params = {}; } let path = originalPath; if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) { router_warning(false, "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); path = path.replace(/\*$/, "/*"); } // ensure `/` is added at the beginning if the path is absolute const prefix = path.startsWith("/") ? "/" : ""; const stringify = p => p == null ? "" : typeof p === "string" ? p : String(p); const segments = path.split(/\/+/).map((segment, index, array) => { const isLastSegment = index === array.length - 1; // only apply the splat if it's the last segment if (isLastSegment && segment === "*") { const star = "*"; // Apply the splat return stringify(params[star]); } const keyMatch = segment.match(/^:(\w+)(\??)$/); if (keyMatch) { const [, key, optional] = keyMatch; let param = params[key]; router_invariant(optional === "?" || param != null, "Missing \":" + key + "\" param"); return stringify(param); } // Remove any optional markers from optional static segments return segment.replace(/\?$/g, ""); }) // Remove empty segments .filter(segment => !!segment); return prefix + segments.join("/"); } /** * Performs pattern matching on a URL pathname and returns information about * the match. * * @see https://reactrouter.com/utils/match-path */ function router_matchPath(pattern, pathname) { if (typeof pattern === "string") { pattern = { path: pattern, caseSensitive: false, end: true }; } let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end); let match = pathname.match(matcher); if (!match) return null; let matchedPathname = match[0]; let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); let captureGroups = match.slice(1); let params = compiledParams.reduce((memo, _ref, index) => { let { paramName, isOptional } = _ref; // We need to compute the pathnameBase here using the raw splat value // instead of using params["*"] later because it will be decoded then if (paramName === "*") { let splatValue = captureGroups[index] || ""; pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); } const value = captureGroups[index]; if (isOptional && !value) { memo[paramName] = undefined; } else { memo[paramName] = safelyDecodeURIComponent(value || "", paramName); } return memo; }, {}); return { params, pathname: matchedPathname, pathnameBase, pattern }; } function compilePath(path, caseSensitive, end) { if (caseSensitive === void 0) { caseSensitive = false; } if (end === void 0) { end = true; } router_warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")); let params = []; let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below .replace(/^\/*/, "/") // Make sure it has a leading / .replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars .replace(/\/:(\w+)(\?)?/g, (_, paramName, isOptional) => { params.push({ paramName, isOptional: isOptional != null }); return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; }); if (path.endsWith("*")) { params.push({ paramName: "*" }); regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest : "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"] } else if (end) { // When matching to the end, ignore trailing slashes regexpSource += "\\/*$"; } else if (path !== "" && path !== "/") { // If our path is non-empty and contains anything beyond an initial slash, // then we have _some_ form of path in our regex, so we should expect to // match only if we find the end of this path segment. Look for an optional // non-captured trailing slash (to match a portion of the URL) or the end // of the path (if we've matched to the end). We used to do this with a // word boundary but that gives false positives on routes like // /user-preferences since `-` counts as a word boundary. regexpSource += "(?:(?=\\/|$))"; } else ; let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i"); return [matcher, params]; } function safelyDecodeURI(value) { try { return decodeURI(value); } catch (error) { router_warning(false, "The URL path \"" + value + "\" could not be decoded because it is is a " + "malformed URL segment. This is probably due to a bad percent " + ("encoding (" + error + ").")); return value; } } function safelyDecodeURIComponent(value, paramName) { try { return decodeURIComponent(value); } catch (error) { router_warning(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")); return value; } } /** * @private */ function router_stripBasename(pathname, basename) { if (basename === "/") return pathname; if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { return null; } // We want to leave trailing slash behavior in the user's control, so if they // specify a basename with a trailing slash, we should support it let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; let nextChar = pathname.charAt(startIndex); if (nextChar && nextChar !== "/") { // pathname does not start with basename/ return null; } return pathname.slice(startIndex) || "/"; } /** * Returns a resolved path object relative to the given pathname. * * @see https://reactrouter.com/utils/resolve-path */ function resolvePath(to, fromPathname) { if (fromPathname === void 0) { fromPathname = "/"; } let { pathname: toPathname, search = "", hash = "" } = typeof to === "string" ? parsePath(to) : to; let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname; return { pathname, search: normalizeSearch(search), hash: normalizeHash(hash) }; } function resolvePathname(relativePath, fromPathname) { let segments = fromPathname.replace(/\/+$/, "").split("/"); let relativeSegments = relativePath.split("/"); relativeSegments.forEach(segment => { if (segment === "..") { // Keep the root "" segment so the pathname starts at / if (segments.length > 1) segments.pop(); } else if (segment !== ".") { segments.push(segment); } }); return segments.length > 1 ? segments.join("/") : "/"; } function getInvalidPathError(char, field, dest, path) { return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in <Link to=\"...\"> and the router will parse it for you."; } /** * @private * * When processing relative navigation we want to ignore ancestor routes that * do not contribute to the path, such that index/pathless layout routes don't * interfere. * * For example, when moving a route element into an index route and/or a * pathless layout route, relative link behavior contained within should stay * the same. Both of the following examples should link back to the root: * * <Route path="/"> * <Route path="accounts" element={<Link to=".."}> * </Route> * * <Route path="/"> * <Route path="accounts"> * <Route element={<AccountsLayout />}> // <-- Does not contribute * <Route index element={<Link to=".."} /> // <-- Does not contribute * </Route * </Route> * </Route> */ function getPathContributingMatches(matches) { return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0); } /** * @private */ function router_resolveTo(toArg, routePathnames, locationPathname, isPathRelative) { if (isPathRelative === void 0) { isPathRelative = false; } let to; if (typeof toArg === "string") { to = parsePath(toArg); } else { to = router_extends({}, toArg); router_invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to)); router_invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to)); router_invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to)); } let isEmptyPath = toArg === "" || to.pathname === ""; let toPathname = isEmptyPath ? "/" : to.pathname; let from; // Routing is relative to the current pathname if explicitly requested. // // If a pathname is explicitly provided in `to`, it should be relative to the // route context. This is explained in `Note on `<Link to>` values` in our // migration guide from v5 as a means of disambiguation between `to` values // that begin with `/` and those that do not. However, this is problematic for // `to` values that do not provide a pathname. `to` can simply be a search or // hash string, in which case we should assume that the navigation is relative // to the current location's pathname and *not* the route pathname. if (toPathname == null) { from = locationPathname; } else if (isPathRelative) { let fromSegments = routePathnames[routePathnames.length - 1].replace(/^\//, "").split("/"); if (toPathname.startsWith("..")) { let toSegments = toPathname.split("/"); // With relative="path", each leading .. segment means "go up one URL segment" while (toSegments[0] === "..") { toSegments.shift(); fromSegments.pop(); } to.pathname = toSegments.join("/"); } from = "/" + fromSegments.join("/"); } else { let routePathnameIndex = routePathnames.length - 1; if (toPathname.startsWith("..")) { let toSegments = toPathname.split("/"); // With relative="route" (the default), each leading .. segment means // "go up one route" instead of "go up one URL segment". This is a key // difference from how <a href> works and a major reason we call this a // "to" value instead of a "href". while (toSegments[0] === "..") { toSegments.shift(); routePathnameIndex -= 1; } to.pathname = toSegments.join("/"); } // If there are more ".." segments than parent routes, resolve relative to // the root / URL. from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; } let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original "to" had one let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); // Or if this was a link to the current path which has a trailing slash let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { path.pathname += "/"; } return path; } /** * @private */ function getToPathname(to) { // Empty strings should be treated the same as / paths return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname; } /** * @private */ const router_joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/"); /** * @private */ const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/"); /** * @private */ const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search; /** * @private */ const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; /** * This is a shortcut for creating `application/json` responses. Converts `data` * to JSON and sets the `Content-Type` header. */ const json = function json(data, init) { if (init === void 0) { init = {}; } let responseInit = typeof init === "number" ? { status: init } : init; let headers = new Headers(responseInit.headers); if (!headers.has("Content-Type")) { headers.set("Content-Type", "application/json; charset=utf-8"); } return new Response(JSON.stringify(data), router_extends({}, responseInit, { headers })); }; class AbortedDeferredError extends Error {} class DeferredData { constructor(data, responseInit) { this.pendingKeysSet = new Set(); this.subscribers = new Set(); this.deferredKeys = []; router_invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects"); // Set up an AbortController + Promise we can race against to exit early // cancellation let reject; this.abortPromise = new Promise((_, r) => reject = r); this.controller = new AbortController(); let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted")); this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort); this.controller.signal.addEventListener("abort", onAbort); this.data = Object.entries(data).reduce((acc, _ref2) => { let [key, value] = _ref2; return Object.assign(acc, { [key]: this.trackPromise(key, value) }); }, {}); if (this.done) { // All incoming values were resolved this.unlistenAbortSignal(); } this.init = responseInit; } trackPromise(key, value) { if (!(value instanceof Promise)) { return value; } this.deferredKeys.push(key); this.pendingKeysSet.add(key); // We store a little wrapper promise that will be extended with // _data/_error props upon resolve/reject let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error)); // Register rejection listeners to avoid uncaught promise rejections on // errors or aborted deferred values promise.catch(() => {}); Object.defineProperty(promise, "_tracked", { get: () => true }); return promise; } onSettle(promise, key, error, data) { if (this.controller.signal.aborted && error instanceof AbortedDeferredError) { this.unlistenAbortSignal(); Object.defineProperty(promise, "_error", { get: () => error }); return Promise.reject(error); } this.pendingKeysSet.delete(key); if (this.done) { // Nothing left to abort! this.unlistenAbortSignal(); } // If the promise was resolved/rejected with undefined, we'll throw an error as you // should always resolve with a value or null if (error === undefined && data === undefined) { let undefinedError = new Error("Deferred data for key \"" + key + "\" resolved/rejected with `undefined`, " + "you must resolve/reject with a value or `null`."); Object.defineProperty(promise, "_error", { get: () => undefinedError }); this.emit(false, key); return Promise.reject(undefinedError); } if (data === undefined) { Object.defineProperty(promise, "_error", { get: () => error }); this.emit(false, key); return Promise.reject(error); } Object.defineProperty(promise, "_data", { get: () => data }); this.emit(false, key); return data; } emit(aborted, settledKey) { this.subscribers.forEach(subscriber => subscriber(aborted, settledKey)); } subscribe(fn) { this.subscribers.add(fn); return () => this.subscribers.delete(fn); } cancel() { this.controller.abort(); this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k)); this.emit(true); } async resolveData(signal) { let aborted = false; if (!this.done) { let onAbort = () => this.cancel(); signal.addEventListener("abort", onAbort); aborted = await new Promise(resolve => { this.subscribe(aborted => { signal.removeEventListener("abort", onAbort); if (aborted || this.done) { resolve(aborted); } }); }); } return aborted; } get done() { return this.pendingKeysSet.size === 0; } get unwrappedData() { router_invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds"); return Object.entries(this.data).reduce((acc, _ref3) => { let [key, value] = _ref3; return Object.assign(acc, { [key]: unwrapTrackedPromise(value) }); }, {}); } get pendingKeys() { return Array.from(this.pendingKeysSet); } } function isTrackedPromise(value) { return value instanceof Promise && value._tracked === true; } function unwrapTrackedPromise(value) { if (!isTrackedPromise(value)) { return value; } if (value._error) { throw value._error; } return value._data; } const defer = function defer(data, init) { if (init === void 0) { init = {}; } let responseInit = typeof init === "number" ? { status: init } : init; return new DeferredData(data, responseInit); }; /** * A redirect response. Sets the status code and the `Location` header. * Defaults to "302 Found". */ const redirect = function redirect(url, init) { if (init === void 0) { init = 302; } let responseInit = init; if (typeof responseInit === "number") { responseInit = { status: responseInit }; } else if (typeof responseInit.status === "undefined") { responseInit.status = 302; } let headers = new Headers(responseInit.headers); headers.set("Location", url); return new Response(null, router_extends({}, responseInit, { headers })); }; /** * A redirect response that will force a document reload to the new location. * Sets the status code and the `Location` header. * Defaults to "302 Found". */ const redirectDocument = (url, init) => { let response = redirect(url, init); response.headers.set("X-Remix-Reload-Document", "true"); return response; }; /** * @private * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies * * We don't export the class for public use since it's an implementation * detail, but we export the interface above so folks can build their own * abstractions around instances via isRouteErrorResponse() */ class ErrorResponseImpl { constructor(status, statusText, data, internal) { if (internal === void 0) { internal = false; } this.status = status; this.statusText = statusText || ""; this.internal = internal; if (data instanceof Error) { this.data = data.toString(); this.error = data; } else { this.data = data; } } } /** * Check if the given error is an ErrorResponse generated from a 4xx/5xx * Response thrown from an action/loader */ function isRouteErrorResponse(error) { return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; } const validMutationMethodsArr = ["post", "put", "patch", "delete"]; const validMutationMethods = new Set(validMutationMethodsArr); const validRequestMethodsArr = ["get", ...validMutationMethodsArr]; const validRequestMethods = new Set(validRequestMethodsArr); const redirectStatusCodes = new Set([301, 302, 303, 307, 308]); const redirectPreserveMethodStatusCodes = new Set([307, 308]); const IDLE_NAVIGATION = { state: "idle", location: undefined, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; const router_IDLE_FETCHER = { state: "idle", data: undefined, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; const router_IDLE_BLOCKER = { state: "unblocked", proceed: undefined, reset: undefined, location: undefined }; const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; const defaultMapRouteProperties = route => ({ hasErrorBoundary: Boolean(route.hasErrorBoundary) }); const TRANSITIONS_STORAGE_KEY = "remix-router-transitions"; //#endregion //////////////////////////////////////////////////////////////////////////////// //#region createRouter //////////////////////////////////////////////////////////////////////////////// /** * Create a router and listen to history POP navigations */ function router_createRouter(init) { const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : undefined; const isBrowser = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined"; const isServer = !isBrowser; router_invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter"); let mapRouteProperties; if (init.mapRouteProperties) { mapRouteProperties = init.mapRouteProperties; } else if (init.detectErrorBoundary) { // If they are still using the deprecated version, wrap it with the new API let detectErrorBoundary = init.detectErrorBoundary; mapRouteProperties = route => ({ hasErrorBoundary: detectErrorBoundary(route) }); } else { mapRouteProperties = defaultMapRouteProperties; } // Routes keyed by ID let manifest = {}; // Routes in tree format for matching let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest); let inFlightDataRoutes; let basename = init.basename || "/"; // Config driven behavior flags let future = router_extends({ v7_fetcherPersist: false, v7_normalizeFormMethod: false, v7_prependBasename: false }, init.future); // Cleanup function for history let unlistenHistory = null; // Externally-provided functions to call on all state changes let subscribers = new Set(); // Externally-provided object to hold scroll restoration locations during routing let savedScrollPositions = null; // Externally-provided function to get scroll restoration keys let getScrollRestorationKey = null; // Externally-provided function to get current scroll position let getScrollPosition = null; // One-time flag to control the initial hydration scroll restoration. Because // we don't get the saved positions from <ScrollRestoration /> until _after_ // the initial render, we need to manually trigger a separate updateState to // send along the restoreScrollPosition // Set to true if we have `hydrationData` since we assume we were SSR'd and that // SSR did the initial scroll restoration. let initialScrollRestored = init.hydrationData != null; let initialMatches = matchRoutes(dataRoutes, init.history.location, basename); let initialErrors = null; if (initialMatches == null) { // If we do not match a user-provided-route, fall back to the root // to allow the error boundary to take over let error = getInternalRouterError(404, { pathname: init.history.location.pathname }); let { matches, route } = getShortCircuitMatches(dataRoutes); initialMatches = matches; initialErrors = { [route.id]: error }; } let initialized = // All initialMatches need to be loaded before we're ready. If we have lazy // functions around still then we'll need to run them in initialize() !initialMatches.some(m => m.route.lazy) && ( // And we have to either have no loaders or have been provided hydrationData !initialMatches.some(m => m.route.loader) || init.hydrationData != null); let router; let state = { historyAction: init.history.action, location: init.history.location, matches: initialMatches, initialized, navigation: IDLE_NAVIGATION, // Don't restore on initial updateState() if we were SSR'd restoreScrollPosition: init.hydrationData != null ? false : null, preventScrollReset: false, revalidation: "idle", loaderData: init.hydrationData && init.hydrationData.loaderData || {}, actionData: init.hydrationData && init.hydrationData.actionData || null, errors: init.hydrationData && init.hydrationData.errors || initialErrors, fetchers: new Map(), blockers: new Map() }; // -- Stateful internal variables to manage navigations -- // Current navigation in progress (to be committed in completeNavigation) let pendingAction = Action.Pop; // Should the current navigation prevent the scroll reset if scroll cannot // be restored? let pendingPreventScrollReset = false; // AbortController for the active navigation let pendingNavigationController; // Should the current navigation enable document.startViewTransition? let pendingViewTransitionEnabled = false; // Store applied view transitions so we can apply them on POP let appliedViewTransitions = new Map(); // Cleanup function for persisting applied transitions to sessionStorage let removePageHideEventListener = null; // We use this to avoid touching history in completeNavigation if a // revalidation is entirely uninterrupted let isUninterruptedRevalidation = false; // Use this internal flag to force revalidation of all loaders: // - submissions (completed or interrupted) // - useRevalidator() // - X-Remix-Revalidate (from redirect) let isRevalidationRequired = false; // Use this internal array to capture routes that require revalidation due // to a cancelled deferred on action submission let cancelledDeferredRoutes = []; // Use this internal array to capture fetcher loads that were cancelled by an // action navigation and require revalidation let cancelledFetcherLoads = []; // AbortControllers for any in-flight fetchers let fetchControllers = new Map(); // Track loads based on the order in which they started let incrementingLoadId = 0; // Track the outstanding pending navigation data load to be compared against // the globally incrementing load when a fetcher load lands after a completed // navigation let pendingNavigationLoadId = -1; // Fetchers that triggered data reloads as a result of their actions let fetchReloadIds = new Map(); // Fetchers that triggered redirect navigations let fetchRedirectIds = new Set(); // Most recent href/match for fetcher.load calls for fetchers let fetchLoadMatches = new Map(); // Ref-count mounted fetchers so we know when it's ok to clean them up let activeFetchers = new Map(); // Fetchers that have requested a delete when using v7_fetcherPersist, // they'll be officially removed after they return to idle let deletedFetchers = new Set(); // Store DeferredData instances for active route matches. When a // route loader returns defer() we stick one in here. Then, when a nested // promise resolves we update loaderData. If a new navigation starts we // cancel active deferreds for eliminated routes. let activeDeferreds = new Map(); // Store blocker functions in a separate Map outside of router state since // we don't need to update UI state if they change let blockerFunctions = new Map(); // Flag to ignore the next history update, so we can revert the URL change on // a POP navigation that was blocked by the user without touching router state let ignoreNextHistoryUpdate = false; // Initialize the router, all side effects should be kicked off from here. // Implemented as a Fluent API for ease of: // let router = createRouter(init).initialize(); function initialize() { // If history informs us of a POP navigation, start the navigation but do not update // state. We'll update our own state once the navigation completes unlistenHistory = init.history.listen(_ref => { let { action: historyAction, location, delta } = _ref; // Ignore this event if it was just us resetting the URL from a // blocked POP navigation if (ignoreNextHistoryUpdate) { ignoreNextHistoryUpdate = false; return; } router_warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location " + "that was not created by @remix-run/router. This will fail silently in " + "production. This can happen if you are navigating outside the router " + "via `window.history.pushState`/`window.location.hash` instead of using " + "router navigation APIs. This can also happen if you are using " + "createHashRouter and the user manually changes the URL."); let blockerKey = shouldBlockNavigation({ currentLocation: state.location, nextLocation: location, historyAction }); if (blockerKey && delta != null) { // Restore the URL to match the current UI, but don't update router state ignoreNextHistoryUpdate = true; init.history.go(delta * -1); // Put the blocker into a blocked state updateBlocker(blockerKey, { state: "blocked", location, proceed() { updateBlocker(blockerKey, { state: "proceeding", proceed: undefined, reset: undefined, location }); // Re-do the same POP navigation we just blocked init.history.go(delta); }, reset() { let blockers = new Map(state.blockers); blockers.set(blockerKey, router_IDLE_BLOCKER); updateState({ blockers }); } }); return; } return startNavigation(historyAction, location); }); if (isBrowser) { // FIXME: This feels gross. How can we cleanup the lines between // scrollRestoration/appliedTransitions persistance? restoreAppliedTransitions(routerWindow, appliedViewTransitions); let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions); routerWindow.addEventListener("pagehide", _saveAppliedTransitions); removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions); } // Kick off initial data load if needed. Use Pop to avoid modifying history // Note we don't do any handling of lazy here. For SPA's it'll get handled // in the normal navigation flow. For SSR it's expected that lazy modules are // resolved prior to router creation since we can't go into a fallbackElement // UI for SSR'd apps if (!state.initialized) { startNavigation(Action.Pop, state.location); } return router; } // Clean up a router and it's side effects function dispose() { if (unlistenHistory) { unlistenHistory(); } if (removePageHideEventListener) { removePageHideEventListener(); } subscribers.clear(); pendingNavigationController && pendingNavigationController.abort(); state.fetchers.forEach((_, key) => deleteFetcher(key)); state.blockers.forEach((_, key) => deleteBlocker(key)); } // Subscribe to state updates for the router function subscribe(fn) { subscribers.add(fn); return () => subscribers.delete(fn); } // Update our state and notify the calling context of the change function updateState(newState, opts) { if (opts === void 0) { opts = {}; } state = router_extends({}, state, newState); // Prep fetcher cleanup so we can tell the UI which fetcher data entries // can be removed let completedFetchers = []; let deletedFetchersKeys = []; if (future.v7_fetcherPersist) { state.fetchers.forEach((fetcher, key) => { if (fetcher.state === "idle") { if (deletedFetchers.has(key)) { // Unmounted from the UI and can be totally removed deletedFetchersKeys.push(key); } else { // Returned to idle but still mounted in the UI, so semi-remains for // revalidations and such completedFetchers.push(key); } } }); } // Iterate over a local copy so that if flushSync is used and we end up // removing and adding a new subscriber due to the useCallback dependencies, // we don't get ourselves into a loop calling the new subscriber immediately [...subscribers].forEach(subscriber => subscriber(state, { deletedFetchers: deletedFetchersKeys, unstable_viewTransitionOpts: opts.viewTransitionOpts, unstable_flushSync: opts.flushSync === true })); // Remove idle fetchers from state since we only care about in-flight fetchers. if (future.v7_fetcherPersist) { completedFetchers.forEach(key => state.fetchers.delete(key)); deletedFetchersKeys.forEach(key => deleteFetcher(key)); } } // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION // and setting state.[historyAction/location/matches] to the new route. // - Location is a required param // - Navigation will always be set to IDLE_NAVIGATION // - Can pass any other state in newState function completeNavigation(location, newState, _temp) { var _location$state, _location$state2; let { flushSync } = _temp === void 0 ? {} : _temp; // Deduce if we're in a loading/actionReload state: // - We have committed actionData in the store // - The current navigation was a mutation submission // - We're past the submitting state and into the loading state // - The location being loaded is not the result of a redirect let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true; let actionData; if (newState.actionData) { if (Object.keys(newState.actionData).length > 0) { actionData = newState.actionData; } else { // Empty actionData -> clear prior actionData due to an action error actionData = null; } } else if (isActionReload) { // Keep the current data if we're wrapping up the action reload actionData = state.actionData; } else { // Clear actionData on any other completed navigations actionData = null; } // Always preserve any existing loaderData from re-used routes let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData; // On a successful navigation we can assume we got through all blockers // so we can start fresh let blockers = state.blockers; if (blockers.size > 0) { blockers = new Map(blockers); blockers.forEach((_, k) => blockers.set(k, router_IDLE_BLOCKER)); } // Always respect the user flag. Otherwise don't reset on mutation // submission navigations unless they redirect let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true; if (inFlightDataRoutes) { dataRoutes = inFlightDataRoutes; inFlightDataRoutes = undefined; } if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) { init.history.push(location, location.state); } else if (pendingAction === Action.Replace) { init.history.replace(location, location.state); } let viewTransitionOpts; // On POP, enable transitions if they were enabled on the original navigation if (pendingAction === Action.Pop) { // Forward takes precedence so they behave like the original navigation let priorPaths = appliedViewTransitions.get(state.location.pathname); if (priorPaths && priorPaths.has(location.pathname)) { viewTransitionOpts = { currentLocation: state.location, nextLocation: location }; } else if (appliedViewTransitions.has(location.pathname)) { // If we don't have a previous forward nav, assume we're popping back to // the new location and enable if that location previously enabled viewTransitionOpts = { currentLocation: location, nextLocation: state.location }; } } else if (pendingViewTransitionEnabled) { // Store the applied transition on PUSH/REPLACE let toPaths = appliedViewTransitions.get(state.location.pathname); if (toPaths) { toPaths.add(location.pathname); } else { toPaths = new Set([location.pathname]); appliedViewTransitions.set(state.location.pathname, toPaths); } viewTransitionOpts = { currentLocation: state.location, nextLocation: location }; } updateState(router_extends({}, newState, { actionData, loaderData, historyAction: pendingAction, location, initialized: true, navigation: IDLE_NAVIGATION, revalidation: "idle", restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches), preventScrollReset, blockers }), { viewTransitionOpts, flushSync: flushSync === true }); // Reset stateful navigation vars pendingAction = Action.Pop; pendingPreventScrollReset = false; pendingViewTransitionEnabled = false; isUninterruptedRevalidation = false; isRevalidationRequired = false; cancelledDeferredRoutes = []; cancelledFetcherLoads = []; } // Trigger a navigation event, which can either be a numerical POP or a PUSH // replace with an optional submission async function navigate(to, opts) { if (typeof to === "number") { init.history.go(to); return; } let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative); let { path, submission, error } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts); let currentLocation = state.location; let nextLocation = createLocation(state.location, path, opts && opts.state); // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded // URL from window.location, so we need to encode it here so the behavior // remains the same as POP and non-data-router usages. new URL() does all // the same encoding we'd get from a history.pushState/window.location read // without having to touch history nextLocation = router_extends({}, nextLocation, init.history.encodeLocation(nextLocation)); let userReplace = opts && opts.replace != null ? opts.replace : undefined; let historyAction = Action.Push; if (userReplace === true) { historyAction = Action.Replace; } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) { // By default on submissions to the current location we REPLACE so that // users don't have to double-click the back button to get to the prior // location. If the user redirects to a different location from the // action/loader this will be ignored and the redirect will be a PUSH historyAction = Action.Replace; } let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined; let flushSync = (opts && opts.unstable_flushSync) === true; let blockerKey = shouldBlockNavigation({ currentLocation, nextLocation, historyAction }); if (blockerKey) { // Put the blocker into a blocked state updateBlocker(blockerKey, { state: "blocked", location: nextLocation, proceed() { updateBlocker(blockerKey, { state: "proceeding", proceed: undefined, reset: undefined, location: nextLocation }); // Send the same navigation through navigate(to, opts); }, reset() { let blockers = new Map(state.blockers); blockers.set(blockerKey, router_IDLE_BLOCKER); updateState({ blockers }); } }); return; } return await startNavigation(historyAction, nextLocation, { submission, // Send through the formData serialization error if we have one so we can // render at the right error boundary after we match routes pendingError: error, preventScrollReset, replace: opts && opts.replace, enableViewTransition: opts && opts.unstable_viewTransition, flushSync }); } // Revalidate all current loaders. If a navigation is in progress or if this // is interrupted by a navigation, allow this to "succeed" by calling all // loaders during the next loader round function revalidate() { interruptActiveLoads(); updateState({ revalidation: "loading" }); // If we're currently submitting an action, we don't need to start a new // navigation, we'll just let the follow up loader execution call all loaders if (state.navigation.state === "submitting") { return; } // If we're currently in an idle state, start a new navigation for the current // action/location and mark it as uninterrupted, which will skip the history // update in completeNavigation if (state.navigation.state === "idle") { startNavigation(state.historyAction, state.location, { startUninterruptedRevalidation: true }); return; } // Otherwise, if we're currently in a loading state, just start a new // navigation to the navigation.location but do not trigger an uninterrupted // revalidation so that history correctly updates once the navigation completes startNavigation(pendingAction || state.historyAction, state.navigation.location, { overrideNavigation: state.navigation }); } // Start a navigation to the given action/location. Can optionally provide a // overrideNavigation which will override the normalLoad in the case of a redirect // navigation async function startNavigation(historyAction, location, opts) { // Abort any in-progress navigations and start a new one. Unset any ongoing // uninterrupted revalidations unless told otherwise, since we want this // new navigation to update history normally pendingNavigationController && pendingNavigationController.abort(); pendingNavigationController = null; pendingAction = historyAction; isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; // Save the current scroll position every time we start a new navigation, // and track whether we should reset scroll on completion saveScrollPosition(state.location, state.matches); pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true; let routesToUse = inFlightDataRoutes || dataRoutes; let loadingNavigation = opts && opts.overrideNavigation; let matches = matchRoutes(routesToUse, location, basename); let flushSync = (opts && opts.flushSync) === true; // Short circuit with a 404 on the root error boundary if we match nothing if (!matches) { let error = getInternalRouterError(404, { pathname: location.pathname }); let { matches: notFoundMatches, route } = getShortCircuitMatches(routesToUse); // Cancel all pending deferred on 404s since we don't keep any routes cancelActiveDeferreds(); completeNavigation(location, { matches: notFoundMatches, loaderData: {}, errors: { [route.id]: error } }, { flushSync }); return; } // Short circuit if it's only a hash change and not a revalidation or // mutation submission. // // Ignore on initial page loads because since the initial load will always // be "same hash". For example, on /page#hash and submit a <Form method="post"> // which will default to a navigation to /page if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) { completeNavigation(location, { matches }, { flushSync }); return; } // Create a controller/Request for this navigation pendingNavigationController = new AbortController(); let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission); let pendingActionData; let pendingError; if (opts && opts.pendingError) { // If we have a pendingError, it means the user attempted a GET submission // with binary FormData so assign here and skip to handleLoaders. That // way we handle calling loaders above the boundary etc. It's not really // different from an actionError in that sense. pendingError = { [findNearestBoundary(matches).route.id]: opts.pendingError }; } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) { // Call action if we received an action submission let actionOutput = await handleAction(request, location, opts.submission, matches, { replace: opts.replace, flushSync }); if (actionOutput.shortCircuited) { return; } pendingActionData = actionOutput.pendingActionData; pendingError = actionOutput.pendingActionError; loadingNavigation = getLoadingNavigation(location, opts.submission); flushSync = false; // Create a GET request for the loaders request = new Request(request.url, { signal: request.signal }); } // Call loaders let { shortCircuited, loaderData, errors } = await handleLoaders(request, location, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, flushSync, pendingActionData, pendingError); if (shortCircuited) { return; } // Clean up now that the action/loaders have completed. Don't clean up if // we short circuited because pendingNavigationController will have already // been assigned to a new controller for the next navigation pendingNavigationController = null; completeNavigation(location, router_extends({ matches }, pendingActionData ? { actionData: pendingActionData } : {}, { loaderData, errors })); } // Call the action matched by the leaf route for this navigation and handle // redirects/errors async function handleAction(request, location, submission, matches, opts) { if (opts === void 0) { opts = {}; } interruptActiveLoads(); // Put us in a submitting state let navigation = getSubmittingNavigation(location, submission); updateState({ navigation }, { flushSync: opts.flushSync === true }); // Call our action and get the result let result; let actionMatch = getTargetMatch(matches, location); if (!actionMatch.route.action && !actionMatch.route.lazy) { result = { type: ResultType.error, error: getInternalRouterError(405, { method: request.method, pathname: location.pathname, routeId: actionMatch.route.id }) }; } else { result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename); if (request.signal.aborted) { return { shortCircuited: true }; } } if (isRedirectResult(result)) { let replace; if (opts && opts.replace != null) { replace = opts.replace; } else { // If the user didn't explicity indicate replace behavior, replace if // we redirected to the exact same location we're currently at to avoid // double back-buttons replace = result.location === state.location.pathname + state.location.search; } await startRedirectNavigation(state, result, { submission, replace }); return { shortCircuited: true }; } if (isErrorResult(result)) { // Store off the pending error - we use it to determine which loaders // to call and will commit it when we complete the navigation let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); // By default, all submissions are REPLACE navigations, but if the // action threw an error that'll be rendered in an errorElement, we fall // back to PUSH so that the user can use the back button to get back to // the pre-submission form location to try again if ((opts && opts.replace) !== true) { pendingAction = Action.Push; } return { // Send back an empty object we can use to clear out any prior actionData pendingActionData: {}, pendingActionError: { [boundaryMatch.route.id]: result.error } }; } if (isDeferredResult(result)) { throw getInternalRouterError(400, { type: "defer-action" }); } return { pendingActionData: { [actionMatch.route.id]: result.data } }; } // Call all applicable loaders for the given matches, handling redirects, // errors, etc. async function handleLoaders(request, location, matches, overrideNavigation, submission, fetcherSubmission, replace, flushSync, pendingActionData, pendingError) { // Figure out the right navigation we want to use for data loading let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission); // If this was a redirect from an action we don't have a "submission" but // we have it on the loading navigation so use that if available let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation); let routesToUse = inFlightDataRoutes || dataRoutes; let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError); // Cancel pending deferreds for no-longer-matched routes or routes we're // about to reload. Note that if this is an action reload we would have // already cancelled all pending deferreds so this would be a no-op cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId)); pendingNavigationLoadId = ++incrementingLoadId; // Short circuit if we have no loaders to run if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) { let updatedFetchers = markFetchRedirectsDone(); completeNavigation(location, router_extends({ matches, loaderData: {}, // Commit pending error if we're short circuiting errors: pendingError || null }, pendingActionData ? { actionData: pendingActionData } : {}, updatedFetchers ? { fetchers: new Map(state.fetchers) } : {}), { flushSync }); return { shortCircuited: true }; } // If this is an uninterrupted revalidation, we remain in our current idle // state. If not, we need to switch to our loading state and load data, // preserving any new action data or existing action data (in the case of // a revalidation interrupting an actionReload) if (!isUninterruptedRevalidation) { revalidatingFetchers.forEach(rf => { let fetcher = state.fetchers.get(rf.key); let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined); state.fetchers.set(rf.key, revalidatingFetcher); }); let actionData = pendingActionData || state.actionData; updateState(router_extends({ navigation: loadingNavigation }, actionData ? Object.keys(actionData).length === 0 ? { actionData: null } : { actionData } : {}, revalidatingFetchers.length > 0 ? { fetchers: new Map(state.fetchers) } : {}), { flushSync }); } revalidatingFetchers.forEach(rf => { if (fetchControllers.has(rf.key)) { abortFetcher(rf.key); } if (rf.controller) { // Fetchers use an independent AbortController so that aborting a fetcher // (via deleteFetcher) does not abort the triggering navigation that // triggered the revalidation fetchControllers.set(rf.key, rf.controller); } }); // Proxy navigation abort through to revalidation fetchers let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key)); if (pendingNavigationController) { pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations); } let { results, loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request); if (request.signal.aborted) { return { shortCircuited: true }; } // Clean up _after_ loaders have completed. Don't clean up if we short // circuited because fetchControllers would have been aborted and // reassigned to new controllers for the next navigation if (pendingNavigationController) { pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations); } revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key)); // If any loaders returned a redirect Response, start a new REPLACE navigation let redirect = findRedirect(results); if (redirect) { if (redirect.idx >= matchesToLoad.length) { // If this redirect came from a fetcher make sure we mark it in // fetchRedirectIds so it doesn't get revalidated on the next set of // loader executions let fetcherKey = revalidatingFetchers[redirect.idx - matchesToLoad.length].key; fetchRedirectIds.add(fetcherKey); } await startRedirectNavigation(state, redirect.result, { replace }); return { shortCircuited: true }; } // Process and commit output from loaders let { loaderData, errors } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds); // Wire up subscribers to update loaderData as promises settle activeDeferreds.forEach((deferredData, routeId) => { deferredData.subscribe(aborted => { // Note: No need to updateState here since the TrackedPromise on // loaderData is stable across resolve/reject // Remove this instance if we were aborted or if promises have settled if (aborted || deferredData.done) { activeDeferreds.delete(routeId); } }); }); let updatedFetchers = markFetchRedirectsDone(); let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0; return router_extends({ loaderData, errors }, shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {}); } // Trigger a fetcher load/submit for the given fetcher key function fetch(key, routeId, href, opts) { if (isServer) { throw new Error("router.fetch() was called during the server render, but it shouldn't be. " + "You are likely calling a useFetcher() method in the body of your component. " + "Try moving it to a useEffect or a callback."); } if (fetchControllers.has(key)) abortFetcher(key); let flushSync = (opts && opts.unstable_flushSync) === true; let routesToUse = inFlightDataRoutes || dataRoutes; let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, routeId, opts == null ? void 0 : opts.relative); let matches = matchRoutes(routesToUse, normalizedPath, basename); if (!matches) { setFetcherError(key, routeId, getInternalRouterError(404, { pathname: normalizedPath }), { flushSync }); return; } let { path, submission, error } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts); if (error) { setFetcherError(key, routeId, error, { flushSync }); return; } let match = getTargetMatch(matches, path); pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; if (submission && isMutationMethod(submission.formMethod)) { handleFetcherAction(key, routeId, path, match, matches, flushSync, submission); return; } // Store off the match so we can call it's shouldRevalidate on subsequent // revalidations fetchLoadMatches.set(key, { routeId, path }); handleFetcherLoader(key, routeId, path, match, matches, flushSync, submission); } // Call the action for the matched fetcher.submit(), and then handle redirects, // errors, and revalidation async function handleFetcherAction(key, routeId, path, match, requestMatches, flushSync, submission) { interruptActiveLoads(); fetchLoadMatches.delete(key); if (!match.route.action && !match.route.lazy) { let error = getInternalRouterError(405, { method: submission.formMethod, pathname: path, routeId: routeId }); setFetcherError(key, routeId, error, { flushSync }); return; } // Put this fetcher into it's submitting state let existingFetcher = state.fetchers.get(key); updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), { flushSync }); // Call the action for the fetcher let abortController = new AbortController(); let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission); fetchControllers.set(key, abortController); let originatingLoadId = incrementingLoadId; let actionResult = await callLoaderOrAction("action", fetchRequest, match, requestMatches, manifest, mapRouteProperties, basename); if (fetchRequest.signal.aborted) { // We can delete this so long as we weren't aborted by our own fetcher // re-submit which would have put _new_ controller is in fetchControllers if (fetchControllers.get(key) === abortController) { fetchControllers.delete(key); } return; } if (deletedFetchers.has(key)) { updateFetcherState(key, getDoneFetcher(undefined)); return; } if (isRedirectResult(actionResult)) { fetchControllers.delete(key); if (pendingNavigationLoadId > originatingLoadId) { // A new navigation was kicked off after our action started, so that // should take precedence over this redirect navigation. We already // set isRevalidationRequired so all loaders for the new route should // fire unless opted out via shouldRevalidate updateFetcherState(key, getDoneFetcher(undefined)); return; } else { fetchRedirectIds.add(key); updateFetcherState(key, getLoadingFetcher(submission)); return startRedirectNavigation(state, actionResult, { fetcherSubmission: submission }); } } // Process any non-redirect errors thrown if (isErrorResult(actionResult)) { setFetcherError(key, routeId, actionResult.error); return; } if (isDeferredResult(actionResult)) { throw getInternalRouterError(400, { type: "defer-action" }); } // Start the data load for current matches, or the next location if we're // in the middle of a navigation let nextLocation = state.navigation.location || state.location; let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal); let routesToUse = inFlightDataRoutes || dataRoutes; let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches; router_invariant(matches, "Didn't find any matches after fetcher action"); let loadId = ++incrementingLoadId; fetchReloadIds.set(key, loadId); let loadFetcher = getLoadingFetcher(submission, actionResult.data); state.fetchers.set(key, loadFetcher); let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, { [match.route.id]: actionResult.data }, undefined // No need to send through errors since we short circuit above ); // Put all revalidating fetchers into the loading state, except for the // current fetcher which we want to keep in it's current loading state which // contains it's action submission info + action data revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => { let staleKey = rf.key; let existingFetcher = state.fetchers.get(staleKey); let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined); state.fetchers.set(staleKey, revalidatingFetcher); if (fetchControllers.has(staleKey)) { abortFetcher(staleKey); } if (rf.controller) { fetchControllers.set(staleKey, rf.controller); } }); updateState({ fetchers: new Map(state.fetchers) }); let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key)); abortController.signal.addEventListener("abort", abortPendingFetchRevalidations); let { results, loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest); if (abortController.signal.aborted) { return; } abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations); fetchReloadIds.delete(key); fetchControllers.delete(key); revalidatingFetchers.forEach(r => fetchControllers.delete(r.key)); let redirect = findRedirect(results); if (redirect) { if (redirect.idx >= matchesToLoad.length) { // If this redirect came from a fetcher make sure we mark it in // fetchRedirectIds so it doesn't get revalidated on the next set of // loader executions let fetcherKey = revalidatingFetchers[redirect.idx - matchesToLoad.length].key; fetchRedirectIds.add(fetcherKey); } return startRedirectNavigation(state, redirect.result); } // Process and commit output from loaders let { loaderData, errors } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds); // Since we let revalidations complete even if the submitting fetcher was // deleted, only put it back to idle if it hasn't been deleted if (state.fetchers.has(key)) { let doneFetcher = getDoneFetcher(actionResult.data); state.fetchers.set(key, doneFetcher); } abortStaleFetchLoads(loadId); // If we are currently in a navigation loading state and this fetcher is // more recent than the navigation, we want the newer data so abort the // navigation and complete it with the fetcher data if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { router_invariant(pendingAction, "Expected pending action"); pendingNavigationController && pendingNavigationController.abort(); completeNavigation(state.navigation.location, { matches, loaderData, errors, fetchers: new Map(state.fetchers) }); } else { // otherwise just update with the fetcher data, preserving any existing // loaderData for loaders that did not need to reload. We have to // manually merge here since we aren't going through completeNavigation updateState({ errors, loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors), fetchers: new Map(state.fetchers) }); isRevalidationRequired = false; } } // Call the matched loader for fetcher.load(), handling redirects, errors, etc. async function handleFetcherLoader(key, routeId, path, match, matches, flushSync, submission) { let existingFetcher = state.fetchers.get(key); updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), { flushSync }); // Call the loader for this fetcher route match let abortController = new AbortController(); let fetchRequest = createClientSideRequest(init.history, path, abortController.signal); fetchControllers.set(key, abortController); let originatingLoadId = incrementingLoadId; let result = await callLoaderOrAction("loader", fetchRequest, match, matches, manifest, mapRouteProperties, basename); // Deferred isn't supported for fetcher loads, await everything and treat it // as a normal load. resolveDeferredData will return undefined if this // fetcher gets aborted, so we just leave result untouched and short circuit // below if that happens if (isDeferredResult(result)) { result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result; } // We can delete this so long as we weren't aborted by our our own fetcher // re-load which would have put _new_ controller is in fetchControllers if (fetchControllers.get(key) === abortController) { fetchControllers.delete(key); } if (fetchRequest.signal.aborted) { return; } if (deletedFetchers.has(key)) { updateFetcherState(key, getDoneFetcher(undefined)); return; } // If the loader threw a redirect Response, start a new REPLACE navigation if (isRedirectResult(result)) { if (pendingNavigationLoadId > originatingLoadId) { // A new navigation was kicked off after our loader started, so that // should take precedence over this redirect navigation updateFetcherState(key, getDoneFetcher(undefined)); return; } else { fetchRedirectIds.add(key); await startRedirectNavigation(state, result); return; } } // Process any non-redirect errors thrown if (isErrorResult(result)) { setFetcherError(key, routeId, result.error); return; } router_invariant(!isDeferredResult(result), "Unhandled fetcher deferred data"); // Put the fetcher back into an idle state updateFetcherState(key, getDoneFetcher(result.data)); } /** * Utility function to handle redirects returned from an action or loader. * Normally, a redirect "replaces" the navigation that triggered it. So, for * example: * * - user is on /a * - user clicks a link to /b * - loader for /b redirects to /c * * In a non-JS app the browser would track the in-flight navigation to /b and * then replace it with /c when it encountered the redirect response. In * the end it would only ever update the URL bar with /c. * * In client-side routing using pushState/replaceState, we aim to emulate * this behavior and we also do not update history until the end of the * navigation (including processed redirects). This means that we never * actually touch history until we've processed redirects, so we just use * the history action from the original navigation (PUSH or REPLACE). */ async function startRedirectNavigation(state, redirect, _temp2) { let { submission, fetcherSubmission, replace } = _temp2 === void 0 ? {} : _temp2; if (redirect.revalidate) { isRevalidationRequired = true; } let redirectLocation = createLocation(state.location, redirect.location, { _isRedirect: true }); router_invariant(redirectLocation, "Expected a location on the redirect navigation"); if (isBrowser) { let isDocumentReload = false; if (redirect.reloadDocument) { // Hard reload if the response contained X-Remix-Reload-Document isDocumentReload = true; } else if (ABSOLUTE_URL_REGEX.test(redirect.location)) { const url = init.history.createURL(redirect.location); isDocumentReload = // Hard reload if it's an absolute URL to a new origin url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename router_stripBasename(url.pathname, basename) == null; } if (isDocumentReload) { if (replace) { routerWindow.location.replace(redirect.location); } else { routerWindow.location.assign(redirect.location); } return; } } // There's no need to abort on redirects, since we don't detect the // redirect until the action/loaders have settled pendingNavigationController = null; let redirectHistoryAction = replace === true ? Action.Replace : Action.Push; // Use the incoming submission if provided, fallback on the active one in // state.navigation let { formMethod, formAction, formEncType } = state.navigation; if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) { submission = getSubmissionFromNavigation(state.navigation); } // If this was a 307/308 submission we want to preserve the HTTP method and // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the // redirected location let activeSubmission = submission || fetcherSubmission; if (redirectPreserveMethodStatusCodes.has(redirect.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) { await startNavigation(redirectHistoryAction, redirectLocation, { submission: router_extends({}, activeSubmission, { formAction: redirect.location }), // Preserve this flag across redirects preventScrollReset: pendingPreventScrollReset }); } else { // If we have a navigation submission, we will preserve it through the // redirect navigation let overrideNavigation = getLoadingNavigation(redirectLocation, submission); await startNavigation(redirectHistoryAction, redirectLocation, { overrideNavigation, // Send fetcher submissions through for shouldRevalidate fetcherSubmission, // Preserve this flag across redirects preventScrollReset: pendingPreventScrollReset }); } } async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) { // Call all navigation loaders and revalidating fetcher loaders in parallel, // then slice off the results into separate arrays so we can handle them // accordingly let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename)), ...fetchersToLoad.map(f => { if (f.matches && f.match && f.controller) { return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties, basename); } else { let error = { type: ResultType.error, error: getInternalRouterError(404, { pathname: f.path }) }; return error; } })]); let loaderResults = results.slice(0, matchesToLoad.length); let fetcherResults = results.slice(matchesToLoad.length); await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, loaderResults.map(() => request.signal), false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map(f => f.match), fetcherResults, fetchersToLoad.map(f => f.controller ? f.controller.signal : null), true)]); return { results, loaderResults, fetcherResults }; } function interruptActiveLoads() { // Every interruption triggers a revalidation isRevalidationRequired = true; // Cancel pending route-level deferreds and mark cancelled routes for // revalidation cancelledDeferredRoutes.push(...cancelActiveDeferreds()); // Abort in-flight fetcher loads fetchLoadMatches.forEach((_, key) => { if (fetchControllers.has(key)) { cancelledFetcherLoads.push(key); abortFetcher(key); } }); } function updateFetcherState(key, fetcher, opts) { if (opts === void 0) { opts = {}; } state.fetchers.set(key, fetcher); updateState({ fetchers: new Map(state.fetchers) }, { flushSync: (opts && opts.flushSync) === true }); } function setFetcherError(key, routeId, error, opts) { if (opts === void 0) { opts = {}; } let boundaryMatch = findNearestBoundary(state.matches, routeId); deleteFetcher(key); updateState({ errors: { [boundaryMatch.route.id]: error }, fetchers: new Map(state.fetchers) }, { flushSync: (opts && opts.flushSync) === true }); } function getFetcher(key) { if (future.v7_fetcherPersist) { activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1); // If this fetcher was previously marked for deletion, unmark it since we // have a new instance if (deletedFetchers.has(key)) { deletedFetchers.delete(key); } } return state.fetchers.get(key) || router_IDLE_FETCHER; } function deleteFetcher(key) { let fetcher = state.fetchers.get(key); // Don't abort the controller if this is a deletion of a fetcher.submit() // in it's loading phase since - we don't want to abort the corresponding // revalidation and want them to complete and land if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) { abortFetcher(key); } fetchLoadMatches.delete(key); fetchReloadIds.delete(key); fetchRedirectIds.delete(key); deletedFetchers.delete(key); state.fetchers.delete(key); } function deleteFetcherAndUpdateState(key) { if (future.v7_fetcherPersist) { let count = (activeFetchers.get(key) || 0) - 1; if (count <= 0) { activeFetchers.delete(key); deletedFetchers.add(key); } else { activeFetchers.set(key, count); } } else { deleteFetcher(key); } updateState({ fetchers: new Map(state.fetchers) }); } function abortFetcher(key) { let controller = fetchControllers.get(key); router_invariant(controller, "Expected fetch controller: " + key); controller.abort(); fetchControllers.delete(key); } function markFetchersDone(keys) { for (let key of keys) { let fetcher = getFetcher(key); let doneFetcher = getDoneFetcher(fetcher.data); state.fetchers.set(key, doneFetcher); } } function markFetchRedirectsDone() { let doneKeys = []; let updatedFetchers = false; for (let key of fetchRedirectIds) { let fetcher = state.fetchers.get(key); router_invariant(fetcher, "Expected fetcher: " + key); if (fetcher.state === "loading") { fetchRedirectIds.delete(key); doneKeys.push(key); updatedFetchers = true; } } markFetchersDone(doneKeys); return updatedFetchers; } function abortStaleFetchLoads(landedId) { let yeetedKeys = []; for (let [key, id] of fetchReloadIds) { if (id < landedId) { let fetcher = state.fetchers.get(key); router_invariant(fetcher, "Expected fetcher: " + key); if (fetcher.state === "loading") { abortFetcher(key); fetchReloadIds.delete(key); yeetedKeys.push(key); } } } markFetchersDone(yeetedKeys); return yeetedKeys.length > 0; } function getBlocker(key, fn) { let blocker = state.blockers.get(key) || router_IDLE_BLOCKER; if (blockerFunctions.get(key) !== fn) { blockerFunctions.set(key, fn); } return blocker; } function deleteBlocker(key) { state.blockers.delete(key); blockerFunctions.delete(key); } // Utility function to update blockers, ensuring valid state transitions function updateBlocker(key, newBlocker) { let blocker = state.blockers.get(key) || router_IDLE_BLOCKER; // Poor mans state machine :) // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM router_invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state); let blockers = new Map(state.blockers); blockers.set(key, newBlocker); updateState({ blockers }); } function shouldBlockNavigation(_ref2) { let { currentLocation, nextLocation, historyAction } = _ref2; if (blockerFunctions.size === 0) { return; } // We ony support a single active blocker at the moment since we don't have // any compelling use cases for multi-blocker yet if (blockerFunctions.size > 1) { router_warning(false, "A router only supports one blocker at a time"); } let entries = Array.from(blockerFunctions.entries()); let [blockerKey, blockerFunction] = entries[entries.length - 1]; let blocker = state.blockers.get(blockerKey); if (blocker && blocker.state === "proceeding") { // If the blocker is currently proceeding, we don't need to re-check // it and can let this navigation continue return; } // At this point, we know we're unblocked/blocked so we need to check the // user-provided blocker function if (blockerFunction({ currentLocation, nextLocation, historyAction })) { return blockerKey; } } function cancelActiveDeferreds(predicate) { let cancelledRouteIds = []; activeDeferreds.forEach((dfd, routeId) => { if (!predicate || predicate(routeId)) { // Cancel the deferred - but do not remove from activeDeferreds here - // we rely on the subscribers to do that so our tests can assert proper // cleanup via _internalActiveDeferreds dfd.cancel(); cancelledRouteIds.push(routeId); activeDeferreds.delete(routeId); } }); return cancelledRouteIds; } // Opt in to capturing and reporting scroll positions during navigations, // used by the <ScrollRestoration> component function enableScrollRestoration(positions, getPosition, getKey) { savedScrollPositions = positions; getScrollPosition = getPosition; getScrollRestorationKey = getKey || null; // Perform initial hydration scroll restoration, since we miss the boat on // the initial updateState() because we've not yet rendered <ScrollRestoration/> // and therefore have no savedScrollPositions available if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { initialScrollRestored = true; let y = getSavedScrollPosition(state.location, state.matches); if (y != null) { updateState({ restoreScrollPosition: y }); } } return () => { savedScrollPositions = null; getScrollPosition = null; getScrollRestorationKey = null; }; } function getScrollKey(location, matches) { if (getScrollRestorationKey) { let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData))); return key || location.key; } return location.key; } function saveScrollPosition(location, matches) { if (savedScrollPositions && getScrollPosition) { let key = getScrollKey(location, matches); savedScrollPositions[key] = getScrollPosition(); } } function getSavedScrollPosition(location, matches) { if (savedScrollPositions) { let key = getScrollKey(location, matches); let y = savedScrollPositions[key]; if (typeof y === "number") { return y; } } return null; } function _internalSetRoutes(newRoutes) { manifest = {}; inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest); } router = { get basename() { return basename; }, get state() { return state; }, get routes() { return dataRoutes; }, get window() { return routerWindow; }, initialize, subscribe, enableScrollRestoration, navigate, fetch, revalidate, // Passthrough to history-aware createHref used by useHref so we get proper // hash-aware URLs in DOM paths createHref: to => init.history.createHref(to), encodeLocation: to => init.history.encodeLocation(to), getFetcher, deleteFetcher: deleteFetcherAndUpdateState, dispose, getBlocker, deleteBlocker, _internalFetchControllers: fetchControllers, _internalActiveDeferreds: activeDeferreds, // TODO: Remove setRoutes, it's temporary to avoid dealing with // updating the tree while validating the update algorithm. _internalSetRoutes }; return router; } //#endregion //////////////////////////////////////////////////////////////////////////////// //#region createStaticHandler //////////////////////////////////////////////////////////////////////////////// const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred"); function createStaticHandler(routes, opts) { router_invariant(routes.length > 0, "You must provide a non-empty routes array to createStaticHandler"); let manifest = {}; let basename = (opts ? opts.basename : null) || "/"; let mapRouteProperties; if (opts != null && opts.mapRouteProperties) { mapRouteProperties = opts.mapRouteProperties; } else if (opts != null && opts.detectErrorBoundary) { // If they are still using the deprecated version, wrap it with the new API let detectErrorBoundary = opts.detectErrorBoundary; mapRouteProperties = route => ({ hasErrorBoundary: detectErrorBoundary(route) }); } else { mapRouteProperties = defaultMapRouteProperties; } let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest); /** * The query() method is intended for document requests, in which we want to * call an optional action and potentially multiple loaders for all nested * routes. It returns a StaticHandlerContext object, which is very similar * to the router state (location, loaderData, actionData, errors, etc.) and * also adds SSR-specific information such as the statusCode and headers * from action/loaders Responses. * * It _should_ never throw and should report all errors through the * returned context.errors object, properly associating errors to their error * boundary. Additionally, it tracks _deepestRenderedBoundaryId which can be * used to emulate React error boundaries during SSr by performing a second * pass only down to the boundaryId. * * The one exception where we do not return a StaticHandlerContext is when a * redirect response is returned or thrown from any action/loader. We * propagate that out and return the raw Response so the HTTP server can * return it directly. */ async function query(request, _temp3) { let { requestContext } = _temp3 === void 0 ? {} : _temp3; let url = new URL(request.url); let method = request.method; let location = createLocation("", router_createPath(url), null, "default"); let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't if (!isValidMethod(method) && method !== "HEAD") { let error = getInternalRouterError(405, { method }); let { matches: methodNotAllowedMatches, route } = getShortCircuitMatches(dataRoutes); return { basename, location, matches: methodNotAllowedMatches, loaderData: {}, actionData: null, errors: { [route.id]: error }, statusCode: error.status, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } else if (!matches) { let error = getInternalRouterError(404, { pathname: location.pathname }); let { matches: notFoundMatches, route } = getShortCircuitMatches(dataRoutes); return { basename, location, matches: notFoundMatches, loaderData: {}, actionData: null, errors: { [route.id]: error }, statusCode: error.status, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } let result = await queryImpl(request, location, matches, requestContext); if (isResponse(result)) { return result; } // When returning StaticHandlerContext, we patch back in the location here // since we need it for React Context. But this helps keep our submit and // loadRouteData operating on a Request instead of a Location return router_extends({ location, basename }, result); } /** * The queryRoute() method is intended for targeted route requests, either * for fetch ?_data requests or resource route requests. In this case, we * are only ever calling a single action or loader, and we are returning the * returned value directly. In most cases, this will be a Response returned * from the action/loader, but it may be a primitive or other value as well - * and in such cases the calling context should handle that accordingly. * * We do respect the throw/return differentiation, so if an action/loader * throws, then this method will throw the value. This is important so we * can do proper boundary identification in Remix where a thrown Response * must go to the Catch Boundary but a returned Response is happy-path. * * One thing to note is that any Router-initiated Errors that make sense * to associate with a status code will be thrown as an ErrorResponse * instance which include the raw Error, such that the calling context can * serialize the error as they see fit while including the proper response * code. Examples here are 404 and 405 errors that occur prior to reaching * any user-defined loaders. */ async function queryRoute(request, _temp4) { let { routeId, requestContext } = _temp4 === void 0 ? {} : _temp4; let url = new URL(request.url); let method = request.method; let location = createLocation("", router_createPath(url), null, "default"); let matches = matchRoutes(dataRoutes, location, basename); // SSR supports HEAD requests while SPA doesn't if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") { throw getInternalRouterError(405, { method }); } else if (!matches) { throw getInternalRouterError(404, { pathname: location.pathname }); } let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location); if (routeId && !match) { throw getInternalRouterError(403, { pathname: location.pathname, routeId }); } else if (!match) { // This should never hit I don't think? throw getInternalRouterError(404, { pathname: location.pathname }); } let result = await queryImpl(request, location, matches, requestContext, match); if (isResponse(result)) { return result; } let error = result.errors ? Object.values(result.errors)[0] : undefined; if (error !== undefined) { // If we got back result.errors, that means the loader/action threw // _something_ that wasn't a Response, but it's not guaranteed/required // to be an `instanceof Error` either, so we have to use throw here to // preserve the "error" state outside of queryImpl. throw error; } // Pick off the right state value to return if (result.actionData) { return Object.values(result.actionData)[0]; } if (result.loaderData) { var _result$activeDeferre; let data = Object.values(result.loaderData)[0]; if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) { data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id]; } return data; } return undefined; } async function queryImpl(request, location, matches, requestContext, routeMatch) { router_invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal"); try { if (isMutationMethod(request.method.toLowerCase())) { let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, routeMatch != null); return result; } let result = await loadRouteData(request, matches, requestContext, routeMatch); return isResponse(result) ? result : router_extends({}, result, { actionData: null, actionHeaders: {} }); } catch (e) { // If the user threw/returned a Response in callLoaderOrAction, we throw // it to bail out and then return or throw here based on whether the user // returned or threw if (isQueryRouteResponse(e)) { if (e.type === ResultType.error) { throw e.response; } return e.response; } // Redirects are always returned since they don't propagate to catch // boundaries if (isRedirectResponse(e)) { return e; } throw e; } } async function submit(request, matches, actionMatch, requestContext, isRouteRequest) { let result; if (!actionMatch.route.action && !actionMatch.route.lazy) { let error = getInternalRouterError(405, { method: request.method, pathname: new URL(request.url).pathname, routeId: actionMatch.route.id }); if (isRouteRequest) { throw error; } result = { type: ResultType.error, error }; } else { result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties, basename, { isStaticRequest: true, isRouteRequest, requestContext }); if (request.signal.aborted) { let method = isRouteRequest ? "queryRoute" : "query"; throw new Error(method + "() call aborted: " + request.method + " " + request.url); } } if (isRedirectResult(result)) { // Uhhhh - this should never happen, we should always throw these from // callLoaderOrAction, but the type narrowing here keeps TS happy and we // can get back on the "throw all redirect responses" train here should // this ever happen :/ throw new Response(null, { status: result.status, headers: { Location: result.location } }); } if (isDeferredResult(result)) { let error = getInternalRouterError(400, { type: "defer-action" }); if (isRouteRequest) { throw error; } result = { type: ResultType.error, error }; } if (isRouteRequest) { // Note: This should only be non-Response values if we get here, since // isRouteRequest should throw any Response received in callLoaderOrAction if (isErrorResult(result)) { throw result.error; } return { matches: [actionMatch], loaderData: {}, actionData: { [actionMatch.route.id]: result.data }, errors: null, // Note: statusCode + headers are unused here since queryRoute will // return the raw Response or value statusCode: 200, loaderHeaders: {}, actionHeaders: {}, activeDeferreds: null }; } if (isErrorResult(result)) { // Store off the pending error - we use it to determine which loaders // to call and will commit it when we complete the navigation let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); let context = await loadRouteData(request, matches, requestContext, undefined, { [boundaryMatch.route.id]: result.error }); // action status codes take precedence over loader status codes return router_extends({}, context, { statusCode: isRouteErrorResponse(result.error) ? result.error.status : 500, actionData: null, actionHeaders: router_extends({}, result.headers ? { [actionMatch.route.id]: result.headers } : {}) }); } // Create a GET request for the loaders let loaderRequest = new Request(request.url, { headers: request.headers, redirect: request.redirect, signal: request.signal }); let context = await loadRouteData(loaderRequest, matches, requestContext); return router_extends({}, context, result.statusCode ? { statusCode: result.statusCode } : {}, { actionData: { [actionMatch.route.id]: result.data }, actionHeaders: router_extends({}, result.headers ? { [actionMatch.route.id]: result.headers } : {}) }); } async function loadRouteData(request, matches, requestContext, routeMatch, pendingActionError) { let isRouteRequest = routeMatch != null; // Short circuit if we have no loaders to run (queryRoute()) if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) { throw getInternalRouterError(400, { method: request.method, pathname: new URL(request.url).pathname, routeId: routeMatch == null ? void 0 : routeMatch.route.id }); } let requestMatches = routeMatch ? [routeMatch] : getLoaderMatchesUntilBoundary(matches, Object.keys(pendingActionError || {})[0]); let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy); // Short circuit if we have no loaders to run (query()) if (matchesToLoad.length === 0) { return { matches, // Add a null for all matched routes for proper revalidation on the client loaderData: matches.reduce((acc, m) => Object.assign(acc, { [m.route.id]: null }), {}), errors: pendingActionError || null, statusCode: 200, loaderHeaders: {}, activeDeferreds: null }; } let results = await Promise.all([...matchesToLoad.map(match => callLoaderOrAction("loader", request, match, matches, manifest, mapRouteProperties, basename, { isStaticRequest: true, isRouteRequest, requestContext }))]); if (request.signal.aborted) { let method = isRouteRequest ? "queryRoute" : "query"; throw new Error(method + "() call aborted: " + request.method + " " + request.url); } // Process and commit output from loaders let activeDeferreds = new Map(); let context = processRouteLoaderData(matches, matchesToLoad, results, pendingActionError, activeDeferreds); // Add a null for any non-loader matches for proper revalidation on the client let executedLoaders = new Set(matchesToLoad.map(match => match.route.id)); matches.forEach(match => { if (!executedLoaders.has(match.route.id)) { context.loaderData[match.route.id] = null; } }); return router_extends({}, context, { matches, activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null }); } return { dataRoutes, query, queryRoute }; } //#endregion //////////////////////////////////////////////////////////////////////////////// //#region Helpers //////////////////////////////////////////////////////////////////////////////// /** * Given an existing StaticHandlerContext and an error thrown at render time, * provide an updated StaticHandlerContext suitable for a second SSR render */ function getStaticContextFromError(routes, context, error) { let newContext = router_extends({}, context, { statusCode: 500, errors: { [context._deepestRenderedBoundaryId || routes[0].id]: error } }); return newContext; } function isSubmissionNavigation(opts) { return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== undefined); } function normalizeTo(location, matches, basename, prependBasename, to, fromRouteId, relative) { let contextualMatches; let activeRouteMatch; if (fromRouteId) { // Grab matches up to the calling route so our route-relative logic is // relative to the correct source route contextualMatches = []; for (let match of matches) { contextualMatches.push(match); if (match.route.id === fromRouteId) { activeRouteMatch = match; break; } } } else { contextualMatches = matches; activeRouteMatch = matches[matches.length - 1]; } // Resolve the relative path let path = router_resolveTo(to ? to : ".", getPathContributingMatches(contextualMatches).map(m => m.pathnameBase), router_stripBasename(location.pathname, basename) || location.pathname, relative === "path"); // When `to` is not specified we inherit search/hash from the current // location, unlike when to="." and we just inherit the path. // See https://github.com/remix-run/remix/issues/927 if (to == null) { path.search = location.search; path.hash = location.hash; } // Add an ?index param for matched index routes if we don't already have one if ((to == null || to === "" || to === ".") && activeRouteMatch && activeRouteMatch.route.index && !hasNakedIndexQuery(path.search)) { path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; } // If we're operating within a basename, prepend it to the pathname. If // this is a root navigation, then just use the raw basename which allows // the basename to have full control over the presence of a trailing slash // on root actions if (prependBasename && basename !== "/") { path.pathname = path.pathname === "/" ? basename : router_joinPaths([basename, path.pathname]); } return router_createPath(path); } // Normalize navigation options by converting formMethod=GET formData objects to // URLSearchParams so they behave identically to links with query params function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) { // Return location verbatim on non-submission navigations if (!opts || !isSubmissionNavigation(opts)) { return { path }; } if (opts.formMethod && !isValidMethod(opts.formMethod)) { return { path, error: getInternalRouterError(405, { method: opts.formMethod }) }; } let getInvalidBodyError = () => ({ path, error: getInternalRouterError(400, { type: "invalid-body" }) }); // Create a Submission on non-GET navigations let rawFormMethod = opts.formMethod || "get"; let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase(); let formAction = stripHashFromPath(path); if (opts.body !== undefined) { if (opts.formEncType === "text/plain") { // text only support POST/PUT/PATCH/DELETE submissions if (!isMutationMethod(formMethod)) { return getInvalidBodyError(); } let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data Array.from(opts.body.entries()).reduce((acc, _ref3) => { let [name, value] = _ref3; return "" + acc + name + "=" + value + "\n"; }, "") : String(opts.body); return { path, submission: { formMethod, formAction, formEncType: opts.formEncType, formData: undefined, json: undefined, text } }; } else if (opts.formEncType === "application/json") { // json only supports POST/PUT/PATCH/DELETE submissions if (!isMutationMethod(formMethod)) { return getInvalidBodyError(); } try { let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body; return { path, submission: { formMethod, formAction, formEncType: opts.formEncType, formData: undefined, json, text: undefined } }; } catch (e) { return getInvalidBodyError(); } } } router_invariant(typeof FormData === "function", "FormData is not available in this environment"); let searchParams; let formData; if (opts.formData) { searchParams = convertFormDataToSearchParams(opts.formData); formData = opts.formData; } else if (opts.body instanceof FormData) { searchParams = convertFormDataToSearchParams(opts.body); formData = opts.body; } else if (opts.body instanceof URLSearchParams) { searchParams = opts.body; formData = convertSearchParamsToFormData(searchParams); } else if (opts.body == null) { searchParams = new URLSearchParams(); formData = new FormData(); } else { try { searchParams = new URLSearchParams(opts.body); formData = convertSearchParamsToFormData(searchParams); } catch (e) { return getInvalidBodyError(); } } let submission = { formMethod, formAction, formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", formData, json: undefined, text: undefined }; if (isMutationMethod(submission.formMethod)) { return { path, submission }; } // Flatten submission onto URLSearchParams for GET submissions let parsedPath = parsePath(path); // On GET navigation submissions we can drop the ?index param from the // resulting location since all loaders will run. But fetcher GET submissions // only run a single loader so we need to preserve any incoming ?index params if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { searchParams.append("index", ""); } parsedPath.search = "?" + searchParams; return { path: router_createPath(parsedPath), submission }; } // Filter out all routes below any caught error as they aren't going to // render so we don't need to load them function getLoaderMatchesUntilBoundary(matches, boundaryId) { let boundaryMatches = matches; if (boundaryId) { let index = matches.findIndex(m => m.route.id === boundaryId); if (index >= 0) { boundaryMatches = matches.slice(0, index); } } return boundaryMatches; } function getMatchesToLoad(history, state, matches, submission, location, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError) { let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : undefined; let currentUrl = history.createURL(state.location); let nextUrl = history.createURL(location); // Pick navigation matches that are net-new or qualify for revalidation let boundaryId = pendingError ? Object.keys(pendingError)[0] : undefined; let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId); let navigationMatches = boundaryMatches.filter((match, index) => { if (match.route.lazy) { // We haven't loaded this route yet so we don't know if it's got a loader! return true; } if (match.route.loader == null) { return false; } // Always call the loader on new route instances and pending defer cancellations if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) { return true; } // This is the default implementation for when we revalidate. If the route // provides it's own implementation, then we give them full control but // provide this value so they can leverage it if needed after they check // their own specific use cases let currentRouteMatch = state.matches[index]; let nextRouteMatch = match; return shouldRevalidateLoader(match, router_extends({ currentUrl, currentParams: currentRouteMatch.params, nextUrl, nextParams: nextRouteMatch.params }, submission, { actionResult, defaultShouldRevalidate: // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate isRevalidationRequired || // Clicked the same link, resubmitted a GET form currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || // Search params affect all loaders currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch) })); }); // Pick fetcher.loads that need to be revalidated let revalidatingFetchers = []; fetchLoadMatches.forEach((f, key) => { // Don't revalidate if fetcher won't be present in the subsequent render if (!matches.some(m => m.route.id === f.routeId)) { return; } let fetcherMatches = matchRoutes(routesToUse, f.path, basename); // If the fetcher path no longer matches, push it in with null matches so // we can trigger a 404 in callLoadersAndMaybeResolveData. Note this is // currently only a use-case for Remix HMR where the route tree can change // at runtime and remove a route previously loaded via a fetcher if (!fetcherMatches) { revalidatingFetchers.push({ key, routeId: f.routeId, path: f.path, matches: null, match: null, controller: null }); return; } // Revalidating fetchers are decoupled from the route matches since they // load from a static href. They revalidate based on explicit revalidation // (submission, useRevalidator, or X-Remix-Revalidate) let fetcher = state.fetchers.get(key); let fetcherMatch = getTargetMatch(fetcherMatches, f.path); let shouldRevalidate = false; if (fetchRedirectIds.has(key)) { // Never trigger a revalidation of an actively redirecting fetcher shouldRevalidate = false; } else if (cancelledFetcherLoads.includes(key)) { // Always revalidate if the fetcher was cancelled shouldRevalidate = true; } else if (fetcher && fetcher.state !== "idle" && fetcher.data === undefined) { // If the fetcher hasn't ever completed loading yet, then this isn't a // revalidation, it would just be a brand new load if an explicit // revalidation is required shouldRevalidate = isRevalidationRequired; } else { // Otherwise fall back on any user-defined shouldRevalidate, defaulting // to explicit revalidations only shouldRevalidate = shouldRevalidateLoader(fetcherMatch, router_extends({ currentUrl, currentParams: state.matches[state.matches.length - 1].params, nextUrl, nextParams: matches[matches.length - 1].params }, submission, { actionResult, defaultShouldRevalidate: isRevalidationRequired })); } if (shouldRevalidate) { revalidatingFetchers.push({ key, routeId: f.routeId, path: f.path, matches: fetcherMatches, match: fetcherMatch, controller: new AbortController() }); } }); return [navigationMatches, revalidatingFetchers]; } function isNewLoader(currentLoaderData, currentMatch, match) { let isNew = // [a] -> [a, b] !currentMatch || // [a, b] -> [a, c] match.route.id !== currentMatch.route.id; // Handle the case that we don't have data for a re-used route, potentially // from a prior error or from a cancelled pending deferred let isMissingData = currentLoaderData[match.route.id] === undefined; // Always load if this is a net-new route or we don't yet have data return isNew || isMissingData; } function isNewRouteInstance(currentMatch, match) { let currentPath = currentMatch.route.path; return ( // param change for this match, /users/123 -> /users/456 currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path // e.g. /files/images/avatar.jpg -> files/finances.xls currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] ); } function shouldRevalidateLoader(loaderMatch, arg) { if (loaderMatch.route.shouldRevalidate) { let routeChoice = loaderMatch.route.shouldRevalidate(arg); if (typeof routeChoice === "boolean") { return routeChoice; } } return arg.defaultShouldRevalidate; } /** * Execute route.lazy() methods to lazily load route modules (loader, action, * shouldRevalidate) and update the routeManifest in place which shares objects * with dataRoutes so those get updated as well. */ async function loadLazyRouteModule(route, mapRouteProperties, manifest) { if (!route.lazy) { return; } let lazyRoute = await route.lazy(); // If the lazy route function was executed and removed by another parallel // call then we can return - first lazy() to finish wins because the return // value of lazy is expected to be static if (!route.lazy) { return; } let routeToUpdate = manifest[route.id]; router_invariant(routeToUpdate, "No route found in manifest"); // Update the route in place. This should be safe because there's no way // we could yet be sitting on this route as we can't get there without // resolving lazy() first. // // This is different than the HMR "update" use-case where we may actively be // on the route being updated. The main concern boils down to "does this // mutation affect any ongoing navigations or any current state.matches // values?". If not, it should be safe to update in place. let routeUpdates = {}; for (let lazyRouteProperty in lazyRoute) { let staticRouteValue = routeToUpdate[lazyRouteProperty]; let isPropertyStaticallyDefined = staticRouteValue !== undefined && // This property isn't static since it should always be updated based // on the route updates lazyRouteProperty !== "hasErrorBoundary"; router_warning(!isPropertyStaticallyDefined, "Route \"" + routeToUpdate.id + "\" has a static property \"" + lazyRouteProperty + "\" " + "defined but its lazy function is also returning a value for this property. " + ("The lazy route property \"" + lazyRouteProperty + "\" will be ignored.")); if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) { routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty]; } } // Mutate the route with the provided updates. Do this first so we pass // the updated version to mapRouteProperties Object.assign(routeToUpdate, routeUpdates); // Mutate the `hasErrorBoundary` property on the route based on the route // updates and remove the `lazy` function so we don't resolve the lazy // route again. Object.assign(routeToUpdate, router_extends({}, mapRouteProperties(routeToUpdate), { lazy: undefined })); } async function callLoaderOrAction(type, request, match, matches, manifest, mapRouteProperties, basename, opts) { if (opts === void 0) { opts = {}; } let resultType; let result; let onReject; let runHandler = handler => { // Setup a promise we can race against so that abort signals short circuit let reject; let abortPromise = new Promise((_, r) => reject = r); onReject = () => reject(); request.signal.addEventListener("abort", onReject); return Promise.race([handler({ request, params: match.params, context: opts.requestContext }), abortPromise]); }; try { let handler = match.route[type]; if (match.route.lazy) { if (handler) { // Run statically defined handler in parallel with lazy() let handlerError; let values = await Promise.all([ // If the handler throws, don't let it immediately bubble out, // since we need to let the lazy() execution finish so we know if this // route has a boundary that can handle the error runHandler(handler).catch(e => { handlerError = e; }), loadLazyRouteModule(match.route, mapRouteProperties, manifest)]); if (handlerError) { throw handlerError; } result = values[0]; } else { // Load lazy route module, then run any returned handler await loadLazyRouteModule(match.route, mapRouteProperties, manifest); handler = match.route[type]; if (handler) { // Handler still run even if we got interrupted to maintain consistency // with un-abortable behavior of handler execution on non-lazy or // previously-lazy-loaded routes result = await runHandler(handler); } else if (type === "action") { let url = new URL(request.url); let pathname = url.pathname + url.search; throw getInternalRouterError(405, { method: request.method, pathname, routeId: match.route.id }); } else { // lazy() route has no loader to run. Short circuit here so we don't // hit the invariant below that errors on returning undefined. return { type: ResultType.data, data: undefined }; } } } else if (!handler) { let url = new URL(request.url); let pathname = url.pathname + url.search; throw getInternalRouterError(404, { pathname }); } else { result = await runHandler(handler); } router_invariant(result !== undefined, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ("\"" + match.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`."); } catch (e) { resultType = ResultType.error; result = e; } finally { if (onReject) { request.signal.removeEventListener("abort", onReject); } } if (isResponse(result)) { let status = result.status; // Process redirects if (redirectStatusCodes.has(status)) { let location = result.headers.get("Location"); router_invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header"); // Support relative routing in internal redirects if (!ABSOLUTE_URL_REGEX.test(location)) { location = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match) + 1), basename, true, location); } else if (!opts.isStaticRequest) { // Strip off the protocol+origin for same-origin + same-basename absolute // redirects. If this is a static request, we can let it go back to the // browser as-is let currentUrl = new URL(request.url); let url = location.startsWith("//") ? new URL(currentUrl.protocol + location) : new URL(location); let isSameBasename = router_stripBasename(url.pathname, basename) != null; if (url.origin === currentUrl.origin && isSameBasename) { location = url.pathname + url.search + url.hash; } } // Don't process redirects in the router during static requests requests. // Instead, throw the Response and let the server handle it with an HTTP // redirect. We also update the Location header in place in this flow so // basename and relative routing is taken into account if (opts.isStaticRequest) { result.headers.set("Location", location); throw result; } return { type: ResultType.redirect, status, location, revalidate: result.headers.get("X-Remix-Revalidate") !== null, reloadDocument: result.headers.get("X-Remix-Reload-Document") !== null }; } // For SSR single-route requests, we want to hand Responses back directly // without unwrapping. We do this with the QueryRouteResponse wrapper // interface so we can know whether it was returned or thrown if (opts.isRouteRequest) { let queryRouteResponse = { type: resultType === ResultType.error ? ResultType.error : ResultType.data, response: result }; throw queryRouteResponse; } let data; let contentType = result.headers.get("Content-Type"); // Check between word boundaries instead of startsWith() due to the last // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type if (contentType && /\bapplication\/json\b/.test(contentType)) { data = await result.json(); } else { data = await result.text(); } if (resultType === ResultType.error) { return { type: resultType, error: new ErrorResponseImpl(status, result.statusText, data), headers: result.headers }; } return { type: ResultType.data, data, statusCode: result.status, headers: result.headers }; } if (resultType === ResultType.error) { return { type: resultType, error: result }; } if (isDeferredData(result)) { var _result$init, _result$init2; return { type: ResultType.deferred, deferredData: result, statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status, headers: ((_result$init2 = result.init) == null ? void 0 : _result$init2.headers) && new Headers(result.init.headers) }; } return { type: ResultType.data, data: result }; } // Utility method for creating the Request instances for loaders/actions during // client-side navigations and fetches. During SSR we will always have a // Request instance from the static handler (query/queryRoute) function createClientSideRequest(history, location, signal, submission) { let url = history.createURL(stripHashFromPath(location)).toString(); let init = { signal }; if (submission && isMutationMethod(submission.formMethod)) { let { formMethod, formEncType } = submission; // Didn't think we needed this but it turns out unlike other methods, patch // won't be properly normalized to uppercase and results in a 405 error. // See: https://fetch.spec.whatwg.org/#concept-method init.method = formMethod.toUpperCase(); if (formEncType === "application/json") { init.headers = new Headers({ "Content-Type": formEncType }); init.body = JSON.stringify(submission.json); } else if (formEncType === "text/plain") { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = submission.text; } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = convertFormDataToSearchParams(submission.formData); } else { // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request) init.body = submission.formData; } } return new Request(url, init); } function convertFormDataToSearchParams(formData) { let searchParams = new URLSearchParams(); for (let [key, value] of formData.entries()) { // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs searchParams.append(key, typeof value === "string" ? value : value.name); } return searchParams; } function convertSearchParamsToFormData(searchParams) { let formData = new FormData(); for (let [key, value] of searchParams.entries()) { formData.append(key, value); } return formData; } function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) { // Fill in loaderData/errors from our loaders let loaderData = {}; let errors = null; let statusCode; let foundError = false; let loaderHeaders = {}; // Process loader results into state.loaderData/state.errors results.forEach((result, index) => { let id = matchesToLoad[index].route.id; router_invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData"); if (isErrorResult(result)) { // Look upwards from the matched route for the closest ancestor // error boundary, defaulting to the root match let boundaryMatch = findNearestBoundary(matches, id); let error = result.error; // If we have a pending action error, we report it at the highest-route // that throws a loader error, and then clear it out to indicate that // it was consumed if (pendingError) { error = Object.values(pendingError)[0]; pendingError = undefined; } errors = errors || {}; // Prefer higher error values if lower errors bubble to the same boundary if (errors[boundaryMatch.route.id] == null) { errors[boundaryMatch.route.id] = error; } // Clear our any prior loaderData for the throwing route loaderData[id] = undefined; // Once we find our first (highest) error, we set the status code and // prevent deeper status codes from overriding if (!foundError) { foundError = true; statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; } if (result.headers) { loaderHeaders[id] = result.headers; } } else { if (isDeferredResult(result)) { activeDeferreds.set(id, result.deferredData); loaderData[id] = result.deferredData.data; } else { loaderData[id] = result.data; } // Error status codes always override success status codes, but if all // loaders are successful we take the deepest status code. if (result.statusCode != null && result.statusCode !== 200 && !foundError) { statusCode = result.statusCode; } if (result.headers) { loaderHeaders[id] = result.headers; } } }); // If we didn't consume the pending action error (i.e., all loaders // resolved), then consume it here. Also clear out any loaderData for the // throwing route if (pendingError) { errors = pendingError; loaderData[Object.keys(pendingError)[0]] = undefined; } return { loaderData, errors, statusCode: statusCode || 200, loaderHeaders }; } function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) { let { loaderData, errors } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds); // Process results from our revalidating fetchers for (let index = 0; index < revalidatingFetchers.length; index++) { let { key, match, controller } = revalidatingFetchers[index]; router_invariant(fetcherResults !== undefined && fetcherResults[index] !== undefined, "Did not find corresponding fetcher result"); let result = fetcherResults[index]; // Process fetcher non-redirect errors if (controller && controller.signal.aborted) { // Nothing to do for aborted fetchers continue; } else if (isErrorResult(result)) { let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id); if (!(errors && errors[boundaryMatch.route.id])) { errors = router_extends({}, errors, { [boundaryMatch.route.id]: result.error }); } state.fetchers.delete(key); } else if (isRedirectResult(result)) { // Should never get here, redirects should get processed above, but we // keep this to type narrow to a success result in the else router_invariant(false, "Unhandled fetcher revalidation redirect"); } else if (isDeferredResult(result)) { // Should never get here, deferred data should be awaited for fetchers // in resolveDeferredResults router_invariant(false, "Unhandled fetcher deferred data"); } else { let doneFetcher = getDoneFetcher(result.data); state.fetchers.set(key, doneFetcher); } } return { loaderData, errors }; } function mergeLoaderData(loaderData, newLoaderData, matches, errors) { let mergedLoaderData = router_extends({}, newLoaderData); for (let match of matches) { let id = match.route.id; if (newLoaderData.hasOwnProperty(id)) { if (newLoaderData[id] !== undefined) { mergedLoaderData[id] = newLoaderData[id]; } } else if (loaderData[id] !== undefined && match.route.loader) { // Preserve existing keys not included in newLoaderData and where a loader // wasn't removed by HMR mergedLoaderData[id] = loaderData[id]; } if (errors && errors.hasOwnProperty(id)) { // Don't keep any loader data below the boundary break; } } return mergedLoaderData; } // Find the nearest error boundary, looking upwards from the leaf route (or the // route specified by routeId) for the closest ancestor error boundary, // defaulting to the root match function findNearestBoundary(matches, routeId) { let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches]; return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0]; } function getShortCircuitMatches(routes) { // Prefer a root layout route if present, otherwise shim in a route object let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === "/") || { id: "__shim-error-route__" }; return { matches: [{ params: {}, pathname: "", pathnameBase: "", route }], route }; } function getInternalRouterError(status, _temp5) { let { pathname, routeId, method, type } = _temp5 === void 0 ? {} : _temp5; let statusText = "Unknown Server Error"; let errorMessage = "Unknown @remix-run/router error"; if (status === 400) { statusText = "Bad Request"; if (method && pathname && routeId) { errorMessage = "You made a " + method + " request to \"" + pathname + "\" but " + ("did not provide a `loader` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; } else if (type === "defer-action") { errorMessage = "defer() is not supported in actions"; } else if (type === "invalid-body") { errorMessage = "Unable to encode submission body"; } } else if (status === 403) { statusText = "Forbidden"; errorMessage = "Route \"" + routeId + "\" does not match URL \"" + pathname + "\""; } else if (status === 404) { statusText = "Not Found"; errorMessage = "No route matches URL \"" + pathname + "\""; } else if (status === 405) { statusText = "Method Not Allowed"; if (method && pathname && routeId) { errorMessage = "You made a " + method.toUpperCase() + " request to \"" + pathname + "\" but " + ("did not provide an `action` for route \"" + routeId + "\", ") + "so there is no way to handle the request."; } else if (method) { errorMessage = "Invalid request method \"" + method.toUpperCase() + "\""; } } return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true); } // Find any returned redirect errors, starting from the lowest match function findRedirect(results) { for (let i = results.length - 1; i >= 0; i--) { let result = results[i]; if (isRedirectResult(result)) { return { result, idx: i }; } } } function stripHashFromPath(path) { let parsedPath = typeof path === "string" ? parsePath(path) : path; return router_createPath(router_extends({}, parsedPath, { hash: "" })); } function isHashChangeOnly(a, b) { if (a.pathname !== b.pathname || a.search !== b.search) { return false; } if (a.hash === "") { // /page -> /page#hash return b.hash !== ""; } else if (a.hash === b.hash) { // /page#hash -> /page#hash return true; } else if (b.hash !== "") { // /page#hash -> /page#other return true; } // If the hash is removed the browser will re-perform a request to the server // /page#hash -> /page return false; } function isDeferredResult(result) { return result.type === ResultType.deferred; } function isErrorResult(result) { return result.type === ResultType.error; } function isRedirectResult(result) { return (result && result.type) === ResultType.redirect; } function isDeferredData(value) { let deferred = value; return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function"; } function isResponse(value) { return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined"; } function isRedirectResponse(result) { if (!isResponse(result)) { return false; } let status = result.status; let location = result.headers.get("Location"); return status >= 300 && status <= 399 && location != null; } function isQueryRouteResponse(obj) { return obj && isResponse(obj.response) && (obj.type === ResultType.data || obj.type === ResultType.error); } function isValidMethod(method) { return validRequestMethods.has(method.toLowerCase()); } function isMutationMethod(method) { return validMutationMethods.has(method.toLowerCase()); } async function resolveDeferredResults(currentMatches, matchesToLoad, results, signals, isFetcher, currentLoaderData) { for (let index = 0; index < results.length; index++) { let result = results[index]; let match = matchesToLoad[index]; // If we don't have a match, then we can have a deferred result to do // anything with. This is for revalidating fetchers where the route was // removed during HMR if (!match) { continue; } let currentMatch = currentMatches.find(m => m.route.id === match.route.id); let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined; if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) { // Note: we do not have to touch activeDeferreds here since we race them // against the signal in resolveDeferredData and they'll get aborted // there if needed let signal = signals[index]; router_invariant(signal, "Expected an AbortSignal for revalidating fetcher deferred result"); await resolveDeferredData(result, signal, isFetcher).then(result => { if (result) { results[index] = result || results[index]; } }); } } } async function resolveDeferredData(result, signal, unwrap) { if (unwrap === void 0) { unwrap = false; } let aborted = await result.deferredData.resolveData(signal); if (aborted) { return; } if (unwrap) { try { return { type: ResultType.data, data: result.deferredData.unwrappedData }; } catch (e) { // Handle any TrackedPromise._error values encountered while unwrapping return { type: ResultType.error, error: e }; } } return { type: ResultType.data, data: result.deferredData.data }; } function hasNakedIndexQuery(search) { return new URLSearchParams(search).getAll("index").some(v => v === ""); } function getTargetMatch(matches, location) { let search = typeof location === "string" ? parsePath(location).search : location.search; if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { // Return the leaf index route when index is present return matches[matches.length - 1]; } // Otherwise grab the deepest "path contributing" match (ignoring index and // pathless layout routes) let pathMatches = getPathContributingMatches(matches); return pathMatches[pathMatches.length - 1]; } function getSubmissionFromNavigation(navigation) { let { formMethod, formAction, formEncType, text, formData, json } = navigation; if (!formMethod || !formAction || !formEncType) { return; } if (text != null) { return { formMethod, formAction, formEncType, formData: undefined, json: undefined, text }; } else if (formData != null) { return { formMethod, formAction, formEncType, formData, json: undefined, text: undefined }; } else if (json !== undefined) { return { formMethod, formAction, formEncType, formData: undefined, json, text: undefined }; } } function getLoadingNavigation(location, submission) { if (submission) { let navigation = { state: "loading", location, formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text }; return navigation; } else { let navigation = { state: "loading", location, formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined }; return navigation; } } function getSubmittingNavigation(location, submission) { let navigation = { state: "submitting", location, formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text }; return navigation; } function getLoadingFetcher(submission, data) { if (submission) { let fetcher = { state: "loading", formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text, data }; return fetcher; } else { let fetcher = { state: "loading", formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined, data }; return fetcher; } } function getSubmittingFetcher(submission, existingFetcher) { let fetcher = { state: "submitting", formMethod: submission.formMethod, formAction: submission.formAction, formEncType: submission.formEncType, formData: submission.formData, json: submission.json, text: submission.text, data: existingFetcher ? existingFetcher.data : undefined }; return fetcher; } function getDoneFetcher(data) { let fetcher = { state: "idle", formMethod: undefined, formAction: undefined, formEncType: undefined, formData: undefined, json: undefined, text: undefined, data }; return fetcher; } function restoreAppliedTransitions(_window, transitions) { try { let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY); if (sessionPositions) { let json = JSON.parse(sessionPositions); for (let [k, v] of Object.entries(json || {})) { if (v && Array.isArray(v)) { transitions.set(k, new Set(v || [])); } } } } catch (e) { // no-op, use default empty object } } function persistAppliedTransitions(_window, transitions) { if (transitions.size > 0) { let json = {}; for (let [k, v] of transitions) { json[k] = [...v]; } try { _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json)); } catch (error) { router_warning(false, "Failed to save applied view transitions in sessionStorage (" + error + ")."); } } } //#endregion //# sourceMappingURL=router.js.map ;// CONCATENATED MODULE: ./node_modules/react-router/dist/index.js /** * React Router v6.19.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ function dist_extends() { dist_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return dist_extends.apply(this, arguments); } // Create react-specific types from the agnostic types in @remix-run/router to // export from react-router const DataRouterContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} const DataRouterStateContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} const AwaitContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} /** * A Navigator is a "location changer"; it's how you get to different locations. * * Every history instance conforms to the Navigator interface, but the * distinction is useful primarily when it comes to the low-level `<Router>` API * where both the location and a navigator must be provided separately in order * to avoid "tearing" that may occur in a suspense-enabled app if the action * and/or location were to be read directly from the history instance. */ const NavigationContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} const LocationContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} const RouteContext = /*#__PURE__*/external_React_.createContext({ outlet: null, matches: [], isDataRoute: false }); if (false) {} const RouteErrorContext = /*#__PURE__*/external_React_.createContext(null); if (false) {} /** * Returns the full href for the given "to" value. This is useful for building * custom links that are also accessible and preserve right-click behavior. * * @see https://reactrouter.com/hooks/use-href */ function useHref(to, _temp) { let { relative } = _temp === void 0 ? {} : _temp; !useInRouterContext() ? false ? 0 : router_invariant(false) : void 0; let { basename, navigator } = external_React_.useContext(NavigationContext); let { hash, pathname, search } = dist_useResolvedPath(to, { relative }); let joinedPathname = pathname; // If we're operating within a basename, prepend it to the pathname prior // to creating the href. If this is a root navigation, then just use the raw // basename which allows the basename to have full control over the presence // of a trailing slash on root links if (basename !== "/") { joinedPathname = pathname === "/" ? basename : router_joinPaths([basename, pathname]); } return navigator.createHref({ pathname: joinedPathname, search, hash }); } /** * Returns true if this component is a descendant of a `<Router>`. * * @see https://reactrouter.com/hooks/use-in-router-context */ function useInRouterContext() { return external_React_.useContext(LocationContext) != null; } /** * Returns the current location object, which represents the current URL in web * browsers. * * Note: If you're using this it may mean you're doing some of your own * "routing" in your app, and we'd like to know what your use case is. We may * be able to provide something higher-level to better suit your needs. * * @see https://reactrouter.com/hooks/use-location */ function dist_useLocation() { !useInRouterContext() ? false ? 0 : router_invariant(false) : void 0; return external_React_.useContext(LocationContext).location; } /** * Returns the current navigation action which describes how the router came to * the current location, either by a pop, push, or replace on the history stack. * * @see https://reactrouter.com/hooks/use-navigation-type */ function useNavigationType() { return React.useContext(LocationContext).navigationType; } /** * Returns a PathMatch object if the given pattern matches the current URL. * This is useful for components that need to know "active" state, e.g. * `<NavLink>`. * * @see https://reactrouter.com/hooks/use-match */ function useMatch(pattern) { !useInRouterContext() ? false ? 0 : UNSAFE_invariant(false) : void 0; let { pathname } = dist_useLocation(); return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]); } /** * The interface for the navigate() function returned from useNavigate(). */ const navigateEffectWarning = (/* unused pure expression or super */ null && ("You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.")); // Mute warnings for calls to useNavigate in SSR environments function dist_useIsomorphicLayoutEffect(cb) { let isStatic = external_React_.useContext(NavigationContext).static; if (!isStatic) { // We should be able to get rid of this once react 18.3 is released // See: https://github.com/facebook/react/pull/26395 // eslint-disable-next-line react-hooks/rules-of-hooks external_React_.useLayoutEffect(cb); } } /** * Returns an imperative method for changing the location. Used by `<Link>`s, but * may also be used by other elements to change the location. * * @see https://reactrouter.com/hooks/use-navigate */ function useNavigate() { let { isDataRoute } = external_React_.useContext(RouteContext); // Conditional usage is OK here because the usage of a data router is static // eslint-disable-next-line react-hooks/rules-of-hooks return isDataRoute ? useNavigateStable() : useNavigateUnstable(); } function useNavigateUnstable() { !useInRouterContext() ? false ? 0 : router_invariant(false) : void 0; let dataRouterContext = external_React_.useContext(DataRouterContext); let { basename, navigator } = external_React_.useContext(NavigationContext); let { matches } = external_React_.useContext(RouteContext); let { pathname: locationPathname } = dist_useLocation(); let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map(match => match.pathnameBase)); let activeRef = external_React_.useRef(false); dist_useIsomorphicLayoutEffect(() => { activeRef.current = true; }); let navigate = external_React_.useCallback(function (to, options) { if (options === void 0) { options = {}; } false ? 0 : void 0; // Short circuit here since if this happens on first render the navigate // is useless because we haven't wired up our history listener yet if (!activeRef.current) return; if (typeof to === "number") { navigator.go(to); return; } let path = router_resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path"); // If we're operating within a basename, prepend it to the pathname prior // to handing off to history (but only if we're not in a data router, // otherwise it'll prepend the basename inside of the router). // If this is a root navigation, then we navigate to the raw basename // which allows the basename to have full control over the presence of a // trailing slash on root links if (dataRouterContext == null && basename !== "/") { path.pathname = path.pathname === "/" ? basename : router_joinPaths([basename, path.pathname]); } (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options); }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]); return navigate; } const OutletContext = /*#__PURE__*/(/* unused pure expression or super */ null && (React.createContext(null))); /** * Returns the context (if provided) for the child route at this level of the route * hierarchy. * @see https://reactrouter.com/hooks/use-outlet-context */ function useOutletContext() { return React.useContext(OutletContext); } /** * Returns the element for the child route at this level of the route * hierarchy. Used internally by `<Outlet>` to render child routes. * * @see https://reactrouter.com/hooks/use-outlet */ function useOutlet(context) { let outlet = React.useContext(RouteContext).outlet; if (outlet) { return /*#__PURE__*/React.createElement(OutletContext.Provider, { value: context }, outlet); } return outlet; } /** * Returns an object of key/value pairs of the dynamic params from the current * URL that were matched by the route path. * * @see https://reactrouter.com/hooks/use-params */ function useParams() { let { matches } = React.useContext(RouteContext); let routeMatch = matches[matches.length - 1]; return routeMatch ? routeMatch.params : {}; } /** * Resolves the pathname of the given `to` value against the current location. * * @see https://reactrouter.com/hooks/use-resolved-path */ function dist_useResolvedPath(to, _temp2) { let { relative } = _temp2 === void 0 ? {} : _temp2; let { matches } = external_React_.useContext(RouteContext); let { pathname: locationPathname } = dist_useLocation(); // Use the full pathname for the leaf match so we include splat values // for "." links let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match, idx) => idx === matches.length - 1 ? match.pathname : match.pathnameBase)); return external_React_.useMemo(() => router_resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]); } /** * Returns the element of the route that matched the current location, prepared * with the correct context to render the remainder of the route tree. Route * elements in the tree must render an `<Outlet>` to render their child route's * element. * * @see https://reactrouter.com/hooks/use-routes */ function useRoutes(routes, locationArg) { return useRoutesImpl(routes, locationArg); } // Internal implementation with accept optional param for RouterProvider usage function useRoutesImpl(routes, locationArg, dataRouterState) { !useInRouterContext() ? false ? 0 : router_invariant(false) : void 0; let { navigator } = external_React_.useContext(NavigationContext); let { matches: parentMatches } = external_React_.useContext(RouteContext); let routeMatch = parentMatches[parentMatches.length - 1]; let parentParams = routeMatch ? routeMatch.params : {}; let parentPathname = routeMatch ? routeMatch.pathname : "/"; let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; let parentRoute = routeMatch && routeMatch.route; if (false) {} let locationFromContext = dist_useLocation(); let location; if (locationArg) { var _parsedLocationArg$pa; let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? false ? 0 : router_invariant(false) : void 0; location = parsedLocationArg; } else { location = locationFromContext; } let pathname = location.pathname || "/"; let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/"; let matches = matchRoutes(routes, { pathname: remainingPathname }); if (false) {} let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, { params: Object.assign({}, parentParams, match.params), pathname: router_joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]), pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : router_joinPaths([parentPathnameBase, // Re-encode pathnames that were decoded inside matchRoutes navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase]) })), parentMatches, dataRouterState); // When a user passes in a `locationArg`, the associated routes need to // be wrapped in a new `LocationContext.Provider` in order for `useLocation` // to use the scoped location instead of the global location. if (locationArg && renderedMatches) { return /*#__PURE__*/external_React_.createElement(LocationContext.Provider, { value: { location: dist_extends({ pathname: "/", search: "", hash: "", state: null, key: "default" }, location), navigationType: Action.Pop } }, renderedMatches); } return renderedMatches; } function DefaultErrorComponent() { let error = useRouteError(); let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error); let stack = error instanceof Error ? error.stack : null; let lightgrey = "rgba(200,200,200, 0.5)"; let preStyles = { padding: "0.5rem", backgroundColor: lightgrey }; let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey }; let devInfo = null; if (false) {} return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, /*#__PURE__*/external_React_.createElement("h2", null, "Unexpected Application Error!"), /*#__PURE__*/external_React_.createElement("h3", { style: { fontStyle: "italic" } }, message), stack ? /*#__PURE__*/external_React_.createElement("pre", { style: preStyles }, stack) : null, devInfo); } const defaultErrorElement = /*#__PURE__*/external_React_.createElement(DefaultErrorComponent, null); class RenderErrorBoundary extends external_React_.Component { constructor(props) { super(props); this.state = { location: props.location, revalidation: props.revalidation, error: props.error }; } static getDerivedStateFromError(error) { return { error: error }; } static getDerivedStateFromProps(props, state) { // When we get into an error state, the user will likely click "back" to the // previous page that didn't have an error. Because this wraps the entire // application, that will have no effect--the error page continues to display. // This gives us a mechanism to recover from the error when the location changes. // // Whether we're in an error state or not, we update the location in state // so that when we are in an error state, it gets reset when a new location // comes in and the user recovers from the error. if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") { return { error: props.error, location: props.location, revalidation: props.revalidation }; } // If we're not changing locations, preserve the location but still surface // any new errors that may come through. We retain the existing error, we do // this because the error provided from the app state may be cleared without // the location changing. return { error: props.error || state.error, location: state.location, revalidation: props.revalidation || state.revalidation }; } componentDidCatch(error, errorInfo) { console.error("React Router caught the following error during render", error, errorInfo); } render() { return this.state.error ? /*#__PURE__*/external_React_.createElement(RouteContext.Provider, { value: this.props.routeContext }, /*#__PURE__*/external_React_.createElement(RouteErrorContext.Provider, { value: this.state.error, children: this.props.component })) : this.props.children; } } function RenderedRoute(_ref) { let { routeContext, match, children } = _ref; let dataRouterContext = external_React_.useContext(DataRouterContext); // Track how deep we got in our render pass to emulate SSR componentDidCatch // in a DataStaticRouter if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) { dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id; } return /*#__PURE__*/external_React_.createElement(RouteContext.Provider, { value: routeContext }, children); } function _renderMatches(matches, parentMatches, dataRouterState) { var _dataRouterState2; if (parentMatches === void 0) { parentMatches = []; } if (dataRouterState === void 0) { dataRouterState = null; } if (matches == null) { var _dataRouterState; if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) { // Don't bail if we have data router errors so we can render them in the // boundary. Use the pre-matched (or shimmed) matches matches = dataRouterState.matches; } else { return null; } } let renderedMatches = matches; // If we have data errors, trim matches to the highest error boundary let errors = (_dataRouterState2 = dataRouterState) == null ? void 0 : _dataRouterState2.errors; if (errors != null) { let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id])); !(errorIndex >= 0) ? false ? 0 : router_invariant(false) : void 0; renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1)); } return renderedMatches.reduceRight((outlet, match, index) => { let error = match.route.id ? errors == null ? void 0 : errors[match.route.id] : null; // Only data routers handle errors let errorElement = null; if (dataRouterState) { errorElement = match.route.errorElement || defaultErrorElement; } let matches = parentMatches.concat(renderedMatches.slice(0, index + 1)); let getChildren = () => { let children; if (error) { children = errorElement; } else if (match.route.Component) { // Note: This is a de-optimized path since React won't re-use the // ReactElement since it's identity changes with each new // React.createElement call. We keep this so folks can use // `<Route Component={...}>` in `<Routes>` but generally `Component` // usage is only advised in `RouterProvider` when we can convert it to // `element` ahead of time. children = /*#__PURE__*/external_React_.createElement(match.route.Component, null); } else if (match.route.element) { children = match.route.element; } else { children = outlet; } return /*#__PURE__*/external_React_.createElement(RenderedRoute, { match: match, routeContext: { outlet, matches, isDataRoute: dataRouterState != null }, children: children }); }; // Only wrap in an error boundary within data router usages when we have an // ErrorBoundary/errorElement on this route. Otherwise let it bubble up to // an ancestor ErrorBoundary/errorElement return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/external_React_.createElement(RenderErrorBoundary, { location: dataRouterState.location, revalidation: dataRouterState.revalidation, component: errorElement, error: error, children: getChildren(), routeContext: { outlet: null, matches, isDataRoute: true } }) : getChildren(); }, null); } var DataRouterHook = /*#__PURE__*/function (DataRouterHook) { DataRouterHook["UseBlocker"] = "useBlocker"; DataRouterHook["UseRevalidator"] = "useRevalidator"; DataRouterHook["UseNavigateStable"] = "useNavigate"; return DataRouterHook; }(DataRouterHook || {}); var DataRouterStateHook = /*#__PURE__*/function (DataRouterStateHook) { DataRouterStateHook["UseBlocker"] = "useBlocker"; DataRouterStateHook["UseLoaderData"] = "useLoaderData"; DataRouterStateHook["UseActionData"] = "useActionData"; DataRouterStateHook["UseRouteError"] = "useRouteError"; DataRouterStateHook["UseNavigation"] = "useNavigation"; DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData"; DataRouterStateHook["UseMatches"] = "useMatches"; DataRouterStateHook["UseRevalidator"] = "useRevalidator"; DataRouterStateHook["UseNavigateStable"] = "useNavigate"; DataRouterStateHook["UseRouteId"] = "useRouteId"; return DataRouterStateHook; }(DataRouterStateHook || {}); function getDataRouterConsoleError(hookName) { return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router."; } function useDataRouterContext(hookName) { let ctx = external_React_.useContext(DataRouterContext); !ctx ? false ? 0 : router_invariant(false) : void 0; return ctx; } function useDataRouterState(hookName) { let state = external_React_.useContext(DataRouterStateContext); !state ? false ? 0 : router_invariant(false) : void 0; return state; } function useRouteContext(hookName) { let route = external_React_.useContext(RouteContext); !route ? false ? 0 : router_invariant(false) : void 0; return route; } // Internal version with hookName-aware debugging function useCurrentRouteId(hookName) { let route = useRouteContext(hookName); let thisRoute = route.matches[route.matches.length - 1]; !thisRoute.route.id ? false ? 0 : router_invariant(false) : void 0; return thisRoute.route.id; } /** * Returns the ID for the nearest contextual route */ function useRouteId() { return useCurrentRouteId(DataRouterStateHook.UseRouteId); } /** * Returns the current navigation, defaulting to an "idle" navigation when * no navigation is in progress */ function dist_useNavigation() { let state = useDataRouterState(DataRouterStateHook.UseNavigation); return state.navigation; } /** * Returns a revalidate function for manually triggering revalidation, as well * as the current state of any manual revalidations */ function useRevalidator() { let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator); let state = useDataRouterState(DataRouterStateHook.UseRevalidator); return React.useMemo(() => ({ revalidate: dataRouterContext.router.revalidate, state: state.revalidation }), [dataRouterContext.router.revalidate, state.revalidation]); } /** * Returns the active route matches, useful for accessing loaderData for * parent/child routes or the route "handle" property */ function dist_useMatches() { let { matches, loaderData } = useDataRouterState(DataRouterStateHook.UseMatches); return React.useMemo(() => matches.map(m => UNSAFE_convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]); } /** * Returns the loader data for the nearest ancestor Route loader */ function useLoaderData() { let state = useDataRouterState(DataRouterStateHook.UseLoaderData); let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData); if (state.errors && state.errors[routeId] != null) { console.error("You cannot `useLoaderData` in an errorElement (routeId: " + routeId + ")"); return undefined; } return state.loaderData[routeId]; } /** * Returns the loaderData for the given routeId */ function useRouteLoaderData(routeId) { let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData); return state.loaderData[routeId]; } /** * Returns the action data for the nearest ancestor Route action */ function useActionData() { let state = useDataRouterState(DataRouterStateHook.UseActionData); let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData); return state.actionData ? state.actionData[routeId] : undefined; } /** * Returns the nearest ancestor Route error, which could be a loader/action * error or a render error. This is intended to be called from your * ErrorBoundary/errorElement to display a proper error message. */ function useRouteError() { var _state$errors; let error = external_React_.useContext(RouteErrorContext); let state = useDataRouterState(DataRouterStateHook.UseRouteError); let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError); // If this was a render error, we put it in a RouteError context inside // of RenderErrorBoundary if (error) { return error; } // Otherwise look for errors from our data router state return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId]; } /** * Returns the happy-path data from the nearest ancestor `<Await />` value */ function useAsyncValue() { let value = React.useContext(AwaitContext); return value == null ? void 0 : value._data; } /** * Returns the error from the nearest ancestor `<Await />` value */ function useAsyncError() { let value = React.useContext(AwaitContext); return value == null ? void 0 : value._error; } let blockerId = 0; /** * Allow the application to block navigations within the SPA and present the * user a confirmation dialog to confirm the navigation. Mostly used to avoid * using half-filled form data. This does not handle hard-reloads or * cross-origin navigations. */ function dist_useBlocker(shouldBlock) { let { router, basename } = useDataRouterContext(DataRouterHook.UseBlocker); let state = useDataRouterState(DataRouterStateHook.UseBlocker); let [blockerKey, setBlockerKey] = React.useState(""); let blockerFunction = React.useCallback(arg => { if (typeof shouldBlock !== "function") { return !!shouldBlock; } if (basename === "/") { return shouldBlock(arg); } // If they provided us a function and we've got an active basename, strip // it from the locations we expose to the user to match the behavior of // useLocation let { currentLocation, nextLocation, historyAction } = arg; return shouldBlock({ currentLocation: dist_extends({}, currentLocation, { pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname }), nextLocation: dist_extends({}, nextLocation, { pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname }), historyAction }); }, [basename, shouldBlock]); // This effect is in charge of blocker key assignment and deletion (which is // tightly coupled to the key) React.useEffect(() => { let key = String(++blockerId); setBlockerKey(key); return () => router.deleteBlocker(key); }, [router]); // This effect handles assigning the blockerFunction. This is to handle // unstable blocker function identities, and happens only after the prior // effect so we don't get an orphaned blockerFunction in the router with a // key of "". Until then we just have the IDLE_BLOCKER. React.useEffect(() => { if (blockerKey !== "") { router.getBlocker(blockerKey, blockerFunction); } }, [router, blockerKey, blockerFunction]); // Prefer the blocker from `state` not `router.state` since DataRouterContext // is memoized so this ensures we update on blocker state updates return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER; } /** * Stable version of useNavigate that is used when we are in the context of * a RouterProvider. */ function useNavigateStable() { let { router } = useDataRouterContext(DataRouterHook.UseNavigateStable); let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable); let activeRef = external_React_.useRef(false); dist_useIsomorphicLayoutEffect(() => { activeRef.current = true; }); let navigate = external_React_.useCallback(function (to, options) { if (options === void 0) { options = {}; } false ? 0 : void 0; // Short circuit here since if this happens on first render the navigate // is useless because we haven't wired up our router subscriber yet if (!activeRef.current) return; if (typeof to === "number") { router.navigate(to); } else { router.navigate(to, dist_extends({ fromRouteId: id }, options)); } }, [router, id]); return navigate; } const alreadyWarned = {}; function warningOnce(key, cond, message) { if (!cond && !alreadyWarned[key]) { alreadyWarned[key] = true; false ? 0 : void 0; } } /** Webpack + React 17 fails to compile on any of the following because webpack complains that `startTransition` doesn't exist in `React`: * import { startTransition } from "react" * import * as React from from "react"; "startTransition" in React ? React.startTransition(() => setState()) : setState() * import * as React from from "react"; "startTransition" in React ? React["startTransition"](() => setState()) : setState() Moving it to a constant such as the following solves the Webpack/React 17 issue: * import * as React from from "react"; const START_TRANSITION = "startTransition"; START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState() However, that introduces webpack/terser minification issues in production builds in React 18 where minification/obfuscation ends up removing the call of React.startTransition entirely from the first half of the ternary. Grabbing this exported reference once up front resolves that issue. See https://github.com/remix-run/react-router/issues/10579 */ const START_TRANSITION = "startTransition"; const startTransitionImpl = external_React_[START_TRANSITION]; /** * Given a Remix Router instance, render the appropriate UI */ function RouterProvider(_ref) { let { fallbackElement, router, future } = _ref; let [state, setStateImpl] = React.useState(router.state); let { v7_startTransition } = future || {}; let setState = React.useCallback(newState => { if (v7_startTransition && startTransitionImpl) { startTransitionImpl(() => setStateImpl(newState)); } else { setStateImpl(newState); } }, [setStateImpl, v7_startTransition]); // Need to use a layout effect here so we are subscribed early enough to // pick up on any render-driven redirects/navigations (useEffect/<Navigate>) React.useLayoutEffect(() => router.subscribe(setState), [router, setState]); let navigator = React.useMemo(() => { return { createHref: router.createHref, encodeLocation: router.encodeLocation, go: n => router.navigate(n), push: (to, state, opts) => router.navigate(to, { state, preventScrollReset: opts == null ? void 0 : opts.preventScrollReset }), replace: (to, state, opts) => router.navigate(to, { replace: true, state, preventScrollReset: opts == null ? void 0 : opts.preventScrollReset }) }; }, [router]); let basename = router.basename || "/"; let dataRouterContext = React.useMemo(() => ({ router, navigator, static: false, basename }), [router, navigator, basename]); // The fragment and {null} here are important! We need them to keep React 18's // useId happy when we are server-rendering since we may have a <script> here // containing the hydrated server-side staticContext (from StaticRouterProvider). // useId relies on the component tree structure to generate deterministic id's // so we need to ensure it remains the same on the client even though // we don't need the <script> tag return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DataRouterContext.Provider, { value: dataRouterContext }, /*#__PURE__*/React.createElement(DataRouterStateContext.Provider, { value: state }, /*#__PURE__*/React.createElement(dist_Router, { basename: basename, location: state.location, navigationType: state.historyAction, navigator: navigator }, state.initialized ? /*#__PURE__*/React.createElement(DataRoutes, { routes: router.routes, state: state }) : fallbackElement))), null); } function DataRoutes(_ref2) { let { routes, state } = _ref2; return useRoutesImpl(routes, undefined, state); } /** * A `<Router>` that stores all entries in memory. * * @see https://reactrouter.com/router-components/memory-router */ function MemoryRouter(_ref3) { let { basename, children, initialEntries, initialIndex, future } = _ref3; let historyRef = React.useRef(); if (historyRef.current == null) { historyRef.current = createMemoryHistory({ initialEntries, initialIndex, v5Compat: true }); } let history = historyRef.current; let [state, setStateImpl] = React.useState({ action: history.action, location: history.location }); let { v7_startTransition } = future || {}; let setState = React.useCallback(newState => { v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); }, [setStateImpl, v7_startTransition]); React.useLayoutEffect(() => history.listen(setState), [history, setState]); return /*#__PURE__*/React.createElement(dist_Router, { basename: basename, children: children, location: state.location, navigationType: state.action, navigator: history }); } /** * Changes the current location. * * Note: This API is mostly useful in React.Component subclasses that are not * able to use hooks. In functional components, we recommend you use the * `useNavigate` hook instead. * * @see https://reactrouter.com/components/navigate */ function Navigate(_ref4) { let { to, replace, state, relative } = _ref4; !useInRouterContext() ? false ? 0 : UNSAFE_invariant(false) : void 0; false ? 0 : void 0; let { matches } = React.useContext(RouteContext); let { pathname: locationPathname } = dist_useLocation(); let navigate = useNavigate(); // Resolve the path outside of the effect so that when effects run twice in // StrictMode they navigate to the same place let path = resolveTo(to, UNSAFE_getPathContributingMatches(matches).map(match => match.pathnameBase), locationPathname, relative === "path"); let jsonPath = JSON.stringify(path); React.useEffect(() => navigate(JSON.parse(jsonPath), { replace, state, relative }), [navigate, jsonPath, relative, replace, state]); return null; } /** * Renders the child route's element, if there is one. * * @see https://reactrouter.com/components/outlet */ function Outlet(props) { return useOutlet(props.context); } /** * Declares an element that should be rendered at a certain URL path. * * @see https://reactrouter.com/components/route */ function Route(_props) { false ? 0 : router_invariant(false) ; } /** * Provides location context for the rest of the app. * * Note: You usually won't render a `<Router>` directly. Instead, you'll render a * router that is more specific to your environment such as a `<BrowserRouter>` * in web browsers or a `<StaticRouter>` for server rendering. * * @see https://reactrouter.com/router-components/router */ function dist_Router(_ref5) { let { basename: basenameProp = "/", children = null, location: locationProp, navigationType = Action.Pop, navigator, static: staticProp = false } = _ref5; !!useInRouterContext() ? false ? 0 : router_invariant(false) : void 0; // Preserve trailing slashes on basename, so we can let the user control // the enforcement of trailing slashes throughout the app let basename = basenameProp.replace(/^\/*/, "/"); let navigationContext = external_React_.useMemo(() => ({ basename, navigator, static: staticProp }), [basename, navigator, staticProp]); if (typeof locationProp === "string") { locationProp = parsePath(locationProp); } let { pathname = "/", search = "", hash = "", state = null, key = "default" } = locationProp; let locationContext = external_React_.useMemo(() => { let trailingPathname = router_stripBasename(pathname, basename); if (trailingPathname == null) { return null; } return { location: { pathname: trailingPathname, search, hash, state, key }, navigationType }; }, [basename, pathname, search, hash, state, key, navigationType]); false ? 0 : void 0; if (locationContext == null) { return null; } return /*#__PURE__*/external_React_.createElement(NavigationContext.Provider, { value: navigationContext }, /*#__PURE__*/external_React_.createElement(LocationContext.Provider, { children: children, value: locationContext })); } /** * A container for a nested tree of `<Route>` elements that renders the branch * that best matches the current location. * * @see https://reactrouter.com/components/routes */ function Routes(_ref6) { let { children, location } = _ref6; return useRoutes(createRoutesFromChildren(children), location); } /** * Component to use for rendering lazily loaded data from returning defer() * in a loader function */ function Await(_ref7) { let { children, errorElement, resolve } = _ref7; return /*#__PURE__*/React.createElement(AwaitErrorBoundary, { resolve: resolve, errorElement: errorElement }, /*#__PURE__*/React.createElement(ResolveAwait, null, children)); } var AwaitRenderStatus = /*#__PURE__*/function (AwaitRenderStatus) { AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending"; AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success"; AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error"; return AwaitRenderStatus; }(AwaitRenderStatus || {}); const neverSettledPromise = new Promise(() => {}); class AwaitErrorBoundary extends external_React_.Component { constructor(props) { super(props); this.state = { error: null }; } static getDerivedStateFromError(error) { return { error }; } componentDidCatch(error, errorInfo) { console.error("<Await> caught the following error during render", error, errorInfo); } render() { let { children, errorElement, resolve } = this.props; let promise = null; let status = AwaitRenderStatus.pending; if (!(resolve instanceof Promise)) { // Didn't get a promise - provide as a resolved promise status = AwaitRenderStatus.success; promise = Promise.resolve(); Object.defineProperty(promise, "_tracked", { get: () => true }); Object.defineProperty(promise, "_data", { get: () => resolve }); } else if (this.state.error) { // Caught a render error, provide it as a rejected promise status = AwaitRenderStatus.error; let renderError = this.state.error; promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings Object.defineProperty(promise, "_tracked", { get: () => true }); Object.defineProperty(promise, "_error", { get: () => renderError }); } else if (resolve._tracked) { // Already tracked promise - check contents promise = resolve; status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending; } else { // Raw (untracked) promise - track it status = AwaitRenderStatus.pending; Object.defineProperty(resolve, "_tracked", { get: () => true }); promise = resolve.then(data => Object.defineProperty(resolve, "_data", { get: () => data }), error => Object.defineProperty(resolve, "_error", { get: () => error })); } if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) { // Freeze the UI by throwing a never resolved promise throw neverSettledPromise; } if (status === AwaitRenderStatus.error && !errorElement) { // No errorElement, throw to the nearest route-level error boundary throw promise._error; } if (status === AwaitRenderStatus.error) { // Render via our errorElement return /*#__PURE__*/external_React_.createElement(AwaitContext.Provider, { value: promise, children: errorElement }); } if (status === AwaitRenderStatus.success) { // Render children with resolved value return /*#__PURE__*/external_React_.createElement(AwaitContext.Provider, { value: promise, children: children }); } // Throw to the suspense boundary throw promise; } } /** * @private * Indirection to leverage useAsyncValue for a render-prop API on `<Await>` */ function ResolveAwait(_ref8) { let { children } = _ref8; let data = useAsyncValue(); let toRender = typeof children === "function" ? children(data) : children; return /*#__PURE__*/React.createElement(React.Fragment, null, toRender); } /////////////////////////////////////////////////////////////////////////////// // UTILS /////////////////////////////////////////////////////////////////////////////// /** * Creates a route config from a React "children" object, which is usually * either a `<Route>` element or an array of them. Used internally by * `<Routes>` to create a route config from its children. * * @see https://reactrouter.com/utils/create-routes-from-children */ function createRoutesFromChildren(children, parentPath) { if (parentPath === void 0) { parentPath = []; } let routes = []; external_React_.Children.forEach(children, (element, index) => { if (! /*#__PURE__*/external_React_.isValidElement(element)) { // Ignore non-elements. This allows people to more easily inline // conditionals in their route config. return; } let treePath = [...parentPath, index]; if (element.type === external_React_.Fragment) { // Transparently support React.Fragment and its children. routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath)); return; } !(element.type === Route) ? false ? 0 : router_invariant(false) : void 0; !(!element.props.index || !element.props.children) ? false ? 0 : router_invariant(false) : void 0; let route = { id: element.props.id || treePath.join("-"), caseSensitive: element.props.caseSensitive, element: element.props.element, Component: element.props.Component, index: element.props.index, path: element.props.path, loader: element.props.loader, action: element.props.action, errorElement: element.props.errorElement, ErrorBoundary: element.props.ErrorBoundary, hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null, shouldRevalidate: element.props.shouldRevalidate, handle: element.props.handle, lazy: element.props.lazy }; if (element.props.children) { route.children = createRoutesFromChildren(element.props.children, treePath); } routes.push(route); }); return routes; } /** * Renders the result of `matchRoutes()` into a React element. */ function renderMatches(matches) { return _renderMatches(matches); } function mapRouteProperties(route) { let updates = { // Note: this check also occurs in createRoutesFromChildren so update // there if you change this -- please and thank you! hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null }; if (route.Component) { if (false) {} Object.assign(updates, { element: /*#__PURE__*/React.createElement(route.Component), Component: undefined }); } if (route.ErrorBoundary) { if (false) {} Object.assign(updates, { errorElement: /*#__PURE__*/React.createElement(route.ErrorBoundary), ErrorBoundary: undefined }); } return updates; } function createMemoryRouter(routes, opts) { return createRouter({ basename: opts == null ? void 0 : opts.basename, future: dist_extends({}, opts == null ? void 0 : opts.future, { v7_prependBasename: true }), history: createMemoryHistory({ initialEntries: opts == null ? void 0 : opts.initialEntries, initialIndex: opts == null ? void 0 : opts.initialIndex }), hydrationData: opts == null ? void 0 : opts.hydrationData, routes, mapRouteProperties }).initialize(); } //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/react-router-dom/dist/index.js /** * React Router DOM v6.19.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ function react_router_dom_dist_extends() { react_router_dom_dist_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return react_router_dom_dist_extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } const defaultMethod = "get"; const defaultEncType = "application/x-www-form-urlencoded"; function isHtmlElement(object) { return object != null && typeof object.tagName === "string"; } function isButtonElement(object) { return isHtmlElement(object) && object.tagName.toLowerCase() === "button"; } function isFormElement(object) { return isHtmlElement(object) && object.tagName.toLowerCase() === "form"; } function isInputElement(object) { return isHtmlElement(object) && object.tagName.toLowerCase() === "input"; } function isModifiedEvent(event) { return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); } function shouldProcessLinkClick(event, target) { return event.button === 0 && ( // Ignore everything but left clicks !target || target === "_self") && // Let browser handle "target=_blank" etc. !isModifiedEvent(event) // Ignore clicks with modifier keys ; } /** * Creates a URLSearchParams object using the given initializer. * * This is identical to `new URLSearchParams(init)` except it also * supports arrays as values in the object form of the initializer * instead of just strings. This is convenient when you need multiple * values for a given key, but don't want to use an array initializer. * * For example, instead of: * * let searchParams = new URLSearchParams([ * ['sort', 'name'], * ['sort', 'price'] * ]); * * you can do: * * let searchParams = createSearchParams({ * sort: ['name', 'price'] * }); */ function createSearchParams(init) { if (init === void 0) { init = ""; } return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => { let value = init[key]; return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]); }, [])); } function getSearchParamsForLocation(locationSearch, defaultSearchParams) { let searchParams = createSearchParams(locationSearch); if (defaultSearchParams) { // Use `defaultSearchParams.forEach(...)` here instead of iterating of // `defaultSearchParams.keys()` to work-around a bug in Firefox related to // web extensions. Relevant Bugzilla tickets: // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602 // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984 defaultSearchParams.forEach((_, key) => { if (!searchParams.has(key)) { defaultSearchParams.getAll(key).forEach(value => { searchParams.append(key, value); }); } }); } return searchParams; } // One-time check for submitter support let _formDataSupportsSubmitter = null; function isFormDataSubmitterSupported() { if (_formDataSupportsSubmitter === null) { try { new FormData(document.createElement("form"), // @ts-expect-error if FormData supports the submitter parameter, this will throw 0); _formDataSupportsSubmitter = false; } catch (e) { _formDataSupportsSubmitter = true; } } return _formDataSupportsSubmitter; } const supportedFormEncTypes = new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]); function getFormEncType(encType) { if (encType != null && !supportedFormEncTypes.has(encType)) { false ? 0 : void 0; return null; } return encType; } function getFormSubmissionInfo(target, basename) { let method; let action; let encType; let formData; let body; if (isFormElement(target)) { // When grabbing the action from the element, it will have had the basename // prefixed to ensure non-JS scenarios work, so strip it since we'll // re-prefix in the router let attr = target.getAttribute("action"); action = attr ? stripBasename(attr, basename) : null; method = target.getAttribute("method") || defaultMethod; encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType; formData = new FormData(target); } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) { let form = target.form; if (form == null) { throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>"); } // <button>/<input type="submit"> may override attributes of <form> // When grabbing the action from the element, it will have had the basename // prefixed to ensure non-JS scenarios work, so strip it since we'll // re-prefix in the router let attr = target.getAttribute("formaction") || form.getAttribute("action"); action = attr ? stripBasename(attr, basename) : null; method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod; encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType; // Build a FormData object populated from a form and submitter formData = new FormData(form, target); // If this browser doesn't support the `FormData(el, submitter)` format, // then tack on the submitter value at the end. This is a lightweight // solution that is not 100% spec compliant. For complete support in older // browsers, consider using the `formdata-submitter-polyfill` package if (!isFormDataSubmitterSupported()) { let { name, type, value } = target; if (type === "image") { let prefix = name ? name + "." : ""; formData.append(prefix + "x", "0"); formData.append(prefix + "y", "0"); } else if (name) { formData.append(name, value); } } } else if (isHtmlElement(target)) { throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">"); } else { method = defaultMethod; action = null; encType = defaultEncType; body = target; } // Send body for <Form encType="text/plain" so we encode it into text if (formData && encType === "text/plain") { body = formData; formData = undefined; } return { action, method: method.toLowerCase(), encType, formData, body }; } const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"], _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"], _excluded3 = (/* unused pure expression or super */ null && (["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"])); function createBrowserRouter(routes, opts) { return createRouter({ basename: opts == null ? void 0 : opts.basename, future: react_router_dom_dist_extends({}, opts == null ? void 0 : opts.future, { v7_prependBasename: true }), history: createBrowserHistory({ window: opts == null ? void 0 : opts.window }), hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(), routes, mapRouteProperties: UNSAFE_mapRouteProperties, window: opts == null ? void 0 : opts.window }).initialize(); } function createHashRouter(routes, opts) { return createRouter({ basename: opts == null ? void 0 : opts.basename, future: react_router_dom_dist_extends({}, opts == null ? void 0 : opts.future, { v7_prependBasename: true }), history: createHashHistory({ window: opts == null ? void 0 : opts.window }), hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(), routes, mapRouteProperties: UNSAFE_mapRouteProperties, window: opts == null ? void 0 : opts.window }).initialize(); } function parseHydrationData() { var _window; let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData; if (state && state.errors) { state = react_router_dom_dist_extends({}, state, { errors: deserializeErrors(state.errors) }); } return state; } function deserializeErrors(errors) { if (!errors) return null; let entries = Object.entries(errors); let serialized = {}; for (let [key, val] of entries) { // Hey you! If you change this, please change the corresponding logic in // serializeErrors in react-router-dom/server.tsx :) if (val && val.__type === "RouteErrorResponse") { serialized[key] = new UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true); } else if (val && val.__type === "Error") { // Attempt to reconstruct the right type of Error (i.e., ReferenceError) if (val.__subType) { let ErrorConstructor = window[val.__subType]; if (typeof ErrorConstructor === "function") { try { // @ts-expect-error let error = new ErrorConstructor(val.message); // Wipe away the client-side stack trace. Nothing to fill it in with // because we don't serialize SSR stack traces for security reasons error.stack = ""; serialized[key] = error; } catch (e) { // no-op - fall through and create a normal Error } } } if (serialized[key] == null) { let error = new Error(val.message); // Wipe away the client-side stack trace. Nothing to fill it in with // because we don't serialize SSR stack traces for security reasons error.stack = ""; serialized[key] = error; } } else { serialized[key] = val; } } return serialized; } const ViewTransitionContext = /*#__PURE__*/external_React_.createContext({ isTransitioning: false }); if (false) {} const FetchersContext = /*#__PURE__*/external_React_.createContext(new Map()); if (false) {} //#endregion //////////////////////////////////////////////////////////////////////////////// //#region Components //////////////////////////////////////////////////////////////////////////////// /** Webpack + React 17 fails to compile on any of the following because webpack complains that `startTransition` doesn't exist in `React`: * import { startTransition } from "react" * import * as React from from "react"; "startTransition" in React ? React.startTransition(() => setState()) : setState() * import * as React from from "react"; "startTransition" in React ? React["startTransition"](() => setState()) : setState() Moving it to a constant such as the following solves the Webpack/React 17 issue: * import * as React from from "react"; const START_TRANSITION = "startTransition"; START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState() However, that introduces webpack/terser minification issues in production builds in React 18 where minification/obfuscation ends up removing the call of React.startTransition entirely from the first half of the ternary. Grabbing this exported reference once up front resolves that issue. See https://github.com/remix-run/react-router/issues/10579 */ const dist_START_TRANSITION = "startTransition"; const dist_startTransitionImpl = external_React_[dist_START_TRANSITION]; const FLUSH_SYNC = "flushSync"; const flushSyncImpl = external_ReactDOM_[FLUSH_SYNC]; function startTransitionSafe(cb) { if (dist_startTransitionImpl) { dist_startTransitionImpl(cb); } else { cb(); } } function flushSyncSafe(cb) { if (flushSyncImpl) { flushSyncImpl(cb); } else { cb(); } } class Deferred { constructor() { this.status = "pending"; this.promise = new Promise((resolve, reject) => { this.resolve = value => { if (this.status === "pending") { this.status = "resolved"; resolve(value); } }; this.reject = reason => { if (this.status === "pending") { this.status = "rejected"; reject(reason); } }; }); } } /** * Given a Remix Router instance, render the appropriate UI */ function dist_RouterProvider(_ref) { let { fallbackElement, router, future } = _ref; let [state, setStateImpl] = React.useState(router.state); let [pendingState, setPendingState] = React.useState(); let [vtContext, setVtContext] = React.useState({ isTransitioning: false }); let [renderDfd, setRenderDfd] = React.useState(); let [transition, setTransition] = React.useState(); let [interruption, setInterruption] = React.useState(); let fetcherData = React.useRef(new Map()); let { v7_startTransition } = future || {}; let optInStartTransition = React.useCallback(cb => { if (v7_startTransition) { startTransitionSafe(cb); } else { cb(); } }, [v7_startTransition]); let setState = React.useCallback((newState, _ref2) => { let { deletedFetchers, unstable_flushSync: flushSync, unstable_viewTransitionOpts: viewTransitionOpts } = _ref2; deletedFetchers.forEach(key => fetcherData.current.delete(key)); newState.fetchers.forEach((fetcher, key) => { if (fetcher.data !== undefined) { fetcherData.current.set(key, fetcher.data); } }); let isViewTransitionUnavailable = router.window == null || typeof router.window.document.startViewTransition !== "function"; // If this isn't a view transition or it's not available in this browser, // just update and be done with it if (!viewTransitionOpts || isViewTransitionUnavailable) { if (flushSync) { flushSyncSafe(() => setStateImpl(newState)); } else { optInStartTransition(() => setStateImpl(newState)); } return; } // flushSync + startViewTransition if (flushSync) { // Flush through the context to mark DOM elements as transition=ing flushSyncSafe(() => { // Cancel any pending transitions if (transition) { renderDfd && renderDfd.resolve(); transition.skipTransition(); } setVtContext({ isTransitioning: true, flushSync: true, currentLocation: viewTransitionOpts.currentLocation, nextLocation: viewTransitionOpts.nextLocation }); }); // Update the DOM let t = router.window.document.startViewTransition(() => { flushSyncSafe(() => setStateImpl(newState)); }); // Clean up after the animation completes t.finished.finally(() => { flushSyncSafe(() => { setRenderDfd(undefined); setTransition(undefined); setPendingState(undefined); setVtContext({ isTransitioning: false }); }); }); flushSyncSafe(() => setTransition(t)); return; } // startTransition + startViewTransition if (transition) { // Interrupting an in-progress transition, cancel and let everything flush // out, and then kick off a new transition from the interruption state renderDfd && renderDfd.resolve(); transition.skipTransition(); setInterruption({ state: newState, currentLocation: viewTransitionOpts.currentLocation, nextLocation: viewTransitionOpts.nextLocation }); } else { // Completed navigation update with opted-in view transitions, let 'er rip setPendingState(newState); setVtContext({ isTransitioning: true, flushSync: false, currentLocation: viewTransitionOpts.currentLocation, nextLocation: viewTransitionOpts.nextLocation }); } }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]); // Need to use a layout effect here so we are subscribed early enough to // pick up on any render-driven redirects/navigations (useEffect/<Navigate>) React.useLayoutEffect(() => router.subscribe(setState), [router, setState]); // When we start a view transition, create a Deferred we can use for the // eventual "completed" render React.useEffect(() => { if (vtContext.isTransitioning && !vtContext.flushSync) { setRenderDfd(new Deferred()); } }, [vtContext]); // Once the deferred is created, kick off startViewTransition() to update the // DOM and then wait on the Deferred to resolve (indicating the DOM update has // happened) React.useEffect(() => { if (renderDfd && pendingState && router.window) { let newState = pendingState; let renderPromise = renderDfd.promise; let transition = router.window.document.startViewTransition(async () => { optInStartTransition(() => setStateImpl(newState)); await renderPromise; }); transition.finished.finally(() => { setRenderDfd(undefined); setTransition(undefined); setPendingState(undefined); setVtContext({ isTransitioning: false }); }); setTransition(transition); } }, [optInStartTransition, pendingState, renderDfd, router.window]); // When the new location finally renders and is committed to the DOM, this // effect will run to resolve the transition React.useEffect(() => { if (renderDfd && pendingState && state.location.key === pendingState.location.key) { renderDfd.resolve(); } }, [renderDfd, transition, state.location, pendingState]); // If we get interrupted with a new navigation during a transition, we skip // the active transition, let it cleanup, then kick it off again here React.useEffect(() => { if (!vtContext.isTransitioning && interruption) { setPendingState(interruption.state); setVtContext({ isTransitioning: true, flushSync: false, currentLocation: interruption.currentLocation, nextLocation: interruption.nextLocation }); setInterruption(undefined); } }, [vtContext.isTransitioning, interruption]); let navigator = React.useMemo(() => { return { createHref: router.createHref, encodeLocation: router.encodeLocation, go: n => router.navigate(n), push: (to, state, opts) => router.navigate(to, { state, preventScrollReset: opts == null ? void 0 : opts.preventScrollReset }), replace: (to, state, opts) => router.navigate(to, { replace: true, state, preventScrollReset: opts == null ? void 0 : opts.preventScrollReset }) }; }, [router]); let basename = router.basename || "/"; let dataRouterContext = React.useMemo(() => ({ router, navigator, static: false, basename }), [router, navigator, basename]); // The fragment and {null} here are important! We need them to keep React 18's // useId happy when we are server-rendering since we may have a <script> here // containing the hydrated server-side staticContext (from StaticRouterProvider). // useId relies on the component tree structure to generate deterministic id's // so we need to ensure it remains the same on the client even though // we don't need the <script> tag return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UNSAFE_DataRouterContext.Provider, { value: dataRouterContext }, /*#__PURE__*/React.createElement(UNSAFE_DataRouterStateContext.Provider, { value: state }, /*#__PURE__*/React.createElement(FetchersContext.Provider, { value: fetcherData.current }, /*#__PURE__*/React.createElement(ViewTransitionContext.Provider, { value: vtContext }, /*#__PURE__*/React.createElement(Router, { basename: basename, location: state.location, navigationType: state.historyAction, navigator: navigator }, state.initialized ? /*#__PURE__*/React.createElement(dist_DataRoutes, { routes: router.routes, state: state }) : fallbackElement))))), null); } function dist_DataRoutes(_ref3) { let { routes, state } = _ref3; return UNSAFE_useRoutesImpl(routes, undefined, state); } /** * A `<Router>` for use in web browsers. Provides the cleanest URLs. */ function BrowserRouter(_ref4) { let { basename, children, future, window } = _ref4; let historyRef = React.useRef(); if (historyRef.current == null) { historyRef.current = createBrowserHistory({ window, v5Compat: true }); } let history = historyRef.current; let [state, setStateImpl] = React.useState({ action: history.action, location: history.location }); let { v7_startTransition } = future || {}; let setState = React.useCallback(newState => { v7_startTransition && dist_startTransitionImpl ? dist_startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); }, [setStateImpl, v7_startTransition]); React.useLayoutEffect(() => history.listen(setState), [history, setState]); return /*#__PURE__*/React.createElement(Router, { basename: basename, children: children, location: state.location, navigationType: state.action, navigator: history }); } /** * A `<Router>` for use in web browsers. Stores the location in the hash * portion of the URL so it is not sent to the server. */ function HashRouter(_ref5) { let { basename, children, future, window } = _ref5; let historyRef = external_React_.useRef(); if (historyRef.current == null) { historyRef.current = router_createHashHistory({ window, v5Compat: true }); } let history = historyRef.current; let [state, setStateImpl] = external_React_.useState({ action: history.action, location: history.location }); let { v7_startTransition } = future || {}; let setState = external_React_.useCallback(newState => { v7_startTransition && dist_startTransitionImpl ? dist_startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); }, [setStateImpl, v7_startTransition]); external_React_.useLayoutEffect(() => history.listen(setState), [history, setState]); return /*#__PURE__*/external_React_.createElement(dist_Router, { basename: basename, children: children, location: state.location, navigationType: state.action, navigator: history }); } /** * A `<Router>` that accepts a pre-instantiated history object. It's important * to note that using your own history object is highly discouraged and may add * two versions of the history library to your bundles unless you use the same * version of the history library that React Router uses internally. */ function HistoryRouter(_ref6) { let { basename, children, future, history } = _ref6; let [state, setStateImpl] = React.useState({ action: history.action, location: history.location }); let { v7_startTransition } = future || {}; let setState = React.useCallback(newState => { v7_startTransition && dist_startTransitionImpl ? dist_startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState); }, [setStateImpl, v7_startTransition]); React.useLayoutEffect(() => history.listen(setState), [history, setState]); return /*#__PURE__*/React.createElement(Router, { basename: basename, children: children, location: state.location, navigationType: state.action, navigator: history }); } if (false) {} const dist_isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"; const dist_ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i; /** * The public API for rendering a history-aware `<a>`. */ const Link = /*#__PURE__*/external_React_.forwardRef(function LinkWithRef(_ref7, ref) { let { onClick, relative, reloadDocument, replace, state, target, to, preventScrollReset, unstable_viewTransition } = _ref7, rest = _objectWithoutPropertiesLoose(_ref7, _excluded); let { basename } = external_React_.useContext(NavigationContext); // Rendered into <a href> for absolute URLs let absoluteHref; let isExternal = false; if (typeof to === "string" && dist_ABSOLUTE_URL_REGEX.test(to)) { // Render the absolute href server- and client-side absoluteHref = to; // Only check for external origins client-side if (dist_isBrowser) { try { let currentUrl = new URL(window.location.href); let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to); let path = router_stripBasename(targetUrl.pathname, basename); if (targetUrl.origin === currentUrl.origin && path != null) { // Strip the protocol/origin/basename for same-origin absolute URLs to = path + targetUrl.search + targetUrl.hash; } else { isExternal = true; } } catch (e) { // We can't do external URL detection without a valid URL false ? 0 : void 0; } } } // Rendered into <a href> for relative URLs let href = useHref(to, { relative }); let internalOnClick = useLinkClickHandler(to, { replace, state, target, preventScrollReset, relative, unstable_viewTransition }); function handleClick(event) { if (onClick) onClick(event); if (!event.defaultPrevented) { internalOnClick(event); } } return ( /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/anchor-has-content external_React_.createElement("a", react_router_dom_dist_extends({}, rest, { href: absoluteHref || href, onClick: isExternal || reloadDocument ? onClick : handleClick, ref: ref, target: target })) ); }); if (false) {} /** * A `<Link>` wrapper that knows if it's "active" or not. */ const NavLink = /*#__PURE__*/external_React_.forwardRef(function NavLinkWithRef(_ref8, ref) { let { "aria-current": ariaCurrentProp = "page", caseSensitive = false, className: classNameProp = "", end = false, style: styleProp, to, unstable_viewTransition, children } = _ref8, rest = _objectWithoutPropertiesLoose(_ref8, _excluded2); let path = dist_useResolvedPath(to, { relative: rest.relative }); let location = dist_useLocation(); let routerState = external_React_.useContext(DataRouterStateContext); let { navigator } = external_React_.useContext(NavigationContext); let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static // eslint-disable-next-line react-hooks/rules-of-hooks useViewTransitionState(path) && unstable_viewTransition === true; let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname; let locationPathname = location.pathname; let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null; if (!caseSensitive) { locationPathname = locationPathname.toLowerCase(); nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null; toPathname = toPathname.toLowerCase(); } // If the `to` has a trailing slash, look at that exact spot. Otherwise, // we're looking for a slash _after_ what's in `to`. For example: // // <NavLink to="/users"> and <NavLink to="/users/"> // both want to look for a / at index 6 to match URL `/users/matt` const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length; let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/"; let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/"); let renderProps = { isActive, isPending, isTransitioning }; let ariaCurrent = isActive ? ariaCurrentProp : undefined; let className; if (typeof classNameProp === "function") { className = classNameProp(renderProps); } else { // If the className prop is not a function, we use a default `active` // class for <NavLink />s that are active. In v5 `active` was the default // value for `activeClassName`, but we are removing that API and can still // use the old default behavior for a cleaner upgrade path and keep the // simple styling rules working as they currently do. className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" "); } let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp; return /*#__PURE__*/external_React_.createElement(Link, react_router_dom_dist_extends({}, rest, { "aria-current": ariaCurrent, className: className, ref: ref, style: style, to: to, unstable_viewTransition: unstable_viewTransition }), typeof children === "function" ? children(renderProps) : children); }); if (false) {} /** * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except * that the interaction with the server is with `fetch` instead of new document * requests, allowing components to add nicer UX to the page as the form is * submitted and returns with data. */ const Form = /*#__PURE__*/(/* unused pure expression or super */ null && (React.forwardRef((_ref9, forwardedRef) => { let { fetcherKey, navigate, reloadDocument, replace, state, method = defaultMethod, action, onSubmit, relative, preventScrollReset, unstable_viewTransition } = _ref9, props = _objectWithoutPropertiesLoose(_ref9, _excluded3); let submit = useSubmit(); let formAction = useFormAction(action, { relative }); let formMethod = method.toLowerCase() === "get" ? "get" : "post"; let submitHandler = event => { onSubmit && onSubmit(event); if (event.defaultPrevented) return; event.preventDefault(); let submitter = event.nativeEvent.submitter; let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method; submit(submitter || event.currentTarget, { fetcherKey, method: submitMethod, navigate, replace, state, relative, preventScrollReset, unstable_viewTransition }); }; return /*#__PURE__*/React.createElement("form", react_router_dom_dist_extends({ ref: forwardedRef, method: formMethod, action: formAction, onSubmit: reloadDocument ? onSubmit : submitHandler }, props)); }))); if (false) {} /** * This component will emulate the browser's scroll restoration on location * changes. */ function ScrollRestoration(_ref10) { let { getKey, storageKey } = _ref10; useScrollRestoration({ getKey, storageKey }); return null; } if (false) {} //#endregion //////////////////////////////////////////////////////////////////////////////// //#region Hooks //////////////////////////////////////////////////////////////////////////////// var dist_DataRouterHook; (function (DataRouterHook) { DataRouterHook["UseScrollRestoration"] = "useScrollRestoration"; DataRouterHook["UseSubmit"] = "useSubmit"; DataRouterHook["UseSubmitFetcher"] = "useSubmitFetcher"; DataRouterHook["UseFetcher"] = "useFetcher"; DataRouterHook["useViewTransitionState"] = "useViewTransitionState"; })(dist_DataRouterHook || (dist_DataRouterHook = {})); var dist_DataRouterStateHook; (function (DataRouterStateHook) { DataRouterStateHook["UseFetcher"] = "useFetcher"; DataRouterStateHook["UseFetchers"] = "useFetchers"; DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration"; })(dist_DataRouterStateHook || (dist_DataRouterStateHook = {})); // Internal hooks function dist_getDataRouterConsoleError(hookName) { return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router."; } function dist_useDataRouterContext(hookName) { let ctx = external_React_.useContext(DataRouterContext); !ctx ? false ? 0 : router_invariant(false) : void 0; return ctx; } function dist_useDataRouterState(hookName) { let state = React.useContext(UNSAFE_DataRouterStateContext); !state ? false ? 0 : UNSAFE_invariant(false) : void 0; return state; } // External hooks /** * Handles the click behavior for router `<Link>` components. This is useful if * you need to create custom `<Link>` components with the same click behavior we * use in our exported `<Link>`. */ function useLinkClickHandler(to, _temp) { let { target, replace: replaceProp, state, preventScrollReset, relative, unstable_viewTransition } = _temp === void 0 ? {} : _temp; let navigate = useNavigate(); let location = dist_useLocation(); let path = dist_useResolvedPath(to, { relative }); return external_React_.useCallback(event => { if (shouldProcessLinkClick(event, target)) { event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of // a push, so do the same here unless the replace prop is explicitly set let replace = replaceProp !== undefined ? replaceProp : router_createPath(location) === router_createPath(path); navigate(to, { replace, state, preventScrollReset, relative, unstable_viewTransition }); } }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, unstable_viewTransition]); } /** * A convenient wrapper for reading and writing search parameters via the * URLSearchParams interface. */ function useSearchParams(defaultInit) { false ? 0 : void 0; let defaultSearchParamsRef = external_React_.useRef(createSearchParams(defaultInit)); let hasSetSearchParamsRef = external_React_.useRef(false); let location = dist_useLocation(); let searchParams = external_React_.useMemo(() => // Only merge in the defaults if we haven't yet called setSearchParams. // Once we call that we want those to take precedence, otherwise you can't // remove a param with setSearchParams({}) if it has an initial value getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]); let navigate = useNavigate(); let setSearchParams = external_React_.useCallback((nextInit, navigateOptions) => { const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit); hasSetSearchParamsRef.current = true; navigate("?" + newSearchParams, navigateOptions); }, [navigate, searchParams]); return [searchParams, setSearchParams]; } function validateClientSideSubmission() { if (typeof document === "undefined") { throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead."); } } let fetcherId = 0; let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__"; /** * Returns a function that may be used to programmatically submit a form (or * some arbitrary data) to the server. */ function useSubmit() { let { router } = dist_useDataRouterContext(dist_DataRouterHook.UseSubmit); let { basename } = React.useContext(UNSAFE_NavigationContext); let currentRouteId = UNSAFE_useRouteId(); return React.useCallback(function (target, options) { if (options === void 0) { options = {}; } validateClientSideSubmission(); let { action, method, encType, formData, body } = getFormSubmissionInfo(target, basename); if (options.navigate === false) { let key = options.fetcherKey || getUniqueFetcherId(); router.fetch(key, currentRouteId, options.action || action, { preventScrollReset: options.preventScrollReset, formData, body, formMethod: options.method || method, formEncType: options.encType || encType, unstable_flushSync: options.unstable_flushSync }); } else { router.navigate(options.action || action, { preventScrollReset: options.preventScrollReset, formData, body, formMethod: options.method || method, formEncType: options.encType || encType, replace: options.replace, state: options.state, fromRouteId: currentRouteId, unstable_flushSync: options.unstable_flushSync, unstable_viewTransition: options.unstable_viewTransition }); } }, [router, basename, currentRouteId]); } // v7: Eventually we should deprecate this entirely in favor of using the // router method directly? function useFormAction(action, _temp2) { let { relative } = _temp2 === void 0 ? {} : _temp2; let { basename } = React.useContext(UNSAFE_NavigationContext); let routeContext = React.useContext(UNSAFE_RouteContext); !routeContext ? false ? 0 : UNSAFE_invariant(false) : void 0; let [match] = routeContext.matches.slice(-1); // Shallow clone path so we can modify it below, otherwise we modify the // object referenced by useMemo inside useResolvedPath let path = react_router_dom_dist_extends({}, useResolvedPath(action ? action : ".", { relative })); // If no action was specified, browsers will persist current search params // when determining the path, so match that behavior // https://github.com/remix-run/remix/issues/927 let location = useLocation(); if (action == null) { // Safe to write to this directly here since if action was undefined, we // would have called useResolvedPath(".") which will never include a search path.search = location.search; // When grabbing search params from the URL, remove any included ?index param // since it might not apply to our contextual route. We add it back based // on match.route.index below let params = new URLSearchParams(path.search); if (params.has("index") && params.get("index") === "") { params.delete("index"); path.search = params.toString() ? "?" + params.toString() : ""; } } if ((!action || action === ".") && match.route.index) { path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; } // If we're operating within a basename, prepend it to the pathname prior // to creating the form action. If this is a root navigation, then just use // the raw basename which allows the basename to have full control over the // presence of a trailing slash on root actions if (basename !== "/") { path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); } return createPath(path); } // TODO: (v7) Change the useFetcher generic default from `any` to `unknown` /** * Interacts with route loaders and actions without causing a navigation. Great * for any interaction that stays on the same page. */ function useFetcher(_temp3) { var _route$matches; let { key } = _temp3 === void 0 ? {} : _temp3; let { router } = dist_useDataRouterContext(dist_DataRouterHook.UseFetcher); let state = dist_useDataRouterState(dist_DataRouterStateHook.UseFetcher); let fetcherData = React.useContext(FetchersContext); let route = React.useContext(UNSAFE_RouteContext); let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id; !fetcherData ? false ? 0 : UNSAFE_invariant(false) : void 0; !route ? false ? 0 : UNSAFE_invariant(false) : void 0; !(routeId != null) ? false ? 0 : UNSAFE_invariant(false) : void 0; // Fetcher key handling let [fetcherKey, setFetcherKey] = React.useState(key || ""); if (key && key !== fetcherKey) { setFetcherKey(key); } else if (!fetcherKey) { setFetcherKey(getUniqueFetcherId()); } // Registration/cleanup React.useEffect(() => { router.getFetcher(fetcherKey); return () => { // Tell the router we've unmounted - if v7_fetcherPersist is enabled this // will not delete immediately but instead queue up a delete after the // fetcher returns to an `idle` state router.deleteFetcher(fetcherKey); }; }, [router, fetcherKey]); // Fetcher additions let load = React.useCallback((href, opts) => { !routeId ? false ? 0 : UNSAFE_invariant(false) : void 0; router.fetch(fetcherKey, routeId, href, opts); }, [fetcherKey, routeId, router]); let submitImpl = useSubmit(); let submit = React.useCallback((target, opts) => { submitImpl(target, react_router_dom_dist_extends({}, opts, { navigate: false, fetcherKey })); }, [fetcherKey, submitImpl]); let FetcherForm = React.useMemo(() => { let FetcherForm = /*#__PURE__*/React.forwardRef((props, ref) => { return /*#__PURE__*/React.createElement(Form, react_router_dom_dist_extends({}, props, { navigate: false, fetcherKey: fetcherKey, ref: ref })); }); if (false) {} return FetcherForm; }, [fetcherKey]); // Exposed FetcherWithComponents let fetcher = state.fetchers.get(fetcherKey) || IDLE_FETCHER; let data = fetcherData.get(fetcherKey); let fetcherWithComponents = React.useMemo(() => react_router_dom_dist_extends({ Form: FetcherForm, submit, load }, fetcher, { data }), [FetcherForm, submit, load, fetcher, data]); return fetcherWithComponents; } /** * Provides all fetchers currently on the page. Useful for layouts and parent * routes that need to provide pending/optimistic UI regarding the fetch. */ function useFetchers() { let state = dist_useDataRouterState(dist_DataRouterStateHook.UseFetchers); return Array.from(state.fetchers.entries()).map(_ref11 => { let [key, fetcher] = _ref11; return react_router_dom_dist_extends({}, fetcher, { key }); }); } const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions"; let savedScrollPositions = {}; /** * When rendered inside a RouterProvider, will restore scroll positions on navigations */ function useScrollRestoration(_temp4) { let { getKey, storageKey } = _temp4 === void 0 ? {} : _temp4; let { router } = dist_useDataRouterContext(dist_DataRouterHook.UseScrollRestoration); let { restoreScrollPosition, preventScrollReset } = dist_useDataRouterState(dist_DataRouterStateHook.UseScrollRestoration); let { basename } = React.useContext(UNSAFE_NavigationContext); let location = useLocation(); let matches = useMatches(); let navigation = useNavigation(); // Trigger manual scroll restoration while we're active React.useEffect(() => { window.history.scrollRestoration = "manual"; return () => { window.history.scrollRestoration = "auto"; }; }, []); // Save positions on pagehide usePageHide(React.useCallback(() => { if (navigation.state === "idle") { let key = (getKey ? getKey(location, matches) : null) || location.key; savedScrollPositions[key] = window.scrollY; } try { sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions)); } catch (error) { false ? 0 : void 0; } window.history.scrollRestoration = "auto"; }, [storageKey, getKey, navigation.state, location, matches])); // Read in any saved scroll locations if (typeof document !== "undefined") { // eslint-disable-next-line react-hooks/rules-of-hooks React.useLayoutEffect(() => { try { let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY); if (sessionPositions) { savedScrollPositions = JSON.parse(sessionPositions); } } catch (e) { // no-op, use default empty object } }, [storageKey]); // Enable scroll restoration in the router // eslint-disable-next-line react-hooks/rules-of-hooks React.useLayoutEffect(() => { let getKeyWithoutBasename = getKey && basename !== "/" ? (location, matches) => getKey( // Strip the basename to match useLocation() react_router_dom_dist_extends({}, location, { pathname: stripBasename(location.pathname, basename) || location.pathname }), matches) : getKey; let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename); return () => disableScrollRestoration && disableScrollRestoration(); }, [router, basename, getKey]); // Restore scrolling when state.restoreScrollPosition changes // eslint-disable-next-line react-hooks/rules-of-hooks React.useLayoutEffect(() => { // Explicit false means don't do anything (used for submissions) if (restoreScrollPosition === false) { return; } // been here before, scroll to it if (typeof restoreScrollPosition === "number") { window.scrollTo(0, restoreScrollPosition); return; } // try to scroll to the hash if (location.hash) { let el = document.getElementById(decodeURIComponent(location.hash.slice(1))); if (el) { el.scrollIntoView(); return; } } // Don't reset if this navigation opted out if (preventScrollReset === true) { return; } // otherwise go to the top on new locations window.scrollTo(0, 0); }, [location, restoreScrollPosition, preventScrollReset]); } } /** * Setup a callback to be fired on the window's `beforeunload` event. This is * useful for saving some data to `window.localStorage` just before the page * refreshes. * * Note: The `callback` argument should be a function created with * `React.useCallback()`. */ function useBeforeUnload(callback, options) { let { capture } = options || {}; React.useEffect(() => { let opts = capture != null ? { capture } : undefined; window.addEventListener("beforeunload", callback, opts); return () => { window.removeEventListener("beforeunload", callback, opts); }; }, [callback, capture]); } /** * Setup a callback to be fired on the window's `pagehide` event. This is * useful for saving some data to `window.localStorage` just before the page * refreshes. This event is better supported than beforeunload across browsers. * * Note: The `callback` argument should be a function created with * `React.useCallback()`. */ function usePageHide(callback, options) { let { capture } = options || {}; React.useEffect(() => { let opts = capture != null ? { capture } : undefined; window.addEventListener("pagehide", callback, opts); return () => { window.removeEventListener("pagehide", callback, opts); }; }, [callback, capture]); } /** * Wrapper around useBlocker to show a window.confirm prompt to users instead * of building a custom UI with useBlocker. * * Warning: This has *a lot of rough edges* and behaves very differently (and * very incorrectly in some cases) across browsers if user click addition * back/forward navigations while the confirm is open. Use at your own risk. */ function usePrompt(_ref12) { let { when, message } = _ref12; let blocker = useBlocker(when); React.useEffect(() => { if (blocker.state === "blocked") { let proceed = window.confirm(message); if (proceed) { // This timeout is needed to avoid a weird "race" on POP navigations // between the `window.history` revert navigation and the result of // `window.confirm` setTimeout(blocker.proceed, 0); } else { blocker.reset(); } } }, [blocker, message]); React.useEffect(() => { if (blocker.state === "blocked" && !when) { blocker.reset(); } }, [blocker, when]); } /** * Return a boolean indicating if there is an active view transition to the * given href. You can use this value to render CSS classes or viewTransitionName * styles onto your elements * * @param href The destination href * @param [opts.relative] Relative routing type ("route" | "path") */ function useViewTransitionState(to, opts) { if (opts === void 0) { opts = {}; } let vtContext = external_React_.useContext(ViewTransitionContext); !(vtContext != null) ? false ? 0 : router_invariant(false) : void 0; let { basename } = dist_useDataRouterContext(dist_DataRouterHook.useViewTransitionState); let path = dist_useResolvedPath(to, { relative: opts.relative }); if (!vtContext.isTransitioning) { return false; } let currentPath = router_stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname; let nextPath = router_stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname; // Transition is active if we're going to or coming from the indicated // destination. This ensures that other PUSH navigations that reverse // an indicated transition apply. I.e., on the list view you have: // // <NavLink to="/details/1" unstable_viewTransition> // // If you click the breadcrumb back to the list view: // // <NavLink to="/list" unstable_viewTransition> // // We should apply the transition because it's indicated as active going // from /list -> /details/1 and therefore should be active on the reverse // (even though this isn't strictly a POP reverse) return router_matchPath(path.pathname, nextPath) != null || router_matchPath(path.pathname, currentPath) != null; } //#endregion //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/hooks/dist/chunk-6B2YUEGK.mjs 'use client' // src/use-id.ts ; function chunk_6B2YUEGK_useId(idProp, prefix) { const id = (0,external_React_.useId)(); return (0,external_React_.useMemo)( () => idProp || [prefix, id].filter(Boolean).join("-"), [idProp, prefix, id] ); } function useIds(idProp, ...prefixes) { const id = chunk_6B2YUEGK_useId(idProp); return useMemo(() => { return prefixes.map((prefix) => `${prefix}-${id}`); }, [id, prefixes]); } function useOptionalPart(partId) { const [id, setId] = useState(null); const ref = useCallback( (node) => { setId(node ? partId : null); }, [partId] ); return { ref, id, isRendered: Boolean(id) }; } //# sourceMappingURL=chunk-6B2YUEGK.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/hooks/dist/chunk-7JSBRQFI.mjs 'use client' ; // src/use-controllable.ts function useControllableProp(prop, state) { const isControlled = prop !== void 0; const value = isControlled && typeof prop !== "undefined" ? prop : state; return [isControlled, value]; } function chunk_7JSBRQFI_useControllableState(props) { const { value: valueProp, defaultValue, onChange, shouldUpdate = (prev, next) => prev !== next } = props; const onChangeProp = useCallbackRef(onChange); const shouldUpdateProp = useCallbackRef(shouldUpdate); const [valueState, setValue] = useState(defaultValue); const isControlled = valueProp !== void 0; const value = isControlled ? valueProp : valueState; const updateValue = useCallback( (next) => { const nextValue = runIfFn(next, value); if (!shouldUpdateProp(value, nextValue)) { return; } if (!isControlled) { setValue(nextValue); } onChangeProp(nextValue); }, [isControlled, onChangeProp, value, shouldUpdateProp] ); return [value, updateValue]; } //# sourceMappingURL=chunk-7JSBRQFI.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/utils/dist/chunk-O3SWHQEE.mjs // src/dom.ts function isElement(el) { return el != null && typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE; } function chunk_O3SWHQEE_isHTMLElement(el) { var _a; if (!isElement(el)) { return false; } const win = (_a = el.ownerDocument.defaultView) != null ? _a : window; return el instanceof win.HTMLElement; } function getOwnerWindow(node) { var _a, _b; return isElement(node) ? (_b = (_a = chunk_O3SWHQEE_getOwnerDocument(node)) == null ? void 0 : _a.defaultView) != null ? _b : window : window; } function chunk_O3SWHQEE_getOwnerDocument(node) { var _a; return isElement(node) ? (_a = node.ownerDocument) != null ? _a : document : document; } function getEventWindow(event) { var _a; return (_a = event.view) != null ? _a : window; } function canUseDOM() { return !!(typeof window !== "undefined" && window.document && window.document.createElement); } var chunk_O3SWHQEE_isBrowser = /* @__PURE__ */ canUseDOM(); var chunk_O3SWHQEE_dataAttr = (condition) => condition ? "" : void 0; var chunk_O3SWHQEE_ariaAttr = (condition) => condition ? true : void 0; var chunk_O3SWHQEE_cx = (...classNames) => classNames.filter(Boolean).join(" "); function getActiveElement(node) { const doc = chunk_O3SWHQEE_getOwnerDocument(node); return doc == null ? void 0 : doc.activeElement; } function contains(parent, child) { if (!parent) return false; return parent === child || parent.contains(child); } function chunk_O3SWHQEE_addDomEvent(target, eventName, handler, options) { target.addEventListener(eventName, handler, options); return () => { target.removeEventListener(eventName, handler, options); }; } function normalizeEventKey(event) { const { key, keyCode } = event; const isArrowKey = keyCode >= 37 && keyCode <= 40 && key.indexOf("Arrow") !== 0; const eventKey = isArrowKey ? `Arrow${key}` : key; return eventKey; } function getRelatedTarget(event) { var _a, _b; const target = (_a = event.target) != null ? _a : event.currentTarget; const activeElement = getActiveElement(target); return (_b = event.relatedTarget) != null ? _b : activeElement; } function isRightClick(event) { return event.button !== 0; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/hooks/dist/chunk-724WJZW4.mjs 'use client' // src/use-safe-layout-effect.ts ; var chunk_724WJZW4_useSafeLayoutEffect = chunk_O3SWHQEE_isBrowser ? external_React_.useLayoutEffect : external_React_.useEffect; //# sourceMappingURL=chunk-724WJZW4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/hooks/dist/chunk-KA2477BY.mjs 'use client' ; // src/use-callback-ref.ts function chunk_KA2477BY_useCallbackRef(fn, deps = []) { const ref = (0,external_React_.useRef)(fn); chunk_724WJZW4_useSafeLayoutEffect(() => { ref.current = fn; }); return (0,external_React_.useCallback)((...args) => { var _a; return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); }, deps); } //# sourceMappingURL=chunk-KA2477BY.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/hooks/dist/chunk-7JBTTEVG.mjs 'use client' ; // src/use-disclosure.ts function useDisclosure(props = {}) { const { onClose: onCloseProp, onOpen: onOpenProp, isOpen: isOpenProp, id: idProp } = props; const onOpenPropCallbackRef = chunk_KA2477BY_useCallbackRef(onOpenProp); const onClosePropCallbackRef = chunk_KA2477BY_useCallbackRef(onCloseProp); const [isOpenState, setIsOpen] = (0,external_React_.useState)(props.defaultIsOpen || false); const [isControlled, isOpen] = useControllableProp(isOpenProp, isOpenState); const id = chunk_6B2YUEGK_useId(idProp, "disclosure"); const onClose = (0,external_React_.useCallback)(() => { if (!isControlled) { setIsOpen(false); } onClosePropCallbackRef == null ? void 0 : onClosePropCallbackRef(); }, [isControlled, onClosePropCallbackRef]); const onOpen = (0,external_React_.useCallback)(() => { if (!isControlled) { setIsOpen(true); } onOpenPropCallbackRef == null ? void 0 : onOpenPropCallbackRef(); }, [isControlled, onOpenPropCallbackRef]); const onToggle = (0,external_React_.useCallback)(() => { const action = isOpen ? onClose : onOpen; action(); }, [isOpen, onOpen, onClose]); return { isOpen: !!isOpen, onOpen, onClose, onToggle, isControlled, getButtonProps: (props2 = {}) => ({ ...props2, "aria-expanded": isOpen, "aria-controls": id, onClick: chunk_M3TFMUOL_callAllHandlers(props2.onClick, onToggle) }), getDisclosureProps: (props2 = {}) => ({ ...props2, hidden: !isOpen, id }) }; } //# sourceMappingURL=chunk-7JBTTEVG.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-ZFQCCYWD.mjs 'use client' // src/stack/stack-item.tsx ; var StackItem = (props) => /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { className: "chakra-stack__item", ...props, __css: { display: "inline-block", flex: "0 0 auto", minWidth: 0, ...props["__css"] } } ); StackItem.displayName = "StackItem"; //# sourceMappingURL=chunk-ZFQCCYWD.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/breakpoint-utils/dist/chunk-G72KV6MB.mjs // src/responsive.ts var chunk_G72KV6MB_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 objectToArrayNotation(obj, bps = chunk_G72KV6MB_breakpoints) { const result = bps.map((br) => { var _a; return (_a = obj[br]) != null ? _a : null; }); const lastItem = result[result.length - 1]; while (lastItem === null) result.pop(); return result; } function arrayToObjectNotation(values, bps = chunk_G72KV6MB_breakpoints) { const result = {}; values.forEach((value, index) => { const key = bps[index]; if (value == null) return; result[key] = value; }); return result; } function isResponsiveObjectLike(obj, bps = chunk_G72KV6MB_breakpoints) { const keys = Object.keys(obj); return keys.length > 0 && keys.every((key) => bps.includes(key)); } var isCustomBreakpoint = (v) => Number.isNaN(Number(v)); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-5VJV6UNA.mjs 'use client' // src/stack/stack.utils.tsx ; function getDividerStyles(options) { const { spacing, direction } = options; const dividerStyles = { column: { my: spacing, mx: 0, borderLeftWidth: 0, borderBottomWidth: "1px" }, "column-reverse": { my: spacing, mx: 0, borderLeftWidth: 0, borderBottomWidth: "1px" }, row: { mx: spacing, my: 0, borderLeftWidth: "1px", borderBottomWidth: 0 }, "row-reverse": { mx: spacing, my: 0, borderLeftWidth: "1px", borderBottomWidth: 0 } }; return { "&": mapResponsive( direction, (value) => dividerStyles[value] ) }; } //# sourceMappingURL=chunk-5VJV6UNA.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-children-utils/dist/index.mjs // src/index.ts function dist_getValidChildren(children) { return external_React_.Children.toArray(children).filter( (child) => (0,external_React_.isValidElement)(child) ); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-ZHMYA64R.mjs 'use client' ; // src/stack/stack.tsx var Stack = forwardRef((props, ref) => { const { isInline, direction: directionProp, align, justify, spacing = "0.5rem", wrap, children, divider, className, shouldWrapChildren, ...rest } = props; const direction = isInline ? "row" : directionProp != null ? directionProp : "column"; const dividerStyle = (0,external_React_.useMemo)( () => getDividerStyles({ spacing, direction }), [spacing, direction] ); const hasDivider = !!divider; const shouldUseChildren = !shouldWrapChildren && !hasDivider; const clones = (0,external_React_.useMemo)(() => { const validChildren = dist_getValidChildren(children); return shouldUseChildren ? validChildren : validChildren.map((child, index) => { const key = typeof child.key !== "undefined" ? child.key : index; const isLast = index + 1 === validChildren.length; const wrappedChild = /* @__PURE__ */ (0,jsx_runtime.jsx)(StackItem, { children: child }, key); const _child = shouldWrapChildren ? wrappedChild : child; if (!hasDivider) return _child; const clonedDivider = (0,external_React_.cloneElement)( divider, { __css: dividerStyle } ); const _divider = isLast ? null : clonedDivider; return /* @__PURE__ */ (0,jsx_runtime.jsxs)(external_React_.Fragment, { children: [ _child, _divider ] }, key); }); }, [ divider, dividerStyle, hasDivider, shouldUseChildren, shouldWrapChildren, children ]); const _className = cx("chakra-stack", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, display: "flex", alignItems: align, justifyContent: justify, flexDirection: direction, flexWrap: wrap, gap: hasDivider ? void 0 : spacing, className: _className, ...rest, children: clones } ); }); Stack.displayName = "Stack"; //# sourceMappingURL=chunk-ZHMYA64R.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-K7XRJ7NL.mjs 'use client' // src/link.tsx ; var chunk_K7XRJ7NL_Link = forwardRef(function Link2(props, ref) { const styles = useStyleConfig("Link", props); const { className, isExternal, ...rest } = omitThemingProps(props); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.a, { target: isExternal ? "_blank" : void 0, rel: isExternal ? "noopener" : void 0, ref, className: cx("chakra-link", className), ...rest, __css: styles } ); }); chunk_K7XRJ7NL_Link.displayName = "Link"; //# sourceMappingURL=chunk-K7XRJ7NL.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tag/dist/chunk-RPO2WXNL.mjs 'use client' // src/tag.tsx ; var [TagStylesProvider, useTagStyles] = createContext({ name: `TagStylesContext`, errorMessage: `useTagStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tag />" ` }); var Tag = forwardRef((props, ref) => { const styles = useMultiStyleConfig("Tag", props); const ownProps = omitThemingProps(props); const containerStyles = { display: "inline-flex", verticalAlign: "top", alignItems: "center", maxWidth: "100%", ...styles.container }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(TagStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { ref, ...ownProps, __css: containerStyles }) }); }); Tag.displayName = "Tag"; var TagLabel = forwardRef((props, ref) => { const styles = useTagStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { ref, noOfLines: 1, ...props, __css: styles.label }); }); TagLabel.displayName = "TagLabel"; var TagLeftIcon = forwardRef((props, ref) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { ref, verticalAlign: "top", marginEnd: "0.5rem", ...props })); TagLeftIcon.displayName = "TagLeftIcon"; var TagRightIcon = forwardRef((props, ref) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { ref, verticalAlign: "top", marginStart: "0.5rem", ...props })); TagRightIcon.displayName = "TagRightIcon"; var TagCloseIcon = (props) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { verticalAlign: "inherit", viewBox: "0 0 512 512", ...props, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( "path", { fill: "currentColor", d: "M289.94 256l95-95A24 24 0 00351 127l-95 95-95-95a24 24 0 00-34 34l95 95-95 95a24 24 0 1034 34l95-95 95 95a24 24 0 0034-34z" } ) }); TagCloseIcon.displayName = "TagCloseIcon"; var TagCloseButton = forwardRef( (props, ref) => { const { isDisabled, children, ...rest } = props; const styles = useTagStyles(); const btnStyles = { display: "flex", alignItems: "center", justifyContent: "center", outline: "0", ...styles.closeButton }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.button, { ref, "aria-label": "close", ...rest, type: "button", disabled: isDisabled, __css: btnStyles, children: children || /* @__PURE__ */ (0,jsx_runtime.jsx)(TagCloseIcon, {}) } ); } ); TagCloseButton.displayName = "TagCloseButton"; //# sourceMappingURL=chunk-RPO2WXNL.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-J37R6SZE.mjs 'use client' // src/use-button-type.tsx ; function useButtonType(value) { const [isButton, setIsButton] = (0,external_React_.useState)(!value); const refCallback = (0,external_React_.useCallback)((node) => { if (!node) return; setIsButton(node.tagName === "BUTTON"); }, []); const type = isButton ? "button" : void 0; return { ref: refCallback, type }; } //# sourceMappingURL=chunk-J37R6SZE.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-T6ZDZOLO.mjs 'use client' // src/button-context.ts ; var [ButtonGroupProvider, useButtonGroup] = createContext({ strict: false, name: "ButtonGroupContext" }); //# sourceMappingURL=chunk-T6ZDZOLO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-3RENZ2UO.mjs 'use client' // src/button-icon.tsx ; function ButtonIcon(props) { const { children, className, ...rest } = props; const _children = (0,external_React_.isValidElement)(children) ? (0,external_React_.cloneElement)(children, { "aria-hidden": true, focusable: false }) : children; const _className = cx("chakra-button__icon", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { display: "inline-flex", alignSelf: "center", flexShrink: 0, ...rest, className: _className, children: _children } ); } ButtonIcon.displayName = "ButtonIcon"; //# sourceMappingURL=chunk-3RENZ2UO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-QB2Y5VKH.mjs 'use client' // src/button-spinner.tsx ; function ButtonSpinner(props) { const { label, placement, spacing = "0.5rem", children = /* @__PURE__ */ (0,jsx_runtime.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,external_React_.useMemo)( () => ({ display: "flex", alignItems: "center", position: label ? "relative" : "absolute", [marginProp]: label ? spacing : 0, fontSize: "1em", lineHeight: "normal", ...__css }), [__css, label, marginProp, spacing] ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.div, { className: _className, ...rest, __css: spinnerStyles, children }); } ButtonSpinner.displayName = "ButtonSpinner"; //# sourceMappingURL=chunk-QB2Y5VKH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-merge-refs/dist/index.mjs 'use client' // src/index.ts ; 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 (node) => { refs.forEach((ref) => { assignRef(ref, node); }); }; } function useMergeRefs(...refs) { return (0,external_React_.useMemo)(() => mergeRefs(...refs), refs); } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-UVUR7MCU.mjs 'use client' ; // src/button.tsx var Button = forwardRef((props, ref) => { const group = useButtonGroup(); const styles = useStyleConfig("Button", { ...group, ...props }); const { isDisabled = group == null ? void 0 : group.isDisabled, isLoading, isActive, children, leftIcon, rightIcon, loadingText, iconSpacing = "0.5rem", type, spinner, spinnerPlacement = "start", className, as, ...rest } = omitThemingProps(props); const buttonStyles = (0,external_React_.useMemo)(() => { const _focus = { ...styles == null ? void 0 : styles["_focus"], zIndex: 1 }; return { display: "inline-flex", appearance: "none", alignItems: "center", justifyContent: "center", userSelect: "none", position: "relative", whiteSpace: "nowrap", verticalAlign: "middle", outline: "none", ...styles, ...!!group && { _focus } }; }, [styles, group]); const { ref: _ref, type: defaultType } = useButtonType(as); const contentProps = { rightIcon, leftIcon, iconSpacing, children }; return /* @__PURE__ */ (0,jsx_runtime.jsxs)( chakra.button, { ref: useMergeRefs(ref, _ref), as, type: type != null ? type : defaultType, "data-active": dataAttr(isActive), "data-loading": dataAttr(isLoading), __css: buttonStyles, className: cx("chakra-button", className), ...rest, disabled: isDisabled || isLoading, children: [ isLoading && spinnerPlacement === "start" && /* @__PURE__ */ (0,jsx_runtime.jsx)( ButtonSpinner, { className: "chakra-button__spinner--start", label: loadingText, placement: "start", spacing: iconSpacing, children: spinner } ), isLoading ? loadingText || /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { opacity: 0, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(ButtonContent, { ...contentProps }) }) : /* @__PURE__ */ (0,jsx_runtime.jsx)(ButtonContent, { ...contentProps }), isLoading && spinnerPlacement === "end" && /* @__PURE__ */ (0,jsx_runtime.jsx)( ButtonSpinner, { className: "chakra-button__spinner--end", label: loadingText, placement: "end", spacing: iconSpacing, children: spinner } ) ] } ); }); Button.displayName = "Button"; function ButtonContent(props) { const { leftIcon, rightIcon, children, iconSpacing } = props; return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ leftIcon && /* @__PURE__ */ (0,jsx_runtime.jsx)(ButtonIcon, { marginEnd: iconSpacing, children: leftIcon }), children, rightIcon && /* @__PURE__ */ (0,jsx_runtime.jsx)(ButtonIcon, { marginStart: iconSpacing, children: rightIcon }) ] }); } //# sourceMappingURL=chunk-UVUR7MCU.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-5WQ4PXEV.mjs 'use client' 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; }; //# sourceMappingURL=chunk-5WQ4PXEV.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-CYRBRIA2.mjs 'use client' ; // src/modal-manager.ts var ModalManager = class { constructor() { __publicField(this, "modals"); this.modals = /* @__PURE__ */ new Map(); } add(modal) { this.modals.set(modal, this.modals.size + 1); return this.modals.size; } remove(modal) { this.modals.delete(modal); } isTopModal(modal) { if (!modal) return false; return this.modals.get(modal) === this.modals.size; } }; var modalManager = new ModalManager(); function useModalManager(ref, isOpen) { const [index, setIndex] = (0,external_React_.useState)(0); (0,external_React_.useEffect)(() => { const node = ref.current; if (!node) return; if (isOpen) { const index2 = modalManager.add(node); setIndex(index2); } return () => { modalManager.remove(node); setIndex(0); }; }, [isOpen, ref]); return index; } //# sourceMappingURL=chunk-CYRBRIA2.mjs.map ;// CONCATENATED MODULE: ./node_modules/aria-hidden/dist/es2015/index.js var getDefaultParent = function (originalTarget) { if (typeof document === 'undefined') { return null; } var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; return sampleTarget.ownerDocument.body; }; var counterMap = new WeakMap(); var uncontrolledNodes = new WeakMap(); var markerMap = {}; var lockCount = 0; var unwrapHost = function (node) { return node && (node.host || unwrapHost(node.parentNode)); }; var correctTargets = function (parent, targets) { return targets .map(function (target) { if (parent.contains(target)) { return target; } var correctedTarget = unwrapHost(target); if (correctedTarget && parent.contains(correctedTarget)) { return correctedTarget; } console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); return null; }) .filter(function (x) { return Boolean(x); }); }; /** * Marks everything except given node(or nodes) as aria-hidden * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @param {String} [controlAttribute] - html Attribute to control * @return {Undo} undo command */ var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); if (!markerMap[markerName]) { markerMap[markerName] = new WeakMap(); } var markerCounter = markerMap[markerName]; var hiddenNodes = []; var elementsToKeep = new Set(); var elementsToStop = new Set(targets); var keep = function (el) { if (!el || elementsToKeep.has(el)) { return; } elementsToKeep.add(el); keep(el.parentNode); }; targets.forEach(keep); var deep = function (parent) { if (!parent || elementsToStop.has(parent)) { return; } Array.prototype.forEach.call(parent.children, function (node) { if (elementsToKeep.has(node)) { deep(node); } else { var attr = node.getAttribute(controlAttribute); var alreadyHidden = attr !== null && attr !== 'false'; var counterValue = (counterMap.get(node) || 0) + 1; var markerValue = (markerCounter.get(node) || 0) + 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); hiddenNodes.push(node); if (counterValue === 1 && alreadyHidden) { uncontrolledNodes.set(node, true); } if (markerValue === 1) { node.setAttribute(markerName, 'true'); } if (!alreadyHidden) { node.setAttribute(controlAttribute, 'true'); } } }); }; deep(parentNode); elementsToKeep.clear(); lockCount++; return function () { hiddenNodes.forEach(function (node) { var counterValue = counterMap.get(node) - 1; var markerValue = markerCounter.get(node) - 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); if (!counterValue) { if (!uncontrolledNodes.has(node)) { node.removeAttribute(controlAttribute); } uncontrolledNodes.delete(node); } if (!markerValue) { node.removeAttribute(markerName); } }); lockCount--; if (!lockCount) { // clear counterMap = new WeakMap(); counterMap = new WeakMap(); uncontrolledNodes = new WeakMap(); markerMap = {}; } }; }; /** * Marks everything except given node(or nodes) as aria-hidden * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ var hideOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-aria-hidden'; } var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); var activeParentNode = parentNode || getDefaultParent(originalTarget); if (!activeParentNode) { return function () { return null; }; } // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); }; /** * Marks everything except given node(or nodes) as inert * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ var inertOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-inert-ed'; } var activeParentNode = parentNode || getDefaultParent(originalTarget); if (!activeParentNode) { return function () { return null; }; } return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); }; /** * @returns if current browser supports inert */ var supportsInert = function () { return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); }; /** * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ var suppressOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-suppressed'; } return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); }; ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-TJ2Q5ITW.mjs 'use client' ; // src/use-modal.ts function useModal(props) { const { isOpen, onClose, id, closeOnOverlayClick = true, closeOnEsc = true, useInert = true, onOverlayClick: onOverlayClickProp, onEsc } = props; const dialogRef = (0,external_React_.useRef)(null); const overlayRef = (0,external_React_.useRef)(null); const [dialogId, headerId, bodyId] = chunk_TJ2Q5ITW_useIds( id, `chakra-modal`, `chakra-modal--header`, `chakra-modal--body` ); useAriaHidden(dialogRef, isOpen && useInert); const index = useModalManager(dialogRef, isOpen); const mouseDownTarget = (0,external_React_.useRef)(null); const onMouseDown = (0,external_React_.useCallback)((event) => { mouseDownTarget.current = event.target; }, []); const onKeyDown = (0,external_React_.useCallback)( (event) => { if (event.key === "Escape") { event.stopPropagation(); if (closeOnEsc) { onClose == null ? void 0 : onClose(); } onEsc == null ? void 0 : onEsc(); } }, [closeOnEsc, onClose, onEsc] ); const [headerMounted, setHeaderMounted] = (0,external_React_.useState)(false); const [bodyMounted, setBodyMounted] = (0,external_React_.useState)(false); const getDialogProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => ({ role: "dialog", ...props2, ref: mergeRefs(ref, dialogRef), id: dialogId, tabIndex: -1, "aria-modal": true, "aria-labelledby": headerMounted ? headerId : void 0, "aria-describedby": bodyMounted ? bodyId : void 0, onClick: callAllHandlers( props2.onClick, (event) => event.stopPropagation() ) }), [bodyId, bodyMounted, dialogId, headerId, headerMounted] ); const onOverlayClick = (0,external_React_.useCallback)( (event) => { event.stopPropagation(); if (mouseDownTarget.current !== event.target) return; if (!modalManager.isTopModal(dialogRef.current)) return; if (closeOnOverlayClick) { onClose == null ? void 0 : onClose(); } onOverlayClickProp == null ? void 0 : onOverlayClickProp(); }, [onClose, closeOnOverlayClick, onOverlayClickProp] ); const getDialogContainerProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => ({ ...props2, ref: mergeRefs(ref, overlayRef), onClick: callAllHandlers(props2.onClick, onOverlayClick), onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDown), onMouseDown: callAllHandlers(props2.onMouseDown, onMouseDown) }), [onKeyDown, onMouseDown, onOverlayClick] ); return { isOpen, onClose, headerId, bodyId, setBodyMounted, setHeaderMounted, dialogRef, overlayRef, getDialogProps, getDialogContainerProps, index }; } function useAriaHidden(ref, shouldHide) { const currentElement = ref.current; (0,external_React_.useEffect)(() => { if (!ref.current || !shouldHide) return void 0; return hideOthers(ref.current); }, [shouldHide, ref, currentElement]); } function chunk_TJ2Q5ITW_useIds(idProp, ...prefixes) { const reactId = (0,external_React_.useId)(); const id = idProp || reactId; return (0,external_React_.useMemo)(() => { return prefixes.map((prefix) => `${prefix}-${id}`); }, [id, prefixes]); } //# sourceMappingURL=chunk-TJ2Q5ITW.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-MSA2NPQT.mjs 'use client' ; // src/modal.tsx var [ModalStylesProvider, useModalStyles] = createContext({ name: `ModalStylesContext`, errorMessage: `useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" ` }); var [ModalContextProvider, useModalContext] = createContext({ strict: true, name: "ModalContext", errorMessage: "useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`" }); var Modal = (props) => { const modalProps = { scrollBehavior: "outside", autoFocus: true, trapFocus: true, returnFocusOnClose: true, blockScrollOnMount: true, allowPinchZoom: false, motionPreset: "scale", lockFocusAcrossFrames: true, ...props }; const { portalProps, children, autoFocus, trapFocus, initialFocusRef, finalFocusRef, returnFocusOnClose, blockScrollOnMount, allowPinchZoom, preserveScrollBarGap, motionPreset, lockFocusAcrossFrames, onCloseComplete } = modalProps; const styles = useMultiStyleConfig("Modal", modalProps); const modal = useModal(modalProps); const context = { ...modal, autoFocus, trapFocus, initialFocusRef, finalFocusRef, returnFocusOnClose, blockScrollOnMount, allowPinchZoom, preserveScrollBarGap, motionPreset, lockFocusAcrossFrames }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(ModalContextProvider, { value: context, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(ModalStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { onExitComplete: onCloseComplete, children: context.isOpen && /* @__PURE__ */ (0,jsx_runtime.jsx)(Portal, { ...portalProps, children }) }) }) }); }; Modal.displayName = "Modal"; //# sourceMappingURL=chunk-MSA2NPQT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-MCHDHFCQ.mjs 'use client' ; // src/drawer.tsx var [DrawerContextProvider, useDrawerContext] = createContext(); var placementMap = { start: { ltr: "left", rtl: "right" }, end: { ltr: "right", rtl: "left" } }; function getDrawerPlacement(placement, dir) { var _a, _b; if (!placement) return; return (_b = (_a = placementMap[placement]) == null ? void 0 : _a[dir]) != null ? _b : placement; } function Drawer(props) { var _a; const { isOpen, onClose, placement: placementProp = "right", children, ...rest } = props; const theme = chunk_UIGT7YZF_useTheme(); const drawerStyleConfig = (_a = theme.components) == null ? void 0 : _a.Drawer; const placement = getDrawerPlacement(placementProp, theme.direction); return /* @__PURE__ */ (0,jsx_runtime.jsx)(DrawerContextProvider, { value: { placement }, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( Modal, { isOpen, onClose, styleConfig: drawerStyleConfig, ...rest, children } ) }); } //# sourceMappingURL=chunk-MCHDHFCQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-6NHXDBFO.mjs 'use client' // src/transition-utils.ts 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) { var _a; const side = (_a = options == null ? void 0 : options.direction) != null ? _a : "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: (transition, delay) => ({ ...transition, delay: typeof delay === "number" ? delay : delay == null ? void 0 : delay["enter"] }), exit: (transition, delay) => ({ ...transition, delay: typeof delay === "number" ? delay : delay == null ? void 0 : delay["exit"] }) }; //# sourceMappingURL=chunk-6NHXDBFO.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-TR226DUX.mjs 'use client' ; // src/fade.tsx var chunk_TR226DUX_variants = { enter: ({ transition, transitionEnd, delay } = {}) => { var _a; return { opacity: 1, transition: (_a = transition == null ? void 0 : transition.enter) != null ? _a : withDelay.enter(TRANSITION_DEFAULTS.enter, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter }; }, exit: ({ transition, transitionEnd, delay } = {}) => { var _a; return { opacity: 0, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(TRANSITION_DEFAULTS.exit, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit }; } }; var fadeConfig = { initial: "exit", animate: "enter", exit: "exit", variants: chunk_TR226DUX_variants }; var Fade = (0,external_React_.forwardRef)(function Fade2(props, ref) { const { unmountOnExit, in: isOpen, className, transition, transitionEnd, delay, ...rest } = props; const animate = isOpen || unmountOnExit ? "enter" : "exit"; const show = unmountOnExit ? isOpen && unmountOnExit : true; const custom = { transition, transitionEnd, delay }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { custom, children: show && /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { ref, className: cx("chakra-fade", className), custom, ...fadeConfig, animate, ...rest } ) }); }); Fade.displayName = "Fade"; //# sourceMappingURL=chunk-TR226DUX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-JQMJHPZH.mjs 'use client' ; // src/modal-overlay.tsx var MotionDiv = chakra(motion.div); var ModalOverlay = forwardRef( (props, ref) => { const { className, transition, motionProps: _motionProps, ...rest } = props; const _className = cx("chakra-modal__overlay", className); const styles = useModalStyles(); const overlayStyle = { pos: "fixed", left: "0", top: "0", w: "100vw", h: "100vh", ...styles.overlay }; const { motionPreset } = useModalContext(); const defaultMotionProps = motionPreset === "none" ? {} : fadeConfig; const motionProps = _motionProps || defaultMotionProps; return /* @__PURE__ */ (0,jsx_runtime.jsx)( MotionDiv, { ...motionProps, __css: overlayStyle, ref, className: _className, ...rest } ); } ); ModalOverlay.displayName = "ModalOverlay"; //# sourceMappingURL=chunk-JQMJHPZH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js function objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js function helpers_esm_extends_extends() { helpers_esm_extends_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return helpers_esm_extends_extends.apply(this, arguments); } ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/constants.js /** * defines a focus group */ var FOCUS_GROUP = 'data-focus-lock'; /** * disables element discovery inside a group marked by key */ var FOCUS_DISABLED = 'data-focus-lock-disabled'; /** * allows uncontrolled focus within the marked area, effectively disabling focus lock for it's content */ var FOCUS_ALLOW = 'data-no-focus-lock'; /** * instructs autofocus engine to pick default autofocus inside a given node * can be set on the element or container */ var FOCUS_AUTO = 'data-autofocus-inside'; /** * instructs autofocus to ignore elements within a given node * can be set on the element or container */ var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus'; ;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/assignRef.js /** * Assigns a value for a given ref, no matter of the ref format * @param {RefObject} ref - a callback function or ref object * @param value - a new value * * @see https://github.com/theKashey/use-callback-ref#assignref * @example * const refObject = useRef(); * const refFn = (ref) => {....} * * assignRef(refObject, "refValue"); * assignRef(refFn, "refValue"); */ function assignRef_assignRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } return ref; } ;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useRef.js /** * creates a MutableRef with ref change callback * @param initialValue - initial ref value * @param {Function} callback - a callback to run when value changes * * @example * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue); * ref.current = 1; * // prints 0 -> 1 * * @see https://reactjs.org/docs/hooks-reference.html#useref * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref * @returns {MutableRefObject} */ function useRef_useCallbackRef(initialValue, callback) { var ref = (0,external_React_.useState)(function () { return ({ // value value: initialValue, // last callback 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]; // update callback ref.callback = callback; return ref.facade; } ;// CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js /** * Merges two or more refs together providing a single interface to set their value * @param {RefObject|Ref} refs * @returns {MutableRefObject} - a new ref, which translates all changes to {refs} * * @see {@link mergeRefs} a version without buit-in memoization * @see https://github.com/theKashey/use-callback-ref#usemergerefs * @example * const Component = React.forwardRef((props, ref) => { * const ownRef = useRef(); * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together * return <div ref={domRef}>...</div> * } */ function useMergeRef_useMergeRefs(refs, defaultValue) { return useRef_useCallbackRef(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef_assignRef(ref, newValue); }); }); } ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/FocusGuard.js var hiddenGuard = { width: '1px', height: '0px', padding: 0, overflow: 'hidden', position: 'fixed', top: '1px', left: '1px' }; var InFocusGuard = function InFocusGuard(_ref) { var children = _ref.children; return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, /*#__PURE__*/external_React_.createElement("div", { key: "guard-first", "data-focus-guard": true, "data-focus-auto-guard": true, style: hiddenGuard }), children, children && /*#__PURE__*/external_React_.createElement("div", { key: "guard-last", "data-focus-guard": true, "data-focus-auto-guard": true, style: hiddenGuard })); }; InFocusGuard.propTypes = false ? 0 : {}; InFocusGuard.defaultProps = { children: null }; /* harmony default export */ const FocusGuard = ((/* unused pure expression or super */ null && (InFocusGuard))); ;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/medium.js function ItoI(a) { return a; } function innerCreateMedium(defaults, middleware) { if (middleware === void 0) { middleware = 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 defaults; }, useMedium: function (data) { var item = middleware(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 cbs = pendingQueue; pendingQueue = []; cbs.forEach(cb); }; var cycle = function () { return Promise.resolve().then(executeQueue); }; cycle(); buffer = { push: function (x) { pendingQueue.push(x); cycle(); }, filter: function (filter) { pendingQueue = pendingQueue.filter(filter); return buffer; }, }; }, }; return medium; } function createMedium(defaults, middleware) { if (middleware === void 0) { middleware = ItoI; } return innerCreateMedium(defaults, middleware); } // eslint-disable-next-line @typescript-eslint/ban-types function createSidecarMedium(options) { if (options === void 0) { options = {}; } var medium = innerCreateMedium(null); medium.options = __assign({ async: true, ssr: false }, options); return medium; } ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/medium.js var mediumFocus = createMedium({}, function (_ref) { var target = _ref.target, currentTarget = _ref.currentTarget; return { target: target, currentTarget: currentTarget }; }); var mediumBlur = createMedium(); var mediumEffect = createMedium(); var mediumSidecar = createSidecarMedium({ async: true // focus-lock sidecar is not required on the server // however, it might be required for JSDOM tests // ssr: true, }); ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/Lock.js var emptyArray = []; var FocusLock = /*#__PURE__*/external_React_.forwardRef(function FocusLockUI(props, parentRef) { var _extends2; var _React$useState = external_React_.useState(), realObserved = _React$useState[0], setObserved = _React$useState[1]; var observed = external_React_.useRef(); var isActive = external_React_.useRef(false); var originalFocusedElement = external_React_.useRef(null); var children = props.children, disabled = props.disabled, noFocusGuards = props.noFocusGuards, persistentFocus = props.persistentFocus, crossFrame = props.crossFrame, autoFocus = 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, Container = _props$as === void 0 ? 'div' : _props$as, _props$lockProps = props.lockProps, containerProps = _props$lockProps === void 0 ? {} : _props$lockProps, SideCar = props.sideCar, shouldReturnFocus = props.returnFocus, focusOptions = props.focusOptions, onActivationCallback = props.onActivation, onDeactivationCallback = props.onDeactivation; var _React$useState2 = external_React_.useState({}), id = _React$useState2[0]; // SIDE EFFECT CALLBACKS var onActivation = external_React_.useCallback(function () { originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement; if (observed.current && onActivationCallback) { onActivationCallback(observed.current); } isActive.current = true; }, [onActivationCallback]); var onDeactivation = external_React_.useCallback(function () { isActive.current = false; if (onDeactivationCallback) { onDeactivationCallback(observed.current); } }, [onDeactivationCallback]); (0,external_React_.useEffect)(function () { if (!disabled) { // cleanup return focus on trap deactivation // sideEffect/returnFocus should happen by this time originalFocusedElement.current = null; } }, []); var returnFocus = external_React_.useCallback(function (allowDefer) { var returnFocusTo = originalFocusedElement.current; if (returnFocusTo && returnFocusTo.focus) { var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus; if (howToReturnFocus) { var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined; originalFocusedElement.current = null; if (allowDefer) { // React might return focus after update // it's safer to defer the action Promise.resolve().then(function () { return returnFocusTo.focus(returnFocusOptions); }); } else { returnFocusTo.focus(returnFocusOptions); } } } }, [shouldReturnFocus]); // MEDIUM CALLBACKS var onFocus = external_React_.useCallback(function (event) { if (isActive.current) { mediumFocus.useMedium(event); } }, []); var onBlur = mediumBlur.useMedium; // REF PROPAGATION // not using real refs due to race conditions var setObserveNode = external_React_.useCallback(function (newObserved) { if (observed.current !== newObserved) { observed.current = newObserved; setObserved(newObserved); } }, []); if (false) {} var lockProps = helpers_esm_extends_extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && 'disabled', _extends2[FOCUS_GROUP] = group, _extends2), containerProps); var hasLeadingGuards = noFocusGuards !== true; var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail'; var mergedRef = useMergeRef_useMergeRefs([parentRef, setObserveNode]); return /*#__PURE__*/external_React_.createElement(external_React_.Fragment, null, hasLeadingGuards && [ /*#__PURE__*/ // nearest focus guard external_React_.createElement("div", { key: "guard-first", "data-focus-guard": true, tabIndex: disabled ? -1 : 0, style: hiddenGuard }), // first tabbed element guard hasPositiveIndices ? /*#__PURE__*/external_React_.createElement("div", { key: "guard-nearest", "data-focus-guard": true, tabIndex: disabled ? -1 : 1, style: hiddenGuard }) : null], !disabled && /*#__PURE__*/external_React_.createElement(SideCar, { id: id, sideCar: mediumSidecar, observed: realObserved, disabled: disabled, persistentFocus: persistentFocus, crossFrame: crossFrame, autoFocus: autoFocus, whiteList: whiteList, shards: shards, onActivation: onActivation, onDeactivation: onDeactivation, returnFocus: returnFocus, focusOptions: focusOptions }), /*#__PURE__*/external_React_.createElement(Container, helpers_esm_extends_extends({ ref: mergedRef }, lockProps, { className: className, onBlur: onBlur, onFocus: onFocus }), children), hasTailingGuards && /*#__PURE__*/external_React_.createElement("div", { "data-focus-guard": true, tabIndex: disabled ? -1 : 0, style: hiddenGuard })); }); FocusLock.propTypes = false ? 0 : {}; FocusLock.defaultProps = { children: undefined, disabled: false, returnFocus: false, focusOptions: undefined, noFocusGuards: false, autoFocus: true, persistentFocus: false, crossFrame: true, hasPositiveIndices: undefined, allowTextSelection: undefined, group: undefined, className: undefined, whiteList: undefined, shards: undefined, as: 'div', lockProps: {}, onActivation: undefined, onDeactivation: undefined }; /* harmony default export */ const Lock = (FocusLock); ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/typeof.js function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/toPrimitive.js function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/node_modules/@babel/runtime/helpers/esm/defineProperty.js function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } ;// CONCATENATED MODULE: ./node_modules/react-clientside-effect/lib/index.es.js function withSideEffect(reducePropsToState, handleStateChangeOnClient) { if (false) {} function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || 'Component'; } return function wrap(WrappedComponent) { if (false) {} var mountedInstances = []; var state; function emitChange() { state = reducePropsToState(mountedInstances.map(function (instance) { return instance.props; })); handleStateChangeOnClient(state); } var SideEffect = /*#__PURE__*/function (_PureComponent) { _inheritsLoose(SideEffect, _PureComponent); function SideEffect() { return _PureComponent.apply(this, arguments) || this; } // Try to use displayName of wrapped component SideEffect.peek = function peek() { return state; }; var _proto = SideEffect.prototype; _proto.componentDidMount = function componentDidMount() { mountedInstances.push(this); emitChange(); }; _proto.componentDidUpdate = function componentDidUpdate() { emitChange(); }; _proto.componentWillUnmount = function componentWillUnmount() { var index = mountedInstances.indexOf(this); mountedInstances.splice(index, 1); emitChange(); }; _proto.render = function render() { return /*#__PURE__*/external_React_default().createElement(WrappedComponent, this.props); }; return SideEffect; }(external_React_.PureComponent); _defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")"); return SideEffect; }; } /* harmony default export */ const index_es = (withSideEffect); ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/array.js /* IE11 support */ 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); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/is.js var isElementHidden = function (node) { // we can measure only "elements" // consider others as "visible" if (node.nodeType !== Node.ELEMENT_NODE) { return false; } var computedStyle = window.getComputedStyle(node, null); if (!computedStyle || !computedStyle.getPropertyValue) { return false; } return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden'); }; var getParentNode = function (node) { // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? // eslint-disable-next-line @typescript-eslint/no-explicit-any node.parentNode.host : node.parentNode; }; var isTopNode = function (node) { // @ts-ignore return node === document || (node && node.nodeType === Node.DOCUMENT_NODE); }; var isVisibleUncached = function (node, checkParent) { return !node || isTopNode(node) || (!isElementHidden(node) && checkParent(getParentNode(node))); }; var isVisibleCached = function (visibilityCache, node) { var cached = visibilityCache.get(node); if (cached !== undefined) { return cached; } var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache)); visibilityCache.set(node, result); return result; }; var isAutoFocusAllowedUncached = function (node, checkParent) { return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true; }; var isAutoFocusAllowedCached = function (cache, node) { var cached = cache.get(node); if (cached !== undefined) { return cached; } var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache)); cache.set(node, result); return result; }; var getDataset = function (node) { // @ts-ignore return node.dataset; }; var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; }; var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; }; var isRadioElement = function (node) { return isHTMLInputElement(node) && node.type === 'radio'; }; var notHiddenInput = function (node) { return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled)); }; var isAutoFocusAllowed = function (node) { var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS); return ![true, 'true', ''].includes(attribute); }; var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); }; var isNotAGuard = function (node) { return !isGuard(node); }; var is_isDefined = function (x) { return Boolean(x); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/tabOrder.js var tabSort = function (a, b) { var tabDiff = a.tabIndex - b.tabIndex; var indexDiff = a.index - b.index; if (tabDiff) { if (!a.tabIndex) { return 1; } if (!b.tabIndex) { return -1; } } return tabDiff || indexDiff; }; var orderByTabIndex = function (nodes, filterNegative, keepGuards) { return toArray(nodes) .map(function (node, index) { return ({ node: node, index: index, tabIndex: keepGuards && node.tabIndex === -1 ? ((node.dataset || {}).focusGuard ? 0 : -1) : node.tabIndex, }); }) .filter(function (data) { return !filterNegative || data.tabIndex >= 0; }) .sort(tabSort); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/tabbables.js /** * list of the object to be considered as focusable */ 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]', ]; ;// CONCATENATED MODULE: ./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 _a; // contentDocument of iframe will be null if current origin cannot access it if (parent instanceof HTMLIFrameElement && ((_a = parent.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) { return getFocusables([parent.contentDocument.body], withGuards); } return [parent]; }; var getFocusables = function (parents, withGuards) { return parents.reduce(function (acc, parent) { var _a; var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards); var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) { return getFocusablesWithIFrame(node, 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 (node) { return node === parent; }) : []); }, []); }; /** * return a list of focusable nodes within an area marked as "auto-focusable" * @param parent */ var getParentAutofocusables = function (parent) { var parentFocus = parent.querySelectorAll("[".concat(FOCUS_AUTO, "]")); return toArray(parentFocus) .map(function (node) { return getFocusables([node]); }) .reduce(function (acc, nodes) { return acc.concat(nodes); }, []); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/DOMutils.js /** * given list of focusable elements keeps the ones user can interact with * @param nodes * @param visibilityCache */ var filterFocusable = function (nodes, visibilityCache) { return toArray(nodes) .filter(function (node) { return isVisibleCached(visibilityCache, node); }) .filter(function (node) { return notHiddenInput(node); }); }; var filterAutoFocusable = function (nodes, cache) { if (cache === void 0) { cache = new Map(); } return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); }); }; /** * !__WARNING__! Low level API. * @returns all tabbable nodes * * @see {@link getFocusableNodes} to get any focusable element * * @param topNodes - array of top level HTMLElements to search inside * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call */ var getTabbableNodes = function (topNodes, visibilityCache, withGuards) { return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards); }; /** * !__WARNING__! Low level API. * * @returns anything "focusable", not only tabbable. The difference is in `tabIndex=-1` * (without guards, as long as they are not expected to be ever focused) * * @see {@link getTabbableNodes} to get only tabble nodes element * * @param topNodes - array of top level HTMLElements to search inside * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call */ var getFocusableNodes = function (topNodes, visibilityCache) { return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false); }; /** * return list of nodes which are expected to be auto-focused * @param topNode * @param visibilityCache */ var parentAutofocusables = function (topNode, visibilityCache) { return filterFocusable(getParentAutofocusables(topNode), visibilityCache); }; /* * Determines if element is contained in scope, including nested shadow DOMs */ var DOMutils_contains = function (scope, element) { if (scope.shadowRoot) { return DOMutils_contains(scope.shadowRoot, element); } else { if (Object.getPrototypeOf(scope).contains !== undefined && Object.getPrototypeOf(scope).contains.call(scope, element)) { return true; } return toArray(scope.children).some(function (child) { var _a; if (child instanceof HTMLIFrameElement) { var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body; if (iframeBody) { return DOMutils_contains(iframeBody, element); } return false; } return DOMutils_contains(child, element); }); } }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/safe.js var safeProbe = function (cb) { try { return cb(); } catch (e) { return undefined; } }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/getActiveElement.js /** * returns active element from document or from nested shadowdoms */ /** * returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it * @param [inDocument] */ var getActiveElement_getActiveElement = function (inDocument) { if (inDocument === void 0) { inDocument = document; } if (!inDocument || !inDocument.activeElement) { return undefined; } var activeElement = inDocument.activeElement; return (activeElement.shadowRoot ? getActiveElement_getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function () { return activeElement.contentWindow.document; }) ? getActiveElement_getActiveElement(activeElement.contentWindow.document) : activeElement); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/focusIsHidden.js /** * checks if focus is hidden FROM the focus-lock * ie contained inside a node focus-lock shall ignore * * This is a utility function coupled with {@link FOCUS_ALLOW} constant * * @returns {boolean} focus is currently is in "allow" area */ var focusIsHidden = function (inDocument) { if (inDocument === void 0) { inDocument = document; } var activeElement = getActiveElement_getActiveElement(inDocument); if (!activeElement) { return false; } // this does not support setting FOCUS_ALLOW within shadow dom return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function (node) { return DOMutils_contains(node, activeElement); }); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/all-affected.js /** * in case of multiple nodes nested inside each other * keeps only top ones * this is O(nlogn) * @param nodes * @returns {*} */ var filterNested = function (nodes) { var contained = new Set(); var l = nodes.length; for (var i = 0; i < l; i += 1) { for (var j = i + 1; j < l; j += 1) { var position = nodes[i].compareDocumentPosition(nodes[j]); /* eslint-disable no-bitwise */ if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) { contained.add(j); } if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) { contained.add(i); } /* eslint-enable */ } } return nodes.filter(function (_, index) { return !contained.has(index); }); }; /** * finds top most parent for a node * @param node * @returns {*} */ var getTopParent = function (node) { return node.parentNode ? getTopParent(node.parentNode) : node; }; /** * returns all "focus containers" inside a given node * @param node - node or nodes to look inside * @returns Element[] */ var getAllAffectedNodes = function (node) { var nodes = asArray(node); 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; }, []); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/focusInside.js var focusInFrame = function (frame, activeElement) { return frame === activeElement; }; var focusInsideIframe = function (topNode, activeElement) { return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node, activeElement); })); }; /** * @returns {Boolean} true, if the current focus is inside given node or nodes. * Supports nodes hidden inside shadowDom */ var focusInside = function (topNode, activeElement) { // const activeElement = document && getActiveElement(); if (activeElement === void 0) { activeElement = getActiveElement_getActiveElement(getFirst(topNode).ownerDocument); } if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) { return false; } return getAllAffectedNodes(topNode).some(function (node) { return DOMutils_contains(node, activeElement) || focusInsideIframe(node, activeElement); }); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/commands.js var focusOn = function (target, focusOptions) { if ('focus' in target) { target.focus(focusOptions); } if ('contentWindow' in target && target.contentWindow) { target.contentWindow.focus(); } }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/correctFocus.js var findSelectedRadio = function (node, nodes) { return nodes .filter(isRadioElement) .filter(function (el) { return el.name === node.name; }) .filter(function (el) { return el.checked; })[0] || node; }; var correctNode = function (node, nodes) { if (isRadioElement(node) && node.name) { return findSelectedRadio(node, nodes); } return node; }; /** * giving a set of radio inputs keeps only selected (tabbable) ones * @param nodes */ var correctNodes = function (nodes) { // IE11 has no Set(array) constructor var resultSet = new Set(); nodes.forEach(function (node) { return resultSet.add(correctNode(node, nodes)); }); // using filter to support IE11 return nodes.filter(function (node) { return resultSet.has(node); }); }; ;// CONCATENATED MODULE: ./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, index) { if (nodes.length > 1) { return nodes.indexOf(correctNode(nodes[index], nodes)); } return index; }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/solver.js var NEW_FOCUS = 'NEW_FOCUS'; /** * Main solver for the "find next focus" question * @param innerNodes * @param outerNodes * @param activeElement * @param lastNode * @returns {number|string|undefined|*} */ var newFocus = function (innerNodes, outerNodes, activeElement, lastNode) { var cnt = innerNodes.length; var firstFocus = innerNodes[0]; var lastFocus = innerNodes[cnt - 1]; var isOnGuard = isGuard(activeElement); // focus is inside if (activeElement && innerNodes.indexOf(activeElement) >= 0) { return undefined; } var activeIndex = activeElement !== undefined ? outerNodes.indexOf(activeElement) : -1; var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex; var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1; var indexDiff = activeIndex - lastIndex; var firstNodeIndex = outerNodes.indexOf(firstFocus); var lastNodeIndex = outerNodes.indexOf(lastFocus); var correctedNodes = correctNodes(outerNodes); var correctedIndex = activeElement !== undefined ? correctedNodes.indexOf(activeElement) : -1; var correctedIndexDiff = correctedIndex - (lastNode ? correctedNodes.indexOf(lastNode) : activeIndex); var returnFirstNode = pickFocusable(innerNodes, 0); var returnLastNode = pickFocusable(innerNodes, cnt - 1); // new focus if (activeIndex === -1 || lastNodeInside === -1) { return NEW_FOCUS; } // old focus if (!indexDiff && lastNodeInside >= 0) { return lastNodeInside; } // first element if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) { return returnLastNode; } // last element if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) { return returnFirstNode; } // jump out, but not on the guard if (indexDiff && Math.abs(correctedIndexDiff) > 1) { return lastNodeInside; } // focus above lock if (activeIndex <= firstNodeIndex) { return returnLastNode; } // focus below lock if (activeIndex > lastNodeIndex) { return returnFirstNode; } // index is inside tab order, but outside Lock if (indexDiff) { if (Math.abs(indexDiff) > 1) { return lastNodeInside; } return (cnt + lastNodeInside + indexDiff) % cnt; } // do nothing return undefined; }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/auto-focus.js var findAutoFocused = function (autoFocusables) { return function (node) { var _a; var autofocus = (_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus; return ( // @ts-expect-error node.autofocus || // (autofocus !== undefined && autofocus !== 'false') || // autoFocusables.indexOf(node) >= 0); }; }; var pickAutofocus = function (nodesIndexes, orderedNodes, groups) { var nodes = nodesIndexes.map(function (_a) { var node = _a.node; return node; }); var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups))); if (autoFocusable && autoFocusable.length) { return pickFirstFocus(autoFocusable); } return pickFirstFocus(filterAutoFocusable(orderedNodes)); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/utils/parenting.js var getParents = function (node, parents) { if (parents === void 0) { parents = []; } parents.push(node); if (node.parentNode) { getParents(node.parentNode.host || node.parentNode, parents); } return parents; }; /** * finds a parent for both nodeA and nodeB * @param nodeA * @param nodeB * @returns {boolean|*} */ var getCommonParent = function (nodeA, nodeB) { var parentsA = getParents(nodeA); var parentsB = getParents(nodeB); // tslint:disable-next-line:prefer-for-of 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 || DOMutils_contains(common, topCommon)) { topCommon = common; } else { topCommon = getCommonParent(common, topCommon); } } }); }); // TODO: add assert here? return topCommon; }; /** * return list of nodes which are expected to be autofocused inside a given top nodes * @param entries * @param visibilityCache */ var allParentAutofocusables = function (entries, visibilityCache) { return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []); }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/focusSolver.js var reorderNodes = function (srcNodes, dstNodes) { var remap = new Map(); // no Set(dstNodes) for IE11 :( dstNodes.forEach(function (entity) { return remap.set(entity.node, entity); }); // remap to dstNodes return srcNodes.map(function (node) { return remap.get(node); }).filter(is_isDefined); }; /** * contains the main logic of the `focus-lock` package. * * ! you probably dont need this function ! * * given top node(s) and the last active element returns the element to be focused next * @returns element which should be focused to move focus inside * @param topNode * @param lastNode */ var focusSolver = function (topNode, lastNode) { var activeElement = getActiveElement_getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument); var entries = getAllAffectedNodes(topNode).filter(isNotAGuard); var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries); var visibilityCache = new Map(); var anyFocusable = getFocusableNodes(entries, visibilityCache); var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) { var node = _a.node; return isNotAGuard(node); }); if (!innerElements[0]) { innerElements = anyFocusable; if (!innerElements[0]) { return undefined; } } var outerNodes = getFocusableNodes([commonParent], visibilityCache).map(function (_a) { var node = _a.node; return node; }); var orderedInnerElements = reorderNodes(outerNodes, innerElements); var innerNodes = orderedInnerElements.map(function (_a) { var node = _a.node; return node; }); var newId = newFocus(innerNodes, outerNodes, activeElement, lastNode); if (newId === NEW_FOCUS) { var focusNode = pickAutofocus(anyFocusable, innerNodes, allParentAutofocusables(entries, visibilityCache)); if (focusNode) { return { node: focusNode }; } else { console.warn('focus-lock: cannot find any node to move focus into'); return undefined; } } if (newId === undefined) { return newId; } return orderedInnerElements[newId]; }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/moveFocusInside.js var guardCount = 0; var lockDisabled = false; /** * The main functionality of the focus-lock package * * Contains focus at a given node. * The last focused element will help to determine which element(first or last) should be focused. * The found element will be focused. * * This is one time action (move), not a persistent focus-lock * * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus * @see {@link focusSolver} for the same functionality without autofocus */ var moveFocusInside = function (topNode, lastNode, options) { if (options === void 0) { options = {}; } var focusable = focusSolver(topNode, lastNode); // global local side effect to countain recursive lock activation and resolve focus-fighting if (lockDisabled) { return; } if (focusable) { /** +FOCUS-FIGHTING prevention **/ if (guardCount > 2) { // we have recursive entered back the lock activation 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--; } }; ;// CONCATENATED MODULE: ./node_modules/focus-lock/dist/es2015/focusables.js /** * @returns list of focusable elements inside a given top node * @see {@link getFocusableNodes} for lower level access */ var expandFocusableNodes = function (topNode) { var entries = getAllAffectedNodes(topNode).filter(isNotAGuard); var commonParent = getTopCommonParent(topNode, topNode, entries); var visibilityCache = new Map(); var outerNodes = getTabbableNodes([commonParent], visibilityCache, true); var innerElements = getTabbableNodes(entries, visibilityCache) .filter(function (_a) { var node = _a.node; return isNotAGuard(node); }) .map(function (_a) { var node = _a.node; return node; }); return outerNodes.map(function (_a) { var node = _a.node, index = _a.index; return ({ node: node, index: index, lockItem: innerElements.indexOf(node) >= 0, guard: isGuard(node), }); }); }; ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/util.js function deferAction(action) { setTimeout(action, 1); } var inlineProp = function inlineProp(name, value) { var obj = {}; obj[name] = value; return obj; }; ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/Trap.js /* eslint-disable no-mixed-operators */ var focusOnBody = function focusOnBody() { return document && document.activeElement === document.body; }; var isFreeFocus = function isFreeFocus() { return focusOnBody() || focusIsHidden(); }; var lastActiveTrap = null; var lastActiveFocus = null; var lastPortaledElement = null; var focusWasOutsideWindow = false; var defaultWhitelist = function defaultWhitelist() { return true; }; var focusWhitelisted = function focusWhitelisted(activeElement) { return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement); }; var recordPortal = function recordPortal(observerNode, portaledElement) { lastPortaledElement = { observerNode: observerNode, portaledElement: portaledElement }; }; var focusIsPortaledPair = function focusIsPortaledPair(element) { return lastPortaledElement && lastPortaledElement.portaledElement === element; }; function autoGuard(startIndex, end, 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) { // we will tab to the next element return; } lastGuard = null; } else { break; } } while ((i += step) !== end); if (lastGuard) { lastGuard.node.tabIndex = 0; } } var extractRef = function extractRef(ref) { return ref && 'current' in ref ? ref.current : ref; }; var focusWasOutside = function focusWasOutside(crossFrameOption) { if (crossFrameOption) { // with cross frame return true for any value return Boolean(focusWasOutsideWindow); } // in other case return only of focus went a while aho return focusWasOutsideWindow === 'meanwhile'; }; var checkInHost = function checkInHost(check, el, boundary) { return el && ( // find host equal to active element and check nested active element el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) // dive up || el.parentNode && checkInHost(check, el.parentNode, boundary)); }; var withinHost = function withinHost(activeElement, workingArea) { return workingArea.some(function (area) { return checkInHost(activeElement, area, area); }); }; var activateTrap = function activateTrap() { 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; var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement; var activeElement = document && document.activeElement; if (workingNode) { var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean)); if (!activeElement || focusWhitelisted(activeElement)) { if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) { if (workingNode && !( // active element is "inside" working area focusInside(workingArea) || // check for shadow-dom contained elements activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement, workingNode))) { if (document && !lastActiveFocus && activeElement && !autoFocus) { // Check if blur() exists, which is missing on certain elements on IE if (activeElement.blur) { activeElement.blur(); } document.body.focus(); } else { result = moveFocusInside(workingArea, lastActiveFocus, { focusOptions: focusOptions }); lastPortaledElement = {}; } } focusWasOutsideWindow = false; lastActiveFocus = document && document.activeElement; } } if (document) { var newActiveElement = document && document.activeElement; var allNodes = expandFocusableNodes(workingArea); var focusedIndex = allNodes.map(function (_ref) { var node = _ref.node; return node; }).indexOf(newActiveElement); if (focusedIndex > -1) { // remove old focus allNodes.filter(function (_ref2) { var guard = _ref2.guard, node = _ref2.node; return guard && node.dataset.focusAutoGuard; }).forEach(function (_ref3) { var node = _ref3.node; return node.removeAttribute('tabIndex'); }); autoGuard(focusedIndex, allNodes.length, +1, allNodes); autoGuard(focusedIndex, -1, -1, allNodes); } } } } return result; }; var onTrap = function onTrap(event) { if (activateTrap() && event) { // prevent scroll jump event.stopPropagation(); event.preventDefault(); } }; var onBlur = function onBlur() { return deferAction(activateTrap); }; var onFocus = function onFocus(event) { // detect portal var source = event.target; var currentNode = event.currentTarget; if (!currentNode.contains(source)) { recordPortal(currentNode, source); } }; var FocusWatcher = function FocusWatcher() { return null; }; var FocusTrap = function FocusTrap(_ref4) { var children = _ref4.children; return /*#__PURE__*/external_React_.createElement("div", { onBlur: onBlur, onFocus: onFocus }, children); }; FocusTrap.propTypes = false ? 0 : {}; var onWindowBlur = function onWindowBlur() { focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction deferAction(function () { focusWasOutsideWindow = 'meanwhile'; }); }; var attachHandler = function attachHandler() { document.addEventListener('focusin', onTrap); document.addEventListener('focusout', onBlur); window.addEventListener('blur', onWindowBlur); }; var detachHandler = function detachHandler() { document.removeEventListener('focusin', onTrap); document.removeEventListener('focusout', onBlur); window.removeEventListener('blur', onWindowBlur); }; function reducePropsToState(propsList) { return propsList.filter(function (_ref5) { var disabled = _ref5.disabled; return !disabled; }); } 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(); // return focus only of last trap was removed if (!traps.filter(function (_ref6) { var id = _ref6.id; return id === lastTrap.id; }).length) { // allow defer is no other trap is awaiting restore lastTrap.returnFocus(!trap); } } if (trap) { lastActiveFocus = null; if (!sameTrap || lastTrap.observed !== trap.observed) { trap.onActivation(); } activateTrap(true); deferAction(activateTrap); } else { detachHandler(); lastActiveFocus = null; } } // bind medium mediumFocus.assignSyncMedium(onFocus); mediumBlur.assignMedium(onBlur); mediumEffect.assignMedium(function (cb) { return cb({ moveFocusInside: moveFocusInside, focusInside: focusInside }); }); /* harmony default export */ const Trap = (index_es(reducePropsToState, handleStateChangeOnClient)(FocusWatcher)); ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/Combination.js /* that would be a BREAKING CHANGE! // delaying sidecar execution till the first usage const RequireSideCar = (props) => { // eslint-disable-next-line global-require const SideCar = require('./Trap').default; return <SideCar {...props} />; }; */ var FocusLockCombination = /*#__PURE__*/external_React_.forwardRef(function FocusLockUICombination(props, ref) { return /*#__PURE__*/external_React_.createElement(Lock, helpers_esm_extends_extends({ sideCar: Trap, ref: ref }, props)); }); var _ref = Lock.propTypes || {}, sideCar = _ref.sideCar, propTypes = objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(_ref, ["sideCar"]); FocusLockCombination.propTypes = false ? 0 : {}; /* harmony default export */ const Combination = (FocusLockCombination); ;// CONCATENATED MODULE: ./node_modules/react-focus-lock/dist/es2015/index.js /* harmony default export */ const es2015 = (Combination); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/dom-utils/dist/chunk-3XANSPY5.mjs // src/dom.ts function chunk_3XANSPY5_isElement(el) { return el != null && typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE; } function chunk_3XANSPY5_isHTMLElement(el) { var _a; if (!chunk_3XANSPY5_isElement(el)) return false; const win = (_a = el.ownerDocument.defaultView) != null ? _a : window; return el instanceof win.HTMLElement; } function chunk_3XANSPY5_getOwnerWindow(node) { var _a, _b; return (_b = (_a = chunk_3XANSPY5_getOwnerDocument(node)) == null ? void 0 : _a.defaultView) != null ? _b : window; } function chunk_3XANSPY5_getOwnerDocument(node) { return chunk_3XANSPY5_isElement(node) ? node.ownerDocument : document; } function chunk_3XANSPY5_getEventWindow(event) { var _a; return (_a = event.view) != null ? _a : window; } function chunk_3XANSPY5_isBrowser() { return Boolean(globalThis == null ? void 0 : globalThis.document); } function chunk_3XANSPY5_getActiveElement(node) { return chunk_3XANSPY5_getOwnerDocument(node).activeElement; } function chunk_3XANSPY5_contains(parent, child) { if (!parent) return false; return parent === child || parent.contains(child); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/dom-utils/dist/chunk-ROURZMX4.mjs // src/tabbable.ts var hasDisplayNone = (element) => window.getComputedStyle(element).display === "none"; var hasTabIndex = (element) => element.hasAttribute("tabindex"); var hasNegativeTabIndex = (element) => hasTabIndex(element) && element.tabIndex === -1; function isDisabled(element) { return Boolean(element.getAttribute("disabled")) === true || Boolean(element.getAttribute("aria-disabled")) === true; } function chunk_ROURZMX4_isInputElement(element) { return isHTMLElement(element) && element.localName === "input" && "select" in element; } function isActiveElement(element) { const doc = isHTMLElement(element) ? getOwnerDocument(element) : document; return doc.activeElement === element; } function hasFocusWithin(element) { if (!document.activeElement) return false; return element.contains(document.activeElement); } function isHidden(element) { if (element.parentElement && isHidden(element.parentElement)) return true; return element.hidden; } function isContentEditable(element) { const value = element.getAttribute("contenteditable"); return value !== "false" && value != null; } function isFocusable(element) { if (!chunk_3XANSPY5_isHTMLElement(element) || isHidden(element) || isDisabled(element)) { return false; } const { localName } = element; const focusableTags = ["input", "select", "textarea", "button"]; if (focusableTags.indexOf(localName) >= 0) return true; const others = { a: () => element.hasAttribute("href"), audio: () => element.hasAttribute("controls"), video: () => element.hasAttribute("controls") }; if (localName in others) { return others[localName](); } if (isContentEditable(element)) return true; return hasTabIndex(element); } function chunk_ROURZMX4_isTabbable(element) { if (!element) return false; return chunk_3XANSPY5_isHTMLElement(element) && isFocusable(element) && !hasNegativeTabIndex(element); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/dom-utils/dist/index.mjs // src/index.ts 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 dist_isVisible = (el) => el.offsetWidth > 0 && el.offsetHeight > 0; function dist_getAllFocusable(container) { const focusableEls = Array.from( container.querySelectorAll(focusableElSelector) ); focusableEls.unshift(container); return focusableEls.filter((el) => isFocusable(el) && dist_isVisible(el)); } function getFirstFocusable(container) { const allFocusable = dist_getAllFocusable(container); return allFocusable.length ? allFocusable[0] : null; } function getAllTabbable(container, fallbackToFocusable) { const allFocusable = Array.from( container.querySelectorAll(focusableElSelector) ); const allTabbable = allFocusable.filter(isTabbable); if (isTabbable(container)) { allTabbable.unshift(container); } if (!allTabbable.length && fallbackToFocusable) { return allFocusable; } return allTabbable; } function getFirstTabbableIn(container, fallbackToFocusable) { const [first] = getAllTabbable(container, fallbackToFocusable); return first || null; } function getLastTabbableIn(container, fallbackToFocusable) { const allTabbable = getAllTabbable(container, fallbackToFocusable); return allTabbable[allTabbable.length - 1] || null; } function getNextTabbable(container, fallbackToFocusable) { const allFocusable = dist_getAllFocusable(container); const index = allFocusable.indexOf(document.activeElement); const slice = allFocusable.slice(index + 1); return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); } function getPreviousTabbable(container, fallbackToFocusable) { const allFocusable = dist_getAllFocusable(container).reverse(); const index = allFocusable.indexOf(document.activeElement); const slice = allFocusable.slice(index + 1); return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/focus-lock/dist/chunk-UU5OHSNF.mjs 'use client' // src/focus-lock.tsx ; var chunk_UU5OHSNF_a; var chunk_UU5OHSNF_FocusTrap = (chunk_UU5OHSNF_a = es2015["default"]) != null ? chunk_UU5OHSNF_a : es2015; var chunk_UU5OHSNF_FocusLock = (props) => { const { initialFocusRef, finalFocusRef, contentRef, restoreFocus, children, isDisabled, autoFocus, persistentFocus, lockFocusAcrossFrames } = props; const onActivation = (0,external_React_.useCallback)(() => { if (initialFocusRef == null ? void 0 : initialFocusRef.current) { initialFocusRef.current.focus(); } else if (contentRef == null ? void 0 : contentRef.current) { const focusables = dist_getAllFocusable(contentRef.current); if (focusables.length === 0) { requestAnimationFrame(() => { var _a2; (_a2 = contentRef.current) == null ? void 0 : _a2.focus(); }); } } }, [initialFocusRef, contentRef]); const onDeactivation = (0,external_React_.useCallback)(() => { var _a2; (_a2 = finalFocusRef == null ? void 0 : finalFocusRef.current) == null ? void 0 : _a2.focus(); }, [finalFocusRef]); const returnFocus = restoreFocus && !finalFocusRef; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chunk_UU5OHSNF_FocusTrap, { crossFrame: lockFocusAcrossFrames, persistentFocus, autoFocus, disabled: isDisabled, onActivation, onDeactivation, returnFocus, children } ); }; chunk_UU5OHSNF_FocusLock.displayName = "FocusLock"; var focus_lock_default = (/* unused pure expression or super */ null && (chunk_UU5OHSNF_FocusLock)); //# sourceMappingURL=chunk-UU5OHSNF.mjs.map ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js var zeroRightClassName = 'right-scroll-bar-position'; var fullWidthClassName = 'width-before-scroll-bar'; var noScrollbarsClassName = 'with-scroll-bars-hidden'; /** * Name of a CSS variable containing the amount of "hidden" scrollbar * ! might be undefined ! use will fallback! */ var removedBarSizeVariable = '--removed-body-scroll-bar-size'; ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/medium.js var effectCar = createSidecarMedium(); ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/UI.js var nothing = function () { return; }; /** * Removes scrollbar from the page and contain the scroll within the Lock */ var RemoveScroll = external_React_.forwardRef(function (props, parentRef) { var ref = external_React_.useRef(null); var _a = external_React_.useState({ onScrollCapture: nothing, onWheelCapture: nothing, onTouchMoveCapture: nothing, }), callbacks = _a[0], setCallbacks = _a[1]; var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]); var SideCar = sideCar; var containerRef = useMergeRef_useMergeRefs([ref, parentRef]); var containerProps = __assign(__assign({}, rest), callbacks); return (external_React_.createElement(external_React_.Fragment, null, enabled && (external_React_.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })), forwardProps ? (external_React_.cloneElement(external_React_.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (external_React_.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children)))); }); RemoveScroll.defaultProps = { enabled: true, removeScrollBar: true, inert: false, }; RemoveScroll.classNames = { fullWidth: fullWidthClassName, zeroRight: zeroRightClassName, }; ;// CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/exports.js var SideCar = function (_a) { var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]); if (!sideCar) { throw new Error('Sidecar: please provide `sideCar` property to import the right car'); } var Target = sideCar.read(); if (!Target) { throw new Error('Sidecar medium not found'); } return external_React_.createElement(Target, __assign({}, rest)); }; SideCar.isSideCarExport = true; function exportSidecar(medium, exported) { medium.useMedium(exported); return SideCar; } ;// CONCATENATED MODULE: ./node_modules/get-nonce/dist/es2015/index.js var currentNonce; var setNonce = function (nonce) { currentNonce = nonce; }; var getNonce = function () { if (currentNonce) { return currentNonce; } if (true) { return __webpack_require__.nc; } return undefined; }; ;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/singleton.js function makeStyleTag() { if (!document) return null; var tag = document.createElement('style'); tag.type = 'text/css'; var nonce = getNonce(); if (nonce) { tag.setAttribute('nonce', nonce); } return tag; } function injectStyles(tag, css) { // @ts-ignore if (tag.styleSheet) { // @ts-ignore tag.styleSheet.cssText = css; } else { tag.appendChild(document.createTextNode(css)); } } function insertStyleTag(tag) { var head = document.head || document.getElementsByTagName('head')[0]; head.appendChild(tag); } var stylesheetSingleton = function () { var counter = 0; var stylesheet = null; return { add: function (style) { if (counter == 0) { if ((stylesheet = makeStyleTag())) { injectStyles(stylesheet, style); insertStyleTag(stylesheet); } } counter++; }, remove: function () { counter--; if (!counter && stylesheet) { stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet); stylesheet = null; } }, }; }; ;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/hook.js /** * creates a hook to control style singleton * @see {@link styleSingleton} for a safer component version * @example * ```tsx * const useStyle = styleHookSingleton(); * /// * useStyle('body { overflow: hidden}'); */ var styleHookSingleton = function () { var sheet = stylesheetSingleton(); return function (styles, isDynamic) { external_React_.useEffect(function () { sheet.add(styles); return function () { sheet.remove(); }; }, [styles && isDynamic]); }; }; ;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/component.js /** * create a Component to add styles on demand * - styles are added when first instance is mounted * - styles are removed when the last instance is unmounted * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior */ var styleSingleton = function () { var useStyle = styleHookSingleton(); var Sheet = function (_a) { var styles = _a.styles, dynamic = _a.dynamic; useStyle(styles, dynamic); return null; }; return Sheet; }; ;// CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/index.js ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js var zeroGap = { left: 0, top: 0, right: 0, gap: 0, }; var utils_parse = function (x) { return parseInt(x || '', 10) || 0; }; var getOffset = function (gapMode) { var cs = window.getComputedStyle(document.body); var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft']; var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop']; var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight']; return [utils_parse(left), utils_parse(top), utils_parse(right)]; }; var getGapWidth = function (gapMode) { if (gapMode === void 0) { gapMode = 'margin'; } if (typeof window === 'undefined') { return zeroGap; } var offsets = getOffset(gapMode); var documentWidth = document.documentElement.clientWidth; var windowWidth = window.innerWidth; return { left: offsets[0], top: offsets[1], right: offsets[2], gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]), }; }; ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/component.js var Style = styleSingleton(); // important tip - once we measure scrollBar width and remove them // we could not repeat this operation // thus we are using style-singleton - only the first "yet correct" style will be applied. var getStyles = function (_a, allowRelative, gapMode, important) { var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap; if (gapMode === void 0) { gapMode = 'margin'; } return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([ allowRelative && "position: relative ".concat(important, ";"), gapMode === 'margin' && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "), gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"), ] .filter(Boolean) .join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n"); }; /** * Removes page scrollbar and blocks page scroll when mounted */ var RemoveScrollBar = function (props) { var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a; /* gap will be measured on every component mount however it will be used only by the "first" invocation due to singleton nature of <Style */ var gap = external_React_.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]); return external_React_.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') }); }; ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/index.js ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js var passiveSupported = false; if (typeof window !== 'undefined') { try { var options = Object.defineProperty({}, 'passive', { get: function () { passiveSupported = true; return true; }, }); // @ts-ignore window.addEventListener('test', options, options); // @ts-ignore window.removeEventListener('test', options, options); } catch (err) { passiveSupported = false; } } var nonPassive = passiveSupported ? { passive: false } : false; ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js var alwaysContainsScroll = function (node) { // textarea will always _contain_ scroll inside self. It only can be hidden return node.tagName === 'TEXTAREA'; }; var elementCanBeScrolled = function (node, overflow) { var styles = window.getComputedStyle(node); return ( // not-not-scrollable styles[overflow] !== 'hidden' && // contains scroll inside self !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible')); }; var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); }; var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); }; var locationCouldBeScrolled = function (axis, node) { var ownerDocument = node.ownerDocument; var current = node; do { // Skip over shadow root if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) { current = current.host; } var isScrollable = elementCouldBeScrolled(axis, current); if (isScrollable) { var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2]; if (s > d) { return true; } } current = current.parentNode; } while (current && current !== ownerDocument.body); return false; }; var getVScrollVariables = function (_a) { var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight; return [ scrollTop, scrollHeight, clientHeight, ]; }; var getHScrollVariables = function (_a) { var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth; return [ scrollLeft, scrollWidth, clientWidth, ]; }; var elementCouldBeScrolled = function (axis, node) { return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node); }; var getScrollVariables = function (axis, node) { return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node); }; var getDirectionFactor = function (axis, direction) { /** * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position, * and then increasingly negative as you scroll towards the end of the content. * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft */ return axis === 'h' && direction === 'rtl' ? -1 : 1; }; var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) { var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction); var delta = directionFactor * sourceDelta; // find scrollable target var target = event.target; var targetInLock = endTarget.contains(target); var shouldCancelScroll = false; var isDeltaPositive = delta > 0; var availableScroll = 0; var availableScrollTop = 0; do { var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2]; var elementScroll = scroll_1 - capacity - directionFactor * position; if (position || elementScroll) { if (elementCouldBeScrolled(axis, target)) { availableScroll += elementScroll; availableScrollTop += position; } } if (target instanceof ShadowRoot) { target = target.host; } else { target = target.parentNode; } } while ( // portaled content (!targetInLock && target !== document.body) || // self content (targetInLock && (endTarget.contains(target) || endTarget === target))); // handle epsilon around 0 (non standard zoom levels) if (isDeltaPositive && ((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) { shouldCancelScroll = true; } else if (!isDeltaPositive && ((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) { shouldCancelScroll = true; } return shouldCancelScroll; }; ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js var getTouchXY = function (event) { return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0]; }; var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; }; var SideEffect_extractRef = function (ref) { return ref && 'current' in ref ? ref.current : ref; }; var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; }; var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); }; var idCounter = 0; var lockStack = []; function RemoveScrollSideCar(props) { var shouldPreventQueue = external_React_.useRef([]); var touchStartRef = external_React_.useRef([0, 0]); var activeAxis = external_React_.useRef(); var id = external_React_.useState(idCounter++)[0]; var Style = external_React_.useState(styleSingleton)[0]; var lastProps = external_React_.useRef(props); external_React_.useEffect(function () { lastProps.current = props; }, [props]); external_React_.useEffect(function () { if (props.inert) { document.body.classList.add("block-interactivity-".concat(id)); var allow_1 = tslib_es6_spreadArray([props.lockRef.current], (props.shards || []).map(SideEffect_extractRef), true).filter(Boolean); allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); }); return function () { document.body.classList.remove("block-interactivity-".concat(id)); allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); }); }; } return; }, [props.inert, props.lockRef.current, props.shards]); var shouldCancelEvent = external_React_.useCallback(function (event, parent) { if ('touches' in event && event.touches.length === 2) { return !lastProps.current.allowPinchZoom; } var touch = getTouchXY(event); var touchStart = touchStartRef.current; var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0]; var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1]; var currentAxis; var target = event.target; var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v'; // allow horizontal touch move on Range inputs. They will not cause any scroll if ('touches' in event && moveDirection === 'h' && target.type === 'range') { return false; } var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); if (!canBeScrolledInMainDirection) { return true; } if (canBeScrolledInMainDirection) { currentAxis = moveDirection; } else { currentAxis = moveDirection === 'v' ? 'h' : 'v'; canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target); // other axis might be not scrollable } if (!canBeScrolledInMainDirection) { return false; } if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) { activeAxis.current = currentAxis; } if (!currentAxis) { return true; } var cancelingAxis = activeAxis.current || currentAxis; return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true); }, []); var shouldPrevent = external_React_.useCallback(function (_event) { var event = _event; if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) { // not the last active return; } var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event); var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0]; // self event, and should be canceled if (sourceEvent && sourceEvent.should) { if (event.cancelable) { event.preventDefault(); } return; } // outside or shard event if (!sourceEvent) { var shardNodes = (lastProps.current.shards || []) .map(SideEffect_extractRef) .filter(Boolean) .filter(function (node) { return node.contains(event.target); }); var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation; if (shouldStop) { if (event.cancelable) { event.preventDefault(); } } } }, []); var shouldCancel = external_React_.useCallback(function (name, delta, target, should) { var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) }; shouldPreventQueue.current.push(event); setTimeout(function () { shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; }); }, 1); }, []); var scrollTouchStart = external_React_.useCallback(function (event) { touchStartRef.current = getTouchXY(event); activeAxis.current = undefined; }, []); var scrollWheel = external_React_.useCallback(function (event) { shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); }, []); var scrollTouchMove = external_React_.useCallback(function (event) { shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current)); }, []); external_React_.useEffect(function () { lockStack.push(Style); props.setCallbacks({ onScrollCapture: scrollWheel, onWheelCapture: scrollWheel, onTouchMoveCapture: scrollTouchMove, }); document.addEventListener('wheel', shouldPrevent, nonPassive); document.addEventListener('touchmove', shouldPrevent, nonPassive); document.addEventListener('touchstart', scrollTouchStart, nonPassive); return function () { lockStack = lockStack.filter(function (inst) { return inst !== Style; }); document.removeEventListener('wheel', shouldPrevent, nonPassive); document.removeEventListener('touchmove', shouldPrevent, nonPassive); document.removeEventListener('touchstart', scrollTouchStart, nonPassive); }; }, []); var removeScrollBar = props.removeScrollBar, inert = props.inert; return (external_React_.createElement(external_React_.Fragment, null, inert ? external_React_.createElement(Style, { styles: generateStyle(id) }) : null, removeScrollBar ? external_React_.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null)); } function getOutermostShadowParent(node) { var shadowParent = null; while (node !== null) { if (node instanceof ShadowRoot) { shadowParent = node.host; node = node.host; } node = node.parentNode; } return shadowParent; } ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/sidecar.js /* harmony default export */ const sidecar = (exportSidecar(effectCar, RemoveScrollSideCar)); ;// CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js var ReactRemoveScroll = external_React_.forwardRef(function (props, ref) { return (external_React_.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: sidecar }))); }); ReactRemoveScroll.classNames = RemoveScroll.classNames; /* harmony default export */ const es2015_Combination = (ReactRemoveScroll); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-NABYTFTG.mjs 'use client' ; // src/modal-focus.tsx function ModalFocusScope(props) { const { autoFocus, trapFocus, dialogRef, initialFocusRef, blockScrollOnMount, allowPinchZoom, finalFocusRef, returnFocusOnClose, preserveScrollBarGap, lockFocusAcrossFrames, isOpen } = useModalContext(); const [isPresent, safeToRemove] = usePresence(); (0,external_React_.useEffect)(() => { if (!isPresent && safeToRemove) { setTimeout(safeToRemove); } }, [isPresent, safeToRemove]); const index = useModalManager(dialogRef, isOpen); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chunk_UU5OHSNF_FocusLock, { autoFocus, isDisabled: !trapFocus, initialFocusRef, finalFocusRef, restoreFocus: returnFocusOnClose, contentRef: dialogRef, lockFocusAcrossFrames, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( es2015_Combination, { removeScrollBar: !preserveScrollBarGap, allowPinchZoom, enabled: index === 1 && blockScrollOnMount, forwardProps: true, children: props.children } ) } ); } //# sourceMappingURL=chunk-NABYTFTG.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-CYUETFQE.mjs 'use client' ; // src/slide.tsx var defaultTransition = { exit: { duration: 0.15, ease: TRANSITION_EASINGS.easeInOut }, enter: { type: "spring", damping: 25, stiffness: 180 } }; var chunk_CYUETFQE_variants = { exit: ({ direction, transition, transitionEnd, delay }) => { var _a; const { exit: exitStyles } = getSlideTransition({ direction }); return { ...exitStyles, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(defaultTransition.exit, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit }; }, enter: ({ direction, transitionEnd, transition, delay }) => { var _a; const { enter: enterStyles } = getSlideTransition({ direction }); return { ...enterStyles, transition: (_a = transition == null ? void 0 : transition.enter) != null ? _a : withDelay.enter(defaultTransition.enter, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter }; } }; var Slide = (0,external_React_.forwardRef)(function Slide2(props, ref) { const { direction = "right", style, unmountOnExit, in: isOpen, className, transition, transitionEnd, delay, motionProps, ...rest } = props; const transitionStyles = getSlideTransition({ direction }); const computedStyle = Object.assign( { position: "fixed" }, transitionStyles.position, style ); const show = unmountOnExit ? isOpen && unmountOnExit : true; const animate = isOpen || unmountOnExit ? "enter" : "exit"; const custom = { transitionEnd, transition, direction, delay }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { custom, children: show && /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { ...rest, ref, initial: "exit", className: cx("chakra-slide", className), animate, exit: "exit", custom, variants: chunk_CYUETFQE_variants, style: computedStyle, ...motionProps } ) }); }); Slide.displayName = "Slide"; //# sourceMappingURL=chunk-CYUETFQE.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-65IR7CTH.mjs 'use client' ; // src/drawer-content.tsx var chunk_65IR7CTH_MotionDiv = chakra(Slide); var DrawerContent = forwardRef( (props, ref) => { const { className, children, motionProps, containerProps: rootProps, ...rest } = props; const { getDialogProps, getDialogContainerProps, isOpen } = useModalContext(); const dialogProps = getDialogProps(rest, ref); const containerProps = getDialogContainerProps(rootProps); const _className = cx("chakra-modal__content", className); const styles = useModalStyles(); const dialogStyles = { display: "flex", flexDirection: "column", position: "relative", width: "100%", outline: 0, ...styles.dialog }; const dialogContainerStyles = { display: "flex", width: "100vw", height: "$100vh", position: "fixed", left: 0, top: 0, ...styles.dialogContainer }; const { placement } = useDrawerContext(); return /* @__PURE__ */ (0,jsx_runtime.jsx)(ModalFocusScope, { children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...containerProps, className: "chakra-modal__content-container", __css: dialogContainerStyles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chunk_65IR7CTH_MotionDiv, { motionProps, direction: placement, in: isOpen, className: _className, ...dialogProps, __css: dialogStyles, children } ) } ) }); } ); DrawerContent.displayName = "DrawerContent"; //# sourceMappingURL=chunk-65IR7CTH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-4FCEGNGT.mjs 'use client' ; // src/modal-close-button.tsx var ModalCloseButton = forwardRef( (props, ref) => { const { onClick, className, ...rest } = props; const { onClose } = useModalContext(); const _className = cx("chakra-modal__close-btn", className); const styles = useModalStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( CloseButton, { ref, __css: styles.closeButton, className: _className, onClick: callAllHandlers(onClick, (event) => { event.stopPropagation(); onClose(); }), ...rest } ); } ); ModalCloseButton.displayName = "ModalCloseButton"; //# sourceMappingURL=chunk-4FCEGNGT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-5FG5SY5K.mjs 'use client' ; // src/modal-header.tsx var ModalHeader = forwardRef( (props, ref) => { const { className, ...rest } = props; const { headerId, setHeaderMounted } = useModalContext(); (0,external_React_.useEffect)(() => { setHeaderMounted(true); return () => setHeaderMounted(false); }, [setHeaderMounted]); const _className = cx("chakra-modal__header", className); const styles = useModalStyles(); const headerStyles = { flex: 0, ...styles.header }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.header, { ref, className: _className, id: headerId, ...rest, __css: headerStyles } ); } ); ModalHeader.displayName = "ModalHeader"; //# sourceMappingURL=chunk-5FG5SY5K.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-OFOVX77R.mjs 'use client' ; // src/modal-body.tsx var ModalBody = forwardRef((props, ref) => { const { className, ...rest } = props; const { bodyId, setBodyMounted } = useModalContext(); (0,external_React_.useEffect)(() => { setBodyMounted(true); return () => setBodyMounted(false); }, [setBodyMounted]); const _className = cx("chakra-modal__body", className); const styles = useModalStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, className: _className, id: bodyId, ...rest, __css: styles.body } ); }); ModalBody.displayName = "ModalBody"; //# sourceMappingURL=chunk-OFOVX77R.mjs.map ;// CONCATENATED MODULE: external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: ./src/dashboard/components/Icon.tsx var Search = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 18 18", xmlns: "https://www.w3.org/2000/svg", ref: ref }, props), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M8.25 3.25a5 5 0 1 0 0 10 5 5 0 0 0 0-10Zm-7 5a7 7 0 1 1 14 0 7 7 0 0 1-14 0Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M11.78 11.78a1 1 0 0 1 1.415 0l3.262 3.263a1 1 0 0 1-1.414 1.414l-3.263-3.262a1 1 0 0 1 0-1.415Z", clipRule: "evenodd" })); }); var Cog = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg", ref: ref }, props), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 9.738a2.262 2.262 0 1 0 0 4.524 2.262 2.262 0 0 0 0-4.524ZM8.833 12a3.167 3.167 0 1 1 6.334 0 3.167 3.167 0 0 1-6.334 0Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd" // eslint-disable-next-line , d: "M12 3.405a1.192 1.192 0 0 0-1.193 1.192v.143a1.81 1.81 0 0 1-1.096 1.656.452.452 0 0 1-.154.036 1.81 1.81 0 0 1-1.904-.4l-.003-.003-.05-.05a1.194 1.194 0 1 0-1.688 1.688l.053.053a1.81 1.81 0 0 1 .368 1.983 1.81 1.81 0 0 1-1.651 1.171h-.085a1.192 1.192 0 1 0 0 2.385h.142a1.81 1.81 0 0 1 1.655 1.095 1.81 1.81 0 0 1-.363 1.994l-.003.003-.05.05a1.194 1.194 0 1 0 1.688 1.688l.053-.053a1.81 1.81 0 0 1 1.983-.368 1.81 1.81 0 0 1 1.171 1.651v.084a1.192 1.192 0 1 0 2.385 0v-.143a1.81 1.81 0 0 1 1.095-1.655 1.809 1.809 0 0 1 1.994.363l.003.003.05.05a1.194 1.194 0 1 0 1.688-1.688l-.053-.053a1.81 1.81 0 0 1-.363-1.994 1.81 1.81 0 0 1 1.655-1.094h.076a1.192 1.192 0 1 0 0-2.386h-.143a1.81 1.81 0 0 1-1.656-1.096.453.453 0 0 1-.036-.154 1.81 1.81 0 0 1 .4-1.904l.003-.003.05-.05a1.193 1.193 0 1 0-1.688-1.688l-.053.053a1.81 1.81 0 0 1-1.994.363 1.81 1.81 0 0 1-1.094-1.655v-.076A1.192 1.192 0 0 0 12 3.405Zm-1.483-.29a2.097 2.097 0 0 1 3.58 1.482v.073a.905.905 0 0 0 .549.828l.004.002a.905.905 0 0 0 .997-.18l.047-.047A2.098 2.098 0 1 1 18.66 8.24l-.047.048a.905.905 0 0 0-.18.996c.02.045.033.093.037.142a.904.904 0 0 0 .793.477h.139a2.098 2.098 0 0 1 0 4.194h-.073a.905.905 0 0 0-.828.549l-.002.004a.905.905 0 0 0 .18.997l.047.047a2.097 2.097 0 0 1-1.483 3.582 2.097 2.097 0 0 1-1.484-.615l-.048-.047a.906.906 0 0 0-.996-.18l-.004.003a.905.905 0 0 0-.549.827v.139a2.098 2.098 0 0 1-4.195 0v-.069a.905.905 0 0 0-.618-.834.906.906 0 0 0-.997.18l-.001.001-.046.046a2.097 2.097 0 0 1-3.423-.68 2.098 2.098 0 0 1 .456-2.287l.047-.048a.905.905 0 0 0 .18-.996l-.003-.004a.905.905 0 0 0-.827-.549h-.139a2.098 2.098 0 0 1 0-4.195h.069A.905.905 0 0 0 5.5 9.35a.905.905 0 0 0-.18-.997l-.047-.047A2.098 2.098 0 1 1 8.24 5.34l.048.047a.905.905 0 0 0 .996.18.453.453 0 0 1 .142-.037.905.905 0 0 0 .477-.793v-.139c0-.556.22-1.09.614-1.483Z", clipRule: "evenodd" })); }); var Meter = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M16.425 9.576a.6.6 0 0 1 0 .848l-4 4a.6.6 0 0 1-.849-.848l4-4a.6.6 0 0 1 .849 0Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 4.6a9.4 9.4 0 0 0-8.14 14.1.6.6 0 0 1-1.04.6 10.6 10.6 0 1 1 18.36 0 .6.6 0 0 1-1.04-.6A9.4 9.4 0 0 0 12 4.6Z", clipRule: "evenodd" })); }); var ArrowsRepeat = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M11.998 2.4H12a9.6 9.6 0 0 1 9.6 9.6.6.6 0 1 1-1.2 0 8.4 8.4 0 0 0-8.398-8.4A9.15 9.15 0 0 0 5.68 6.168L3.425 8.425a.6.6 0 0 1-.849-.849L4.843 5.31a10.35 10.35 0 0 1 7.155-2.91Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M3 2.4a.6.6 0 0 1 .6.6v4.4H8a.6.6 0 0 1 0 1.2H3a.6.6 0 0 1-.6-.6V3a.6.6 0 0 1 .6-.6Zm0 9a.6.6 0 0 1 .6.6 8.4 8.4 0 0 0 8.4 8.4 9.15 9.15 0 0 0 6.32-2.567l2.256-2.257a.6.6 0 0 1 .849.849l-2.268 2.267a10.35 10.35 0 0 1-7.154 2.908H12A9.6 9.6 0 0 1 2.4 12a.6.6 0 0 1 .6-.6Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M15.4 16a.6.6 0 0 1 .6-.6h5a.6.6 0 0 1 .6.6v5a.6.6 0 1 1-1.2 0v-4.4H16a.6.6 0 0 1-.6-.6Z", clipRule: "evenodd" })); }); var ArrowsUpDown = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 30 28", fill: "none", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M17.295 19.794a.498.498 0 0 1-.354-.146l-4.706-4.706a.5.5 0 1 1 .707-.707l3.854 3.854V4a.5.5 0 1 1 1 0v14.085l3.85-3.85a.5.5 0 0 1 .708.707l-4.68 4.678a.5.5 0 0 1-.379.174ZM6.325 3.675a.499.499 0 0 1 .734-.028l4.706 4.706a.5.5 0 1 1-.707.707L7.204 5.206v14.09a.5.5 0 1 1-1 0V5.21l-3.85 3.85a.5.5 0 0 1-.708-.707l4.68-4.678Z" })); }); var Links = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M7.5 22c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l8.3-8.3-8.3-8.3c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l9 9c.4.4.4 1 0 1.4l-9 9c-.2.2-.4.3-.7.3z" })); }); var ArrowRight = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 18 18", fill: "none", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "m6.75 13.5 4.5-4.5-4.5-4.5" })); }); var DotsHorizontal = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg", strokeWidth: "0" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" })); }); var Logo = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false" }, /*#__PURE__*/external_React_default().createElement("rect", { width: "24", height: "24", fill: "white" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M12 18.7957H4.60217V5.20432L12 9.82797V18.7957Z", fill: "#690AA0" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M19.4194 18.7957H12V9.82797L19.4194 5.20432V18.7957Z", fill: "#8D42CE" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M24 24H0V0H24V24ZM1.07527 22.9247H22.9247V1.07527H1.07527V22.9247Z", fill: "#690AA0" })); }); var ArrowRightFill = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg", fill: "none" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M22 12A10 10 0 1 1 12 2a10 10 0 0 1 10 10Zm-6.29-6.5a1 1 0 0 0-1.42 0l-6 6a1 1 0 0 0 0 1.42l6 6a1 1 0 0 0 1.42-1.42l-5.3-5.29 5.3-5.29a1 1 0 0 0 0-1.42Z" })); }); var QuestionCircleFill = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 16 16", xmlns: "https://www.w3.org/2000/svg", strokeWidth: "0" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M8 1.332a6.667 6.667 0 1 0 0 13.333A6.667 6.667 0 0 0 8 1.332Zm0 10.333a.667.667 0 1 1 0-1.333.667.667 0 0 1 0 1.333Zm.16-2.433a.793.793 0 0 1-.214.033.675.675 0 1 1-.206-1.333c.433-.147 1.333-.627 1.333-1.167a1.133 1.133 0 0 0-2.2-.38A.667.667 0 0 1 5.62 6a2.467 2.467 0 0 1 4.793.82c0 1.613-2.02 2.333-2.253 2.413Z" })); }); var Buttons = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M19.27 12.91H4.73a1.83 1.83 0 0 0-1.82 1.82v5.45A1.83 1.83 0 0 0 4.73 22h14.54a1.83 1.83 0 0 0 1.82-1.82v-5.45a1.83 1.83 0 0 0-1.82-1.82Zm0 7.27H4.73v-5.45h14.54Z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M7.45 18.36h9.1a.91.91 0 0 0 0-1.81h-9.1a.91.91 0 0 0 0 1.81ZM19.27 2H4.73a1.83 1.83 0 0 0-1.82 1.82v5.45a1.83 1.83 0 0 0 1.82 1.82h14.54a1.83 1.83 0 0 0 1.82-1.82V3.82A1.83 1.83 0 0 0 19.27 2Zm0 7.27H4.73V3.82h14.54Z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M7.45 7.45h9.1a.85.85 0 0 0 .9-.9.85.85 0 0 0-.9-.91h-9.1a.85.85 0 0 0-.9.91.85.85 0 0 0 .9.9Z" })); }); var ThreeCircleNodes = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 15.6a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8ZM8.4 18a3.6 3.6 0 1 1 7.2 0 3.6 3.6 0 0 1-7.2 0ZM6 3.6a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8ZM2.4 6a3.6 3.6 0 1 1 7.2 0 3.6 3.6 0 0 1-7.2 0ZM18 3.6a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8ZM14.4 6a3.6 3.6 0 1 1 7.2 0 3.6 3.6 0 0 1-7.2 0Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M6 8.4a.6.6 0 0 1 .6.6v1A1.4 1.4 0 0 0 8 11.4h8a1.4 1.4 0 0 0 1.4-1.4V9a.6.6 0 1 1 1.2 0v1a2.6 2.6 0 0 1-2.6 2.6H8A2.6 2.6 0 0 1 5.4 10V9a.6.6 0 0 1 .6-.6Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 11.4a.6.6 0 0 1 .6.6v3a.6.6 0 1 1-1.2 0v-3a.6.6 0 0 1 .6-.6Z", clipRule: "evenodd" })); }); var Countdown = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg", xmlSpace: "preserve" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "m20.1 8.8.9-.9c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0l-1 1c-1-.6-2.3-1-3.6-1-3.9 0-7 3.1-7 7.1 0 3.7 3.2 6.9 6.9 6.9 3.9 0 7.1-3.1 7.1-7 0-1.8-.7-3.4-1.9-4.7zM15 18.5c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm0-8c.6 0 1 .4 1 1v2c0 .5-.4 1-1 1-.5 0-1-.4-1-1v-2c0-.6.4-1 1-1zm-1-7h2c.5 0 1 .4 1 1 0 .5-.4 1-1 1h-2c-.5 0-1-.4-1-1s.4-1 1-1zm-10 5h2c.5 0 1 .4 1 1 0 .5-.4 1-1 1H4c-.5 0-1-.4-1-1s.4-1 1-1zm0 8h2c.5 0 1 .4 1 1 0 .5-.4 1-1 1H4c-.5 0-1-.4-1-1s.4-1 1-1zm-1-4h2c.5 0 1 .4 1 1 0 .5-.4 1-1 1H3c-.5 0-1-.4-1-1s.4-1 1-1z" })); }); var Counter = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg", xmlSpace: "preserve" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M19.664 17.739V7.646l1.316 1.316a.575.575 0 0 0 .812-.811l-2.296-2.295a.573.573 0 0 0-.403-.169h-.005a.572.572 0 0 0-.406.169l-2.294 2.295a.573.573 0 1 0 .812.811l1.315-1.316v10.092a.574.574 0 0 0 1.149.001zm-15.64-.866a.58.58 0 0 1-.42-.16.527.527 0 0 1-.165-.396v-4.603l.128.201-.667.493a.502.502 0 0 1-.32.101.526.526 0 0 1-.383-.164.537.537 0 0 1-.165-.393c0-.195.094-.353.283-.475L3.63 10.6a.6.6 0 0 1 .206-.091.929.929 0 0 1 .214-.027.56.56 0 0 1 .42.16.548.548 0 0 1 .155.397v5.279c0 .158-.057.29-.169.396a.604.604 0 0 1-.432.159zm6.018-1.005a.496.496 0 0 1 .511.511.472.472 0 0 1-.146.352.502.502 0 0 1-.365.142H6.937a.493.493 0 0 1-.375-.146c-.091-.097-.137-.222-.137-.374s.055-.286.164-.401l1.991-2.129c.225-.242.403-.492.534-.748s.197-.478.197-.667c0-.304-.088-.549-.265-.735s-.411-.278-.703-.278a.86.86 0 0 0-.356.082 1.467 1.467 0 0 0-.352.228c-.113.098-.218.21-.315.338a.482.482 0 0 1-.219.183.547.547 0 0 1-.571-.113.459.459 0 0 1-.169-.352c0-.104.035-.204.105-.302a2.763 2.763 0 0 1 1.355-.972c.2-.064.396-.096.584-.096.408 0 .763.081 1.064.242s.534.39.699.685c.164.295.247.644.247 1.045 0 .335-.099.708-.297 1.119a4.647 4.647 0 0 1-.799 1.155l-1.233 1.315-.1-.083h2.056zm2.493-.283a.662.662 0 0 1 .393.137c.104.079.227.149.369.21.144.061.311.091.498.091.189 0 .367-.047.535-.142a1.138 1.138 0 0 0 .58-1.027c0-.23-.049-.423-.143-.575s-.219-.268-.375-.347a1.073 1.073 0 0 0-.496-.118c-.135 0-.246.012-.334.035-.088.025-.174.051-.256.078s-.178.041-.287.041a.389.389 0 0 1-.325-.146.546.546 0 0 1-.114-.346.51.51 0 0 1 .05-.229c.033-.067.083-.141.151-.22l1.607-1.708.246.21h-2.246a.496.496 0 0 1-.511-.511c0-.14.049-.257.146-.352a.502.502 0 0 1 .365-.142h2.795c.188 0 .33.052.424.155a.555.555 0 0 1 .143.393c0 .079-.021.157-.064.233s-.094.145-.154.206l-1.617 1.735-.246-.311c.066-.03.16-.058.277-.082a1.596 1.596 0 0 1 1.235.242c.264.186.469.426.611.721s.215.613.215.954c0 .451-.102.841-.303 1.169a1.966 1.966 0 0 1-.848.758c-.365.177-.793.266-1.279.266-.226 0-.447-.028-.667-.083a2.213 2.213 0 0 1-.566-.219.626.626 0 0 1-.27-.242.555.555 0 0 1-.068-.251c0-.14.05-.272.151-.397a.465.465 0 0 1 .378-.186z" })); }); var Section = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M4 2a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm16 5H4V4h16zM2 12v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2zm18 0v8H4v-8zm-9 5H9v-2h2v-2h2v2h2v2h-2v2h-2z" })); }); var Heading = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "m17 19v-14a1 1 0 0 0-1-1 1 1 0 0 0-1 1v6h-6v-6a1 1 0 0 0-1-1 0.94 0.94 0 0 0-1 1v14a1 1 0 0 0 1 1 1 1 0 0 0 1-1v-6h6v6a1 1 0 0 0 1 1 0.94 0.94 0 0 0 1-1z", fill: "#690aa0" })); }); var Advertisement = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M7.77 6.81c-.12.48-.24 1.09-.37 1.56l-.5 1.71h1.77l-.5-1.71c-.17-.48-.29-1.08-.4-1.56Zm7.4-.02a3.42 3.42 0 0 0-.81.07v5.27a2.89 2.89 0 0 0 .62 0 2.49 2.49 0 0 0 2.7-2.82 2.3 2.3 0 0 0-2.51-2.52Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M2 2v16h1.9l-.85 4 10.29-4H22V2Zm7.54 11.51-.61-2.07H6.64l-.57 2.07H4.2l2.44-8.06H9l2.47 8.06Zm8.74-1a5.69 5.69 0 0 1-3.69 1 15.22 15.22 0 0 1-2-.12V5.56A15.49 15.49 0 0 1 15 5.39a5.07 5.07 0 0 1 3.27.86 3.57 3.57 0 0 1 1.35 3 4.13 4.13 0 0 1-1.34 3.3Z" })); }); var BannerPosts = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M1.97 1.98h8v20h-8zm10.97 0h3v20h-3zm6.04.01h3v9h-3zm0 10.99h3v9h-3z" })); }); var GridModule = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M2.18 1.93h4.6v4.6h-4.6zm7.51.02h4.6v4.6h-4.6zm7.51-.02h4.6v4.6h-4.6zM2.18 9.69h4.6v4.6h-4.6zm7.51.02h4.6v4.6h-4.6zm7.51-.02h4.6v4.6h-4.6zm-15.02 7.7h4.6v4.6h-4.6zm7.51.03h4.6v4.6h-4.6zm7.51-.03h4.6v4.6h-4.6z" })); }); var FeaturedPosts = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M1.93 2.08h20v12h-20zm.05 14.91h20v2h-20zm0 3.06h10v2h-10z" })); }); var FeaturedCategories = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M13.01 2h9v12h-9zm-10.99.06h9v12h-9zM2.03 16h9v2h-9zm10.98 0h9v2h-9zM2.03 19.98h5.46v2.07H2.03zm10.98 0h5.46v2.07h-5.46z" })); }); var TabPost = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M8.66 7.95V2.12H2v20h20V7.95H8.66z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M16.19 3.78h5v2.51h-5zm-5.86 0h5v2.51h-5z" })); }); var PostList = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M1.99 1.98h8.5v8.5h-8.5zm11.52 1.26h8.5v2h-8.5zm0 3.98h4.25v2h-4.25zM1.99 13.47h8.5v8.5h-8.5zm11.52 1.25h8.5v2h-8.5zm0 3.99h4.25v2h-4.25z" })); }); var PostVideo = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M2 8v14h20V8Zm8.08 11v-7l5.84 3.5ZM3 5.07h18v1.5H3zM4 2h16v1.5H4z" })); }); var CategoryList = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M2.03 2.06h9v9h-9zm0 10.94h9v9h-9zM13 2h9v9h-9z" })); }); var NewsTicker = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M2 2v20h20V2Zm14 6.88-4.86 10.33a.39.39 0 0 1-.37.22h-.13a.4.4 0 0 1-.23-.17.36.36 0 0 1 0-.27l1.76-7.21-3.62.9H8.4a.4.4 0 0 1-.28-.1.34.34 0 0 1-.12-.36l1.8-7.36a.39.39 0 0 1 .2-.21.41.41 0 0 1 .25-.08h2.92a.38.38 0 0 1 .29.12.34.34 0 0 1 .12.26.41.41 0 0 1 0 .16L12 9.24l3.54-.87a.26.26 0 0 1 .11 0 .41.41 0 0 1 .3.13.33.33 0 0 1 .05.38Z" })); }); var DateWeather = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M8 18.33a.51.51 0 0 0-.75.24L6 21.07a.66.66 0 0 0 .21.85.56.56 0 0 0 .27.08.53.53 0 0 0 .52-.32l1.27-2.5a.66.66 0 0 0-.27-.85Zm3.36 0a.52.52 0 0 0-.76.24l-1.26 2.5a.66.66 0 0 0 .2.85.57.57 0 0 0 .28.08.55.55 0 0 0 .48-.32l1.26-2.5a.67.67 0 0 0-.2-.85Zm-6.65 0a.51.51 0 0 0-.75.24l-1.27 2.5a.66.66 0 0 0 .21.85.51.51 0 0 0 .75-.24l1.27-2.5a.66.66 0 0 0-.21-.85Zm17.01-7.59c-2.44.52-4.67-1.57-4.67-4.33a4.54 4.54 0 0 1 2-3.83.28.28 0 0 0-.05-.49 4.78 4.78 0 0 0-.95-.09 5.31 5.31 0 0 0-5 5.39 4.17 4.17 0 0 1 2 2.41 4.31 4.31 0 0 1 2.43 3.39 4.6 4.6 0 0 0 .52.06 4.81 4.81 0 0 0 3.9-2.09.25.25 0 0 0-.18-.42Zm-7.04 7.59a.51.51 0 0 0-.75.24l-1.27 2.5a.66.66 0 0 0 .21.85.51.51 0 0 0 .75-.24l1.27-2.5a.66.66 0 0 0-.21-.85Zm-.48-7.52a2.89 2.89 0 0 0-2.72-2.56 2.54 2.54 0 0 0-1.19.31A3.22 3.22 0 0 0 7.6 7a3.56 3.56 0 0 0-3.32 3.75s0 0 0 .06a3.06 3.06 0 0 0-2.23 3.07A3 3 0 0 0 4.83 17h8.86a3 3 0 0 0 2.77-3.12 3 3 0 0 0-2.26-3.07Z" })); }); var SocialIcons = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { d: "M6 15c.9 0 1.7-.3 2.4-.9l6.3 3.6c-.1.3-.1.6-.1.9 0 1.9 1.6 3.5 3.5 3.6 1.9 0 3.5-1.6 3.6-3.5 0-1.9-1.6-3.5-3.5-3.6-.9 0-1.8.3-2.4.9l-6.3-3.6c.1-.2.1-.5.1-.8l6.1-3.5c1.4 1.3 3.6 1.2 4.9-.2s1.2-3.6-.2-4.9-3.6-1.2-4.9.2c-.6.6-.9 1.5-.9 2.4 0 .3 0 .6.1.8L8.9 9.6c-1-1.6-3.2-2.1-4.8-1S2 11.8 3 13.4c.7 1 1.8 1.6 3 1.6zm12 2c.8 0 1.5.7 1.5 1.5S18.8 20 18 20s-1.5-.7-1.5-1.5.6-1.5 1.5-1.5zm0-13c.8 0 1.5.7 1.5 1.5S18.8 7 18 7s-1.5-.7-1.5-1.5S17.1 4 18 4zM6 10c.8 0 1.5.7 1.5 1.5S6.8 13 6 13s-1.5-.7-1.5-1.5S5.1 10 6 10z" })); }); var Slider = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ xmlns: "http://www.w3.org/2000/svg", xmlSpace: "preserve", viewBox: "0 0 24 24" }, props), /*#__PURE__*/external_React_default().createElement("path", { fill: "#690aa0", d: "M3.5 20H2V5h1.5v15zM22 5h-1.5v15H22V5zm-3-3H5v20h14V2z" })); }); var Paragraph = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M9.15 17h2.3v4.1a.9.9 0 0 0 .9.9.9.9 0 0 0 .9-.9v-17h2.8v17a.9.9 0 0 0 .9.9h.1a.9.9 0 0 0 .9-.9v-17h3.1a.9.9 0 0 0 .9-.9V3a.9.9 0 0 0-.9-.9h-12a7.2 7.2 0 0 0-7 7.5 7.2 7.2 0 0 0 7.1 7.4zm-.1-12.9h2.3V15h-2.2a5.79 5.79 0 0 1-5.1-5.5 5.69 5.69 0 0 1 5-5.45z" })); }); var Spacing = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M21 2H3a1 1 0 0 0-1 1 .94.94 0 0 0 1 1h18a.94.94 0 0 0 1-1 .94.94 0 0 0-1-1ZM2 21a.94.94 0 0 0 1 1h18a.94.94 0 0 0 1-1 .94.94 0 0 0-1-1H3a.94.94 0 0 0-1 1Zm7-6V9a.94.94 0 0 0-1-1 1 1 0 0 0-1 1v6a.94.94 0 0 0 1 1 1 1 0 0 0 1-1Zm8 0V9a.94.94 0 0 0-1-1 .94.94 0 0 0-1 1v6a.94.94 0 0 0 1 1 1.08 1.08 0 0 0 1-1Zm-4 2V7a.94.94 0 0 0-1-1 .94.94 0 0 0-1 1v10a.94.94 0 0 0 1 1 .94.94 0 0 0 1-1Z" })); }); var Tabs = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M6 10V4H4v16h16V10H6Zm16-2v14H2V2h6v6h14Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M13.5 3.5h-3v2h3v-2ZM9 2v5h6V2H9Zm11.5 1.5h-3v2h3v-2ZM16 2v5h6V2h-6Z", clipRule: "evenodd" })); }); var Lottie = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M20 4v16H4V4h16m0-2H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM7 18a1 1 0 0 1 0-2c1.66 0 2.856-2.177 4.124-4.482C12.616 8.805 14.159 6 17 6a1 1 0 0 1 0 2c-1.66 0-2.856 2.177-4.124 4.482C11.384 15.195 9.841 18 7 18z" })); }); var InfoBox = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M22 4V3c0-.6-.4-1-1-1H3c-.6 0-1 .4-1 1v18c0 .6.4 1 1 1h18c.6 0 1-.4 1-1V4zM4 4h16v16H4V4zm8 5.5a2 2 0 1 0 .001-3.999A2 2 0 0 0 12 9.5zm3 1H9c-.6 0-1 .4-1 1s.4 1 1 1h6c.6 0 1-.4 1-1s-.5-1-1-1zm-4 8h2c.6 0 1-.4 1-1s-.4-1-1-1h-2c-.6 0-1 .4-1 1 0 .5.4 1 1 1zm-5-4c0 .6.4 1 1 1h10c.6 0 1-.4 1-1s-.4-1-1-1H7c-.6 0-1 .5-1 1z" })); }); var Icon_Image = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M19.9 2.2H4.3c-1.2 0-2 .8-2 2v15.6c0 1.2.7 2.1 2 2.1h15.6c1.2 0 2-.8 2-2V4.3c-.1-1.3-.8-2.1-2-2.1zM4.3 19.8V4.2h15.6v15.6H4.3z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "m10.1 14-1-1-3 4h12l-5-7-3 4z" })); }); var TableOfContents = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M16.8 9h-6.5c-.2 0-.3-.1-.3-.2V7.3c0-.2.1-.3.3-.3h6.5c.1 0 .2.1.2.3v1.5c0 .1-.1.2-.2.2zm-.8 3.8v-1.5c0-.1-.1-.3-.3-.3h-5.5c-.1 0-.3.1-.3.3v1.5c0 .1.1.3.3.3h5.5c.2-.1.3-.2.3-.3zm-2 4v-1.5c0-.1-.1-.3-.3-.3h-3.5c-.1 0-.3.1-.3.3v1.5c0 .1.1.3.3.3h3.5c.2-.1.3-.2.3-.3zm-5-8V7.3c0-.2-.1-.3-.2-.3H7.3c-.2 0-.3.1-.3.3v1.5c0 .1.1.2.3.2h1.5c.1 0 .2-.1.2-.2zm0 4v-1.5c0-.2-.1-.3-.2-.3H7.3c-.2 0-.3.1-.3.3v1.5c0 .1.1.2.3.2h1.5c.1 0 .2-.1.2-.2zm0 4v-1.5c0-.2-.1-.3-.2-.3H7.3c-.2 0-.3.1-.3.3v1.5c0 .1.1.2.3.2h1.5c.1 0 .2-.1.2-.2zm9 5.2H6c-1.7 0-3-1.3-3-3V5c0-1.7 1.3-3 3-3h12c1.7 0 3 1.3 3 3v14c0 1.7-1.3 3-3 3zM6 4c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1H6z" })); }); var SocialShare = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M6 15c.9 0 1.7-.3 2.4-.9l6.3 3.6c-.1.3-.1.6-.1.9 0 1.9 1.6 3.5 3.5 3.6 1.9 0 3.5-1.6 3.6-3.5 0-1.9-1.6-3.5-3.5-3.6-.9 0-1.8.3-2.4.9l-6.3-3.6c.1-.2.1-.5.1-.8l6.1-3.5c1.4 1.3 3.6 1.2 4.9-.2 1.3-1.4 1.2-3.6-.2-4.9-1.4-1.3-3.6-1.2-4.9.2-.6.6-.9 1.5-.9 2.4 0 .3 0 .6.1.8L8.9 9.6c-1-1.6-3.2-2.1-4.8-1C2.5 9.7 2 11.8 3 13.4c.7 1 1.8 1.6 3 1.6Zm12 2c.8 0 1.5.7 1.5 1.5S18.8 20 18 20s-1.5-.7-1.5-1.5.6-1.5 1.5-1.5Zm0-13c.8 0 1.5.7 1.5 1.5S18.8 7 18 7s-1.5-.7-1.5-1.5S17.1 4 18 4ZM6 10c.8 0 1.5.7 1.5 1.5S6.8 13 6 13s-1.5-.7-1.5-1.5S5.1 10 6 10Z" })); }); var Team = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd" // eslint-disable-next-line , d: "M6.81 14.425a4.077 4.077 0 0 1 2.882-1.194h4.616a4.077 4.077 0 0 1 4.076 4.077v1.538a1 1 0 0 1-2 0v-1.538a2.077 2.077 0 0 0-2.076-2.077H9.692a2.077 2.077 0 0 0-2.077 2.077v1.538a1 1 0 0 1-2 0v-1.538c0-1.082.43-2.119 1.194-2.883ZM12 6a2.077 2.077 0 1 0 0 4.154A2.077 2.077 0 0 0 12 6ZM7.923 8.077a4.077 4.077 0 1 1 8.154 0 4.077 4.077 0 0 1-8.154 0Zm10.801 5.903a1 1 0 0 1 1.218-.718A4.077 4.077 0 0 1 23 17.207v1.54a1 1 0 0 1-2 0v-1.539a2.077 2.077 0 0 0-1.558-2.009 1 1 0 0 1-.718-1.218Zm-2.308-9.228a1 1 0 0 1 1.217-.72 4.077 4.077 0 0 1 0 7.898 1 1 0 1 1-.496-1.937 2.077 2.077 0 0 0 0-4.024 1 1 0 0 1-.721-1.217ZM5.276 13.98a1 1 0 0 0-1.218-.718A4.078 4.078 0 0 0 1 17.207v1.54a1 1 0 0 0 2 0v-1.539A2.077 2.077 0 0 1 4.558 15.2a1 1 0 0 0 .718-1.218Zm2.308-9.228a1 1 0 0 0-1.217-.72 4.077 4.077 0 0 0 0 7.898 1 1 0 1 0 .496-1.937 2.077 2.077 0 0 1 0-4.024 1 1 0 0 0 .721-1.217Z", clipRule: "evenodd" })); }); var CirclesInsideCircle = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M11.402 2h1.196c.084.03.17.052.259.067a9.92 9.92 0 0 1 8.745 7.282c.181.67.266 1.368.398 2.053v1.196c-.03.084-.052.17-.067.259a9.923 9.923 0 0 1-7.282 8.745c-.672.18-1.368.266-2.053.398h-1.196a1.511 1.511 0 0 0-.259-.067 9.934 9.934 0 0 1-8.824-7.589c-.14-.574-.215-1.164-.319-1.746v-1.196c.03-.084.052-.17.067-.259A9.931 9.931 0 0 1 9.656 2.32c.575-.14 1.164-.215 1.746-.319Zm-8.545 9.986c-.01 4.965 4.045 9.071 8.88 9.17 5.1.104 9.271-3.97 9.41-8.883.145-5.13-3.99-9.295-8.905-9.422-5.103-.134-9.418 4.028-9.385 9.136Z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M7.258 10.008c1.115.015 1.963.892 1.952 2.024-.011 1.124-.883 1.97-2.013 1.96a1.971 1.971 0 0 1-1.978-2.042c.021-1.11.91-1.957 2.039-1.942Zm1.154 2.005c.006-.697-.498-1.206-1.196-1.207-.68 0-1.182.486-1.195 1.163-.015.697.478 1.216 1.172 1.226.694.01 1.213-.488 1.219-1.182Zm5.58-.011a1.992 1.992 0 1 1-1.98-1.992 1.955 1.955 0 0 1 1.98 1.992Zm-.797 0c0-.696-.508-1.2-1.204-1.195a1.155 1.155 0 0 0-1.185 1.174c-.01.697.491 1.21 1.184 1.215.694.005 1.204-.5 1.204-1.195l.001.001Zm3.585-1.994a1.957 1.957 0 0 1 1.993 1.983c0 1.144-.868 2.01-2.014 2.002a1.992 1.992 0 0 1 .021-3.984Zm-.006 3.187c.697 0 1.203-.5 1.201-1.195a1.155 1.155 0 0 0-1.168-1.191c-.697-.012-1.213.486-1.22 1.178-.008.693.493 1.205 1.187 1.208Z" })); }); var ExternalLink = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 12 12", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M2.5 4a.5.5 0 0 0-.5.5V10a.5.5 0 0 0 .5.5H8a.5.5 0 0 0 .5-.5V7a.5.5 0 0 1 1 0v3A1.5 1.5 0 0 1 8 11.5H2.5A1.5 1.5 0 0 1 1 10V4.5A1.5 1.5 0 0 1 2.5 3h3a.5.5 0 0 1 0 1h-3ZM7 2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0V2.5H7.5A.5.5 0 0 1 7 2Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M10.854 1.646a.5.5 0 0 1 0 .708l-5.5 5.5a.5.5 0 1 1-.708-.708l5.5-5.5a.5.5 0 0 1 .708 0Z", clipRule: "evenodd" })); }); var Docs = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 12 12", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M1.94 1.44A1.5 1.5 0 0 1 3 1h4.25a.5.5 0 0 1 .354.146l2.75 2.75a.5.5 0 0 1 .146.354v6.25A1.5 1.5 0 0 1 9 12H3a1.5 1.5 0 0 1-1.5-1.5v-8c0-.398.158-.78.44-1.06ZM3 2a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 .5-.5V4.457L7.043 2H3Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M7 1a.5.5 0 0 1 .5.5V4H10a.5.5 0 0 1 0 1H7a.5.5 0 0 1-.5-.5v-3A.5.5 0 0 1 7 1Z", clipRule: "evenodd" })); }); var DocsLines = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 20 20", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M3.292 1.624A2.417 2.417 0 0 1 5 .916h7.083a.75.75 0 0 1 .53.22l4.584 4.583c.14.14.22.331.22.53v10.417A2.417 2.417 0 0 1 15 19.083H5a2.417 2.417 0 0 1-2.417-2.417V3.333c0-.641.255-1.256.708-1.71ZM5 2.416a.917.917 0 0 0-.917.917v13.333a.917.917 0 0 0 .917.917h10a.917.917 0 0 0 .916-.917V6.56l-4.144-4.144H5.001Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M11.666.916a.75.75 0 0 1 .75.75v4.25h4.25a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1-.75-.75v-5a.75.75 0 0 1 .75-.75Zm-5.75 9.917a.75.75 0 0 1 .75-.75h6.667a.75.75 0 0 1 0 1.5H6.666a.75.75 0 0 1-.75-.75Zm0 3.333a.75.75 0 0 1 .75-.75h6.667a.75.75 0 0 1 0 1.5H6.666a.75.75 0 0 1-.75-.75Zm0-6.666a.75.75 0 0 1 .75-.75h1.667a.75.75 0 1 1 0 1.5H6.666a.75.75 0 0 1-.75-.75Z", clipRule: "evenodd" })); }); var Video = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 20 20", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M4.167 3.25a.917.917 0 0 0-.917.917v11.666c0 .507.41.917.917.917h11.666c.507 0 .917-.41.917-.917V4.167a.917.917 0 0 0-.917-.917H4.167Zm-2.417.917A2.417 2.417 0 0 1 4.167 1.75h11.666a2.417 2.417 0 0 1 2.417 2.417v11.666a2.417 2.417 0 0 1-2.417 2.417H4.167a2.417 2.417 0 0 1-2.417-2.417V4.167Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M7.146 6.005a.75.75 0 0 1 .77.037l5 3.333a.75.75 0 0 1 0 1.248l-5 3.334a.75.75 0 0 1-1.166-.624V6.666a.75.75 0 0 1 .396-.661ZM8.25 8.067v3.864L11.148 10 8.25 8.067Z", clipRule: "evenodd" })); }); var Star = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 20 20", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M10 .917a.75.75 0 0 1 .672.418l2.4 4.864 5.37.784a.75.75 0 0 1 .414 1.28l-3.884 3.783.917 5.344a.75.75 0 0 1-1.089.79L10 15.657l-4.802 2.525a.75.75 0 0 1-1.088-.79l.917-5.345-3.884-3.783a.75.75 0 0 1 .415-1.28L6.926 6.2l2.4-4.864A.75.75 0 0 1 10 .917Zm0 2.444L8.096 7.216a.75.75 0 0 1-.564.41l-4.256.622 3.079 2.998a.75.75 0 0 1 .216.664l-.726 4.236 3.804-2.001a.75.75 0 0 1 .698 0l3.805 2-.726-4.235a.75.75 0 0 1 .216-.664l3.078-2.998-4.255-.622a.75.75 0 0 1-.564-.41L9.999 3.36Z", clipRule: "evenodd" })); }); var Bulb = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 20 20", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd" // eslint-disable-next-line , d: "M5.934 2.601a5.75 5.75 0 0 1 9.816 4.066c0 1.262-.483 2.551-1.483 3.46-.608.61-.907 1.064-1.032 1.687a.75.75 0 1 1-1.47-.294c.207-1.04.738-1.75 1.455-2.467a.726.726 0 0 1 .028-.027c.656-.59 1.002-1.461 1.002-2.359a4.25 4.25 0 0 0-8.5 0c0 .687.12 1.477 1.03 2.386.626.626 1.246 1.42 1.455 2.467a.75.75 0 1 1-1.47.294c-.125-.62-.504-1.159-1.045-1.7-1.257-1.257-1.47-2.467-1.47-3.447a5.75 5.75 0 0 1 1.684-4.066ZM6.75 15a.75.75 0 0 1 .75-.75h5a.75.75 0 0 1 0 1.5h-5a.75.75 0 0 1-.75-.75Zm.833 3.333a.75.75 0 0 1 .75-.75h3.334a.75.75 0 0 1 0 1.5H8.333a.75.75 0 0 1-.75-.75Z", clipRule: "evenodd" })); }); var Chat = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 32 32", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M5.333 3.666c-.914 0-1.667.753-1.667 1.667v12.252l3.627-3.626A1 1 0 0 1 8 13.666h8A1.666 1.666 0 0 0 17.666 12V5.333A1.667 1.667 0 0 0 16 3.666H5.333ZM1.666 5.333a3.675 3.675 0 0 1 3.667-3.667H16a3.667 3.667 0 0 1 3.666 3.667V12A3.667 3.667 0 0 1 16 15.666H8.414l-5.04 5.04A1 1 0 0 1 1.666 20V5.333Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M23 12a1 1 0 0 1 1-1h2.667a3.667 3.667 0 0 1 3.666 3.667v14.666a1 1 0 0 1-1.707.708L23.586 25H16a3.667 3.667 0 0 1-3.667-3.668V20a1 1 0 1 1 2 0v1.333A1.667 1.667 0 0 0 16 23h8a1 1 0 0 1 .707.293l3.626 3.626V14.667A1.667 1.667 0 0 0 26.667 13H24a1 1 0 0 1-1-1Z", clipRule: "evenodd" })); }); var UR = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 40 40", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#475BB2", d: "M0 3.636A3.636 3.636 0 0 1 3.636 0h32.728A3.636 3.636 0 0 1 40 3.636v32.728A3.636 3.636 0 0 1 36.364 40H3.636A3.636 3.636 0 0 1 0 36.364V3.636Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff" // eslint-disable-next-line , d: "M28.99 10.623c-1.45.852-2.813 1.96-4.006 3.154-1.194 1.193-2.301 2.556-3.154 3.92a27.715 27.715 0 0 1 1.534 3.665c.767-1.62 1.705-3.068 2.898-4.347v4.602a6.29 6.29 0 0 1-4.602 6.052h-.17c-.171-2.216-.682-4.347-1.45-6.393a21.151 21.151 0 0 0-5.028-7.5c-1.193-1.193-2.557-2.215-4.006-3.153l-.34-.17v11.08c0 4.516 3.238 8.437 7.755 9.204h.085c1.023.17 2.046.17 2.983 0h.086c4.517-.767 7.755-4.688 7.755-9.205v-11.08l-.34.171Zm-15.256 10.91v-4.518c2.642 2.983 4.261 6.648 4.602 10.568a6.29 6.29 0 0 1-4.602-6.05Zm6.221-12.444a2.292 2.292 0 0 0-2.3 2.301 2.292 2.292 0 0 0 2.3 2.301 2.292 2.292 0 0 0 2.301-2.3 2.292 2.292 0 0 0-2.3-2.302Z" })); }); var MagazineBlocks = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 40 40", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("rect", { width: "40", height: "40", fill: "#8D42CE", rx: "3.636" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "M19.781 26.7h-7.025V13.797l7.025 4.387V26.7Zm7.01 0h-7.01v-8.517l7.01-4.387V26.7Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "M30.077 30.576h-21V9.5h21v21.076Zm-20.05-.95h19.115V10.45H10.027v19.176Z" })); }); var EVF = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 40 40", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("rect", { width: "40", height: "40", fill: "#7545BB", rx: "3.636" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "M26.72 11h-4.31l1.32 2.224h4.309L26.72 11Zm2.71 4.447h-4.308l1.39 2.224h4.308l-1.39-2.224Zm-.069 11.119h-16.4l6.88-11.258 2.849 4.587h-2.85l-1.32 2.223h8.13l-6.81-10.98L9 28.79h21.751l-1.39-2.223Z" })); }); var Headphones = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 20 20", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd" // eslint-disable-next-line , d: "M10 3.25A6.75 6.75 0 0 0 3.25 10v.917H5a2.417 2.417 0 0 1 2.417 2.416v2.5A2.417 2.417 0 0 1 5 18.25h-.833a2.417 2.417 0 0 1-2.417-2.417V10a8.25 8.25 0 1 1 16.5 0v5.833a2.417 2.417 0 0 1-2.417 2.417H15a2.417 2.417 0 0 1-2.417-2.417v-2.5A2.416 2.416 0 0 1 15 10.917h1.75V10A6.75 6.75 0 0 0 10 3.25Zm6.75 9.167H15a.916.916 0 0 0-.917.916v2.5a.917.917 0 0 0 .917.917h.833a.917.917 0 0 0 .917-.917v-3.416Zm-13.5 0v3.416a.917.917 0 0 0 .917.917H5a.917.917 0 0 0 .917-.917v-2.5A.916.916 0 0 0 5 12.417H3.25Z", clipRule: "evenodd" })); }); var Masteriyo = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 40 40", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("rect", { width: "40", height: "40", fill: "#E9E3FD", rx: "3.636" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#787DFF", d: "m14.163 11.898 3.851 4.281c.607.64.946 1.489.946 2.37v10.009l-4.8-3.353.003-13.307Z", opacity: ".3" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#787DFF", d: "m11.173 11.3 6.346 4.519a3.373 3.373 0 0 1 1.438 2.559V28.55l-7.785-4.102.001-13.148Z", opacity: ".5" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#787DFF", d: "m18.96 28.656-7.014-2.245A3.48 3.48 0 0 1 9.5 23.305V12.953l7.62 2.943a2.831 2.831 0 0 1 1.835 2.452v.16l.005 10.148Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#FD739C", d: "m25.837 11.898-3.851 4.281a3.444 3.444 0 0 0-.946 2.364v10.008l4.8-3.353-.003-13.3Z", opacity: ".3" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#FD739C", d: "m28.828 11.3-6.346 4.519a3.374 3.374 0 0 0-1.438 2.559V28.55l7.785-4.102-.001-13.148Z", opacity: ".5" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#FD739C", d: "m21.04 28.656 7.013-2.245c1.373-.44 2.377-1.667 2.447-3.106V12.953l-7.617 2.943a2.832 2.832 0 0 0-1.836 2.452v.16l-.007 10.148Z" })); }); var Blockquote = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { xmlns: "http://www.w3.org/2000/svg", fillRule: "evenodd", d: "M2 6a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1Zm5 6a1 1 0 0 1 1-1h13a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h13a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Zm-4-7a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0v-6a1 1 0 0 1 1-1Z", clipRule: "evenodd" })); }); var Timeline = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M11 3a1 1 0 1 1 2 0v18a1 1 0 1 1-2 0V3Z" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M16.037 7.397 15 6.517l.953-.789c.262-.436.74-.728 1.286-.728H20.5a1.5 1.5 0 0 1 0 3h-3.261c-.492 0-.929-.237-1.202-.603Zm0 11L15 17.517l1.025-.898A1.498 1.498 0 0 1 17.239 16H20.5a1.5 1.5 0 0 1 0 3h-3.261c-.492 0-.929-.237-1.202-.603ZM8 12.847l1-.83-.966-.811A1.499 1.499 0 0 0 6.76 10.5H3.5a1.5 1.5 0 0 0 0 3h3.261c.514 0 .968-.259 1.238-.653Z", clipRule: "evenodd" })); }); var Progress = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M20 9.7H4a.3.3 0 0 0-.3.3v4a.3.3 0 0 0 .3.3h16a.3.3 0 0 0 .3-.3v-4a.3.3 0 0 0-.3-.3ZM4 8a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2H4Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M3 9h7v6H3V9Z" })); }); var CTA = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-4v-2h4V5H5v7h7.5v2H5a2 2 0 0 1-2-2V5Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12.046 9.848a.699.699 0 0 1 .786.124l7.25 6.897a.703.703 0 0 1 .158.793.696.696 0 0 1-.692.413l-3.638-.292-2.085 3.045a.696.696 0 0 1-.753.28.703.703 0 0 1-.52-.617l-.897-9.95a.699.699 0 0 1 .392-.693Zm1.168 2.417.556 6.164 1.215-1.774a.696.696 0 0 1 .63-.301l2.072.166-4.473-4.255Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M7 8.25c0 .45.333.75.833.75h8.334c.5 0 .833-.3.833-.75s-.333-.75-.833-.75H7.833c-.5 0-.833.375-.833.75Z" })); }); var Icon_Map = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M12 14c2.206 0 4-1.794 4-4s-1.794-4-4-4-4 1.794-4 4 1.794 4 4 4Zm0-6c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2Z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M11.42 21.814a.998.998 0 0 0 1.16 0C12.884 21.599 20.029 16.44 20 10c0-4.411-3.589-8-8-8S4 5.589 4 9.995c-.029 6.445 7.116 11.604 7.42 11.819ZM12 4c3.309 0 6 2.691 6 6.005.021 4.438-4.388 8.423-6 9.73-1.611-1.308-6.021-5.294-6-9.735 0-3.309 2.691-6 6-6Z" })); }); var Testimonial = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { d: "M20.2 1.5H4.8c-1.2 0-2.2 1-2.2 2.2v12.9c0 1.2 1 2.2 2.2 2.2h3.9l3.8 3.7 3.8-3.7h3.9c1.2 0 2.2-1 2.2-2.2V3.7c0-1.2-1-2.2-2.2-2.2Zm0 15.1h-4.9l-2.8 2.8-2.8-2.8H4.8V3.7h15.4v12.9Z" }), /*#__PURE__*/external_React_default().createElement("path", { d: "M8 11.6a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm4.5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm4.5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" })); }); var Notice = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 24 24", xmlns: "https://www.w3.org/2000/svg" }, props, { ref: ref }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18ZM1 12C1 5.925 5.925 1 12 1s11 4.925 11 11-4.925 11-11 11S1 18.075 1 12Z", clipRule: "evenodd" }), /*#__PURE__*/external_React_default().createElement("path", { fillRule: "evenodd", d: "M12 7a1 1 0 0 1 1 1v4a1 1 0 0 1-2 0V8a1 1 0 0 1 1-1Zm-1 9a1 1 0 0 1 1-1h.01a1 1 0 0 1 0 2H12a1 1 0 0 1-1-1Z", clipRule: "evenodd" })); }); var Megaphone = /*#__PURE__*/external_React_default().forwardRef(function (props, ref) { return /*#__PURE__*/external_React_default().createElement(chakra.svg, helpers_esm_extends_extends({ viewBox: "0 0 42 42", xmlns: "https://www.w3.org/2000/svg" }, props, { fill: "none", ref: ref }), /*#__PURE__*/external_React_default().createElement("rect", { width: "41", height: "41", x: ".5", y: ".5", fill: "#fff", rx: "19.5" }), /*#__PURE__*/external_React_default().createElement("rect", { width: "41", height: "41", x: ".5", y: ".5", stroke: "#DDD", rx: "19.5" }), /*#__PURE__*/external_React_default().createElement("g", { clipPath: "url(#a)" }, /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "M22.394 19.247c-1.098-4.806-.549-9.232 1.176-11.163a1.054 1.054 0 0 0-.502.242l-6.584 5.768-2.23 1.959a6.76 6.76 0 0 0-.497.816c-.66 1.276-1.39 2.887-1.157 4.451.336 2.276 2.13 4.059 3.91 5.049.275.153.56.285.855.395l2.372.359 8.4 1.645.126-.024c-2.38-.995-4.777-4.713-5.87-9.497Z" }), /*#__PURE__*/external_React_default().createElement("path", { stroke: "#E2E2E2", strokeMiterlimit: "10", strokeWidth: ".068", d: "m30.987 28.236-2.726.509c-2.38-.991-4.775-4.713-5.868-9.497-1.098-4.806-.549-9.23 1.176-11.162l2.069-.38 5.349 20.53Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#E2E2E2", d: "m13.812 23.726 9.819-.648 4.63 5.644-11.227-2.053s-3.132-.806-3.222-2.943Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#2E5DAD", d: "M30.078 28.938a2.933 2.933 0 0 1-1.817-.193c-2.38-.991-4.775-4.713-5.868-9.497-1.098-4.806-.549-9.23 1.176-11.162.398-.47.932-.802 1.526-.952 2.868-.668 6.308 3.674 7.685 9.69 1.377 6.017.168 11.444-2.702 12.114Z" }), /*#__PURE__*/external_React_default().createElement("path", { stroke: "#fff", strokeMiterlimit: "10", strokeWidth: ".068", d: "M22.394 19.247c-1.098-4.806-.549-9.232 1.176-11.163l-.284.052-6.802 5.958-2.23 1.959a6.76 6.76 0 0 0-.497.816c-.66 1.276-1.39 2.887-1.157 4.451.336 2.276 2.13 4.059 3.91 5.049.275.153.56.285.855.395l.631.013 1.744.341 8.4 1.646.127-.024c-2.385-.99-4.78-4.709-5.873-9.493Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#CBDEFA", d: "M30.415 27.887c-.979.228-2.078-.456-3.101-1.776-.728-.935-1.419-2.19-2.003-3.663a23.67 23.67 0 0 1-1.069-3.465 24.559 24.559 0 0 1-.485-2.906 18.492 18.492 0 0 1-.056-3.417c.206-2.421.983-4.122 2.225-4.413 2.17-.505 4.932 3.48 6.171 8.904 1.24 5.423.486 10.23-1.683 10.736Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#B8C9E4", d: "M28.982 25.042c-.492.741-1.243.984-1.668 1.066-1.249-1.606-2.388-4.15-3.068-7.132-.535-2.315-.694-4.519-.541-6.323.419-.416 1.069-.686 1.136-.686 1.71 0 3.448 2.567 4.31 6.341.657 2.889.549 5.507-.169 6.734Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "m27.94 20.402-2.63 2.045a23.67 23.67 0 0 1-1.07-3.464 24.559 24.559 0 0 1-.485-2.907l3.116-.104v.018l1.056 4.376.013.036Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#2E5DAD", d: "m14.253 16.08-4.918 2.161s-3.207 1.513-1.71 6.915c0 0 1.817 4.539 5.132 3.134l4.32-1.641S9.87 23.21 14.252 16.08Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#CEDAF7", d: "M27.71 20.494c.522-.122.716-1.23.432-2.473-.284-1.244-.939-2.153-1.462-2.031-.523.122-.716 1.23-.432 2.473.284 1.244.938 2.153 1.461 2.031Z" }), /*#__PURE__*/external_React_default().createElement("path", { stroke: "#2E5DAD", strokeMiterlimit: "10", strokeWidth: ".137", d: "M22.914 19.214c-1.098-4.806.856-11.237.856-11.237-.253.07-.49.19-.7.35l-6.584 5.767-2.232 1.96c-.185.26-.35.532-.497.815-.66 1.276-1.39 2.887-1.157 4.452.336 2.275 2.13 4.058 3.91 5.048.275.154.56.286.855.396l2.372.358 8.272 1.621c.19.003.382-.005.572-.022-2.379-.99-4.574-4.725-5.667-9.508Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#3C5385", d: "m8.053 26.008 5.757-2.281s1.727 2.51 3.224 2.942l-4.672 1.762s-2.599 1.021-4.31-2.424Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#C9DDFB", d: "m12.361 28.432 2 6.109c.125.381.206.821.778.784a1.36 1.36 0 0 1 .278.011l.107.017a.86.86 0 0 1 .673.53c.148.371.252.864-.126 1.051l.346-.027c.227-.017.441-.11.61-.265l.513-.466a.799.799 0 0 0 .25-.735 2.522 2.522 0 0 0-.067-.282.698.698 0 0 0-.582-.494 9.618 9.618 0 0 0-.573-.046.637.637 0 0 1-.578-.448l-.997-3.115-1.969-2.928-.663.304Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#2E5DAD", d: "m15.638 30.794-.033.1-.014.044-1.604.432-.934-3.188 2.002-.756v.007l.577 1.713a2.62 2.62 0 0 1 .006 1.648Z" }), /*#__PURE__*/external_React_default().createElement("path", { fill: "#3E5589", d: "m15.644 30.792-.034.108-1.57.416c.21-.634.228-1.317.054-1.961l-.374-1.389 1.337-.54.576 1.712c.183.535.186 1.116.011 1.654Z" })), /*#__PURE__*/external_React_default().createElement("defs", null, /*#__PURE__*/external_React_default().createElement("clipPath", { id: "a" }, /*#__PURE__*/external_React_default().createElement("path", { fill: "#fff", d: "M7 7h27v30H7z" })))); }); ArrowRight.displayName = "ArrowRight"; Megaphone.displayName = "Megaphone"; Notice.displayName = "Notice"; Testimonial.displayName = "Testimonial"; Icon_Map.displayName = "Map"; Slider.displayName = "Slider"; CTA.displayName = "CTA"; Progress.displayName = "Progress"; Timeline.displayName = "Timeline"; Blockquote.displayName = "Blockquote"; Headphones.displayName = "Headphones"; EVF.displayName = "EVF"; MagazineBlocks.displayName = "MagazineBlocks"; Masteriyo.displayName = "Masteriyo"; UR.displayName = "UR"; Chat.displayName = "Chat"; Bulb.displayName = "Bulb"; Star.displayName = "Star"; Video.displayName = "Video"; DocsLines.displayName = "DocsLines"; Docs.displayName = "Docs"; ExternalLink.displayName = "ExternalLink"; CirclesInsideCircle.displayName = "CirclesInsideCircle"; DotsHorizontal.displayName = "DotsHorizontal"; Search.displayName = "Search"; Cog.displayName = "Cog"; Meter.displayName = "Meter"; ArrowsRepeat.displayName = "ArrowsRepeat"; ArrowsUpDown.displayName = "ArrowsUpDown"; Links.displayName = "Links"; Logo.displayName = "Logo"; ArrowRightFill.displayName = "ArrowRightFill"; QuestionCircleFill.displayName = "QuestionCircleFill"; Buttons.displayName = "Buttons"; Countdown.displayName = "Countdown"; Counter.displayName = "Counter"; FeaturedPosts.displayName = "FeaturedPosts"; Paragraph.displayName = "Paragraph"; Section.displayName = "Section"; Spacing.displayName = "Spacing"; Tabs.displayName = "Tabs"; Lottie.displayName = "Lottie"; InfoBox.displayName = "InfoBox"; Icon_Image.displayName = "Image"; TableOfContents.displayName = "TableOfContents"; SocialShare.displayName = "SocialShare"; Team.displayName = "Team"; ThreeCircleNodes.displayName = "ThreeCircleNodes"; ;// CONCATENATED MODULE: ./src/dashboard/constants/index.tsx var ROUTES = [{ route: "/dashboard", label: (0,external_wp_i18n_namespaceObject.__)("Dashboard", "magazine-blocks") }, { route: "/blocks", label: (0,external_wp_i18n_namespaceObject.__)("Blocks", "magazine-blocks") }, { route: "/products", label: (0,external_wp_i18n_namespaceObject.__)("Products", "magazine-blocks") }, { route: "/settings", label: (0,external_wp_i18n_namespaceObject.__)("Settings", "magazine-blocks") }, // { // route: '/free-vs-pro', // label: __('Free vs Pro', 'magazine-blocks'), // }, { route: "/help", label: (0,external_wp_i18n_namespaceObject.__)("Help", "magazine-blocks") }]; var CHANGELOG_TAG_COLORS = { fix: { color: "primary.500", bgColor: "primary.100", scheme: "primary" }, feature: { color: "green.500", bgColor: "green.50", scheme: "green" }, enhancement: { color: "teal.500", bgColor: "teal.50", scheme: "teal" }, added: { color: "pink.500", bgColor: "pink.50", scheme: "pink" }, update: { color: "orange.500", bgColor: "orange.50", scheme: "orange" }, tweak: { color: "purple.500", bgColor: "purple.50", scheme: "purple" } }; var BLOCKS = { section: { label: (0,external_wp_i18n_namespaceObject.__)("Section", "magazine-blocks"), icon: Section }, heading: { label: (0,external_wp_i18n_namespaceObject.__)("Heading", "magazine-blocks"), icon: Heading }, advertisement: { label: (0,external_wp_i18n_namespaceObject.__)("Advertisement", "magazine-blocks"), icon: Advertisement }, "banner-posts": { label: (0,external_wp_i18n_namespaceObject.__)("Banner Posts", "magazine-blocks"), icon: BannerPosts }, "grid-module": { label: (0,external_wp_i18n_namespaceObject.__)("Grid Module", "magazine-blocks"), icon: GridModule }, "featured-posts": { label: (0,external_wp_i18n_namespaceObject.__)("Featured Posts", "magazine-blocks"), icon: FeaturedPosts }, "featured-categories": { label: (0,external_wp_i18n_namespaceObject.__)("Featured Categories", "magazine-blocks"), icon: FeaturedCategories }, "tab-post": { label: (0,external_wp_i18n_namespaceObject.__)("Tab Post", "magazine-blocks"), icon: TabPost }, "post-list": { label: (0,external_wp_i18n_namespaceObject.__)("Post List", "magazine-blocks"), icon: PostList }, "post-video": { label: (0,external_wp_i18n_namespaceObject.__)("Post Video", "magazine-blocks"), icon: PostVideo }, "category-list": { label: (0,external_wp_i18n_namespaceObject.__)("Category List", "magazine-blocks"), icon: CategoryList }, "news-ticker": { label: (0,external_wp_i18n_namespaceObject.__)("News Ticker", "magazine-blocks"), icon: NewsTicker }, "date-weather": { label: (0,external_wp_i18n_namespaceObject.__)("Date & Weather", "magazine-blocks"), icon: DateWeather }, "social-icons": { label: (0,external_wp_i18n_namespaceObject.__)("Social Icons", "magazine-blocks"), icon: SocialIcons }, slider: { label: (0,external_wp_i18n_namespaceObject.__)("Slider", "magazine-blocks"), icon: Slider } }; var SETTINGS_TABS = [{ label: (0,external_wp_i18n_namespaceObject.__)("Editor Options", "magazine-blocks"), icon: Cog }, { label: (0,external_wp_i18n_namespaceObject.__)("Asset Generation", "magazine-blocks"), icon: ArrowsRepeat }, { label: (0,external_wp_i18n_namespaceObject.__)("Performance", "magazine-blocks"), icon: Meter }, { label: (0,external_wp_i18n_namespaceObject.__)("Version Control", "magazine-blocks"), icon: ThreeCircleNodes }, { label: (0,external_wp_i18n_namespaceObject.__)("Integrations", "magazine-blocks"), icon: ArrowsUpDown }, { label: (0,external_wp_i18n_namespaceObject.__)("Maintenance Mode", "magazine-blocks"), icon: CirclesInsideCircle }]; ;// CONCATENATED MODULE: ./src/dashboard/utils/global.ts var localized = window._MAGAZINE_BLOCKS_DASHBOARD_; ;// CONCATENATED MODULE: ./src/dashboard/utils/index.ts ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-PULVB27S.mjs 'use client' // src/box.tsx ; var Box = chakra("div"); Box.displayName = "Box"; var Square = forwardRef(function Square2(props, ref) { const { size, centerContent = true, ...rest } = props; const styles = centerContent ? { display: "flex", alignItems: "center", justifyContent: "center" } : {}; return /* @__PURE__ */ (0,jsx_runtime.jsx)( Box, { ref, boxSize: size, __css: { ...styles, flexShrink: 0, flexGrow: 0 }, ...rest } ); }); Square.displayName = "Square"; var Circle = forwardRef(function Circle2(props, ref) { const { size, ...rest } = props; return /* @__PURE__ */ (0,jsx_runtime.jsx)(Square, { size, ref, borderRadius: "9999px", ...rest }); }); Circle.displayName = "Circle"; //# sourceMappingURL=chunk-PULVB27S.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-3ASUQ6PA.mjs 'use client' ; // src/stack/h-stack.tsx var HStack = forwardRef((props, ref) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Stack, { align: "center", ...props, direction: "row", ref })); HStack.displayName = "HStack"; //# sourceMappingURL=chunk-3ASUQ6PA.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-7OLJDQMT.mjs 'use client' // src/heading.tsx ; var chunk_7OLJDQMT_Heading = forwardRef(function Heading2(props, ref) { const styles = useStyleConfig("Heading", props); const { className, ...rest } = omitThemingProps(props); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.h2, { ref, className: cx("chakra-heading", props.className), ...rest, __css: styles } ); }); chunk_7OLJDQMT_Heading.displayName = "Heading"; //# sourceMappingURL=chunk-7OLJDQMT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/object-utils/dist/chunk-R3DH46PF.mjs // src/compact.ts function compact(object) { const clone = Object.assign({}, object); for (let key in clone) { if (clone[key] === void 0) delete clone[key]; } return clone; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-2OOHT3W5.mjs 'use client' // src/text.tsx ; var Text = forwardRef(function Text2(props, ref) { const styles = useStyleConfig("Text", props); const { className, align, decoration, casing, ...rest } = omitThemingProps(props); const aliasedProps = compact({ textAlign: props.align, textDecoration: props.decoration, textTransform: props.casing }); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.p, { ref, className: cx("chakra-text", props.className), ...aliasedProps, ...rest, __css: styles } ); }); Text.displayName = "Text"; //# sourceMappingURL=chunk-2OOHT3W5.mjs.map ;// CONCATENATED MODULE: external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/skeleton/dist/chunk-AASO4CLC.mjs 'use client' // src/use-is-first-render.ts ; function useIsFirstRender() { const isFirstRender = (0,external_React_.useRef)(true); (0,external_React_.useEffect)(() => { isFirstRender.current = false; }, []); return isFirstRender.current; } //# sourceMappingURL=chunk-AASO4CLC.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-previous/dist/index.mjs 'use client' // src/index.ts ; function usePrevious(value) { const ref = (0,external_React_.useRef)(); (0,external_React_.useEffect)(() => { ref.current = value; }, [value]); return ref.current; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/skeleton/dist/chunk-GOJLRND4.mjs 'use client' ; // src/skeleton.tsx var StyledSkeleton = chakra("div", { baseStyle: { boxShadow: "none", backgroundClip: "padding-box", cursor: "default", color: "transparent", pointerEvents: "none", userSelect: "none", "&::before, &::after, *": { visibility: "hidden" } } }); var chunk_GOJLRND4_$startColor = cssVar("skeleton-start-color"); var chunk_GOJLRND4_$endColor = cssVar("skeleton-end-color"); var fade = keyframes({ from: { opacity: 0 }, to: { opacity: 1 } }); var bgFade = keyframes({ from: { borderColor: chunk_GOJLRND4_$startColor.reference, background: chunk_GOJLRND4_$startColor.reference }, to: { borderColor: chunk_GOJLRND4_$endColor.reference, background: chunk_GOJLRND4_$endColor.reference } }); var Skeleton = forwardRef((props, ref) => { const skeletonProps = { ...props, fadeDuration: typeof props.fadeDuration === "number" ? props.fadeDuration : 0.4, speed: typeof props.speed === "number" ? props.speed : 0.8 }; const styles = useStyleConfig("Skeleton", skeletonProps); const isFirstRender = useIsFirstRender(); const { startColor = "", endColor = "", isLoaded, fadeDuration, speed, className, fitContent, ...rest } = omitThemingProps(skeletonProps); const [startColorVar, endColorVar] = useToken("colors", [ startColor, endColor ]); const wasPreviouslyLoaded = usePrevious(isLoaded); const _className = cx("chakra-skeleton", className); const cssVarStyles = { ...startColorVar && { [chunk_GOJLRND4_$startColor.variable]: startColorVar }, ...endColorVar && { [chunk_GOJLRND4_$endColor.variable]: endColorVar } }; if (isLoaded) { const animation = isFirstRender || wasPreviouslyLoaded ? "none" : `${fade} ${fadeDuration}s`; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, className: _className, __css: { animation }, ...rest } ); } return /* @__PURE__ */ (0,jsx_runtime.jsx)( StyledSkeleton, { ref, className: _className, ...rest, __css: { width: fitContent ? "fit-content" : void 0, ...styles, ...cssVarStyles, _dark: { ...styles["_dark"], ...cssVarStyles }, animation: `${speed}s linear infinite alternate ${bgFade}` } } ); }); Skeleton.displayName = "Skeleton"; //# sourceMappingURL=chunk-GOJLRND4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/media-query/dist/chunk-C53CKZDP.mjs 'use client' // src/media-query.utils.ts ; function getClosestValue(values, breakpoint, breakpoints = chunk_G72KV6MB_breakpoints) { let index = Object.keys(values).indexOf(breakpoint); if (index !== -1) { return values[breakpoint]; } let stopIndex = breakpoints.indexOf(breakpoint); while (stopIndex >= 0) { const key = breakpoints[stopIndex]; if (values.hasOwnProperty(key)) { index = stopIndex; break; } stopIndex -= 1; } if (index !== -1) { const key = breakpoints[index]; return values[key]; } return void 0; } //# sourceMappingURL=chunk-C53CKZDP.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/media-query/dist/chunk-57I6FYPZ.mjs 'use client' // src/use-media-query.ts ; function useMediaQuery(query, options = {}) { const { ssr = true, fallback } = options; const { getWindow } = 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,external_React_.useState)(() => { return queries.map((query2, index) => ({ media: query2, matches: ssr ? !!fallbackValues[index] : getWindow().matchMedia(query2).matches })); }); (0,external_React_.useEffect)(() => { const win = getWindow(); setValue( queries.map((query2) => ({ media: query2, matches: win.matchMedia(query2).matches })) ); const mql = queries.map((query2) => win.matchMedia(query2)); const handler = (evt) => { setValue((prev) => { return prev.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); } }); }; }, [getWindow]); return value.map((item) => item.matches); } //# sourceMappingURL=chunk-57I6FYPZ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/media-query/dist/chunk-6KW5I77S.mjs 'use client' ; // src/use-breakpoint.ts function useBreakpoint(arg) { var _a, _b; const opts = isObject(arg) ? arg : { fallback: arg != null ? arg : "base" }; const theme = chunk_UIGT7YZF_useTheme(); const breakpoints = theme.__breakpoints.details.map( ({ minMaxQuery, breakpoint }) => ({ breakpoint, query: minMaxQuery.replace("@media screen and ", "") }) ); const fallback = breakpoints.map((bp) => bp.breakpoint === opts.fallback); const values = useMediaQuery( breakpoints.map((bp) => bp.query), { fallback, ssr: opts.ssr } ); const index = values.findIndex((value) => value == true); return (_b = (_a = breakpoints[index]) == null ? void 0 : _a.breakpoint) != null ? _b : opts.fallback; } //# sourceMappingURL=chunk-6KW5I77S.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/media-query/dist/chunk-KC77MHL3.mjs 'use client' ; // src/use-breakpoint-value.ts function useBreakpointValue(values, arg) { var _a; const opts = isObject(arg) ? arg : { fallback: arg != null ? arg : "base" }; const breakpoint = useBreakpoint(opts); const theme = chunk_UIGT7YZF_useTheme(); if (!breakpoint) return; const breakpoints = Array.from(((_a = theme.__breakpoints) == null ? void 0 : _a.keys) || []); const obj = Array.isArray(values) ? Object.fromEntries( Object.entries(arrayToObjectNotation(values, breakpoints)).map( ([key, value]) => [key, value] ) ) : values; return getClosestValue(obj, breakpoint, breakpoints); } //# sourceMappingURL=chunk-KC77MHL3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/skeleton/dist/chunk-IYS4KVU2.mjs 'use client' ; // src/skeleton-text.tsx function range(count) { return Array(count).fill(1).map((_, index) => index + 1); } var defaultNoOfLines = 3; var SkeletonText = (props) => { const { noOfLines = defaultNoOfLines, spacing = "0.5rem", skeletonHeight = "0.5rem", className, startColor, endColor, isLoaded, fadeDuration, speed, variant, size, colorScheme, children, ...rest } = props; const noOfLinesValue = useBreakpointValue( typeof noOfLines === "number" ? [noOfLines] : noOfLines ) || defaultNoOfLines; const numbers = range(noOfLinesValue); const getWidth = (index) => { if (noOfLinesValue > 1) { return index === numbers.length ? "80%" : "100%"; } return "100%"; }; const _className = cx("chakra-skeleton__group", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.div, { className: _className, ...rest, children: numbers.map((number, index) => { if (isLoaded && index > 0) { return null; } const sizeProps = isLoaded ? null : { mb: number === numbers.length ? "0" : spacing, width: getWidth(number), height: skeletonHeight }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( Skeleton, { startColor, endColor, isLoaded, fadeDuration, speed, variant, size, colorScheme, ...sizeProps, // allows animating the children children: index === 0 ? children : void 0 }, numbers.length.toString() + number ); }) }); }; SkeletonText.displayName = "SkeletonText"; //# sourceMappingURL=chunk-IYS4KVU2.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/components/ChangelogSkeleton.tsx var ChangelogSkeleton = function ChangelogSkeleton() { return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, Array.from({ length: 5 }).map(function (_, i) { return /*#__PURE__*/external_React_default().createElement(Box, { key: i, mt: i > 0 ? '20px' : undefined }, /*#__PURE__*/external_React_default().createElement(Stack, { direction: "row", align: "center", justify: "space-between" }, /*#__PURE__*/external_React_default().createElement(Skeleton, { height: "17px", width: "80px" }), /*#__PURE__*/external_React_default().createElement(Skeleton, { height: "10px", width: "57px" })), /*#__PURE__*/external_React_default().createElement(Skeleton, { height: "26px", width: "60px", mt: "20px" }), /*#__PURE__*/external_React_default().createElement(SkeletonText, { mt: "20px", noOfLines: 5, spacing: "1" })); })); }; /* harmony default export */ const components_ChangelogSkeleton = (ChangelogSkeleton); ;// CONCATENATED MODULE: ./src/dashboard/components/Changelog.tsx var Changelog = function Changelog() { var _changelogQuery$data; var changelogQuery = (0,react_query_es.useQuery)(["changelog"], function () { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/changelog" }); }); if (changelogQuery.isLoading) { return /*#__PURE__*/external_React_default().createElement(components_ChangelogSkeleton, null); } return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, (_changelogQuery$data = changelogQuery.data) === null || _changelogQuery$data === void 0 ? void 0 : _changelogQuery$data.map(function (changelog) { return /*#__PURE__*/external_React_default().createElement(Box, { key: changelog.version, mb: "7" }, /*#__PURE__*/external_React_default().createElement(HStack, { justify: "space-between" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h4", fontSize: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Version %s"), changelog.version)), /*#__PURE__*/external_React_default().createElement(Text, null, changelog.date)), /*#__PURE__*/external_React_default().createElement(Box, null, Object.entries(changelog.changes).map(function (_ref, i) { var _CHANGELOG_TAG_COLORS, _CHANGELOG_TAG_COLORS2, _CHANGELOG_TAG_COLORS3; var _ref2 = _slicedToArray(_ref, 2), tag = _ref2[0], changes = _ref2[1]; return /*#__PURE__*/external_React_default().createElement(Box, { key: "".concat(changelog.version).concat(tag).concat(i), position: "relative", _after: { bgColor: (_CHANGELOG_TAG_COLORS = CHANGELOG_TAG_COLORS === null || CHANGELOG_TAG_COLORS === void 0 || (_CHANGELOG_TAG_COLORS2 = CHANGELOG_TAG_COLORS[tag.trim().toLowerCase()]) === null || _CHANGELOG_TAG_COLORS2 === void 0 ? void 0 : _CHANGELOG_TAG_COLORS2.bgColor) !== null && _CHANGELOG_TAG_COLORS !== void 0 ? _CHANGELOG_TAG_COLORS : "gray", bottom: 0, content: '""', height: "full", left: "12px", position: "absolute", top: 0, width: "2px" }, mb: "10", mt: "8" }, /*#__PURE__*/external_React_default().createElement(Tag, { colorScheme: CHANGELOG_TAG_COLORS === null || CHANGELOG_TAG_COLORS === void 0 || (_CHANGELOG_TAG_COLORS3 = CHANGELOG_TAG_COLORS[tag.trim().toLowerCase()]) === null || _CHANGELOG_TAG_COLORS3 === void 0 ? void 0 : _CHANGELOG_TAG_COLORS3.scheme, position: "sticky", zIndex: 2, top: "0" }, tag), /*#__PURE__*/external_React_default().createElement(Box, { pt: "10px" }, changes.map(function (change, j) { var _CHANGELOG_TAG_COLORS4, _CHANGELOG_TAG_COLORS5; return /*#__PURE__*/external_React_default().createElement(Text, { key: "".concat(changelog.version).concat(tag).concat(i).concat(j), pl: "10", position: "relative", mb: "4", _after: { bgColor: CHANGELOG_TAG_COLORS === null || CHANGELOG_TAG_COLORS === void 0 || (_CHANGELOG_TAG_COLORS4 = CHANGELOG_TAG_COLORS[tag.trim().toLowerCase()]) === null || _CHANGELOG_TAG_COLORS4 === void 0 ? void 0 : _CHANGELOG_TAG_COLORS4.bgColor, bgPosition: "50%", borderRadius: "50%", content: '""', height: "20px", width: "20px", position: "absolute", top: "50%", transform: "translateY(-50%)", left: "2px" }, _before: { color: CHANGELOG_TAG_COLORS === null || CHANGELOG_TAG_COLORS === void 0 || (_CHANGELOG_TAG_COLORS5 = CHANGELOG_TAG_COLORS[tag.trim().toLowerCase()]) === null || _CHANGELOG_TAG_COLORS5 === void 0 ? void 0 : _CHANGELOG_TAG_COLORS5.color, content: '"\\2713"', position: "absolute", left: "9px", top: "50%", transform: "translateY(-50%)", fontSize: "10px", fontWeight: "bold", zIndex: 1 } }, change); }))); }))); })); }; /* harmony default export */ const components_Changelog = (Changelog); ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js function typeof_typeof(o) { "@babel/helpers - typeof"; return typeof_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, typeof_typeof(o); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js function toPrimitive_toPrimitive(input, hint) { if (typeof_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function toPropertyKey_toPropertyKey(arg) { var key = toPrimitive_toPrimitive(arg, "string"); return typeof_typeof(key) === "symbol" ? key : String(key); } ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js function defineProperty_defineProperty(obj, key, value) { key = toPropertyKey_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-YSKACL7R.mjs 'use client' // src/use-shortcut.ts ; 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 [keys, setKeys] = (0,external_React_.useState)([]); const timeoutRef = (0,external_React_.useRef)(); const flush = () => { if (timeoutRef.current) { clearTimeout(timeoutRef.current); timeoutRef.current = null; } }; const clearKeysAfterDelay = () => { flush(); timeoutRef.current = setTimeout(() => { setKeys([]); timeoutRef.current = null; }, timeout); }; (0,external_React_.useEffect)(() => flush, []); function onKeyDown(fn) { return (event) => { if (event.key === "Backspace") { const keysCopy = [...keys]; keysCopy.pop(); setKeys(keysCopy); return; } if (isPrintableCharacter(event)) { const keysCopy = keys.concat(event.key); if (preventDefault(event)) { event.preventDefault(); event.stopPropagation(); } setKeys(keysCopy); fn(keysCopy.join("")); clearKeysAfterDelay(); } }; } return onKeyDown; } //# sourceMappingURL=chunk-YSKACL7R.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-BWUXSGSJ.mjs 'use client' // src/get-next-item-from-search.ts 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; } //# sourceMappingURL=chunk-BWUXSGSJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/clickable/dist/chunk-VDSXRTOE.mjs 'use client' // src/use-event-listeners.ts ; function useEventListeners() { const listeners = (0,external_React_.useRef)(/* @__PURE__ */ new Map()); const currentListeners = listeners.current; const add = (0,external_React_.useCallback)((el, type, listener, options) => { listeners.current.set(listener, { type, el, options }); el.addEventListener(type, listener, options); }, []); const remove = (0,external_React_.useCallback)( (el, type, listener, options) => { el.removeEventListener(type, listener, options); listeners.current.delete(listener); }, [] ); (0,external_React_.useEffect)( () => () => { currentListeners.forEach((value, key) => { remove(value.el, value.type, key, value.options); }); }, [remove, currentListeners] ); return { add, remove }; } //# sourceMappingURL=chunk-VDSXRTOE.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/clickable/dist/chunk-AXLEE3EK.mjs 'use client' ; // src/use-clickable.ts function isValidElement(event) { const element = event.target; const { tagName, isContentEditable } = element; return tagName !== "INPUT" && tagName !== "TEXTAREA" && isContentEditable !== true; } function useClickable(props = {}) { const { ref: htmlRef, isDisabled, isFocusable, clickOnEnter = true, clickOnSpace = true, onMouseDown, onMouseUp, onClick, onKeyDown, onKeyUp, tabIndex: tabIndexProp, onMouseOver, onMouseLeave, ...htmlProps } = props; const [isButton, setIsButton] = (0,external_React_.useState)(true); const [isPressed, setIsPressed] = (0,external_React_.useState)(false); const listeners = useEventListeners(); const refCallback = (node) => { if (!node) return; if (node.tagName !== "BUTTON") { setIsButton(false); } }; const tabIndex = isButton ? tabIndexProp : tabIndexProp || 0; const trulyDisabled = isDisabled && !isFocusable; const handleClick = (0,external_React_.useCallback)( (event) => { if (isDisabled) { event.stopPropagation(); event.preventDefault(); return; } const self = event.currentTarget; self.focus(); onClick == null ? void 0 : onClick(event); }, [isDisabled, onClick] ); const onDocumentKeyUp = (0,external_React_.useCallback)( (e) => { if (isPressed && isValidElement(e)) { e.preventDefault(); e.stopPropagation(); setIsPressed(false); listeners.remove(document, "keyup", onDocumentKeyUp, false); } }, [isPressed, listeners] ); const handleKeyDown = (0,external_React_.useCallback)( (event) => { onKeyDown == null ? void 0 : onKeyDown(event); if (isDisabled || event.defaultPrevented || event.metaKey) { return; } if (!isValidElement(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 self = event.currentTarget; self.click(); } listeners.add(document, "keyup", onDocumentKeyUp, false); }, [ isDisabled, isButton, onKeyDown, clickOnEnter, clickOnSpace, listeners, onDocumentKeyUp ] ); const handleKeyUp = (0,external_React_.useCallback)( (event) => { onKeyUp == null ? void 0 : onKeyUp(event); if (isDisabled || event.defaultPrevented || event.metaKey) return; if (!isValidElement(event.nativeEvent) || isButton) return; const shouldClickOnSpace = clickOnSpace && event.key === " "; if (shouldClickOnSpace) { event.preventDefault(); setIsPressed(false); const self = event.currentTarget; self.click(); } }, [clickOnSpace, isButton, isDisabled, onKeyUp] ); const onDocumentMouseUp = (0,external_React_.useCallback)( (event) => { if (event.button !== 0) return; setIsPressed(false); listeners.remove(document, "mouseup", onDocumentMouseUp, false); }, [listeners] ); const handleMouseDown = (0,external_React_.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,external_React_.useCallback)( (event) => { if (event.button !== 0) return; if (!isButton) { setIsPressed(false); } onMouseUp == null ? void 0 : onMouseUp(event); }, [onMouseUp, isButton] ); const handleMouseOver = (0,external_React_.useCallback)( (event) => { if (isDisabled) { event.preventDefault(); return; } onMouseOver == null ? void 0 : onMouseOver(event); }, [isDisabled, onMouseOver] ); const handleMouseLeave = (0,external_React_.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 }; } //# sourceMappingURL=chunk-AXLEE3EK.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/descendant/dist/chunk-3A5YOZDU.mjs 'use client' var chunk_3A5YOZDU_defProp = Object.defineProperty; var chunk_3A5YOZDU_defNormalProp = (obj, key, value) => key in obj ? chunk_3A5YOZDU_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var chunk_3A5YOZDU_publicField = (obj, key, value) => { chunk_3A5YOZDU_defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; // src/utils.ts 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 chunk_3A5YOZDU_isElement = (el) => typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE; function chunk_3A5YOZDU_getNextIndex(current, max, loop) { let next = current + 1; if (loop && next >= max) next = 0; return next; } function getPrevIndex(current, max, loop) { let next = current - 1; if (loop && next < 0) next = max; return next; } var chunk_3A5YOZDU_useSafeLayoutEffect = typeof window !== "undefined" ? external_React_.useLayoutEffect : external_React_.useEffect; var cast = (value) => value; //# sourceMappingURL=chunk-3A5YOZDU.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/descendant/dist/chunk-FT3H4P66.mjs 'use client' ; // src/descendant.ts var DescendantsManager = class { constructor() { chunk_3A5YOZDU_publicField(this, "descendants", /* @__PURE__ */ new Map()); chunk_3A5YOZDU_publicField(this, "register", (nodeOrOptions) => { if (nodeOrOptions == null) return; if (chunk_3A5YOZDU_isElement(nodeOrOptions)) { return this.registerNode(nodeOrOptions); } return (node) => { this.registerNode(node, nodeOrOptions); }; }); chunk_3A5YOZDU_publicField(this, "unregister", (node) => { this.descendants.delete(node); const sorted = sortNodes(Array.from(this.descendants.keys())); this.assignIndex(sorted); }); chunk_3A5YOZDU_publicField(this, "destroy", () => { this.descendants.clear(); }); chunk_3A5YOZDU_publicField(this, "assignIndex", (descendants) => { this.descendants.forEach((descendant) => { const index = descendants.indexOf(descendant.node); descendant.index = index; descendant.node.dataset["index"] = descendant.index.toString(); }); }); chunk_3A5YOZDU_publicField(this, "count", () => this.descendants.size); chunk_3A5YOZDU_publicField(this, "enabledCount", () => this.enabledValues().length); chunk_3A5YOZDU_publicField(this, "values", () => { const values = Array.from(this.descendants.values()); return values.sort((a, b) => a.index - b.index); }); chunk_3A5YOZDU_publicField(this, "enabledValues", () => { return this.values().filter((descendant) => !descendant.disabled); }); chunk_3A5YOZDU_publicField(this, "item", (index) => { if (this.count() === 0) return void 0; return this.values()[index]; }); chunk_3A5YOZDU_publicField(this, "enabledItem", (index) => { if (this.enabledCount() === 0) return void 0; return this.enabledValues()[index]; }); chunk_3A5YOZDU_publicField(this, "first", () => this.item(0)); chunk_3A5YOZDU_publicField(this, "firstEnabled", () => this.enabledItem(0)); chunk_3A5YOZDU_publicField(this, "last", () => this.item(this.descendants.size - 1)); chunk_3A5YOZDU_publicField(this, "lastEnabled", () => { const lastIndex = this.enabledValues().length - 1; return this.enabledItem(lastIndex); }); chunk_3A5YOZDU_publicField(this, "indexOf", (node) => { var _a, _b; if (!node) return -1; return (_b = (_a = this.descendants.get(node)) == null ? void 0 : _a.index) != null ? _b : -1; }); chunk_3A5YOZDU_publicField(this, "enabledIndexOf", (node) => { if (node == null) return -1; return this.enabledValues().findIndex((i) => i.node.isSameNode(node)); }); chunk_3A5YOZDU_publicField(this, "next", (index, loop = true) => { const next = chunk_3A5YOZDU_getNextIndex(index, this.count(), loop); return this.item(next); }); chunk_3A5YOZDU_publicField(this, "nextEnabled", (index, loop = true) => { const item = this.item(index); if (!item) return; const enabledIndex = this.enabledIndexOf(item.node); const nextEnabledIndex = chunk_3A5YOZDU_getNextIndex( enabledIndex, this.enabledCount(), loop ); return this.enabledItem(nextEnabledIndex); }); chunk_3A5YOZDU_publicField(this, "prev", (index, loop = true) => { const prev = getPrevIndex(index, this.count() - 1, loop); return this.item(prev); }); chunk_3A5YOZDU_publicField(this, "prevEnabled", (index, loop = true) => { const item = this.item(index); if (!item) return; const enabledIndex = this.enabledIndexOf(item.node); const prevEnabledIndex = getPrevIndex( enabledIndex, this.enabledCount() - 1, loop ); return this.enabledItem(prevEnabledIndex); }); chunk_3A5YOZDU_publicField(this, "registerNode", (node, options) => { if (!node || this.descendants.has(node)) return; const keys = Array.from(this.descendants.keys()).concat(node); const sorted = sortNodes(keys); if (options == null ? void 0 : options.disabled) { options.disabled = !!options.disabled; } const descendant = { node, index: -1, ...options }; this.descendants.set(node, descendant); this.assignIndex(sorted); }); } }; //# sourceMappingURL=chunk-FT3H4P66.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/descendant/dist/chunk-OCNORRQU.mjs 'use client' ; // src/use-descendant.ts function useDescendants() { const descendants = (0,external_React_.useRef)(new DescendantsManager()); chunk_3A5YOZDU_useSafeLayoutEffect(() => { return () => descendants.current.destroy(); }); return descendants.current; } var [DescendantsContextProvider, useDescendantsContext] = createContext({ name: "DescendantsProvider", errorMessage: "useDescendantsContext must be used within DescendantsProvider" }); function useDescendant(options) { const descendants = useDescendantsContext(); const [index, setIndex] = (0,external_React_.useState)(-1); const ref = (0,external_React_.useRef)(null); chunk_3A5YOZDU_useSafeLayoutEffect(() => { return () => { if (!ref.current) return; descendants.unregister(ref.current); }; }, []); chunk_3A5YOZDU_useSafeLayoutEffect(() => { if (!ref.current) return; const dataIndex = Number(ref.current.dataset["index"]); if (index != dataIndex && !Number.isNaN(dataIndex)) { setIndex(dataIndex); } }); const refCallback = options ? cast(descendants.register(options)) : cast(descendants.register); return { descendants, index, enabledIndex: descendants.enabledIndexOf(ref.current), register: mergeRefs(refCallback, ref) }; } function createDescendantContext() { const ContextProvider = cast(DescendantsContextProvider); const _useDescendantsContext = () => cast(useDescendantsContext()); const _useDescendant = (options) => useDescendant(options); const _useDescendants = () => useDescendants(); return [ // context provider ContextProvider, // 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 ]; } //# sourceMappingURL=chunk-OCNORRQU.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-focus-effect/dist/index.mjs 'use client' // src/index.ts ; function preventReturnFocus(containerRef) { const el = containerRef.current; if (!el) return false; const activeElement = chunk_3XANSPY5_getActiveElement(el); if (!activeElement) return false; if (el.contains(activeElement)) return false; if (chunk_ROURZMX4_isTabbable(activeElement)) return true; return false; } function useFocusOnHide(containerRef, options) { const { shouldFocus: shouldFocusProp, visible, focusRef } = options; const shouldFocus = shouldFocusProp && !visible; dist_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 = dist_isRefObject(target) ? target.current : target; const autoFocusValue = shouldFocus && visible; const autoFocusRef = useRef(autoFocusValue); const lastVisibleRef = useRef(visible); useSafeLayoutEffect(() => { if (!lastVisibleRef.current && visible) { autoFocusRef.current = autoFocusValue; } lastVisibleRef.current = visible; }, [visible, autoFocusValue]); const onFocus = 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 _a; (_a = focusRef.current) == null ? void 0 : _a.focus({ preventScroll }); }); } else { const tabbableEls = getAllFocusable(element); if (tabbableEls.length > 0) { requestAnimationFrame(() => { tabbableEls[0].focus({ preventScroll }); }); } } }, [visible, preventScroll, element, focusRef]); useUpdateEffect(() => { onFocus(); }, [onFocus]); useEventListener(element, "transitionend", onFocus); } function dist_isRefObject(val) { return "current" in val; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/popper/dist/chunk-6WT2JRWX.mjs 'use client' // src/utils.ts var chunk_6WT2JRWX_toVar = (value, fallback) => ({ var: value, varRef: fallback ? `var(${value}, ${fallback})` : `var(${value})` }); var cssVars = { arrowShadowColor: chunk_6WT2JRWX_toVar("--popper-arrow-shadow-color"), arrowSize: chunk_6WT2JRWX_toVar("--popper-arrow-size", "8px"), arrowSizeHalf: chunk_6WT2JRWX_toVar("--popper-arrow-size-half"), arrowBg: chunk_6WT2JRWX_toVar("--popper-arrow-bg"), transformOrigin: chunk_6WT2JRWX_toVar("--popper-transform-origin"), arrowOffset: chunk_6WT2JRWX_toVar("--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; } //# sourceMappingURL=chunk-6WT2JRWX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/popper/dist/chunk-P4KPSAOW.mjs 'use client' ; // src/modifiers.ts var matchWidth = { name: "matchWidth", enabled: true, phase: "beforeWrite", requires: ["computeStyles"], fn: ({ state }) => { state.styles.popper.width = `${state.rects.reference.width}px`; }, effect: ({ state }) => () => { const reference = state.elements.reference; state.elements.popper.style.width = `${reference.offsetWidth}px`; } }; var transformOrigin = { name: "transformOrigin", enabled: true, phase: "write", fn: ({ state }) => { setTransformOrigin(state); }, effect: ({ state }) => () => { setTransformOrigin(state); } }; var setTransformOrigin = (state) => { state.elements.popper.style.setProperty( cssVars.transformOrigin.var, toTransformOrigin(state.placement) ); }; var positionArrow = { name: "positionArrow", enabled: true, phase: "afterWrite", fn: ({ state }) => { setArrowStyles(state); } }; var setArrowStyles = (state) => { var _a; if (!state.placement) return; const overrides = getArrowStyle(state.placement); if (((_a = state.elements) == null ? void 0 : _a.arrow) && overrides) { Object.assign(state.elements.arrow.style, { [overrides.property]: overrides.value, width: cssVars.arrowSize.varRef, height: cssVars.arrowSize.varRef, zIndex: -1 }); const vars = { [cssVars.arrowSizeHalf.var]: `calc(${cssVars.arrowSize.varRef} / 2 - 1px)`, [cssVars.arrowOffset.var]: `calc(${cssVars.arrowSizeHalf.varRef} * -1)` }; for (const property in vars) { state.elements.arrow.style.setProperty(property, vars[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 }) => { setInnerArrowStyles(state); }, effect: ({ state }) => () => { setInnerArrowStyles(state); } }; var setInnerArrowStyles = (state) => { if (!state.elements.arrow) return; const inner = state.elements.arrow.querySelector( "[data-popper-arrow-inner]" ); if (!inner) return; const boxShadow = getBoxShadow(state.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))` }); }; //# sourceMappingURL=chunk-P4KPSAOW.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/popper/dist/chunk-AUJXXV3B.mjs 'use client' // src/popper.placement.ts 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 _a, _b; const value = ((_a = logicals[placement]) == null ? void 0 : _a[dir]) || placement; if (dir === "ltr") return value; return (_b = opposites[placement]) != null ? _b : value; } //# sourceMappingURL=chunk-AUJXXV3B.mjs.map ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js function getWindow(node) { if (node == null) { return window; } if (node.toString() !== '[object Window]') { var ownerDocument = node.ownerDocument; return ownerDocument ? ownerDocument.defaultView || window : window; } return node; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js function instanceOf_isElement(node) { var OwnElement = getWindow(node).Element; return node instanceof OwnElement || node instanceof Element; } function instanceOf_isHTMLElement(node) { var OwnElement = getWindow(node).HTMLElement; return node instanceof OwnElement || node instanceof HTMLElement; } function isShadowRoot(node) { // IE 11 has no ShadowRoot if (typeof ShadowRoot === 'undefined') { return false; } var OwnElement = getWindow(node).ShadowRoot; return node instanceof OwnElement || node instanceof ShadowRoot; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js var math_max = Math.max; var math_min = Math.min; var round = Math.round; ;// CONCATENATED MODULE: ./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; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js function isLayoutViewport() { return !/^((?!chrome|android).)*safari/i.test(getUAString()); } ;// CONCATENATED MODULE: ./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 && instanceOf_isHTMLElement(element)) { scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; } var _ref = instanceOf_isElement(element) ? getWindow(element) : window, visualViewport = _ref.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: width, height: height, top: y, right: x + width, bottom: y + height, left: x, x: x, y: y }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js function getWindowScroll(node) { var win = getWindow(node); var scrollLeft = win.pageXOffset; var scrollTop = win.pageYOffset; return { scrollLeft: scrollLeft, scrollTop: scrollTop }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js function getHTMLElementScroll(element) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js function getNodeScroll(node) { if (node === getWindow(node) || !instanceOf_isHTMLElement(node)) { return getWindowScroll(node); } else { return getHTMLElementScroll(node); } } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js function getNodeName(element) { return element ? (element.nodeName || '').toLowerCase() : null; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js function getDocumentElement(element) { // $FlowFixMe[incompatible-return]: assume body is always available return ((instanceOf_isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] element.document) || window.document).documentElement; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js function getWindowScrollBarX(element) { // If <html> has a CSS width greater than the viewport, then this will be // incorrect for RTL. // Popper 1 is broken in this case and never had a bug report so let's assume // it's not an issue. I don't think anyone ever specifies width on <html> // anyway. // Browsers where the left scrollbar doesn't cause an issue report `0` for // this (e.g. Edge 2019, IE11, Safari) return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js function getComputedStyle_getComputedStyle(element) { return getWindow(element).getComputedStyle(element); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js function isScrollParent(element) { // Firefox wants us to check `-x` and `-y` variations as well var _getComputedStyle = getComputedStyle_getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); } ;// CONCATENATED MODULE: ./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; } // Returns the composite rect of an element relative to its offsetParent. // Composite means it takes into account transforms as well as layout. function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { if (isFixed === void 0) { isFixed = false; } var isOffsetParentAnElement = instanceOf_isHTMLElement(offsetParent); var offsetParentIsScaled = instanceOf_isHTMLElement(offsetParent) && isElementScaled(offsetParent); var documentElement = getDocumentElement(offsetParent); var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); var scroll = { scrollLeft: 0, scrollTop: 0 }; var offsets = { x: 0, y: 0 }; if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 isScrollParent(documentElement)) { scroll = getNodeScroll(offsetParent); } if (instanceOf_isHTMLElement(offsetParent)) { offsets = getBoundingClientRect(offsetParent, true); offsets.x += offsetParent.clientLeft; offsets.y += offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } return { x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, width: rect.width, height: rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js // Returns the layout rect of an element relative to its offsetParent. Layout // means it doesn't take into account transforms. function getLayoutRect(element) { var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. // Fixes https://github.com/popperjs/popper-core/issues/1223 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: width, height: height }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js function getParentNode_getParentNode(element) { if (getNodeName(element) === 'html') { return element; } return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle // $FlowFixMe[incompatible-return] // $FlowFixMe[prop-missing] element.assignedSlot || // step into the shadow DOM of the parent of a slotted node element.parentNode || ( // DOM Element detected isShadowRoot(element) ? element.host : null) || // ShadowRoot detected // $FlowFixMe[incompatible-call]: HTMLElement is a Node getDocumentElement(element) // fallback ); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js function getScrollParent(node) { if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { // $FlowFixMe[incompatible-return]: assume body is always available return node.ownerDocument.body; } if (instanceOf_isHTMLElement(node) && isScrollParent(node)) { return node; } return getScrollParent(getParentNode_getParentNode(node)); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js /* given a DOM element, return the list of all scroll parents, up the list of ancesors until we get to the top window object. This list is what we attach scroll listeners to, because if any of these parent elements scroll, we'll need to re-calculate the reference element's position. */ function listScrollParents(element, list) { var _element$ownerDocumen; if (list === void 0) { list = []; } var scrollParent = getScrollParent(element); var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); var win = getWindow(scrollParent); var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; var updatedList = list.concat(target); return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here updatedList.concat(listScrollParents(getParentNode_getParentNode(target))); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js function isTableElement(element) { return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js function getTrueOffsetParent(element) { if (!instanceOf_isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 getComputedStyle_getComputedStyle(element).position === 'fixed') { return null; } return element.offsetParent; } // `.offsetParent` reports `null` for fixed elements, while absolute elements // return the containing block function getContainingBlock(element) { var isFirefox = /firefox/i.test(getUAString()); var isIE = /Trident/i.test(getUAString()); if (isIE && instanceOf_isHTMLElement(element)) { // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport var elementCss = getComputedStyle_getComputedStyle(element); if (elementCss.position === 'fixed') { return null; } } var currentNode = getParentNode_getParentNode(element); if (isShadowRoot(currentNode)) { currentNode = currentNode.host; } while (instanceOf_isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { var css = getComputedStyle_getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that // create a containing block. // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { return currentNode; } else { currentNode = currentNode.parentNode; } } return null; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element) { var window = getWindow(element); var offsetParent = getTrueOffsetParent(element); while (offsetParent && isTableElement(offsetParent) && getComputedStyle_getComputedStyle(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent); } if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle_getComputedStyle(offsetParent).position === 'static')) { return window; } return offsetParent || getContainingBlock(element) || window; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js var enums_top = 'top'; var bottom = 'bottom'; var right = 'right'; var left = 'left'; var enums_auto = 'auto'; var basePlacements = [enums_top, bottom, right, left]; var start = 'start'; var end = 'end'; var clippingParents = 'clippingParents'; var viewport = 'viewport'; var popper = 'popper'; var reference = 'reference'; var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { return acc.concat([placement + "-" + start, placement + "-" + end]); }, []); var enums_placements = /*#__PURE__*/[].concat(basePlacements, [enums_auto]).reduce(function (acc, placement) { return acc.concat([placement, placement + "-" + start, placement + "-" + end]); }, []); // modifiers that need to read the DOM var beforeRead = 'beforeRead'; var read = 'read'; var afterRead = 'afterRead'; // pure-logic modifiers var beforeMain = 'beforeMain'; var main = 'main'; var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) var beforeWrite = 'beforeWrite'; var write = 'write'; var afterWrite = 'afterWrite'; var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js // source: https://stackoverflow.com/questions/49875255 function orderModifiers_order(modifiers) { var map = new Map(); var visited = new Set(); var result = []; modifiers.forEach(function (modifier) { map.set(modifier.name, modifier); }); // On visiting object, check for its dependencies and visit them recursively 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)) { // check for visited object sort(modifier); } }); return result; } function orderModifiers(modifiers) { // order based on dependencies var orderedModifiers = orderModifiers_order(modifiers); // order based on phase return modifierPhases.reduce(function (acc, phase) { return acc.concat(orderedModifiers.filter(function (modifier) { return modifier.phase === phase; })); }, []); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js function debounce(fn) { var pending; return function () { if (!pending) { pending = new Promise(function (resolve) { Promise.resolve().then(function () { pending = undefined; resolve(fn()); }); }); } return pending; }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js function mergeByName(modifiers) { var merged = modifiers.reduce(function (merged, current) { var existing = merged[current.name]; merged[current.name] = existing ? Object.assign({}, existing, current, { options: Object.assign({}, existing.options, current.options), data: Object.assign({}, existing.data, current.data) }) : current; return merged; }, {}); // IE11 does not support Object.values return Object.keys(merged).map(function (key) { return merged[key]; }); } ;// CONCATENATED MODULE: ./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, defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; return function createPopper(reference, popper, options) { if (options === void 0) { options = defaultOptions; } var state = { placement: 'bottom', orderedModifiers: [], options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), modifiersData: {}, elements: { reference: reference, popper: popper }, attributes: {}, styles: {} }; var effectCleanupFns = []; var isDestroyed = false; var instance = { state: state, setOptions: function setOptions(setOptionsAction) { var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; cleanupModifierEffects(); state.options = Object.assign({}, defaultOptions, state.options, options); state.scrollParents = { reference: instanceOf_isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], popper: listScrollParents(popper) }; // Orders the modifiers based on their dependencies and `phase` // properties var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers state.orderedModifiers = orderedModifiers.filter(function (m) { return m.enabled; }); runModifierEffects(); return instance.update(); }, // Sync update – it will always be executed, even if not necessary. This // is useful for low frequency updates where sync behavior simplifies the // logic. // For high frequency updates (e.g. `resize` and `scroll` events), always // prefer the async Popper#update method forceUpdate: function forceUpdate() { if (isDestroyed) { return; } var _state$elements = state.elements, reference = _state$elements.reference, popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements // anymore if (!areValidElements(reference, popper)) { return; } // Store the reference and popper rects to be read by modifiers state.rects = { reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), popper: getLayoutRect(popper) }; // Modifiers have the ability to reset the current update cycle. The // most common use case for this is the `flip` modifier changing the // placement, which then needs to re-run all the modifiers, because the // logic was previously ran for the previous placement and is therefore // stale/incorrect state.reset = false; state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier // is filled with the initial data specified by the modifier. This means // it doesn't persist and is fresh on each update. // To ensure persistent data, use `${name}#persistent` state.orderedModifiers.forEach(function (modifier) { return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); }); for (var index = 0; index < state.orderedModifiers.length; index++) { if (state.reset === true) { state.reset = false; index = -1; continue; } var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; if (typeof fn === 'function') { state = fn({ state: state, options: _options, name: name, instance: instance }) || state; } } }, // Async and optimistically optimized update – it will not be executed if // not necessary (debounced to run at most once-per-tick) update: debounce(function () { return new Promise(function (resolve) { instance.forceUpdate(); resolve(state); }); }), destroy: function destroy() { cleanupModifierEffects(); isDestroyed = true; } }; if (!areValidElements(reference, popper)) { return instance; } instance.setOptions(options).then(function (state) { if (!isDestroyed && options.onFirstUpdate) { options.onFirstUpdate(state); } }); // Modifiers have the ability to execute arbitrary code before the first // update cycle runs. They will be executed in the same order as the update // cycle. This is useful when a modifier adds some persistent data that // other modifiers need to use, but the modifier is run after the dependent // one. function runModifierEffects() { state.orderedModifiers.forEach(function (_ref) { var name = _ref.name, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options, effect = _ref.effect; if (typeof effect === 'function') { var cleanupFn = effect({ state: state, name: name, instance: instance, options: options }); var noopFn = function noopFn() {}; effectCleanupFns.push(cleanupFn || noopFn); } }); } function cleanupModifierEffects() { effectCleanupFns.forEach(function (fn) { return fn(); }); effectCleanupFns = []; } return instance; }; } var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js // eslint-disable-next-line import/no-unused-modules var passive = { passive: true }; function eventListeners_effect(_ref) { var state = _ref.state, instance = _ref.instance, options = _ref.options; var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; var window = getWindow(state.elements.popper); var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); if (scroll) { scrollParents.forEach(function (scrollParent) { scrollParent.addEventListener('scroll', instance.update, passive); }); } if (resize) { window.addEventListener('resize', instance.update, passive); } return function () { if (scroll) { scrollParents.forEach(function (scrollParent) { scrollParent.removeEventListener('scroll', instance.update, passive); }); } if (resize) { window.removeEventListener('resize', instance.update, passive); } }; } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const eventListeners = ({ name: 'eventListeners', enabled: true, phase: 'write', fn: function fn() {}, effect: eventListeners_effect, data: {} }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js function getBasePlacement(placement) { return placement.split('-')[0]; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js function getVariation(placement) { return placement.split('-')[1]; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js function getMainAxisFromPlacement(placement) { return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js function computeOffsets(_ref) { var reference = _ref.reference, element = _ref.element, placement = _ref.placement; var basePlacement = placement ? getBasePlacement(placement) : null; var variation = placement ? getVariation(placement) : null; var commonX = reference.x + reference.width / 2 - element.width / 2; var commonY = reference.y + reference.height / 2 - element.height / 2; var offsets; switch (basePlacement) { case enums_top: offsets = { x: commonX, y: reference.y - element.height }; break; case bottom: offsets = { x: commonX, y: reference.y + reference.height }; break; case right: offsets = { x: reference.x + reference.width, y: commonY }; break; case left: offsets = { x: reference.x - element.width, y: commonY }; break; default: offsets = { x: reference.x, y: reference.y }; } var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; if (mainAxis != null) { var len = mainAxis === 'y' ? 'height' : 'width'; switch (variation) { case start: offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); break; case end: offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); break; default: } } return offsets; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js function popperOffsets(_ref) { var state = _ref.state, name = _ref.name; // Offsets are the actual position the popper needs to have to be // properly positioned near its reference element // This is the most basic placement, and will be adjusted by // the modifiers in the next step state.modifiersData[name] = computeOffsets({ reference: state.rects.reference, element: state.rects.popper, strategy: 'absolute', placement: state.placement }); } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_popperOffsets = ({ name: 'popperOffsets', enabled: true, phase: 'read', fn: popperOffsets, data: {} }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js // eslint-disable-next-line import/no-unused-modules var unsetSides = { top: 'auto', right: 'auto', bottom: 'auto', left: 'auto' }; // Round the offsets to the nearest suitable subpixel based on the DPR. // Zooming can change the DPR, but it seems to report a value that will // cleanly divide the values into the appropriate subpixels. function roundOffsetsByDPR(_ref, win) { var x = _ref.x, y = _ref.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 popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; var _offsets$x = offsets.x, 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: x, y: y }) : { x: x, y: y }; x = _ref3.x; y = _ref3.y; var hasX = offsets.hasOwnProperty('x'); var hasY = offsets.hasOwnProperty('y'); var sideX = left; var sideY = enums_top; var win = window; if (adaptive) { var offsetParent = getOffsetParent(popper); var heightProp = 'clientHeight'; var widthProp = 'clientWidth'; if (offsetParent === getWindow(popper)) { offsetParent = getDocumentElement(popper); if (getComputedStyle_getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { heightProp = 'scrollHeight'; widthProp = 'scrollWidth'; } } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it offsetParent = offsetParent; if (placement === enums_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 === enums_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 commonStyles = Object.assign({ position: position }, adaptive && unsetSides); var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ x: x, y: y }, getWindow(popper)) : { x: x, y: y }; x = _ref4.x; y = _ref4.y; if (gpuAcceleration) { var _Object$assign; return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); } return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); } function computeStyles(_ref5) { var state = _ref5.state, options = _ref5.options; var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; var commonStyles = { placement: getBasePlacement(state.placement), variation: getVariation(state.placement), popper: state.elements.popper, popperRect: state.rects.popper, gpuAcceleration: gpuAcceleration, isFixed: state.options.strategy === 'fixed' }; if (state.modifiersData.popperOffsets != null) { state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { offsets: state.modifiersData.popperOffsets, position: state.options.strategy, adaptive: adaptive, roundOffsets: roundOffsets }))); } if (state.modifiersData.arrow != null) { state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { offsets: state.modifiersData.arrow, position: 'absolute', adaptive: false, roundOffsets: roundOffsets }))); } state.attributes.popper = Object.assign({}, state.attributes.popper, { 'data-popper-placement': state.placement }); } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_computeStyles = ({ name: 'computeStyles', enabled: true, phase: 'beforeWrite', fn: computeStyles, data: {} }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js // This modifier takes the styles prepared by the `computeStyles` modifier // and applies them to the HTMLElements such as popper and arrow function applyStyles(_ref) { var state = _ref.state; Object.keys(state.elements).forEach(function (name) { var style = state.styles[name] || {}; var attributes = state.attributes[name] || {}; var element = state.elements[name]; // arrow is optional + virtual elements if (!instanceOf_isHTMLElement(element) || !getNodeName(element)) { return; } // Flow doesn't support to extend this property, but it's the most // effective way to apply styles to an HTMLElement // $FlowFixMe[cannot-write] Object.assign(element.style, style); Object.keys(attributes).forEach(function (name) { var value = attributes[name]; if (value === false) { element.removeAttribute(name); } else { element.setAttribute(name, value === true ? '' : value); } }); }); } function applyStyles_effect(_ref2) { var state = _ref2.state; var initialStyles = { popper: { position: state.options.strategy, left: '0', top: '0', margin: '0' }, arrow: { position: 'absolute' }, reference: {} }; Object.assign(state.elements.popper.style, initialStyles.popper); state.styles = initialStyles; if (state.elements.arrow) { Object.assign(state.elements.arrow.style, initialStyles.arrow); } return function () { Object.keys(state.elements).forEach(function (name) { var element = state.elements[name]; var attributes = state.attributes[name] || {}; var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them var style = styleProperties.reduce(function (style, property) { style[property] = ''; return style; }, {}); // arrow is optional + virtual elements if (!instanceOf_isHTMLElement(element) || !getNodeName(element)) { return; } Object.assign(element.style, style); Object.keys(attributes).forEach(function (attribute) { element.removeAttribute(attribute); }); }); }; } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_applyStyles = ({ name: 'applyStyles', enabled: true, phase: 'write', fn: applyStyles, effect: applyStyles_effect, requires: ['computeStyles'] }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js // eslint-disable-next-line import/no-unused-modules function distanceAndSkiddingToXY(placement, rects, offset) { var basePlacement = getBasePlacement(placement); var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { placement: placement })) : offset, skidding = _ref[0], distance = _ref[1]; skidding = skidding || 0; distance = (distance || 0) * invertDistance; return [left, right].indexOf(basePlacement) >= 0 ? { x: distance, y: skidding } : { x: skidding, y: distance }; } function offset(_ref2) { var state = _ref2.state, options = _ref2.options, name = _ref2.name; var _options$offset = options.offset, offset = _options$offset === void 0 ? [0, 0] : _options$offset; var data = enums_placements.reduce(function (acc, placement) { acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); return acc; }, {}); var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y; if (state.modifiersData.popperOffsets != null) { state.modifiersData.popperOffsets.x += x; state.modifiersData.popperOffsets.y += y; } state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_offset = ({ name: 'offset', enabled: true, phase: 'main', requires: ['popperOffsets'], fn: offset }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js var getOppositePlacement_hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, function (matched) { return getOppositePlacement_hash[matched]; }); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js var getOppositeVariationPlacement_hash = { start: 'end', end: 'start' }; function getOppositeVariationPlacement(placement) { return placement.replace(/start|end/g, function (matched) { return getOppositeVariationPlacement_hash[matched]; }); } ;// CONCATENATED MODULE: ./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: width, height: height, x: x + getWindowScrollBarX(element), y: y }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js // Gets the entire size of the scrollable document area, even extending outside // of the `<html>` and `<body>` rect bounds if horizontally scrollable 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 = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); var x = -winScroll.scrollLeft + getWindowScrollBarX(element); var y = -winScroll.scrollTop; if (getComputedStyle_getComputedStyle(body || html).direction === 'rtl') { x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; } return { width: width, height: height, x: x, y: y }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js function contains_contains(parent, child) { var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method if (parent.contains(child)) { return true; } // then fallback to custom implementation with Shadow DOM support else if (rootNode && isShadowRoot(rootNode)) { var next = child; do { if (next && parent.isSameNode(next)) { return true; } // $FlowFixMe[prop-missing]: need a better way to handle this... next = next.parentNode || next.host; } while (next); } // Give up, the result is false return false; } ;// CONCATENATED MODULE: ./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 }); } ;// CONCATENATED MODULE: ./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)) : instanceOf_isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); } // A "clipping parent" is an overflowable container with the characteristic of // clipping (or hiding) overflowing elements with a position different from // `initial` function getClippingParents(element) { var clippingParents = listScrollParents(getParentNode_getParentNode(element)); var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle_getComputedStyle(element).position) >= 0; var clipperElement = canEscapeClipping && instanceOf_isHTMLElement(element) ? getOffsetParent(element) : element; if (!instanceOf_isElement(clipperElement)) { return []; } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 return clippingParents.filter(function (clippingParent) { return instanceOf_isElement(clippingParent) && contains_contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; }); } // Gets the maximum area that the element is visible in due to any number of // clipping parents function getClippingRect(element, boundary, rootBoundary, strategy) { var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); var clippingParents = [].concat(mainClippingParents, [rootBoundary]); var firstClippingParent = clippingParents[0]; var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { var rect = getClientRectFromMixedType(element, clippingParent, strategy); accRect.top = math_max(rect.top, accRect.top); accRect.right = math_min(rect.right, accRect.right); accRect.bottom = math_min(rect.bottom, accRect.bottom); accRect.left = math_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; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js function getFreshSideObject() { return { top: 0, right: 0, bottom: 0, left: 0 }; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js function mergePaddingObject(paddingObject) { return Object.assign({}, getFreshSideObject(), paddingObject); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js function expandToHashMap(value, keys) { return keys.reduce(function (hashMap, key) { hashMap[key] = value; return hashMap; }, {}); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js // eslint-disable-next-line import/no-unused-modules function detectOverflow(state, options) { if (options === void 0) { options = {}; } var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); var altContext = elementContext === popper ? reference : popper; var popperRect = state.rects.popper; var element = state.elements[altBoundary ? altContext : elementContext]; var clippingClientRect = getClippingRect(instanceOf_isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); var referenceClientRect = getBoundingClientRect(state.elements.reference); var popperOffsets = computeOffsets({ reference: referenceClientRect, element: popperRect, strategy: 'absolute', placement: placement }); var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect // 0 or negative = within the clipping rect var overflowOffsets = { top: clippingClientRect.top - elementClientRect.top + paddingObject.top, bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, left: clippingClientRect.left - elementClientRect.left + paddingObject.left, right: elementClientRect.right - clippingClientRect.right + paddingObject.right }; var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element if (elementContext === popper && offsetData) { var offset = offsetData[placement]; Object.keys(overflowOffsets).forEach(function (key) { var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; overflowOffsets[key] += offset[axis] * multiply; }); } return overflowOffsets; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js function computeAutoPlacement(state, options) { if (options === void 0) { options = {}; } var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; var variation = getVariation(placement); var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { return getVariation(placement) === variation; }) : basePlacements; var allowedPlacements = placements.filter(function (placement) { return allowedAutoPlacements.indexOf(placement) >= 0; }); if (allowedPlacements.length === 0) { allowedPlacements = placements; } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... var overflows = allowedPlacements.reduce(function (acc, placement) { acc[placement] = detectOverflow(state, { placement: placement, boundary: boundary, rootBoundary: rootBoundary, padding: padding })[getBasePlacement(placement)]; return acc; }, {}); return Object.keys(overflows).sort(function (a, b) { return overflows[a] - overflows[b]; }); } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js // eslint-disable-next-line import/no-unused-modules function getExpandedFallbackPlacements(placement) { if (getBasePlacement(placement) === enums_auto) { return []; } var oppositePlacement = getOppositePlacement(placement); return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; } function flip(_ref) { var state = _ref.state, options = _ref.options, name = _ref.name; if (state.modifiersData[name]._skip) { return; } var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; var preferredPlacement = state.options.placement; var basePlacement = getBasePlacement(preferredPlacement); var isBasePlacement = basePlacement === preferredPlacement; var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { return acc.concat(getBasePlacement(placement) === enums_auto ? computeAutoPlacement(state, { placement: placement, boundary: boundary, rootBoundary: rootBoundary, padding: padding, flipVariations: flipVariations, allowedAutoPlacements: allowedAutoPlacements }) : placement); }, []); var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var checksMap = new Map(); var makeFallbackChecks = true; var firstFittingPlacement = placements[0]; for (var i = 0; i < placements.length; i++) { var placement = placements[i]; var _basePlacement = getBasePlacement(placement); var isStartVariation = getVariation(placement) === start; var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; var len = isVertical ? 'width' : 'height'; var overflow = detectOverflow(state, { placement: placement, boundary: boundary, rootBoundary: rootBoundary, altBoundary: altBoundary, padding: padding }); var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_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) { // `2` may be desired in some cases – research later var numberOfChecks = flipVariations ? 3 : 1; var _loop = function _loop(_i) { var fittingPlacement = placements.find(function (placement) { var checks = checksMap.get(placement); if (checks) { return checks.slice(0, _i).every(function (check) { return check; }); } }); if (fittingPlacement) { firstFittingPlacement = fittingPlacement; return "break"; } }; for (var _i = numberOfChecks; _i > 0; _i--) { var _ret = _loop(_i); if (_ret === "break") break; } } if (state.placement !== firstFittingPlacement) { state.modifiersData[name]._skip = true; state.placement = firstFittingPlacement; state.reset = true; } } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_flip = ({ name: 'flip', enabled: true, phase: 'main', fn: flip, requiresIfExists: ['offset'], data: { _skip: false } }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js function getAltAxis(axis) { return axis === 'x' ? 'y' : 'x'; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js function within(min, value, max) { return math_max(min, math_min(value, max)); } function withinMaxClamp(min, value, max) { var v = within(min, value, max); return v > max ? max : v; } ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js function preventOverflow(_ref) { var state = _ref.state, options = _ref.options, name = _ref.name; var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; var overflow = detectOverflow(state, { boundary: boundary, rootBoundary: rootBoundary, padding: padding, altBoundary: altBoundary }); var basePlacement = getBasePlacement(state.placement); var variation = getVariation(state.placement); var isBasePlacement = !variation; var mainAxis = getMainAxisFromPlacement(basePlacement); var altAxis = getAltAxis(mainAxis); var popperOffsets = state.modifiersData.popperOffsets; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { placement: state.placement })) : tetherOffset; var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { mainAxis: tetherOffsetValue, altAxis: tetherOffsetValue } : Object.assign({ mainAxis: 0, altAxis: 0 }, tetherOffsetValue); var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; var data = { x: 0, y: 0 }; if (!popperOffsets) { return; } if (checkMainAxis) { var _offsetModifierState$; var mainSide = mainAxis === 'y' ? enums_top : left; var altSide = mainAxis === 'y' ? bottom : right; var len = mainAxis === 'y' ? 'height' : 'width'; var offset = popperOffsets[mainAxis]; var min = offset + overflow[mainSide]; var max = offset - 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]; // We need to include the arrow in the calculation so the arrow doesn't go // outside the reference bounds var arrowElement = state.elements.arrow; var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { width: 0, height: 0 }; var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); var arrowPaddingMin = arrowPaddingObject[mainSide]; var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want // to include its full size in the calculation. If the reference is small // and near the edge of a boundary, the popper can overflow even if the // reference is not overflowing as well (e.g. virtual elements with no // width or height) var arrowLen = within(0, referenceRect[len], arrowRect[len]); var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; var tetherMax = offset + maxOffset - offsetModifierValue; var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); popperOffsets[mainAxis] = preventedOffset; data[mainAxis] = preventedOffset - offset; } if (checkAltAxis) { var _offsetModifierState$2; var _mainSide = mainAxis === 'x' ? enums_top : left; var _altSide = mainAxis === 'x' ? bottom : right; var _offset = popperOffsets[altAxis]; var _len = altAxis === 'y' ? 'height' : 'width'; var _min = _offset + overflow[_mainSide]; var _max = _offset - overflow[_altSide]; var isOriginSide = [enums_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); popperOffsets[altAxis] = _preventedOffset; data[altAxis] = _preventedOffset - _offset; } state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_preventOverflow = ({ name: 'preventOverflow', enabled: true, phase: 'main', fn: preventOverflow, requiresIfExists: ['offset'] }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js // eslint-disable-next-line import/no-unused-modules var toPaddingObject = function toPaddingObject(padding, state) { padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { placement: state.placement })) : padding; return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); }; function arrow(_ref) { var _state$modifiersData$; var state = _ref.state, name = _ref.name, options = _ref.options; var arrowElement = state.elements.arrow; var popperOffsets = state.modifiersData.popperOffsets; var basePlacement = getBasePlacement(state.placement); var axis = getMainAxisFromPlacement(basePlacement); var isVertical = [left, right].indexOf(basePlacement) >= 0; var len = isVertical ? 'height' : 'width'; if (!arrowElement || !popperOffsets) { return; } var paddingObject = toPaddingObject(options.padding, state); var arrowRect = getLayoutRect(arrowElement); var minProp = axis === 'y' ? enums_top : left; var maxProp = axis === 'y' ? bottom : right; var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; var startDiff = popperOffsets[axis] - state.rects.reference[axis]; var arrowOffsetParent = getOffsetParent(arrowElement); var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is // outside of the popper bounds var min = paddingObject[minProp]; var max = clientSize - arrowRect[len] - paddingObject[maxProp]; var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; var offset = within(min, center, max); // Prevents breaking syntax highlighting... var axisProp = axis; state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); } function arrow_effect(_ref2) { var state = _ref2.state, options = _ref2.options; var _options$element = options.element, arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; if (arrowElement == null) { return; } // CSS selector if (typeof arrowElement === 'string') { arrowElement = state.elements.popper.querySelector(arrowElement); if (!arrowElement) { return; } } if (!contains_contains(state.elements.popper, arrowElement)) { return; } state.elements.arrow = arrowElement; } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_arrow = ({ name: 'arrow', enabled: true, phase: 'main', fn: arrow, effect: arrow_effect, requires: ['popperOffsets'], requiresIfExists: ['preventOverflow'] }); ;// CONCATENATED MODULE: ./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 [enums_top, right, bottom, left].some(function (side) { return overflow[side] >= 0; }); } function hide(_ref) { var state = _ref.state, name = _ref.name; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var preventedOffsets = state.modifiersData.preventOverflow; var referenceOverflow = detectOverflow(state, { elementContext: 'reference' }); var popperAltOverflow = detectOverflow(state, { altBoundary: true }); var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); state.modifiersData[name] = { referenceClippingOffsets: referenceClippingOffsets, popperEscapeOffsets: popperEscapeOffsets, isReferenceHidden: isReferenceHidden, hasPopperEscaped: hasPopperEscaped }; state.attributes.popper = Object.assign({}, state.attributes.popper, { 'data-popper-reference-hidden': isReferenceHidden, 'data-popper-escaped': hasPopperEscaped }); } // eslint-disable-next-line import/no-unused-modules /* harmony default export */ const modifiers_hide = ({ name: 'hide', enabled: true, phase: 'main', requiresIfExists: ['preventOverflow'], fn: hide }); ;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; var popper_createPopper = /*#__PURE__*/popperGenerator({ defaultModifiers: defaultModifiers }); // eslint-disable-next-line import/no-unused-modules // eslint-disable-next-line import/no-unused-modules // eslint-disable-next-line import/no-unused-modules ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/popper/dist/chunk-LUYFNC5G.mjs 'use client' ; // src/use-popper.ts function usePopper(props = {}) { const { enabled = true, modifiers, placement: placementProp = "bottom", strategy = "absolute", arrowPadding = 8, eventListeners = true, offset, gutter = 8, flip = true, boundary = "clippingParents", preventOverflow = true, matchWidth: matchWidth2, direction = "ltr" } = props; const reference = (0,external_React_.useRef)(null); const popper = (0,external_React_.useRef)(null); const instance = (0,external_React_.useRef)(null); const placement = getPopperPlacement(placementProp, direction); const cleanup = (0,external_React_.useRef)(() => { }); const setupPopper = (0,external_React_.useCallback)(() => { var _a; if (!enabled || !reference.current || !popper.current) return; (_a = cleanup.current) == null ? void 0 : _a.call(cleanup); instance.current = popper_createPopper(reference.current, popper.current, { placement, modifiers: [ innerArrow, positionArrow, transformOrigin, { ...matchWidth, enabled: !!matchWidth2 }, { name: "eventListeners", ...getEventListenerOptions(eventListeners) }, { name: "arrow", options: { padding: arrowPadding } }, { name: "offset", options: { offset: offset != null ? offset : [0, gutter] } }, { name: "flip", enabled: !!flip, options: { padding: 8 } }, { name: "preventOverflow", enabled: !!preventOverflow, options: { boundary } }, // allow users override internal modifiers ...modifiers != null ? modifiers : [] ], strategy }); instance.current.forceUpdate(); cleanup.current = instance.current.destroy; }, [ placement, enabled, modifiers, matchWidth2, eventListeners, arrowPadding, offset, gutter, flip, preventOverflow, boundary, strategy ]); (0,external_React_.useEffect)(() => { return () => { var _a; if (!reference.current && !popper.current) { (_a = instance.current) == null ? void 0 : _a.destroy(); instance.current = null; } }; }, []); const referenceRef = (0,external_React_.useCallback)( (node) => { reference.current = node; setupPopper(); }, [setupPopper] ); const getReferenceProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => ({ ...props2, ref: mergeRefs(referenceRef, ref) }), [referenceRef] ); const popperRef = (0,external_React_.useCallback)( (node) => { popper.current = node; setupPopper(); }, [setupPopper] ); const getPopperProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => ({ ...props2, ref: mergeRefs(popperRef, ref), style: { ...props2.style, position: strategy, minWidth: matchWidth2 ? void 0 : "max-content", inset: "0 auto auto 0" } }), [strategy, popperRef, matchWidth2] ); const getArrowProps = (0,external_React_.useCallback)((props2 = {}, ref = null) => { const { size, shadowColor, bg, style, ...rest } = props2; return { ...rest, ref, "data-popper-arrow": "", style: chunk_LUYFNC5G_getArrowStyle(props2) }; }, []); const getArrowInnerProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => ({ ...props2, ref, "data-popper-arrow-inner": "" }), [] ); return { update() { var _a; (_a = instance.current) == null ? void 0 : _a.update(); }, forceUpdate() { var _a; (_a = instance.current) == null ? void 0 : _a.forceUpdate(); }, transformOrigin: cssVars.transformOrigin.varRef, referenceRef, popperRef, getPopperProps, getArrowProps, getArrowInnerProps, getReferenceProps }; } function chunk_LUYFNC5G_getArrowStyle(props) { const { size, shadowColor, bg, style } = props; const computedStyle = { ...style, position: "absolute" }; if (size) { computedStyle["--popper-arrow-size"] = size; } if (shadowColor) { computedStyle["--popper-arrow-shadow-color"] = shadowColor; } if (bg) { computedStyle["--popper-arrow-bg"] = bg; } return computedStyle; } //# sourceMappingURL=chunk-LUYFNC5G.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-disclosure/dist/index.mjs 'use client' // src/index.ts ; function dist_useDisclosure(props = {}) { const { onClose: onCloseProp, onOpen: onOpenProp, isOpen: isOpenProp, id: idProp } = props; const handleOpen = dist_useCallbackRef(onOpenProp); const handleClose = dist_useCallbackRef(onCloseProp); const [isOpenState, setIsOpen] = (0,external_React_.useState)(props.defaultIsOpen || false); const isOpen = isOpenProp !== void 0 ? isOpenProp : isOpenState; const isControlled = isOpenProp !== void 0; const uid = (0,external_React_.useId)(); const id = idProp != null ? idProp : `disclosure-${uid}`; const onClose = (0,external_React_.useCallback)(() => { if (!isControlled) { setIsOpen(false); } handleClose == null ? void 0 : handleClose(); }, [isControlled, handleClose]); const onOpen = (0,external_React_.useCallback)(() => { if (!isControlled) { setIsOpen(true); } handleOpen == null ? void 0 : handleOpen(); }, [isControlled, handleOpen]); const onToggle = (0,external_React_.useCallback)(() => { if (isOpen) { onClose(); } else { onOpen(); } }, [isOpen, onOpen, onClose]); function getButtonProps(props2 = {}) { return { ...props2, "aria-expanded": isOpen, "aria-controls": id, onClick(event) { var _a; (_a = props2.onClick) == null ? void 0 : _a.call(props2, event); onToggle(); } }; } function getDisclosureProps(props2 = {}) { return { ...props2, hidden: !isOpen, id }; } return { isOpen, onOpen, onClose, onToggle, isControlled, getButtonProps, getDisclosureProps }; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-outside-click/dist/index.mjs 'use client' // src/index.ts ; function useOutsideClick(props) { const { ref, handler, enabled = true } = props; const savedHandler = dist_useCallbackRef(handler); const stateRef = (0,external_React_.useRef)({ isPointerDown: false, ignoreEmulatedMouseEvents: false }); const state = stateRef.current; (0,external_React_.useEffect)(() => { if (!enabled) return; const onPointerDown = (e) => { if (isValidEvent(e, ref)) { state.isPointerDown = true; } }; const onMouseUp = (event) => { if (state.ignoreEmulatedMouseEvents) { state.ignoreEmulatedMouseEvents = false; return; } if (state.isPointerDown && handler && isValidEvent(event, ref)) { state.isPointerDown = false; savedHandler(event); } }; const onTouchEnd = (event) => { state.ignoreEmulatedMouseEvents = true; if (handler && state.isPointerDown && isValidEvent(event, ref)) { state.isPointerDown = false; savedHandler(event); } }; const doc = dist_getOwnerDocument(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, state, enabled]); } function isValidEvent(event, ref) { var _a; const target = event.target; if (target) { const doc = dist_getOwnerDocument(target); if (!doc.contains(target)) return false; } return !((_a = ref.current) == null ? void 0 : _a.contains(target)); } function dist_getOwnerDocument(node) { var _a; return (_a = node == null ? void 0 : node.ownerDocument) != null ? _a : document; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-event-listener/dist/index.mjs 'use client' // src/index.ts ; function dist_useEventListener(target, event, handler, options) { const listener = dist_useCallbackRef(handler); (0,external_React_.useEffect)(() => { const node = typeof target === "function" ? target() : target != null ? target : document; if (!handler || !node) return; node.addEventListener(event, listener, options); return () => { node.removeEventListener(event, listener, options); }; }, [event, target, options, listener, handler]); return () => { const node = typeof target === "function" ? target() : target != null ? target : document; node == null ? void 0 : node.removeEventListener(event, listener, options); }; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-animation-state/dist/index.mjs 'use client' // src/index.ts ; function useAnimationState(props) { const { isOpen, ref } = props; const [mounted, setMounted] = (0,external_React_.useState)(isOpen); const [once, setOnce] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!once) { setMounted(isOpen); setOnce(true); } }, [isOpen, once, mounted]); dist_useEventListener( () => ref.current, "animationend", () => { setMounted(isOpen); } ); const hidden = isOpen ? false : !mounted; return { present: !hidden, onComplete() { var _a; const win = chunk_3XANSPY5_getOwnerWindow(ref.current); const evt = new win.CustomEvent("animationend", { bubbles: true }); (_a = ref.current) == null ? void 0 : _a.dispatchEvent(evt); } }; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/lazy-utils/dist/index.mjs // src/index.ts function lazyDisclosure(options) { const { wasSelected, enabled, isSelected, mode = "unmount" } = options; if (!enabled) return true; if (isSelected) return true; if (mode === "keepMounted" && wasSelected) return true; return false; } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-SANI5SUM.mjs 'use client' ; // src/use-menu.ts var [ MenuDescendantsProvider, useMenuDescendantsContext, useMenuDescendants, useMenuDescendant ] = createDescendantContext(); var [MenuProvider, useMenuContext] = createContext({ strict: false, name: "MenuContext" }); function chunk_SANI5SUM_useIds(idProp, ...prefixes) { const reactId = (0,external_React_.useId)(); const id = idProp || reactId; return (0,external_React_.useMemo)(() => { return prefixes.map((prefix) => `${prefix}-${id}`); }, [id, prefixes]); } function chunk_SANI5SUM_getOwnerDocument(node) { var _a; return (_a = node == null ? void 0 : node.ownerDocument) != null ? _a : document; } function chunk_SANI5SUM_isActiveElement(element) { const doc = chunk_SANI5SUM_getOwnerDocument(element); return doc.activeElement === element; } function useMenu(props = {}) { const { id, closeOnSelect = true, closeOnBlur = true, initialFocusRef, autoSelect = true, isLazy, isOpen: isOpenProp, defaultIsOpen, onClose: onCloseProp, onOpen: onOpenProp, placement = "bottom-start", lazyBehavior = "unmount", direction, computePositionOnMount = false, ...popperProps } = props; const menuRef = (0,external_React_.useRef)(null); const buttonRef = (0,external_React_.useRef)(null); const descendants = useMenuDescendants(); const focusMenu = (0,external_React_.useCallback)(() => { requestAnimationFrame(() => { var _a; (_a = menuRef.current) == null ? void 0 : _a.focus({ preventScroll: false }); }); }, []); const focusFirstItem = (0,external_React_.useCallback)(() => { const id2 = setTimeout(() => { var _a; if (initialFocusRef) { (_a = initialFocusRef.current) == null ? void 0 : _a.focus(); } else { const first = descendants.firstEnabled(); if (first) setFocusedIndex(first.index); } }); timeoutIds.current.add(id2); }, [descendants, initialFocusRef]); const focusLastItem = (0,external_React_.useCallback)(() => { const id2 = setTimeout(() => { const last = descendants.lastEnabled(); if (last) setFocusedIndex(last.index); }); timeoutIds.current.add(id2); }, [descendants]); const onOpenInternal = (0,external_React_.useCallback)(() => { onOpenProp == null ? void 0 : onOpenProp(); if (autoSelect) { focusFirstItem(); } else { focusMenu(); } }, [autoSelect, focusFirstItem, focusMenu, onOpenProp]); const { isOpen, onOpen, onClose, onToggle } = dist_useDisclosure({ isOpen: isOpenProp, defaultIsOpen, onClose: onCloseProp, onOpen: onOpenInternal }); useOutsideClick({ enabled: isOpen && closeOnBlur, ref: menuRef, handler: (event) => { var _a; if (!((_a = buttonRef.current) == null ? void 0 : _a.contains(event.target))) { onClose(); } } }); const popper = usePopper({ ...popperProps, enabled: isOpen || computePositionOnMount, placement, direction }); const [focusedIndex, setFocusedIndex] = (0,external_React_.useState)(-1); dist_useUpdateEffect(() => { if (!isOpen) { setFocusedIndex(-1); } }, [isOpen]); useFocusOnHide(menuRef, { focusRef: buttonRef, visible: isOpen, shouldFocus: true }); const animationState = useAnimationState({ isOpen, ref: menuRef }); const [buttonId, menuId] = chunk_SANI5SUM_useIds(id, `menu-button`, `menu-list`); const openAndFocusMenu = (0,external_React_.useCallback)(() => { onOpen(); focusMenu(); }, [onOpen, focusMenu]); const timeoutIds = (0,external_React_.useRef)(/* @__PURE__ */ new Set([])); (0,external_React_.useEffect)(() => { const ids = timeoutIds.current; return () => { ids.forEach((id2) => clearTimeout(id2)); ids.clear(); }; }, []); const openAndFocusFirstItem = (0,external_React_.useCallback)(() => { onOpen(); focusFirstItem(); }, [focusFirstItem, onOpen]); const openAndFocusLastItem = (0,external_React_.useCallback)(() => { onOpen(); focusLastItem(); }, [onOpen, focusLastItem]); const refocus = (0,external_React_.useCallback)(() => { var _a, _b; const doc = chunk_SANI5SUM_getOwnerDocument(menuRef.current); const hasFocusWithin = (_a = menuRef.current) == null ? void 0 : _a.contains(doc.activeElement); const shouldRefocus = isOpen && !hasFocusWithin; if (!shouldRefocus) return; const node = (_b = descendants.item(focusedIndex)) == null ? void 0 : _b.node; node == null ? void 0 : node.focus({ preventScroll: true }); }, [isOpen, focusedIndex, descendants]); const rafId = (0,external_React_.useRef)(null); return { openAndFocusMenu, openAndFocusFirstItem, openAndFocusLastItem, onTransitionEnd: refocus, unstable__animationState: animationState, descendants, popper, buttonId, menuId, forceUpdate: popper.forceUpdate, orientation: "vertical", isOpen, onToggle, onOpen, onClose, menuRef, buttonRef, focusedIndex, closeOnSelect, closeOnBlur, autoSelect, setFocusedIndex, isLazy, lazyBehavior, initialFocusRef, rafId }; } function useMenuButton(props = {}, externalRef = null) { const menu = useMenuContext(); const { onToggle, popper, openAndFocusFirstItem, openAndFocusLastItem } = menu; const onKeyDown = (0,external_React_.useCallback)( (event) => { const eventKey = event.key; const keyMap = { Enter: openAndFocusFirstItem, ArrowDown: openAndFocusFirstItem, ArrowUp: openAndFocusLastItem }; const action = keyMap[eventKey]; if (action) { event.preventDefault(); event.stopPropagation(); action(event); } }, [openAndFocusFirstItem, openAndFocusLastItem] ); return { ...props, ref: mergeRefs(menu.buttonRef, externalRef, popper.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 _a; return chunk_SANI5SUM_isHTMLElement(target) && !!((_a = target == null ? void 0 : target.getAttribute("role")) == null ? void 0 : _a.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 <Menu>` ); } const { focusedIndex, setFocusedIndex, menuRef, isOpen, onClose, menuId, isLazy, lazyBehavior, unstable__animationState: animated } = menu; const descendants = useMenuDescendantsContext(); const createTypeaheadHandler = useShortcut({ preventDefault: (event) => event.key !== " " && isTargetMenuItem(event.target) }); const onKeyDown = (0,external_React_.useCallback)( (event) => { if (!event.currentTarget.contains(event.target)) return; const eventKey = event.key; const keyMap = { Tab: (event2) => event2.preventDefault(), Escape: onClose, ArrowDown: () => { const next = descendants.nextEnabled(focusedIndex); if (next) setFocusedIndex(next.index); }, ArrowUp: () => { const prev = descendants.prevEnabled(focusedIndex); if (prev) setFocusedIndex(prev.index); } }; const fn = keyMap[eventKey]; if (fn) { event.preventDefault(); fn(event); return; } const onTypeahead = createTypeaheadHandler((character) => { const nextItem = getNextItemFromSearch( descendants.values(), character, (item) => { var _a, _b; return (_b = (_a = item == null ? void 0 : item.node) == null ? void 0 : _a.textContent) != null ? _b : ""; }, descendants.item(focusedIndex) ); if (nextItem) { const index = descendants.indexOf(nextItem.node); setFocusedIndex(index); } }); if (isTargetMenuItem(event.target)) { onTypeahead(event); } }, [ descendants, focusedIndex, createTypeaheadHandler, onClose, setFocusedIndex ] ); const hasBeenOpened = (0,external_React_.useRef)(false); if (isOpen) { hasBeenOpened.current = true; } const shouldRenderChildren = lazyDisclosure({ wasSelected: hasBeenOpened.current, enabled: isLazy, mode: lazyBehavior, isSelected: animated.present }); return { ...props, ref: mergeRefs(menuRef, ref), children: shouldRenderChildren ? props.children : null, tabIndex: -1, role: "menu", id: menuId, style: { ...props.style, transformOrigin: "var(--popper-transform-origin)" }, "aria-orientation": "vertical", onKeyDown: callAllHandlers(props.onKeyDown, onKeyDown) }; } function useMenuPositioner(props = {}) { const { popper, isOpen } = useMenuContext(); return popper.getPopperProps({ ...props, style: { visibility: isOpen ? "visible" : "hidden", ...props.style } }); } function useMenuItem(props = {}, externalRef = null) { const { onMouseEnter: onMouseEnterProp, onMouseMove: onMouseMoveProp, onMouseLeave: onMouseLeaveProp, onClick: onClickProp, onFocus: onFocusProp, isDisabled, isFocusable, closeOnSelect, type: typeProp, ...htmlProps } = props; const menu = useMenuContext(); const { setFocusedIndex, focusedIndex, closeOnSelect: menuCloseOnSelect, onClose, menuRef, isOpen, menuId, rafId } = menu; const ref = (0,external_React_.useRef)(null); const id = `${menuId}-menuitem-${(0,external_React_.useId)()}`; const { index, register } = useMenuDescendant({ disabled: isDisabled && !isFocusable }); const onMouseEnter = (0,external_React_.useCallback)( (event) => { onMouseEnterProp == null ? void 0 : onMouseEnterProp(event); if (isDisabled) return; setFocusedIndex(index); }, [setFocusedIndex, index, isDisabled, onMouseEnterProp] ); const onMouseMove = (0,external_React_.useCallback)( (event) => { onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (ref.current && !chunk_SANI5SUM_isActiveElement(ref.current)) { onMouseEnter(event); } }, [onMouseEnter, onMouseMoveProp] ); const onMouseLeave = (0,external_React_.useCallback)( (event) => { onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event); if (isDisabled) return; setFocusedIndex(-1); }, [setFocusedIndex, isDisabled, onMouseLeaveProp] ); const onClick = (0,external_React_.useCallback)( (event) => { onClickProp == null ? void 0 : onClickProp(event); if (!isTargetMenuItem(event.currentTarget)) return; if (closeOnSelect != null ? closeOnSelect : menuCloseOnSelect) { onClose(); } }, [onClose, onClickProp, menuCloseOnSelect, closeOnSelect] ); const onFocus = (0,external_React_.useCallback)( (event) => { onFocusProp == null ? void 0 : onFocusProp(event); setFocusedIndex(index); }, [setFocusedIndex, onFocusProp, index] ); const isFocused = index === focusedIndex; const trulyDisabled = isDisabled && !isFocusable; dist_useUpdateEffect(() => { if (!isOpen) return; if (isFocused && !trulyDisabled && ref.current) { if (rafId.current) { cancelAnimationFrame(rafId.current); } rafId.current = requestAnimationFrame(() => { var _a; (_a = ref.current) == null ? void 0 : _a.focus({ preventScroll: true }); rafId.current = null; }); } else if (menuRef.current && !chunk_SANI5SUM_isActiveElement(menuRef.current)) { menuRef.current.focus({ preventScroll: true }); } return () => { if (rafId.current) { cancelAnimationFrame(rafId.current); } }; }, [isFocused, trulyDisabled, menuRef, isOpen]); const clickableProps = useClickable({ onClick, onFocus, onMouseEnter, onMouseMove, onMouseLeave, ref: mergeRefs(register, ref, externalRef), isDisabled, isFocusable }); return { ...htmlProps, ...clickableProps, type: typeProp != null ? typeProp : clickableProps.type, id, role: "menuitem", tabIndex: isFocused ? 0 : -1 }; } function useMenuOption(props = {}, ref = null) { const { type = "radio", isChecked, ...rest } = props; const ownProps = useMenuItem(rest, ref); return { ...ownProps, role: `menuitem${type}`, "aria-checked": isChecked }; } function useMenuOptionGroup(props = {}) { const { children, type = "radio", value: valueProp, defaultValue, onChange: onChangeProp, ...htmlProps } = props; const isRadio = type === "radio"; const fallback = isRadio ? "" : []; const [value, setValue] = useControllableState({ defaultValue: defaultValue != null ? defaultValue : fallback, value: valueProp, onChange: onChangeProp }); const onChange = useCallback( (selectedValue) => { if (type === "radio" && typeof value === "string") { setValue(selectedValue); } if (type === "checkbox" && Array.isArray(value)) { const nextValue = value.includes(selectedValue) ? value.filter((item) => item !== selectedValue) : value.concat(selectedValue); setValue(nextValue); } }, [value, setValue, type] ); const validChildren = getValidChildren(children); const clones = validChildren.map((child) => { if (child.type.id !== "MenuItemOption") return child; const onClick = (event) => { var _a, _b; onChange(child.props.value); (_b = (_a = child.props).onClick) == null ? void 0 : _b.call(_a, event); }; const isChecked = type === "radio" ? child.props.value === value : value.includes(child.props.value); return cloneElement(child, { type, onClick, isChecked }); }); return { ...htmlProps, children: clones }; } function useMenuState() { const { isOpen, onClose } = useMenuContext(); return { isOpen, onClose }; } function chunk_SANI5SUM_isHTMLElement(el) { var _a; if (!chunk_SANI5SUM_isElement(el)) return false; const win = (_a = el.ownerDocument.defaultView) != null ? _a : window; return el instanceof win.HTMLElement; } function chunk_SANI5SUM_isElement(el) { return el != null && typeof el == "object" && "nodeType" in el && el.nodeType === Node.ELEMENT_NODE; } //# sourceMappingURL=chunk-SANI5SUM.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-UZJ3TPNQ.mjs 'use client' ; // src/menu.tsx var [MenuStylesProvider, useMenuStyles] = createContext({ name: `MenuStylesContext`, errorMessage: `useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" ` }); var Menu = (props) => { const { children } = props; const styles = useMultiStyleConfig("Menu", props); const ownProps = omitThemingProps(props); const { direction } = chunk_UIGT7YZF_useTheme(); const { descendants, ...ctx } = useMenu({ ...ownProps, direction }); const context = (0,external_React_.useMemo)(() => ctx, [ctx]); const { isOpen, onClose, forceUpdate } = context; return /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuDescendantsProvider, { value: descendants, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuProvider, { value: context, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuStylesProvider, { value: styles, children: dist_runIfFn(children, { isOpen, onClose, forceUpdate }) }) }) }); }; Menu.displayName = "Menu"; //# sourceMappingURL=chunk-UZJ3TPNQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-Z3VR2BFQ.mjs 'use client' ; // src/menu-button.tsx var StyledMenuButton = forwardRef((props, ref) => { const styles = useMenuStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.button, { ref, ...props, __css: { display: "inline-flex", appearance: "none", alignItems: "center", outline: 0, ...styles.button } } ); }); var MenuButton = forwardRef( (props, ref) => { const { children, as: As, ...rest } = props; const buttonProps = useMenuButton(rest, ref); const Element = As || StyledMenuButton; return /* @__PURE__ */ (0,jsx_runtime.jsx)( Element, { ...buttonProps, className: cx("chakra-menu__menu-button", props.className), children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { __css: { pointerEvents: "none", flex: "1 1 auto", minW: 0 }, children: props.children } ) } ); } ); MenuButton.displayName = "MenuButton"; //# sourceMappingURL=chunk-Z3VR2BFQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-6QYXN73V.mjs 'use client' ; // src/icon-button.tsx var IconButton = forwardRef( (props, ref) => { const { icon, children, isRound, "aria-label": ariaLabel, ...rest } = props; const element = icon || children; const _children = (0,external_React_.isValidElement)(element) ? (0,external_React_.cloneElement)(element, { "aria-hidden": true, focusable: false }) : null; return /* @__PURE__ */ (0,jsx_runtime.jsx)( Button, { padding: "0", borderRadius: isRound ? "full" : void 0, ref, "aria-label": ariaLabel, ...rest, children: _children } ); } ); IconButton.displayName = "IconButton"; //# sourceMappingURL=chunk-6QYXN73V.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-6MF6NSK4.mjs 'use client' ; // src/menu-list.tsx var motionVariants = { enter: { visibility: "visible", opacity: 1, scale: 1, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] } }, exit: { transitionEnd: { visibility: "hidden" }, opacity: 0, scale: 0.8, transition: { duration: 0.1, easings: "easeOut" } } }; var MenuTransition = chakra(motion.div); var MenuList = forwardRef(function MenuList2(props, ref) { var _a, _b; const { rootProps, motionProps, ...rest } = props; const { isOpen, onTransitionEnd, unstable__animationState: animated } = useMenuContext(); const listProps = useMenuList(rest, ref); const positionerProps = useMenuPositioner(rootProps); const styles = useMenuStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...positionerProps, __css: { zIndex: (_b = props.zIndex) != null ? _b : (_a = styles.list) == null ? void 0 : _a.zIndex }, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( MenuTransition, { variants: motionVariants, initial: false, animate: isOpen ? "enter" : "exit", __css: { outline: 0, ...styles.list }, ...motionProps, className: cx("chakra-menu__menu-list", listProps.className), ...listProps, onUpdate: onTransitionEnd, onAnimationComplete: callAll( animated.onComplete, listProps.onAnimationComplete ) } ) } ); }); MenuList.displayName = "MenuList"; //# sourceMappingURL=chunk-6MF6NSK4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-4CNGLKYX.mjs 'use client' ; // src/menu-command.tsx var MenuCommand = forwardRef( (props, ref) => { const styles = useMenuStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { ref, ...props, __css: styles.command, className: "chakra-menu__command" } ); } ); MenuCommand.displayName = "MenuCommand"; //# sourceMappingURL=chunk-4CNGLKYX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-M565QO7N.mjs 'use client' ; // src/styled-menu-item.tsx var StyledMenuItem = forwardRef( (props, ref) => { const { type, ...rest } = props; const styles = useMenuStyles(); const btnType = rest.as || type ? type != null ? type : void 0 : "button"; const buttonStyles = (0,external_React_.useMemo)( () => ({ textDecoration: "none", color: "inherit", userSelect: "none", display: "flex", width: "100%", alignItems: "center", textAlign: "start", flex: "0 0 auto", outline: 0, ...styles.item }), [styles.item] ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.button, { ref, type: btnType, ...rest, __css: buttonStyles }); } ); //# sourceMappingURL=chunk-M565QO7N.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-HB6KBUMZ.mjs 'use client' ; // src/menu-icon.tsx var MenuIcon = (props) => { const { className, children, ...rest } = props; const styles = useMenuStyles(); const child = external_React_.Children.only(children); const clone = (0,external_React_.isValidElement)(child) ? (0,external_React_.cloneElement)(child, { focusable: "false", "aria-hidden": true, className: cx("chakra-menu__icon", child.props.className) }) : null; const _className = cx("chakra-menu__icon-wrapper", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { className: _className, ...rest, __css: styles.icon, children: clone }); }; MenuIcon.displayName = "MenuIcon"; //# sourceMappingURL=chunk-HB6KBUMZ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/menu/dist/chunk-5TWLKMYI.mjs 'use client' ; // src/menu-item.tsx var MenuItem = forwardRef((props, ref) => { const { icon, iconSpacing = "0.75rem", command, commandSpacing = "0.75rem", children, ...rest } = props; const menuitemProps = useMenuItem(rest, ref); const shouldWrap = icon || command; const _children = shouldWrap ? /* @__PURE__ */ (0,jsx_runtime.jsx)("span", { style: { pointerEvents: "none", flex: 1 }, children }) : children; return /* @__PURE__ */ (0,jsx_runtime.jsxs)( StyledMenuItem, { ...menuitemProps, className: cx("chakra-menu__menuitem", menuitemProps.className), children: [ icon && /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuIcon, { fontSize: "0.8em", marginEnd: iconSpacing, children: icon }), _children, command && /* @__PURE__ */ (0,jsx_runtime.jsx)(MenuCommand, { marginStart: commandSpacing, children: command }) ] } ); }); MenuItem.displayName = "MenuItem"; //# sourceMappingURL=chunk-5TWLKMYI.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/components/IntersectionObserver.tsx function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function IntersectionObserver_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var IntersectionStyles = { visible: { order: 0, visibility: 'visible', opacity: 1 }, inVisible: { order: 100, visibility: 'hidden', pointerEvents: 'none' }, toolbarWrapper: { overflow: 'hidden', display: 'flex', border: '1px solid black', alignItem: 'center' }, overflowStyle: { order: 99, position: 'sticky', right: '0', backgroundColor: 'white' } }; function IntersectObserver(_ref) { var children = _ref.children, routes = _ref.routes; var ref = (0,external_React_.useRef)(null); var _useState = (0,external_React_.useState)({}), _useState2 = _slicedToArray(_useState, 2), visibleMap = _useState2[0], setVisibleMap = _useState2[1]; var location = dist_useLocation(); var hiddenRoutes = routes.filter(function (route) { return !visibleMap[route.route]; }); var selectedHiddenRoute = hiddenRoutes.find(function (h) { return h.route === location.pathname; }); (0,external_React_.useEffect)(function () { if (!ref.current) return; var observer = new IntersectionObserver(function (entries) { var updatedEntries = {}; entries.forEach(function (entry) { var _entry$target$dataset; var target = (_entry$target$dataset = entry.target.dataset) === null || _entry$target$dataset === void 0 ? void 0 : _entry$target$dataset['target']; if (entry.isIntersecting && target) { updatedEntries[target] = true; } if (!entry.isIntersecting && target) { updatedEntries[target] = false; } }); setVisibleMap(function (prev) { return IntersectionObserver_objectSpread(IntersectionObserver_objectSpread({}, prev), updatedEntries); }); }, { root: ref.current, threshold: 0.98 }); Array.from(ref.current.children).forEach(function (item) { if (item.getAttribute('data-target')) { observer.observe(item); } }); return function () { return observer.disconnect(); }; }, []); var shouldShowMenu = Object.values(visibleMap).some(function (v) { return v === false; }); return /*#__PURE__*/external_React_default().createElement(HStack, { ref: ref, width: { base: '50px', sm: '240px', md: '520px', lg: '570px', xl: '680px' }, overflow: 'hidden', h: "full" }, external_React_default().Children.map(children, function (child) { var _children$props; var otherSX = visibleMap[child.props['data-target']] ? IntersectionStyles.visible : IntersectionStyles.inVisible; return /*#__PURE__*/external_React_default().cloneElement(child, { sx: IntersectionObserver_objectSpread(IntersectionObserver_objectSpread({}, children === null || children === void 0 || (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.sx), otherSX) }); }), shouldShowMenu && /*#__PURE__*/external_React_default().createElement(Menu, null, /*#__PURE__*/external_React_default().createElement(MenuButton, { as: IconButton, "aria-label": "Options", sx: IntersectionStyles.overflowStyle, style: { background: '#FFFFFF', boxShadow: 'none', marginLeft: '0px' }, color: !!selectedHiddenRoute ? 'primary.500' : '#383838', visibility: 'visible', icon: /*#__PURE__*/external_React_default().createElement(DotsHorizontal, { w: "24px", h: "24px" }) }), /*#__PURE__*/external_React_default().createElement(MenuList, { display: "flex", flexDirection: "column" }, hiddenRoutes.map(function (_ref2) { var label = _ref2.label, route = _ref2.route; return /*#__PURE__*/external_React_default().createElement(MenuItem, { key: route, as: NavLink, to: route, marginBottom: '0px', "data-target": route, fontSize: "sm", fontWeight: "semibold", lineHeight: "150%", color: "#383838", _hover: { color: 'primary.500' }, _focus: { boxShadow: 'none' }, _activeLink: { color: 'primary.500' }, display: "inline-flex", alignItems: "center", px: "2", py: "10px" }, label); })))); } /* harmony default export */ const components_IntersectionObserver = (IntersectObserver); ;// CONCATENATED MODULE: ./src/dashboard/components/Header.tsx var Header = function Header() { var _useDisclosure = useDisclosure(), isOpen = _useDisclosure.isOpen, onOpen = _useDisclosure.onOpen, onClose = _useDisclosure.onClose; var ref = external_React_default().useRef(); return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(Stack, { direction: "row", minH: "70px", justify: "space-between", px: "6", borderBottom: "1px solid #E9E9E9", bg: "white", position: { sm: "sticky" }, top: "var(--wp-admin--admin-bar--height, 0)", zIndex: 1 }, /*#__PURE__*/external_React_default().createElement(Stack, { direction: "row", align: "center", gap: "7" }, /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { as: NavLink, to: "/dashboard" }, /*#__PURE__*/external_React_default().createElement(Logo, { h: "10", w: "10" })), /*#__PURE__*/external_React_default().createElement(components_IntersectionObserver, { routes: ROUTES }, ROUTES.map(function (_ref) { var route = _ref.route, label = _ref.label; return /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { "data-target": route, key: route, as: NavLink, to: route, fontSize: "sm", fontWeight: "semibold", lineHeight: "150%", color: "#383838", _hover: { color: "primary.500" }, _focus: { boxShadow: "none" }, _activeLink: { color: "primary.500", borderBottom: "3px solid", borderColor: "primary.500", marginBottom: "-2px" }, display: "inline-flex", alignItems: "center", px: "2", h: "full" }, label); }))), /*#__PURE__*/external_React_default().createElement(Stack, { direction: "row", align: "center" }, /*#__PURE__*/external_React_default().createElement(Tag, { variant: "outline", colorScheme: "primary", borderRadius: "xl", bgColor: "#F8FAFF" }, localized.version), /*#__PURE__*/external_React_default().createElement(Button, { onClick: onOpen, variant: "unstyled" }, /*#__PURE__*/external_React_default().createElement(Megaphone, { w: "10", h: "10" })))), /*#__PURE__*/external_React_default().createElement(Drawer, { isOpen: isOpen, placement: "right", onClose: onClose, finalFocusRef: ref }, /*#__PURE__*/external_React_default().createElement(ModalOverlay, { bgColor: "rgba(0,0,0,0.05)" }), /*#__PURE__*/external_React_default().createElement(DrawerContent, { top: "var(--wp-admin--admin-bar--height, 0) !important" }, /*#__PURE__*/external_React_default().createElement(ModalCloseButton, null), /*#__PURE__*/external_React_default().createElement(ModalHeader, null, (0,external_wp_i18n_namespaceObject.__)("Latest Updates", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(ModalBody, null, /*#__PURE__*/external_React_default().createElement(components_Changelog, null))))); }; /* harmony default export */ const components_Header = (Header); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/toast/dist/chunk-6RSEZNRH.mjs 'use client' ; // src/use-toast.tsx function useToast(options) { const { theme } = chunk_7FWEOSAE_useChakra(); const defaultOptions = useToastOptionContext(); return (0,external_React_.useMemo)( () => createToastFn(theme.direction, { ...defaultOptions, ...options }), [options, theme.direction, defaultOptions] ); } var use_toast_default = (/* unused pure expression or super */ null && (useToast)); //# sourceMappingURL=chunk-6RSEZNRH.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-JARCRF6W.mjs 'use client' // src/grid.tsx ; var Grid = forwardRef(function Grid2(props, ref) { const { templateAreas, gap, rowGap, columnGap, column, row, autoFlow, autoRows, templateRows, autoColumns, templateColumns, ...rest } = props; const styles = { display: "grid", gridTemplateAreas: templateAreas, gridGap: gap, gridRowGap: rowGap, gridColumnGap: columnGap, gridAutoColumns: autoColumns, gridColumn: column, gridRow: row, gridAutoFlow: autoFlow, gridAutoRows: autoRows, gridTemplateRows: templateRows, gridTemplateColumns: templateColumns }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.div, { ref, __css: styles, ...rest }); }); Grid.displayName = "Grid"; //# sourceMappingURL=chunk-JARCRF6W.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/form-control/dist/chunk-DFWC5MHP.mjs 'use client' // src/form-control.tsx ; var [FormControlStylesProvider, useFormControlStyles] = createContext({ name: `FormControlStylesContext`, errorMessage: `useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" ` }); var [FormControlProvider, useFormControlContext] = createContext({ strict: false, name: "FormControlContext" }); function useFormControlProvider(props) { const { id: idProp, isRequired, isInvalid, isDisabled, isReadOnly, ...htmlProps } = props; const uuid = (0,external_React_.useId)(); const id = idProp || `field-${uuid}`; const labelId = `${id}-label`; const feedbackId = `${id}-feedback`; const helpTextId = `${id}-helptext`; const [hasFeedbackText, setHasFeedbackText] = (0,external_React_.useState)(false); const [hasHelpText, setHasHelpText] = (0,external_React_.useState)(false); const [isFocused, setFocus] = (0,external_React_.useState)(false); const getHelpTextProps = (0,external_React_.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, (node) => { if (!node) return; setHasHelpText(true); }) }), [helpTextId] ); const getLabelProps = (0,external_React_.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 : id }), [id, isDisabled, isFocused, isInvalid, isReadOnly, labelId] ); const getErrorMessageProps = (0,external_React_.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, (node) => { if (!node) return; setHasFeedbackText(true); }), "aria-live": "polite" }), [feedbackId] ); const getRootProps = (0,external_React_.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,external_React_.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, labelId, feedbackId, helpTextId, htmlProps, getHelpTextProps, getErrorMessageProps, getRootProps, getLabelProps, getRequiredIndicatorProps }; } var FormControl = forwardRef( function FormControl2(props, ref) { const styles = useMultiStyleConfig("Form", props); const ownProps = omitThemingProps(props); const { getRootProps, htmlProps: _, ...context } = useFormControlProvider(ownProps); const className = cx("chakra-form-control", props.className); return /* @__PURE__ */ (0,jsx_runtime.jsx)(FormControlProvider, { value: context, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(FormControlStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...getRootProps({}, ref), className, __css: styles["container"] } ) }) }); } ); FormControl.displayName = "FormControl"; var FormHelperText = forwardRef( function FormHelperText2(props, ref) { const field = useFormControlContext(); const styles = useFormControlStyles(); const className = cx("chakra-form__helper-text", props.className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...field == null ? void 0 : field.getHelpTextProps(props, ref), __css: styles.helperText, className } ); } ); FormHelperText.displayName = "FormHelperText"; //# sourceMappingURL=chunk-DFWC5MHP.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/form-control/dist/chunk-H46NUPBZ.mjs 'use client' ; // src/form-label.tsx var FormLabel = forwardRef(function FormLabel2(passedProps, ref) { var _a; const styles = useStyleConfig("FormLabel", passedProps); const props = omitThemingProps(passedProps); const { className, children, requiredIndicator = /* @__PURE__ */ (0,jsx_runtime.jsx)(RequiredIndicator, {}), optionalIndicator = null, ...rest } = props; const field = useFormControlContext(); const ownProps = (_a = field == null ? void 0 : field.getLabelProps(rest, ref)) != null ? _a : { ref, ...rest }; return /* @__PURE__ */ (0,jsx_runtime.jsxs)( chakra.label, { ...ownProps, className: cx("chakra-form__label", props.className), __css: { display: "block", textAlign: "start", ...styles }, children: [ children, (field == null ? void 0 : field.isRequired) ? requiredIndicator : optionalIndicator ] } ); }); FormLabel.displayName = "FormLabel"; var RequiredIndicator = forwardRef( function RequiredIndicator2(props, ref) { const field = useFormControlContext(); const styles = useFormControlStyles(); if (!(field == null ? void 0 : field.isRequired)) return null; const className = cx("chakra-form__required-indicator", props.className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { ...field == null ? void 0 : field.getRequiredIndicatorProps(props, ref), __css: styles.requiredIndicator, className } ); } ); RequiredIndicator.displayName = "RequiredIndicator"; //# sourceMappingURL=chunk-H46NUPBZ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/form-control/dist/chunk-56K2BSAJ.mjs 'use client' ; // src/use-form-control.ts 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) { var _a, _b, _c; const field = useFormControlContext(); const { id, disabled, readOnly, required, isRequired, isInvalid, isReadOnly, isDisabled, onFocus, onBlur, ...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: id != null ? id : field == null ? void 0 : field.id, isDisabled: (_a = disabled != null ? disabled : isDisabled) != null ? _a : field == null ? void 0 : field.isDisabled, isReadOnly: (_b = readOnly != null ? readOnly : isReadOnly) != null ? _b : field == null ? void 0 : field.isReadOnly, isRequired: (_c = required != null ? required : isRequired) != null ? _c : field == null ? void 0 : field.isRequired, isInvalid: isInvalid != null ? isInvalid : field == null ? void 0 : field.isInvalid, onFocus: callAllHandlers(field == null ? void 0 : field.onFocus, onFocus), onBlur: callAllHandlers(field == null ? void 0 : field.onBlur, onBlur) }; } //# sourceMappingURL=chunk-56K2BSAJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/visually-hidden/dist/chunk-3JHDQ75O.mjs 'use client' // src/visually-hidden.style.ts var visuallyHiddenStyle = { border: "0", clip: "rect(0, 0, 0, 0)", height: "1px", width: "1px", margin: "-1px", padding: "0", overflow: "hidden", whiteSpace: "nowrap", position: "absolute" }; //# sourceMappingURL=chunk-3JHDQ75O.mjs.map ;// CONCATENATED MODULE: ./node_modules/@zag-js/dom-query/dist/index.mjs // src/attrs.ts var dist_dataAttr = (guard) => { return guard ? "" : void 0; }; var dist_ariaAttr = (guard) => { return guard ? "true" : void 0; }; // src/is-html-element.ts function dist_isHTMLElement(value) { return typeof value === "object" && value?.nodeType === Node.ELEMENT_NODE && typeof value?.nodeName === "string"; } // src/contains.ts function dist_contains(parent, child) { if (!parent || !child) return false; if (!dist_isHTMLElement(parent) || !dist_isHTMLElement(child)) return false; return parent === child || parent.contains(child); } var isSelfEvent = (event) => dist_contains(event.currentTarget, event.target); // src/create-scope.ts var getDocument = (node) => { if (node.nodeType === Node.DOCUMENT_NODE) return node; return node.ownerDocument ?? document; }; function createScope(methods) { const screen = { getRootNode: (ctx) => ctx.getRootNode?.() ?? document, getDoc: (ctx) => getDocument(screen.getRootNode(ctx)), getWin: (ctx) => screen.getDoc(ctx).defaultView ?? window, getActiveElement: (ctx) => screen.getDoc(ctx).activeElement, getById: (ctx, id) => screen.getRootNode(ctx).getElementById(id) }; return { ...screen, ...methods }; } // src/env.ts var isDocument = (el) => el.nodeType === Node.DOCUMENT_NODE; function getDocument2(el) { if (isDocument(el)) return el; return el?.ownerDocument ?? document; } function dist_getWindow(el) { return el?.ownerDocument.defaultView ?? window; } // src/get-active-element.ts function dist_getActiveElement(el) { let activeElement = el.ownerDocument.activeElement; while (activeElement?.shadowRoot) { const el2 = activeElement.shadowRoot.activeElement; if (el2 === activeElement) break; else activeElement = el2; } return activeElement; } // src/get-by-id.ts function itemById(v, id) { return v.find((node) => node.id === id); } function indexOfId(v, id) { const item = itemById(v, id); return item ? v.indexOf(item) : -1; } function nextById(v, id, loop = true) { let idx = indexOfId(v, id); idx = loop ? (idx + 1) % v.length : Math.min(idx + 1, v.length - 1); return v[idx]; } function prevById(v, id, loop = true) { let idx = indexOfId(v, id); if (idx === -1) return loop ? v[v.length - 1] : null; idx = loop ? (idx - 1 + v.length) % v.length : Math.max(0, idx - 1); return v[idx]; } // src/get-by-text.ts var getValueText = (item) => item.dataset.valuetext ?? item.textContent ?? ""; var dist_match = (valueText, query2) => valueText.toLowerCase().startsWith(query2.toLowerCase()); var dist_wrap = (v, idx) => { return v.map((_, index) => v[(Math.max(idx, 0) + index) % v.length]); }; function getByText(v, text, currentId) { const index = currentId ? indexOfId(v, currentId) : -1; let items = currentId ? dist_wrap(v, index) : v; const isSingleKey = text.length === 1; if (isSingleKey) { items = items.filter((item) => item.id !== currentId); } return items.find((item) => dist_match(getValueText(item), text)); } // src/get-by-typeahead.ts function getByTypeaheadImpl(_items, options) { const { state, activeId, key, timeout = 350 } = options; const search = state.keysSoFar + key; const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]); const query2 = isRepeated ? search[0] : search; let items = _items.slice(); const next = getByText(items, query2, activeId); function cleanup() { clearTimeout(state.timer); state.timer = -1; } function update(value) { state.keysSoFar = value; cleanup(); if (value !== "") { state.timer = +setTimeout(() => { update(""); cleanup(); }, timeout); } } update(search); return next; } var getByTypeahead = /* @__PURE__ */ Object.assign(getByTypeaheadImpl, { defaultOptions: { keysSoFar: "", timer: -1 }, isValidEvent: isValidTypeaheadEvent }); function isValidTypeaheadEvent(event) { return event.key.length === 1 && !event.ctrlKey && !event.metaKey; } // src/get-computed-style.ts var styleCache = /* @__PURE__ */ new WeakMap(); function dist_getComputedStyle(el) { if (!styleCache.has(el)) { const win = el.ownerDocument.defaultView || window; styleCache.set(el, win.getComputedStyle(el)); } return styleCache.get(el); } // src/get-event-target.ts function getEventTarget(event) { return event.composedPath?.()[0] ?? event.target; } // src/get-scroll-parent.ts function dist_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 dist_getScrollParent(el) { if (["html", "body", "#document"].includes(el.localName)) { return el.ownerDocument.body; } if (dist_isHTMLElement(el) && dist_isScrollParent(el)) { return el; } return dist_getScrollParent(getParent(el)); } function getScrollParents(el, list = []) { const parent = dist_getScrollParent(el); const isBody = parent === el.ownerDocument.body; const win = parent.ownerDocument.defaultView || window; const target = isBody ? [win].concat(win.visualViewport || [], dist_isScrollParent(parent) ? parent : []) : parent; const parents = list.concat(target); return isBody ? parents : parents.concat(getScrollParents(getParent(target))); } // src/is-editable-element.ts function isEditableElement(el) { if (el == null || !dist_isHTMLElement(el)) { return false; } try { const win = el.ownerDocument.defaultView || window; return el instanceof win.HTMLInputElement && el.selectionStart != null || /(textarea|select)/.test(el.localName) || el.isContentEditable; } catch { return false; } } // src/platform.ts var isDom = () => typeof document !== "undefined"; function getPlatform() { const agent = navigator.userAgentData; return agent?.platform ?? navigator.platform; } var pt = (v) => isDom() && v.test(getPlatform()); var ua = (v) => isDom() && v.test(navigator.userAgent); var vn = (v) => isDom() && v.test(navigator.vendor); var isTouchDevice = () => isDom() && !!navigator.maxTouchPoints; var isMac = () => pt(/^Mac/) && !isTouchDevice(); var isIPhone = () => pt(/^iPhone/); var isSafari = () => isApple() && vn(/apple/i); var isFirefox = () => ua(/firefox\//i); var isApple = () => pt(/mac|iphone|ipad|ipod/i); var isIos = () => isApple() && !isMac(); // src/query.ts function queryAll(root, selector) { return Array.from(root?.querySelectorAll(selector) ?? []); } function query(root, selector) { return root?.querySelector(selector); } // src/raf.ts function nextTick(fn) { const set = /* @__PURE__ */ new Set(); function raf2(fn2) { const id = globalThis.requestAnimationFrame(fn2); set.add(() => globalThis.cancelAnimationFrame(id)); } raf2(() => raf2(fn)); return function cleanup() { set.forEach((fn2) => fn2()); }; } function raf(fn) { const id = globalThis.requestAnimationFrame(fn); return () => { globalThis.cancelAnimationFrame(id); }; } // src/index.ts var MAX_Z_INDEX = 2147483647; //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@zag-js/focus-visible/dist/index.mjs // src/index.ts 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 dist_isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false; function isValidKey(e) { return !(e.metaKey || !dist_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 (!hasEventBeforeFocus && !hasBlurredWindowRecently) { modality = "virtual"; trigger("virtual", event); } hasEventBeforeFocus = false; hasBlurredWindowRecently = false; } function dist_onWindowBlur() { hasEventBeforeFocus = false; hasBlurredWindowRecently = true; } function isFocusVisible() { return modality !== "pointer"; } function setupGlobalFocusEvents() { if (!isDom() || 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", dist_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(fn) { setupGlobalFocusEvents(); fn(isFocusVisible()); const handler = () => fn(isFocusVisible()); handlers.add(handler); return () => { handlers.delete(handler); }; } function trackInteractionModality(fn) { setupGlobalFocusEvents(); fn(modality); const handler = () => fn(modality); handlers.add(handler); return () => { handlers.delete(handler); }; } function setInteractionModality(value) { modality = value; trigger(value, null); } function getInteractionModality() { return modality; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/checkbox/dist/chunk-7D6N5TE5.mjs 'use client' // src/use-checkbox.ts ; // ../../utilities/object-utils/src/omit.ts function chunk_7D6N5TE5_omit(object, keysToOmit = []) { const clone = Object.assign({}, object); for (const key of keysToOmit) { if (key in clone) { delete clone[key]; } } return clone; } // src/use-checkbox.ts function useCheckbox(props = {}) { const formControlProps = useFormControlProps(props); const { isDisabled, isReadOnly, isRequired, isInvalid, id, onBlur, onFocus, "aria-describedby": ariaDescribedBy } = formControlProps; const { defaultChecked, isChecked: checkedProp, isFocusable, onChange, isIndeterminate, name, value, tabIndex = void 0, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-invalid": ariaInvalid, ...rest } = props; const htmlProps = chunk_7D6N5TE5_omit(rest, [ "isDisabled", "isReadOnly", "isRequired", "isInvalid", "id", "onBlur", "onFocus", "aria-describedby" ]); const onChangeProp = dist_useCallbackRef(onChange); const onBlurProp = dist_useCallbackRef(onBlur); const onFocusProp = dist_useCallbackRef(onFocus); const [isFocusVisible, setIsFocusVisible] = (0,external_React_.useState)(false); const [isFocused, setFocused] = (0,external_React_.useState)(false); const [isHovered, setHovered] = (0,external_React_.useState)(false); const [isActive, setActive] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { return trackFocusVisible(setIsFocusVisible); }, []); const inputRef = (0,external_React_.useRef)(null); const [rootIsLabelElement, setRootIsLabelElement] = (0,external_React_.useState)(true); const [checkedState, setCheckedState] = (0,external_React_.useState)(!!defaultChecked); const isControlled = checkedProp !== void 0; const isChecked = isControlled ? checkedProp : checkedState; const handleChange = (0,external_React_.useCallback)( (event) => { if (isReadOnly || isDisabled) { event.preventDefault(); return; } if (!isControlled) { if (isChecked) { setCheckedState(event.target.checked); } else { setCheckedState(isIndeterminate ? true : event.target.checked); } } onChangeProp == null ? void 0 : onChangeProp(event); }, [ isReadOnly, isDisabled, isChecked, isControlled, isIndeterminate, onChangeProp ] ); dist_useSafeLayoutEffect(() => { if (inputRef.current) { inputRef.current.indeterminate = Boolean(isIndeterminate); } }, [isIndeterminate]); dist_useUpdateEffect(() => { if (isDisabled) { setFocused(false); } }, [isDisabled, setFocused]); dist_useSafeLayoutEffect(() => { const el = inputRef.current; if (!(el == null ? void 0 : el.form)) return; const formResetListener = () => { setCheckedState(!!defaultChecked); }; el.form.addEventListener("reset", formResetListener); return () => { var _a; return (_a = el.form) == null ? void 0 : _a.removeEventListener("reset", formResetListener); }; }, []); const trulyDisabled = isDisabled && !isFocusable; const onKeyDown = (0,external_React_.useCallback)( (event) => { if (event.key === " ") { setActive(true); } }, [setActive] ); const onKeyUp = (0,external_React_.useCallback)( (event) => { if (event.key === " ") { setActive(false); } }, [setActive] ); dist_useSafeLayoutEffect(() => { if (!inputRef.current) return; const notInSync = inputRef.current.checked !== isChecked; if (notInSync) { setCheckedState(inputRef.current.checked); } }, [inputRef.current]); const getCheckboxProps = (0,external_React_.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 && isFocusVisible), "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, isFocusVisible, isHovered, isIndeterminate, isInvalid, isReadOnly ] ); const getIndicatorProps = (0,external_React_.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 && isFocusVisible), "data-indeterminate": dataAttr(isIndeterminate), "data-disabled": dataAttr(isDisabled), "data-invalid": dataAttr(isInvalid), "data-readonly": dataAttr(isReadOnly) }), [ isActive, isChecked, isDisabled, isFocused, isFocusVisible, isHovered, isIndeterminate, isInvalid, isReadOnly ] ); const getRootProps = (0,external_React_.useCallback)( (props2 = {}, forwardedRef = null) => ({ ...htmlProps, ...props2, ref: mergeRefs(forwardedRef, (node) => { if (!node) return; setRootIsLabelElement(node.tagName === "LABEL"); }), onClick: callAllHandlers(props2.onClick, () => { var _a; if (!rootIsLabelElement) { (_a = inputRef.current) == null ? void 0 : _a.click(); requestAnimationFrame(() => { var _a2; (_a2 = inputRef.current) == null ? void 0 : _a2.focus({ preventScroll: true }); }); } }), "data-disabled": dataAttr(isDisabled), "data-checked": dataAttr(isChecked), "data-invalid": dataAttr(isInvalid) }), [htmlProps, isDisabled, isChecked, isInvalid, rootIsLabelElement] ); const getInputProps = (0,external_React_.useCallback)( (props2 = {}, forwardedRef = null) => { return { ...props2, ref: mergeRefs(inputRef, forwardedRef), type: "checkbox", name, value, id, 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, style: visuallyHiddenStyle }; }, [ name, value, id, handleChange, onBlurProp, onFocusProp, onKeyDown, onKeyUp, isRequired, isChecked, trulyDisabled, isReadOnly, ariaLabel, ariaLabelledBy, ariaInvalid, isInvalid, ariaDescribedBy, isDisabled, tabIndex ] ); const getLabelProps = (0,external_React_.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 state = { isInvalid, isFocused, isChecked, isActive, isHovered, isIndeterminate, isDisabled, isReadOnly, isRequired }; return { state, getRootProps, getCheckboxProps, getIndicatorProps, getInputProps, getLabelProps, htmlProps }; } function stopEvent(event) { event.preventDefault(); event.stopPropagation(); } //# sourceMappingURL=chunk-7D6N5TE5.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/switch/dist/chunk-VTV6N5LE.mjs 'use client' // src/switch.tsx ; var Switch = forwardRef(function Switch2(props, ref) { const styles = useMultiStyleConfig("Switch", props); const { spacing = "0.5rem", children, ...ownProps } = omitThemingProps(props); const { getIndicatorProps, getInputProps, getCheckboxProps, getRootProps, getLabelProps } = useCheckbox(ownProps); const containerStyles = (0,external_React_.useMemo)( () => ({ display: "inline-block", position: "relative", verticalAlign: "middle", lineHeight: 0, ...styles.container }), [styles.container] ); const trackStyles = (0,external_React_.useMemo)( () => ({ display: "inline-flex", flexShrink: 0, justifyContent: "flex-start", boxSizing: "content-box", cursor: "pointer", ...styles.track }), [styles.track] ); const labelStyles = (0,external_React_.useMemo)( () => ({ userSelect: "none", marginStart: spacing, ...styles.label }), [spacing, styles.label] ); return /* @__PURE__ */ (0,jsx_runtime.jsxs)( chakra.label, { ...getRootProps(), className: cx("chakra-switch", props.className), __css: containerStyles, children: [ /* @__PURE__ */ (0,jsx_runtime.jsx)("input", { className: "chakra-switch__input", ...getInputProps({}, ref) }), /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { ...getCheckboxProps(), className: "chakra-switch__track", __css: trackStyles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { __css: styles.thumb, className: "chakra-switch__thumb", ...getIndicatorProps() } ) } ), children && /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { className: "chakra-switch__label", ...getLabelProps(), __css: labelStyles, children } ) ] } ); }); Switch.displayName = "Switch"; //# sourceMappingURL=chunk-VTV6N5LE.mjs.map ;// CONCATENATED MODULE: ./node_modules/react-hook-form/dist/index.esm.mjs var isCheckBoxInput = (element) => element.type === 'checkbox'; var isDateObject = (value) => value instanceof Date; var isNullOrUndefined = (value) => value == null; const isObjectType = (value) => typeof value === 'object'; var index_esm_isObject = (value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value); var getEventValue = (event) => index_esm_isObject(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event; var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name; var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name)); var isPlainObject = (tempObject) => { const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype; return (index_esm_isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf')); }; var isWeb = typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined' && typeof document !== 'undefined'; function cloneObject(data) { let copy; const isArray = Array.isArray(data); if (data instanceof Date) { copy = new Date(data); } else if (data instanceof Set) { copy = new Set(data); } else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) && (isArray || index_esm_isObject(data))) { copy = isArray ? [] : {}; if (!isArray && !isPlainObject(data)) { copy = data; } else { for (const key in data) { if (data.hasOwnProperty(key)) { copy[key] = cloneObject(data[key]); } } } } else { return data; } return copy; } var index_esm_compact = (value) => Array.isArray(value) ? value.filter(Boolean) : []; var index_esm_isUndefined = (val) => val === undefined; var index_esm_get = (obj, path, defaultValue) => { if (!path || !index_esm_isObject(obj)) { return defaultValue; } const result = index_esm_compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj); return index_esm_isUndefined(result) || result === obj ? index_esm_isUndefined(obj[path]) ? defaultValue : obj[path] : result; }; var isBoolean = (value) => typeof value === 'boolean'; const EVENTS = { BLUR: 'blur', FOCUS_OUT: 'focusout', CHANGE: 'change', }; const VALIDATION_MODE = { onBlur: 'onBlur', onChange: 'onChange', onSubmit: 'onSubmit', onTouched: 'onTouched', all: 'all', }; const INPUT_VALIDATION_RULES = { max: 'max', min: 'min', maxLength: 'maxLength', minLength: 'minLength', pattern: 'pattern', required: 'required', validate: 'validate', }; const HookFormContext = external_React_.createContext(null); /** * This custom hook allows you to access the form context. useFormContext is intended to be used in deeply nested structures, where it would become inconvenient to pass the context as a prop. To be used with {@link FormProvider}. * * @remarks * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi) * * @returns return all useForm methods * * @example * ```tsx * function App() { * const methods = useForm(); * const onSubmit = data => console.log(data); * * return ( * <FormProvider {...methods} > * <form onSubmit={methods.handleSubmit(onSubmit)}> * <NestedInput /> * <input type="submit" /> * </form> * </FormProvider> * ); * } * * function NestedInput() { * const { register } = useFormContext(); // retrieve all hook methods * return <input {...register("test")} />; * } * ``` */ const useFormContext = () => external_React_.useContext(HookFormContext); /** * A provider component that propagates the `useForm` methods to all children components via [React Context](https://reactjs.org/docs/context.html) API. To be used with {@link useFormContext}. * * @remarks * [API](https://react-hook-form.com/docs/useformcontext) • [Demo](https://codesandbox.io/s/react-hook-form-v7-form-context-ytudi) * * @param props - all useForm methods * * @example * ```tsx * function App() { * const methods = useForm(); * const onSubmit = data => console.log(data); * * return ( * <FormProvider {...methods} > * <form onSubmit={methods.handleSubmit(onSubmit)}> * <NestedInput /> * <input type="submit" /> * </form> * </FormProvider> * ); * } * * function NestedInput() { * const { register } = useFormContext(); // retrieve all hook methods * return <input {...register("test")} />; * } * ``` */ const FormProvider = (props) => { const { children, ...data } = props; return (external_React_.createElement(HookFormContext.Provider, { value: data }, children)); }; var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => { const result = { defaultValues: control._defaultValues, }; for (const key in formState) { Object.defineProperty(result, key, { get: () => { const _key = key; if (control._proxyFormState[_key] !== VALIDATION_MODE.all) { control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all; } localProxyFormState && (localProxyFormState[_key] = true); return formState[_key]; }, }); } return result; }; var index_esm_isEmptyObject = (value) => index_esm_isObject(value) && !Object.keys(value).length; var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => { updateFormState(formStateData); const { name, ...formState } = formStateData; return (index_esm_isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all))); }; var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]); var shouldSubscribeByName = (name, signalName, exact) => !name || !signalName || name === signalName || convertToArrayPayload(name).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName))); function useSubscribe(props) { const _props = external_React_.useRef(props); _props.current = props; external_React_.useEffect(() => { const subscription = !props.disabled && _props.current.subject && _props.current.subject.subscribe({ next: _props.current.next, }); return () => { subscription && subscription.unsubscribe(); }; }, [props.disabled]); } /** * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application. * * @remarks * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly) * * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn} * * @example * ```tsx * function App() { * const { register, handleSubmit, control } = useForm({ * defaultValues: { * firstName: "firstName" * }}); * const { dirtyFields } = useFormState({ * control * }); * const onSubmit = (data) => console.log(data); * * return ( * <form onSubmit={handleSubmit(onSubmit)}> * <input {...register("firstName")} placeholder="First Name" /> * {dirtyFields.firstName && <p>Field is dirty.</p>} * <input type="submit" /> * </form> * ); * } * ``` */ function useFormState(props) { const methods = useFormContext(); const { control = methods.control, disabled, name, exact } = props || {}; const [formState, updateFormState] = external_React_.useState(control._formState); const _mounted = external_React_.useRef(true); const _localProxyFormState = external_React_.useRef({ isDirty: false, isLoading: false, dirtyFields: false, touchedFields: false, isValidating: false, isValid: false, errors: false, }); const _name = external_React_.useRef(name); _name.current = name; useSubscribe({ disabled, next: (value) => _mounted.current && shouldSubscribeByName(_name.current, value.name, exact) && shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) && updateFormState({ ...control._formState, ...value, }), subject: control._subjects.state, }); external_React_.useEffect(() => { _mounted.current = true; _localProxyFormState.current.isValid && control._updateValid(true); return () => { _mounted.current = false; }; }, [control]); return getProxyFormState(formState, control, _localProxyFormState.current, false); } var index_esm_isString = (value) => typeof value === 'string'; var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => { if (index_esm_isString(names)) { isGlobal && _names.watch.add(names); return index_esm_get(formValues, names, defaultValue); } if (Array.isArray(names)) { return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), index_esm_get(formValues, fieldName))); } isGlobal && (_names.watchAll = true); return formValues; }; /** * Custom hook to subscribe to field change and isolate re-rendering at the component level. * * @remarks * * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e) * * @example * ```tsx * const { control } = useForm(); * const values = useWatch({ * name: "fieldName" * control, * }) * ``` */ function useWatch(props) { const methods = useFormContext(); const { control = methods.control, name, defaultValue, disabled, exact, } = props || {}; const _name = external_React_.useRef(name); _name.current = name; useSubscribe({ disabled, subject: control._subjects.values, next: (formState) => { if (shouldSubscribeByName(_name.current, formState.name, exact)) { updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue))); } }, }); const [value, updateValue] = external_React_.useState(control._getWatch(name, defaultValue)); external_React_.useEffect(() => control._removeUnmounted()); return value; } var isKey = (value) => /^\w*$/.test(value); var stringToPath = (input) => index_esm_compact(input.replace(/["|']|\]/g, '').split(/\.|\[/)); function set(object, path, value) { let index = -1; const tempPath = isKey(path) ? [path] : stringToPath(path); const length = tempPath.length; const lastIndex = length - 1; while (++index < length) { const key = tempPath[index]; let newValue = value; if (index !== lastIndex) { const objValue = object[key]; newValue = index_esm_isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {}; } object[key] = newValue; object = object[key]; } return object; } /** * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level. * * @remarks * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px) * * @param props - the path name to the form field value, and validation rules. * * @returns field properties, field and form state. {@link UseControllerReturn} * * @example * ```tsx * function Input(props) { * const { field, fieldState, formState } = useController(props); * return ( * <div> * <input {...field} placeholder={props.name} /> * <p>{fieldState.isTouched && "Touched"}</p> * <p>{formState.isSubmitted ? "submitted" : ""}</p> * </div> * ); * } * ``` */ function useController(props) { const methods = useFormContext(); const { name, disabled, control = methods.control, shouldUnregister } = props; const isArrayField = isNameInFieldArray(control._names.array, name); const value = useWatch({ control, name, defaultValue: index_esm_get(control._formValues, name, index_esm_get(control._defaultValues, name, props.defaultValue)), exact: true, }); const formState = useFormState({ control, name, }); const _registerProps = external_React_.useRef(control.register(name, { ...props.rules, value, })); _registerProps.current = control.register(name, props.rules); external_React_.useEffect(() => { const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister; const updateMounted = (name, value) => { const field = index_esm_get(control._fields, name); if (field) { field._f.mount = value; } }; updateMounted(name, true); if (_shouldUnregisterField) { const value = cloneObject(index_esm_get(control._options.defaultValues, name)); set(control._defaultValues, name, value); if (index_esm_isUndefined(index_esm_get(control._formValues, name))) { set(control._formValues, name, value); } } return () => { (isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false); }; }, [name, control, isArrayField, shouldUnregister]); external_React_.useEffect(() => { if (index_esm_get(control._fields, name)) { control._updateDisabledField({ disabled, fields: control._fields, name, value: index_esm_get(control._fields, name)._f.value, }); } }, [disabled, name, control]); return { field: { name, value, ...(isBoolean(disabled) || isBoolean(formState.disabled) ? { disabled: formState.disabled || disabled } : {}), onChange: external_React_.useCallback((event) => _registerProps.current.onChange({ target: { value: getEventValue(event), name: name, }, type: EVENTS.CHANGE, }), [name]), onBlur: external_React_.useCallback(() => _registerProps.current.onBlur({ target: { value: index_esm_get(control._formValues, name), name: name, }, type: EVENTS.BLUR, }), [name, control]), ref: (elm) => { const field = index_esm_get(control._fields, name); if (field && elm) { field._f.ref = { focus: () => elm.focus(), select: () => elm.select(), setCustomValidity: (message) => elm.setCustomValidity(message), reportValidity: () => elm.reportValidity(), }; } }, }, formState, fieldState: Object.defineProperties({}, { invalid: { enumerable: true, get: () => !!index_esm_get(formState.errors, name), }, isDirty: { enumerable: true, get: () => !!index_esm_get(formState.dirtyFields, name), }, isTouched: { enumerable: true, get: () => !!index_esm_get(formState.touchedFields, name), }, error: { enumerable: true, get: () => index_esm_get(formState.errors, name), }, }), }; } /** * Component based on `useController` hook to work with controlled component. * * @remarks * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s/react-hook-form-v6-controller-ts-jwyzw) • [Video](https://www.youtube.com/watch?v=N2UNk_UCVyA) * * @param props - the path name to the form field value, and validation rules. * * @returns provide field handler functions, field and form state. * * @example * ```tsx * function App() { * const { control } = useForm<FormValues>({ * defaultValues: { * test: "" * } * }); * * return ( * <form> * <Controller * control={control} * name="test" * render={({ field: { onChange, onBlur, value, ref }, formState, fieldState }) => ( * <> * <input * onChange={onChange} // send value to hook form * onBlur={onBlur} // notify when input is touched * value={value} // return updated value * ref={ref} // set ref for focus management * /> * <p>{formState.isSubmitted ? "submitted" : ""}</p> * <p>{fieldState.isTouched ? "touched" : ""}</p> * </> * )} * /> * </form> * ); * } * ``` */ const Controller = (props) => props.render(useController(props)); const POST_REQUEST = 'post'; /** * Form component to manage submission. * * @param props - to setup submission detail. {@link FormProps} * * @returns form component or headless render prop. * * @example * ```tsx * function App() { * const { control, formState: { errors } } = useForm(); * * return ( * <Form action="/api" control={control}> * <input {...register("name")} /> * <p>{errors?.root?.server && 'Server error'}</p> * <button>Submit</button> * </Form> * ); * } * ``` */ function index_esm_Form(props) { const methods = useFormContext(); const [mounted, setMounted] = React.useState(false); const { control = methods.control, onSubmit, children, action, method = POST_REQUEST, headers, encType, onError, render, onSuccess, validateStatus, ...rest } = props; const submit = async (event) => { let hasError = false; let type = ''; await control.handleSubmit(async (data) => { const formData = new FormData(); let formDataJson = ''; try { formDataJson = JSON.stringify(data); } catch (_a) { } for (const name of control._names.mount) { formData.append(name, index_esm_get(data, name)); } if (onSubmit) { await onSubmit({ data, event, method, formData, formDataJson, }); } if (action) { try { const shouldStringifySubmissionData = [ headers && headers['Content-Type'], encType, ].some((value) => value && value.includes('json')); const response = await fetch(action, { method, headers: { ...headers, ...(encType ? { 'Content-Type': encType } : {}), }, body: shouldStringifySubmissionData ? formDataJson : formData, }); if (response && (validateStatus ? !validateStatus(response.status) : response.status < 200 || response.status >= 300)) { hasError = true; onError && onError({ response }); type = String(response.status); } else { onSuccess && onSuccess({ response }); } } catch (error) { hasError = true; onError && onError({ error }); } } })(event); if (hasError && props.control) { props.control._subjects.state.next({ isSubmitSuccessful: false, }); props.control.setError('root.server', { type, }); } }; React.useEffect(() => { setMounted(true); }, []); return render ? (React.createElement(React.Fragment, null, render({ submit, }))) : (React.createElement("form", { noValidate: mounted, action: action, method: method, encType: encType, onSubmit: submit, ...rest }, children)); } var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria ? { ...errors[name], types: { ...(errors[name] && errors[name].types ? errors[name].types : {}), [type]: message || true, }, } : {}; var generateId = () => { const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000; return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { const r = (Math.random() * 16 + d) % 16 | 0; return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16); }); }; var getFocusFieldName = (name, index, options = {}) => options.shouldFocus || index_esm_isUndefined(options.shouldFocus) ? options.focusName || `${name}.${index_esm_isUndefined(options.focusIndex) ? index : options.focusIndex}.` : ''; var getValidationModes = (mode) => ({ isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit, isOnBlur: mode === VALIDATION_MODE.onBlur, isOnChange: mode === VALIDATION_MODE.onChange, isOnAll: mode === VALIDATION_MODE.all, isOnTouch: mode === VALIDATION_MODE.onTouched, }); var isWatched = (name, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name) || [..._names.watch].some((watchName) => name.startsWith(watchName) && /^\.\w+/.test(name.slice(watchName.length)))); const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => { for (const key of fieldsNames || Object.keys(fields)) { const field = index_esm_get(fields, key); if (field) { const { _f, ...currentField } = field; if (_f) { if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) { break; } else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) { break; } } else if (index_esm_isObject(currentField)) { iterateFieldsByAction(currentField, action); } } } }; var updateFieldArrayRootError = (errors, error, name) => { const fieldArrayErrors = index_esm_compact(index_esm_get(errors, name)); set(fieldArrayErrors, 'root', error[name]); set(errors, name, fieldArrayErrors); return errors; }; var isFileInput = (element) => element.type === 'file'; var index_esm_isFunction = (value) => typeof value === 'function'; var index_esm_isHTMLElement = (value) => { if (!isWeb) { return false; } const owner = value ? value.ownerDocument : 0; return (value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement)); }; var isMessage = (value) => index_esm_isString(value); var isRadioInput = (element) => element.type === 'radio'; var isRegex = (value) => value instanceof RegExp; const defaultResult = { value: false, isValid: false, }; const validResult = { value: true, isValid: true }; var getCheckboxValue = (options) => { if (Array.isArray(options)) { if (options.length > 1) { const values = options .filter((option) => option && option.checked && !option.disabled) .map((option) => option.value); return { value: values, isValid: !!values.length }; } return options[0].checked && !options[0].disabled ? // @ts-expect-error expected to work in the browser options[0].attributes && !index_esm_isUndefined(options[0].attributes.value) ? index_esm_isUndefined(options[0].value) || options[0].value === '' ? validResult : { value: options[0].value, isValid: true } : validResult : defaultResult; } return defaultResult; }; const defaultReturn = { isValid: false, value: null, }; var getRadioValue = (options) => Array.isArray(options) ? options.reduce((previous, option) => option && option.checked && !option.disabled ? { isValid: true, value: option.value, } : previous, defaultReturn) : defaultReturn; function getValidateError(result, ref, type = 'validate') { if (isMessage(result) || (Array.isArray(result) && result.every(isMessage)) || (isBoolean(result) && !result)) { return { type, message: isMessage(result) ? result : '', ref, }; } } var getValueAndMessage = (validationData) => index_esm_isObject(validationData) && !isRegex(validationData) ? validationData : { value: validationData, message: '', }; var validateField = async (field, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => { const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, disabled, } = field._f; const inputValue = index_esm_get(formValues, name); if (!mount || disabled) { return {}; } const inputRef = refs ? refs[0] : ref; const setCustomValidity = (message) => { if (shouldUseNativeValidation && inputRef.reportValidity) { inputRef.setCustomValidity(isBoolean(message) ? '' : message || ''); inputRef.reportValidity(); } }; const error = {}; const isRadio = isRadioInput(ref); const isCheckBox = isCheckBoxInput(ref); const isRadioOrCheckbox = isRadio || isCheckBox; const isEmpty = ((valueAsNumber || isFileInput(ref)) && index_esm_isUndefined(ref.value) && index_esm_isUndefined(inputValue)) || (index_esm_isHTMLElement(ref) && ref.value === '') || inputValue === '' || (Array.isArray(inputValue) && !inputValue.length); const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error); const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => { const message = exceedMax ? maxLengthMessage : minLengthMessage; error[name] = { type: exceedMax ? maxType : minType, message, ref, ...appendErrorsCurry(exceedMax ? maxType : minType, message), }; }; if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) || (isBoolean(inputValue) && !inputValue) || (isCheckBox && !getCheckboxValue(refs).isValid) || (isRadio && !getRadioValue(refs).isValid))) { const { value, message } = isMessage(required) ? { value: !!required, message: required } : getValueAndMessage(required); if (value) { error[name] = { type: INPUT_VALIDATION_RULES.required, message, ref: inputRef, ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message), }; if (!validateAllFieldCriteria) { setCustomValidity(message); return error; } } } if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) { let exceedMax; let exceedMin; const maxOutput = getValueAndMessage(max); const minOutput = getValueAndMessage(min); if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) { const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue); if (!isNullOrUndefined(maxOutput.value)) { exceedMax = valueNumber > maxOutput.value; } if (!isNullOrUndefined(minOutput.value)) { exceedMin = valueNumber < minOutput.value; } } else { const valueDate = ref.valueAsDate || new Date(inputValue); const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time); const isTime = ref.type == 'time'; const isWeek = ref.type == 'week'; if (index_esm_isString(maxOutput.value) && inputValue) { exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value); } if (index_esm_isString(minOutput.value) && inputValue) { exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value); } } if (exceedMax || exceedMin) { getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min); if (!validateAllFieldCriteria) { setCustomValidity(error[name].message); return error; } } } if ((maxLength || minLength) && !isEmpty && (index_esm_isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) { const maxLengthOutput = getValueAndMessage(maxLength); const minLengthOutput = getValueAndMessage(minLength); const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value; const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value; if (exceedMax || exceedMin) { getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message); if (!validateAllFieldCriteria) { setCustomValidity(error[name].message); return error; } } } if (pattern && !isEmpty && index_esm_isString(inputValue)) { const { value: patternValue, message } = getValueAndMessage(pattern); if (isRegex(patternValue) && !inputValue.match(patternValue)) { error[name] = { type: INPUT_VALIDATION_RULES.pattern, message, ref, ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message), }; if (!validateAllFieldCriteria) { setCustomValidity(message); return error; } } } if (validate) { if (index_esm_isFunction(validate)) { const result = await validate(inputValue, formValues); const validateError = getValidateError(result, inputRef); if (validateError) { error[name] = { ...validateError, ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message), }; if (!validateAllFieldCriteria) { setCustomValidity(validateError.message); return error; } } } else if (index_esm_isObject(validate)) { let validationResult = {}; for (const key in validate) { if (!index_esm_isEmptyObject(validationResult) && !validateAllFieldCriteria) { break; } const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key); if (validateError) { validationResult = { ...validateError, ...appendErrorsCurry(key, validateError.message), }; setCustomValidity(validateError.message); if (validateAllFieldCriteria) { error[name] = validationResult; } } } if (!index_esm_isEmptyObject(validationResult)) { error[name] = { ref: inputRef, ...validationResult, }; if (!validateAllFieldCriteria) { return error; } } } } setCustomValidity(true); return error; }; function index_esm_append(data, value) { return [...data, ...convertToArrayPayload(value)]; } var fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined; function insert(data, index, value) { return [ ...data.slice(0, index), ...convertToArrayPayload(value), ...data.slice(index), ]; } var moveArrayAt = (data, from, to) => { if (!Array.isArray(data)) { return []; } if (index_esm_isUndefined(data[to])) { data[to] = undefined; } data.splice(to, 0, data.splice(from, 1)[0]); return data; }; function prepend(data, value) { return [...convertToArrayPayload(value), ...convertToArrayPayload(data)]; } function removeAtIndexes(data, indexes) { let i = 0; const temp = [...data]; for (const index of indexes) { temp.splice(index - i, 1); i++; } return index_esm_compact(temp).length ? temp : []; } var removeArrayAt = (data, index) => index_esm_isUndefined(index) ? [] : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b)); var swapArrayAt = (data, indexA, indexB) => { data[indexA] = [data[indexB], (data[indexB] = data[indexA])][0]; }; function baseGet(object, updatePath) { const length = updatePath.slice(0, -1).length; let index = 0; while (index < length) { object = index_esm_isUndefined(object) ? index++ : object[updatePath[index++]]; } return object; } function index_esm_isEmptyArray(obj) { for (const key in obj) { if (obj.hasOwnProperty(key) && !index_esm_isUndefined(obj[key])) { return false; } } return true; } function unset(object, path) { const paths = Array.isArray(path) ? path : isKey(path) ? [path] : stringToPath(path); const childObject = paths.length === 1 ? object : baseGet(object, paths); const index = paths.length - 1; const key = paths[index]; if (childObject) { delete childObject[key]; } if (index !== 0 && ((index_esm_isObject(childObject) && index_esm_isEmptyObject(childObject)) || (Array.isArray(childObject) && index_esm_isEmptyArray(childObject)))) { unset(object, paths.slice(0, -1)); } return object; } var updateAt = (fieldValues, index, value) => { fieldValues[index] = value; return fieldValues; }; /** * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A) * * @remarks * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) * * @param props - useFieldArray props * * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn} * * @example * ```tsx * function App() { * const { register, control, handleSubmit, reset, trigger, setError } = useForm({ * defaultValues: { * test: [] * } * }); * const { fields, append } = useFieldArray({ * control, * name: "test" * }); * * return ( * <form onSubmit={handleSubmit(data => console.log(data))}> * {fields.map((item, index) => ( * <input key={item.id} {...register(`test.${index}.firstName`)} /> * ))} * <button type="button" onClick={() => append({ firstName: "bill" })}> * append * </button> * <input type="submit" /> * </form> * ); * } * ``` */ function useFieldArray(props) { const methods = useFormContext(); const { control = methods.control, name, keyName = 'id', shouldUnregister, } = props; const [fields, setFields] = React.useState(control._getFieldArray(name)); const ids = React.useRef(control._getFieldArray(name).map(generateId)); const _fieldIds = React.useRef(fields); const _name = React.useRef(name); const _actioned = React.useRef(false); _name.current = name; _fieldIds.current = fields; control._names.array.add(name); props.rules && control.register(name, props.rules); useSubscribe({ next: ({ values, name: fieldArrayName, }) => { if (fieldArrayName === _name.current || !fieldArrayName) { const fieldValues = index_esm_get(values, _name.current); if (Array.isArray(fieldValues)) { setFields(fieldValues); ids.current = fieldValues.map(generateId); } } }, subject: control._subjects.array, }); const updateValues = React.useCallback((updatedFieldArrayValues) => { _actioned.current = true; control._updateFieldArray(name, updatedFieldArrayValues); }, [control, name]); const append$1 = (value, options) => { const appendValue = convertToArrayPayload(cloneObject(value)); const updatedFieldArrayValues = index_esm_append(control._getFieldArray(name), appendValue); control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options); ids.current = index_esm_append(ids.current, appendValue.map(generateId)); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, index_esm_append, { argA: fillEmptyArray(value), }); }; const prepend$1 = (value, options) => { const prependValue = convertToArrayPayload(cloneObject(value)); const updatedFieldArrayValues = prepend(control._getFieldArray(name), prependValue); control._names.focus = getFocusFieldName(name, 0, options); ids.current = prepend(ids.current, prependValue.map(generateId)); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, prepend, { argA: fillEmptyArray(value), }); }; const remove = (index) => { const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index); ids.current = removeArrayAt(ids.current, index); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, removeArrayAt, { argA: index, }); }; const insert$1 = (index, value, options) => { const insertValue = convertToArrayPayload(cloneObject(value)); const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue); control._names.focus = getFocusFieldName(name, index, options); ids.current = insert(ids.current, index, insertValue.map(generateId)); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, insert, { argA: index, argB: fillEmptyArray(value), }); }; const swap = (indexA, indexB) => { const updatedFieldArrayValues = control._getFieldArray(name); swapArrayAt(updatedFieldArrayValues, indexA, indexB); swapArrayAt(ids.current, indexA, indexB); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, swapArrayAt, { argA: indexA, argB: indexB, }, false); }; const move = (from, to) => { const updatedFieldArrayValues = control._getFieldArray(name); moveArrayAt(updatedFieldArrayValues, from, to); moveArrayAt(ids.current, from, to); updateValues(updatedFieldArrayValues); setFields(updatedFieldArrayValues); control._updateFieldArray(name, updatedFieldArrayValues, moveArrayAt, { argA: from, argB: to, }, false); }; const update = (index, value) => { const updateValue = cloneObject(value); const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue); ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]); updateValues(updatedFieldArrayValues); setFields([...updatedFieldArrayValues]); control._updateFieldArray(name, updatedFieldArrayValues, updateAt, { argA: index, argB: updateValue, }, true, false); }; const replace = (value) => { const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value)); ids.current = updatedFieldArrayValues.map(generateId); updateValues([...updatedFieldArrayValues]); setFields([...updatedFieldArrayValues]); control._updateFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false); }; React.useEffect(() => { control._state.action = false; isWatched(name, control._names) && control._subjects.state.next({ ...control._formState, }); if (_actioned.current && (!getValidationModes(control._options.mode).isOnSubmit || control._formState.isSubmitted)) { if (control._options.resolver) { control._executeSchema([name]).then((result) => { const error = index_esm_get(result.errors, name); const existingError = index_esm_get(control._formState.errors, name); if (existingError ? (!error && existingError.type) || (error && (existingError.type !== error.type || existingError.message !== error.message)) : error && error.type) { error ? set(control._formState.errors, name, error) : unset(control._formState.errors, name); control._subjects.state.next({ errors: control._formState.errors, }); } }); } else { const field = index_esm_get(control._fields, name); if (field && field._f) { validateField(field, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !index_esm_isEmptyObject(error) && control._subjects.state.next({ errors: updateFieldArrayRootError(control._formState.errors, error, name), })); } } } control._subjects.values.next({ name, values: { ...control._formValues }, }); control._names.focus && iterateFieldsByAction(control._fields, (ref, key) => { if (control._names.focus && key.startsWith(control._names.focus) && ref.focus) { ref.focus(); return 1; } return; }); control._names.focus = ''; control._updateValid(); _actioned.current = false; }, [fields, name, control]); React.useEffect(() => { !index_esm_get(control._formValues, name) && control._updateFieldArray(name); return () => { (control._options.shouldUnregister || shouldUnregister) && control.unregister(name); }; }, [name, control, keyName, shouldUnregister]); return { swap: React.useCallback(swap, [updateValues, name, control]), move: React.useCallback(move, [updateValues, name, control]), prepend: React.useCallback(prepend$1, [updateValues, name, control]), append: React.useCallback(append$1, [updateValues, name, control]), remove: React.useCallback(remove, [updateValues, name, control]), insert: React.useCallback(insert$1, [updateValues, name, control]), update: React.useCallback(update, [updateValues, name, control]), replace: React.useCallback(replace, [updateValues, name, control]), fields: React.useMemo(() => fields.map((field, index) => ({ ...field, [keyName]: ids.current[index] || generateId(), })), [fields, keyName]), }; } function createSubject() { let _observers = []; const next = (value) => { for (const observer of _observers) { observer.next && observer.next(value); } }; const subscribe = (observer) => { _observers.push(observer); return { unsubscribe: () => { _observers = _observers.filter((o) => o !== observer); }, }; }; const unsubscribe = () => { _observers = []; }; return { get observers() { return _observers; }, next, subscribe, unsubscribe, }; } var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value); function deepEqual(object1, object2) { if (isPrimitive(object1) || isPrimitive(object2)) { return object1 === object2; } if (isDateObject(object1) && isDateObject(object2)) { return object1.getTime() === object2.getTime(); } const keys1 = Object.keys(object1); const keys2 = Object.keys(object2); if (keys1.length !== keys2.length) { return false; } for (const key of keys1) { const val1 = object1[key]; if (!keys2.includes(key)) { return false; } if (key !== 'ref') { const val2 = object2[key]; if ((isDateObject(val1) && isDateObject(val2)) || (index_esm_isObject(val1) && index_esm_isObject(val2)) || (Array.isArray(val1) && Array.isArray(val2)) ? !deepEqual(val1, val2) : val1 !== val2) { return false; } } } return true; } var isMultipleSelect = (element) => element.type === `select-multiple`; var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref); var live = (ref) => index_esm_isHTMLElement(ref) && ref.isConnected; var objectHasFunction = (data) => { for (const key in data) { if (index_esm_isFunction(data[key])) { return true; } } return false; }; function markFieldsDirty(data, fields = {}) { const isParentNodeArray = Array.isArray(data); if (index_esm_isObject(data) || isParentNodeArray) { for (const key in data) { if (Array.isArray(data[key]) || (index_esm_isObject(data[key]) && !objectHasFunction(data[key]))) { fields[key] = Array.isArray(data[key]) ? [] : {}; markFieldsDirty(data[key], fields[key]); } else if (!isNullOrUndefined(data[key])) { fields[key] = true; } } } return fields; } function getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) { const isParentNodeArray = Array.isArray(data); if (index_esm_isObject(data) || isParentNodeArray) { for (const key in data) { if (Array.isArray(data[key]) || (index_esm_isObject(data[key]) && !objectHasFunction(data[key]))) { if (index_esm_isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) { dirtyFieldsFromValues[key] = Array.isArray(data[key]) ? markFieldsDirty(data[key], []) : { ...markFieldsDirty(data[key]) }; } else { getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]); } } else { dirtyFieldsFromValues[key] = !deepEqual(data[key], formValues[key]); } } } return dirtyFieldsFromValues; } var getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues)); var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => index_esm_isUndefined(value) ? value : valueAsNumber ? value === '' ? NaN : value ? +value : value : valueAsDate && index_esm_isString(value) ? new Date(value) : setValueAs ? setValueAs(value) : value; function getFieldValue(_f) { const ref = _f.ref; if (_f.refs ? _f.refs.every((ref) => ref.disabled) : ref.disabled) { return; } if (isFileInput(ref)) { return ref.files; } if (isRadioInput(ref)) { return getRadioValue(_f.refs).value; } if (isMultipleSelect(ref)) { return [...ref.selectedOptions].map(({ value }) => value); } if (isCheckBoxInput(ref)) { return getCheckboxValue(_f.refs).value; } return getFieldValueAs(index_esm_isUndefined(ref.value) ? _f.ref.value : ref.value, _f); } var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => { const fields = {}; for (const name of fieldsNames) { const field = index_esm_get(_fields, name); field && set(fields, name, field._f); } return { criteriaMode, names: [...fieldsNames], fields, shouldUseNativeValidation, }; }; var getRuleValue = (rule) => index_esm_isUndefined(rule) ? rule : isRegex(rule) ? rule.source : index_esm_isObject(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule; var hasValidation = (options) => options.mount && (options.required || options.min || options.max || options.maxLength || options.minLength || options.pattern || options.validate); function schemaErrorLookup(errors, _fields, name) { const error = index_esm_get(errors, name); if (error || isKey(name)) { return { error, name, }; } const names = name.split('.'); while (names.length) { const fieldName = names.join('.'); const field = index_esm_get(_fields, fieldName); const foundError = index_esm_get(errors, fieldName); if (field && !Array.isArray(field) && name !== fieldName) { return { name }; } if (foundError && foundError.type) { return { name: fieldName, error: foundError, }; } names.pop(); } return { name, }; } var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => { if (mode.isOnAll) { return false; } else if (!isSubmitted && mode.isOnTouch) { return !(isTouched || isBlurEvent); } else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) { return !isBlurEvent; } else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) { return isBlurEvent; } return true; }; var unsetEmptyArray = (ref, name) => !index_esm_compact(index_esm_get(ref, name)).length && unset(ref, name); const index_esm_defaultOptions = { mode: VALIDATION_MODE.onSubmit, reValidateMode: VALIDATION_MODE.onChange, shouldFocusError: true, }; function createFormControl(props = {}, flushRootRender) { let _options = { ...index_esm_defaultOptions, ...props, }; let _formState = { submitCount: 0, isDirty: false, isLoading: index_esm_isFunction(_options.defaultValues), isValidating: false, isSubmitted: false, isSubmitting: false, isSubmitSuccessful: false, isValid: false, touchedFields: {}, dirtyFields: {}, errors: {}, disabled: false, }; let _fields = {}; let _defaultValues = index_esm_isObject(_options.defaultValues) || index_esm_isObject(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {}; let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues); let _state = { action: false, mount: false, watch: false, }; let _names = { mount: new Set(), unMount: new Set(), array: new Set(), watch: new Set(), }; let delayErrorCallback; let timer = 0; const _proxyFormState = { isDirty: false, dirtyFields: false, touchedFields: false, isValidating: false, isValid: false, errors: false, }; const _subjects = { values: createSubject(), array: createSubject(), state: createSubject(), }; const shouldCaptureDirtyFields = props.resetOptions && props.resetOptions.keepDirtyValues; const validationModeBeforeSubmit = getValidationModes(_options.mode); const validationModeAfterSubmit = getValidationModes(_options.reValidateMode); const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all; const debounce = (callback) => (wait) => { clearTimeout(timer); timer = setTimeout(callback, wait); }; const _updateValid = async (shouldUpdateValid) => { if (_proxyFormState.isValid || shouldUpdateValid) { const isValid = _options.resolver ? index_esm_isEmptyObject((await _executeSchema()).errors) : await executeBuiltInValidation(_fields, true); if (isValid !== _formState.isValid) { _subjects.state.next({ isValid, }); } } }; const _updateIsValidating = (value) => _proxyFormState.isValidating && _subjects.state.next({ isValidating: value, }); const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => { if (args && method) { _state.action = true; if (shouldUpdateFieldsAndState && Array.isArray(index_esm_get(_fields, name))) { const fieldValues = method(index_esm_get(_fields, name), args.argA, args.argB); shouldSetValues && set(_fields, name, fieldValues); } if (shouldUpdateFieldsAndState && Array.isArray(index_esm_get(_formState.errors, name))) { const errors = method(index_esm_get(_formState.errors, name), args.argA, args.argB); shouldSetValues && set(_formState.errors, name, errors); unsetEmptyArray(_formState.errors, name); } if (_proxyFormState.touchedFields && shouldUpdateFieldsAndState && Array.isArray(index_esm_get(_formState.touchedFields, name))) { const touchedFields = method(index_esm_get(_formState.touchedFields, name), args.argA, args.argB); shouldSetValues && set(_formState.touchedFields, name, touchedFields); } if (_proxyFormState.dirtyFields) { _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues); } _subjects.state.next({ name, isDirty: _getDirty(name, values), dirtyFields: _formState.dirtyFields, errors: _formState.errors, isValid: _formState.isValid, }); } else { set(_formValues, name, values); } }; const updateErrors = (name, error) => { set(_formState.errors, name, error); _subjects.state.next({ errors: _formState.errors, }); }; const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => { const field = index_esm_get(_fields, name); if (field) { const defaultValue = index_esm_get(_formValues, name, index_esm_isUndefined(value) ? index_esm_get(_defaultValues, name) : value); index_esm_isUndefined(defaultValue) || (ref && ref.defaultChecked) || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue); _state.mount && _updateValid(); } }; const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => { let shouldUpdateField = false; let isPreviousDirty = false; const output = { name, }; if (!isBlurEvent || shouldDirty) { if (_proxyFormState.isDirty) { isPreviousDirty = _formState.isDirty; _formState.isDirty = output.isDirty = _getDirty(); shouldUpdateField = isPreviousDirty !== output.isDirty; } const isCurrentFieldPristine = deepEqual(index_esm_get(_defaultValues, name), fieldValue); isPreviousDirty = index_esm_get(_formState.dirtyFields, name); isCurrentFieldPristine ? unset(_formState.dirtyFields, name) : set(_formState.dirtyFields, name, true); output.dirtyFields = _formState.dirtyFields; shouldUpdateField = shouldUpdateField || (_proxyFormState.dirtyFields && isPreviousDirty !== !isCurrentFieldPristine); } if (isBlurEvent) { const isPreviousFieldTouched = index_esm_get(_formState.touchedFields, name); if (!isPreviousFieldTouched) { set(_formState.touchedFields, name, isBlurEvent); output.touchedFields = _formState.touchedFields; shouldUpdateField = shouldUpdateField || (_proxyFormState.touchedFields && isPreviousFieldTouched !== isBlurEvent); } } shouldUpdateField && shouldRender && _subjects.state.next(output); return shouldUpdateField ? output : {}; }; const shouldRenderByError = (name, isValid, error, fieldState) => { const previousFieldError = index_esm_get(_formState.errors, name); const shouldUpdateValid = _proxyFormState.isValid && isBoolean(isValid) && _formState.isValid !== isValid; if (props.delayError && error) { delayErrorCallback = debounce(() => updateErrors(name, error)); delayErrorCallback(props.delayError); } else { clearTimeout(timer); delayErrorCallback = null; error ? set(_formState.errors, name, error) : unset(_formState.errors, name); } if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) || !index_esm_isEmptyObject(fieldState) || shouldUpdateValid) { const updatedFormState = { ...fieldState, ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}), errors: _formState.errors, name, }; _formState = { ..._formState, ...updatedFormState, }; _subjects.state.next(updatedFormState); } _updateIsValidating(false); }; const _executeSchema = async (name) => _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation)); const executeSchemaAndUpdateState = async (names) => { const { errors } = await _executeSchema(names); if (names) { for (const name of names) { const error = index_esm_get(errors, name); error ? set(_formState.errors, name, error) : unset(_formState.errors, name); } } else { _formState.errors = errors; } return errors; }; const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = { valid: true, }) => { for (const name in fields) { const field = fields[name]; if (field) { const { _f, ...fieldValue } = field; if (_f) { const isFieldArrayRoot = _names.array.has(_f.name); const fieldError = await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot); if (fieldError[_f.name]) { context.valid = false; if (shouldOnlyCheckValid) { break; } } !shouldOnlyCheckValid && (index_esm_get(fieldError, _f.name) ? isFieldArrayRoot ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name) : set(_formState.errors, _f.name, fieldError[_f.name]) : unset(_formState.errors, _f.name)); } fieldValue && (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context)); } } return context.valid; }; const _removeUnmounted = () => { for (const name of _names.unMount) { const field = index_esm_get(_fields, name); field && (field._f.refs ? field._f.refs.every((ref) => !live(ref)) : !live(field._f.ref)) && unregister(name); } _names.unMount = new Set(); }; const _getDirty = (name, data) => (name && data && set(_formValues, name, data), !deepEqual(getValues(), _defaultValues)); const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, { ...(_state.mount ? _formValues : index_esm_isUndefined(defaultValue) ? _defaultValues : index_esm_isString(names) ? { [names]: defaultValue } : defaultValue), }, isGlobal, defaultValue); const _getFieldArray = (name) => index_esm_compact(index_esm_get(_state.mount ? _formValues : _defaultValues, name, props.shouldUnregister ? index_esm_get(_defaultValues, name, []) : [])); const setFieldValue = (name, value, options = {}) => { const field = index_esm_get(_fields, name); let fieldValue = value; if (field) { const fieldReference = field._f; if (fieldReference) { !fieldReference.disabled && set(_formValues, name, getFieldValueAs(value, fieldReference)); fieldValue = index_esm_isHTMLElement(fieldReference.ref) && isNullOrUndefined(value) ? '' : value; if (isMultipleSelect(fieldReference.ref)) { [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value))); } else if (fieldReference.refs) { if (isCheckBoxInput(fieldReference.ref)) { fieldReference.refs.length > 1 ? fieldReference.refs.forEach((checkboxRef) => (!checkboxRef.defaultChecked || !checkboxRef.disabled) && (checkboxRef.checked = Array.isArray(fieldValue) ? !!fieldValue.find((data) => data === checkboxRef.value) : fieldValue === checkboxRef.value)) : fieldReference.refs[0] && (fieldReference.refs[0].checked = !!fieldValue); } else { fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue)); } } else if (isFileInput(fieldReference.ref)) { fieldReference.ref.value = ''; } else { fieldReference.ref.value = fieldValue; if (!fieldReference.ref.type) { _subjects.values.next({ name, values: { ..._formValues }, }); } } } } (options.shouldDirty || options.shouldTouch) && updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true); options.shouldValidate && trigger(name); }; const setValues = (name, value, options) => { for (const fieldKey in value) { const fieldValue = value[fieldKey]; const fieldName = `${name}.${fieldKey}`; const field = index_esm_get(_fields, fieldName); (_names.array.has(name) || !isPrimitive(fieldValue) || (field && !field._f)) && !isDateObject(fieldValue) ? setValues(fieldName, fieldValue, options) : setFieldValue(fieldName, fieldValue, options); } }; const setValue = (name, value, options = {}) => { const field = index_esm_get(_fields, name); const isFieldArray = _names.array.has(name); const cloneValue = cloneObject(value); set(_formValues, name, cloneValue); if (isFieldArray) { _subjects.array.next({ name, values: { ..._formValues }, }); if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields) && options.shouldDirty) { _subjects.state.next({ name, dirtyFields: getDirtyFields(_defaultValues, _formValues), isDirty: _getDirty(name, cloneValue), }); } } else { field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name, cloneValue, options) : setFieldValue(name, cloneValue, options); } isWatched(name, _names) && _subjects.state.next({ ..._formState }); _subjects.values.next({ name, values: { ..._formValues }, }); !_state.mount && flushRootRender(); }; const onChange = async (event) => { const target = event.target; let name = target.name; let isFieldValueUpdated = true; const field = index_esm_get(_fields, name); const getCurrentFieldValue = () => target.type ? getFieldValue(field._f) : getEventValue(event); const _updateIsFieldValueUpdated = (fieldValue) => { isFieldValueUpdated = Number.isNaN(fieldValue) || fieldValue === index_esm_get(_formValues, name, fieldValue); }; if (field) { let error; let isValid; const fieldValue = getCurrentFieldValue(); const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT; const shouldSkipValidation = (!hasValidation(field._f) && !_options.resolver && !index_esm_get(_formState.errors, name) && !field._f.deps) || skipValidation(isBlurEvent, index_esm_get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit); const watched = isWatched(name, _names, isBlurEvent); set(_formValues, name, fieldValue); if (isBlurEvent) { field._f.onBlur && field._f.onBlur(event); delayErrorCallback && delayErrorCallback(0); } else if (field._f.onChange) { field._f.onChange(event); } const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent, false); const shouldRender = !index_esm_isEmptyObject(fieldState) || watched; !isBlurEvent && _subjects.values.next({ name, type: event.type, values: { ..._formValues }, }); if (shouldSkipValidation) { _proxyFormState.isValid && _updateValid(); return (shouldRender && _subjects.state.next({ name, ...(watched ? {} : fieldState) })); } !isBlurEvent && watched && _subjects.state.next({ ..._formState }); _updateIsValidating(true); if (_options.resolver) { const { errors } = await _executeSchema([name]); _updateIsFieldValueUpdated(fieldValue); if (isFieldValueUpdated) { const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name); const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name); error = errorLookupResult.error; name = errorLookupResult.name; isValid = index_esm_isEmptyObject(errors); } } else { error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name]; _updateIsFieldValueUpdated(fieldValue); if (isFieldValueUpdated) { if (error) { isValid = false; } else if (_proxyFormState.isValid) { isValid = await executeBuiltInValidation(_fields, true); } } } if (isFieldValueUpdated) { field._f.deps && trigger(field._f.deps); shouldRenderByError(name, isValid, error, fieldState); } } }; const _focusInput = (ref, key) => { if (index_esm_get(_formState.errors, key) && ref.focus) { ref.focus(); return 1; } return; }; const trigger = async (name, options = {}) => { let isValid; let validationResult; const fieldNames = convertToArrayPayload(name); _updateIsValidating(true); if (_options.resolver) { const errors = await executeSchemaAndUpdateState(index_esm_isUndefined(name) ? name : fieldNames); isValid = index_esm_isEmptyObject(errors); validationResult = name ? !fieldNames.some((name) => index_esm_get(errors, name)) : isValid; } else if (name) { validationResult = (await Promise.all(fieldNames.map(async (fieldName) => { const field = index_esm_get(_fields, fieldName); return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field); }))).every(Boolean); !(!validationResult && !_formState.isValid) && _updateValid(); } else { validationResult = isValid = await executeBuiltInValidation(_fields); } _subjects.state.next({ ...(!index_esm_isString(name) || (_proxyFormState.isValid && isValid !== _formState.isValid) ? {} : { name }), ...(_options.resolver || !name ? { isValid } : {}), errors: _formState.errors, isValidating: false, }); options.shouldFocus && !validationResult && iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount); return validationResult; }; const getValues = (fieldNames) => { const values = { ..._defaultValues, ...(_state.mount ? _formValues : {}), }; return index_esm_isUndefined(fieldNames) ? values : index_esm_isString(fieldNames) ? index_esm_get(values, fieldNames) : fieldNames.map((name) => index_esm_get(values, name)); }; const getFieldState = (name, formState) => ({ invalid: !!index_esm_get((formState || _formState).errors, name), isDirty: !!index_esm_get((formState || _formState).dirtyFields, name), isTouched: !!index_esm_get((formState || _formState).touchedFields, name), error: index_esm_get((formState || _formState).errors, name), }); const clearErrors = (name) => { name && convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName)); _subjects.state.next({ errors: name ? _formState.errors : {}, }); }; const setError = (name, error, options) => { const ref = (index_esm_get(_fields, name, { _f: {} })._f || {}).ref; set(_formState.errors, name, { ...error, ref, }); _subjects.state.next({ name, errors: _formState.errors, isValid: false, }); options && options.shouldFocus && ref && ref.focus && ref.focus(); }; const watch = (name, defaultValue) => index_esm_isFunction(name) ? _subjects.values.subscribe({ next: (payload) => name(_getWatch(undefined, defaultValue), payload), }) : _getWatch(name, defaultValue, true); const unregister = (name, options = {}) => { for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) { _names.mount.delete(fieldName); _names.array.delete(fieldName); if (!options.keepValue) { unset(_fields, fieldName); unset(_formValues, fieldName); } !options.keepError && unset(_formState.errors, fieldName); !options.keepDirty && unset(_formState.dirtyFields, fieldName); !options.keepTouched && unset(_formState.touchedFields, fieldName); !_options.shouldUnregister && !options.keepDefaultValue && unset(_defaultValues, fieldName); } _subjects.values.next({ values: { ..._formValues }, }); _subjects.state.next({ ..._formState, ...(!options.keepDirty ? {} : { isDirty: _getDirty() }), }); !options.keepIsValid && _updateValid(); }; const _updateDisabledField = ({ disabled, name, field, fields, value, }) => { if (isBoolean(disabled)) { const inputValue = disabled ? undefined : index_esm_isUndefined(value) ? getFieldValue(field ? field._f : index_esm_get(fields, name)._f) : value; set(_formValues, name, inputValue); updateTouchAndDirty(name, inputValue, false, false, true); } }; const register = (name, options = {}) => { let field = index_esm_get(_fields, name); const disabledIsDefined = isBoolean(options.disabled); set(_fields, name, { ...(field || {}), _f: { ...(field && field._f ? field._f : { ref: { name } }), name, mount: true, ...options, }, }); _names.mount.add(name); if (field) { _updateDisabledField({ field, disabled: options.disabled, name, }); } else { updateValidAndValue(name, true, options.value); } return { ...(disabledIsDefined ? { disabled: options.disabled } : {}), ...(_options.progressive ? { required: !!options.required, min: getRuleValue(options.min), max: getRuleValue(options.max), minLength: getRuleValue(options.minLength), maxLength: getRuleValue(options.maxLength), pattern: getRuleValue(options.pattern), } : {}), name, onChange, onBlur: onChange, ref: (ref) => { if (ref) { register(name, options); field = index_esm_get(_fields, name); const fieldRef = index_esm_isUndefined(ref.value) ? ref.querySelectorAll ? ref.querySelectorAll('input,select,textarea')[0] || ref : ref : ref; const radioOrCheckbox = isRadioOrCheckbox(fieldRef); const refs = field._f.refs || []; if (radioOrCheckbox ? refs.find((option) => option === fieldRef) : fieldRef === field._f.ref) { return; } set(_fields, name, { _f: { ...field._f, ...(radioOrCheckbox ? { refs: [ ...refs.filter(live), fieldRef, ...(Array.isArray(index_esm_get(_defaultValues, name)) ? [{}] : []), ], ref: { type: fieldRef.type, name }, } : { ref: fieldRef }), }, }); updateValidAndValue(name, false, undefined, fieldRef); } else { field = index_esm_get(_fields, name, {}); if (field._f) { field._f.mount = false; } (_options.shouldUnregister || options.shouldUnregister) && !(isNameInFieldArray(_names.array, name) && _state.action) && _names.unMount.add(name); } }, }; }; const _focusError = () => _options.shouldFocusError && iterateFieldsByAction(_fields, _focusInput, _names.mount); const _disableForm = (disabled) => { if (isBoolean(disabled)) { _subjects.state.next({ disabled }); iterateFieldsByAction(_fields, (ref) => { ref.disabled = disabled; }, 0, false); } }; const handleSubmit = (onValid, onInvalid) => async (e) => { if (e) { e.preventDefault && e.preventDefault(); e.persist && e.persist(); } let fieldValues = cloneObject(_formValues); _subjects.state.next({ isSubmitting: true, }); if (_options.resolver) { const { errors, values } = await _executeSchema(); _formState.errors = errors; fieldValues = values; } else { await executeBuiltInValidation(_fields); } unset(_formState.errors, 'root'); if (index_esm_isEmptyObject(_formState.errors)) { _subjects.state.next({ errors: {}, }); await onValid(fieldValues, e); } else { if (onInvalid) { await onInvalid({ ..._formState.errors }, e); } _focusError(); setTimeout(_focusError); } _subjects.state.next({ isSubmitted: true, isSubmitting: false, isSubmitSuccessful: index_esm_isEmptyObject(_formState.errors), submitCount: _formState.submitCount + 1, errors: _formState.errors, }); }; const resetField = (name, options = {}) => { if (index_esm_get(_fields, name)) { if (index_esm_isUndefined(options.defaultValue)) { setValue(name, index_esm_get(_defaultValues, name)); } else { setValue(name, options.defaultValue); set(_defaultValues, name, options.defaultValue); } if (!options.keepTouched) { unset(_formState.touchedFields, name); } if (!options.keepDirty) { unset(_formState.dirtyFields, name); _formState.isDirty = options.defaultValue ? _getDirty(name, index_esm_get(_defaultValues, name)) : _getDirty(); } if (!options.keepError) { unset(_formState.errors, name); _proxyFormState.isValid && _updateValid(); } _subjects.state.next({ ..._formState }); } }; const _reset = (formValues, keepStateOptions = {}) => { const updatedValues = formValues ? cloneObject(formValues) : _defaultValues; const cloneUpdatedValues = cloneObject(updatedValues); const values = formValues && !index_esm_isEmptyObject(formValues) ? cloneUpdatedValues : _defaultValues; if (!keepStateOptions.keepDefaultValues) { _defaultValues = updatedValues; } if (!keepStateOptions.keepValues) { if (keepStateOptions.keepDirtyValues || shouldCaptureDirtyFields) { for (const fieldName of _names.mount) { index_esm_get(_formState.dirtyFields, fieldName) ? set(values, fieldName, index_esm_get(_formValues, fieldName)) : setValue(fieldName, index_esm_get(values, fieldName)); } } else { if (isWeb && index_esm_isUndefined(formValues)) { for (const name of _names.mount) { const field = index_esm_get(_fields, name); if (field && field._f) { const fieldReference = Array.isArray(field._f.refs) ? field._f.refs[0] : field._f.ref; if (index_esm_isHTMLElement(fieldReference)) { const form = fieldReference.closest('form'); if (form) { form.reset(); break; } } } } } _fields = {}; } _formValues = props.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values); _subjects.array.next({ values: { ...values }, }); _subjects.values.next({ values: { ...values }, }); } _names = { mount: new Set(), unMount: new Set(), array: new Set(), watch: new Set(), watchAll: false, focus: '', }; !_state.mount && flushRootRender(); _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid; _state.watch = !!props.shouldUnregister; _subjects.state.next({ submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0, isDirty: keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)), isSubmitted: keepStateOptions.keepIsSubmitted ? _formState.isSubmitted : false, dirtyFields: keepStateOptions.keepDirtyValues ? _formState.dirtyFields : keepStateOptions.keepDefaultValues && formValues ? getDirtyFields(_defaultValues, formValues) : {}, touchedFields: keepStateOptions.keepTouched ? _formState.touchedFields : {}, errors: keepStateOptions.keepErrors ? _formState.errors : {}, isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful ? _formState.isSubmitSuccessful : false, isSubmitting: false, }); }; const reset = (formValues, keepStateOptions) => _reset(index_esm_isFunction(formValues) ? formValues(_formValues) : formValues, keepStateOptions); const setFocus = (name, options = {}) => { const field = index_esm_get(_fields, name); const fieldReference = field && field._f; if (fieldReference) { const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref; if (fieldRef.focus) { fieldRef.focus(); options.shouldSelect && fieldRef.select(); } } }; const _updateFormState = (updatedFormState) => { _formState = { ..._formState, ...updatedFormState, }; }; const _resetDefaultValues = () => index_esm_isFunction(_options.defaultValues) && _options.defaultValues().then((values) => { reset(values, _options.resetOptions); _subjects.state.next({ isLoading: false, }); }); return { control: { register, unregister, getFieldState, handleSubmit, setError, _executeSchema, _getWatch, _getDirty, _updateValid, _removeUnmounted, _updateFieldArray, _updateDisabledField, _getFieldArray, _reset, _resetDefaultValues, _updateFormState, _disableForm, _subjects, _proxyFormState, get _fields() { return _fields; }, get _formValues() { return _formValues; }, get _state() { return _state; }, set _state(value) { _state = value; }, get _defaultValues() { return _defaultValues; }, get _names() { return _names; }, set _names(value) { _names = value; }, get _formState() { return _formState; }, set _formState(value) { _formState = value; }, get _options() { return _options; }, set _options(value) { _options = { ..._options, ...value, }; }, }, trigger, register, handleSubmit, watch, setValue, getValues, reset, resetField, clearErrors, unregister, setError, setFocus, getFieldState, }; } /** * Custom hook to manage the entire form. * * @remarks * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4) * * @param props - form configuration and validation parameters. * * @returns methods - individual functions to manage the form state. {@link UseFormReturn} * * @example * ```tsx * function App() { * const { register, handleSubmit, watch, formState: { errors } } = useForm(); * const onSubmit = data => console.log(data); * * console.log(watch("example")); * * return ( * <form onSubmit={handleSubmit(onSubmit)}> * <input defaultValue="test" {...register("example")} /> * <input {...register("exampleRequired", { required: true })} /> * {errors.exampleRequired && <span>This field is required</span>} * <button>Submit</button> * </form> * ); * } * ``` */ function useForm(props = {}) { const _formControl = external_React_.useRef(); const _values = external_React_.useRef(); const [formState, updateFormState] = external_React_.useState({ isDirty: false, isValidating: false, isLoading: index_esm_isFunction(props.defaultValues), isSubmitted: false, isSubmitting: false, isSubmitSuccessful: false, isValid: false, submitCount: 0, dirtyFields: {}, touchedFields: {}, errors: {}, disabled: false, defaultValues: index_esm_isFunction(props.defaultValues) ? undefined : props.defaultValues, }); if (!_formControl.current) { _formControl.current = { ...createFormControl(props, () => updateFormState((formState) => ({ ...formState }))), formState, }; } const control = _formControl.current.control; control._options = props; useSubscribe({ subject: control._subjects.state, next: (value) => { if (shouldRenderFormState(value, control._proxyFormState, control._updateFormState, true)) { updateFormState({ ...control._formState }); } }, }); external_React_.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]); external_React_.useEffect(() => { if (control._proxyFormState.isDirty) { const isDirty = control._getDirty(); if (isDirty !== formState.isDirty) { control._subjects.state.next({ isDirty, }); } } }, [control, formState.isDirty]); external_React_.useEffect(() => { if (props.values && !deepEqual(props.values, _values.current)) { control._reset(props.values, control._options.resetOptions); _values.current = props.values; } else { control._resetDefaultValues(); } }, [props.values, control]); external_React_.useEffect(() => { if (!control._state.mount) { control._updateValid(); control._state.mount = true; } if (control._state.watch) { control._state.watch = false; control._subjects.state.next({ ...control._formState }); } control._removeUnmounted(); }); _formControl.current.formState = getProxyFormState(formState, control); return _formControl.current; } //# sourceMappingURL=index.esm.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/hooks/useDebounce.ts var useDebounce = function useDebounce(value, delay) { var _useState = (0,external_React_.useState)(value), _useState2 = _slicedToArray(_useState, 2), debouncedValue = _useState2[0], setDebouncedValue = _useState2[1]; (0,external_React_.useEffect)(function () { var timer = setTimeout(function () { return setDebouncedValue(value); }, delay || 500); return function () { clearTimeout(timer); }; }, [value, delay]); return debouncedValue; }; /* harmony default export */ const hooks_useDebounce = (useDebounce); ;// CONCATENATED MODULE: ./src/dashboard/hooks/create-storage.ts var useWindowEvent = function useWindowEvent(type, handler, options) { (0,external_React_.useEffect)(function () { // @ts-ignore window.addEventListener(type, handler, options); // @ts-ignore return function () { return window.removeEventListener(type, handler, options); }; }, [type, handler, options]); }; var serializeJSON = function serializeJSON(value, hookName) { try { return JSON.stringify(value); } catch (error) { throw new Error("Filed to serialize ".concat(hookName, " value")); } }; var deserializeJSON = function deserializeJSON(value) { try { return JSON.parse(value); } catch (error) { throw new Error("Filed to deserialize value"); } }; var create_storage_createStorage = function createStorage(type, hookName) { var eventName = "localStorage" === type ? "magazine-blocks-local-storage" : "magazine-blocks-session-storage"; var useStorage = function useStorage(_ref) { var key = _ref.key, _ref$defaultValue = _ref.defaultValue, defaultValue = _ref$defaultValue === void 0 ? undefined : _ref$defaultValue, _ref$getInitialValueI = _ref.getInitialValueInEffect, getInitialValueInEffect = _ref$getInitialValueI === void 0 ? false : _ref$getInitialValueI, _ref$serialize = _ref.serialize, serialize = _ref$serialize === void 0 ? function (value) { return serializeJSON(value, hookName); } : _ref$serialize, _ref$deserialize = _ref.deserialize, deserialize = _ref$deserialize === void 0 ? deserializeJSON : _ref$deserialize; var read = (0,external_React_.useCallback)(function (skip) { if ("undefined" === typeof window || !(type in window) || window[type] === null || skip) { return defaultValue; } var value = window[type].getItem(key); return null !== value ? deserialize(value) : defaultValue; }, [key, defaultValue, deserialize]); var _useState = (0,external_React_.useState)(read(getInitialValueInEffect)), _useState2 = _slicedToArray(_useState, 2), value = _useState2[0], setValue = _useState2[1]; var setStorageValue = (0,external_React_.useCallback)(function (val) { if (val instanceof Function) { setValue(function (current) { var result = val(current); window[type].setItem(key, serialize(result)); window.dispatchEvent(new CustomEvent(eventName, { detail: { key: key, value: val(current) } })); return result; }); } }, [key, serialize]); var removeStorageValue = (0,external_React_.useCallback)(function () { window[type].removeItem(key); window.dispatchEvent(new CustomEvent(eventName, { detail: { key: key, value: defaultValue } })); }, [defaultValue, key]); useWindowEvent("storage", function (event) { if (event.storageArea === window[type] && event.key === key) { setValue(deserialize(event.newValue)); } }); useWindowEvent(eventName, function (event) { if (event.detail.key === key) { setValue(event.detail.value); } }); (0,external_React_.useEffect)(function () { if (defaultValue !== undefined && value === undefined) { setStorageValue(defaultValue); } }, [defaultValue, value, setStorageValue]); (0,external_React_.useEffect)(function () { if (getInitialValueInEffect) { setValue(read()); } }, [getInitialValueInEffect, read]); return [value === undefined ? defaultValue : value, setStorageValue, removeStorageValue]; }; return useStorage; }; ;// CONCATENATED MODULE: ./src/dashboard/hooks/useLocalStorage.ts var useLocalStorage = function useLocalStorage(props) { return create_storage_createStorage('localStorage', 'use-local-storage')(props); }; /* harmony default export */ const hooks_useLocalStorage = (useLocalStorage); ;// CONCATENATED MODULE: ./src/dashboard/hooks/useSessionStorage.ts var useSessionStorage = function useSessionStorage(props) { return createStorage('sessionStorage', 'use-session-storage')(props); }; /* harmony default export */ const hooks_useSessionStorage = ((/* unused pure expression or super */ null && (useSessionStorage))); ;// CONCATENATED MODULE: ./src/dashboard/hooks/index.ts ;// CONCATENATED MODULE: ./src/dashboard/skeleton/BlocksSkeleton.tsx var BlocksSkeleton = function BlocksSkeleton() { return /*#__PURE__*/external_React_default().createElement(Stack, { px: "24px", mt: "32px" }, /*#__PURE__*/external_React_default().createElement(HStack, { justify: "space-between", align: "center" }, /*#__PURE__*/external_React_default().createElement(HStack, null, /*#__PURE__*/external_React_default().createElement(Skeleton, { w: "120px", h: "40px" }), /*#__PURE__*/external_React_default().createElement(Skeleton, { w: "216px", h: "40px" })), /*#__PURE__*/external_React_default().createElement(Skeleton, { w: "232px", h: "40px" })), /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "repeat(auto-fill, minmax(290px, 1fr))", gridGap: "16px", mt: "23px" }, Array.from({ length: 20 }).map(function (_, i) { return /*#__PURE__*/external_React_default().createElement(HStack, { key: i, p: "12px", borderRadius: "4px", border: "1px solid", borderColor: "gray.100", align: "center", justify: "space-between", bgColor: "white" }, /*#__PURE__*/external_React_default().createElement(HStack, null, /*#__PURE__*/external_React_default().createElement(Skeleton, { h: "28px", w: "28px", m: "14px" }), /*#__PURE__*/external_React_default().createElement(SkeletonText, { noOfLines: 2, width: "80px" })), /*#__PURE__*/external_React_default().createElement(Skeleton, { w: "34px", h: "20px", borderRadius: "20px", mr: "19px" })); }))); }; /* harmony default export */ const skeleton_BlocksSkeleton = (BlocksSkeleton); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/select/dist/chunk-C6OUXMED.mjs 'use client' // src/select-field.tsx ; var SelectField = forwardRef( function SelectField2(props, ref) { const { children, placeholder, className, ...rest } = props; return /* @__PURE__ */ (0,jsx_runtime.jsxs)( chakra.select, { ...rest, ref, className: cx("chakra-select", className), children: [ placeholder && /* @__PURE__ */ (0,jsx_runtime.jsx)("option", { value: "", children: placeholder }), children ] } ); } ); SelectField.displayName = "SelectField"; //# sourceMappingURL=chunk-C6OUXMED.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/select/dist/chunk-3RSXBRAN.mjs 'use client' ; // src/select.tsx // ../../utilities/object-utils/src/split.ts function chunk_3RSXBRAN_split(object, keys) { const picked = {}; const omitted = {}; for (const [key, value] of Object.entries(object)) { if (keys.includes(key)) picked[key] = value; else omitted[key] = value; } return [picked, omitted]; } // src/select.tsx var Select = forwardRef((props, ref) => { var _a; const styles = useMultiStyleConfig("Select", props); const { rootProps, placeholder, icon, color, height, h, minH, minHeight, iconColor, iconSize, ...rest } = omitThemingProps(props); const [layoutProps, otherProps] = chunk_3RSXBRAN_split(rest, layoutPropNames); const ownProps = useFormControl(otherProps); const rootStyles = { width: "100%", height: "fit-content", position: "relative", color }; const fieldStyles = { paddingEnd: "2rem", ...styles.field, _focus: { zIndex: "unset", ...(_a = styles.field) == null ? void 0 : _a["_focus"] } }; return /* @__PURE__ */ (0,jsx_runtime.jsxs)( chakra.div, { className: "chakra-select__wrapper", __css: rootStyles, ...layoutProps, ...rootProps, children: [ /* @__PURE__ */ (0,jsx_runtime.jsx)( SelectField, { ref, height: h != null ? h : height, minH: minH != null ? minH : minHeight, placeholder, ...ownProps, __css: fieldStyles, children: props.children } ), /* @__PURE__ */ (0,jsx_runtime.jsx)( SelectIcon, { "data-disabled": dataAttr(ownProps.disabled), ...(iconColor || color) && { color: iconColor || color }, __css: styles.icon, ...iconSize && { fontSize: iconSize }, children: icon } ) ] } ); }); Select.displayName = "Select"; var DefaultIcon = (props) => /* @__PURE__ */ (0,jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( "path", { fill: "currentColor", d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" } ) }); var IconWrapper = chakra("div", { baseStyle: { position: "absolute", display: "inline-flex", alignItems: "center", justifyContent: "center", pointerEvents: "none", top: "50%", transform: "translateY(-50%)" } }); var SelectIcon = (props) => { const { children = /* @__PURE__ */ (0,jsx_runtime.jsx)(DefaultIcon, {}), ...rest } = props; const clone = (0,external_React_.cloneElement)(children, { role: "presentation", className: "chakra-select__icon", focusable: false, "aria-hidden": true, // force icon to adhere to `IconWrapper` styles style: { width: "1em", height: "1em", color: "currentColor" } }); return /* @__PURE__ */ (0,jsx_runtime.jsx)(IconWrapper, { ...rest, className: "chakra-select__icon-wrapper", children: (0,external_React_.isValidElement)(children) ? clone : null }); }; SelectIcon.displayName = "SelectIcon"; //# sourceMappingURL=chunk-3RSXBRAN.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/button/dist/chunk-DA7QIPTJ.mjs 'use client' ; // src/button-group.tsx 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: (spacing) => ({ "& > *:not(style) ~ *:not(style)": { marginStart: spacing } }), vertical: (spacing) => ({ "& > *:not(style) ~ *:not(style)": { marginTop: spacing } }) }; var ButtonGroup = forwardRef( function ButtonGroup2(props, ref) { const { size, colorScheme, variant, className, spacing = "0.5rem", isAttached, isDisabled, orientation = "horizontal", ...rest } = props; const _className = cx("chakra-button__group", className); const context = (0,external_React_.useMemo)( () => ({ size, colorScheme, variant, isDisabled }), [size, colorScheme, variant, isDisabled] ); let groupStyles = { display: "inline-flex", ...isAttached ? attachedStyles[orientation] : gapStyles[orientation](spacing) }; const isVertical = orientation === "vertical"; return /* @__PURE__ */ (0,jsx_runtime.jsx)(ButtonGroupProvider, { value: context, children: /* @__PURE__ */ (0,jsx_runtime.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"; //# sourceMappingURL=chunk-DA7QIPTJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/input/dist/chunk-FKYN3ZGE.mjs 'use client' // src/input-group.tsx ; var [InputGroupStylesProvider, useInputGroupStyles] = createContext({ name: `InputGroupStylesContext`, errorMessage: `useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" ` }); var InputGroup = forwardRef( function InputGroup2(props, ref) { const styles = useMultiStyleConfig("Input", props); const { children, className, ...rest } = omitThemingProps(props); const _className = cx("chakra-input__group", className); const groupStyles = {}; const validChildren = dist_getValidChildren(children); const input = styles.field; validChildren.forEach((child) => { var _a, _b; if (!styles) return; if (input && child.type.id === "InputLeftElement") { groupStyles.paddingStart = (_a = input.height) != null ? _a : input.h; } if (input && child.type.id === "InputRightElement") { groupStyles.paddingEnd = (_b = input.height) != null ? _b : input.h; } if (child.type.id === "InputRightAddon") { groupStyles.borderEndRadius = 0; } if (child.type.id === "InputLeftAddon") { groupStyles.borderStartRadius = 0; } }); const clones = validChildren.map((child) => { var _a, _b; const theming = compact({ size: ((_a = child.props) == null ? void 0 : _a.size) || props.size, variant: ((_b = child.props) == null ? void 0 : _b.variant) || props.variant }); return child.type.id !== "Input" ? (0,external_React_.cloneElement)(child, theming) : (0,external_React_.cloneElement)(child, Object.assign(theming, groupStyles, child.props)); }); return /* @__PURE__ */ (0,jsx_runtime.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", ...styles.group }, "data-group": true, ...rest, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(InputGroupStylesProvider, { value: styles, children: clones }) } ); } ); InputGroup.displayName = "InputGroup"; //# sourceMappingURL=chunk-FKYN3ZGE.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/input/dist/chunk-2ZHRCML3.mjs 'use client' ; // src/input-element.tsx var StyledInputElement = chakra("div", { baseStyle: { display: "flex", alignItems: "center", justifyContent: "center", position: "absolute", top: "0", zIndex: 2 } }); var InputElement = forwardRef(function InputElement2(props, ref) { var _a, _b; const { placement = "left", ...rest } = props; const styles = useInputGroupStyles(); const input = styles.field; const attr = placement === "left" ? "insetStart" : "insetEnd"; const elementStyles = { [attr]: "0", width: (_a = input == null ? void 0 : input.height) != null ? _a : input == null ? void 0 : input.h, height: (_b = input == null ? void 0 : input.height) != null ? _b : input == null ? void 0 : input.h, fontSize: input == null ? void 0 : input.fontSize, ...styles.element }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(StyledInputElement, { ref, __css: elementStyles, ...rest }); }); InputElement.id = "InputElement"; InputElement.displayName = "InputElement"; var InputLeftElement = forwardRef( function InputLeftElement2(props, ref) { const { className, ...rest } = props; const _className = cx("chakra-input__left-element", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( InputElement, { ref, placement: "left", className: _className, ...rest } ); } ); InputLeftElement.id = "InputLeftElement"; InputLeftElement.displayName = "InputLeftElement"; var InputRightElement = forwardRef( function InputRightElement2(props, ref) { const { className, ...rest } = props; const _className = cx("chakra-input__right-element", className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( InputElement, { ref, placement: "right", className: _className, ...rest } ); } ); InputRightElement.id = "InputRightElement"; InputRightElement.displayName = "InputRightElement"; //# sourceMappingURL=chunk-2ZHRCML3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/input/dist/chunk-6CVSDS6C.mjs 'use client' // src/input.tsx ; var Input = forwardRef(function Input2(props, ref) { const { htmlSize, ...rest } = props; const styles = useMultiStyleConfig("Input", rest); const ownProps = omitThemingProps(rest); const input = useFormControl(ownProps); const _className = cx("chakra-input", props.className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.input, { size: htmlSize, ...input, __css: styles.field, ref, className: _className } ); }); Input.displayName = "Input"; Input.id = "Input"; //# sourceMappingURL=chunk-6CVSDS6C.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/screens/blocks/components/Filters.tsx var Filters = function Filters(props) { var sort = props.sort, search = props.search, onActivateAll = props.onActivateAll, onDeactivateAll = props.onDeactivateAll, isAllActive = props.isAllActive, isAllInactive = props.isAllInactive, onSort = props.onSort, onSearch = props.onSearch, loading = props.loading; return /*#__PURE__*/external_React_default().createElement(Stack, { align: { base: "center", xs: "flex-start" }, justify: "space-between", direction: { base: "column", md: "row" } }, /*#__PURE__*/external_React_default().createElement(HStack, { justify: ["space-between", "space-between", "normal"] }, /*#__PURE__*/external_React_default().createElement(Select, { placeholder: "Select option", w: "120px", bg: "unset !important", borderColor: "gray.200 !important", onChange: function onChange(e) { if (e.target.value) { onSort === null || onSort === void 0 || onSort(e.target.value); } }, defaultValue: sort }, /*#__PURE__*/external_React_default().createElement("option", { value: "newest" }, (0,external_wp_i18n_namespaceObject.__)("Newest", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement("option", { value: "alphabetical" }, (0,external_wp_i18n_namespaceObject.__)("Alphabetical", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(ButtonGroup, { borderRadius: "base", isDisabled: loading }, /*#__PURE__*/external_React_default().createElement(Button, { variant: "outline", borderTopRightRadius: "0", borderBottomRightRadius: "0", fontSize: "sm", fontWeight: "normal", py: "6px", px: "4", onClick: onActivateAll, isDisabled: isAllActive, _hover: { bgColor: "transparent", color: "primary.500" }, _active: { bgColor: "transparent", color: "primary.500" } }, (0,external_wp_i18n_namespaceObject.__)("Activate all", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { ml: "0 !important", variant: "outline", borderTopLeftRadius: "0", borderBottomLeftRadius: "0", fontSize: "sm", fontWeight: "normal", py: "6px", px: "4", onClick: onDeactivateAll, isDisabled: isAllInactive, _hover: { bgColor: "transparent", color: "primary.500" }, _active: { bgColor: "transparent", color: "primary.500" } }, (0,external_wp_i18n_namespaceObject.__)("Deactivate all", "magazine-blocks")))), /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(InputGroup, null, /*#__PURE__*/external_React_default().createElement(InputLeftElement, null, /*#__PURE__*/external_React_default().createElement(Search, { h: "5", w: "5", fill: "gray.400" })), /*#__PURE__*/external_React_default().createElement(Input, { border: "1px", borderColor: "gray.200 !important", pl: "9 !important", type: "text", placeholder: "Search...", defaultValue: search, fontSize: "xs", onChange: function onChange(e) { return onSearch === null || onSearch === void 0 ? void 0 : onSearch(e.target.value); } })))); }; /* harmony default export */ const components_Filters = (Filters); ;// CONCATENATED MODULE: ./src/dashboard/screens/blocks/Blocks.tsx function Blocks_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function Blocks_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Blocks_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Blocks_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var Blocks = function Blocks() { var _settingsQuery$data$b, _settingsQuery$data, _settingsQuery$data$b2, _settingsQuery$data2; var methods = useForm(); var toast = useToast(); var queryClient = (0,react_query_es.useQueryClient)(); var settingsQuery = (0,react_query_es.useQuery)(["settings"], function () { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/settings" }); }); var _React$useState = external_React_default().useState(""), _React$useState2 = _slicedToArray(_React$useState, 2), search = _React$useState2[0], setSearch = _React$useState2[1]; var _React$useState3 = external_React_default().useState("newest"), _React$useState4 = _slicedToArray(_React$useState3, 2), sort = _React$useState4[0], setSort = _React$useState4[1]; var debouncedSearch = hooks_useDebounce(search, 400); var save = (0,react_query_es.useMutation)(function (data) { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/settings", method: "POST", data: data }); }, { onSuccess: function onSuccess() { queryClient.invalidateQueries(["settings"]); toast({ status: "success", isClosable: true, title: (0,external_wp_i18n_namespaceObject.__)("Blocks saved successfully", "magazine-blocks") }); }, onError: function onError(e) { toast({ status: "error", isClosable: true, description: e.message, title: (0,external_wp_i18n_namespaceObject.__)("Error saving blocks", "magazine-blocks") }); } }); var onSubmit = function onSubmit(data) { save.mutate(data); }; var activateDeactivate = function activateDeactivate() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "activate"; return function () { var data = Object.entries(BLOCKS).reduce(function (acc, _ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; acc[key] = "activate" === mode ? true : false; return acc; }, {}); methods.setValue("blocks", data); methods.handleSubmit(onSubmit)(); }; }; var blocks = Object.entries(BLOCKS).sort(function (_ref3, _ref4) { var _ref5 = _slicedToArray(_ref3, 2), a = _ref5[1].label; var _ref6 = _slicedToArray(_ref4, 2), b = _ref6[1].label; if (sort === "alphabetical") { if (a < b) { return -1; } if (a > b) { return 1; } } return 0; }).map(function (_ref7) { var _ref8 = _slicedToArray(_ref7, 2), key = _ref8[0], val = _ref8[1]; return Blocks_objectSpread(Blocks_objectSpread({}, val), {}, { key: key, hidden: debouncedSearch && !val.label.toLowerCase().includes(debouncedSearch) }); }); var allBlockHidden = blocks.every(function (b) { return b.hidden; }); if (settingsQuery.isLoading) return /*#__PURE__*/external_React_default().createElement(skeleton_BlocksSkeleton, null); return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(Stack, { px: "6", mt: "8" }, /*#__PURE__*/external_React_default().createElement(components_Filters, { onActivateAll: activateDeactivate("activate"), onDeactivateAll: activateDeactivate("deactivate"), isAllActive: Object.values((_settingsQuery$data$b = (_settingsQuery$data = settingsQuery.data) === null || _settingsQuery$data === void 0 ? void 0 : _settingsQuery$data.blocks) !== null && _settingsQuery$data$b !== void 0 ? _settingsQuery$data$b : {}).every(function (v) { return v; }), isAllInactive: Object.values((_settingsQuery$data$b2 = (_settingsQuery$data2 = settingsQuery.data) === null || _settingsQuery$data2 === void 0 ? void 0 : _settingsQuery$data2.blocks) !== null && _settingsQuery$data$b2 !== void 0 ? _settingsQuery$data$b2 : {}).every(function (v) { return !v; }), loading: save.isLoading, onSort: setSort, onSearch: setSearch, search: search, sort: sort }), /*#__PURE__*/external_React_default().createElement("form", { onSubmit: methods.handleSubmit(onSubmit) }, /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))", gridGap: "4", mt: "6" }, allBlockHidden && /*#__PURE__*/external_React_default().createElement(Alert, { status: "info", gridColumn: "1/-1" }, /*#__PURE__*/external_React_default().createElement(AlertDescription, null, (0,external_wp_i18n_namespaceObject.__)("Sorry, we couldn't find any blocks matching your search query. Please try a different search.", "magazine-blocks"))), blocks.map(function (_ref9) { var _settingsQuery$data3; var label = _ref9.label, BlockIcon = _ref9.icon, key = _ref9.key, hidden = _ref9.hidden; return /*#__PURE__*/external_React_default().createElement(Controller, { key: key, name: "blocks.".concat(key), control: methods.control, defaultValue: (_settingsQuery$data3 = settingsQuery.data) === null || _settingsQuery$data3 === void 0 || (_settingsQuery$data3 = _settingsQuery$data3.blocks) === null || _settingsQuery$data3 === void 0 ? void 0 : _settingsQuery$data3[key], render: function render(_ref10) { var _ref10$field = _ref10.field, _onChange = _ref10$field.onChange, value = _ref10$field.value; return /*#__PURE__*/external_React_default().createElement(FormControl, { display: hidden ? "none" : "flex", alignItems: "center", border: "1px", borderColor: "gray.100", p: "3", borderRadius: "base", justifyContent: "space-between", bgColor: "white" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "3" }, /*#__PURE__*/external_React_default().createElement(BlockIcon, { fill: "#690aa0", w: "7", h: "7", m: "14px" }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(FormLabel, { fontSize: "sm", fontWeight: "semibold", lineHeight: "150%", color: "gray.700", margin: "0" }, label))), /*#__PURE__*/external_React_default().createElement(Switch, { size: "sm", isChecked: value, m: "14px", colorScheme: "primary", onChange: function onChange(e) { _onChange(e.target.checked); methods.handleSubmit(onSubmit)(); } })); } }); }))))); }; /* harmony default export */ const blocks_Blocks = (Blocks); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/image/dist/chunk-X3PS6RUF.mjs 'use client' // src/native-image.tsx ; var NativeImage = forwardRef(function NativeImage2(props, ref) { const { htmlWidth, htmlHeight, alt, ...rest } = props; return /* @__PURE__ */ (0,jsx_runtime.jsx)("img", { width: htmlWidth, height: htmlHeight, ref, alt, ...rest }); }); NativeImage.displayName = "NativeImage"; //# sourceMappingURL=chunk-X3PS6RUF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/image/dist/chunk-SPIKMR6I.mjs 'use client' // src/use-image.ts ; function useImage(props) { const { loading, src, srcSet, onLoad, onError, crossOrigin, sizes, ignoreFallback } = props; const [status, setStatus] = (0,external_React_.useState)("pending"); (0,external_React_.useEffect)(() => { setStatus(src ? "loading" : "pending"); }, [src]); const imageRef = (0,external_React_.useRef)(); const load = (0,external_React_.useCallback)(() => { if (!src) return; flush(); const img = new Image(); img.src = src; if (crossOrigin) img.crossOrigin = crossOrigin; if (srcSet) img.srcset = srcSet; if (sizes) img.sizes = sizes; 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, sizes, onLoad, onError, loading]); const flush = () => { if (imageRef.current) { imageRef.current.onload = null; imageRef.current.onerror = null; imageRef.current = null; } }; dist_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"; //# sourceMappingURL=chunk-SPIKMR6I.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/image/dist/chunk-QINAG4RG.mjs 'use client' ; // src/image.tsx // ../../utilities/object-utils/src/omit.ts function chunk_QINAG4RG_omit(object, keysToOmit = []) { const clone = Object.assign({}, object); for (const key of keysToOmit) { if (key in clone) { delete clone[key]; } } return clone; } // src/image.tsx var chunk_QINAG4RG_Image = forwardRef(function Image2(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 : chunk_QINAG4RG_omit(rest, ["onError", "onLoad"]) }; if (showFallbackImage) { if (fallback) return fallback; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.img, { as: NativeImage, className: "chakra-image__placeholder", src: fallbackSrc, ...shared } ); } return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.img, { as: NativeImage, src, srcSet, crossOrigin, loading, referrerPolicy, className: "chakra-image", ...shared } ); }); chunk_QINAG4RG_Image.displayName = "Image"; //# sourceMappingURL=chunk-QINAG4RG.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/images/magazine-blocks-hero.jpg /* harmony default export */ const magazine_blocks_hero = (__webpack_require__.p + "50182020c1d8948d44cd67c70030cc11.jpg"); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-7254PCTD.mjs 'use client' ; // src/slide-fade.tsx var chunk_7254PCTD_variants = { initial: ({ offsetX, offsetY, transition, transitionEnd, delay }) => { var _a; return { opacity: 0, x: offsetX, y: offsetY, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(TRANSITION_DEFAULTS.exit, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit }; }, enter: ({ transition, transitionEnd, delay }) => { var _a; return { opacity: 1, x: 0, y: 0, transition: (_a = transition == null ? void 0 : transition.enter) != null ? _a : withDelay.enter(TRANSITION_DEFAULTS.enter, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter }; }, exit: ({ offsetY, offsetX, transition, transitionEnd, reverse, delay }) => { var _a; const offset = { x: offsetX, y: offsetY }; return { opacity: 0, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(TRANSITION_DEFAULTS.exit, delay), ...reverse ? { ...offset, transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit } : { transitionEnd: { ...offset, ...transitionEnd == null ? void 0 : transitionEnd.exit } } }; } }; var slideFadeConfig = { initial: "initial", animate: "enter", exit: "exit", variants: chunk_7254PCTD_variants }; var SlideFade = (0,external_React_.forwardRef)( function SlideFade2(props, ref) { const { unmountOnExit, in: isOpen, reverse = true, className, offsetX = 0, offsetY = 8, transition, transitionEnd, delay, ...rest } = props; const show = unmountOnExit ? isOpen && unmountOnExit : true; const animate = isOpen || unmountOnExit ? "enter" : "exit"; const custom = { offsetX, offsetY, reverse, transition, transitionEnd, delay }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { custom, children: show && /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { ref, className: cx("chakra-offset-slide", className), custom, ...slideFadeConfig, animate, ...rest } ) }); } ); SlideFade.displayName = "SlideFade"; //# sourceMappingURL=chunk-7254PCTD.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-SR4VX3RF.mjs 'use client' ; // src/scale-fade.tsx var chunk_SR4VX3RF_variants = { exit: ({ reverse, initialScale, transition, transitionEnd, delay }) => { var _a; return { opacity: 0, ...reverse ? { scale: initialScale, transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit } : { transitionEnd: { scale: initialScale, ...transitionEnd == null ? void 0 : transitionEnd.exit } }, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(TRANSITION_DEFAULTS.exit, delay) }; }, enter: ({ transitionEnd, transition, delay }) => { var _a; return { opacity: 1, scale: 1, transition: (_a = transition == null ? void 0 : transition.enter) != null ? _a : withDelay.enter(TRANSITION_DEFAULTS.enter, delay), transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter }; } }; var scaleFadeConfig = { initial: "exit", animate: "enter", exit: "exit", variants: chunk_SR4VX3RF_variants }; var ScaleFade = (0,external_React_.forwardRef)( function ScaleFade2(props, ref) { const { unmountOnExit, in: isOpen, reverse = true, initialScale = 0.95, className, transition, transitionEnd, delay, ...rest } = props; const show = unmountOnExit ? isOpen && unmountOnExit : true; const animate = isOpen || unmountOnExit ? "enter" : "exit"; const custom = { initialScale, reverse, transition, transitionEnd, delay }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { custom, children: show && /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { ref, className: cx("chakra-offset-slide", className), ...scaleFadeConfig, animate, custom, ...rest } ) }); } ); ScaleFade.displayName = "ScaleFade"; //# sourceMappingURL=chunk-SR4VX3RF.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-7NUJBCEL.mjs 'use client' // src/modal-transition.tsx ; var transitions = { slideInBottom: { ...slideFadeConfig, custom: { offsetY: 16, reverse: true } }, slideInRight: { ...slideFadeConfig, custom: { offsetX: 16, reverse: true } }, slideInTop: { ...slideFadeConfig, custom: { offsetY: -16, reverse: true } }, slideInLeft: { ...slideFadeConfig, custom: { offsetX: -16, reverse: true } }, scale: { ...scaleFadeConfig, custom: { initialScale: 0.95, reverse: true } }, none: {} }; var MotionSection = chakra(motion.section); var getMotionProps = (preset) => { return transitions[preset || "none"]; }; var ModalTransition = (0,external_React_.forwardRef)( (props, ref) => { const { preset, motionProps = getMotionProps(preset), ...rest } = props; return /* @__PURE__ */ (0,jsx_runtime.jsx)(MotionSection, { ref, ...motionProps, ...rest }); } ); ModalTransition.displayName = "ModalTransition"; //# sourceMappingURL=chunk-7NUJBCEL.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-EL2VKIZQ.mjs 'use client' ; // src/modal-content.tsx var ModalContent = forwardRef( (props, ref) => { const { className, children, containerProps: rootProps, motionProps, ...rest } = props; const { getDialogProps, getDialogContainerProps } = useModalContext(); const dialogProps = getDialogProps(rest, ref); const containerProps = getDialogContainerProps(rootProps); const _className = cx("chakra-modal__content", className); const styles = useModalStyles(); const dialogStyles = { display: "flex", flexDirection: "column", position: "relative", width: "100%", outline: 0, ...styles.dialog }; const dialogContainerStyles = { display: "flex", width: "100vw", height: "$100vh", position: "fixed", left: 0, top: 0, ...styles.dialogContainer }; const { motionPreset } = useModalContext(); return /* @__PURE__ */ (0,jsx_runtime.jsx)(ModalFocusScope, { children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...containerProps, className: "chakra-modal__content-container", tabIndex: -1, __css: dialogContainerStyles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( ModalTransition, { preset: motionPreset, motionProps, className: _className, ...dialogProps, __css: dialogStyles, children } ) } ) }); } ); ModalContent.displayName = "ModalContent"; //# sourceMappingURL=chunk-EL2VKIZQ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-FQDHE43W.mjs 'use client' ; // src/alert-dialog.tsx function AlertDialog(props) { const { leastDestructiveRef, ...rest } = props; return /* @__PURE__ */ (0,jsx_runtime.jsx)(Modal, { ...rest, initialFocusRef: leastDestructiveRef }); } var AlertDialogContent = forwardRef( (props, ref) => /* @__PURE__ */ (0,jsx_runtime.jsx)(ModalContent, { ref, role: "alertdialog", ...props }) ); //# sourceMappingURL=chunk-FQDHE43W.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/modal/dist/chunk-RAWN7VJ3.mjs 'use client' ; // src/modal-footer.tsx var ModalFooter = forwardRef( (props, ref) => { const { className, ...rest } = props; const _className = cx("chakra-modal__footer", className); const styles = useModalStyles(); const footerStyles = { display: "flex", alignItems: "center", justifyContent: "flex-end", ...styles.footer }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.footer, { ref, ...rest, __css: footerStyles, className: _className } ); } ); ModalFooter.displayName = "ModalFooter"; //# sourceMappingURL=chunk-RAWN7VJ3.mjs.map ;// CONCATENATED MODULE: external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// CONCATENATED MODULE: ./src/dashboard/images/blockart-blocks.webp /* harmony default export */ const blockart_blocks = (__webpack_require__.p + "6f863fcb56d8b6cb186730f36584df65.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/colormag.webp /* harmony default export */ const colormag = (__webpack_require__.p + "953555118c8f835b30db43e927efe1b3.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/evf.webp /* harmony default export */ const evf = (__webpack_require__.p + "5e0119d5e262c4119039e6137d0c94d6.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/masteriyo.webp /* harmony default export */ const masteriyo = (__webpack_require__.p + "edefcb9e8e52ef39ce7fdef6eab4b904.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/ur.webp /* harmony default export */ const ur = (__webpack_require__.p + "a020ba77a9e60b3ab59df0f9d798f142.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/zakra.webp /* harmony default export */ const zakra = (__webpack_require__.p + "6ec9d263fb46252dd146d64ffbc28d69.webp"); ;// CONCATENATED MODULE: ./src/dashboard/constants/products.tsx var PLUGINS = [{ label: "Masteriyo", slug: "learning-management-system/lms.php", description: (0,external_wp_i18n_namespaceObject.__)("WordPress LMS & e-Learning plugin to create and sell online courses. Easy quiz creation with inbuilt quiz builder.", "magazine-blocks"), type: "plugin", image: masteriyo, website: "https://masteriyo.com/", shortDescription: (0,external_wp_i18n_namespaceObject.__)("WordPress e-Learning Plugin with Quiz Builder.", "magazine-blocks"), logo: Masteriyo }, { label: "User Registration", slug: "user-registration/user-registration.php", description: (0,external_wp_i18n_namespaceObject.__)("The best Drag and drop user registration form and login form builder with a user profile page, email notification, user roles assignment, and more.", "magazine-blocks"), type: "plugin", image: ur, website: "https://wpuserregistration.com/", shortDescription: (0,external_wp_i18n_namespaceObject.__)("User Forms, Profiles, Roles, Notifications.", "magazine-blocks"), logo: UR }, { label: "Everest Forms", slug: "everest-forms/everest-forms.php", description: (0,external_wp_i18n_namespaceObject.__)("Fast, Lightweight & Secure Contact Form plugin. Beautiful & Responsive Pre-Built Templates.", "magazine-blocks"), type: "plugin", image: evf, website: "https://everestforms.net/", shortDescription: (0,external_wp_i18n_namespaceObject.__)("Quick, Secure Contact Form with Templates.", "magazine-blocks"), logo: EVF }, { label: "BlockArt Blocks", slug: "blockart-blocks/blockart.php", description: (0,external_wp_i18n_namespaceObject.__)("Craft your website beautifully using Gutenberg blocks like section/column, heading, button, etc. Unlimited possibilities of design with features like colors, backgrounds, typography, layouts, spacing, etc.", "magazine-blocks"), type: "plugin", image: blockart_blocks, website: "https://wpblockart.com/magazine-blocks/", shortDescription: (0,external_wp_i18n_namespaceObject.__)("Gutenberg Editor, Website Builder, Page Builder with Sections, Template Library & Starter Sites", "magazine-blocks"), logo: MagazineBlocks }]; var THEMES = [{ label: "Zakra", slug: "zakra", description: (0,external_wp_i18n_namespaceObject.__)("A powerful and versatile multipurpose theme that makes it easy to create beautiful and professional websites. With over free 40 pre-designed starter demo sites to choose from, you can quickly build a unique and functional site that fits your specific needs.", "magazine-blocks"), type: "theme", image: zakra, website: "https://zakratheme.com/" }, { label: "ColorMag", slug: "colormag", description: (0,external_wp_i18n_namespaceObject.__)("ColorMag is always the best choice when it comes to magazine, news, and blog WordPress themes. You can create elegant and modern websites for news portals, online magazines, and publishing sites.", "magazine-blocks"), type: "theme", image: colormag, website: "https://themegrill.com/themes/colormag/" }]; ;// CONCATENATED MODULE: ./src/dashboard/store/index.ts function store_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function store_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? store_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : store_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var MAGAZINE_BLOCKS_DASHBOARD_STORE = "magazine-blocks/dashboard"; var INITIAL_STATE = { plugins: localized.plugins, themes: localized.themes }; var dashboardStore = (0,external_wp_data_namespaceObject.createReduxStore)(MAGAZINE_BLOCKS_DASHBOARD_STORE, { reducer: function reducer() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INITIAL_STATE; var action = arguments.length > 1 ? arguments[1] : undefined; switch (action.type) { case "UPDATE_PLUGINS_STATUS": return store_objectSpread(store_objectSpread({}, state), {}, { plugins: store_objectSpread(store_objectSpread({}, state.plugins), action.payload) }); case "UPDATE_THEMES_STATUS": return store_objectSpread(store_objectSpread({}, state), {}, { themes: store_objectSpread(store_objectSpread({}, state.themes), action.payload) }); } return state; }, actions: { setPluginsStatus: function setPluginsStatus(plugins) { return { type: "UPDATE_PLUGINS_STATUS", payload: plugins }; }, setThemesStatus: function setThemesStatus(themes) { return { type: "UPDATE_THEMES_STATUS", payload: themes }; } }, selectors: { getPluginsStatus: function getPluginsStatus(state) { return state.plugins; }, getPluginStatus: function getPluginStatus(state, plugin) { return state.plugins[plugin]; }, getThemesStatus: function getThemesStatus(state) { return state.themes; }, getThemeStatus: function getThemeStatus(state, theme) { return state.themes[theme]; } } }); (0,external_wp_data_namespaceObject.register)(dashboardStore); ;// CONCATENATED MODULE: ./src/dashboard/screens/dashboard/components/UsefulPlugins.tsx var Plugin = function Plugin(_ref) { var plugin = _ref.plugin, index = _ref.index, pluginsStatus = _ref.pluginsStatus; var _useDispatch = (0,external_wp_data_namespaceObject.useDispatch)(MAGAZINE_BLOCKS_DASHBOARD_STORE), setPluginsStatus = _useDispatch.setPluginsStatus; var toast = useToast(); var _useDisclosure = useDisclosure(), isOpen = _useDisclosure.isOpen, onOpen = _useDisclosure.onOpen, onClose = _useDisclosure.onClose; var cancelRef = external_React_default().useRef(); var activate = (0,react_query_es.useMutation)(function (_ref2) { var slug = _ref2.slug, file = _ref2.file; return external_wp_apiFetch_default()({ path: "wp/v2/plugins/".concat(slug), method: "POST", data: { plugin: file.replace(".php", ""), status: "active" } }); }, { onSuccess: function onSuccess(data) { setPluginsStatus(defineProperty_defineProperty({}, "".concat(data.plugin, ".php"), data.status)); toast({ status: "success", description: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s plugin activated successfully", "magazine-blocks"), data.name), isClosable: true }); onClose(); }, onError: function onError(e) { toast({ status: "error", description: e.message, isClosable: true }); onClose(); } }); var install = (0,react_query_es.useMutation)(function (plugin) { return external_wp_apiFetch_default()({ path: "wp/v2/plugins", method: "POST", data: { slug: plugin, status: "active" } }); }, { onSuccess: function onSuccess(data) { setPluginsStatus(defineProperty_defineProperty({}, "".concat(data.plugin, ".php"), data.status)); toast({ status: "success", description: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s plugin installed and activated successfully", "magazine-blocks"), data.name), isClosable: true }); onClose(); }, onError: function onError(e) { toast({ status: "error", description: e.message, isClosable: true }); onClose(); } }); var installOrActivatePlugin = function installOrActivatePlugin(pluginFile) { var slug = pluginFile.split("/")[0]; if (pluginsStatus[pluginFile] === "not-installed") { install.mutate(slug); } else if (pluginsStatus[pluginFile] === "inactive") { activate.mutate({ slug: slug, file: pluginFile }); } }; return /*#__PURE__*/external_React_default().createElement(HStack, { key: plugin.slug, gap: "4px", justify: "space-between", px: "16px", py: "18px", borderRight: "1px", borderBottom: "1px", borderColor: "gray.100", pl: index % 2 === 0 ? "0" : undefined }, /*#__PURE__*/external_React_default().createElement(HStack, null, /*#__PURE__*/external_React_default().createElement(plugin.logo, { w: "40px", h: "40px" }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "6px" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h4", fontSize: "14px", fontWeight: "semibold" }, plugin.label), /*#__PURE__*/external_React_default().createElement(Text, { as: "span", color: "gray.500" }, plugin.shortDescription))), /*#__PURE__*/external_React_default().createElement(Button, { variant: "link", colorScheme: "primary", color: "primary.500 !important", fontSize: "14px", fontWeight: "normal", textDecor: "underline", isLoading: activate.isLoading || install.isLoading, isDisabled: "active" === pluginsStatus[plugin.slug], onClick: onOpen }, pluginsStatus[plugin.slug] === "active" ? (0,external_wp_i18n_namespaceObject.__)("Active", "magazine-blocks") : pluginsStatus[plugin.slug] === "inactive" ? (0,external_wp_i18n_namespaceObject.__)("Activate", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(AlertDialog, { isOpen: isOpen, leastDestructiveRef: cancelRef, onClose: onClose, isCentered: true }, /*#__PURE__*/external_React_default().createElement(ModalOverlay, null, /*#__PURE__*/external_React_default().createElement(AlertDialogContent, null, /*#__PURE__*/external_React_default().createElement(ModalHeader, { fontSize: "lg", fontWeight: "semibold" }, "inactive" === pluginsStatus[plugin.slug] ? (0,external_wp_i18n_namespaceObject.__)("Activate Plugin", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install Plugin", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(ModalBody, null, "inactive" === pluginsStatus[plugin.slug] ? (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Are you sure? You want to activate %s plugin.", "magazine-blocks"), plugin.label) : (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Are you sure? You want to install and activate %s plugin.", "magazine-blocks"), plugin.label)), /*#__PURE__*/external_React_default().createElement(ModalFooter, null, /*#__PURE__*/external_React_default().createElement(Button, { size: "sm", fontSize: "xs", fontWeight: "normal", variant: "outline", colorScheme: "primary", isDisabled: activate.isLoading || install.isLoading, ref: cancelRef, onClick: onClose }, (0,external_wp_i18n_namespaceObject.__)("Cancel", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { size: "sm", fontSize: "xs", fontWeight: "normal", colorScheme: "primary", onClick: function onClick() { return installOrActivatePlugin(plugin.slug); }, ml: 3, isLoading: activate.isLoading || install.isLoading }, "inactive" === pluginsStatus[plugin.slug] ? (0,external_wp_i18n_namespaceObject.__)("Activate", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install", "magazine-blocks"))))))); }; var UsefulPlugins = function UsefulPlugins() { var pluginsStatus = (0,external_wp_data_namespaceObject.useSelect)(function (select) { return select(MAGAZINE_BLOCKS_DASHBOARD_STORE).getPluginsStatus(); }, []); return /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "1fr 1fr" }, PLUGINS.map(function (plugin, i) { return /*#__PURE__*/external_React_default().createElement(Plugin, { key: plugin.slug, pluginsStatus: pluginsStatus, plugin: plugin, index: i }); })); }; /* harmony default export */ const components_UsefulPlugins = (UsefulPlugins); ;// CONCATENATED MODULE: ./src/dashboard/screens/dashboard/Dashboard.tsx var Dashboard = function Dashboard() { return /*#__PURE__*/external_React_default().createElement(Grid, { my: "8", mx: "6", gridGap: "5", gridTemplateColumns: { sm: "1fr", md: "3fr 1fr" } }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "5" }, /*#__PURE__*/external_React_default().createElement(Box, { p: "6", borderRadius: "base", border: "1px", borderColor: "gray.100", bgColor: "white" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", mb: "5", fontSize: "2xl", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Welcome to Magazine Blocks", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_QINAG4RG_Image, { src: magazine_blocks_hero }), /*#__PURE__*/external_React_default().createElement(ButtonGroup, { mt: "5", spacing: "6" }, /*#__PURE__*/external_React_default().createElement(Button, { as: chunk_K7XRJ7NL_Link, colorScheme: "primary", fontSize: "14px", fontWeight: "normal", borderRadius: "base", color: "white !important", textDecor: "none !important", py: "3", px: "6", href: "".concat(localized.adminUrl, "post-new.php?post_type=page") }, (0,external_wp_i18n_namespaceObject.__)("Create Your First Page", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { as: chunk_K7XRJ7NL_Link, colorScheme: "primary", fontSize: "14px", fontWeight: "normal", borderRadius: "base", variant: "link", textDecor: "underline", color: "primary.500 !important", href: "https://wpblockart.com/", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Visit Our Website", "magazine-blocks")))), /*#__PURE__*/external_React_default().createElement(Box, { bgColor: "white", border: "1px", borderColor: "gray.100", borderRadius: "base", p: "4" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", mb: "4", fontSize: "lg", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Useful Plugins", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(components_UsefulPlugins, null))), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(DocsLines, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Getting Started", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Please check out basic documentation for detailed information on how to use Magazine Blocks.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { color: "primary.500 !important", textDecor: "underline", href: "https://docs.wpblockart.com/magazine-blocks/", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("View Documentation", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Bulb, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Feature Request", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Please take a moment to suggest any features that could enhance our product.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { color: "primary.500 !important", textDecor: "underline", href: "https://wpblockart.com/contact/", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Request a Feature", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Star, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Submit us a Review", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Sharing your review is a valuable way to help us enhance your experience.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { color: "primary.500 !important", textDecor: "underline", href: "https://wordpress.org/support/plugin/magazine-blocks/reviews/?rate=5#new-post", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Submit a Review", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Video, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Video Tutorials", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Have a look at video tutorials to walk you through getting started.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { color: "primary.500 !important", textDecor: "underline", isExternal: true, href: "https://www.youtube.com/@ThemeGrillOfficial" }, (0,external_wp_i18n_namespaceObject.__)("Watch Videos", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Headphones, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Support", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Get in touch with our support team. You can always submit a support ticket for help.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { color: "primary.500 !important", textDecor: "underline", href: "https://wordpress.org/support/plugin/magazine-blocks/#new-topic-0", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Create a Ticket", "magazine-blocks"))))); }; /* harmony default export */ const dashboard_Dashboard = (Dashboard); ;// CONCATENATED MODULE: ./src/dashboard/screens/free-vs-pro/FreeVsPro.tsx var FreeVsPro = function FreeVsPro() { return /*#__PURE__*/external_React_default().createElement("p", null, "FreeVsPro"); }; /* harmony default export */ const free_vs_pro_FreeVsPro = (FreeVsPro); ;// CONCATENATED MODULE: ./src/dashboard/images/facebook.webp /* harmony default export */ const facebook = (__webpack_require__.p + "73e84ecf138c39fb2c97167a5f9e82a2.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/x.webp /* harmony default export */ const x = (__webpack_require__.p + "49f9520e9ca04b8812e26bf548c09eae.webp"); ;// CONCATENATED MODULE: ./src/dashboard/images/youtube.webp /* harmony default export */ const youtube = (__webpack_require__.p + "bf7d11b17f85f0181710e4c28be8174b.webp"); ;// CONCATENATED MODULE: ./src/dashboard/screens/help/Help.tsx var Help = function Help() { return /*#__PURE__*/external_React_default().createElement(Grid, { my: "8", mx: "6", gridGap: "5", gridTemplateColumns: { sm: "1fr", md: "3fr 1fr" } }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "5" }, /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: { sm: "1fr", md: "1fr 1fr" }, gridGap: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { px: "6", py: "8", align: "center", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100", textAlign: "center" }, /*#__PURE__*/external_React_default().createElement(Chat, { w: "8", h: "8", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Support", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("We would be happy to guide any of your issues and queries 24/7", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { mt: "10", as: chunk_K7XRJ7NL_Link, variant: "outline", colorScheme: "primary", borderRadius: "base", fontSize: "14px", fontWeight: "normal", href: "https://wpblockart.com/contact/", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Contact Support", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { px: "6", py: "8", align: "center", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100", textAlign: "center" }, /*#__PURE__*/external_React_default().createElement(DocsLines, { w: "8", h: "8", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Need Some Help?", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("Please check out basic documentation for detailed information on how to use Magazine Blocks.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { mt: "10", as: chunk_K7XRJ7NL_Link, colorScheme: "primary", variant: "link", borderRadius: "base", fontSize: "14px", fontWeight: "normal", textDecor: "underline", href: "https://docs.wpblockart.com/magazine-blocks/", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("View Now", "magazine-blocks")))), /*#__PURE__*/external_React_default().createElement(Stack, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", fontSize: "lg", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Join Our Community", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "1fr 1fr", p: "4", bgColor: "white", border: "1px", borderColor: "gray.100", borderRadius: "base", gridGap: "7" }, /*#__PURE__*/external_React_default().createElement(chunk_QINAG4RG_Image, { src: facebook, w: "full" }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "2", justify: "center" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", fontSize: "xl", fontWeight: "normal", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("Facebook Community", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("Join our Facebook community, where the latest news and updates eagerly await your arrival.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { as: chunk_K7XRJ7NL_Link, colorScheme: "primary", borderRadius: "base", fontSize: "14px", fontWeight: "normal", alignSelf: "start", mt: "5", color: "white !important", isExternal: true, href: "https://www.facebook.com/themegrill" }, (0,external_wp_i18n_namespaceObject.__)("Join Group", "magazine-blocks")))), /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "1fr 1fr", p: "4", bgColor: "white", border: "1px", borderColor: "gray.100", borderRadius: "base", gridGap: "7" }, /*#__PURE__*/external_React_default().createElement(chunk_QINAG4RG_Image, { src: x }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "2", justify: "center" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", fontSize: "xl", fontWeight: "normal", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("X Community", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("Join our X community, where the latest news and updates eagerly await your arrival.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { as: chunk_K7XRJ7NL_Link, borderRadius: "base", fontSize: "14px", fontWeight: "normal", alignSelf: "start", mt: "5", color: "white !important", bgColor: "black !important", isExternal: true, href: "https://twitter.com/themegrill" }, (0,external_wp_i18n_namespaceObject.__)("Join Group", "magazine-blocks")))), /*#__PURE__*/external_React_default().createElement(Grid, { gridTemplateColumns: "1fr 1fr", p: "4", bgColor: "white", border: "1px", borderColor: "gray.100", borderRadius: "base", gridGap: "7" }, /*#__PURE__*/external_React_default().createElement(chunk_QINAG4RG_Image, { src: youtube }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "2", justify: "center" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", fontSize: "xl", fontWeight: "normal", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("YouTube Community", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700" }, (0,external_wp_i18n_namespaceObject.__)("Subscribe to our YouTube channel, where the latest news and updates eagerly await your arrival.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { as: chunk_K7XRJ7NL_Link, colorScheme: "red", borderRadius: "base", fontSize: "14px", fontWeight: "normal", alignSelf: "start", mt: "5", color: "white !important", isExternal: true, href: "https://www.youtube.com/@ThemeGrillOfficial" }, (0,external_wp_i18n_namespaceObject.__)("Subscribe", "magazine-blocks"))))), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Video, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Video Tutorials", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Have a look at video tutorials to walk you through getting started.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { isExternal: true, color: "primary.500 !important", textDecor: "underline", href: "https://www.youtube.com/@ThemeGrillOfficial" }, (0,external_wp_i18n_namespaceObject.__)("Watch Videos", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Bulb, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Feature Request", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Please take a moment to suggest any features that could enhance our product.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { href: "https://wpblockart.com/contact/", color: "primary.500 !important", textDecor: "underline", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Request a Feature", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Stack, { p: "4", gap: "3", bgColor: "white", borderRadius: "base", border: "1px", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "2" }, /*#__PURE__*/external_React_default().createElement(Star, { w: "5", h: "5", fill: "primary.500" }), /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "sm", fontWeight: "semibold" }, (0,external_wp_i18n_namespaceObject.__)("Submit us a Review", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "13px", color: "gray.700", mb: "5" }, (0,external_wp_i18n_namespaceObject.__)("Sharing your review is a valuable way to help us enhance your experience.", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { href: "https://wordpress.org/support/plugin/magazine-blocks/reviews/?rate=5#new-post", color: "primary.500 !important", textDecor: "underline", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Submit a Review", "magazine-blocks"))))); }; /* harmony default export */ const help_Help = (Help); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-NEK3OOAM.mjs 'use client' ; // src/simple-grid.tsx var SimpleGrid = forwardRef( function SimpleGrid2(props, ref) { const { columns, spacingX, spacingY, spacing, minChildWidth, ...rest } = props; const theme = chunk_UIGT7YZF_useTheme(); const templateColumns = minChildWidth ? widthToColumns(minChildWidth, theme) : countToColumns(columns); return /* @__PURE__ */ (0,jsx_runtime.jsx)( Grid, { ref, gap: spacing, columnGap: spacingX, rowGap: spacingY, templateColumns, ...rest } ); } ); SimpleGrid.displayName = "SimpleGrid"; function toPx(n) { return typeof n === "number" ? `${n}px` : n; } function widthToColumns(width, theme) { return mapResponsive(width, (value) => { const _value = getToken("sizes", value, toPx(value))(theme); 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))` ); } //# sourceMappingURL=chunk-NEK3OOAM.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/card/dist/chunk-HAZMUPV3.mjs 'use client' // src/card-context.tsx ; var [CardStylesProvider, useCardStyles] = createStylesContext("Card"); //# sourceMappingURL=chunk-HAZMUPV3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/card/dist/chunk-YQO7BFFX.mjs 'use client' ; // src/card.tsx var Card = forwardRef(function Card2(props, ref) { const { className, children, direction = "column", justify, align, ...rest } = omitThemingProps(props); const styles = useMultiStyleConfig("Card", props); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, className: cx("chakra-card", className), __css: { display: "flex", flexDirection: direction, justifyContent: justify, alignItems: align, position: "relative", minWidth: 0, wordWrap: "break-word", ...styles.container }, ...rest, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(CardStylesProvider, { value: styles, children }) } ); }); //# sourceMappingURL=chunk-YQO7BFFX.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/card/dist/chunk-FHHZMTWR.mjs 'use client' ; // src/card-body.tsx var CardBody = forwardRef(function CardBody2(props, ref) { const { className, ...rest } = props; const styles = useCardStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, className: cx("chakra-card__body", className), __css: styles.body, ...rest } ); }); //# sourceMappingURL=chunk-FHHZMTWR.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/layout/dist/chunk-W7WUSNWJ.mjs 'use client' // src/divider.tsx ; var Divider = forwardRef(function Divider2(props, ref) { const { borderLeftWidth, borderBottomWidth, borderTopWidth, borderRightWidth, borderWidth, borderStyle, borderColor, ...styles } = 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 /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.hr, { ref, "aria-orientation": orientation, ...rest, __css: { ...styles, border: "0", borderColor, borderStyle, ...dividerStyles[orientation], ...__css }, className: cx("chakra-divider", className) } ); }); Divider.displayName = "Divider"; //# sourceMappingURL=chunk-W7WUSNWJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/card/dist/chunk-BDSTZZXD.mjs 'use client' ; // src/card-footer.tsx var CardFooter = forwardRef( function CardFooter2(props, ref) { const { className, justify, ...rest } = props; const styles = useCardStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ref, className: cx("chakra-card__footer", className), __css: { display: "flex", justifyContent: justify, ...styles.footer }, ...rest } ); } ); //# sourceMappingURL=chunk-BDSTZZXD.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/screens/products/components/ProductCard.tsx var ProductCard = function ProductCard(props) { var label = props.label, description = props.description, image = props.image, website = props.website, pluginsStatus = props.pluginsStatus, slug = props.slug, type = props.type, themesStatus = props.themesStatus; var _useDispatch = (0,external_wp_data_namespaceObject.useDispatch)(MAGAZINE_BLOCKS_DASHBOARD_STORE), setPluginsStatus = _useDispatch.setPluginsStatus; var toast = useToast(); var _useDisclosure = useDisclosure(), isOpen = _useDisclosure.isOpen, onOpen = _useDisclosure.onOpen, onClose = _useDisclosure.onClose; var cancelRef = external_React_default().useRef(); var activatePlugin = (0,react_query_es.useMutation)(function (_ref) { var slug = _ref.slug, file = _ref.file; return external_wp_apiFetch_default()({ path: "wp/v2/plugins/".concat(slug), method: "POST", data: { plugin: file.replace(".php", ""), status: "active" } }); }, { onSuccess: function onSuccess(data) { setPluginsStatus(defineProperty_defineProperty({}, "".concat(data.plugin, ".php"), data.status)); toast({ status: "success", description: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s plugin activated successfully", "magazine-blocks"), data.name), isClosable: true }); onClose(); }, onError: function onError(e) { toast({ status: "error", description: e.message, isClosable: true }); onClose(); } }); var installPlugin = (0,react_query_es.useMutation)(function (plugin) { return external_wp_apiFetch_default()({ path: "wp/v2/plugins", method: "POST", data: { slug: plugin, status: "active" } }); }, { onSuccess: function onSuccess(data) { setPluginsStatus(defineProperty_defineProperty({}, "".concat(data.plugin, ".php"), data.status)); toast({ status: "success", description: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("%s plugin installed and activated successfully", "magazine-blocks"), data.name), isClosable: true }); onClose(); }, onError: function onError(e) { toast({ status: "error", description: e.message, isClosable: true }); onClose(); } }); var installOrActivatePlugin = function installOrActivatePlugin(pluginFile) { var slug = pluginFile.split("/")[0]; if (pluginsStatus[pluginFile] === "not-installed") { installPlugin.mutate(slug); } else if (pluginsStatus[pluginFile] === "inactive") { activatePlugin.mutate({ slug: slug, file: pluginFile }); } }; var status = type === "theme" ? themesStatus[slug] : pluginsStatus[slug]; return /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement(Card, { overflow: "hidden", boxShadow: "none", border: "1px", borderRadius: "base", borderColor: "gray.100" }, /*#__PURE__*/external_React_default().createElement(CardBody, { p: "0" }, /*#__PURE__*/external_React_default().createElement(chunk_QINAG4RG_Image, { w: "full", src: image }), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "2", px: "4", py: "5" }, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { as: "h3", size: "md", m: "0", fontSize: "md", fontWeight: "semibold" }, label), /*#__PURE__*/external_React_default().createElement(Text, { m: "0", color: "gray.600", fontSize: "13px" }, description))), /*#__PURE__*/external_React_default().createElement(Divider, { color: "gray.300" }), /*#__PURE__*/external_React_default().createElement(CardFooter, { px: "4", py: "5", justifyContent: "space-between", alignItems: "center" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "1", align: "center" }, /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { href: website, fontSize: "xs", color: "gray.500", textDecoration: "underline", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Learn More", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Text, { as: "span", lineHeight: "1", color: "gray.500" }, "|"), /*#__PURE__*/external_React_default().createElement(chunk_K7XRJ7NL_Link, { href: website, fontSize: "xs", color: "gray.500", textDecoration: "underline", isExternal: true }, (0,external_wp_i18n_namespaceObject.__)("Live Demo", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Button, { colorScheme: "primary", size: "sm", fontSize: "xs", borderRadius: "base", fontWeight: "semibold", _hover: { color: "white", textDecoration: "none" }, _focus: { color: "white", textDecoration: "none" }, isDisabled: "active" === status, as: "theme" === type ? chunk_K7XRJ7NL_Link : undefined, href: "theme" === type ? "inactive" === status ? "".concat(localized.adminUrl, "themes.php?search=").concat(slug) : "".concat(localized.adminUrl, "/theme-install.php?search=").concat(slug) : undefined, onClick: "plugin" === type ? onOpen : undefined, isLoading: "plugin" === type ? activatePlugin.isLoading || installPlugin.isLoading : undefined }, "active" === status ? (0,external_wp_i18n_namespaceObject.__)("Active", "magazine-blocks") : "inactive" === status ? (0,external_wp_i18n_namespaceObject.__)("Activate", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install", "magazine-blocks")))), type === "plugin" && /*#__PURE__*/external_React_default().createElement(AlertDialog, { isOpen: isOpen, leastDestructiveRef: cancelRef, onClose: onClose, isCentered: true }, /*#__PURE__*/external_React_default().createElement(ModalOverlay, null, /*#__PURE__*/external_React_default().createElement(AlertDialogContent, null, /*#__PURE__*/external_React_default().createElement(ModalHeader, { fontSize: "lg", fontWeight: "semibold" }, "inactive" === pluginsStatus[slug] ? (0,external_wp_i18n_namespaceObject.__)("Activate Plugin", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install Plugin", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(ModalBody, null, "inactive" === pluginsStatus[slug] ? (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Are you sure? You want to activate %s plugin.", "magazine-blocks"), label) : (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)("Are you sure? You want to install and activate %s plugin.", "magazine-blocks"), label)), /*#__PURE__*/external_React_default().createElement(ModalFooter, null, /*#__PURE__*/external_React_default().createElement(Button, { size: "sm", fontSize: "xs", fontWeight: "normal", variant: "outline", colorScheme: "primary", isDisabled: activatePlugin.isLoading || installPlugin.isLoading, ref: cancelRef, onClick: onClose }, (0,external_wp_i18n_namespaceObject.__)("Cancel", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Button, { size: "sm", fontSize: "xs", fontWeight: "normal", colorScheme: "primary", onClick: function onClick() { return installOrActivatePlugin(slug); }, ml: 3, isLoading: activatePlugin.isLoading || installPlugin.isLoading }, "inactive" === pluginsStatus[slug] ? (0,external_wp_i18n_namespaceObject.__)("Activate", "magazine-blocks") : (0,external_wp_i18n_namespaceObject.__)("Install", "magazine-blocks"))))))); }; /* harmony default export */ const components_ProductCard = (ProductCard); ;// CONCATENATED MODULE: ./src/dashboard/screens/products/Products.tsx var Products = function Products() { var _useSelect = (0,external_wp_data_namespaceObject.useSelect)(function (select) { var _ref = select(MAGAZINE_BLOCKS_DASHBOARD_STORE), getPluginsStatus = _ref.getPluginsStatus, getThemesStatus = _ref.getThemesStatus; return { pluginsStatus: getPluginsStatus(), themesStatus: getThemesStatus() }; }, []), pluginsStatus = _useSelect.pluginsStatus, themesStatus = _useSelect.themesStatus; return /*#__PURE__*/external_React_default().createElement(Stack, { my: "8", mx: "6" }, /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { size: "md", fontSize: "xl", fontWeight: "semibold", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Plugins", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(SimpleGrid, { columns: { base: 1, md: 2, lg: 3, xl: 4 }, spacing: "5" }, PLUGINS.map(function (plugin) { return /*#__PURE__*/external_React_default().createElement(components_ProductCard, helpers_esm_extends_extends({ key: plugin.slug }, plugin, { pluginsStatus: pluginsStatus, themesStatus: themesStatus })); }))), /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { size: "md", fontSize: "xl", fontWeight: "semibold", my: "8" }, (0,external_wp_i18n_namespaceObject.__)("Themes", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(SimpleGrid, { columns: { base: 1, md: 2, lg: 3, xl: 4 }, spacing: "5" }, THEMES.map(function (theme) { return /*#__PURE__*/external_React_default().createElement(components_ProductCard, helpers_esm_extends_extends({ key: theme.slug }, theme, { pluginsStatus: pluginsStatus, themesStatus: themesStatus })); })))); }; /* harmony default export */ const products_Products = (Products); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-controllable-state/dist/index.mjs 'use client' // src/index.ts ; function dist_useControllableProp(prop, state) { const controlled = typeof prop !== "undefined"; const value = controlled ? prop : state; return useMemo(() => [controlled, value], [controlled, value]); } function dist_useControllableState(props) { const { value: valueProp, defaultValue, onChange, shouldUpdate = (prev, next) => prev !== next } = props; const onChangeProp = dist_useCallbackRef(onChange); const shouldUpdateProp = dist_useCallbackRef(shouldUpdate); const [uncontrolledState, setUncontrolledState] = (0,external_React_.useState)(defaultValue); const controlled = valueProp !== void 0; const value = controlled ? valueProp : uncontrolledState; const setValue = dist_useCallbackRef( (next) => { const setter = next; const nextValue = typeof next === "function" ? setter(value) : next; if (!shouldUpdateProp(value, nextValue)) { return; } if (!controlled) { setUncontrolledState(nextValue); } onChangeProp(nextValue); }, [controlled, onChangeProp, value, shouldUpdateProp] ); return [value, setValue]; } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-NXSBASJ3.mjs 'use client' // src/use-tabs.ts ; var [ TabsDescendantsProvider, useTabsDescendantsContext, useTabsDescendants, useTabsDescendant ] = createDescendantContext(); function useTabs(props) { var _a; const { defaultIndex, onChange, index, isManual, isLazy, lazyBehavior = "unmount", orientation = "horizontal", direction = "ltr", ...htmlProps } = props; const [focusedIndex, setFocusedIndex] = (0,external_React_.useState)(defaultIndex != null ? defaultIndex : 0); const [selectedIndex, setSelectedIndex] = dist_useControllableState({ defaultValue: defaultIndex != null ? defaultIndex : 0, value: index, onChange }); (0,external_React_.useEffect)(() => { if (index != null) { setFocusedIndex(index); } }, [index]); const descendants = useTabsDescendants(); const uuid = (0,external_React_.useId)(); const uid = (_a = props.id) != null ? _a : uuid; const id = `tabs-${uid}`; return { id, selectedIndex, focusedIndex, setSelectedIndex, setFocusedIndex, isManual, isLazy, lazyBehavior, orientation, descendants, direction, htmlProps }; } var [TabsProvider, useTabsContext] = createContext({ name: "TabsContext", errorMessage: "useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />" }); function useTabList(props) { const { focusedIndex, orientation, direction } = useTabsContext(); const descendants = useTabsDescendantsContext(); const onKeyDown = (0,external_React_.useCallback)( (event) => { const nextTab = () => { var _a; const next = descendants.nextEnabled(focusedIndex); if (next) (_a = next.node) == null ? void 0 : _a.focus(); }; const prevTab = () => { var _a; const prev = descendants.prevEnabled(focusedIndex); if (prev) (_a = prev.node) == null ? void 0 : _a.focus(); }; const firstTab = () => { var _a; const first = descendants.firstEnabled(); if (first) (_a = first.node) == null ? void 0 : _a.focus(); }; const lastTab = () => { var _a; const last = descendants.lastEnabled(); if (last) (_a = last.node) == null ? void 0 : _a.focus(); }; const isHorizontal = orientation === "horizontal"; const isVertical = orientation === "vertical"; const eventKey = event.key; const ArrowStart = direction === "ltr" ? "ArrowLeft" : "ArrowRight"; const ArrowEnd = direction === "ltr" ? "ArrowRight" : "ArrowLeft"; const keyMap = { [ArrowStart]: () => isHorizontal && prevTab(), [ArrowEnd]: () => isHorizontal && nextTab(), ArrowDown: () => isVertical && nextTab(), ArrowUp: () => isVertical && prevTab(), Home: firstTab, End: lastTab }; const action = keyMap[eventKey]; if (action) { event.preventDefault(); action(event); } }, [descendants, focusedIndex, orientation, direction] ); return { ...props, role: "tablist", "aria-orientation": orientation, onKeyDown: callAllHandlers(props.onKeyDown, onKeyDown) }; } function useTab(props) { const { isDisabled = false, isFocusable = false, ...htmlProps } = props; const { setSelectedIndex, isManual, id, setFocusedIndex, selectedIndex } = useTabsContext(); const { index, register } = useTabsDescendant({ disabled: isDisabled && !isFocusable }); const isSelected = index === selectedIndex; const onClick = () => { setSelectedIndex(index); }; const onFocus = () => { setFocusedIndex(index); const isDisabledButFocusable = isDisabled && isFocusable; const shouldSelect = !isManual && !isDisabledButFocusable; if (shouldSelect) { setSelectedIndex(index); } }; const clickableProps = useClickable({ ...htmlProps, ref: mergeRefs(register, props.ref), isDisabled, isFocusable, onClick: callAllHandlers(props.onClick, onClick) }); const type = "button"; return { ...clickableProps, id: makeTabId(id, index), role: "tab", tabIndex: isSelected ? 0 : -1, type, "aria-selected": isSelected, "aria-controls": makeTabPanelId(id, index), onFocus: isDisabled ? void 0 : callAllHandlers(props.onFocus, onFocus) }; } var [TabPanelProvider, useTabPanelContext] = createContext({}); function useTabPanels(props) { const context = useTabsContext(); const { id, selectedIndex } = context; const validChildren = dist_getValidChildren(props.children); const children = validChildren.map( (child, index) => (0,external_React_.createElement)( TabPanelProvider, { key: index, value: { isSelected: index === selectedIndex, id: makeTabPanelId(id, index), tabId: makeTabId(id, index), selectedIndex } }, child ) ); return { ...props, children }; } function useTabPanel(props) { const { children, ...htmlProps } = props; const { isLazy, lazyBehavior } = useTabsContext(); const { isSelected, id, tabId } = useTabPanelContext(); const hasBeenSelected = (0,external_React_.useRef)(false); if (isSelected) { hasBeenSelected.current = true; } const shouldRenderChildren = lazyDisclosure({ wasSelected: hasBeenSelected.current, isSelected, enabled: isLazy, mode: lazyBehavior }); return { // Puts the tabpanel in the page `Tab` sequence. tabIndex: 0, ...htmlProps, children: shouldRenderChildren ? children : null, role: "tabpanel", "aria-labelledby": tabId, hidden: !isSelected, id }; } function useTabIndicator() { const context = useTabsContext(); const descendants = useTabsDescendantsContext(); const { selectedIndex, orientation } = context; const isHorizontal = orientation === "horizontal"; const isVertical = orientation === "vertical"; const [rect, setRect] = useState(() => { if (isHorizontal) return { left: 0, width: 0 }; if (isVertical) return { top: 0, height: 0 }; return void 0; }); const [hasMeasured, setHasMeasured] = useState(false); useSafeLayoutEffect(() => { if (selectedIndex == null) return; const tab = descendants.item(selectedIndex); if (tab == null) return; if (isHorizontal) { setRect({ left: tab.node.offsetLeft, width: tab.node.offsetWidth }); } if (isVertical) { setRect({ top: tab.node.offsetTop, height: tab.node.offsetHeight }); } const id = requestAnimationFrame(() => { setHasMeasured(true); }); return () => { if (id) { cancelAnimationFrame(id); } }; }, [selectedIndex, isHorizontal, isVertical, descendants]); return { position: "absolute", transitionProperty: "left, right, top, bottom, height, width", transitionDuration: hasMeasured ? "200ms" : "0ms", transitionTimingFunction: "cubic-bezier(0, 0, 0.2, 1)", ...rect }; } function makeTabId(id, index) { return `${id}--tab-${index}`; } function makeTabPanelId(id, index) { return `${id}--tabpanel-${index}`; } //# sourceMappingURL=chunk-NXSBASJ3.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-GTRZJDIL.mjs 'use client' ; // src/tabs.tsx var [TabsStylesProvider, useTabsStyles] = createContext({ name: `TabsStylesContext`, errorMessage: `useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" ` }); var chunk_GTRZJDIL_Tabs = forwardRef(function Tabs2(props, ref) { const styles = useMultiStyleConfig("Tabs", props); const { children, className, ...rest } = omitThemingProps(props); const { htmlProps, descendants, ...ctx } = useTabs(rest); const context = (0,external_React_.useMemo)(() => ctx, [ctx]); const { isFitted: _, ...rootProps } = htmlProps; const tabsStyles = { position: "relative", ...styles.root }; return /* @__PURE__ */ (0,jsx_runtime.jsx)(TabsDescendantsProvider, { value: descendants, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(TabsProvider, { value: context, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(TabsStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { className: cx("chakra-tabs", className), ref, ...rootProps, __css: tabsStyles, children } ) }) }) }); }); chunk_GTRZJDIL_Tabs.displayName = "Tabs"; //# sourceMappingURL=chunk-GTRZJDIL.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-IAXSQ4X2.mjs 'use client' ; // src/tab.tsx var Tab = forwardRef(function Tab2(props, ref) { const styles = useTabsStyles(); const tabProps = useTab({ ...props, ref }); const tabStyles = { outline: "0", display: "flex", alignItems: "center", justifyContent: "center", ...styles.tab }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.button, { ...tabProps, className: cx("chakra-tabs__tab", props.className), __css: tabStyles } ); }); Tab.displayName = "Tab"; //# sourceMappingURL=chunk-IAXSQ4X2.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-BXDFYXZJ.mjs 'use client' ; // src/tab-list.tsx var TabList = forwardRef(function TabList2(props, ref) { const tablistProps = useTabList({ ...props, ref }); const styles = useTabsStyles(); const tablistStyles = { display: "flex", ...styles.tablist }; return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...tablistProps, className: cx("chakra-tabs__tablist", props.className), __css: tablistStyles } ); }); TabList.displayName = "TabList"; //# sourceMappingURL=chunk-BXDFYXZJ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-4YMKQ5D4.mjs 'use client' ; // src/tab-panels.tsx var TabPanels = forwardRef(function TabPanels2(props, ref) { const panelsProps = useTabPanels(props); const styles = useTabsStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...panelsProps, width: "100%", ref, className: cx("chakra-tabs__tab-panels", props.className), __css: styles.tabpanels } ); }); TabPanels.displayName = "TabPanels"; //# sourceMappingURL=chunk-4YMKQ5D4.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tabs/dist/chunk-KGTDXOFZ.mjs 'use client' ; // src/tab-panel.tsx var TabPanel = forwardRef(function TabPanel2(props, ref) { const panelProps = useTabPanel({ ...props, ref }); const styles = useTabsStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { outline: "0", ...panelProps, className: cx("chakra-tabs__tab-panel", props.className), __css: styles.tabpanel } ); }); TabPanel.displayName = "TabPanel"; //# sourceMappingURL=chunk-KGTDXOFZ.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/skeleton/dist/chunk-W7A7QDAK.mjs 'use client' ; // src/skeleton-circle.tsx var SkeletonCircle = ({ size = "2rem", ...rest }) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Skeleton, { borderRadius: "full", boxSize: size, ...rest }); SkeletonCircle.displayName = "SkeletonCircle"; //# sourceMappingURL=chunk-W7A7QDAK.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/skeleton/SettingsSkeleton.tsx var SettingsSkeleton = function SettingsSkeleton() { return /*#__PURE__*/external_React_default().createElement(Box, { m: "32px 24px" }, /*#__PURE__*/external_React_default().createElement(HStack, { gap: "0" }, /*#__PURE__*/external_React_default().createElement(Stack, { w: "30%", gap: "20px", py: "40px", border: "1px solid", borderColor: "gray.200", alignSelf: "stretch" }, Array.from({ length: 4 }).map(function (_, i) { return /*#__PURE__*/external_React_default().createElement(HStack, { key: i, p: "20px" }, /*#__PURE__*/external_React_default().createElement(SkeletonCircle, { size: "24px" }), /*#__PURE__*/external_React_default().createElement(SkeletonText, { noOfLines: 2, flex: "1" })); })), /*#__PURE__*/external_React_default().createElement(Stack, { w: "full", p: "40px 20px", border: "1px solid", borderColor: "gray.200", borderLeft: "none" }, Array.from({ length: 5 }).map(function (_, i) { return /*#__PURE__*/external_React_default().createElement(HStack, { key: i, p: "20px" }, /*#__PURE__*/external_React_default().createElement(Box, { flexBasis: "38%" }, /*#__PURE__*/external_React_default().createElement(Skeleton, { h: "24px", w: "200px", flexBasis: "38%" })), /*#__PURE__*/external_React_default().createElement(Box, { flexBasis: "60%" }, /*#__PURE__*/external_React_default().createElement(SkeletonText, { noOfLines: 2 }))); })))); }; /* harmony default export */ const skeleton_SettingsSkeleton = (SettingsSkeleton); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tooltip/dist/chunk-XRZH7COS.mjs 'use client' // src/tooltip.transition.tsx var chunk_XRZH7COS_scale = { exit: { scale: 0.85, opacity: 0, transition: { opacity: { duration: 0.15, easings: "easeInOut" }, scale: { duration: 0.2, easings: "easeInOut" } } }, enter: { scale: 1, opacity: 1, transition: { opacity: { easings: "easeOut", duration: 0.2 }, scale: { duration: 0.2, ease: [0.175, 0.885, 0.4, 1.1] } } } }; //# sourceMappingURL=chunk-XRZH7COS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/dom-utils/dist/chunk-4WEUWBTD.mjs // src/scroll.ts function chunk_4WEUWBTD_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 chunk_4WEUWBTD_getParent(el) { if (el.localName === "html") return el; return el.assignedSlot || el.parentElement || el.ownerDocument.documentElement; } function chunk_4WEUWBTD_getScrollParent(el) { if (["html", "body", "#document"].includes(el.localName)) { return el.ownerDocument.body; } if (chunk_3XANSPY5_isHTMLElement(el) && chunk_4WEUWBTD_isScrollParent(el)) { return el; } return chunk_4WEUWBTD_getScrollParent(chunk_4WEUWBTD_getParent(el)); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tooltip/dist/chunk-P7BNLW77.mjs 'use client' // src/use-tooltip.ts ; var getDoc = (ref) => { var _a; return ((_a = ref.current) == null ? void 0 : _a.ownerDocument) || document; }; var getWin = (ref) => { var _a, _b; return ((_b = (_a = ref.current) == null ? void 0 : _a.ownerDocument) == null ? void 0 : _b.defaultView) || window; }; function useTooltip(props = {}) { const { openDelay = 0, closeDelay = 0, closeOnClick = true, closeOnMouseDown, closeOnScroll, closeOnPointerDown = closeOnMouseDown, closeOnEsc = true, onOpen: onOpenProp, onClose: onCloseProp, placement, id, isOpen: isOpenProp, defaultIsOpen, arrowSize = 10, arrowShadowColor, arrowPadding, modifiers, isDisabled, gutter, offset, direction, ...htmlProps } = props; const { isOpen, onOpen, onClose } = dist_useDisclosure({ isOpen: isOpenProp, defaultIsOpen, onOpen: onOpenProp, onClose: onCloseProp }); const { referenceRef, getPopperProps, getArrowInnerProps, getArrowProps } = usePopper({ enabled: isOpen, placement, arrowPadding, modifiers, gutter, offset, direction }); const uuid = (0,external_React_.useId)(); const uid = id != null ? id : uuid; const tooltipId = `tooltip-${uid}`; const ref = (0,external_React_.useRef)(null); const enterTimeout = (0,external_React_.useRef)(); const clearEnterTimeout = (0,external_React_.useCallback)(() => { if (enterTimeout.current) { clearTimeout(enterTimeout.current); enterTimeout.current = void 0; } }, []); const exitTimeout = (0,external_React_.useRef)(); const clearExitTimeout = (0,external_React_.useCallback)(() => { if (exitTimeout.current) { clearTimeout(exitTimeout.current); exitTimeout.current = void 0; } }, []); const closeNow = (0,external_React_.useCallback)(() => { clearExitTimeout(); onClose(); }, [onClose, clearExitTimeout]); const dispatchCloseEvent = useCloseEvent(ref, closeNow); const openWithDelay = (0,external_React_.useCallback)(() => { if (!isDisabled && !enterTimeout.current) { if (isOpen) dispatchCloseEvent(); const win = getWin(ref); enterTimeout.current = win.setTimeout(onOpen, openDelay); } }, [dispatchCloseEvent, isDisabled, isOpen, onOpen, openDelay]); const closeWithDelay = (0,external_React_.useCallback)(() => { clearEnterTimeout(); const win = getWin(ref); exitTimeout.current = win.setTimeout(closeNow, closeDelay); }, [closeDelay, closeNow, clearEnterTimeout]); const onClick = (0,external_React_.useCallback)(() => { if (isOpen && closeOnClick) { closeWithDelay(); } }, [closeOnClick, closeWithDelay, isOpen]); const onPointerDown = (0,external_React_.useCallback)(() => { if (isOpen && closeOnPointerDown) { closeWithDelay(); } }, [closeOnPointerDown, closeWithDelay, isOpen]); const onKeyDown = (0,external_React_.useCallback)( (event) => { if (isOpen && event.key === "Escape") { closeWithDelay(); } }, [isOpen, closeWithDelay] ); dist_useEventListener( () => getDoc(ref), "keydown", closeOnEsc ? onKeyDown : void 0 ); dist_useEventListener( () => { if (!closeOnScroll) return null; const node = ref.current; if (!node) return null; const scrollParent = chunk_4WEUWBTD_getScrollParent(node); return scrollParent.localName === "body" ? getWin(ref) : scrollParent; }, "scroll", () => { if (isOpen && closeOnScroll) { closeNow(); } }, { passive: true, capture: true } ); (0,external_React_.useEffect)(() => { if (!isDisabled) return; clearEnterTimeout(); if (isOpen) onClose(); }, [isDisabled, isOpen, onClose, clearEnterTimeout]); (0,external_React_.useEffect)(() => { return () => { clearEnterTimeout(); clearExitTimeout(); }; }, [clearEnterTimeout, clearExitTimeout]); dist_useEventListener(() => ref.current, "pointerleave", closeWithDelay); const getTriggerProps = (0,external_React_.useCallback)( (props2 = {}, _ref = null) => { const triggerProps = { ...props2, ref: mergeRefs(ref, _ref, referenceRef), onPointerEnter: callAllHandlers(props2.onPointerEnter, (e) => { if (e.pointerType === "touch") return; openWithDelay(); }), onClick: callAllHandlers(props2.onClick, onClick), onPointerDown: callAllHandlers(props2.onPointerDown, onPointerDown), onFocus: callAllHandlers(props2.onFocus, openWithDelay), onBlur: callAllHandlers(props2.onBlur, closeWithDelay), "aria-describedby": isOpen ? tooltipId : void 0 }; return triggerProps; }, [ openWithDelay, closeWithDelay, onPointerDown, isOpen, tooltipId, onClick, referenceRef ] ); const getTooltipPositionerProps = (0,external_React_.useCallback)( (props2 = {}, forwardedRef = null) => getPopperProps( { ...props2, style: { ...props2.style, [cssVars.arrowSize.var]: arrowSize ? `${arrowSize}px` : void 0, [cssVars.arrowShadowColor.var]: arrowShadowColor } }, forwardedRef ), [getPopperProps, arrowSize, arrowShadowColor] ); const getTooltipProps = (0,external_React_.useCallback)( (props2 = {}, ref2 = null) => { const styles = { ...props2.style, position: "relative", transformOrigin: cssVars.transformOrigin.varRef }; return { ref: ref2, ...htmlProps, ...props2, id: tooltipId, role: "tooltip", style: styles }; }, [htmlProps, tooltipId] ); return { isOpen, show: openWithDelay, hide: closeWithDelay, getTriggerProps, getTooltipProps, getTooltipPositionerProps, getArrowProps, getArrowInnerProps }; } var closeEventName = "chakra-ui:close-tooltip"; function useCloseEvent(ref, close) { (0,external_React_.useEffect)(() => { const doc = getDoc(ref); doc.addEventListener(closeEventName, close); return () => doc.removeEventListener(closeEventName, close); }, [close, ref]); return () => { const doc = getDoc(ref); const win = getWin(ref); doc.dispatchEvent(new win.CustomEvent(closeEventName)); }; } //# sourceMappingURL=chunk-P7BNLW77.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/tooltip/dist/chunk-TK6VMDNP.mjs 'use client' ; // src/tooltip.tsx // ../../utilities/object-utils/src/omit.ts function chunk_TK6VMDNP_omit(object, keysToOmit = []) { const clone = Object.assign({}, object); for (const key of keysToOmit) { if (key in clone) { delete clone[key]; } } return clone; } // ../../utilities/object-utils/src/pick.ts function chunk_TK6VMDNP_pick(object, keysToPick) { const result = {}; for (const key of keysToPick) { if (key in object) { result[key] = object[key]; } } return result; } // src/tooltip.tsx var chunk_TK6VMDNP_MotionDiv = chakra(motion.div); var Tooltip = forwardRef((props, ref) => { var _a, _b; const styles = useStyleConfig("Tooltip", props); const ownProps = omitThemingProps(props); const theme = chunk_UIGT7YZF_useTheme(); const { children, label, shouldWrapChildren, "aria-label": ariaLabel, hasArrow, bg, portalProps, background, backgroundColor, bgColor, motionProps, ...rest } = ownProps; const userDefinedBg = (_b = (_a = background != null ? background : backgroundColor) != null ? _a : bg) != null ? _b : bgColor; if (userDefinedBg) { styles.bg = userDefinedBg; const bgVar = dist_getCSSVar(theme, "colors", userDefinedBg); styles[cssVars.arrowBg.var] = bgVar; } const tooltip = useTooltip({ ...rest, direction: theme.direction }); const shouldWrap = typeof children === "string" || shouldWrapChildren; let trigger; if (shouldWrap) { trigger = /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.span, { display: "inline-block", tabIndex: 0, ...tooltip.getTriggerProps(), children } ); } else { const child = external_React_.Children.only(children); trigger = (0,external_React_.cloneElement)( child, tooltip.getTriggerProps(child.props, child.ref) ); } const hasAriaLabel = !!ariaLabel; const _tooltipProps = tooltip.getTooltipProps({}, ref); const tooltipProps = hasAriaLabel ? chunk_TK6VMDNP_omit(_tooltipProps, ["role", "id"]) : _tooltipProps; const srOnlyProps = chunk_TK6VMDNP_pick(_tooltipProps, ["role", "id"]); if (!label) { return /* @__PURE__ */ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { children }); } return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ trigger, /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { children: tooltip.isOpen && /* @__PURE__ */ (0,jsx_runtime.jsx)(Portal, { ...portalProps, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...tooltip.getTooltipPositionerProps(), __css: { zIndex: styles.zIndex, pointerEvents: "none" }, children: /* @__PURE__ */ (0,jsx_runtime.jsxs)( chunk_TK6VMDNP_MotionDiv, { variants: chunk_XRZH7COS_scale, initial: "exit", animate: "enter", exit: "exit", ...motionProps, ...tooltipProps, __css: styles, children: [ label, hasAriaLabel && /* @__PURE__ */ (0,jsx_runtime.jsx)(chakra.span, { srOnly: true, ...srOnlyProps, children: ariaLabel }), hasArrow && /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { "data-popper-arrow": true, className: "chakra-tooltip__arrow-wrapper", children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { "data-popper-arrow-inner": true, className: "chakra-tooltip__arrow", __css: { bg: styles.bg } } ) } ) ] } ) } ) }) }) ] }); }); Tooltip.displayName = "Tooltip"; //# sourceMappingURL=chunk-TK6VMDNP.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/FormTwoColumn.tsx var FormTwoColumn = function FormTwoColumn(_ref) { var label = _ref.label, children = _ref.children, description = _ref.description, labelAlignStart = _ref.labelAlignStart; return /*#__PURE__*/external_React_default().createElement(HStack, { justify: "space-between" }, /*#__PURE__*/external_React_default().createElement(FormLabel, { fontSize: "14px", fontWeight: "semibold", color: "gray.700", flexBasis: "38%", display: "flex", alignItems: "center", gap: "2", alignSelf: labelAlignStart ? 'flex-start' : undefined, my: "1" }, label, description && /*#__PURE__*/external_React_default().createElement(Tooltip, { label: description, fontSize: "xs", hasArrow: true, placement: "top" }, /*#__PURE__*/external_React_default().createElement(QuestionCircleFill, { w: "4", h: "4", fill: "gray.500" }))), /*#__PURE__*/external_React_default().createElement(Box, { flexBasis: "60%" }, children)); }; /* harmony default export */ const components_FormTwoColumn = (FormTwoColumn); ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/AssetGeneration.tsx var AssetGeneration = function AssetGeneration(props) { var _props$data; var toast = useToast(); var regenerateAssets = (0,react_query_es.useMutation)(function () { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/regenerate-assets", method: "POST" }); }, { onSuccess: function onSuccess() { toast({ status: "success", description: (0,external_wp_i18n_namespaceObject.__)("Assets regenerated", "magazine-blocks"), isClosable: true }); }, onError: function onError(e) { toast({ status: "error", description: e.message, isClosable: true }); } }); var _useFormContext = useFormContext(), register = _useFormContext.register; return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Asset Generation", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "#FAFAFC", border: "1px", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("File Generation", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)("Magazine Blocks typically embeds dynamic assets (CSS/JS) directly within the page. You can opt to enable this feature for loading dynamic assets (CSS/JS) externally from a file.", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(Switch, helpers_esm_extends_extends({}, register("asset-generation.external-file"), { defaultChecked: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data["external-file"], colorScheme: "primary" }))), /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Asset Generation", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)("To resolve any issues related to block styles, regenerate the assets.", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(Button, { fontSize: "xs", colorScheme: "primary", variant: "outline", borderRadius: "base", isLoading: regenerateAssets.isLoading, onClick: function onClick() { return regenerateAssets.mutate(); } }, (0,external_wp_i18n_namespaceObject.__)("Regenerate Asset Files and Data", "magazine-blocks")))))); }; /* harmony default export */ const components_AssetGeneration = (AssetGeneration); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-input/dist/chunk-KWODBCCW.mjs 'use client' // src/icons.tsx ; var TriangleDownIcon = (props) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( "path", { fill: "currentColor", d: "M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z" } ) }); var TriangleUpIcon = (props) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Icon, { viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( "path", { fill: "currentColor", d: "M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z" } ) }); //# sourceMappingURL=chunk-KWODBCCW.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-input/dist/chunk-2PMVP26D.mjs 'use client' // src/use-attr-observer.ts ; function useAttributeObserver(ref, attributes, fn, enabled) { (0,external_React_.useEffect)(() => { var _a; if (!ref.current || !enabled) return; const win = (_a = ref.current.ownerDocument.defaultView) != null ? _a : window; const attrs = Array.isArray(attributes) ? attributes : [attributes]; const obs = new win.MutationObserver((changes) => { for (const change of changes) { if (change.type === "attributes" && change.attributeName && attrs.includes(change.attributeName)) { fn(change); } } }); obs.observe(ref.current, { attributes: true, attributeFilter: attrs }); return () => obs.disconnect(); }); } //# sourceMappingURL=chunk-2PMVP26D.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/react-use-interval/dist/index.mjs 'use client' // src/index.ts ; function useInterval(callback, delay) { const fn = dist_useCallbackRef(callback); (0,external_React_.useEffect)(() => { let intervalId = null; const tick = () => fn(); if (delay !== null) { intervalId = window.setInterval(tick, delay); } return () => { if (intervalId) { window.clearInterval(intervalId); } }; }, [delay, fn]); } //# sourceMappingURL=index.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-input/dist/chunk-366L2ZDN.mjs 'use client' // src/use-spinner.ts ; var CONTINUOUS_CHANGE_INTERVAL = 50; var CONTINUOUS_CHANGE_DELAY = 300; function useSpinner(increment, decrement) { const [isSpinning, setIsSpinning] = (0,external_React_.useState)(false); const [action, setAction] = (0,external_React_.useState)(null); const [runOnce, setRunOnce] = (0,external_React_.useState)(true); const timeoutRef = (0,external_React_.useRef)(null); const removeTimeout = () => clearTimeout(timeoutRef.current); useInterval( () => { if (action === "increment") { increment(); } if (action === "decrement") { decrement(); } }, isSpinning ? CONTINUOUS_CHANGE_INTERVAL : null ); const up = (0,external_React_.useCallback)(() => { if (runOnce) { increment(); } timeoutRef.current = setTimeout(() => { setRunOnce(false); setIsSpinning(true); setAction("increment"); }, CONTINUOUS_CHANGE_DELAY); }, [increment, runOnce]); const down = (0,external_React_.useCallback)(() => { if (runOnce) { decrement(); } timeoutRef.current = setTimeout(() => { setRunOnce(false); setIsSpinning(true); setAction("decrement"); }, CONTINUOUS_CHANGE_DELAY); }, [decrement, runOnce]); const stop = (0,external_React_.useCallback)(() => { setRunOnce(true); setIsSpinning(false); removeTimeout(); }, []); (0,external_React_.useEffect)(() => { return () => removeTimeout(); }, []); return { up, down, stop, isSpinning }; } //# sourceMappingURL=chunk-366L2ZDN.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-utils/dist/index.mjs // src/index.ts 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 != null ? 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, min, max) { return (value - min) * 100 / (max - min); } function percentToValue(percent, min, max) { return (max - min) * percent + min; } function roundValueToStep(value, from, step) { const nextValue = Math.round((value - from) / step) * step + from; const precision = countDecimalPlaces(step); return toPrecision(nextValue, precision); } function clampValue(value, min, max) { if (value == null) return value; if (max < min) { console.warn("clamp: max cannot be less than min"); } return Math.min(Math.max(value, min), max); } ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/counter/dist/chunk-AB3TPYVS.mjs 'use client' // src/use-counter.ts ; function useCounter(props = {}) { const { onChange, precision: precisionProp, defaultValue, value: valueProp, step: stepProp = 1, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, keepWithinRange = true } = props; const onChangeProp = dist_useCallbackRef(onChange); const [valueState, setValue] = (0,external_React_.useState)(() => { var _a; if (defaultValue == null) return ""; return (_a = chunk_AB3TPYVS_cast(defaultValue, stepProp, precisionProp)) != null ? _a : ""; }); const isControlled = typeof valueProp !== "undefined"; const value = isControlled ? valueProp : valueState; const decimalPlaces = getDecimalPlaces(chunk_AB3TPYVS_parse(value), stepProp); const precision = precisionProp != null ? precisionProp : decimalPlaces; const update = (0,external_React_.useCallback)( (next) => { if (next === value) return; if (!isControlled) { setValue(next.toString()); } onChangeProp == null ? void 0 : onChangeProp(next.toString(), chunk_AB3TPYVS_parse(next)); }, [onChangeProp, isControlled, value] ); const clamp = (0,external_React_.useCallback)( (value2) => { let nextValue = value2; if (keepWithinRange) { nextValue = clampValue(nextValue, min, max); } return toPrecision(nextValue, precision); }, [precision, keepWithinRange, max, min] ); const increment = (0,external_React_.useCallback)( (step = stepProp) => { let next; if (value === "") { next = chunk_AB3TPYVS_parse(step); } else { next = chunk_AB3TPYVS_parse(value) + step; } next = clamp(next); update(next); }, [clamp, stepProp, update, value] ); const decrement = (0,external_React_.useCallback)( (step = stepProp) => { let next; if (value === "") { next = chunk_AB3TPYVS_parse(-step); } else { next = chunk_AB3TPYVS_parse(value) - step; } next = clamp(next); update(next); }, [clamp, stepProp, update, value] ); const reset = (0,external_React_.useCallback)(() => { var _a; let next; if (defaultValue == null) { next = ""; } else { next = (_a = chunk_AB3TPYVS_cast(defaultValue, stepProp, precisionProp)) != null ? _a : min; } update(next); }, [defaultValue, precisionProp, stepProp, update, min]); const castValue = (0,external_React_.useCallback)( (value2) => { var _a; const nextValue = (_a = chunk_AB3TPYVS_cast(value2, stepProp, precision)) != null ? _a : min; update(nextValue); }, [precision, stepProp, update, min] ); const valueAsNumber = chunk_AB3TPYVS_parse(value); const isOutOfRange = valueAsNumber > max || valueAsNumber < min; const isAtMax = valueAsNumber === max; const isAtMin = valueAsNumber === min; return { isOutOfRange, isAtMax, isAtMin, precision, value, valueAsNumber, update, reset, increment, decrement, clamp, cast: castValue, setValue }; } function chunk_AB3TPYVS_parse(value) { return parseFloat(value.toString().replace(/[^\w.-]+/g, "")); } function getDecimalPlaces(value, step) { return Math.max(countDecimalPlaces(step), countDecimalPlaces(value)); } function chunk_AB3TPYVS_cast(value, step, precision) { const parsedValue = chunk_AB3TPYVS_parse(value); if (Number.isNaN(parsedValue)) return void 0; const decimalPlaces = getDecimalPlaces(parsedValue, step); return toPrecision(parsedValue, precision != null ? precision : decimalPlaces); } //# sourceMappingURL=chunk-AB3TPYVS.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-input/dist/chunk-4ZJMWFQT.mjs 'use client' ; // src/use-number-input.ts var FLOATING_POINT_REGEX = /^[Ee0-9+\-.]$/; function isFloatingPointNumericCharacter(character) { return FLOATING_POINT_REGEX.test(character); } function isValidNumericKeyboardEvent(event, isValid) { if (event.key == null) return true; const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; const isSingleCharacterKey = event.key.length === 1; if (!isSingleCharacterKey || isModifierKey) return true; return isValid(event.key); } function useNumberInput(props = {}) { const { focusInputOnChange = true, clampValueOnBlur = true, keepWithinRange = true, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, step: stepProp = 1, isReadOnly, isDisabled, isRequired, isInvalid, pattern = "[0-9]*(.[0-9]+)?", inputMode = "decimal", allowMouseWheel, id, onChange: _, precision, name, "aria-describedby": ariaDescBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onFocus: onFocusProp, onBlur: onBlurProp, onInvalid: onInvalidProp, getAriaValueText: getAriaValueTextProp, isValidCharacter: isValidCharacterProp, format: formatValue, parse: parseValue, ...htmlProps } = props; const onFocus = dist_useCallbackRef(onFocusProp); const onBlur = dist_useCallbackRef(onBlurProp); const onInvalid = dist_useCallbackRef(onInvalidProp); const isValidCharacter = dist_useCallbackRef( isValidCharacterProp != null ? isValidCharacterProp : isFloatingPointNumericCharacter ); const getAriaValueText = dist_useCallbackRef(getAriaValueTextProp); const counter = useCounter(props); const { update: updateFn, increment: incrementFn, decrement: decrementFn } = counter; const [isFocused, setFocused] = (0,external_React_.useState)(false); const isInteractive = !(isReadOnly || isDisabled); const inputRef = (0,external_React_.useRef)(null); const inputSelectionRef = (0,external_React_.useRef)(null); const incrementButtonRef = (0,external_React_.useRef)(null); const decrementButtonRef = (0,external_React_.useRef)(null); const sanitize = (0,external_React_.useCallback)( (value) => value.split("").filter(isValidCharacter).join(""), [isValidCharacter] ); const parse = (0,external_React_.useCallback)( (value) => { var _a; return (_a = parseValue == null ? void 0 : parseValue(value)) != null ? _a : value; }, [parseValue] ); const format = (0,external_React_.useCallback)( (value) => { var _a; return ((_a = formatValue == null ? void 0 : formatValue(value)) != null ? _a : value).toString(); }, [formatValue] ); dist_useUpdateEffect(() => { if (counter.valueAsNumber > max) { onInvalid == null ? void 0 : onInvalid("rangeOverflow", format(counter.value), counter.valueAsNumber); } else if (counter.valueAsNumber < min) { onInvalid == null ? void 0 : onInvalid("rangeOverflow", format(counter.value), counter.valueAsNumber); } }, [counter.valueAsNumber, counter.value, format, onInvalid]); dist_useSafeLayoutEffect(() => { if (!inputRef.current) return; const notInSync = inputRef.current.value != counter.value; if (notInSync) { const parsedInput = parse(inputRef.current.value); counter.setValue(sanitize(parsedInput)); } }, [parse, sanitize]); const increment = (0,external_React_.useCallback)( (step = stepProp) => { if (isInteractive) { incrementFn(step); } }, [incrementFn, isInteractive, stepProp] ); const decrement = (0,external_React_.useCallback)( (step = stepProp) => { if (isInteractive) { decrementFn(step); } }, [decrementFn, isInteractive, stepProp] ); const spinner = useSpinner(increment, decrement); useAttributeObserver( incrementButtonRef, "disabled", spinner.stop, spinner.isSpinning ); useAttributeObserver( decrementButtonRef, "disabled", spinner.stop, spinner.isSpinning ); const onChange = (0,external_React_.useCallback)( (event) => { const evt = event.nativeEvent; if (evt.isComposing) return; const parsedInput = parse(event.currentTarget.value); updateFn(sanitize(parsedInput)); inputSelectionRef.current = { start: event.currentTarget.selectionStart, end: event.currentTarget.selectionEnd }; }, [updateFn, sanitize, parse] ); const _onFocus = (0,external_React_.useCallback)( (event) => { var _a, _b, _c; onFocus == null ? void 0 : onFocus(event); if (!inputSelectionRef.current) return; event.target.selectionStart = (_b = inputSelectionRef.current.start) != null ? _b : (_a = event.currentTarget.value) == null ? void 0 : _a.length; event.currentTarget.selectionEnd = (_c = inputSelectionRef.current.end) != null ? _c : event.currentTarget.selectionStart; }, [onFocus] ); const onKeyDown = (0,external_React_.useCallback)( (event) => { if (event.nativeEvent.isComposing) return; if (!isValidNumericKeyboardEvent(event, isValidCharacter)) { event.preventDefault(); } const stepFactor = getStepFactor(event) * stepProp; const eventKey = event.key; const keyMap = { ArrowUp: () => increment(stepFactor), ArrowDown: () => decrement(stepFactor), Home: () => updateFn(min), End: () => updateFn(max) }; const action = keyMap[eventKey]; if (action) { event.preventDefault(); action(event); } }, [isValidCharacter, stepProp, increment, decrement, updateFn, min, max] ); const getStepFactor = (event) => { let ratio = 1; if (event.metaKey || event.ctrlKey) { ratio = 0.1; } if (event.shiftKey) { ratio = 10; } return ratio; }; const ariaValueText = (0,external_React_.useMemo)(() => { const text = getAriaValueText == null ? void 0 : getAriaValueText(counter.value); if (text != null) return text; const defaultText = counter.value.toString(); return !defaultText ? void 0 : defaultText; }, [counter.value, getAriaValueText]); const validateAndClamp = (0,external_React_.useCallback)(() => { let next = counter.value; if (counter.value === "") return; const valueStartsWithE = /^[eE]/.test(counter.value.toString()); if (valueStartsWithE) { counter.setValue(""); } else { if (counter.valueAsNumber < min) { next = min; } if (counter.valueAsNumber > max) { next = max; } counter.cast(next); } }, [counter, max, min]); const onInputBlur = (0,external_React_.useCallback)(() => { setFocused(false); if (clampValueOnBlur) { validateAndClamp(); } }, [clampValueOnBlur, setFocused, validateAndClamp]); const focusInput = (0,external_React_.useCallback)(() => { if (focusInputOnChange) { requestAnimationFrame(() => { var _a; (_a = inputRef.current) == null ? void 0 : _a.focus(); }); } }, [focusInputOnChange]); const spinUp = (0,external_React_.useCallback)( (event) => { event.preventDefault(); spinner.up(); focusInput(); }, [focusInput, spinner] ); const spinDown = (0,external_React_.useCallback)( (event) => { event.preventDefault(); spinner.down(); focusInput(); }, [focusInput, spinner] ); dist_useEventListener( () => inputRef.current, "wheel", (event) => { var _a, _b; const doc = (_b = (_a = inputRef.current) == null ? void 0 : _a.ownerDocument) != null ? _b : document; const isInputFocused = doc.activeElement === inputRef.current; if (!allowMouseWheel || !isInputFocused) return; event.preventDefault(); const stepFactor = getStepFactor(event) * stepProp; const direction = Math.sign(event.deltaY); if (direction === -1) { increment(stepFactor); } else if (direction === 1) { decrement(stepFactor); } }, { passive: false } ); const getIncrementButtonProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => { const disabled = isDisabled || keepWithinRange && counter.isAtMax; return { ...props2, ref: mergeRefs(ref, incrementButtonRef), role: "button", tabIndex: -1, onPointerDown: callAllHandlers(props2.onPointerDown, (event) => { if (event.button !== 0 || disabled) return; spinUp(event); }), onPointerLeave: callAllHandlers(props2.onPointerLeave, spinner.stop), onPointerUp: callAllHandlers(props2.onPointerUp, spinner.stop), disabled, "aria-disabled": ariaAttr(disabled) }; }, [counter.isAtMax, keepWithinRange, spinUp, spinner.stop, isDisabled] ); const getDecrementButtonProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => { const disabled = isDisabled || keepWithinRange && counter.isAtMin; return { ...props2, ref: mergeRefs(ref, decrementButtonRef), role: "button", tabIndex: -1, onPointerDown: callAllHandlers(props2.onPointerDown, (event) => { if (event.button !== 0 || disabled) return; spinDown(event); }), onPointerLeave: callAllHandlers(props2.onPointerLeave, spinner.stop), onPointerUp: callAllHandlers(props2.onPointerUp, spinner.stop), disabled, "aria-disabled": ariaAttr(disabled) }; }, [counter.isAtMin, keepWithinRange, spinDown, spinner.stop, isDisabled] ); const getInputProps = (0,external_React_.useCallback)( (props2 = {}, ref = null) => { var _a, _b, _c, _d; return { name, inputMode, type: "text", pattern, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, "aria-describedby": ariaDescBy, id, disabled: isDisabled, ...props2, readOnly: (_a = props2.readOnly) != null ? _a : isReadOnly, "aria-readonly": (_b = props2.readOnly) != null ? _b : isReadOnly, "aria-required": (_c = props2.required) != null ? _c : isRequired, required: (_d = props2.required) != null ? _d : isRequired, ref: mergeRefs(inputRef, ref), value: format(counter.value), role: "spinbutton", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": Number.isNaN(counter.valueAsNumber) ? void 0 : counter.valueAsNumber, "aria-invalid": ariaAttr(isInvalid != null ? isInvalid : counter.isOutOfRange), "aria-valuetext": ariaValueText, autoComplete: "off", autoCorrect: "off", onChange: callAllHandlers(props2.onChange, onChange), onKeyDown: callAllHandlers(props2.onKeyDown, onKeyDown), onFocus: callAllHandlers( props2.onFocus, _onFocus, () => setFocused(true) ), onBlur: callAllHandlers(props2.onBlur, onBlur, onInputBlur) }; }, [ name, inputMode, pattern, ariaLabelledBy, ariaLabel, format, ariaDescBy, id, isDisabled, isRequired, isReadOnly, isInvalid, counter.value, counter.valueAsNumber, counter.isOutOfRange, min, max, ariaValueText, onChange, onKeyDown, _onFocus, onBlur, onInputBlur ] ); return { value: format(counter.value), valueAsNumber: counter.valueAsNumber, isFocused, isDisabled, isReadOnly, getIncrementButtonProps, getDecrementButtonProps, getInputProps, htmlProps }; } //# sourceMappingURL=chunk-4ZJMWFQT.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/number-input/dist/chunk-2JJX6TVY.mjs 'use client' ; // src/number-input.tsx var [NumberInputStylesProvider, useNumberInputStyles] = createContext({ name: `NumberInputStylesContext`, errorMessage: `useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" ` }); var [NumberInputProvider, useNumberInputContext] = createContext({ name: "NumberInputContext", errorMessage: "useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />" }); var NumberInput = forwardRef( function NumberInput2(props, ref) { const styles = useMultiStyleConfig("NumberInput", props); const ownProps = omitThemingProps(props); const controlProps = useFormControlProps(ownProps); const { htmlProps, ...context } = useNumberInput(controlProps); const ctx = (0,external_React_.useMemo)(() => context, [context]); return /* @__PURE__ */ (0,jsx_runtime.jsx)(NumberInputProvider, { value: ctx, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(NumberInputStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...htmlProps, ref, className: cx("chakra-numberinput", props.className), __css: { position: "relative", zIndex: 0, ...styles.root } } ) }) }); } ); NumberInput.displayName = "NumberInput"; var NumberInputStepper = forwardRef( function NumberInputStepper2(props, ref) { const styles = useNumberInputStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { "aria-hidden": true, ref, ...props, __css: { display: "flex", flexDirection: "column", position: "absolute", top: "0", insetEnd: "0px", margin: "1px", height: "calc(100% - 2px)", zIndex: 1, ...styles.stepperGroup } } ); } ); NumberInputStepper.displayName = "NumberInputStepper"; var NumberInputField = forwardRef( function NumberInputField2(props, ref) { const { getInputProps } = useNumberInputContext(); const input = getInputProps(props, ref); const styles = useNumberInputStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.input, { ...input, className: cx("chakra-numberinput__field", props.className), __css: { width: "100%", ...styles.field } } ); } ); NumberInputField.displayName = "NumberInputField"; var StyledStepper = chakra("div", { baseStyle: { display: "flex", justifyContent: "center", alignItems: "center", flex: 1, transitionProperty: "common", transitionDuration: "normal", userSelect: "none", cursor: "pointer", lineHeight: "normal" } }); var NumberDecrementStepper = forwardRef(function NumberDecrementStepper2(props, ref) { var _a; const styles = useNumberInputStyles(); const { getDecrementButtonProps } = useNumberInputContext(); const decrement = getDecrementButtonProps(props, ref); return /* @__PURE__ */ (0,jsx_runtime.jsx)(StyledStepper, { ...decrement, __css: styles.stepper, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0,jsx_runtime.jsx)(TriangleDownIcon, {}) }); }); NumberDecrementStepper.displayName = "NumberDecrementStepper"; var NumberIncrementStepper = forwardRef(function NumberIncrementStepper2(props, ref) { var _a; const { getIncrementButtonProps } = useNumberInputContext(); const increment = getIncrementButtonProps(props, ref); const styles = useNumberInputStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)(StyledStepper, { ...increment, __css: styles.stepper, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0,jsx_runtime.jsx)(TriangleUpIcon, {}) }); }); NumberIncrementStepper.displayName = "NumberIncrementStepper"; //# sourceMappingURL=chunk-2JJX6TVY.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/input/dist/chunk-ADBZ7YHX.mjs 'use client' ; // src/input-addon.tsx 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 = forwardRef( function InputAddon2(props, ref) { var _a; const { placement = "left", ...rest } = props; const placementStyles = (_a = placements[placement]) != null ? _a : {}; const styles = useInputGroupStyles(); return /* @__PURE__ */ (0,jsx_runtime.jsx)( StyledAddon, { ref, ...rest, __css: { ...styles.addon, ...placementStyles } } ); } ); InputAddon.displayName = "InputAddon"; var InputLeftAddon = forwardRef( function InputLeftAddon2(props, ref) { return /* @__PURE__ */ (0,jsx_runtime.jsx)( InputAddon, { ref, placement: "left", ...props, className: cx("chakra-input__left-addon", props.className) } ); } ); InputLeftAddon.displayName = "InputLeftAddon"; InputLeftAddon.id = "InputLeftAddon"; var InputRightAddon = forwardRef( function InputRightAddon2(props, ref) { return /* @__PURE__ */ (0,jsx_runtime.jsx)( InputAddon, { ref, placement: "right", ...props, className: cx("chakra-input__right-addon", props.className) } ); } ); InputRightAddon.displayName = "InputRightAddon"; InputRightAddon.id = "InputRightAddon"; //# sourceMappingURL=chunk-ADBZ7YHX.mjs.map ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/EditorOptions.tsx var EditorOptions = function EditorOptions(props) { var _props$data, _props$data2, _props$data3, _props$data4; var _useFormContext = useFormContext(), control = _useFormContext.control, register = _useFormContext.register; return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Editor Options", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "primary.50", py: "4", px: "5", border: "1px solid", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(Controller, { name: "editor.section-width", control: control, defaultValue: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data["section-width"], render: function render(_ref) { var _ref$field = _ref.field, onChange = _ref$field.onChange, value = _ref$field.value; return /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Default Section Width", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)("Default section block content width", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(InputGroup, null, /*#__PURE__*/external_React_default().createElement(NumberInput, { defaultValue: value, flex: 1, step: 1, min: 0, onChange: onChange }, /*#__PURE__*/external_React_default().createElement(NumberInputField, { color: "gray.500 !important", borderTopRightRadius: "0 !important", borderBottomRightRadius: "0 !important", borderColor: "gray.200 !important" })), /*#__PURE__*/external_React_default().createElement(InputRightAddon, { color: "gray.400", fontWeight: "medium", bgColor: "white" }, "px"))); } }), /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Responsive Breakpoints", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)("Manage responsive breakpoints to suit your website's needs.", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(HStack, null, /*#__PURE__*/external_React_default().createElement(Controller, { control: control, name: "editor.responsive-breakpoints.tablet", defaultValue: (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2["responsive-breakpoints"].tablet, render: function render(_ref2) { var _ref2$field = _ref2.field, onChange = _ref2$field.onChange, value = _ref2$field.value; return /*#__PURE__*/external_React_default().createElement(Tooltip, { label: (0,external_wp_i18n_namespaceObject.__)("Tablet", "magazine-blocks"), placement: "top", hasArrow: true }, /*#__PURE__*/external_React_default().createElement(InputGroup, null, /*#__PURE__*/external_React_default().createElement(NumberInput, { defaultValue: value, flex: 1, step: 1, min: 0, onChange: onChange }, /*#__PURE__*/external_React_default().createElement(NumberInputField, { color: "gray.500 !important", borderTopRightRadius: "0 !important", borderBottomRightRadius: "0 !important", borderColor: "gray.200 !important" })), /*#__PURE__*/external_React_default().createElement(InputRightAddon, { color: "gray.400", fontWeight: "medium", bgColor: "white" }, "px"))); } }), /*#__PURE__*/external_React_default().createElement(Controller, { control: control, name: "editor.responsive-breakpoints.mobile", defaultValue: (_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : _props$data3["responsive-breakpoints"].mobile, render: function render(_ref3) { var _ref3$field = _ref3.field, onChange = _ref3$field.onChange, value = _ref3$field.value; return /*#__PURE__*/external_React_default().createElement(Tooltip, { label: (0,external_wp_i18n_namespaceObject.__)("Mobile", "magazine-blocks"), placement: "top", hasArrow: true }, /*#__PURE__*/external_React_default().createElement(InputGroup, null, /*#__PURE__*/external_React_default().createElement(NumberInput, { defaultValue: value, flex: 1, step: 1, min: 0, onChange: onChange }, /*#__PURE__*/external_React_default().createElement(NumberInputField, { color: "gray.500 !important", borderTopRightRadius: "0 !important", borderBottomRightRadius: "0 !important", borderColor: "gray.200 !important" })), /*#__PURE__*/external_React_default().createElement(InputRightAddon, { color: "gray.400", fontWeight: "medium", bgColor: "white" }, "px"))); } }))), /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Copy Paste Styles", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)("Enable copy-paste style option in block controls to copy and apply Magazine Blocks block styles.", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(Switch, helpers_esm_extends_extends({}, register("editor.copy-paste-styles", { value: (_props$data4 = props.data) === null || _props$data4 === void 0 ? void 0 : _props$data4["copy-paste-styles"] }), { colorScheme: "primary" })))))); }; /* harmony default export */ const components_EditorOptions = (EditorOptions); ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/Integrations.tsx var Integrations = function Integrations(props) { var _props$data, _props$data2; var _useFormContext = useFormContext(), register = _useFormContext.register; return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Integrations", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "#FAFAFC", border: "1px", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("News Ticker Embed API Key", "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Stack, null, /*#__PURE__*/external_React_default().createElement(Input, helpers_esm_extends_extends({}, register("integrations.dateWeatherApiKey", { value: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data["dateWeatherApiKey"] }), { borderRadius: "base" }))))), /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("News Ticker Zip Code", "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Stack, null, /*#__PURE__*/external_React_default().createElement(Input, helpers_esm_extends_extends({}, register("integrations.dateWeatherZipCode", { value: (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2["dateWeatherZipCode"] }), { borderRadius: "base" }))))))); }; /* harmony default export */ const components_Integrations = (Integrations); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/transition/dist/chunk-RKXMPHPI.mjs 'use client' ; // src/collapse.tsx var chunk_RKXMPHPI_isNumeric = (value) => value != null && parseInt(value.toString(), 10) > 0; var chunk_RKXMPHPI_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 chunk_RKXMPHPI_variants = { exit: ({ animateOpacity, startingHeight, transition, transitionEnd, delay }) => { var _a; return { ...animateOpacity && { opacity: chunk_RKXMPHPI_isNumeric(startingHeight) ? 1 : 0 }, height: startingHeight, transitionEnd: transitionEnd == null ? void 0 : transitionEnd.exit, transition: (_a = transition == null ? void 0 : transition.exit) != null ? _a : withDelay.exit(chunk_RKXMPHPI_defaultTransitions.exit, delay) }; }, enter: ({ animateOpacity, endingHeight, transition, transitionEnd, delay }) => { var _a; return { ...animateOpacity && { opacity: 1 }, height: endingHeight, transitionEnd: transitionEnd == null ? void 0 : transitionEnd.enter, transition: (_a = transition == null ? void 0 : transition.enter) != null ? _a : withDelay.enter(chunk_RKXMPHPI_defaultTransitions.enter, delay) }; } }; var Collapse = (0,external_React_.forwardRef)( (props, ref) => { const { in: isOpen, unmountOnExit, animateOpacity = true, startingHeight = 0, endingHeight = "auto", style, className, transition, transitionEnd, ...rest } = props; const [mounted, setMounted] = (0,external_React_.useState)(false); (0,external_React_.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 } } : transition, 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 animate = isOpen || unmountOnExit ? "enter" : "exit"; return /* @__PURE__ */ (0,jsx_runtime.jsx)(AnimatePresence, { initial: false, custom, children: show && /* @__PURE__ */ (0,jsx_runtime.jsx)( motion.div, { ref, ...rest, className: cx("chakra-collapse", className), style: { overflow: "hidden", display: "block", ...style }, custom, variants: chunk_RKXMPHPI_variants, initial: unmountOnExit ? "exit" : false, animate, exit: "exit" } ) }); } ); Collapse.displayName = "Collapse"; //# sourceMappingURL=chunk-RKXMPHPI.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/form-control/dist/chunk-VGESXGVT.mjs 'use client' ; // src/form-error.tsx var [FormErrorStylesProvider, useFormErrorStyles] = createContext({ name: `FormErrorStylesContext`, errorMessage: `useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" ` }); var FormErrorMessage = forwardRef( (props, ref) => { const styles = useMultiStyleConfig("FormError", props); const ownProps = omitThemingProps(props); const field = useFormControlContext(); if (!(field == null ? void 0 : field.isInvalid)) return null; return /* @__PURE__ */ (0,jsx_runtime.jsx)(FormErrorStylesProvider, { value: styles, children: /* @__PURE__ */ (0,jsx_runtime.jsx)( chakra.div, { ...field == null ? void 0 : field.getErrorMessageProps(ownProps, ref), className: cx("chakra-form__error-message", props.className), __css: { display: "flex", alignItems: "center", ...styles.text } } ) }); } ); FormErrorMessage.displayName = "FormErrorMessage"; var FormErrorIcon = forwardRef((props, ref) => { const styles = useFormErrorStyles(); const field = useFormControlContext(); if (!(field == null ? void 0 : field.isInvalid)) return null; const _className = cx("chakra-form__error-icon", props.className); return /* @__PURE__ */ (0,jsx_runtime.jsx)( Icon, { ref, "aria-hidden": true, ...props, __css: styles.icon, className: _className, children: /* @__PURE__ */ (0,jsx_runtime.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"; //# sourceMappingURL=chunk-VGESXGVT.mjs.map ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/extends.js function runtime_helpers_esm_extends_extends() { runtime_helpers_esm_extends_extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return runtime_helpers_esm_extends_extends.apply(this, arguments); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/typeof.js function esm_typeof_typeof(o) { "@babel/helpers - typeof"; return esm_typeof_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, esm_typeof_typeof(o); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/toPrimitive.js function esm_toPrimitive_toPrimitive(input, hint) { if (esm_typeof_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (esm_typeof_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js function esm_toPropertyKey_toPropertyKey(arg) { var key = esm_toPrimitive_toPrimitive(arg, "string"); return esm_typeof_typeof(key) === "symbol" ? key : String(key); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/defineProperty.js function esm_defineProperty_defineProperty(obj, key, value) { key = esm_toPropertyKey_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/objectSpread2.js function objectSpread2_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function objectSpread2_objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? objectSpread2_ownKeys(Object(t), !0).forEach(function (r) { esm_defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : objectSpread2_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/classCallCheck.js function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/createClass.js function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, esm_toPropertyKey_toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function setPrototypeOf_setPrototypeOf(o, p) { setPrototypeOf_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return setPrototypeOf_setPrototypeOf(o, p); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/inherits.js function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) setPrototypeOf_setPrototypeOf(subClass, superClass); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js function _possibleConstructorReturn(self, call) { if (call && (esm_typeof_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/createSuper.js function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js function arrayLikeToArray_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return arrayLikeToArray_arrayLikeToArray(arr); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/iterableToArray.js function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || unsupportedIterableToArray_unsupportedIterableToArray(arr) || _nonIterableSpread(); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js function arrayWithHoles_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function iterableToArrayLimit_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js function nonIterableRest_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/slicedToArray.js function slicedToArray_slicedToArray(arr, i) { return arrayWithHoles_arrayWithHoles(arr) || iterableToArrayLimit_iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || nonIterableRest_nonIterableRest(); } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js function esm_objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = esm_objectWithoutPropertiesLoose_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } ;// CONCATENATED MODULE: ./node_modules/react-select/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs const sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); const min = Math.min; const max = Math.max; const floating_ui_utils_round = Math.round; const floor = Math.floor; const createCoords = v => ({ x: v, y: v }); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const oppositeAlignmentMap = { start: 'end', end: 'start' }; function floating_ui_utils_clamp(start, value, end) { return max(start, min(value, end)); } function evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function getSide(placement) { return placement.split('-')[0]; } function getAlignment(placement) { return placement.split('-')[1]; } function getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function getSideAxis(placement) { return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x'; } function getAlignmentAxis(placement) { return getOppositeAxis(getSideAxis(placement)); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = floating_ui_utils_getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } function floating_ui_utils_getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getPaddingObject(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function floating_ui_utils_rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs function floating_ui_utils_dom_getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function floating_ui_utils_dom_getWindow(node) { var _node$ownerDocument; return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function floating_ui_utils_dom_getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node; } function floating_ui_utils_dom_isElement(value) { return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element; } function floating_ui_utils_dom_isHTMLElement(value) { return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement; } function floating_ui_utils_dom_isShadowRoot(value) { // Browsers without `ShadowRoot` support. if (typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = floating_ui_utils_dom_getComputedStyle(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); } function floating_ui_utils_dom_isTableElement(element) { return ['table', 'td', 'th'].includes(floating_ui_utils_dom_getNodeName(element)); } function isContainingBlock(element) { const webkit = isWebKit(); const css = floating_ui_utils_dom_getComputedStyle(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); } function floating_ui_utils_dom_getContainingBlock(element) { let currentNode = floating_ui_utils_dom_getParentNode(element); while (floating_ui_utils_dom_isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = floating_ui_utils_dom_getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } function isLastTraversableNode(node) { return ['html', 'body', '#document'].includes(floating_ui_utils_dom_getNodeName(node)); } function floating_ui_utils_dom_getComputedStyle(element) { return floating_ui_utils_dom_getWindow(element).getComputedStyle(element); } function floating_ui_utils_dom_getNodeScroll(element) { if (floating_ui_utils_dom_isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.pageXOffset, scrollTop: element.pageYOffset }; } function floating_ui_utils_dom_getParentNode(node) { if (floating_ui_utils_dom_getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. floating_ui_utils_dom_isShadowRoot(node) && node.host || // Fallback. floating_ui_utils_dom_getDocumentElement(node); return floating_ui_utils_dom_isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = floating_ui_utils_dom_getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (floating_ui_utils_dom_isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = floating_ui_utils_dom_getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element) { const css = floating_ui_utils_dom_getComputedStyle(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = floating_ui_utils_dom_isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !floating_ui_utils_dom_isElement(element) ? element.contextElement : element; } function floating_ui_dom_getScale(element) { const domElement = unwrapElement(element); if (!floating_ui_utils_dom_isHTMLElement(domElement)) { return createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width; let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = /*#__PURE__*/createCoords(0); function getVisualOffsets(element) { const win = floating_ui_utils_dom_getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) { return false; } return isFixed; } function floating_ui_dom_getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = createCoords(1); if (includeScale) { if (offsetParent) { if (floating_ui_utils_dom_isElement(offsetParent)) { scale = floating_ui_dom_getScale(offsetParent); } } else { scale = floating_ui_dom_getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = floating_ui_utils_dom_getWindow(domElement); const offsetWin = offsetParent && floating_ui_utils_dom_isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent; let currentIFrame = win.frameElement; while (currentIFrame && offsetParent && offsetWin !== win) { const iframeScale = floating_ui_dom_getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentIFrame = floating_ui_utils_dom_getWindow(currentIFrame).frameElement; } } return floating_ui_utils_rectToClientRect({ width, height, x, y }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { rect, offsetParent, strategy } = _ref; const isOffsetParentAnElement = floating_ui_utils_dom_isHTMLElement(offsetParent); const documentElement = floating_ui_utils_dom_getDocumentElement(offsetParent); if (offsetParent === documentElement) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = createCoords(1); const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') { if (floating_ui_utils_dom_getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = floating_ui_utils_dom_getNodeScroll(offsetParent); } if (floating_ui_utils_dom_isHTMLElement(offsetParent)) { const offsetRect = floating_ui_dom_getBoundingClientRect(offsetParent); scale = floating_ui_dom_getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } function floating_ui_dom_getWindowScrollBarX(element) { // If <html> has a CSS width greater than the viewport, then this will be // incorrect for RTL. return floating_ui_dom_getBoundingClientRect(floating_ui_utils_dom_getDocumentElement(element)).left + floating_ui_utils_dom_getNodeScroll(element).scrollLeft; } // Gets the entire size of the scrollable document area, even extending outside // of the `<html>` and `<body>` rect bounds if horizontally scrollable. function floating_ui_dom_getDocumentRect(element) { const html = floating_ui_utils_dom_getDocumentElement(element); const scroll = floating_ui_utils_dom_getNodeScroll(element); const body = element.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + floating_ui_dom_getWindowScrollBarX(element); const y = -scroll.scrollTop; if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function floating_ui_dom_getViewportRect(element, strategy) { const win = floating_ui_utils_dom_getWindow(element); const html = floating_ui_utils_dom_getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } // Returns the inner client rect, subtracting scrollbars if present. function floating_ui_dom_getInnerBoundingClientRect(element, strategy) { const clientRect = floating_ui_dom_getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = floating_ui_utils_dom_isHTMLElement(element) ? floating_ui_dom_getScale(element) : createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = floating_ui_dom_getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = floating_ui_dom_getDocumentRect(floating_ui_utils_dom_getDocumentElement(element)); } else if (floating_ui_utils_dom_isElement(clippingAncestor)) { rect = floating_ui_dom_getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return floating_ui_utils_rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = floating_ui_utils_dom_getParentNode(element); if (parentNode === stopNode || !floating_ui_utils_dom_isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter(el => floating_ui_utils_dom_isElement(el) && floating_ui_utils_dom_getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; let currentNode = elementIsFixed ? floating_ui_utils_dom_getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (floating_ui_utils_dom_isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = floating_ui_utils_dom_getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function floating_ui_dom_getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, 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; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { return getCssDimensions(element); } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = floating_ui_utils_dom_isHTMLElement(offsetParent); const documentElement = floating_ui_utils_dom_getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = floating_ui_dom_getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (floating_ui_utils_dom_getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = floating_ui_utils_dom_getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = floating_ui_dom_getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = floating_ui_dom_getWindowScrollBarX(documentElement); } } return { x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, width: rect.width, height: rect.height }; } function floating_ui_dom_getTrueOffsetParent(element, polyfill) { if (!floating_ui_utils_dom_isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } return element.offsetParent; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function floating_ui_dom_getOffsetParent(element, polyfill) { const window = floating_ui_utils_dom_getWindow(element); if (!floating_ui_utils_dom_isHTMLElement(element)) { return window; } let offsetParent = floating_ui_dom_getTrueOffsetParent(element, polyfill); while (offsetParent && floating_ui_utils_dom_isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') { offsetParent = floating_ui_dom_getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (floating_ui_utils_dom_getNodeName(offsetParent) === 'html' || floating_ui_utils_dom_getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { return window; } return offsetParent || floating_ui_utils_dom_getContainingBlock(element) || window; } const getElementRects = async function (_ref) { let { reference, floating, strategy } = _ref; const getOffsetParentFn = this.getOffsetParent || floating_ui_dom_getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy), floating: { x: 0, y: 0, ...(await getDimensionsFn(floating)) } }; }; function isRTL(element) { return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; } const platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement: floating_ui_utils_dom_getDocumentElement, getClippingRect: floating_ui_dom_getClippingRect, getOffsetParent: floating_ui_dom_getOffsetParent, getElementRects, getClientRects, getDimensions, getScale: floating_ui_dom_getScale, isElement: floating_ui_utils_dom_isElement, isRTL }; // https://samthor.au/2021/observing-dom/ function observeMove(element, onMove) { let io = null; let timeoutId; const root = floating_ui_utils_dom_getDocumentElement(element); function cleanup() { clearTimeout(timeoutId); io && io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floor(top); const insetRight = floor(root.clientWidth - (left + width)); const insetBottom = floor(root.clientHeight - (top + height)); const insetLeft = floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: max(0, min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 100); } else { refresh(false, ratio); } } isFirstUpdate = false; } // Older browsers don't support a `document` as the root and will throw an // error. try { io = new IntersectionObserver(handleObserve, { ...options, // Handle <iframe>s root: root.ownerDocument }); } catch (e) { io = new IntersectionObserver(handleObserve, options); } io.observe(element); } refresh(true); return cleanup; } /** * Automatically updates the position of the floating element when necessary. * Should only be called when the floating element is mounted on the DOM or * visible on the screen. * @returns cleanup function that should be invoked when the floating element is * removed from the DOM or hidden from the screen. * @see https://floating-ui.com/docs/autoUpdate */ function autoUpdate(reference, floating, update, options) { if (options === void 0) { options = {}; } const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === 'function', layoutShift = typeof IntersectionObserver === 'function', animationFrame = false } = options; const referenceEl = unwrapElement(reference); const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : []; ancestors.forEach(ancestor => { ancestorScroll && ancestor.addEventListener('scroll', update, { passive: true }); ancestorResize && ancestor.addEventListener('resize', update); }); const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null; let reobserveFrame = -1; let resizeObserver = null; if (elementResize) { resizeObserver = new ResizeObserver(_ref => { let [firstEntry] = _ref; if (firstEntry && firstEntry.target === referenceEl && resizeObserver) { // Prevent update loops when using the `size` middleware. // https://github.com/floating-ui/floating-ui/issues/1740 resizeObserver.unobserve(floating); cancelAnimationFrame(reobserveFrame); reobserveFrame = requestAnimationFrame(() => { resizeObserver && resizeObserver.observe(floating); }); } update(); }); if (referenceEl && !animationFrame) { resizeObserver.observe(referenceEl); } resizeObserver.observe(floating); } let frameId; let prevRefRect = animationFrame ? floating_ui_dom_getBoundingClientRect(reference) : null; if (animationFrame) { frameLoop(); } function frameLoop() { const nextRefRect = floating_ui_dom_getBoundingClientRect(reference); if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) { update(); } prevRefRect = nextRefRect; frameId = requestAnimationFrame(frameLoop); } update(); return () => { ancestors.forEach(ancestor => { ancestorScroll && ancestor.removeEventListener('scroll', update); ancestorResize && ancestor.removeEventListener('resize', update); }); cleanupIo && cleanupIo(); resizeObserver && resizeObserver.disconnect(); resizeObserver = null; if (animationFrame) { cancelAnimationFrame(frameId); } }; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a reference element when it is given a certain CSS positioning * strategy. */ const computePosition = (reference, floating, options) => { // This caches the expensive `getClippingElementAncestors` function so that // multiple lifecycle resets re-use the same result. It only lives for a // single call. If other functions become expensive, we can add them as well. const cache = new Map(); const mergedOptions = { platform, ...options }; const platformWithCache = { ...mergedOptions.platform, _c: cache }; return computePosition$1(reference, floating, { ...mergedOptions, platform: platformWithCache }); }; ;// CONCATENATED MODULE: ./node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js var index = external_React_.useLayoutEffect ; /* harmony default export */ const use_isomorphic_layout_effect_browser_esm = (index); ;// CONCATENATED MODULE: ./node_modules/react-select/dist/index-a301f526.esm.js var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"]; // ============================== // NO OP // ============================== var index_a301f526_esm_noop = function noop() {}; // ============================== // Class Name Prefixer // ============================== /** String representation of component state for styling with class names. Expects an array of strings OR a string/object pair: - className(['comp', 'comp-arg', 'comp-arg-2']) @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2' - className('comp', { some: true, state: false }) @returns 'react-select__comp react-select__comp--some' */ function applyPrefixToName(prefix, name) { if (!name) { return prefix; } else if (name[0] === '-') { return prefix + name; } else { return prefix + '__' + name; } } function index_a301f526_esm_classNames(prefix, state) { for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { classNameList[_key - 2] = arguments[_key]; } var arr = [].concat(classNameList); if (state && prefix) { for (var key in state) { if (state.hasOwnProperty(key) && state[key]) { arr.push("".concat(applyPrefixToName(prefix, key))); } } } return arr.filter(function (i) { return i; }).map(function (i) { return String(i).trim(); }).join(' '); } // ============================== // Clean Value // ============================== var cleanValue = function cleanValue(value) { if (index_a301f526_esm_isArray(value)) return value.filter(Boolean); if (esm_typeof_typeof(value) === 'object' && value !== null) return [value]; return []; }; // ============================== // Clean Common Props // ============================== var cleanCommonProps = function cleanCommonProps(props) { //className props.className; props.clearValue; props.cx; props.getStyles; props.getClassNames; props.getValue; props.hasValue; props.isMulti; props.isRtl; props.options; props.selectOption; props.selectProps; props.setValue; props.theme; var innerProps = _objectWithoutProperties(props, _excluded$4); return objectSpread2_objectSpread2({}, innerProps); }; // ============================== // Get Style Props // ============================== var getStyleProps = function getStyleProps(props, name, classNamesState) { var cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, className = props.className; return { css: getStyles(name, props), className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className) }; }; // ============================== // Handle Input Change // ============================== function handleInputChange(inputValue, actionMeta, onInputChange) { if (onInputChange) { var _newValue = onInputChange(inputValue, actionMeta); if (typeof _newValue === 'string') return _newValue; } return inputValue; } // ============================== // Scroll Helpers // ============================== function isDocumentElement(el) { return [document.documentElement, document.body, window].indexOf(el) > -1; } // Normalized Scroll Top // ------------------------------ function normalizedHeight(el) { if (isDocumentElement(el)) { return window.innerHeight; } return el.clientHeight; } // Normalized scrollTo & scrollTop // ------------------------------ function getScrollTop(el) { if (isDocumentElement(el)) { return window.pageYOffset; } return el.scrollTop; } function scrollTo(el, top) { // with a scroll distance, we perform scroll on the element if (isDocumentElement(el)) { window.scrollTo(0, top); return; } el.scrollTop = top; } // Get Scroll Parent // ------------------------------ function index_a301f526_esm_getScrollParent(element) { var style = getComputedStyle(element); var excludeStaticParent = style.position === 'absolute'; var overflowRx = /(auto|scroll)/; if (style.position === 'fixed') return document.documentElement; for (var parent = element; parent = parent.parentElement;) { style = getComputedStyle(parent); if (excludeStaticParent && style.position === 'static') { continue; } if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) { return parent; } } return document.documentElement; } // Animated Scroll To // ------------------------------ /** @param t: time (elapsed) @param b: initial value @param c: amount of change @param d: duration */ function easeOutCubic(t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; } function animatedScrollTo(element, to) { var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200; var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : index_a301f526_esm_noop; var start = getScrollTop(element); var change = to - start; var increment = 10; var currentTime = 0; function animateScroll() { currentTime += increment; var val = easeOutCubic(currentTime, start, change, duration); scrollTo(element, val); if (currentTime < duration) { window.requestAnimationFrame(animateScroll); } else { callback(element); } } animateScroll(); } // Scroll Into View // ------------------------------ function scrollIntoView(menuEl, focusedEl) { var menuRect = menuEl.getBoundingClientRect(); var focusedRect = focusedEl.getBoundingClientRect(); var overScroll = focusedEl.offsetHeight / 3; if (focusedRect.bottom + overScroll > menuRect.bottom) { scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight)); } else if (focusedRect.top - overScroll < menuRect.top) { scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0)); } } // ============================== // Get bounding client object // ============================== // cannot get keys using array notation with DOMRect function getBoundingClientObj(element) { var rect = element.getBoundingClientRect(); return { bottom: rect.bottom, height: rect.height, left: rect.left, right: rect.right, top: rect.top, width: rect.width }; } // ============================== // Touch Capability Detector // ============================== function isTouchCapable() { try { document.createEvent('TouchEvent'); return true; } catch (e) { return false; } } // ============================== // Mobile Device Detector // ============================== function isMobileDevice() { try { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); } catch (e) { return false; } } // ============================== // Passive Event Detector // ============================== // https://github.com/rafgraph/detect-it/blob/main/src/index.ts#L19-L36 var passiveOptionAccessed = false; var index_a301f526_esm_options = { get passive() { return passiveOptionAccessed = true; } }; // check for SSR var w = typeof window !== 'undefined' ? window : {}; if (w.addEventListener && w.removeEventListener) { w.addEventListener('p', index_a301f526_esm_noop, index_a301f526_esm_options); w.removeEventListener('p', index_a301f526_esm_noop, false); } var supportsPassiveEvents = passiveOptionAccessed; function notNullish(item) { return item != null; } function index_a301f526_esm_isArray(arg) { return Array.isArray(arg); } function valueTernary(isMulti, multiValue, singleValue) { return isMulti ? multiValue : singleValue; } function singleValueAsValue(singleValue) { return singleValue; } function multiValueAsValue(multiValue) { return multiValue; } var removeProps = function removeProps(propsObj) { for (var _len2 = arguments.length, properties = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { properties[_key2 - 1] = arguments[_key2]; } var propsMap = Object.entries(propsObj).filter(function (_ref) { var _ref2 = slicedToArray_slicedToArray(_ref, 1), key = _ref2[0]; return !properties.includes(key); }); return propsMap.reduce(function (newProps, _ref3) { var _ref4 = slicedToArray_slicedToArray(_ref3, 2), key = _ref4[0], val = _ref4[1]; newProps[key] = val; return newProps; }, {}); }; var _excluded$3 = ["children", "innerProps"], _excluded2$1 = ["children", "innerProps"]; function getMenuPlacement(_ref) { var preferredMaxHeight = _ref.maxHeight, menuEl = _ref.menuEl, minHeight = _ref.minHeight, preferredPlacement = _ref.placement, shouldScroll = _ref.shouldScroll, isFixedPosition = _ref.isFixedPosition, controlHeight = _ref.controlHeight; var scrollParent = index_a301f526_esm_getScrollParent(menuEl); var defaultState = { placement: 'bottom', maxHeight: preferredMaxHeight }; // something went wrong, return default state if (!menuEl || !menuEl.offsetParent) return defaultState; // we can't trust `scrollParent.scrollHeight` --> it may increase when // the menu is rendered var _scrollParent$getBoun = scrollParent.getBoundingClientRect(), scrollHeight = _scrollParent$getBoun.height; var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(), menuBottom = _menuEl$getBoundingCl.bottom, menuHeight = _menuEl$getBoundingCl.height, menuTop = _menuEl$getBoundingCl.top; var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(), containerTop = _menuEl$offsetParent$.top; var viewHeight = isFixedPosition ? window.innerHeight : normalizedHeight(scrollParent); var scrollTop = getScrollTop(scrollParent); var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10); var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10); var viewSpaceAbove = containerTop - marginTop; var viewSpaceBelow = viewHeight - menuTop; var scrollSpaceAbove = viewSpaceAbove + scrollTop; var scrollSpaceBelow = scrollHeight - scrollTop - menuTop; var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom; var scrollUp = scrollTop + menuTop - marginTop; var scrollDuration = 160; switch (preferredPlacement) { case 'auto': case 'bottom': // 1: the menu will fit, do nothing if (viewSpaceBelow >= menuHeight) { return { placement: 'bottom', maxHeight: preferredMaxHeight }; } // 2: the menu will fit, if scrolled if (scrollSpaceBelow >= menuHeight && !isFixedPosition) { if (shouldScroll) { animatedScrollTo(scrollParent, scrollDown, scrollDuration); } return { placement: 'bottom', maxHeight: preferredMaxHeight }; } // 3: the menu will fit, if constrained if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) { if (shouldScroll) { animatedScrollTo(scrollParent, scrollDown, scrollDuration); } // we want to provide as much of the menu as possible to the user, // so give them whatever is available below rather than the minHeight. var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom; return { placement: 'bottom', maxHeight: constrainedHeight }; } // 4. Forked beviour when there isn't enough space below // AUTO: flip the menu, render above if (preferredPlacement === 'auto' || isFixedPosition) { // may need to be constrained after flipping var _constrainedHeight = preferredMaxHeight; var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove; if (spaceAbove >= minHeight) { _constrainedHeight = Math.min(spaceAbove - marginBottom - controlHeight, preferredMaxHeight); } return { placement: 'top', maxHeight: _constrainedHeight }; } // BOTTOM: allow browser to increase scrollable area and immediately set scroll if (preferredPlacement === 'bottom') { if (shouldScroll) { scrollTo(scrollParent, scrollDown); } return { placement: 'bottom', maxHeight: preferredMaxHeight }; } break; case 'top': // 1: the menu will fit, do nothing if (viewSpaceAbove >= menuHeight) { return { placement: 'top', maxHeight: preferredMaxHeight }; } // 2: the menu will fit, if scrolled if (scrollSpaceAbove >= menuHeight && !isFixedPosition) { if (shouldScroll) { animatedScrollTo(scrollParent, scrollUp, scrollDuration); } return { placement: 'top', maxHeight: preferredMaxHeight }; } // 3: the menu will fit, if constrained if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) { var _constrainedHeight2 = preferredMaxHeight; // we want to provide as much of the menu as possible to the user, // so give them whatever is available below rather than the minHeight. if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) { _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop; } if (shouldScroll) { animatedScrollTo(scrollParent, scrollUp, scrollDuration); } return { placement: 'top', maxHeight: _constrainedHeight2 }; } // 4. not enough space, the browser WILL NOT increase scrollable area when // absolutely positioned element rendered above the viewport (only below). // Flip the menu, render below return { placement: 'bottom', maxHeight: preferredMaxHeight }; default: throw new Error("Invalid placement provided \"".concat(preferredPlacement, "\".")); } return defaultState; } // Menu Component // ------------------------------ function alignToControl(placement) { var placementToCSSProp = { bottom: 'top', top: 'bottom' }; return placement ? placementToCSSProp[placement] : 'bottom'; } var coercePlacement = function coercePlacement(p) { return p === 'auto' ? 'bottom' : p; }; var menuCSS = function menuCSS(_ref2, unstyled) { var _objectSpread2; var placement = _ref2.placement, _ref2$theme = _ref2.theme, borderRadius = _ref2$theme.borderRadius, spacing = _ref2$theme.spacing, colors = _ref2$theme.colors; return objectSpread2_objectSpread2((_objectSpread2 = { label: 'menu' }, esm_defineProperty_defineProperty(_objectSpread2, alignToControl(placement), '100%'), esm_defineProperty_defineProperty(_objectSpread2, "position", 'absolute'), esm_defineProperty_defineProperty(_objectSpread2, "width", '100%'), esm_defineProperty_defineProperty(_objectSpread2, "zIndex", 1), _objectSpread2), unstyled ? {} : { backgroundColor: colors.neutral0, borderRadius: borderRadius, boxShadow: '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)', marginBottom: spacing.menuGutter, marginTop: spacing.menuGutter }); }; var PortalPlacementContext = /*#__PURE__*/(0,external_React_.createContext)(null); // NOTE: internal only var MenuPlacer = function MenuPlacer(props) { var children = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme; var _ref3 = (0,external_React_.useContext)(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement; var ref = (0,external_React_.useRef)(null); var _useState = (0,external_React_.useState)(maxMenuHeight), _useState2 = slicedToArray_slicedToArray(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1]; var _useState3 = (0,external_React_.useState)(null), _useState4 = slicedToArray_slicedToArray(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1]; var controlHeight = theme.spacing.controlHeight; use_isomorphic_layout_effect_browser_esm(function () { var menuEl = ref.current; if (!menuEl) return; // DO NOT scroll if position is fixed var isFixedPosition = menuPosition === 'fixed'; var shouldScroll = menuShouldScrollIntoView && !isFixedPosition; var state = getMenuPlacement({ maxHeight: maxMenuHeight, menuEl: menuEl, minHeight: minMenuHeight, placement: menuPlacement, shouldScroll: shouldScroll, isFixedPosition: isFixedPosition, controlHeight: controlHeight }); setMaxHeight(state.maxHeight); setPlacement(state.placement); setPortalPlacement === null || setPortalPlacement === void 0 ? void 0 : setPortalPlacement(state.placement); }, [maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, setPortalPlacement, controlHeight]); return children({ ref: ref, placerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, props), {}, { placement: placement || coercePlacement(menuPlacement), maxHeight: maxHeight }) }); }; var index_a301f526_esm_Menu = function Menu(props) { var children = props.children, innerRef = props.innerRef, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'menu', { menu: true }), { ref: innerRef }, innerProps), children); }; var Menu$1 = index_a301f526_esm_Menu; // ============================== // Menu List // ============================== var menuListCSS = function menuListCSS(_ref4, unstyled) { var maxHeight = _ref4.maxHeight, baseUnit = _ref4.theme.spacing.baseUnit; return objectSpread2_objectSpread2({ maxHeight: maxHeight, overflowY: 'auto', position: 'relative', // required for offset[Height, Top] > keyboard scroll WebkitOverflowScrolling: 'touch' }, unstyled ? {} : { paddingBottom: baseUnit, paddingTop: baseUnit }); }; var index_a301f526_esm_MenuList = function MenuList(props) { var children = props.children, innerProps = props.innerProps, innerRef = props.innerRef, isMulti = props.isMulti; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'menuList', { 'menu-list': true, 'menu-list--is-multi': isMulti }), { ref: innerRef }, innerProps), children); }; // ============================== // Menu Notices // ============================== var noticeCSS = function noticeCSS(_ref5, unstyled) { var _ref5$theme = _ref5.theme, baseUnit = _ref5$theme.spacing.baseUnit, colors = _ref5$theme.colors; return objectSpread2_objectSpread2({ textAlign: 'center' }, unstyled ? {} : { color: colors.neutral40, padding: "".concat(baseUnit * 2, "px ").concat(baseUnit * 3, "px") }); }; var noOptionsMessageCSS = noticeCSS; var loadingMessageCSS = noticeCSS; var NoOptionsMessage = function NoOptionsMessage(_ref6) { var _ref6$children = _ref6.children, children = _ref6$children === void 0 ? 'No options' : _ref6$children, innerProps = _ref6.innerProps, restProps = _objectWithoutProperties(_ref6, _excluded$3); return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, { children: children, innerProps: innerProps }), 'noOptionsMessage', { 'menu-notice': true, 'menu-notice--no-options': true }), innerProps), children); }; var LoadingMessage = function LoadingMessage(_ref7) { var _ref7$children = _ref7.children, children = _ref7$children === void 0 ? 'Loading...' : _ref7$children, innerProps = _ref7.innerProps, restProps = _objectWithoutProperties(_ref7, _excluded2$1); return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, { children: children, innerProps: innerProps }), 'loadingMessage', { 'menu-notice': true, 'menu-notice--loading': true }), innerProps), children); }; // ============================== // Menu Portal // ============================== var menuPortalCSS = function menuPortalCSS(_ref8) { var rect = _ref8.rect, offset = _ref8.offset, position = _ref8.position; return { left: rect.left, position: position, top: offset, width: rect.width, zIndex: 1 }; }; var MenuPortal = function MenuPortal(props) { var appendTo = props.appendTo, children = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition; var menuPortalRef = (0,external_React_.useRef)(null); var cleanupRef = (0,external_React_.useRef)(null); var _useState5 = (0,external_React_.useState)(coercePlacement(menuPlacement)), _useState6 = slicedToArray_slicedToArray(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1]; var portalPlacementContext = (0,external_React_.useMemo)(function () { return { setPortalPlacement: setPortalPlacement }; }, []); var _useState7 = (0,external_React_.useState)(null), _useState8 = slicedToArray_slicedToArray(_useState7, 2), computedPosition = _useState8[0], setComputedPosition = _useState8[1]; var updateComputedPosition = (0,external_React_.useCallback)(function () { if (!controlElement) return; var rect = getBoundingClientObj(controlElement); var scrollDistance = menuPosition === 'fixed' ? 0 : window.pageYOffset; var offset = rect[placement] + scrollDistance; if (offset !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset) || rect.left !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left) || rect.width !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width)) { setComputedPosition({ offset: offset, rect: rect }); } }, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]); use_isomorphic_layout_effect_browser_esm(function () { updateComputedPosition(); }, [updateComputedPosition]); var runAutoUpdate = (0,external_React_.useCallback)(function () { if (typeof cleanupRef.current === 'function') { cleanupRef.current(); cleanupRef.current = null; } if (controlElement && menuPortalRef.current) { cleanupRef.current = autoUpdate(controlElement, menuPortalRef.current, updateComputedPosition, { elementResize: 'ResizeObserver' in window }); } }, [controlElement, updateComputedPosition]); use_isomorphic_layout_effect_browser_esm(function () { runAutoUpdate(); }, [runAutoUpdate]); var setMenuPortalElement = (0,external_React_.useCallback)(function (menuPortalElement) { menuPortalRef.current = menuPortalElement; runAutoUpdate(); }, [runAutoUpdate]); // bail early if required elements aren't present if (!appendTo && menuPosition !== 'fixed' || !computedPosition) return null; // same wrapper element whether fixed or portalled var menuWrapper = jsx("div", runtime_helpers_esm_extends_extends({ ref: setMenuPortalElement }, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, props), {}, { offset: computedPosition.offset, position: menuPosition, rect: computedPosition.rect }), 'menuPortal', { 'menu-portal': true }), innerProps), children); return jsx(PortalPlacementContext.Provider, { value: portalPlacementContext }, appendTo ? /*#__PURE__*/(0,external_ReactDOM_.createPortal)(menuWrapper, appendTo) : menuWrapper); }; // ============================== // Root Container // ============================== var containerCSS = function containerCSS(_ref) { var isDisabled = _ref.isDisabled, isRtl = _ref.isRtl; return { label: 'container', direction: isRtl ? 'rtl' : undefined, pointerEvents: isDisabled ? 'none' : undefined, // cancel mouse events when disabled position: 'relative' }; }; var SelectContainer = function SelectContainer(props) { var children = props.children, innerProps = props.innerProps, isDisabled = props.isDisabled, isRtl = props.isRtl; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'container', { '--is-disabled': isDisabled, '--is-rtl': isRtl }), innerProps), children); }; // ============================== // Value Container // ============================== var valueContainerCSS = function valueContainerCSS(_ref2, unstyled) { var spacing = _ref2.theme.spacing, isMulti = _ref2.isMulti, hasValue = _ref2.hasValue, controlShouldRenderValue = _ref2.selectProps.controlShouldRenderValue; return objectSpread2_objectSpread2({ alignItems: 'center', display: isMulti && hasValue && controlShouldRenderValue ? 'flex' : 'grid', flex: 1, flexWrap: 'wrap', WebkitOverflowScrolling: 'touch', position: 'relative', overflow: 'hidden' }, unstyled ? {} : { padding: "".concat(spacing.baseUnit / 2, "px ").concat(spacing.baseUnit * 2, "px") }); }; var ValueContainer = function ValueContainer(props) { var children = props.children, innerProps = props.innerProps, isMulti = props.isMulti, hasValue = props.hasValue; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'valueContainer', { 'value-container': true, 'value-container--is-multi': isMulti, 'value-container--has-value': hasValue }), innerProps), children); }; // ============================== // Indicator Container // ============================== var indicatorsContainerCSS = function indicatorsContainerCSS() { return { alignItems: 'center', alignSelf: 'stretch', display: 'flex', flexShrink: 0 }; }; var IndicatorsContainer = function IndicatorsContainer(props) { var children = props.children, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'indicatorsContainer', { indicators: true }), innerProps), children); }; var _templateObject; var _excluded$2 = ["size"], index_a301f526_esm_excluded2 = ["innerProps", "isRtl", "size"]; function _EMOTION_STRINGIFIED_CSS_ERROR__() { 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)."; } // ============================== // Dropdown & Clear Icons // ============================== var _ref2 = true ? { name: "8mmkcg", styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0" } : 0; var Svg = function Svg(_ref) { var size = _ref.size, props = _objectWithoutProperties(_ref, _excluded$2); return jsx("svg", runtime_helpers_esm_extends_extends({ height: size, width: size, viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", css: _ref2 }, props)); }; var CrossIcon = function CrossIcon(props) { return jsx(Svg, runtime_helpers_esm_extends_extends({ size: 20 }, props), jsx("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })); }; var DownChevron = function DownChevron(props) { return jsx(Svg, runtime_helpers_esm_extends_extends({ size: 20 }, props), jsx("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })); }; // ============================== // Dropdown & Clear Buttons // ============================== var baseCSS = function baseCSS(_ref3, unstyled) { var isFocused = _ref3.isFocused, _ref3$theme = _ref3.theme, baseUnit = _ref3$theme.spacing.baseUnit, colors = _ref3$theme.colors; return objectSpread2_objectSpread2({ label: 'indicatorContainer', display: 'flex', transition: 'color 150ms' }, unstyled ? {} : { color: isFocused ? colors.neutral60 : colors.neutral20, padding: baseUnit * 2, ':hover': { color: isFocused ? colors.neutral80 : colors.neutral40 } }); }; var dropdownIndicatorCSS = baseCSS; var DropdownIndicator = function DropdownIndicator(props) { var children = props.children, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'dropdownIndicator', { indicator: true, 'dropdown-indicator': true }), innerProps), children || jsx(DownChevron, null)); }; var clearIndicatorCSS = baseCSS; var ClearIndicator = function ClearIndicator(props) { var children = props.children, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'clearIndicator', { indicator: true, 'clear-indicator': true }), innerProps), children || jsx(CrossIcon, null)); }; // ============================== // Separator // ============================== var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4, unstyled) { var isDisabled = _ref4.isDisabled, _ref4$theme = _ref4.theme, baseUnit = _ref4$theme.spacing.baseUnit, colors = _ref4$theme.colors; return objectSpread2_objectSpread2({ label: 'indicatorSeparator', alignSelf: 'stretch', width: 1 }, unstyled ? {} : { backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20, marginBottom: baseUnit * 2, marginTop: baseUnit * 2 }); }; var IndicatorSeparator = function IndicatorSeparator(props) { var innerProps = props.innerProps; return jsx("span", runtime_helpers_esm_extends_extends({}, innerProps, getStyleProps(props, 'indicatorSeparator', { 'indicator-separator': true }))); }; // ============================== // Loading // ============================== var loadingDotAnimations = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))); var loadingIndicatorCSS = function loadingIndicatorCSS(_ref5, unstyled) { var isFocused = _ref5.isFocused, size = _ref5.size, _ref5$theme = _ref5.theme, colors = _ref5$theme.colors, baseUnit = _ref5$theme.spacing.baseUnit; return objectSpread2_objectSpread2({ label: 'loadingIndicator', display: 'flex', transition: 'color 150ms', alignSelf: 'center', fontSize: size, lineHeight: 1, marginRight: size, textAlign: 'center', verticalAlign: 'middle' }, unstyled ? {} : { color: isFocused ? colors.neutral60 : colors.neutral20, padding: baseUnit * 2 }); }; var LoadingDot = function LoadingDot(_ref6) { var delay = _ref6.delay, offset = _ref6.offset; return jsx("span", { css: /*#__PURE__*/css({ animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"), backgroundColor: 'currentColor', borderRadius: '1em', display: 'inline-block', marginLeft: offset ? '1em' : undefined, height: '1em', verticalAlign: 'top', width: '1em' }, true ? "" : 0, true ? "" : 0) }); }; var LoadingIndicator = function LoadingIndicator(_ref7) { var innerProps = _ref7.innerProps, isRtl = _ref7.isRtl, _ref7$size = _ref7.size, size = _ref7$size === void 0 ? 4 : _ref7$size, restProps = _objectWithoutProperties(_ref7, index_a301f526_esm_excluded2); return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, { innerProps: innerProps, isRtl: isRtl, size: size }), 'loadingIndicator', { indicator: true, 'loading-indicator': true }), innerProps), jsx(LoadingDot, { delay: 0, offset: isRtl }), jsx(LoadingDot, { delay: 160, offset: true }), jsx(LoadingDot, { delay: 320, offset: !isRtl })); }; var css$1 = function css(_ref, unstyled) { var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, _ref$theme = _ref.theme, colors = _ref$theme.colors, borderRadius = _ref$theme.borderRadius, spacing = _ref$theme.spacing; return objectSpread2_objectSpread2({ label: 'control', alignItems: 'center', cursor: 'default', display: 'flex', flexWrap: 'wrap', justifyContent: 'space-between', minHeight: spacing.controlHeight, outline: '0 !important', position: 'relative', transition: 'all 100ms' }, unstyled ? {} : { backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0, borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20, borderRadius: borderRadius, borderStyle: 'solid', borderWidth: 1, boxShadow: isFocused ? "0 0 0 1px ".concat(colors.primary) : undefined, '&:hover': { borderColor: isFocused ? colors.primary : colors.neutral30 } }); }; var Control = function Control(props) { var children = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, innerRef = props.innerRef, innerProps = props.innerProps, menuIsOpen = props.menuIsOpen; return jsx("div", runtime_helpers_esm_extends_extends({ ref: innerRef }, getStyleProps(props, 'control', { control: true, 'control--is-disabled': isDisabled, 'control--is-focused': isFocused, 'control--menu-is-open': menuIsOpen }), innerProps, { "aria-disabled": isDisabled || undefined }), children); }; var Control$1 = Control; var _excluded$1 = ["data"]; var groupCSS = function groupCSS(_ref, unstyled) { var spacing = _ref.theme.spacing; return unstyled ? {} : { paddingBottom: spacing.baseUnit * 2, paddingTop: spacing.baseUnit * 2 }; }; var Group = function Group(props) { var children = props.children, cx = props.cx, getStyles = props.getStyles, getClassNames = props.getClassNames, Heading = props.Heading, headingProps = props.headingProps, innerProps = props.innerProps, label = props.label, theme = props.theme, selectProps = props.selectProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'group', { group: true }), innerProps), jsx(Heading, runtime_helpers_esm_extends_extends({}, headingProps, { selectProps: selectProps, theme: theme, getStyles: getStyles, getClassNames: getClassNames, cx: cx }), label), jsx("div", null, children)); }; var groupHeadingCSS = function groupHeadingCSS(_ref2, unstyled) { var _ref2$theme = _ref2.theme, colors = _ref2$theme.colors, spacing = _ref2$theme.spacing; return objectSpread2_objectSpread2({ label: 'group', cursor: 'default', display: 'block' }, unstyled ? {} : { color: colors.neutral40, fontSize: '75%', fontWeight: 500, marginBottom: '0.25em', paddingLeft: spacing.baseUnit * 3, paddingRight: spacing.baseUnit * 3, textTransform: 'uppercase' }); }; var GroupHeading = function GroupHeading(props) { var _cleanCommonProps = cleanCommonProps(props); _cleanCommonProps.data; var innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$1); return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'groupHeading', { 'group-heading': true }), innerProps)); }; var Group$1 = Group; var index_a301f526_esm_excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"]; var inputCSS = function inputCSS(_ref, unstyled) { var isDisabled = _ref.isDisabled, value = _ref.value, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return objectSpread2_objectSpread2(objectSpread2_objectSpread2({ visibility: isDisabled ? 'hidden' : 'visible', // force css to recompute when value change due to @emotion bug. // We can remove it whenever the bug is fixed. transform: value ? 'translateZ(0)' : '' }, containerStyle), unstyled ? {} : { margin: spacing.baseUnit / 2, paddingBottom: spacing.baseUnit / 2, paddingTop: spacing.baseUnit / 2, color: colors.neutral80 }); }; var spacingStyle = { gridArea: '1 / 2', font: 'inherit', minWidth: '2px', border: 0, margin: 0, outline: 0, padding: 0 }; var containerStyle = { flex: '1 1 auto', display: 'inline-grid', gridArea: '1 / 1 / 2 / 3', gridTemplateColumns: '0 min-content', '&:after': objectSpread2_objectSpread2({ content: 'attr(data-value) " "', visibility: 'hidden', whiteSpace: 'pre' }, spacingStyle) }; var inputStyle = function inputStyle(isHidden) { return objectSpread2_objectSpread2({ label: 'input', color: 'inherit', background: 0, opacity: isHidden ? 0 : 1, width: '100%' }, spacingStyle); }; var index_a301f526_esm_Input = function Input(props) { var cx = props.cx, value = props.value; var _cleanCommonProps = cleanCommonProps(props), innerRef = _cleanCommonProps.innerRef, isDisabled = _cleanCommonProps.isDisabled, isHidden = _cleanCommonProps.isHidden, inputClassName = _cleanCommonProps.inputClassName, innerProps = _objectWithoutProperties(_cleanCommonProps, index_a301f526_esm_excluded); return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'input', { 'input-container': true }), { "data-value": value || '' }), jsx("input", runtime_helpers_esm_extends_extends({ className: cx({ input: true }, inputClassName), ref: innerRef, style: inputStyle(isHidden), disabled: isDisabled }, innerProps))); }; var Input$1 = index_a301f526_esm_Input; var multiValueCSS = function multiValueCSS(_ref, unstyled) { var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, borderRadius = _ref$theme.borderRadius, colors = _ref$theme.colors; return objectSpread2_objectSpread2({ label: 'multiValue', display: 'flex', minWidth: 0 }, unstyled ? {} : { backgroundColor: colors.neutral10, borderRadius: borderRadius / 2, margin: spacing.baseUnit / 2 }); }; var multiValueLabelCSS = function multiValueLabelCSS(_ref2, unstyled) { var _ref2$theme = _ref2.theme, borderRadius = _ref2$theme.borderRadius, colors = _ref2$theme.colors, cropWithEllipsis = _ref2.cropWithEllipsis; return objectSpread2_objectSpread2({ overflow: 'hidden', textOverflow: cropWithEllipsis || cropWithEllipsis === undefined ? 'ellipsis' : undefined, whiteSpace: 'nowrap' }, unstyled ? {} : { borderRadius: borderRadius / 2, color: colors.neutral80, fontSize: '85%', padding: 3, paddingLeft: 6 }); }; var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3, unstyled) { var _ref3$theme = _ref3.theme, spacing = _ref3$theme.spacing, borderRadius = _ref3$theme.borderRadius, colors = _ref3$theme.colors, isFocused = _ref3.isFocused; return objectSpread2_objectSpread2({ alignItems: 'center', display: 'flex' }, unstyled ? {} : { borderRadius: borderRadius / 2, backgroundColor: isFocused ? colors.dangerLight : undefined, paddingLeft: spacing.baseUnit, paddingRight: spacing.baseUnit, ':hover': { backgroundColor: colors.dangerLight, color: colors.danger } }); }; var MultiValueGeneric = function MultiValueGeneric(_ref4) { var children = _ref4.children, innerProps = _ref4.innerProps; return jsx("div", innerProps, children); }; var MultiValueContainer = MultiValueGeneric; var MultiValueLabel = MultiValueGeneric; function MultiValueRemove(_ref5) { var children = _ref5.children, innerProps = _ref5.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({ role: "button" }, innerProps), children || jsx(CrossIcon, { size: 14 })); } var MultiValue = function MultiValue(props) { var children = props.children, components = props.components, data = props.data, innerProps = props.innerProps, isDisabled = props.isDisabled, removeProps = props.removeProps, selectProps = props.selectProps; var Container = components.Container, Label = components.Label, Remove = components.Remove; return jsx(Container, { data: data, innerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValue', { 'multi-value': true, 'multi-value--is-disabled': isDisabled })), innerProps), selectProps: selectProps }, jsx(Label, { data: data, innerProps: objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValueLabel', { 'multi-value__label': true })), selectProps: selectProps }, children), jsx(Remove, { data: data, innerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValueRemove', { 'multi-value__remove': true })), {}, { 'aria-label': "Remove ".concat(children || 'option') }, removeProps), selectProps: selectProps })); }; var MultiValue$1 = MultiValue; var optionCSS = function optionCSS(_ref, unstyled) { var isDisabled = _ref.isDisabled, isFocused = _ref.isFocused, isSelected = _ref.isSelected, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return objectSpread2_objectSpread2({ label: 'option', cursor: 'default', display: 'block', fontSize: 'inherit', width: '100%', userSelect: 'none', WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)' }, unstyled ? {} : { backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent', color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit', padding: "".concat(spacing.baseUnit * 2, "px ").concat(spacing.baseUnit * 3, "px"), // provide some affordance on touch devices ':active': { backgroundColor: !isDisabled ? isSelected ? colors.primary : colors.primary50 : undefined } }); }; var Option = function Option(props) { var children = props.children, isDisabled = props.isDisabled, isFocused = props.isFocused, isSelected = props.isSelected, innerRef = props.innerRef, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'option', { option: true, 'option--is-disabled': isDisabled, 'option--is-focused': isFocused, 'option--is-selected': isSelected }), { ref: innerRef, "aria-disabled": isDisabled }, innerProps), children); }; var Option$1 = Option; var placeholderCSS = function placeholderCSS(_ref, unstyled) { var _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return objectSpread2_objectSpread2({ label: 'placeholder', gridArea: '1 / 1 / 2 / 3' }, unstyled ? {} : { color: colors.neutral50, marginLeft: spacing.baseUnit / 2, marginRight: spacing.baseUnit / 2 }); }; var Placeholder = function Placeholder(props) { var children = props.children, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'placeholder', { placeholder: true }), innerProps), children); }; var Placeholder$1 = Placeholder; var index_a301f526_esm_css = function css(_ref, unstyled) { var isDisabled = _ref.isDisabled, _ref$theme = _ref.theme, spacing = _ref$theme.spacing, colors = _ref$theme.colors; return objectSpread2_objectSpread2({ label: 'singleValue', gridArea: '1 / 1 / 2 / 3', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, unstyled ? {} : { color: isDisabled ? colors.neutral40 : colors.neutral80, marginLeft: spacing.baseUnit / 2, marginRight: spacing.baseUnit / 2 }); }; var SingleValue = function SingleValue(props) { var children = props.children, isDisabled = props.isDisabled, innerProps = props.innerProps; return jsx("div", runtime_helpers_esm_extends_extends({}, getStyleProps(props, 'singleValue', { 'single-value': true, 'single-value--is-disabled': isDisabled }), innerProps), children); }; var SingleValue$1 = SingleValue; var index_a301f526_esm_components = { ClearIndicator: ClearIndicator, Control: Control$1, DropdownIndicator: DropdownIndicator, DownChevron: DownChevron, CrossIcon: CrossIcon, Group: Group$1, GroupHeading: GroupHeading, IndicatorsContainer: IndicatorsContainer, IndicatorSeparator: IndicatorSeparator, Input: Input$1, LoadingIndicator: LoadingIndicator, Menu: Menu$1, MenuList: index_a301f526_esm_MenuList, MenuPortal: MenuPortal, LoadingMessage: LoadingMessage, NoOptionsMessage: NoOptionsMessage, MultiValue: MultiValue$1, MultiValueContainer: MultiValueContainer, MultiValueLabel: MultiValueLabel, MultiValueRemove: MultiValueRemove, Option: Option$1, Placeholder: Placeholder$1, SelectContainer: SelectContainer, SingleValue: SingleValue$1, ValueContainer: ValueContainer }; var defaultComponents = function defaultComponents(props) { return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, index_a301f526_esm_components), props.components); }; ;// CONCATENATED MODULE: ./node_modules/memoize-one/dist/memoize-one.esm.js var safeIsNaN = Number.isNaN || function ponyfill(value) { return typeof value === 'number' && value !== value; }; function isEqual(first, second) { if (first === second) { return true; } if (safeIsNaN(first) && safeIsNaN(second)) { return true; } return false; } function areInputsEqual(newInputs, lastInputs) { if (newInputs.length !== lastInputs.length) { return false; } for (var i = 0; i < newInputs.length; i++) { if (!isEqual(newInputs[i], lastInputs[i])) { return false; } } return true; } function memoizeOne(resultFn, isEqual) { if (isEqual === void 0) { isEqual = areInputsEqual; } var cache = null; function memoized() { var newArgs = []; for (var _i = 0; _i < arguments.length; _i++) { newArgs[_i] = arguments[_i]; } if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) { return cache.lastResult; } var lastResult = resultFn.apply(this, newArgs); cache = { lastResult: lastResult, lastArgs: newArgs, lastThis: this, }; return lastResult; } memoized.clear = function clear() { cache = null; }; return memoized; } ;// CONCATENATED MODULE: ./node_modules/react-select/dist/Select-49a62830.esm.js function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { 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)."; } // Assistive text to describe visual elements. Hidden for sighted users. var Select_49a62830_esm_ref = true ? { name: "7pg0cj-a11yText", styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap" } : 0; var A11yText = function A11yText(props) { return jsx("span", runtime_helpers_esm_extends_extends({ css: Select_49a62830_esm_ref }, props)); }; var A11yText$1 = A11yText; var defaultAriaLiveMessages = { guidance: function guidance(props) { var isSearchable = props.isSearchable, isMulti = props.isMulti, tabSelectsValue = props.tabSelectsValue, context = props.context, isInitialFocus = props.isInitialFocus; switch (context) { case 'menu': return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', "."); case 'input': return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : ''; case 'value': return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value'; default: return ''; } }, onChange: function onChange(props) { var action = props.action, _props$label = props.label, label = _props$label === void 0 ? '' : _props$label, labels = props.labels, isDisabled = props.isDisabled; switch (action) { case 'deselect-option': case 'pop-value': case 'remove-value': return "option ".concat(label, ", deselected."); case 'clear': return 'All selected options have been cleared.'; case 'initial-input-focus': return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected."); case 'select-option': return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected."); default: return ''; } }, onFocus: function onFocus(props) { var context = props.context, focused = props.focused, options = props.options, _props$label2 = props.label, label = _props$label2 === void 0 ? '' : _props$label2, selectValue = props.selectValue, isDisabled = props.isDisabled, isSelected = props.isSelected, isAppleDevice = props.isAppleDevice; var getArrayIndex = function getArrayIndex(arr, item) { return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : ''; }; if (context === 'value' && selectValue) { return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), "."); } if (context === 'menu' && isAppleDevice) { var disabled = isDisabled ? ' disabled' : ''; var status = "".concat(isSelected ? ' selected' : '').concat(disabled); return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), "."); } return ''; }, onFilter: function onFilter(props) { var inputValue = props.inputValue, resultsMessage = props.resultsMessage; return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', "."); } }; var LiveRegion = function LiveRegion(props) { var ariaSelection = props.ariaSelection, focusedOption = props.focusedOption, focusedValue = props.focusedValue, focusableOptions = props.focusableOptions, isFocused = props.isFocused, selectValue = props.selectValue, selectProps = props.selectProps, id = props.id, isAppleDevice = props.isAppleDevice; var ariaLiveMessages = selectProps.ariaLiveMessages, getOptionLabel = selectProps.getOptionLabel, inputValue = selectProps.inputValue, isMulti = selectProps.isMulti, isOptionDisabled = selectProps.isOptionDisabled, isSearchable = selectProps.isSearchable, menuIsOpen = selectProps.menuIsOpen, options = selectProps.options, screenReaderStatus = selectProps.screenReaderStatus, tabSelectsValue = selectProps.tabSelectsValue, isLoading = selectProps.isLoading; var ariaLabel = selectProps['aria-label']; var ariaLive = selectProps['aria-live']; // Update aria live message configuration when prop changes var messages = (0,external_React_.useMemo)(function () { return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, defaultAriaLiveMessages), ariaLiveMessages || {}); }, [ariaLiveMessages]); // Update aria live selected option when prop changes var ariaSelected = (0,external_React_.useMemo)(function () { var message = ''; if (ariaSelection && messages.onChange) { var option = ariaSelection.option, selectedOptions = ariaSelection.options, removedValue = ariaSelection.removedValue, removedValues = ariaSelection.removedValues, value = ariaSelection.value; // select-option when !isMulti does not return option so we assume selected option is value var asOption = function asOption(val) { return !Array.isArray(val) ? val : null; }; // If there is just one item from the action then get its label var selected = removedValue || option || asOption(value); var label = selected ? getOptionLabel(selected) : ''; // If there are multiple items from the action then return an array of labels var multiSelected = selectedOptions || removedValues || undefined; var labels = multiSelected ? multiSelected.map(getOptionLabel) : []; var onChangeProps = objectSpread2_objectSpread2({ // multiSelected items are usually items that have already been selected // or set by the user as a default value so we assume they are not disabled isDisabled: selected && isOptionDisabled(selected, selectValue), label: label, labels: labels }, ariaSelection); message = messages.onChange(onChangeProps); } return message; }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]); var ariaFocused = (0,external_React_.useMemo)(function () { var focusMsg = ''; var focused = focusedOption || focusedValue; var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption)); if (focused && messages.onFocus) { var onFocusProps = { focused: focused, label: getOptionLabel(focused), isDisabled: isOptionDisabled(focused, selectValue), isSelected: isSelected, options: focusableOptions, context: focused === focusedOption ? 'menu' : 'value', selectValue: selectValue, isAppleDevice: isAppleDevice }; focusMsg = messages.onFocus(onFocusProps); } return focusMsg; }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]); var ariaResults = (0,external_React_.useMemo)(function () { var resultsMsg = ''; if (menuIsOpen && options.length && !isLoading && messages.onFilter) { var resultsMessage = screenReaderStatus({ count: focusableOptions.length }); resultsMsg = messages.onFilter({ inputValue: inputValue, resultsMessage: resultsMessage }); } return resultsMsg; }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]); var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus'; var ariaGuidance = (0,external_React_.useMemo)(function () { var guidanceMsg = ''; if (messages.guidance) { var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input'; guidanceMsg = messages.guidance({ 'aria-label': ariaLabel, context: context, isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue), isMulti: isMulti, isSearchable: isSearchable, tabSelectsValue: tabSelectsValue, isInitialFocus: isInitialFocus }); } return guidanceMsg; }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]); var ScreenReaderText = jsx(external_React_.Fragment, null, jsx("span", { id: "aria-selection" }, ariaSelected), jsx("span", { id: "aria-focused" }, ariaFocused), jsx("span", { id: "aria-results" }, ariaResults), jsx("span", { id: "aria-guidance" }, ariaGuidance)); return jsx(external_React_.Fragment, null, jsx(A11yText$1, { id: id }, isInitialFocus && ScreenReaderText), jsx(A11yText$1, { "aria-live": ariaLive, "aria-atomic": "false", "aria-relevant": "additions text", role: "log" }, isFocused && !isInitialFocus && ScreenReaderText)); }; var LiveRegion$1 = LiveRegion; var diacritics = [{ base: 'A', letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F" }, { base: 'AA', letters: "\uA732" }, { base: 'AE', letters: "\xC6\u01FC\u01E2" }, { base: 'AO', letters: "\uA734" }, { base: 'AU', letters: "\uA736" }, { base: 'AV', letters: "\uA738\uA73A" }, { base: 'AY', letters: "\uA73C" }, { base: 'B', letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181" }, { base: 'C', letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E" }, { base: 'D', letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779" }, { base: 'DZ', letters: "\u01F1\u01C4" }, { base: 'Dz', letters: "\u01F2\u01C5" }, { base: 'E', letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E" }, { base: 'F', letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B" }, { base: 'G', letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E" }, { base: 'H', letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D" }, { base: 'I', letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197" }, { base: 'J', letters: "J\u24BF\uFF2A\u0134\u0248" }, { base: 'K', letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2" }, { base: 'L', letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780" }, { base: 'LJ', letters: "\u01C7" }, { base: 'Lj', letters: "\u01C8" }, { base: 'M', letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C" }, { base: 'N', letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4" }, { base: 'NJ', letters: "\u01CA" }, { base: 'Nj', letters: "\u01CB" }, { base: 'O', letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C" }, { base: 'OI', letters: "\u01A2" }, { base: 'OO', letters: "\uA74E" }, { base: 'OU', letters: "\u0222" }, { base: 'P', letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754" }, { base: 'Q', letters: "Q\u24C6\uFF31\uA756\uA758\u024A" }, { base: 'R', letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782" }, { base: 'S', letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784" }, { base: 'T', letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786" }, { base: 'TZ', letters: "\uA728" }, { base: 'U', letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244" }, { base: 'V', letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245" }, { base: 'VY', letters: "\uA760" }, { base: 'W', letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72" }, { base: 'X', letters: "X\u24CD\uFF38\u1E8A\u1E8C" }, { base: 'Y', letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE" }, { base: 'Z', letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762" }, { base: 'a', letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250" }, { base: 'aa', letters: "\uA733" }, { base: 'ae', letters: "\xE6\u01FD\u01E3" }, { base: 'ao', letters: "\uA735" }, { base: 'au', letters: "\uA737" }, { base: 'av', letters: "\uA739\uA73B" }, { base: 'ay', letters: "\uA73D" }, { base: 'b', letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253" }, { base: 'c', letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184" }, { base: 'd', letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A" }, { base: 'dz', letters: "\u01F3\u01C6" }, { base: 'e', letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD" }, { base: 'f', letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C" }, { base: 'g', letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F" }, { base: 'h', letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265" }, { base: 'hv', letters: "\u0195" }, { base: 'i', letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131" }, { base: 'j', letters: "j\u24D9\uFF4A\u0135\u01F0\u0249" }, { base: 'k', letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3" }, { base: 'l', letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747" }, { base: 'lj', letters: "\u01C9" }, { base: 'm', letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F" }, { base: 'n', letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5" }, { base: 'nj', letters: "\u01CC" }, { base: 'o', letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275" }, { base: 'oi', letters: "\u01A3" }, { base: 'ou', letters: "\u0223" }, { base: 'oo', letters: "\uA74F" }, { base: 'p', letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755" }, { base: 'q', letters: "q\u24E0\uFF51\u024B\uA757\uA759" }, { base: 'r', letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783" }, { base: 's', letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B" }, { base: 't', letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787" }, { base: 'tz', letters: "\uA729" }, { base: 'u', letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289" }, { base: 'v', letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C" }, { base: 'vy', letters: "\uA761" }, { base: 'w', letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73" }, { base: 'x', letters: "x\u24E7\uFF58\u1E8B\u1E8D" }, { base: 'y', letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF" }, { base: 'z', letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763" }]; var anyDiacritic = new RegExp('[' + diacritics.map(function (d) { return d.letters; }).join('') + ']', 'g'); var diacriticToBase = {}; for (var i = 0; i < diacritics.length; i++) { var diacritic = diacritics[i]; for (var j = 0; j < diacritic.letters.length; j++) { diacriticToBase[diacritic.letters[j]] = diacritic.base; } } var stripDiacritics = function stripDiacritics(str) { return str.replace(anyDiacritic, function (match) { return diacriticToBase[match]; }); }; var memoizedStripDiacriticsForInput = memoizeOne(stripDiacritics); var trimString = function trimString(str) { return str.replace(/^\s+|\s+$/g, ''); }; var defaultStringify = function defaultStringify(option) { return "".concat(option.label, " ").concat(option.value); }; var createFilter = function createFilter(config) { return function (option, rawInput) { // eslint-disable-next-line no-underscore-dangle if (option.data.__isNew__) return true; var _ignoreCase$ignoreAcc = objectSpread2_objectSpread2({ ignoreCase: true, ignoreAccents: true, stringify: defaultStringify, trim: true, matchFrom: 'any' }, config), ignoreCase = _ignoreCase$ignoreAcc.ignoreCase, ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents, stringify = _ignoreCase$ignoreAcc.stringify, trim = _ignoreCase$ignoreAcc.trim, matchFrom = _ignoreCase$ignoreAcc.matchFrom; var input = trim ? trimString(rawInput) : rawInput; var candidate = trim ? trimString(stringify(option)) : stringify(option); if (ignoreCase) { input = input.toLowerCase(); candidate = candidate.toLowerCase(); } if (ignoreAccents) { input = memoizedStripDiacriticsForInput(input); candidate = stripDiacritics(candidate); } return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1; }; }; var Select_49a62830_esm_excluded = ["innerRef"]; function DummyInput(_ref) { var innerRef = _ref.innerRef, props = _objectWithoutProperties(_ref, Select_49a62830_esm_excluded); // Remove animation props not meant for HTML elements var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear'); return jsx("input", runtime_helpers_esm_extends_extends({ ref: innerRef }, filteredProps, { css: /*#__PURE__*/css({ label: 'dummyInput', // get rid of any default styles background: 0, border: 0, // important! this hides the flashing cursor caretColor: 'transparent', fontSize: 'inherit', gridArea: '1 / 1 / 2 / 3', outline: 0, padding: 0, // important! without `width` browsers won't allow focus width: 1, // remove cursor on desktop color: 'transparent', // remove cursor on mobile whilst maintaining "scroll into view" behaviour left: -100, opacity: 0, position: 'relative', transform: 'scale(.01)' }, true ? "" : 0, true ? "" : 0) })); } var cancelScroll = function cancelScroll(event) { if (event.cancelable) event.preventDefault(); event.stopPropagation(); }; function useScrollCapture(_ref) { var isEnabled = _ref.isEnabled, onBottomArrive = _ref.onBottomArrive, onBottomLeave = _ref.onBottomLeave, onTopArrive = _ref.onTopArrive, onTopLeave = _ref.onTopLeave; var isBottom = (0,external_React_.useRef)(false); var isTop = (0,external_React_.useRef)(false); var touchStart = (0,external_React_.useRef)(0); var scrollTarget = (0,external_React_.useRef)(null); var handleEventDelta = (0,external_React_.useCallback)(function (event, delta) { if (scrollTarget.current === null) return; var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight; var target = scrollTarget.current; var isDeltaPositive = delta > 0; var availableScroll = scrollHeight - clientHeight - scrollTop; var shouldCancelScroll = false; // reset bottom/top flags if (availableScroll > delta && isBottom.current) { if (onBottomLeave) onBottomLeave(event); isBottom.current = false; } if (isDeltaPositive && isTop.current) { if (onTopLeave) onTopLeave(event); isTop.current = false; } // bottom limit if (isDeltaPositive && delta > availableScroll) { if (onBottomArrive && !isBottom.current) { onBottomArrive(event); } target.scrollTop = scrollHeight; shouldCancelScroll = true; isBottom.current = true; // top limit } else if (!isDeltaPositive && -delta > scrollTop) { if (onTopArrive && !isTop.current) { onTopArrive(event); } target.scrollTop = 0; shouldCancelScroll = true; isTop.current = true; } // cancel scroll if (shouldCancelScroll) { cancelScroll(event); } }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]); var onWheel = (0,external_React_.useCallback)(function (event) { handleEventDelta(event, event.deltaY); }, [handleEventDelta]); var onTouchStart = (0,external_React_.useCallback)(function (event) { // set touch start so we can calculate touchmove delta touchStart.current = event.changedTouches[0].clientY; }, []); var onTouchMove = (0,external_React_.useCallback)(function (event) { var deltaY = touchStart.current - event.changedTouches[0].clientY; handleEventDelta(event, deltaY); }, [handleEventDelta]); var startListening = (0,external_React_.useCallback)(function (el) { // bail early if no element is available to attach to if (!el) return; var notPassive = supportsPassiveEvents ? { passive: false } : false; el.addEventListener('wheel', onWheel, notPassive); el.addEventListener('touchstart', onTouchStart, notPassive); el.addEventListener('touchmove', onTouchMove, notPassive); }, [onTouchMove, onTouchStart, onWheel]); var stopListening = (0,external_React_.useCallback)(function (el) { // bail early if no element is available to detach from if (!el) return; el.removeEventListener('wheel', onWheel, false); el.removeEventListener('touchstart', onTouchStart, false); el.removeEventListener('touchmove', onTouchMove, false); }, [onTouchMove, onTouchStart, onWheel]); (0,external_React_.useEffect)(function () { if (!isEnabled) return; var element = scrollTarget.current; startListening(element); return function () { stopListening(element); }; }, [isEnabled, startListening, stopListening]); return function (element) { scrollTarget.current = element; }; } var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position']; var LOCK_STYLES = { boxSizing: 'border-box', // account for possible declaration `width: 100%;` on body overflow: 'hidden', position: 'relative', height: '100%' }; function preventTouchMove(e) { e.preventDefault(); } function allowTouchMove(e) { e.stopPropagation(); } function preventInertiaScroll() { var top = this.scrollTop; var totalScroll = this.scrollHeight; var currentScroll = top + this.offsetHeight; if (top === 0) { this.scrollTop = 1; } else if (currentScroll === totalScroll) { this.scrollTop = top - 1; } } // `ontouchstart` check works on most browsers // `maxTouchPoints` works on IE10/11 and Surface function Select_49a62830_esm_isTouchDevice() { return 'ontouchstart' in window || navigator.maxTouchPoints; } var Select_49a62830_esm_canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); var activeScrollLocks = 0; var listenerOptions = { capture: false, passive: false }; function useScrollLock(_ref) { var isEnabled = _ref.isEnabled, _ref$accountForScroll = _ref.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll; var originalStyles = (0,external_React_.useRef)({}); var scrollTarget = (0,external_React_.useRef)(null); var addScrollLock = (0,external_React_.useCallback)(function (touchScrollTarget) { if (!Select_49a62830_esm_canUseDOM) return; var target = document.body; var targetStyle = target && target.style; if (accountForScrollbars) { // store any styles already applied to the body STYLE_KEYS.forEach(function (key) { var val = targetStyle && targetStyle[key]; originalStyles.current[key] = val; }); } // apply the lock styles and padding if this is the first scroll lock if (accountForScrollbars && activeScrollLocks < 1) { var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0; var clientWidth = document.body ? document.body.clientWidth : 0; var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0; Object.keys(LOCK_STYLES).forEach(function (key) { var val = LOCK_STYLES[key]; if (targetStyle) { targetStyle[key] = val; } }); if (targetStyle) { targetStyle.paddingRight = "".concat(adjustedPadding, "px"); } } // account for touch devices if (target && Select_49a62830_esm_isTouchDevice()) { // Mobile Safari ignores { overflow: hidden } declaration on the body. target.addEventListener('touchmove', preventTouchMove, listenerOptions); // Allow scroll on provided target if (touchScrollTarget) { touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions); touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions); } } // increment active scroll locks activeScrollLocks += 1; }, [accountForScrollbars]); var removeScrollLock = (0,external_React_.useCallback)(function (touchScrollTarget) { if (!Select_49a62830_esm_canUseDOM) return; var target = document.body; var targetStyle = target && target.style; // safely decrement active scroll locks activeScrollLocks = Math.max(activeScrollLocks - 1, 0); // reapply original body styles, if any if (accountForScrollbars && activeScrollLocks < 1) { STYLE_KEYS.forEach(function (key) { var val = originalStyles.current[key]; if (targetStyle) { targetStyle[key] = val; } }); } // remove touch listeners if (target && Select_49a62830_esm_isTouchDevice()) { target.removeEventListener('touchmove', preventTouchMove, listenerOptions); if (touchScrollTarget) { touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions); touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions); } } }, [accountForScrollbars]); (0,external_React_.useEffect)(function () { if (!isEnabled) return; var element = scrollTarget.current; addScrollLock(element); return function () { removeScrollLock(element); }; }, [isEnabled, addScrollLock, removeScrollLock]); return function (element) { scrollTarget.current = element; }; } function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { 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)."; } var blurSelectInput = function blurSelectInput(event) { var element = event.target; return element.ownerDocument.activeElement && element.ownerDocument.activeElement.blur(); }; var _ref2$1 = true ? { name: "1kfdb0e", styles: "position:fixed;left:0;bottom:0;right:0;top:0" } : 0; function ScrollManager(_ref) { var children = _ref.children, lockEnabled = _ref.lockEnabled, _ref$captureEnabled = _ref.captureEnabled, captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled, onBottomArrive = _ref.onBottomArrive, onBottomLeave = _ref.onBottomLeave, onTopArrive = _ref.onTopArrive, onTopLeave = _ref.onTopLeave; var setScrollCaptureTarget = useScrollCapture({ isEnabled: captureEnabled, onBottomArrive: onBottomArrive, onBottomLeave: onBottomLeave, onTopArrive: onTopArrive, onTopLeave: onTopLeave }); var setScrollLockTarget = useScrollLock({ isEnabled: lockEnabled }); var targetRef = function targetRef(element) { setScrollCaptureTarget(element); setScrollLockTarget(element); }; return jsx(external_React_.Fragment, null, lockEnabled && jsx("div", { onClick: blurSelectInput, css: _ref2$1 }), children(targetRef)); } function Select_49a62830_esm_EMOTION_STRINGIFIED_CSS_ERROR_() { 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)."; } var Select_49a62830_esm_ref2 = true ? { name: "1a0ro4n-requiredInput", styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%" } : 0; var RequiredInput = function RequiredInput(_ref) { var name = _ref.name, onFocus = _ref.onFocus; return jsx("input", { required: true, name: name, tabIndex: -1, "aria-hidden": "true", onFocus: onFocus, css: Select_49a62830_esm_ref2 // Prevent `Switching from uncontrolled to controlled` error , value: "", onChange: function onChange() {} }); }; var RequiredInput$1 = RequiredInput; /// <reference types="user-agent-data-types" /> function testPlatform(re) { var _window$navigator$use; return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false; } function Select_49a62830_esm_isIPhone() { return testPlatform(/^iPhone/i); } function Select_49a62830_esm_isMac() { return testPlatform(/^Mac/i); } function isIPad() { return testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support. Select_49a62830_esm_isMac() && navigator.maxTouchPoints > 1; } function isIOS() { return Select_49a62830_esm_isIPhone() || isIPad(); } function isAppleDevice() { return Select_49a62830_esm_isMac() || isIOS(); } var formatGroupLabel = function formatGroupLabel(group) { return group.label; }; var getOptionLabel$1 = function getOptionLabel(option) { return option.label; }; var getOptionValue$1 = function getOptionValue(option) { return option.value; }; var isOptionDisabled = function isOptionDisabled(option) { return !!option.isDisabled; }; var defaultStyles = { clearIndicator: clearIndicatorCSS, container: containerCSS, control: css$1, dropdownIndicator: dropdownIndicatorCSS, group: groupCSS, groupHeading: groupHeadingCSS, indicatorsContainer: indicatorsContainerCSS, indicatorSeparator: indicatorSeparatorCSS, input: inputCSS, loadingIndicator: loadingIndicatorCSS, loadingMessage: loadingMessageCSS, menu: menuCSS, menuList: menuListCSS, menuPortal: menuPortalCSS, multiValue: multiValueCSS, multiValueLabel: multiValueLabelCSS, multiValueRemove: multiValueRemoveCSS, noOptionsMessage: noOptionsMessageCSS, option: optionCSS, placeholder: placeholderCSS, singleValue: index_a301f526_esm_css, valueContainer: valueContainerCSS }; // Merge Utility // Allows consumers to extend a base Select with additional styles function mergeStyles(source) { var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // initialize with source styles var styles = _objectSpread({}, source); // massage in target styles Object.keys(target).forEach(function (keyAsString) { var key = keyAsString; if (source[key]) { styles[key] = function (rsCss, props) { return target[key](source[key](rsCss, props), props); }; } else { styles[key] = target[key]; } }); return styles; } var Select_49a62830_esm_colors = { primary: '#2684FF', primary75: '#4C9AFF', primary50: '#B2D4FF', primary25: '#DEEBFF', danger: '#DE350B', dangerLight: '#FFBDAD', neutral0: 'hsl(0, 0%, 100%)', neutral5: 'hsl(0, 0%, 95%)', neutral10: 'hsl(0, 0%, 90%)', neutral20: 'hsl(0, 0%, 80%)', neutral30: 'hsl(0, 0%, 70%)', neutral40: 'hsl(0, 0%, 60%)', neutral50: 'hsl(0, 0%, 50%)', neutral60: 'hsl(0, 0%, 40%)', neutral70: 'hsl(0, 0%, 30%)', neutral80: 'hsl(0, 0%, 20%)', neutral90: 'hsl(0, 0%, 10%)' }; var borderRadius = 4; // Used to calculate consistent margin/padding on elements var baseUnit = 4; // The minimum height of the control var controlHeight = 38; // The amount of space between the control and menu */ var menuGutter = baseUnit * 2; var Select_49a62830_esm_spacing = { baseUnit: baseUnit, controlHeight: controlHeight, menuGutter: menuGutter }; var defaultTheme = { borderRadius: borderRadius, colors: Select_49a62830_esm_colors, spacing: Select_49a62830_esm_spacing }; var Select_49a62830_esm_defaultProps = { 'aria-live': 'polite', backspaceRemovesValue: true, blurInputOnSelect: isTouchCapable(), captureMenuScroll: !isTouchCapable(), classNames: {}, closeMenuOnSelect: true, closeMenuOnScroll: false, components: {}, controlShouldRenderValue: true, escapeClearsValue: false, filterOption: createFilter(), formatGroupLabel: formatGroupLabel, getOptionLabel: getOptionLabel$1, getOptionValue: getOptionValue$1, isDisabled: false, isLoading: false, isMulti: false, isRtl: false, isSearchable: true, isOptionDisabled: isOptionDisabled, loadingMessage: function loadingMessage() { return 'Loading...'; }, maxMenuHeight: 300, minMenuHeight: 140, menuIsOpen: false, menuPlacement: 'bottom', menuPosition: 'absolute', menuShouldBlockScroll: false, menuShouldScrollIntoView: !isMobileDevice(), noOptionsMessage: function noOptionsMessage() { return 'No options'; }, openMenuOnFocus: false, openMenuOnClick: true, options: [], pageSize: 5, placeholder: 'Select...', screenReaderStatus: function screenReaderStatus(_ref) { var count = _ref.count; return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available"); }, styles: {}, tabIndex: 0, tabSelectsValue: true, unstyled: false }; function toCategorizedOption(props, option, selectValue, index) { var isDisabled = _isOptionDisabled(props, option, selectValue); var isSelected = _isOptionSelected(props, option, selectValue); var label = getOptionLabel(props, option); var value = getOptionValue(props, option); return { type: 'option', data: option, isDisabled: isDisabled, isSelected: isSelected, label: label, value: value, index: index }; } function buildCategorizedOptions(props, selectValue) { return props.options.map(function (groupOrOption, groupOrOptionIndex) { if ('options' in groupOrOption) { var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) { return toCategorizedOption(props, option, selectValue, optionIndex); }).filter(function (categorizedOption) { return Select_49a62830_esm_isFocusable(props, categorizedOption); }); return categorizedOptions.length > 0 ? { type: 'group', data: groupOrOption, options: categorizedOptions, index: groupOrOptionIndex } : undefined; } var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex); return Select_49a62830_esm_isFocusable(props, categorizedOption) ? categorizedOption : undefined; }).filter(notNullish); } function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) { return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) { if (categorizedOption.type === 'group') { optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) { return option.data; }))); } else { optionsAccumulator.push(categorizedOption.data); } return optionsAccumulator; }, []); } function buildFocusableOptionsWithIds(categorizedOptions, optionId) { return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) { if (categorizedOption.type === 'group') { optionsAccumulator.push.apply(optionsAccumulator, _toConsumableArray(categorizedOption.options.map(function (option) { return { data: option.data, id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index) }; }))); } else { optionsAccumulator.push({ data: categorizedOption.data, id: "".concat(optionId, "-").concat(categorizedOption.index) }); } return optionsAccumulator; }, []); } function buildFocusableOptions(props, selectValue) { return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue)); } function Select_49a62830_esm_isFocusable(props, categorizedOption) { var _props$inputValue = props.inputValue, inputValue = _props$inputValue === void 0 ? '' : _props$inputValue; var data = categorizedOption.data, isSelected = categorizedOption.isSelected, label = categorizedOption.label, value = categorizedOption.value; return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, { label: label, value: value, data: data }, inputValue); } function getNextFocusedValue(state, nextSelectValue) { var focusedValue = state.focusedValue, lastSelectValue = state.selectValue; var lastFocusedIndex = lastSelectValue.indexOf(focusedValue); if (lastFocusedIndex > -1) { var nextFocusedIndex = nextSelectValue.indexOf(focusedValue); if (nextFocusedIndex > -1) { // the focused value is still in the selectValue, return it return focusedValue; } else if (lastFocusedIndex < nextSelectValue.length) { // the focusedValue is not present in the next selectValue array by // reference, so return the new value at the same index return nextSelectValue[lastFocusedIndex]; } } return null; } function getNextFocusedOption(state, options) { var lastFocusedOption = state.focusedOption; return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0]; } var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) { var _focusableOptionsWith; var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) { return option.data === focusedOption; })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id; return focusedOptionId || null; }; var getOptionLabel = function getOptionLabel(props, data) { return props.getOptionLabel(data); }; var getOptionValue = function getOptionValue(props, data) { return props.getOptionValue(data); }; function _isOptionDisabled(props, option, selectValue) { return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false; } function _isOptionSelected(props, option, selectValue) { if (selectValue.indexOf(option) > -1) return true; if (typeof props.isOptionSelected === 'function') { return props.isOptionSelected(option, selectValue); } var candidate = getOptionValue(props, option); return selectValue.some(function (i) { return getOptionValue(props, i) === candidate; }); } function _filterOption(props, option, inputValue) { return props.filterOption ? props.filterOption(option, inputValue) : true; } var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) { var hideSelectedOptions = props.hideSelectedOptions, isMulti = props.isMulti; if (hideSelectedOptions === undefined) return isMulti; return hideSelectedOptions; }; var instanceId = 1; var Select_49a62830_esm_Select = /*#__PURE__*/function (_Component) { _inherits(Select, _Component); var _super = _createSuper(Select); // Misc. Instance Properties // ------------------------------ // TODO // Refs // ------------------------------ // Lifecycle // ------------------------------ function Select(_props) { var _this; _classCallCheck(this, Select); _this = _super.call(this, _props); _this.state = { ariaSelection: null, focusedOption: null, focusedOptionId: null, focusableOptionsWithIds: [], focusedValue: null, inputIsHidden: false, isFocused: false, selectValue: [], clearFocusValueOnUpdate: false, prevWasFocused: false, inputIsHiddenAfterUpdate: undefined, prevProps: undefined, instancePrefix: '' }; _this.blockOptionHover = false; _this.isComposing = false; _this.commonProps = void 0; _this.initialTouchX = 0; _this.initialTouchY = 0; _this.openAfterFocus = false; _this.scrollToFocusedOptionOnUpdate = false; _this.userIsDragging = void 0; _this.isAppleDevice = isAppleDevice(); _this.controlRef = null; _this.getControlRef = function (ref) { _this.controlRef = ref; }; _this.focusedOptionRef = null; _this.getFocusedOptionRef = function (ref) { _this.focusedOptionRef = ref; }; _this.menuListRef = null; _this.getMenuListRef = function (ref) { _this.menuListRef = ref; }; _this.inputRef = null; _this.getInputRef = function (ref) { _this.inputRef = ref; }; _this.focus = _this.focusInput; _this.blur = _this.blurInput; _this.onChange = function (newValue, actionMeta) { var _this$props = _this.props, onChange = _this$props.onChange, name = _this$props.name; actionMeta.name = name; _this.ariaOnChange(newValue, actionMeta); onChange(newValue, actionMeta); }; _this.setValue = function (newValue, action, option) { var _this$props2 = _this.props, closeMenuOnSelect = _this$props2.closeMenuOnSelect, isMulti = _this$props2.isMulti, inputValue = _this$props2.inputValue; _this.onInputChange('', { action: 'set-value', prevInputValue: inputValue }); if (closeMenuOnSelect) { _this.setState({ inputIsHiddenAfterUpdate: !isMulti }); _this.onMenuClose(); } // when the select value should change, we should reset focusedValue _this.setState({ clearFocusValueOnUpdate: true }); _this.onChange(newValue, { action: action, option: option }); }; _this.selectOption = function (newValue) { var _this$props3 = _this.props, blurInputOnSelect = _this$props3.blurInputOnSelect, isMulti = _this$props3.isMulti, name = _this$props3.name; var selectValue = _this.state.selectValue; var deselected = isMulti && _this.isOptionSelected(newValue, selectValue); var isDisabled = _this.isOptionDisabled(newValue, selectValue); if (deselected) { var candidate = _this.getOptionValue(newValue); _this.setValue(multiValueAsValue(selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; })), 'deselect-option', newValue); } else if (!isDisabled) { // Select option if option is not disabled if (isMulti) { _this.setValue(multiValueAsValue([].concat(_toConsumableArray(selectValue), [newValue])), 'select-option', newValue); } else { _this.setValue(singleValueAsValue(newValue), 'select-option'); } } else { _this.ariaOnChange(singleValueAsValue(newValue), { action: 'select-option', option: newValue, name: name }); return; } if (blurInputOnSelect) { _this.blurInput(); } }; _this.removeValue = function (removedValue) { var isMulti = _this.props.isMulti; var selectValue = _this.state.selectValue; var candidate = _this.getOptionValue(removedValue); var newValueArray = selectValue.filter(function (i) { return _this.getOptionValue(i) !== candidate; }); var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null); _this.onChange(newValue, { action: 'remove-value', removedValue: removedValue }); _this.focusInput(); }; _this.clearValue = function () { var selectValue = _this.state.selectValue; _this.onChange(valueTernary(_this.props.isMulti, [], null), { action: 'clear', removedValues: selectValue }); }; _this.popValue = function () { var isMulti = _this.props.isMulti; var selectValue = _this.state.selectValue; var lastSelectedValue = selectValue[selectValue.length - 1]; var newValueArray = selectValue.slice(0, selectValue.length - 1); var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null); _this.onChange(newValue, { action: 'pop-value', removedValue: lastSelectedValue }); }; _this.getFocusedOptionId = function (focusedOption) { return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption); }; _this.getFocusableOptionsWithIds = function () { return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option')); }; _this.getValue = function () { return _this.state.selectValue; }; _this.cx = function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return index_a301f526_esm_classNames.apply(void 0, [_this.props.classNamePrefix].concat(args)); }; _this.getOptionLabel = function (data) { return getOptionLabel(_this.props, data); }; _this.getOptionValue = function (data) { return getOptionValue(_this.props, data); }; _this.getStyles = function (key, props) { var unstyled = _this.props.unstyled; var base = defaultStyles[key](props, unstyled); base.boxSizing = 'border-box'; var custom = _this.props.styles[key]; return custom ? custom(base, props) : base; }; _this.getClassNames = function (key, props) { var _this$props$className, _this$props$className2; return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props); }; _this.getElementId = function (element) { return "".concat(_this.state.instancePrefix, "-").concat(element); }; _this.getComponents = function () { return defaultComponents(_this.props); }; _this.buildCategorizedOptions = function () { return buildCategorizedOptions(_this.props, _this.state.selectValue); }; _this.getCategorizedOptions = function () { return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : []; }; _this.buildFocusableOptions = function () { return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions()); }; _this.getFocusableOptions = function () { return _this.props.menuIsOpen ? _this.buildFocusableOptions() : []; }; _this.ariaOnChange = function (value, actionMeta) { _this.setState({ ariaSelection: objectSpread2_objectSpread2({ value: value }, actionMeta) }); }; _this.onMenuMouseDown = function (event) { if (event.button !== 0) { return; } event.stopPropagation(); event.preventDefault(); _this.focusInput(); }; _this.onMenuMouseMove = function (event) { _this.blockOptionHover = false; }; _this.onControlMouseDown = function (event) { // Event captured by dropdown indicator if (event.defaultPrevented) { return; } var openMenuOnClick = _this.props.openMenuOnClick; if (!_this.state.isFocused) { if (openMenuOnClick) { _this.openAfterFocus = true; } _this.focusInput(); } else if (!_this.props.menuIsOpen) { if (openMenuOnClick) { _this.openMenu('first'); } } else { if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') { _this.onMenuClose(); } } if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') { event.preventDefault(); } }; _this.onDropdownIndicatorMouseDown = function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } if (_this.props.isDisabled) return; var _this$props4 = _this.props, isMulti = _this$props4.isMulti, menuIsOpen = _this$props4.menuIsOpen; _this.focusInput(); if (menuIsOpen) { _this.setState({ inputIsHiddenAfterUpdate: !isMulti }); _this.onMenuClose(); } else { _this.openMenu('first'); } event.preventDefault(); }; _this.onClearIndicatorMouseDown = function (event) { // ignore mouse events that weren't triggered by the primary button if (event && event.type === 'mousedown' && event.button !== 0) { return; } _this.clearValue(); event.preventDefault(); _this.openAfterFocus = false; if (event.type === 'touchend') { _this.focusInput(); } else { setTimeout(function () { return _this.focusInput(); }); } }; _this.onScroll = function (event) { if (typeof _this.props.closeMenuOnScroll === 'boolean') { if (event.target instanceof HTMLElement && isDocumentElement(event.target)) { _this.props.onMenuClose(); } } else if (typeof _this.props.closeMenuOnScroll === 'function') { if (_this.props.closeMenuOnScroll(event)) { _this.props.onMenuClose(); } } }; _this.onCompositionStart = function () { _this.isComposing = true; }; _this.onCompositionEnd = function () { _this.isComposing = false; }; _this.onTouchStart = function (_ref2) { var touches = _ref2.touches; var touch = touches && touches.item(0); if (!touch) { return; } _this.initialTouchX = touch.clientX; _this.initialTouchY = touch.clientY; _this.userIsDragging = false; }; _this.onTouchMove = function (_ref3) { var touches = _ref3.touches; var touch = touches && touches.item(0); if (!touch) { return; } var deltaX = Math.abs(touch.clientX - _this.initialTouchX); var deltaY = Math.abs(touch.clientY - _this.initialTouchY); var moveThreshold = 5; _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold; }; _this.onTouchEnd = function (event) { if (_this.userIsDragging) return; // close the menu if the user taps outside // we're checking on event.target here instead of event.currentTarget, because we want to assert information // on events on child elements, not the document (which we've attached this handler to). if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) { _this.blurInput(); } // reset move vars _this.initialTouchX = 0; _this.initialTouchY = 0; }; _this.onControlTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onControlMouseDown(event); }; _this.onClearIndicatorTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onClearIndicatorMouseDown(event); }; _this.onDropdownIndicatorTouchEnd = function (event) { if (_this.userIsDragging) return; _this.onDropdownIndicatorMouseDown(event); }; _this.handleInputChange = function (event) { var prevInputValue = _this.props.inputValue; var inputValue = event.currentTarget.value; _this.setState({ inputIsHiddenAfterUpdate: false }); _this.onInputChange(inputValue, { action: 'input-change', prevInputValue: prevInputValue }); if (!_this.props.menuIsOpen) { _this.onMenuOpen(); } }; _this.onInputFocus = function (event) { if (_this.props.onFocus) { _this.props.onFocus(event); } _this.setState({ inputIsHiddenAfterUpdate: false, isFocused: true }); if (_this.openAfterFocus || _this.props.openMenuOnFocus) { _this.openMenu('first'); } _this.openAfterFocus = false; }; _this.onInputBlur = function (event) { var prevInputValue = _this.props.inputValue; if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) { _this.inputRef.focus(); return; } if (_this.props.onBlur) { _this.props.onBlur(event); } _this.onInputChange('', { action: 'input-blur', prevInputValue: prevInputValue }); _this.onMenuClose(); _this.setState({ focusedValue: null, isFocused: false }); }; _this.onOptionHover = function (focusedOption) { if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) { return; } var options = _this.getFocusableOptions(); var focusedOptionIndex = options.indexOf(focusedOption); _this.setState({ focusedOption: focusedOption, focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null }); }; _this.shouldHideSelectedOptions = function () { return shouldHideSelectedOptions(_this.props); }; _this.onValueInputFocus = function (e) { e.preventDefault(); e.stopPropagation(); _this.focus(); }; _this.onKeyDown = function (event) { var _this$props5 = _this.props, isMulti = _this$props5.isMulti, backspaceRemovesValue = _this$props5.backspaceRemovesValue, escapeClearsValue = _this$props5.escapeClearsValue, inputValue = _this$props5.inputValue, isClearable = _this$props5.isClearable, isDisabled = _this$props5.isDisabled, menuIsOpen = _this$props5.menuIsOpen, onKeyDown = _this$props5.onKeyDown, tabSelectsValue = _this$props5.tabSelectsValue, openMenuOnFocus = _this$props5.openMenuOnFocus; var _this$state = _this.state, focusedOption = _this$state.focusedOption, focusedValue = _this$state.focusedValue, selectValue = _this$state.selectValue; if (isDisabled) return; if (typeof onKeyDown === 'function') { onKeyDown(event); if (event.defaultPrevented) { return; } } // Block option hover events when the user has just pressed a key _this.blockOptionHover = true; switch (event.key) { case 'ArrowLeft': if (!isMulti || inputValue) return; _this.focusValue('previous'); break; case 'ArrowRight': if (!isMulti || inputValue) return; _this.focusValue('next'); break; case 'Delete': case 'Backspace': if (inputValue) return; if (focusedValue) { _this.removeValue(focusedValue); } else { if (!backspaceRemovesValue) return; if (isMulti) { _this.popValue(); } else if (isClearable) { _this.clearValue(); } } break; case 'Tab': if (_this.isComposing) return; if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused // option is already selected; it breaks the flow of navigation openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) { return; } _this.selectOption(focusedOption); break; case 'Enter': if (event.keyCode === 229) { // ignore the keydown event from an Input Method Editor(IME) // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode break; } if (menuIsOpen) { if (!focusedOption) return; if (_this.isComposing) return; _this.selectOption(focusedOption); break; } return; case 'Escape': if (menuIsOpen) { _this.setState({ inputIsHiddenAfterUpdate: false }); _this.onInputChange('', { action: 'menu-close', prevInputValue: inputValue }); _this.onMenuClose(); } else if (isClearable && escapeClearsValue) { _this.clearValue(); } break; case ' ': // space if (inputValue) { return; } if (!menuIsOpen) { _this.openMenu('first'); break; } if (!focusedOption) return; _this.selectOption(focusedOption); break; case 'ArrowUp': if (menuIsOpen) { _this.focusOption('up'); } else { _this.openMenu('last'); } break; case 'ArrowDown': if (menuIsOpen) { _this.focusOption('down'); } else { _this.openMenu('first'); } break; case 'PageUp': if (!menuIsOpen) return; _this.focusOption('pageup'); break; case 'PageDown': if (!menuIsOpen) return; _this.focusOption('pagedown'); break; case 'Home': if (!menuIsOpen) return; _this.focusOption('first'); break; case 'End': if (!menuIsOpen) return; _this.focusOption('last'); break; default: return; } event.preventDefault(); }; _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId); _this.state.selectValue = cleanValue(_props.value); // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen) if (_props.menuIsOpen && _this.state.selectValue.length) { var focusableOptionsWithIds = _this.getFocusableOptionsWithIds(); var focusableOptions = _this.buildFocusableOptions(); var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]); _this.state.focusableOptionsWithIds = focusableOptionsWithIds; _this.state.focusedOption = focusableOptions[optionIndex]; _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]); } return _this; } _createClass(Select, [{ key: "componentDidMount", value: function componentDidMount() { this.startListeningComposition(); this.startListeningToTouch(); if (this.props.closeMenuOnScroll && document && document.addEventListener) { // Listen to all scroll events, and filter them out inside of 'onScroll' document.addEventListener('scroll', this.onScroll, true); } if (this.props.autoFocus) { this.focusInput(); } // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen) if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) { scrollIntoView(this.menuListRef, this.focusedOptionRef); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props6 = this.props, isDisabled = _this$props6.isDisabled, menuIsOpen = _this$props6.menuIsOpen; var isFocused = this.state.isFocused; if ( // ensure focus is restored correctly when the control becomes enabled isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens isFocused && menuIsOpen && !prevProps.menuIsOpen) { this.focusInput(); } if (isFocused && isDisabled && !prevProps.isDisabled) { // ensure select state gets blurred in case Select is programmatically disabled while focused // eslint-disable-next-line react/no-did-update-set-state this.setState({ isFocused: false }, this.onMenuClose); } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) { // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox) // eslint-disable-next-line react/no-did-update-set-state this.setState({ isFocused: true }); } // scroll the focused option into view if necessary if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) { scrollIntoView(this.menuListRef, this.focusedOptionRef); this.scrollToFocusedOptionOnUpdate = false; } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.stopListeningComposition(); this.stopListeningToTouch(); document.removeEventListener('scroll', this.onScroll, true); } // ============================== // Consumer Handlers // ============================== }, { key: "onMenuOpen", value: function onMenuOpen() { this.props.onMenuOpen(); } }, { key: "onMenuClose", value: function onMenuClose() { this.onInputChange('', { action: 'menu-close', prevInputValue: this.props.inputValue }); this.props.onMenuClose(); } }, { key: "onInputChange", value: function onInputChange(newValue, actionMeta) { this.props.onInputChange(newValue, actionMeta); } // ============================== // Methods // ============================== }, { key: "focusInput", value: function focusInput() { if (!this.inputRef) return; this.inputRef.focus(); } }, { key: "blurInput", value: function blurInput() { if (!this.inputRef) return; this.inputRef.blur(); } // aliased for consumers }, { key: "openMenu", value: function openMenu(focusOption) { var _this2 = this; var _this$state2 = this.state, selectValue = _this$state2.selectValue, isFocused = _this$state2.isFocused; var focusableOptions = this.buildFocusableOptions(); var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1; if (!this.props.isMulti) { var selectedIndex = focusableOptions.indexOf(selectValue[0]); if (selectedIndex > -1) { openAtIndex = selectedIndex; } } // only scroll if the menu isn't already open this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef); this.setState({ inputIsHiddenAfterUpdate: false, focusedValue: null, focusedOption: focusableOptions[openAtIndex], focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex]) }, function () { return _this2.onMenuOpen(); }); } }, { key: "focusValue", value: function focusValue(direction) { var _this$state3 = this.state, selectValue = _this$state3.selectValue, focusedValue = _this$state3.focusedValue; // Only multiselects support value focusing if (!this.props.isMulti) return; this.setState({ focusedOption: null }); var focusedIndex = selectValue.indexOf(focusedValue); if (!focusedValue) { focusedIndex = -1; } var lastIndex = selectValue.length - 1; var nextFocus = -1; if (!selectValue.length) return; switch (direction) { case 'previous': if (focusedIndex === 0) { // don't cycle from the start to the end nextFocus = 0; } else if (focusedIndex === -1) { // if nothing is focused, focus the last value first nextFocus = lastIndex; } else { nextFocus = focusedIndex - 1; } break; case 'next': if (focusedIndex > -1 && focusedIndex < lastIndex) { nextFocus = focusedIndex + 1; } break; } this.setState({ inputIsHidden: nextFocus !== -1, focusedValue: selectValue[nextFocus] }); } }, { key: "focusOption", value: function focusOption() { var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first'; var pageSize = this.props.pageSize; var focusedOption = this.state.focusedOption; var options = this.getFocusableOptions(); if (!options.length) return; var nextFocus = 0; // handles 'first' var focusedIndex = options.indexOf(focusedOption); if (!focusedOption) { focusedIndex = -1; } if (direction === 'up') { nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1; } else if (direction === 'down') { nextFocus = (focusedIndex + 1) % options.length; } else if (direction === 'pageup') { nextFocus = focusedIndex - pageSize; if (nextFocus < 0) nextFocus = 0; } else if (direction === 'pagedown') { nextFocus = focusedIndex + pageSize; if (nextFocus > options.length - 1) nextFocus = options.length - 1; } else if (direction === 'last') { nextFocus = options.length - 1; } this.scrollToFocusedOptionOnUpdate = true; this.setState({ focusedOption: options[nextFocus], focusedValue: null, focusedOptionId: this.getFocusedOptionId(options[nextFocus]) }); } }, { key: "getTheme", value: // ============================== // Getters // ============================== function getTheme() { // Use the default theme if there are no customisations. if (!this.props.theme) { return defaultTheme; } // If the theme prop is a function, assume the function // knows how to merge the passed-in default theme with // its own modifications. if (typeof this.props.theme === 'function') { return this.props.theme(defaultTheme); } // Otherwise, if a plain theme object was passed in, // overlay it with the default theme. return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, defaultTheme), this.props.theme); } }, { key: "getCommonProps", value: function getCommonProps() { var clearValue = this.clearValue, cx = this.cx, getStyles = this.getStyles, getClassNames = this.getClassNames, getValue = this.getValue, selectOption = this.selectOption, setValue = this.setValue, props = this.props; var isMulti = props.isMulti, isRtl = props.isRtl, options = props.options; var hasValue = this.hasValue(); return { clearValue: clearValue, cx: cx, getStyles: getStyles, getClassNames: getClassNames, getValue: getValue, hasValue: hasValue, isMulti: isMulti, isRtl: isRtl, options: options, selectOption: selectOption, selectProps: props, setValue: setValue, theme: this.getTheme() }; } }, { key: "hasValue", value: function hasValue() { var selectValue = this.state.selectValue; return selectValue.length > 0; } }, { key: "hasOptions", value: function hasOptions() { return !!this.getFocusableOptions().length; } }, { key: "isClearable", value: function isClearable() { var _this$props7 = this.props, isClearable = _this$props7.isClearable, isMulti = _this$props7.isMulti; // single select, by default, IS NOT clearable // multi select, by default, IS clearable if (isClearable === undefined) return isMulti; return isClearable; } }, { key: "isOptionDisabled", value: function isOptionDisabled(option, selectValue) { return _isOptionDisabled(this.props, option, selectValue); } }, { key: "isOptionSelected", value: function isOptionSelected(option, selectValue) { return _isOptionSelected(this.props, option, selectValue); } }, { key: "filterOption", value: function filterOption(option, inputValue) { return _filterOption(this.props, option, inputValue); } }, { key: "formatOptionLabel", value: function formatOptionLabel(data, context) { if (typeof this.props.formatOptionLabel === 'function') { var _inputValue = this.props.inputValue; var _selectValue = this.state.selectValue; return this.props.formatOptionLabel(data, { context: context, inputValue: _inputValue, selectValue: _selectValue }); } else { return this.getOptionLabel(data); } } }, { key: "formatGroupLabel", value: function formatGroupLabel(data) { return this.props.formatGroupLabel(data); } // ============================== // Mouse Handlers // ============================== }, { key: "startListeningComposition", value: // ============================== // Composition Handlers // ============================== function startListeningComposition() { if (document && document.addEventListener) { document.addEventListener('compositionstart', this.onCompositionStart, false); document.addEventListener('compositionend', this.onCompositionEnd, false); } } }, { key: "stopListeningComposition", value: function stopListeningComposition() { if (document && document.removeEventListener) { document.removeEventListener('compositionstart', this.onCompositionStart); document.removeEventListener('compositionend', this.onCompositionEnd); } } }, { key: "startListeningToTouch", value: // ============================== // Touch Handlers // ============================== function startListeningToTouch() { if (document && document.addEventListener) { document.addEventListener('touchstart', this.onTouchStart, false); document.addEventListener('touchmove', this.onTouchMove, false); document.addEventListener('touchend', this.onTouchEnd, false); } } }, { key: "stopListeningToTouch", value: function stopListeningToTouch() { if (document && document.removeEventListener) { document.removeEventListener('touchstart', this.onTouchStart); document.removeEventListener('touchmove', this.onTouchMove); document.removeEventListener('touchend', this.onTouchEnd); } } }, { key: "renderInput", value: // ============================== // Renderers // ============================== function renderInput() { var _this$props8 = this.props, isDisabled = _this$props8.isDisabled, isSearchable = _this$props8.isSearchable, inputId = _this$props8.inputId, inputValue = _this$props8.inputValue, tabIndex = _this$props8.tabIndex, form = _this$props8.form, menuIsOpen = _this$props8.menuIsOpen, required = _this$props8.required; var _this$getComponents = this.getComponents(), Input = _this$getComponents.Input; var _this$state4 = this.state, inputIsHidden = _this$state4.inputIsHidden, ariaSelection = _this$state4.ariaSelection; var commonProps = this.commonProps; var id = inputId || this.getElementId('input'); // aria attributes makes the JSX "noisy", separated for clarity var ariaAttributes = objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({ 'aria-autocomplete': 'list', 'aria-expanded': menuIsOpen, 'aria-haspopup': true, 'aria-errormessage': this.props['aria-errormessage'], 'aria-invalid': this.props['aria-invalid'], 'aria-label': this.props['aria-label'], 'aria-labelledby': this.props['aria-labelledby'], 'aria-required': required, role: 'combobox', 'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || '' }, menuIsOpen && { 'aria-controls': this.getElementId('listbox') }), !isSearchable && { 'aria-readonly': true }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && { 'aria-describedby': this.getElementId('live-region') } : { 'aria-describedby': this.getElementId('placeholder') }); if (!isSearchable) { // use a dummy input to maintain focus/blur functionality return /*#__PURE__*/external_React_.createElement(DummyInput, runtime_helpers_esm_extends_extends({ id: id, innerRef: this.getInputRef, onBlur: this.onInputBlur, onChange: index_a301f526_esm_noop, onFocus: this.onInputFocus, disabled: isDisabled, tabIndex: tabIndex, inputMode: "none", form: form, value: "" }, ariaAttributes)); } return /*#__PURE__*/external_React_.createElement(Input, runtime_helpers_esm_extends_extends({}, commonProps, { autoCapitalize: "none", autoComplete: "off", autoCorrect: "off", id: id, innerRef: this.getInputRef, isDisabled: isDisabled, isHidden: inputIsHidden, onBlur: this.onInputBlur, onChange: this.handleInputChange, onFocus: this.onInputFocus, spellCheck: "false", tabIndex: tabIndex, form: form, type: "text", value: inputValue }, ariaAttributes)); } }, { key: "renderPlaceholderOrValue", value: function renderPlaceholderOrValue() { var _this3 = this; var _this$getComponents2 = this.getComponents(), MultiValue = _this$getComponents2.MultiValue, MultiValueContainer = _this$getComponents2.MultiValueContainer, MultiValueLabel = _this$getComponents2.MultiValueLabel, MultiValueRemove = _this$getComponents2.MultiValueRemove, SingleValue = _this$getComponents2.SingleValue, Placeholder = _this$getComponents2.Placeholder; var commonProps = this.commonProps; var _this$props9 = this.props, controlShouldRenderValue = _this$props9.controlShouldRenderValue, isDisabled = _this$props9.isDisabled, isMulti = _this$props9.isMulti, inputValue = _this$props9.inputValue, placeholder = _this$props9.placeholder; var _this$state5 = this.state, selectValue = _this$state5.selectValue, focusedValue = _this$state5.focusedValue, isFocused = _this$state5.isFocused; if (!this.hasValue() || !controlShouldRenderValue) { return inputValue ? null : /*#__PURE__*/external_React_.createElement(Placeholder, runtime_helpers_esm_extends_extends({}, commonProps, { key: "placeholder", isDisabled: isDisabled, isFocused: isFocused, innerProps: { id: this.getElementId('placeholder') } }), placeholder); } if (isMulti) { return selectValue.map(function (opt, index) { var isOptionFocused = opt === focusedValue; var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt)); return /*#__PURE__*/external_React_.createElement(MultiValue, runtime_helpers_esm_extends_extends({}, commonProps, { components: { Container: MultiValueContainer, Label: MultiValueLabel, Remove: MultiValueRemove }, isFocused: isOptionFocused, isDisabled: isDisabled, key: key, index: index, removeProps: { onClick: function onClick() { return _this3.removeValue(opt); }, onTouchEnd: function onTouchEnd() { return _this3.removeValue(opt); }, onMouseDown: function onMouseDown(e) { e.preventDefault(); } }, data: opt }), _this3.formatOptionLabel(opt, 'value')); }); } if (inputValue) { return null; } var singleValue = selectValue[0]; return /*#__PURE__*/external_React_.createElement(SingleValue, runtime_helpers_esm_extends_extends({}, commonProps, { data: singleValue, isDisabled: isDisabled }), this.formatOptionLabel(singleValue, 'value')); } }, { key: "renderClearIndicator", value: function renderClearIndicator() { var _this$getComponents3 = this.getComponents(), ClearIndicator = _this$getComponents3.ClearIndicator; var commonProps = this.commonProps; var _this$props10 = this.props, isDisabled = _this$props10.isDisabled, isLoading = _this$props10.isLoading; var isFocused = this.state.isFocused; if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) { return null; } var innerProps = { onMouseDown: this.onClearIndicatorMouseDown, onTouchEnd: this.onClearIndicatorTouchEnd, 'aria-hidden': 'true' }; return /*#__PURE__*/external_React_.createElement(ClearIndicator, runtime_helpers_esm_extends_extends({}, commonProps, { innerProps: innerProps, isFocused: isFocused })); } }, { key: "renderLoadingIndicator", value: function renderLoadingIndicator() { var _this$getComponents4 = this.getComponents(), LoadingIndicator = _this$getComponents4.LoadingIndicator; var commonProps = this.commonProps; var _this$props11 = this.props, isDisabled = _this$props11.isDisabled, isLoading = _this$props11.isLoading; var isFocused = this.state.isFocused; if (!LoadingIndicator || !isLoading) return null; var innerProps = { 'aria-hidden': 'true' }; return /*#__PURE__*/external_React_.createElement(LoadingIndicator, runtime_helpers_esm_extends_extends({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderIndicatorSeparator", value: function renderIndicatorSeparator() { var _this$getComponents5 = this.getComponents(), DropdownIndicator = _this$getComponents5.DropdownIndicator, IndicatorSeparator = _this$getComponents5.IndicatorSeparator; // separator doesn't make sense without the dropdown indicator if (!DropdownIndicator || !IndicatorSeparator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; return /*#__PURE__*/external_React_.createElement(IndicatorSeparator, runtime_helpers_esm_extends_extends({}, commonProps, { isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderDropdownIndicator", value: function renderDropdownIndicator() { var _this$getComponents6 = this.getComponents(), DropdownIndicator = _this$getComponents6.DropdownIndicator; if (!DropdownIndicator) return null; var commonProps = this.commonProps; var isDisabled = this.props.isDisabled; var isFocused = this.state.isFocused; var innerProps = { onMouseDown: this.onDropdownIndicatorMouseDown, onTouchEnd: this.onDropdownIndicatorTouchEnd, 'aria-hidden': 'true' }; return /*#__PURE__*/external_React_.createElement(DropdownIndicator, runtime_helpers_esm_extends_extends({}, commonProps, { innerProps: innerProps, isDisabled: isDisabled, isFocused: isFocused })); } }, { key: "renderMenu", value: function renderMenu() { var _this4 = this; var _this$getComponents7 = this.getComponents(), Group = _this$getComponents7.Group, GroupHeading = _this$getComponents7.GroupHeading, Menu = _this$getComponents7.Menu, MenuList = _this$getComponents7.MenuList, MenuPortal = _this$getComponents7.MenuPortal, LoadingMessage = _this$getComponents7.LoadingMessage, NoOptionsMessage = _this$getComponents7.NoOptionsMessage, Option = _this$getComponents7.Option; var commonProps = this.commonProps; var focusedOption = this.state.focusedOption; var _this$props12 = this.props, captureMenuScroll = _this$props12.captureMenuScroll, inputValue = _this$props12.inputValue, isLoading = _this$props12.isLoading, loadingMessage = _this$props12.loadingMessage, minMenuHeight = _this$props12.minMenuHeight, maxMenuHeight = _this$props12.maxMenuHeight, menuIsOpen = _this$props12.menuIsOpen, menuPlacement = _this$props12.menuPlacement, menuPosition = _this$props12.menuPosition, menuPortalTarget = _this$props12.menuPortalTarget, menuShouldBlockScroll = _this$props12.menuShouldBlockScroll, menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView, noOptionsMessage = _this$props12.noOptionsMessage, onMenuScrollToTop = _this$props12.onMenuScrollToTop, onMenuScrollToBottom = _this$props12.onMenuScrollToBottom; if (!menuIsOpen) return null; // TODO: Internal Option Type here var render = function render(props, id) { var type = props.type, data = props.data, isDisabled = props.isDisabled, isSelected = props.isSelected, label = props.label, value = props.value; var isFocused = focusedOption === data; var onHover = isDisabled ? undefined : function () { return _this4.onOptionHover(data); }; var onSelect = isDisabled ? undefined : function () { return _this4.selectOption(data); }; var optionId = "".concat(_this4.getElementId('option'), "-").concat(id); var innerProps = { id: optionId, onClick: onSelect, onMouseMove: onHover, onMouseOver: onHover, tabIndex: -1, role: 'option', 'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices }; return /*#__PURE__*/external_React_.createElement(Option, runtime_helpers_esm_extends_extends({}, commonProps, { innerProps: innerProps, data: data, isDisabled: isDisabled, isSelected: isSelected, key: optionId, label: label, type: type, value: value, isFocused: isFocused, innerRef: isFocused ? _this4.getFocusedOptionRef : undefined }), _this4.formatOptionLabel(props.data, 'menu')); }; var menuUI; if (this.hasOptions()) { menuUI = this.getCategorizedOptions().map(function (item) { if (item.type === 'group') { var _data = item.data, options = item.options, groupIndex = item.index; var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex); var headingId = "".concat(groupId, "-heading"); return /*#__PURE__*/external_React_.createElement(Group, runtime_helpers_esm_extends_extends({}, commonProps, { key: groupId, data: _data, options: options, Heading: GroupHeading, headingProps: { id: headingId, data: item.data }, label: _this4.formatGroupLabel(item.data) }), item.options.map(function (option) { return render(option, "".concat(groupIndex, "-").concat(option.index)); })); } else if (item.type === 'option') { return render(item, "".concat(item.index)); } }); } else if (isLoading) { var message = loadingMessage({ inputValue: inputValue }); if (message === null) return null; menuUI = /*#__PURE__*/external_React_.createElement(LoadingMessage, commonProps, message); } else { var _message = noOptionsMessage({ inputValue: inputValue }); if (_message === null) return null; menuUI = /*#__PURE__*/external_React_.createElement(NoOptionsMessage, commonProps, _message); } var menuPlacementProps = { minMenuHeight: minMenuHeight, maxMenuHeight: maxMenuHeight, menuPlacement: menuPlacement, menuPosition: menuPosition, menuShouldScrollIntoView: menuShouldScrollIntoView }; var menuElement = /*#__PURE__*/external_React_.createElement(MenuPlacer, runtime_helpers_esm_extends_extends({}, commonProps, menuPlacementProps), function (_ref4) { var ref = _ref4.ref, _ref4$placerProps = _ref4.placerProps, placement = _ref4$placerProps.placement, maxHeight = _ref4$placerProps.maxHeight; return /*#__PURE__*/external_React_.createElement(Menu, runtime_helpers_esm_extends_extends({}, commonProps, menuPlacementProps, { innerRef: ref, innerProps: { onMouseDown: _this4.onMenuMouseDown, onMouseMove: _this4.onMenuMouseMove }, isLoading: isLoading, placement: placement }), /*#__PURE__*/external_React_.createElement(ScrollManager, { captureEnabled: captureMenuScroll, onTopArrive: onMenuScrollToTop, onBottomArrive: onMenuScrollToBottom, lockEnabled: menuShouldBlockScroll }, function (scrollTargetRef) { return /*#__PURE__*/external_React_.createElement(MenuList, runtime_helpers_esm_extends_extends({}, commonProps, { innerRef: function innerRef(instance) { _this4.getMenuListRef(instance); scrollTargetRef(instance); }, innerProps: { role: 'listbox', 'aria-multiselectable': commonProps.isMulti, id: _this4.getElementId('listbox') }, isLoading: isLoading, maxHeight: maxHeight, focusedOption: focusedOption }), menuUI); })); }); // positioning behaviour is almost identical for portalled and fixed, // so we use the same component. the actual portalling logic is forked // within the component based on `menuPosition` return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/external_React_.createElement(MenuPortal, runtime_helpers_esm_extends_extends({}, commonProps, { appendTo: menuPortalTarget, controlElement: this.controlRef, menuPlacement: menuPlacement, menuPosition: menuPosition }), menuElement) : menuElement; } }, { key: "renderFormField", value: function renderFormField() { var _this5 = this; var _this$props13 = this.props, delimiter = _this$props13.delimiter, isDisabled = _this$props13.isDisabled, isMulti = _this$props13.isMulti, name = _this$props13.name, required = _this$props13.required; var selectValue = this.state.selectValue; if (required && !this.hasValue() && !isDisabled) { return /*#__PURE__*/external_React_.createElement(RequiredInput$1, { name: name, onFocus: this.onValueInputFocus }); } if (!name || isDisabled) return; if (isMulti) { if (delimiter) { var value = selectValue.map(function (opt) { return _this5.getOptionValue(opt); }).join(delimiter); return /*#__PURE__*/external_React_.createElement("input", { name: name, type: "hidden", value: value }); } else { var input = selectValue.length > 0 ? selectValue.map(function (opt, i) { return /*#__PURE__*/external_React_.createElement("input", { key: "i-".concat(i), name: name, type: "hidden", value: _this5.getOptionValue(opt) }); }) : /*#__PURE__*/external_React_.createElement("input", { name: name, type: "hidden", value: "" }); return /*#__PURE__*/external_React_.createElement("div", null, input); } } else { var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : ''; return /*#__PURE__*/external_React_.createElement("input", { name: name, type: "hidden", value: _value }); } } }, { key: "renderLiveRegion", value: function renderLiveRegion() { var commonProps = this.commonProps; var _this$state6 = this.state, ariaSelection = _this$state6.ariaSelection, focusedOption = _this$state6.focusedOption, focusedValue = _this$state6.focusedValue, isFocused = _this$state6.isFocused, selectValue = _this$state6.selectValue; var focusableOptions = this.getFocusableOptions(); return /*#__PURE__*/external_React_.createElement(LiveRegion$1, runtime_helpers_esm_extends_extends({}, commonProps, { id: this.getElementId('live-region'), ariaSelection: ariaSelection, focusedOption: focusedOption, focusedValue: focusedValue, isFocused: isFocused, selectValue: selectValue, focusableOptions: focusableOptions, isAppleDevice: this.isAppleDevice })); } }, { key: "render", value: function render() { var _this$getComponents8 = this.getComponents(), Control = _this$getComponents8.Control, IndicatorsContainer = _this$getComponents8.IndicatorsContainer, SelectContainer = _this$getComponents8.SelectContainer, ValueContainer = _this$getComponents8.ValueContainer; var _this$props14 = this.props, className = _this$props14.className, id = _this$props14.id, isDisabled = _this$props14.isDisabled, menuIsOpen = _this$props14.menuIsOpen; var isFocused = this.state.isFocused; var commonProps = this.commonProps = this.getCommonProps(); return /*#__PURE__*/external_React_.createElement(SelectContainer, runtime_helpers_esm_extends_extends({}, commonProps, { className: className, innerProps: { id: id, onKeyDown: this.onKeyDown }, isDisabled: isDisabled, isFocused: isFocused }), this.renderLiveRegion(), /*#__PURE__*/external_React_.createElement(Control, runtime_helpers_esm_extends_extends({}, commonProps, { innerRef: this.getControlRef, innerProps: { onMouseDown: this.onControlMouseDown, onTouchEnd: this.onControlTouchEnd }, isDisabled: isDisabled, isFocused: isFocused, menuIsOpen: menuIsOpen }), /*#__PURE__*/external_React_.createElement(ValueContainer, runtime_helpers_esm_extends_extends({}, commonProps, { isDisabled: isDisabled }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/external_React_.createElement(IndicatorsContainer, runtime_helpers_esm_extends_extends({}, commonProps, { isDisabled: isDisabled }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField()); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { var prevProps = state.prevProps, clearFocusValueOnUpdate = state.clearFocusValueOnUpdate, inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate, ariaSelection = state.ariaSelection, isFocused = state.isFocused, prevWasFocused = state.prevWasFocused, instancePrefix = state.instancePrefix; var options = props.options, value = props.value, menuIsOpen = props.menuIsOpen, inputValue = props.inputValue, isMulti = props.isMulti; var selectValue = cleanValue(value); var newMenuOptionsState = {}; if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) { var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : []; var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : []; var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null; var focusedOption = getNextFocusedOption(state, focusableOptions); var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption); newMenuOptionsState = { selectValue: selectValue, focusedOption: focusedOption, focusedOptionId: focusedOptionId, focusableOptionsWithIds: focusableOptionsWithIds, focusedValue: focusedValue, clearFocusValueOnUpdate: false }; } // some updates should toggle the state of the input visibility var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? { inputIsHidden: inputIsHiddenAfterUpdate, inputIsHiddenAfterUpdate: undefined } : {}; var newAriaSelection = ariaSelection; var hasKeptFocus = isFocused && prevWasFocused; if (isFocused && !hasKeptFocus) { // If `value` or `defaultValue` props are not empty then announce them // when the Select is initially focused newAriaSelection = { value: valueTernary(isMulti, selectValue, selectValue[0] || null), options: selectValue, action: 'initial-input-focus' }; hasKeptFocus = !prevWasFocused; } // If the 'initial-input-focus' action has been set already // then reset the ariaSelection to null if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') { newAriaSelection = null; } return objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, newMenuOptionsState), newInputIsHiddenState), {}, { prevProps: props, ariaSelection: newAriaSelection, prevWasFocused: hasKeptFocus }); } }]); return Select; }(external_React_.Component); Select_49a62830_esm_Select.defaultProps = Select_49a62830_esm_defaultProps; ;// CONCATENATED MODULE: ./node_modules/react-select/dist/useStateManager-7e1e8489.esm.js var useStateManager_7e1e8489_esm_excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"]; function useStateManager(_ref) { var _ref$defaultInputValu = _ref.defaultInputValue, defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu, _ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen, defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe, _ref$defaultValue = _ref.defaultValue, defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue, propsInputValue = _ref.inputValue, propsMenuIsOpen = _ref.menuIsOpen, propsOnChange = _ref.onChange, propsOnInputChange = _ref.onInputChange, propsOnMenuClose = _ref.onMenuClose, propsOnMenuOpen = _ref.onMenuOpen, propsValue = _ref.value, restSelectProps = _objectWithoutProperties(_ref, useStateManager_7e1e8489_esm_excluded); var _useState = (0,external_React_.useState)(propsInputValue !== undefined ? propsInputValue : defaultInputValue), _useState2 = slicedToArray_slicedToArray(_useState, 2), stateInputValue = _useState2[0], setStateInputValue = _useState2[1]; var _useState3 = (0,external_React_.useState)(propsMenuIsOpen !== undefined ? propsMenuIsOpen : defaultMenuIsOpen), _useState4 = slicedToArray_slicedToArray(_useState3, 2), stateMenuIsOpen = _useState4[0], setStateMenuIsOpen = _useState4[1]; var _useState5 = (0,external_React_.useState)(propsValue !== undefined ? propsValue : defaultValue), _useState6 = slicedToArray_slicedToArray(_useState5, 2), stateValue = _useState6[0], setStateValue = _useState6[1]; var onChange = (0,external_React_.useCallback)(function (value, actionMeta) { if (typeof propsOnChange === 'function') { propsOnChange(value, actionMeta); } setStateValue(value); }, [propsOnChange]); var onInputChange = (0,external_React_.useCallback)(function (value, actionMeta) { var newValue; if (typeof propsOnInputChange === 'function') { newValue = propsOnInputChange(value, actionMeta); } setStateInputValue(newValue !== undefined ? newValue : value); }, [propsOnInputChange]); var onMenuOpen = (0,external_React_.useCallback)(function () { if (typeof propsOnMenuOpen === 'function') { propsOnMenuOpen(); } setStateMenuIsOpen(true); }, [propsOnMenuOpen]); var onMenuClose = (0,external_React_.useCallback)(function () { if (typeof propsOnMenuClose === 'function') { propsOnMenuClose(); } setStateMenuIsOpen(false); }, [propsOnMenuClose]); var inputValue = propsInputValue !== undefined ? propsInputValue : stateInputValue; var menuIsOpen = propsMenuIsOpen !== undefined ? propsMenuIsOpen : stateMenuIsOpen; var value = propsValue !== undefined ? propsValue : stateValue; return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restSelectProps), {}, { inputValue: inputValue, menuIsOpen: menuIsOpen, onChange: onChange, onInputChange: onInputChange, onMenuClose: onMenuClose, onMenuOpen: onMenuOpen, value: value }); } ;// CONCATENATED MODULE: ./node_modules/react-select/dist/useAsync-ba7c6b77.esm.js var useAsync_ba7c6b77_esm_excluded = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"]; function useAsync(_ref) { var _ref$defaultOptions = _ref.defaultOptions, propsDefaultOptions = _ref$defaultOptions === void 0 ? false : _ref$defaultOptions, _ref$cacheOptions = _ref.cacheOptions, cacheOptions = _ref$cacheOptions === void 0 ? false : _ref$cacheOptions, propsLoadOptions = _ref.loadOptions; _ref.options; var _ref$isLoading = _ref.isLoading, propsIsLoading = _ref$isLoading === void 0 ? false : _ref$isLoading, propsOnInputChange = _ref.onInputChange, _ref$filterOption = _ref.filterOption, filterOption = _ref$filterOption === void 0 ? null : _ref$filterOption, restSelectProps = _objectWithoutProperties(_ref, useAsync_ba7c6b77_esm_excluded); var propsInputValue = restSelectProps.inputValue; var lastRequest = (0,external_React_.useRef)(undefined); var mounted = (0,external_React_.useRef)(false); var _useState = (0,external_React_.useState)(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined), _useState2 = slicedToArray_slicedToArray(_useState, 2), defaultOptions = _useState2[0], setDefaultOptions = _useState2[1]; var _useState3 = (0,external_React_.useState)(typeof propsInputValue !== 'undefined' ? propsInputValue : ''), _useState4 = slicedToArray_slicedToArray(_useState3, 2), stateInputValue = _useState4[0], setStateInputValue = _useState4[1]; var _useState5 = (0,external_React_.useState)(propsDefaultOptions === true), _useState6 = slicedToArray_slicedToArray(_useState5, 2), isLoading = _useState6[0], setIsLoading = _useState6[1]; var _useState7 = (0,external_React_.useState)(undefined), _useState8 = slicedToArray_slicedToArray(_useState7, 2), loadedInputValue = _useState8[0], setLoadedInputValue = _useState8[1]; var _useState9 = (0,external_React_.useState)([]), _useState10 = slicedToArray_slicedToArray(_useState9, 2), loadedOptions = _useState10[0], setLoadedOptions = _useState10[1]; var _useState11 = (0,external_React_.useState)(false), _useState12 = slicedToArray_slicedToArray(_useState11, 2), passEmptyOptions = _useState12[0], setPassEmptyOptions = _useState12[1]; var _useState13 = (0,external_React_.useState)({}), _useState14 = slicedToArray_slicedToArray(_useState13, 2), optionsCache = _useState14[0], setOptionsCache = _useState14[1]; var _useState15 = (0,external_React_.useState)(undefined), _useState16 = slicedToArray_slicedToArray(_useState15, 2), prevDefaultOptions = _useState16[0], setPrevDefaultOptions = _useState16[1]; var _useState17 = (0,external_React_.useState)(undefined), _useState18 = slicedToArray_slicedToArray(_useState17, 2), prevCacheOptions = _useState18[0], setPrevCacheOptions = _useState18[1]; if (cacheOptions !== prevCacheOptions) { setOptionsCache({}); setPrevCacheOptions(cacheOptions); } if (propsDefaultOptions !== prevDefaultOptions) { setDefaultOptions(Array.isArray(propsDefaultOptions) ? propsDefaultOptions : undefined); setPrevDefaultOptions(propsDefaultOptions); } (0,external_React_.useEffect)(function () { mounted.current = true; return function () { mounted.current = false; }; }, []); var loadOptions = (0,external_React_.useCallback)(function (inputValue, callback) { if (!propsLoadOptions) return callback(); var loader = propsLoadOptions(inputValue, callback); if (loader && typeof loader.then === 'function') { loader.then(callback, function () { return callback(); }); } }, [propsLoadOptions]); (0,external_React_.useEffect)(function () { if (propsDefaultOptions === true) { loadOptions(stateInputValue, function (options) { if (!mounted.current) return; setDefaultOptions(options || []); setIsLoading(!!lastRequest.current); }); } // NOTE: this effect is designed to only run when the component mounts, // so we don't want to include any hook dependencies // eslint-disable-next-line react-hooks/exhaustive-deps }, []); var onInputChange = (0,external_React_.useCallback)(function (newValue, actionMeta) { var inputValue = handleInputChange(newValue, actionMeta, propsOnInputChange); if (!inputValue) { lastRequest.current = undefined; setStateInputValue(''); setLoadedInputValue(''); setLoadedOptions([]); setIsLoading(false); setPassEmptyOptions(false); return; } if (cacheOptions && optionsCache[inputValue]) { setStateInputValue(inputValue); setLoadedInputValue(inputValue); setLoadedOptions(optionsCache[inputValue]); setIsLoading(false); setPassEmptyOptions(false); } else { var request = lastRequest.current = {}; setStateInputValue(inputValue); setIsLoading(true); setPassEmptyOptions(!loadedInputValue); loadOptions(inputValue, function (options) { if (!mounted) return; if (request !== lastRequest.current) return; lastRequest.current = undefined; setIsLoading(false); setLoadedInputValue(inputValue); setLoadedOptions(options || []); setPassEmptyOptions(false); setOptionsCache(options ? objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, optionsCache), {}, esm_defineProperty_defineProperty({}, inputValue, options)) : optionsCache); }); } }, [cacheOptions, loadOptions, loadedInputValue, optionsCache, propsOnInputChange]); var options = passEmptyOptions ? [] : stateInputValue && loadedInputValue ? loadedOptions : defaultOptions || []; return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restSelectProps), {}, { options: options, isLoading: isLoading || propsIsLoading, onInputChange: onInputChange, filterOption: filterOption }); } ;// CONCATENATED MODULE: ./node_modules/react-select/async/dist/react-select-async.esm.js var AsyncSelect = /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { var stateManagedProps = useAsync(props); var selectProps = useStateManager(stateManagedProps); return /*#__PURE__*/external_React_.createElement(Select_49a62830_esm_Select, runtime_helpers_esm_extends_extends({ ref: ref }, selectProps)); }); var AsyncSelect$1 = AsyncSelect; ;// CONCATENATED MODULE: ./src/dashboard/configs/styles.ts function styles_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function styles_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? styles_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : styles_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } var reactSelectStyles = { indicatorSeparator: function indicatorSeparator(base) { return styles_objectSpread(styles_objectSpread({}, base), {}, { display: "none" }); } }; var reactSelectTheme = function reactSelectTheme(theme) { return styles_objectSpread(styles_objectSpread({}, theme), {}, { borderRadius: 4, colors: styles_objectSpread(styles_objectSpread({}, theme.colors), {}, { neutral20: "#E2E8F0", primary: "#690aa0" }) }); }; ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/MaintenanceMode.tsx var MaintenanceMode = function MaintenanceMode(props) { var _props$data, _props$data2; var _useFormContext = useFormContext(), register = _useFormContext.register, watch = _useFormContext.watch, errors = _useFormContext.formState.errors, clearErrors = _useFormContext.clearErrors; var watchMode = watch("maintenance-mode.mode"); var pagesQuery = (0,react_query_es.useQuery)(["pages"], function () { return external_wp_apiFetch_default()({ path: "wp/v2/pages?per_page=20&status=publish" }); }, { keepPreviousData: true }); return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Maintenance Mode", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "#FAFAFC", border: "1px", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Mode", "magazine-blocks"), description: (0,external_wp_i18n_namespaceObject.__)('Select either "Coming Soon" mode (which returns an HTTP 200 code) or "Maintenance Mode" (which returns an HTTP 503 code).', "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Stack, null, /*#__PURE__*/external_React_default().createElement(Select, helpers_esm_extends_extends({}, register("maintenance-mode.mode", { value: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data["mode"] }), { bg: "unset !important", borderColor: "gray.200 !important", sx: { "&.chakra-select": { maxWidth: "full !important" } } }), /*#__PURE__*/external_React_default().createElement("option", { value: "none" }, (0,external_wp_i18n_namespaceObject.__)("None", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement("option", { value: "maintenance" }, (0,external_wp_i18n_namespaceObject.__)("Maintenance", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement("option", { value: "coming-soon" }, (0,external_wp_i18n_namespaceObject.__)("Coming soon", "magazine-blocks"))), /*#__PURE__*/external_React_default().createElement(Alert, { status: "info", mb: "2" }, /*#__PURE__*/external_React_default().createElement(AlertDescription, null, (0,external_wp_i18n_namespaceObject.__)('Enable "MAINTENANCE MODE" for temporary site offline, or "COMING SOON" for pre-launch.', "magazine-blocks"))))), /*#__PURE__*/external_React_default().createElement(Collapse, { "in": watchMode && "none" !== watchMode }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Maintenance Mode Page", "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Controller, { name: "maintenance-mode.maintenance-page", defaultValue: (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2["maintenance-page"], rules: { required: "none" !== watchMode ? (0,external_wp_i18n_namespaceObject.__)("Please select a maintenance page.", "magazine-blocks") : false }, render: function render(_ref) { var _errors$maintenanceM, _pagesQuery$data, _errors$maintenanceM2, _errors$maintenanceM3; var _ref$field = _ref.field, value = _ref$field.value, _onChange = _ref$field.onChange; return /*#__PURE__*/external_React_default().createElement(FormControl, { isInvalid: !!(errors !== null && errors !== void 0 && (_errors$maintenanceM = errors["maintenance-mode"]) !== null && _errors$maintenanceM !== void 0 && _errors$maintenanceM["maintenance-page"]) }, /*#__PURE__*/external_React_default().createElement(AsyncSelect$1, { isClearable: true, cacheOptions: true, defaultOptions: pagesQuery.isSuccess ? (_pagesQuery$data = pagesQuery.data) === null || _pagesQuery$data === void 0 ? void 0 : _pagesQuery$data.map(function (page) { return { value: page.id, label: "#".concat(page.id, " ").concat(page.title.rendered || (0,external_wp_i18n_namespaceObject.__)("(No title)", "magazine-blocks")) }; }) : [], loadOptions: function loadOptions(search, callback) { if (!search) { callback([]); return; } external_wp_apiFetch_default()({ path: "wp/v2/pages?per_page=20&status=publish&search=".concat(search) }).then(function (data) { callback(data === null || data === void 0 ? void 0 : data.map(function (page) { return { value: page.id, label: "#".concat(page.id, " ").concat(page.title.rendered || (0,external_wp_i18n_namespaceObject.__)("(No title)", "magazine-blocks")) }; })); }); }, noOptionsMessage: function noOptionsMessage() { return (0,external_wp_i18n_namespaceObject.__)("No pages found", "magazine-blocks"); }, menuPosition: "fixed", onChange: function onChange(v) { return _onChange(v); }, value: value, styles: reactSelectStyles, theme: reactSelectTheme }), (errors === null || errors === void 0 || (_errors$maintenanceM2 = errors["maintenance-mode"]) === null || _errors$maintenanceM2 === void 0 ? void 0 : _errors$maintenanceM2["maintenance-page"]) && /*#__PURE__*/external_React_default().createElement(FormErrorMessage, null, errors === null || errors === void 0 || (_errors$maintenanceM3 = errors["maintenance-mode"]) === null || _errors$maintenanceM3 === void 0 || (_errors$maintenanceM3 = _errors$maintenanceM3["maintenance-page"]) === null || _errors$maintenanceM3 === void 0 ? void 0 : _errors$maintenanceM3.message)); } })))))); }; /* harmony default export */ const components_MaintenanceMode = (MaintenanceMode); ;// CONCATENATED MODULE: ./node_modules/react-select/dist/react-select.esm.js var StateManagedSelect = /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { var baseSelectProps = useStateManager(props); return /*#__PURE__*/external_React_.createElement(Select_49a62830_esm_Select, runtime_helpers_esm_extends_extends({ ref: ref }, baseSelectProps)); }); var StateManagedSelect$1 = StateManagedSelect; var NonceProvider = (function (_ref) { var nonce = _ref.nonce, children = _ref.children, cacheKey = _ref.cacheKey; var emotionCache = useMemo(function () { return createCache({ key: cacheKey, nonce: nonce }); }, [cacheKey, nonce]); return /*#__PURE__*/React.createElement(CacheProvider, { value: emotionCache }, children); }); ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/Performance.tsx var Performance = function Performance(props) { var data = props.data; var _useFormContext = useFormContext(), register = _useFormContext.register, control = _useFormContext.control, watch = _useFormContext.watch; var watchAllowedFonts = watch("performance.allow-only-selected-fonts"); var watchLoadGoogleFontsLocally = watch("performance.local-google-fonts"); return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Performance", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "#FAFAFC", border: "1px", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Load Google Fonts Locally", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(Switch, helpers_esm_extends_extends({}, register("performance.local-google-fonts", { value: data === null || data === void 0 ? void 0 : data["local-google-fonts"] }), { colorScheme: "primary" }))), /*#__PURE__*/external_React_default().createElement(Collapse, { "in": watchLoadGoogleFontsLocally }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Preload Local Fonts", "magazine-blocks") }, /*#__PURE__*/external_React_default().createElement(Switch, helpers_esm_extends_extends({}, register("performance.preload-local-fonts", { value: data === null || data === void 0 ? void 0 : data["preload-local-fonts"] }), { colorScheme: "primary" }))), /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Allow Only Selected Fonts", "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Stack, null, /*#__PURE__*/external_React_default().createElement(Switch, helpers_esm_extends_extends({}, register("performance.allow-only-selected-fonts", { value: data === null || data === void 0 ? void 0 : data["allow-only-selected-fonts"] }), { colorScheme: "primary" })), /*#__PURE__*/external_React_default().createElement(Collapse, { "in": watchAllowedFonts }, /*#__PURE__*/external_React_default().createElement(Controller, { name: "performance.allowed-fonts", control: control, defaultValue: data === null || data === void 0 ? void 0 : data["allowed-fonts"], render: function render(_ref) { var _ref$field = _ref.field, value = _ref$field.value, onChange = _ref$field.onChange; return /*#__PURE__*/external_React_default().createElement(StateManagedSelect$1, { value: value, onChange: onChange, isMulti: true, hideSelectedOptions: true, closeMenuOnSelect: false, options: localized.googleFonts.slice(1), styles: reactSelectStyles, theme: reactSelectTheme, menuPosition: "fixed", placeholder: (0,external_wp_i18n_namespaceObject.__)("Select fonts...", "magazine-blocks"), getOptionLabel: function getOptionLabel(v) { return v.family; }, getOptionValue: function getOptionValue(v) { return v.family; } }); } })), /*#__PURE__*/external_React_default().createElement(Alert, { status: "info" }, /*#__PURE__*/external_React_default().createElement(AlertDescription, null, (0,external_wp_i18n_namespaceObject.__)("Magazine Blocks provides the option to incorporate Google Fonts, allowing you to select from a curated collection of fonts in the block settings. This feature allows for a more streamlined and focused font selection experience.", "magazine-blocks")))))))))); }; /* harmony default export */ const components_Performance = (Performance); ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/components/VersionControl.tsx var VersionControl = function VersionControl(props) { var _props$data; var _React$useState = external_React_default().useState(), _React$useState2 = _slicedToArray(_React$useState, 2), version = _React$useState2[0], setVersion = _React$useState2[1]; var _useFormContext = useFormContext(), register = _useFormContext.register; var versionControlQuery = (0,react_query_es.useQuery)(["version-control"], function () { return external_wp_apiFetch_default()({ path: "/magazine-blocks/v1/version-control" }); }, { onSuccess: function onSuccess(data) { setVersion(data[0]); } }); return /*#__PURE__*/external_React_default().createElement(Box, null, /*#__PURE__*/external_React_default().createElement(chunk_7OLJDQMT_Heading, { fontWeight: "semibold", fontSize: "3xl", as: "h2", mb: "8" }, (0,external_wp_i18n_namespaceObject.__)("Version Control", "magazine-blocks")), /*#__PURE__*/external_React_default().createElement(Stack, { bgColor: "#FAFAFC", border: "1px", borderColor: "gray.200", borderRadius: "lg", maxWidth: "4xl", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(Stack, { gap: "7" }, /*#__PURE__*/external_React_default().createElement(components_FormTwoColumn, { label: (0,external_wp_i18n_namespaceObject.__)("Become Beta Tester"), description: (0,external_wp_i18n_namespaceObject.__)("Activate the Beta Tester feature to receive notifications whenever a new beta release of Magazine Blocks becomes available.", "magazine-blocks"), labelAlignStart: true }, /*#__PURE__*/external_React_default().createElement(Stack, { mt: "1" }, /*#__PURE__*/external_React_default().createElement(Switch, register("version-control.beta-tester", { value: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data["beta-tester"] })), /*#__PURE__*/external_React_default().createElement(Alert, { status: "warning" }, /*#__PURE__*/external_React_default().createElement(AlertDescription, null, (0,external_wp_i18n_namespaceObject.__)("It is not advisable to install a beta version on production websites.", "magazine-blocks")))))))); }; /* harmony default export */ const components_VersionControl = (VersionControl); ;// CONCATENATED MODULE: ./src/dashboard/screens/settings/Settings.tsx var TABS_INDEX_MAP = ["editor-options", "asset-generation", "performance", "integrations", "maintenance-mode"]; var Settings = function Settings() { var _searchParams$get, _settingsQuery$data, _settingsQuery$data2, _settingsQuery$data3, _settingsQuery$data4, _settingsQuery$data5, _settingsQuery$data6; var methods = useForm(); var toast = useToast(); var queryClient = (0,react_query_es.useQueryClient)(); var settingsQuery = (0,react_query_es.useQuery)(["settings"], function () { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/settings" }); }); var isSmallThan961 = useMediaQuery("(max-width: 961px)"); var _useLocalStorage = hooks_useLocalStorage({ key: "_magazine_blocks_settings_nav_collapsed", defaultValue: false }), _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2), isCollapsed = _useLocalStorage2[0], setIsCollapsed = _useLocalStorage2[1]; var _useSearchParams = useSearchParams(), _useSearchParams2 = _slicedToArray(_useSearchParams, 2), searchParams = _useSearchParams2[0], setSearchParams = _useSearchParams2[1]; var currentTab = (_searchParams$get = searchParams.get("tab")) !== null && _searchParams$get !== void 0 ? _searchParams$get : "editor-options"; var save = (0,react_query_es.useMutation)(function (data) { return external_wp_apiFetch_default()({ path: "magazine-blocks/v1/settings", method: "POST", data: data }); }, { onSuccess: function onSuccess() { queryClient.invalidateQueries(["settings"]); toast({ status: "success", isClosable: true, title: (0,external_wp_i18n_namespaceObject.__)("Settings saved successfully", "magazine-blocks") }); }, onError: function onError(e) { toast({ status: "error", isClosable: true, title: (0,external_wp_i18n_namespaceObject.__)("Error saving settings", "magazine-blocks"), description: e.message }); } }); var onSubmit = function onSubmit(data) { save.mutate(data); }; var TabButton = function TabButton(_ref) { var label = _ref.label, icon = _ref.icon; return /*#__PURE__*/external_React_default().createElement(Tab, { color: "gray.700", py: "3.5", px: !isCollapsed ? "6" : 0, borderBottom: "1px solid #E1E1E1", _selected: { borderRight: "1px solid white", marginRight: "-1px", color: "primary.500", bgColor: "white", position: "relative", "&::after": { content: '""', width: "1", height: "full", left: 0, bgColor: "primary.500", position: "absolute" } } }, icon, !isCollapsed && /*#__PURE__*/external_React_default().createElement(HStack, { flex: "1", justify: "space-between", align: "center", ml: "3" }, /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "sm", as: "span" }, label), /*#__PURE__*/external_React_default().createElement(ArrowRight, { w: "5", h: "5" }))); }; if (settingsQuery.isLoading) { return /*#__PURE__*/external_React_default().createElement(skeleton_SettingsSkeleton, null); } return /*#__PURE__*/external_React_default().createElement(Box, { my: "8", mx: "6" }, /*#__PURE__*/external_React_default().createElement(FormProvider, methods, /*#__PURE__*/external_React_default().createElement("form", { onSubmit: methods.handleSubmit(onSubmit) }, /*#__PURE__*/external_React_default().createElement(chunk_GTRZJDIL_Tabs, { variant: "unstyled", orientation: "vertical", onChange: function onChange(t) { var _TABS_INDEX_MAP$at; setSearchParams({ tab: (_TABS_INDEX_MAP$at = TABS_INDEX_MAP.at(t)) !== null && _TABS_INDEX_MAP$at !== void 0 ? _TABS_INDEX_MAP$at : "editor-options" }); }, defaultIndex: TABS_INDEX_MAP.includes(currentTab) ? TABS_INDEX_MAP.findIndex(function (t) { return t === currentTab; }) : 0 }, /*#__PURE__*/external_React_default().createElement(TabList, { width: "30%", bgColor: "#FAFAFC", border: "1px solid #E9E9E9", borderTopStartRadius: "base", maxW: isCollapsed ? "73px" : undefined }, SETTINGS_TABS.map(function (_ref2) { var label = _ref2.label, TabIcon = _ref2.icon; return /*#__PURE__*/external_React_default().createElement(TabButton, { key: label, label: label, icon: /*#__PURE__*/external_React_default().createElement(TabIcon, { w: "6", h: "6", fill: "currentcolor" }) }); }), /*#__PURE__*/external_React_default().createElement(Button, { variant: "unstyled", color: "gray.700", py: "3.5", px: !isCollapsed ? "6" : 0, borderBottom: "1px", borderBottomColor: "gray.300", display: "flex", height: "auto", borderRadius: "0", onClick: function onClick() { return setIsCollapsed(function (prev) { return !prev; }); } }, /*#__PURE__*/external_React_default().createElement(ArrowRightFill, { transform: isCollapsed ? "rotate(180deg)" : undefined, w: "6", h: "6", fill: "currentColor" }), !isCollapsed && /*#__PURE__*/external_React_default().createElement(HStack, { flex: "1", justify: "space-between", align: "center", ml: "3" }, /*#__PURE__*/external_React_default().createElement(Text, { fontSize: "sm", as: "span" }, (0,external_wp_i18n_namespaceObject.__)("Collapse Menu", "magazine-blocks"))))), /*#__PURE__*/external_React_default().createElement(TabPanels, { width: "70%", border: "1px", borderColor: "gray.200", borderLeft: "none", bgColor: "white", py: "4", px: "5" }, /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_EditorOptions, { data: (_settingsQuery$data = settingsQuery.data) === null || _settingsQuery$data === void 0 ? void 0 : _settingsQuery$data.editor })), /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_AssetGeneration, { data: (_settingsQuery$data2 = settingsQuery.data) === null || _settingsQuery$data2 === void 0 ? void 0 : _settingsQuery$data2["asset-generation"] })), /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_Performance, { data: (_settingsQuery$data3 = settingsQuery.data) === null || _settingsQuery$data3 === void 0 ? void 0 : _settingsQuery$data3.performance })), /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_VersionControl, { data: (_settingsQuery$data4 = settingsQuery.data) === null || _settingsQuery$data4 === void 0 ? void 0 : _settingsQuery$data4["version-control"] })), /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_Integrations, { data: (_settingsQuery$data5 = settingsQuery.data) === null || _settingsQuery$data5 === void 0 ? void 0 : _settingsQuery$data5.integrations })), /*#__PURE__*/external_React_default().createElement(TabPanel, { p: "0" }, /*#__PURE__*/external_React_default().createElement(components_MaintenanceMode, { data: (_settingsQuery$data6 = settingsQuery.data) === null || _settingsQuery$data6 === void 0 ? void 0 : _settingsQuery$data6["maintenance-mode"] })), /*#__PURE__*/external_React_default().createElement(Button, { fontWeight: "normal", fontSize: "xs", colorScheme: "primary", variant: "solid", mt: "5", type: "submit", isLoading: save.isLoading }, (0,external_wp_i18n_namespaceObject.__)("Save Changes"))))))); }; /* harmony default export */ const settings_Settings = (Settings); ;// CONCATENATED MODULE: ./src/dashboard/screens/index.ts ;// CONCATENATED MODULE: ./src/dashboard/router/Router.tsx var Router_Router = function Router() { var _useLocation = dist_useLocation(), pathname = _useLocation.pathname; external_React_default().useLayoutEffect(function () { var _submenu$parentElemen; var submenu = document.querySelector(".wp-submenu a[href=\"admin.php?page=magazine-blocks#".concat(pathname, "\"]")); if (!submenu) return; (_submenu$parentElemen = submenu.parentElement) === null || _submenu$parentElemen === void 0 || _submenu$parentElemen.classList.add("current"); return function () { var _submenu$parentElemen2; (_submenu$parentElemen2 = submenu.parentElement) === null || _submenu$parentElemen2 === void 0 || (_submenu$parentElemen2 = _submenu$parentElemen2.classList) === null || _submenu$parentElemen2 === void 0 || _submenu$parentElemen2.remove("current"); }; }, [pathname]); return /*#__PURE__*/external_React_default().createElement(Routes, null, /*#__PURE__*/external_React_default().createElement(Route, { path: "/", element: /*#__PURE__*/external_React_default().createElement(dashboard_Dashboard, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "/blocks", element: /*#__PURE__*/external_React_default().createElement(blocks_Blocks, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "/Products", element: /*#__PURE__*/external_React_default().createElement(products_Products, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "/settings", element: /*#__PURE__*/external_React_default().createElement(settings_Settings, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "/free-vs-pro", element: /*#__PURE__*/external_React_default().createElement(free_vs_pro_FreeVsPro, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "/help", element: /*#__PURE__*/external_React_default().createElement(help_Help, null) }), /*#__PURE__*/external_React_default().createElement(Route, { path: "*", element: /*#__PURE__*/external_React_default().createElement(dashboard_Dashboard, null) })); }; /* harmony default export */ const router_Router = (Router_Router); ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme/dist/chunk-P56GPN75.mjs // src/utils/is-chakra-theme.ts 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) ); } //# sourceMappingURL=chunk-P56GPN75.mjs.map ;// CONCATENATED MODULE: ./node_modules/@chakra-ui/theme-utils/dist/chunk-LIR5QAZY.mjs // src/extend-theme.ts function chunk_LIR5QAZY_isFunction(value) { return typeof value === "function"; } function chunk_LIR5QAZY_pipe(...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 chunk_LIR5QAZY_pipe( ...overrides.map( (extension) => (prevTheme) => chunk_LIR5QAZY_isFunction(extension) ? extension(prevTheme) : chunk_LIR5QAZY_mergeThemeOverride(prevTheme, extension) ) )(activeTheme); }; }; var extendTheme = createExtendTheme(theme); var extendBaseTheme = createExtendTheme(baseTheme); function chunk_LIR5QAZY_mergeThemeOverride(...overrides) { return lodash_mergewith({}, ...overrides, mergeThemeCustomizer); } function mergeThemeCustomizer(source, override, key, object) { if ((chunk_LIR5QAZY_isFunction(source) || chunk_LIR5QAZY_isFunction(override)) && Object.prototype.hasOwnProperty.call(object, key)) { return (...args) => { const sourceValue = chunk_LIR5QAZY_isFunction(source) ? source(...args) : source; const overrideValue = chunk_LIR5QAZY_isFunction(override) ? override(...args) : override; return lodash_mergewith({}, sourceValue, overrideValue, mergeThemeCustomizer); }; } return void 0; } ;// CONCATENATED MODULE: ./src/dashboard/theme/theme.ts var theme_theme = extendTheme({ colors: { primary: { 50: "#fafafc", 100: "#e8eefd", 200: "#b9cdf9", 300: "#8aabf4", 400: "#5c8af0", 500: "#690aa0", 600: "#134fd2", 700: "#0f3ea3", 800: "#0b2c75", 900: "#061a46" } }, styles: { global: { ".wp-admin #mzb": { ms: "-20px" }, ".toplevel_page_magazine_blocks #wpwrap": { bgColor: "primary.50" } } }, components: { Button: defineStyleConfig({ baseStyle: { borderRadius: "base" } }), Heading: defineStyleConfig({ baseStyle: { margin: 0 } }), Text: defineStyleConfig({ baseStyle: { margin: 0 } }) } }); /* harmony default export */ const dashboard_theme_theme = (theme_theme); ;// CONCATENATED MODULE: ./src/dashboard/App.tsx var App = function App() { return /*#__PURE__*/external_React_default().createElement(HashRouter, null, /*#__PURE__*/external_React_default().createElement(chunk_QAITB7GG_ChakraProvider, { theme: dashboard_theme_theme }, /*#__PURE__*/external_React_default().createElement(react_query_es.QueryClientProvider, { client: new react_query_es.QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, refetchOnReconnect: false, useErrorBoundary: true, retry: false } } }) }, /*#__PURE__*/external_React_default().createElement(components_Header, null), /*#__PURE__*/external_React_default().createElement(router_Router, null), /*#__PURE__*/external_React_default().createElement(devtools.ReactQueryDevtools, { initialIsOpen: false })))); }; /* harmony default export */ const dashboard_App = (App); ;// CONCATENATED MODULE: ./src/dashboard/index.tsx external_wp_domReady_default()(function () { var root = document.getElementById("mzb"); if (!root) return; if (external_wp_element_namespaceObject.createRoot) { (0,external_wp_element_namespaceObject.createRoot)(root).render( /*#__PURE__*/external_React_default().createElement(dashboard_App, null)); } else { (0,external_wp_element_namespaceObject.render)( /*#__PURE__*/external_React_default().createElement(dashboard_App, null), root); } }); })(); /******/ })() ;