@saas-ui/forms 0.7.2 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/array-field.d.ts +4 -1
  3. package/dist/array-field.d.ts.map +1 -1
  4. package/dist/auto-form.d.ts +1 -0
  5. package/dist/auto-form.d.ts.map +1 -1
  6. package/dist/display-field.d.ts.map +1 -1
  7. package/dist/display-if.d.ts +4 -1
  8. package/dist/display-if.d.ts.map +1 -1
  9. package/dist/field.d.ts.map +1 -1
  10. package/dist/fields.d.ts.map +1 -1
  11. package/dist/form.d.ts +1 -0
  12. package/dist/form.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.modern.js +1 -1
  16. package/dist/index.modern.js.map +1 -1
  17. package/dist/layout.d.ts +4 -1
  18. package/dist/layout.d.ts.map +1 -1
  19. package/dist/object-field.d.ts.map +1 -1
  20. package/dist/submit-button.d.ts.map +1 -1
  21. package/dist/zod/index.js +1 -1
  22. package/dist/zod/index.js.map +1 -1
  23. package/dist/zod/index.modern.js +1 -1
  24. package/dist/zod/index.modern.js.map +1 -1
  25. package/dist/zod/{index.d.ts → zod/src/index.d.ts} +0 -0
  26. package/dist/zod/{index.d.ts.map → zod/src/index.d.ts.map} +0 -0
  27. package/dist/zod/zod-resolver.d.ts +1 -2
  28. package/dist/zod/zod-resolver.d.ts.map +1 -1
  29. package/package.json +4 -1
  30. package/src/array-field.tsx +33 -1
  31. package/src/auto-form.tsx +9 -1
  32. package/src/display-field.tsx +9 -0
  33. package/src/display-if.tsx +5 -0
  34. package/src/field.tsx +6 -0
  35. package/src/fields.tsx +5 -0
  36. package/src/form.tsx +8 -0
  37. package/src/layout.tsx +13 -1
  38. package/src/object-field.tsx +5 -0
  39. package/src/submit-button.tsx +5 -0
  40. package/yup/package.json +28 -0
  41. package/zod/package.json +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.js","sources":["../../../../node_modules/lodash.mergewith/index.js","../../../../node_modules/@chakra-ui/utils/dist/chakra-ui-utils.esm.js","../../zod/src/zod-resolver.ts"],"sourcesContent":["/**\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = mergeWith;\n","export * from 'css-box-model';\nexport { default as mergeWith } from 'lodash.mergewith';\nimport sync, { cancelSync, getFrameData } from 'framesync';\n\nfunction getFirstItem(array) {\n return array != null && array.length ? array[0] : undefined;\n}\nfunction getLastItem(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\nfunction getPrevItem(index, array, loop) {\n if (loop === void 0) {\n loop = true;\n }\n\n var prevIndex = getPrevIndex(index, array.length, loop);\n return array[prevIndex];\n}\nfunction getNextItem(index, array, loop) {\n if (loop === void 0) {\n loop = true;\n }\n\n var nextIndex = getNextIndex(index, array.length, 1, loop);\n return array[nextIndex];\n}\nfunction removeIndex(array, index) {\n return array.filter(function (_, idx) {\n return idx !== index;\n });\n}\nfunction addItem(array, item) {\n return [].concat(array, [item]);\n}\nfunction removeItem(array, item) {\n return array.filter(function (eachItem) {\n return eachItem !== item;\n });\n}\n/**\n * Get the next index based on the current index and step.\n *\n * @param currentIndex the current index\n * @param length the total length or count of items\n * @param step the number of steps\n * @param loop whether to circle back once `currentIndex` is at the start/end\n */\n\nfunction getNextIndex(currentIndex, length, step, loop) {\n if (step === void 0) {\n step = 1;\n }\n\n if (loop === void 0) {\n loop = true;\n }\n\n var lastIndex = length - 1;\n\n if (currentIndex === -1) {\n return step > 0 ? 0 : lastIndex;\n }\n\n var nextIndex = currentIndex + step;\n\n if (nextIndex < 0) {\n return loop ? lastIndex : 0;\n }\n\n if (nextIndex >= length) {\n if (loop) return 0;\n return currentIndex > length ? length : currentIndex;\n }\n\n return nextIndex;\n}\n/**\n * Get's the previous index based on the current index.\n * Mostly used for keyboard navigation.\n *\n * @param index - the current index\n * @param count - the length or total count of items in the array\n * @param loop - whether we should circle back to the\n * first/last once `currentIndex` is at the start/end\n */\n\nfunction getPrevIndex(index, count, loop) {\n if (loop === void 0) {\n loop = true;\n }\n\n return getNextIndex(index, count, -1, loop);\n}\n/**\n * Converts an array into smaller chunks or groups.\n *\n * @param array the array to chunk into group\n * @param size the length of each chunk\n */\n\nfunction chunk(array, size) {\n return array.reduce(function (rows, currentValue, index) {\n if (index % size === 0) {\n rows.push([currentValue]);\n } else {\n rows[rows.length - 1].push(currentValue);\n }\n\n return rows;\n }, []);\n}\n/**\n * Gets the next item based on a search string\n *\n * @param items array of items\n * @param searchString the search string\n * @param itemToString resolves an item to string\n * @param currentItem the current selected item\n */\n\nfunction getNextItemFromSearch(items, searchString, itemToString, currentItem) {\n if (searchString == null) {\n return currentItem;\n } // If current item doesn't exist, find the item that matches the search string\n\n\n if (!currentItem) {\n var foundItem = items.find(function (item) {\n return itemToString(item).toLowerCase().startsWith(searchString.toLowerCase());\n });\n return foundItem;\n } // Filter items for ones that match the search string (case insensitive)\n\n\n var matchingItems = items.filter(function (item) {\n return itemToString(item).toLowerCase().startsWith(searchString.toLowerCase());\n }); // If there's a match, let's get the next item to select\n\n if (matchingItems.length > 0) {\n var nextIndex; // If the currentItem is in the available items, we move to the next available option\n\n if (matchingItems.includes(currentItem)) {\n var currentIndex = matchingItems.indexOf(currentItem);\n nextIndex = currentIndex + 1;\n\n if (nextIndex === matchingItems.length) {\n nextIndex = 0;\n }\n\n return matchingItems[nextIndex];\n } // Else, we pick the first item in the available items\n\n\n nextIndex = items.indexOf(matchingItems[0]);\n return items[nextIndex];\n } // a decent fallback to the currentItem\n\n\n return currentItem;\n}\n\n// Number assertions\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isNotNumber(value) {\n return typeof value !== \"number\" || Number.isNaN(value) || !Number.isFinite(value);\n}\nfunction isNumeric(value) {\n return value != null && value - parseFloat(value) + 1 >= 0;\n} // Array assertions\n\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isEmptyArray(value) {\n return isArray(value) && value.length === 0;\n} // Function assertions\n\nfunction isFunction(value) {\n return typeof value === \"function\";\n} // Generic assertions\n\nfunction isDefined(value) {\n return typeof value !== \"undefined\" && value !== undefined;\n}\nfunction isUndefined(value) {\n return typeof value === \"undefined\" || value === undefined;\n} // Object assertions\n\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type === \"object\" || type === \"function\") && !isArray(value);\n}\nfunction isEmptyObject(value) {\n return isObject(value) && Object.keys(value).length === 0;\n}\nfunction isNotEmptyObject(value) {\n return value && !isEmptyObject(value);\n}\nfunction isNull(value) {\n return value == null;\n} // String assertions\n\nfunction isString(value) {\n return Object.prototype.toString.call(value) === \"[object String]\";\n}\nfunction isCssVar(value) {\n return /^var\\(--.+\\)$/.test(value);\n} // Empty assertions\n\nfunction isEmpty(value) {\n if (isArray(value)) return isEmptyArray(value);\n if (isObject(value)) return isEmptyObject(value);\n if (value == null || value === \"\") return true;\n return false;\n}\nvar __DEV__ = process.env.NODE_ENV !== \"production\";\nvar __TEST__ = process.env.NODE_ENV === \"test\";\nfunction isRefObject(val) {\n return \"current\" in val;\n}\nfunction isInputEvent(value) {\n return value && isObject(value) && isObject(value.target);\n}\n\nfunction omit(object, keys) {\n var result = {};\n Object.keys(object).forEach(function (key) {\n if (keys.includes(key)) return;\n result[key] = object[key];\n });\n return result;\n}\nfunction pick(object, keys) {\n var result = {};\n keys.forEach(function (key) {\n if (key in object) {\n result[key] = object[key];\n }\n });\n return result;\n}\nfunction split(object, keys) {\n var picked = {};\n var omitted = {};\n Object.keys(object).forEach(function (key) {\n if (keys.includes(key)) {\n picked[key] = object[key];\n } else {\n omitted[key] = object[key];\n }\n });\n return [picked, omitted];\n}\n/**\n * Get value from a deeply nested object using a string path.\n * Memoizes the value.\n * @param obj - the object\n * @param path - the string path\n * @param def - the fallback value\n */\n\nfunction get(obj, path, fallback, index) {\n var key = typeof path === \"string\" ? path.split(\".\") : [path];\n\n for (index = 0; index < key.length; index += 1) {\n if (!obj) break;\n obj = obj[key[index]];\n }\n\n return obj === undefined ? fallback : obj;\n}\nvar memoize = function memoize(fn) {\n var cache = new WeakMap();\n\n var memoizedFn = function memoizedFn(obj, path, fallback, index) {\n if (typeof obj === \"undefined\") {\n return fn(obj, path, fallback);\n }\n\n if (!cache.has(obj)) {\n cache.set(obj, new Map());\n }\n\n var map = cache.get(obj);\n\n if (map.has(path)) {\n return map.get(path);\n }\n\n var value = fn(obj, path, fallback, index);\n map.set(path, value);\n return value;\n };\n\n return memoizedFn;\n};\nvar memoizedGet = memoize(get);\n/**\n * Get value from deeply nested object, based on path\n * It returns the path value if not found in object\n *\n * @param path - the string path or value\n * @param scale - the string path or value\n */\n\nfunction getWithDefault(path, scale) {\n return memoizedGet(scale, path, path);\n}\n\n/**\n * Returns the items of an object that meet the condition specified in a callback function.\n *\n * @param object the object to loop through\n * @param fn The filter function\n */\nfunction objectFilter(object, fn) {\n var result = {};\n Object.keys(object).forEach(function (key) {\n var value = object[key];\n var shouldPass = fn(value, key, object);\n\n if (shouldPass) {\n result[key] = value;\n }\n });\n return result;\n}\nvar filterUndefined = function filterUndefined(object) {\n return objectFilter(object, function (val) {\n return val !== null && val !== undefined;\n });\n};\nvar objectKeys = function objectKeys(obj) {\n return Object.keys(obj);\n};\n/**\n * Object.entries polyfill for Nodev10 compatibility\n */\n\nvar fromEntries = function fromEntries(entries) {\n return entries.reduce(function (carry, _ref) {\n var key = _ref[0],\n value = _ref[1];\n carry[key] = value;\n return carry;\n }, {});\n};\n/**\n * Get the CSS variable ref stored in the theme\n */\n\nvar getCSSVar = function getCSSVar(theme, scale, value) {\n var _theme$__cssMap$$varR, _theme$__cssMap$;\n\n return (_theme$__cssMap$$varR = (_theme$__cssMap$ = theme.__cssMap[scale + \".\" + value]) == null ? void 0 : _theme$__cssMap$.varRef) != null ? _theme$__cssMap$$varR : value;\n};\n\nfunction analyzeCSSValue(value) {\n var num = parseFloat(value.toString());\n var unit = value.toString().replace(String(num), \"\");\n return {\n unitless: !unit,\n value: num,\n unit: unit\n };\n}\n\nfunction px(value) {\n if (value == null) return value;\n\n var _analyzeCSSValue = analyzeCSSValue(value),\n unitless = _analyzeCSSValue.unitless;\n\n return unitless || isNumber(value) ? value + \"px\" : value;\n}\n\nvar sortByBreakpointValue = function sortByBreakpointValue(a, b) {\n return parseInt(a[1], 10) > parseInt(b[1], 10) ? 1 : -1;\n};\n\nvar sortBps = function sortBps(breakpoints) {\n return fromEntries(Object.entries(breakpoints).sort(sortByBreakpointValue));\n};\n\nfunction normalize(breakpoints) {\n var sorted = sortBps(breakpoints);\n return Object.assign(Object.values(sorted), sorted);\n}\n\nfunction keys(breakpoints) {\n var value = Object.keys(sortBps(breakpoints));\n return new Set(value);\n}\n\nfunction subtract(value) {\n var _px;\n\n if (!value) return value;\n value = (_px = px(value)) != null ? _px : value;\n var factor = value.endsWith(\"px\") ? -1 : // the equivalent of 1px in em using a 16px base\n -0.0635;\n return isNumber(value) ? \"\" + (value + factor) : value.replace(/([0-9]+\\.?[0-9]*)/, function (m) {\n return \"\" + (parseFloat(m) + factor);\n });\n}\n\nfunction queryString(min, max) {\n var query = [\"@media screen\"];\n if (min) query.push(\"and\", \"(min-width: \" + px(min) + \")\");\n if (max) query.push(\"and\", \"(max-width: \" + px(max) + \")\");\n return query.join(\" \");\n}\n\nfunction analyzeBreakpoints(breakpoints) {\n var _breakpoints$base;\n\n if (!breakpoints) return null;\n breakpoints.base = (_breakpoints$base = breakpoints.base) != null ? _breakpoints$base : \"0px\";\n var normalized = normalize(breakpoints);\n var queries = Object.entries(breakpoints).sort(sortByBreakpointValue).map(function (_ref, index, entry) {\n var _entry;\n\n var breakpoint = _ref[0],\n minW = _ref[1];\n\n var _ref2 = (_entry = entry[index + 1]) != null ? _entry : [],\n maxW = _ref2[1];\n\n maxW = parseFloat(maxW) > 0 ? subtract(maxW) : undefined;\n return {\n breakpoint: breakpoint,\n minW: minW,\n maxW: maxW,\n maxWQuery: queryString(null, maxW),\n minWQuery: queryString(minW),\n minMaxQuery: queryString(minW, maxW)\n };\n });\n\n var _keys = keys(breakpoints);\n\n var _keysArr = Array.from(_keys.values());\n\n return {\n keys: _keys,\n normalized: normalized,\n isResponsive: function isResponsive(test) {\n var keys = Object.keys(test);\n return keys.length > 0 && keys.every(function (key) {\n return _keys.has(key);\n });\n },\n asObject: sortBps(breakpoints),\n asArray: normalize(breakpoints),\n details: queries,\n media: [null].concat(normalized.map(function (minW) {\n return queryString(minW);\n }).slice(1)),\n toArrayValue: function toArrayValue(test) {\n if (!isObject(test)) {\n throw new Error(\"toArrayValue: value must be an object\");\n }\n\n var result = _keysArr.map(function (bp) {\n var _test$bp;\n\n return (_test$bp = test[bp]) != null ? _test$bp : null;\n });\n\n while (getLastItem(result) === null) {\n result.pop();\n }\n\n return result;\n },\n toObjectValue: function toObjectValue(test) {\n if (!Array.isArray(test)) {\n throw new Error(\"toObjectValue: value must be an array\");\n }\n\n return test.reduce(function (acc, value, index) {\n var key = _keysArr[index];\n if (key != null && value != null) acc[key] = value;\n return acc;\n }, {});\n }\n };\n}\n\nfunction isElement(el) {\n return el != null && typeof el == \"object\" && \"nodeType\" in el && el.nodeType === Node.ELEMENT_NODE;\n}\nfunction isHTMLElement(el) {\n var _el$ownerDocument$def;\n\n if (!isElement(el)) {\n return false;\n }\n\n var win = (_el$ownerDocument$def = el.ownerDocument.defaultView) != null ? _el$ownerDocument$def : window;\n return el instanceof win.HTMLElement;\n}\nfunction getOwnerWindow(node) {\n var _getOwnerDocument$def, _getOwnerDocument;\n\n return isElement(node) ? (_getOwnerDocument$def = (_getOwnerDocument = getOwnerDocument(node)) == null ? void 0 : _getOwnerDocument.defaultView) != null ? _getOwnerDocument$def : window : window;\n}\nfunction getOwnerDocument(node) {\n var _node$ownerDocument;\n\n return isElement(node) ? (_node$ownerDocument = node.ownerDocument) != null ? _node$ownerDocument : document : document;\n}\nfunction getEventWindow(event) {\n var _view;\n\n return (_view = event.view) != null ? _view : window;\n}\nfunction canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}\nvar isBrowser = canUseDOM();\nvar dataAttr = function dataAttr(condition) {\n return condition ? \"\" : undefined;\n};\nvar ariaAttr = function ariaAttr(condition) {\n return condition ? true : undefined;\n};\nvar cx = function cx() {\n for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {\n classNames[_key] = arguments[_key];\n }\n\n return classNames.filter(Boolean).join(\" \");\n};\nfunction getActiveElement(node) {\n var doc = getOwnerDocument(node);\n return doc == null ? void 0 : doc.activeElement;\n}\nfunction contains(parent, child) {\n if (!parent) return false;\n return parent === child || parent.contains(child);\n}\nfunction addDomEvent(target, eventName, handler, options) {\n target.addEventListener(eventName, handler, options);\n return function () {\n target.removeEventListener(eventName, handler, options);\n };\n}\n/**\n * Get the normalized event key across all browsers\n * @param event keyboard event\n */\n\nfunction normalizeEventKey(event) {\n var key = event.key,\n keyCode = event.keyCode;\n var isArrowKey = keyCode >= 37 && keyCode <= 40 && key.indexOf(\"Arrow\") !== 0;\n var eventKey = isArrowKey ? \"Arrow\" + key : key;\n return eventKey;\n}\nfunction getRelatedTarget(event) {\n var _event$target, _event$relatedTarget;\n\n var target = (_event$target = event.target) != null ? _event$target : event.currentTarget;\n var activeElement = getActiveElement(target);\n return (_event$relatedTarget = event.relatedTarget) != null ? _event$relatedTarget : activeElement;\n}\nfunction isRightClick(event) {\n return event.button !== 0;\n}\n\n// Really great work done by Diego Haz on this one\nvar hasDisplayNone = function hasDisplayNone(element) {\n return window.getComputedStyle(element).display === \"none\";\n};\nvar hasTabIndex = function hasTabIndex(element) {\n return element.hasAttribute(\"tabindex\");\n};\nvar hasNegativeTabIndex = function hasNegativeTabIndex(element) {\n return hasTabIndex(element) && element.tabIndex === -1;\n};\nfunction isDisabled(element) {\n return Boolean(element.getAttribute(\"disabled\")) === true || Boolean(element.getAttribute(\"aria-disabled\")) === true;\n}\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName.toLowerCase() === \"input\" && \"select\" in element;\n}\nfunction isActiveElement(element) {\n var doc = isHTMLElement(element) ? getOwnerDocument(element) : document;\n return doc.activeElement === element;\n}\nfunction hasFocusWithin(element) {\n if (!document.activeElement) return false;\n return element.contains(document.activeElement);\n}\nfunction isHidden(element) {\n if (element.parentElement && isHidden(element.parentElement)) return true;\n return element.hidden;\n}\nfunction isContentEditable(element) {\n var value = element.getAttribute(\"contenteditable\");\n return value !== \"false\" && value != null;\n}\nfunction isFocusable(element) {\n if (!isHTMLElement(element) || isHidden(element) || isDisabled(element)) {\n return false;\n }\n\n var localName = element.localName;\n var focusableTags = [\"input\", \"select\", \"textarea\", \"button\"];\n if (focusableTags.indexOf(localName) >= 0) return true;\n var others = {\n a: function a() {\n return element.hasAttribute(\"href\");\n },\n audio: function audio() {\n return element.hasAttribute(\"controls\");\n },\n video: function video() {\n return element.hasAttribute(\"controls\");\n }\n };\n\n if (localName in others) {\n return others[localName]();\n }\n\n if (isContentEditable(element)) return true;\n return hasTabIndex(element);\n}\nfunction isTabbable(element) {\n if (!element) return false;\n return isHTMLElement(element) && isFocusable(element) && !hasNegativeTabIndex(element);\n}\n\nvar focusableElList = [\"input:not([disabled])\", \"select:not([disabled])\", \"textarea:not([disabled])\", \"embed\", \"iframe\", \"object\", \"a[href]\", \"area[href]\", \"button:not([disabled])\", \"[tabindex]\", \"audio[controls]\", \"video[controls]\", \"*[tabindex]:not([aria-disabled])\", \"*[contenteditable]\"];\nvar focusableElSelector = focusableElList.join();\nfunction getAllFocusable(container) {\n var focusableEls = Array.from(container.querySelectorAll(focusableElSelector));\n focusableEls.unshift(container);\n return focusableEls.filter(isFocusable).filter(function (el) {\n return window.getComputedStyle(el).display !== \"none\";\n });\n}\nfunction getFirstFocusable(container) {\n var allFocusable = getAllFocusable(container);\n return allFocusable.length ? allFocusable[0] : null;\n}\nfunction getAllTabbable(container, fallbackToFocusable) {\n var allFocusable = Array.from(container.querySelectorAll(focusableElSelector));\n var allTabbable = allFocusable.filter(isTabbable);\n\n if (isTabbable(container)) {\n allTabbable.unshift(container);\n }\n\n if (!allTabbable.length && fallbackToFocusable) {\n return allFocusable;\n }\n\n return allTabbable;\n}\nfunction getFirstTabbableIn(container, fallbackToFocusable) {\n var _getAllTabbable = getAllTabbable(container, fallbackToFocusable),\n first = _getAllTabbable[0];\n\n return first || null;\n}\nfunction getLastTabbableIn(container, fallbackToFocusable) {\n var allTabbable = getAllTabbable(container, fallbackToFocusable);\n return allTabbable[allTabbable.length - 1] || null;\n}\nfunction getNextTabbable(container, fallbackToFocusable) {\n var allFocusable = getAllFocusable(container);\n var index = allFocusable.indexOf(document.activeElement);\n var slice = allFocusable.slice(index + 1);\n return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);\n}\nfunction getPreviousTabbable(container, fallbackToFocusable) {\n var allFocusable = getAllFocusable(container).reverse();\n var index = allFocusable.indexOf(document.activeElement);\n var slice = allFocusable.slice(index + 1);\n return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);\n}\nfunction focusNextTabbable(container, fallbackToFocusable) {\n var nextTabbable = getNextTabbable(container, fallbackToFocusable);\n\n if (nextTabbable && isHTMLElement(nextTabbable)) {\n nextTabbable.focus();\n }\n}\nfunction focusPreviousTabbable(container, fallbackToFocusable) {\n var previousTabbable = getPreviousTabbable(container, fallbackToFocusable);\n\n if (previousTabbable && isHTMLElement(previousTabbable)) {\n previousTabbable.focus();\n }\n}\n\nfunction matches(element, selectors) {\n if (\"matches\" in element) return element.matches(selectors);\n if (\"msMatchesSelector\" in element) return element.msMatchesSelector(selectors);\n return element.webkitMatchesSelector(selectors);\n}\n\nfunction closest(element, selectors) {\n if (\"closest\" in element) return element.closest(selectors);\n\n do {\n if (matches(element, selectors)) return element;\n element = element.parentElement || element.parentNode;\n } while (element !== null && element.nodeType === 1);\n\n return null;\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n/* eslint-disable no-nested-ternary */\nfunction runIfFn(valueOrFn) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return isFunction(valueOrFn) ? valueOrFn.apply(void 0, args) : valueOrFn;\n}\nfunction callAllHandlers() {\n for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n fns[_key2] = arguments[_key2];\n }\n\n return function func(event) {\n fns.some(function (fn) {\n fn == null ? void 0 : fn(event);\n return event == null ? void 0 : event.defaultPrevented;\n });\n };\n}\nfunction callAll() {\n for (var _len3 = arguments.length, fns = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n fns[_key3] = arguments[_key3];\n }\n\n return function mergedFn(arg) {\n fns.forEach(function (fn) {\n fn == null ? void 0 : fn(arg);\n });\n };\n}\nvar compose = function compose(fn1) {\n for (var _len4 = arguments.length, fns = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n fns[_key4 - 1] = arguments[_key4];\n }\n\n return fns.reduce(function (f1, f2) {\n return function () {\n return f1(f2.apply(void 0, arguments));\n };\n }, fn1);\n};\nfunction once(fn) {\n var result;\n return function func() {\n if (fn) {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n result = fn.apply(this, args);\n fn = null;\n }\n\n return result;\n };\n}\nvar noop = function noop() {};\nvar warn = once(function (options) {\n return function () {\n var condition = options.condition,\n message = options.message;\n\n if (condition && __DEV__) {\n console.warn(message);\n }\n };\n});\nvar error = once(function (options) {\n return function () {\n var condition = options.condition,\n message = options.message;\n\n if (condition && __DEV__) {\n console.error(message);\n }\n };\n});\nvar pipe = function pipe() {\n for (var _len6 = arguments.length, fns = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n fns[_key6] = arguments[_key6];\n }\n\n return function (v) {\n return fns.reduce(function (a, b) {\n return b(a);\n }, v);\n };\n};\n\nvar distance1D = function distance1D(a, b) {\n return Math.abs(a - b);\n};\n\nvar isPoint = function isPoint(point) {\n return \"x\" in point && \"y\" in point;\n};\n\nfunction distance(a, b) {\n if (isNumber(a) && isNumber(b)) {\n return distance1D(a, b);\n }\n\n if (isPoint(a) && isPoint(b)) {\n var xDelta = distance1D(a.x, b.x);\n var yDelta = distance1D(a.y, b.y);\n return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2));\n }\n\n return 0;\n}\n\nfunction focus(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$isActive = _options.isActive,\n isActive = _options$isActive === void 0 ? isActiveElement : _options$isActive,\n nextTick = _options.nextTick,\n _options$preventScrol = _options.preventScroll,\n preventScroll = _options$preventScrol === void 0 ? true : _options$preventScrol,\n _options$selectTextIf = _options.selectTextIfInput,\n selectTextIfInput = _options$selectTextIf === void 0 ? true : _options$selectTextIf;\n if (!element || isActive(element)) return -1;\n\n function triggerFocus() {\n if (!element) {\n warn({\n condition: true,\n message: \"[chakra-ui]: can't call focus() on `null` or `undefined` element\"\n });\n return;\n }\n\n if (supportsPreventScroll()) {\n element.focus({\n preventScroll: preventScroll\n });\n } else {\n element.focus();\n\n if (preventScroll) {\n var scrollableElements = getScrollableElements(element);\n restoreScrollPosition(scrollableElements);\n }\n }\n\n if (isInputElement(element) && selectTextIfInput) {\n element.select();\n }\n }\n\n if (nextTick) {\n return requestAnimationFrame(triggerFocus);\n }\n\n triggerFocus();\n return -1;\n}\nvar supportsPreventScrollCached = null;\n\nfunction supportsPreventScroll() {\n if (supportsPreventScrollCached == null) {\n supportsPreventScrollCached = false;\n\n try {\n var div = document.createElement(\"div\");\n div.focus({\n get preventScroll() {\n supportsPreventScrollCached = true;\n return true;\n }\n\n });\n } catch (e) {// Ignore\n }\n }\n\n return supportsPreventScrollCached;\n}\n\nfunction getScrollableElements(element) {\n var _doc$defaultView;\n\n var doc = getOwnerDocument(element);\n var win = (_doc$defaultView = doc.defaultView) != null ? _doc$defaultView : window;\n var parent = element.parentNode;\n var scrollableElements = [];\n var rootScrollingElement = doc.scrollingElement || doc.documentElement;\n\n while (parent instanceof win.HTMLElement && parent !== rootScrollingElement) {\n if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) {\n scrollableElements.push({\n element: parent,\n scrollTop: parent.scrollTop,\n scrollLeft: parent.scrollLeft\n });\n }\n\n parent = parent.parentNode;\n }\n\n if (rootScrollingElement instanceof win.HTMLElement) {\n scrollableElements.push({\n element: rootScrollingElement,\n scrollTop: rootScrollingElement.scrollTop,\n scrollLeft: rootScrollingElement.scrollLeft\n });\n }\n\n return scrollableElements;\n}\n\nfunction restoreScrollPosition(scrollableElements) {\n for (var _iterator = _createForOfIteratorHelperLoose(scrollableElements), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n element = _step$value.element,\n scrollTop = _step$value.scrollTop,\n scrollLeft = _step$value.scrollLeft;\n element.scrollTop = scrollTop;\n element.scrollLeft = scrollLeft;\n }\n}\n\nfunction flatten(target, maxDepth) {\n if (maxDepth === void 0) {\n maxDepth = Infinity;\n }\n\n if (!isObject(target) && !Array.isArray(target) || !maxDepth) {\n return target;\n }\n\n return Object.entries(target).reduce(function (result, _ref) {\n var key = _ref[0],\n value = _ref[1];\n\n if (isObject(value) || isArray(value)) {\n Object.entries(flatten(value, maxDepth - 1)).forEach(function (_ref2) {\n var childKey = _ref2[0],\n childValue = _ref2[1];\n // e.g. gray.500\n result[key + \".\" + childKey] = childValue;\n });\n } else {\n // e.g. transparent\n result[key] = value;\n }\n\n return result;\n }, {});\n}\n\n/**\n * Determines whether the children of a disclosure widget\n * should be rendered or not, depending on the lazy behavior.\n *\n * Used in accordion, tabs, popover, menu and other disclosure\n * widgets.\n */\nfunction determineLazyBehavior(options) {\n var hasBeenSelected = options.hasBeenSelected,\n isLazy = options.isLazy,\n isSelected = options.isSelected,\n _options$lazyBehavior = options.lazyBehavior,\n lazyBehavior = _options$lazyBehavior === void 0 ? \"unmount\" : _options$lazyBehavior; // if not lazy, always render the disclosure's content\n\n if (!isLazy) return true; // if the diclosure is selected, render the disclosure's content\n\n if (isSelected) return true; // if the disclosure was selected but not active, keep its content active\n\n if (lazyBehavior === \"keepMounted\" && hasBeenSelected) return true;\n return false;\n}\n\nvar minSafeInteger = Number.MIN_SAFE_INTEGER || -9007199254740991;\nvar maxSafeInteger = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\nfunction toNumber(value) {\n var num = parseFloat(value);\n return isNotNumber(num) ? 0 : num;\n}\n/**\n * Converts a value to a specific precision (or decimal points).\n *\n * Returns a string representing a number in fixed-point notation.\n *\n * @param value the value to convert\n * @param precision the precision or decimal points\n */\n\n\nfunction toPrecision(value, precision) {\n var nextValue = toNumber(value);\n var scaleFactor = Math.pow(10, precision != null ? precision : 10);\n nextValue = Math.round(nextValue * scaleFactor) / scaleFactor;\n return precision ? nextValue.toFixed(precision) : nextValue.toString();\n}\n/**\n * Counts the number of decimal places a number has\n *\n * @param value the decimal value to count\n */\n\nfunction countDecimalPlaces(value) {\n if (!Number.isFinite(value)) return 0;\n var e = 1;\n var p = 0;\n\n while (Math.round(value * e) / e !== value) {\n e *= 10;\n p += 1;\n }\n\n return p;\n}\n/**\n * Convert a value to percentage based on lower and upper bound values\n *\n * @param value the value in number\n * @param min the minimum value\n * @param max the maximum value\n */\n\nfunction valueToPercent(value, min, max) {\n return (value - min) * 100 / (max - min);\n}\n/**\n * Calculate the value based on percentage, lower and upper bound values\n *\n * @param percent the percent value in decimals (e.g 0.6, 0.3)\n * @param min the minimum value\n * @param max the maximum value\n */\n\nfunction percentToValue(percent, min, max) {\n return (max - min) * percent + min;\n}\n/**\n * Rounds a specific value to the next or previous step\n *\n * @param value the value to round\n * @param from the number that stepping started from\n * @param step the specified step\n */\n\nfunction roundValueToStep(value, from, step) {\n var nextValue = Math.round((value - from) / step) * step + from;\n var precision = countDecimalPlaces(step);\n return toPrecision(nextValue, precision);\n}\n/**\n * Clamps a value to ensure it stays within the min and max range.\n *\n * @param value the value to clamp\n * @param min the minimum value\n * @param max the maximum value\n */\n\nfunction clampValue(value, min, max) {\n if (value == null) return value;\n warn({\n condition: max < min,\n message: \"clamp: max cannot be less than min\"\n });\n return Math.min(Math.max(value, min), max);\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n/**\n * Credit goes to `framer-motion` of this useful utilities.\n * License can be found here: https://github.com/framer/motion\n */\nfunction isMouseEvent(event) {\n var win = getEventWindow(event); // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.\n\n if (typeof win.PointerEvent !== \"undefined\" && event instanceof win.PointerEvent) {\n return !!(event.pointerType === \"mouse\");\n }\n\n return event instanceof win.MouseEvent;\n}\nfunction isTouchEvent(event) {\n var hasTouches = !!event.touches;\n return hasTouches;\n}\n\n/**\n * Filters out events not attached to the primary pointer (currently left mouse button)\n * @param eventHandler\n */\nfunction filterPrimaryPointer(eventHandler) {\n return function (event) {\n var win = getEventWindow(event);\n var isMouseEvent = event instanceof win.MouseEvent;\n var isPrimaryPointer = !isMouseEvent || isMouseEvent && event.button === 0;\n\n if (isPrimaryPointer) {\n eventHandler(event);\n }\n };\n}\n\nvar defaultPagePoint = {\n pageX: 0,\n pageY: 0\n};\n\nfunction pointFromTouch(e, pointType) {\n if (pointType === void 0) {\n pointType = \"page\";\n }\n\n var primaryTouch = e.touches[0] || e.changedTouches[0];\n var point = primaryTouch || defaultPagePoint;\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"]\n };\n}\n\nfunction pointFromMouse(point, pointType) {\n if (pointType === void 0) {\n pointType = \"page\";\n }\n\n return {\n x: point[pointType + \"X\"],\n y: point[pointType + \"Y\"]\n };\n}\n\nfunction extractEventInfo(event, pointType) {\n if (pointType === void 0) {\n pointType = \"page\";\n }\n\n return {\n point: isTouchEvent(event) ? pointFromTouch(event, pointType) : pointFromMouse(event, pointType)\n };\n}\nfunction getViewportPointFromEvent(event) {\n return extractEventInfo(event, \"client\");\n}\nvar wrapPointerEventHandler = function wrapPointerEventHandler(handler, shouldFilterPrimaryPointer) {\n if (shouldFilterPrimaryPointer === void 0) {\n shouldFilterPrimaryPointer = false;\n }\n\n var listener = function listener(event) {\n return handler(event, extractEventInfo(event));\n };\n\n return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener;\n}; // We check for event support via functions in case they've been mocked by a testing suite.\n\nvar supportsPointerEvents = function supportsPointerEvents() {\n return isBrowser && window.onpointerdown === null;\n};\n\nvar supportsTouchEvents = function supportsTouchEvents() {\n return isBrowser && window.ontouchstart === null;\n};\n\nvar supportsMouseEvents = function supportsMouseEvents() {\n return isBrowser && window.onmousedown === null;\n};\n\nvar mouseEventNames = {\n pointerdown: \"mousedown\",\n pointermove: \"mousemove\",\n pointerup: \"mouseup\",\n pointercancel: \"mousecancel\",\n pointerover: \"mouseover\",\n pointerout: \"mouseout\",\n pointerenter: \"mouseenter\",\n pointerleave: \"mouseleave\"\n};\nvar touchEventNames = {\n pointerdown: \"touchstart\",\n pointermove: \"touchmove\",\n pointerup: \"touchend\",\n pointercancel: \"touchcancel\"\n};\nfunction getPointerEventName(name) {\n if (supportsPointerEvents()) {\n return name;\n }\n\n if (supportsTouchEvents()) {\n return touchEventNames[name];\n }\n\n if (supportsMouseEvents()) {\n return mouseEventNames[name];\n }\n\n return name;\n}\nfunction addPointerEvent(target, eventName, handler, options) {\n return addDomEvent(target, getPointerEventName(eventName), wrapPointerEventHandler(handler, eventName === \"pointerdown\"), options);\n}\nfunction isMultiTouchEvent(event) {\n return isTouchEvent(event) && event.touches.length > 1;\n}\n\n/**\n * The event information passed to pan event handlers like `onPan`, `onPanStart`.\n *\n * It contains information about the current state of the tap gesture such as its\n * `point`, `delta`, and `offset`\n */\n\n/**\n * @internal\n *\n * A Pan Session is recognized when the pointer is down\n * and moved in the allowed direction.\n */\nvar PanSession = /*#__PURE__*/function () {\n /**\n * We use this to keep track of the `x` and `y` pan session history\n * as the pan event happens. It helps to calculate the `offset` and `delta`\n */\n // The pointer event that started the pan session\n // The current pointer event for the pan session\n // The current pointer event info for the pan session\n\n /**\n * Minimal pan distance required before recognizing the pan.\n * @default \"3px\"\n */\n function PanSession(_event, handlers, threshold) {\n var _this = this;\n\n this.history = [];\n this.startEvent = null;\n this.lastEvent = null;\n this.lastEventInfo = null;\n this.handlers = {};\n this.removeListeners = noop;\n this.threshold = 3;\n this.win = void 0;\n\n this.updatePoint = function () {\n if (!(_this.lastEvent && _this.lastEventInfo)) return;\n var info = getPanInfo(_this.lastEventInfo, _this.history);\n var isPanStarted = _this.startEvent !== null;\n\n var isDistancePastThreshold = distance(info.offset, {\n x: 0,\n y: 0\n }) >= _this.threshold;\n\n if (!isPanStarted && !isDistancePastThreshold) return;\n\n var _getFrameData = getFrameData(),\n timestamp = _getFrameData.timestamp;\n\n _this.history.push(_extends({}, info.point, {\n timestamp: timestamp\n }));\n\n var _this$handlers = _this.handlers,\n onStart = _this$handlers.onStart,\n onMove = _this$handlers.onMove;\n\n if (!isPanStarted) {\n onStart == null ? void 0 : onStart(_this.lastEvent, info);\n _this.startEvent = _this.lastEvent;\n }\n\n onMove == null ? void 0 : onMove(_this.lastEvent, info);\n };\n\n this.onPointerMove = function (event, info) {\n _this.lastEvent = event;\n _this.lastEventInfo = info; // Because Safari doesn't trigger mouseup events when it's above a `<select>`\n\n if (isMouseEvent(event) && event.buttons === 0) {\n _this.onPointerUp(event, info);\n\n return;\n } // Throttle mouse move event to once per frame\n\n\n sync.update(_this.updatePoint, true);\n };\n\n this.onPointerUp = function (event, info) {\n // notify pan session ended\n var panInfo = getPanInfo(info, _this.history);\n var _this$handlers2 = _this.handlers,\n onEnd = _this$handlers2.onEnd,\n onSessionEnd = _this$handlers2.onSessionEnd;\n onSessionEnd == null ? void 0 : onSessionEnd(event, panInfo);\n\n _this.end(); // if panning never started, no need to call `onEnd`\n // panning requires a pointermove of at least 3px\n\n\n if (!onEnd || !_this.startEvent) return;\n onEnd == null ? void 0 : onEnd(event, panInfo);\n };\n\n this.win = getEventWindow(_event); // If we have more than one touch, don't start detecting this gesture\n\n if (isMultiTouchEvent(_event)) return;\n this.handlers = handlers;\n\n if (threshold) {\n this.threshold = threshold;\n } // stop default browser behavior\n\n\n _event.stopPropagation();\n\n _event.preventDefault(); // get and save the `pointerdown` event info in history\n // we'll use it to compute the `offset`\n\n\n var _info = extractEventInfo(_event);\n\n var _getFrameData2 = getFrameData(),\n _timestamp = _getFrameData2.timestamp;\n\n this.history = [_extends({}, _info.point, {\n timestamp: _timestamp\n })]; // notify pan session start\n\n var onSessionStart = handlers.onSessionStart;\n onSessionStart == null ? void 0 : onSessionStart(_event, getPanInfo(_info, this.history)); // attach event listeners and return a single function to remove them all\n\n this.removeListeners = pipe(addPointerEvent(this.win, \"pointermove\", this.onPointerMove), addPointerEvent(this.win, \"pointerup\", this.onPointerUp), addPointerEvent(this.win, \"pointercancel\", this.onPointerUp));\n }\n\n var _proto = PanSession.prototype;\n\n _proto.updateHandlers = function updateHandlers(handlers) {\n this.handlers = handlers;\n };\n\n _proto.end = function end() {\n var _this$removeListeners;\n\n (_this$removeListeners = this.removeListeners) == null ? void 0 : _this$removeListeners.call(this);\n cancelSync.update(this.updatePoint);\n };\n\n return PanSession;\n}();\n\nfunction subtractPoint(a, b) {\n return {\n x: a.x - b.x,\n y: a.y - b.y\n };\n}\n\nfunction startPanPoint(history) {\n return history[0];\n}\n\nfunction lastPanPoint(history) {\n return history[history.length - 1];\n}\n\nfunction getPanInfo(info, history) {\n return {\n point: info.point,\n delta: subtractPoint(info.point, lastPanPoint(history)),\n offset: subtractPoint(info.point, startPanPoint(history)),\n velocity: getVelocity(history, 0.1)\n };\n}\n\nfunction lastDevicePoint(history) {\n return history[history.length - 1];\n}\n\nvar toMilliseconds = function toMilliseconds(seconds) {\n return seconds * 1000;\n};\n\nfunction getVelocity(history, timeDelta) {\n if (history.length < 2) {\n return {\n x: 0,\n y: 0\n };\n }\n\n var i = history.length - 1;\n var timestampedPoint = null;\n var lastPoint = lastDevicePoint(history);\n\n while (i >= 0) {\n timestampedPoint = history[i];\n\n if (lastPoint.timestamp - timestampedPoint.timestamp > toMilliseconds(timeDelta)) {\n break;\n }\n\n i--;\n }\n\n if (!timestampedPoint) {\n return {\n x: 0,\n y: 0\n };\n }\n\n var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000;\n\n if (time === 0) {\n return {\n x: 0,\n y: 0\n };\n }\n\n var currentVelocity = {\n x: (lastPoint.x - timestampedPoint.x) / time,\n y: (lastPoint.y - timestampedPoint.y) / time\n };\n\n if (currentVelocity.x === Infinity) {\n currentVelocity.x = 0;\n }\n\n if (currentVelocity.y === Infinity) {\n currentVelocity.y = 0;\n }\n\n return currentVelocity;\n}\n\nvar breakpoints = Object.freeze([\"base\", \"sm\", \"md\", \"lg\", \"xl\", \"2xl\"]);\nfunction mapResponsive(prop, mapper) {\n if (isArray(prop)) {\n return prop.map(function (item) {\n if (item === null) {\n return null;\n }\n\n return mapper(item);\n });\n }\n\n if (isObject(prop)) {\n return objectKeys(prop).reduce(function (result, key) {\n result[key] = mapper(prop[key]);\n return result;\n }, {});\n }\n\n if (prop != null) {\n return mapper(prop);\n }\n\n return null;\n}\nfunction objectToArrayNotation(obj, bps) {\n if (bps === void 0) {\n bps = breakpoints;\n }\n\n var result = bps.map(function (br) {\n var _obj$br;\n\n return (_obj$br = obj[br]) != null ? _obj$br : null;\n });\n\n while (getLastItem(result) === null) {\n result.pop();\n }\n\n return result;\n}\nfunction arrayToObjectNotation(values, bps) {\n if (bps === void 0) {\n bps = breakpoints;\n }\n\n var result = {};\n values.forEach(function (value, index) {\n var key = bps[index];\n if (value == null) return;\n result[key] = value;\n });\n return result;\n}\nfunction isResponsiveObjectLike(obj, bps) {\n if (bps === void 0) {\n bps = breakpoints;\n }\n\n var keys = Object.keys(obj);\n return keys.length > 0 && keys.every(function (key) {\n return bps.includes(key);\n });\n}\n/**\n * since breakpoints are defined as custom properties on an array, you may\n * `Object.keys(theme.breakpoints)` to retrieve both regular numeric indices\n * and custom breakpoints as string.\n *\n * This function returns true given a custom array property.\n */\n\nvar isCustomBreakpoint = function isCustomBreakpoint(maybeBreakpoint) {\n return Number.isNaN(Number(maybeBreakpoint));\n};\n\nfunction getUserAgentBrowser(navigator) {\n var ua = navigator.userAgent,\n vendor = navigator.vendor;\n var android = /(android)/i.test(ua);\n\n switch (true) {\n case /CriOS/.test(ua):\n return \"Chrome for iOS\";\n\n case /Edg\\//.test(ua):\n return \"Edge\";\n\n case android && /Silk\\//.test(ua):\n return \"Silk\";\n\n case /Chrome/.test(ua) && /Google Inc/.test(vendor):\n return \"Chrome\";\n\n case /Firefox\\/\\d+\\.\\d+$/.test(ua):\n return \"Firefox\";\n\n case android:\n return \"AOSP\";\n\n case /MSIE|Trident/.test(ua):\n return \"IE\";\n\n case /Safari/.test(navigator.userAgent) && /Apple Computer/.test(ua):\n return \"Safari\";\n\n case /AppleWebKit/.test(ua):\n return \"WebKit\";\n\n default:\n return null;\n }\n}\n\nfunction getUserAgentOS(navigator) {\n var ua = navigator.userAgent,\n platform = navigator.platform;\n\n switch (true) {\n case /Android/.test(ua):\n return \"Android\";\n\n case /iPhone|iPad|iPod/.test(platform):\n return \"iOS\";\n\n case /Win/.test(platform):\n return \"Windows\";\n\n case /Mac/.test(platform):\n return \"Mac\";\n\n case /CrOS/.test(ua):\n return \"Chrome OS\";\n\n case /Firefox/.test(ua):\n return \"Firefox OS\";\n\n default:\n return null;\n }\n}\n\nfunction detectDeviceType(navigator) {\n var ua = navigator.userAgent;\n if (/(tablet)|(iPad)|(Nexus 9)/i.test(ua)) return \"tablet\";\n if (/(mobi)/i.test(ua)) return \"phone\";\n return \"desktop\";\n}\nfunction detectOS(os) {\n if (!isBrowser) return false;\n return getUserAgentOS(window.navigator) === os;\n}\nfunction detectBrowser(browser) {\n if (!isBrowser) return false;\n return getUserAgentBrowser(window.navigator) === browser;\n}\nfunction detectTouch() {\n if (!isBrowser) return false;\n return window.ontouchstart === null && window.ontouchmove === null && window.ontouchend === null;\n}\n\nfunction walkObject(target, predicate) {\n function inner(value, path) {\n if (path === void 0) {\n path = [];\n }\n\n if (isArray(value)) {\n return value.map(function (item, index) {\n return inner(item, [].concat(path, [String(index)]));\n });\n }\n\n if (isObject(value)) {\n return fromEntries(Object.entries(value).map(function (_ref) {\n var key = _ref[0],\n child = _ref[1];\n return [key, inner(child, [].concat(path, [key]))];\n }));\n }\n\n return predicate(value, path);\n }\n\n return inner(target);\n}\n\nexport { PanSession, __DEV__, __TEST__, addDomEvent, addItem, addPointerEvent, analyzeBreakpoints, ariaAttr, arrayToObjectNotation, breakpoints, callAll, callAllHandlers, canUseDOM, chunk, clampValue, closest, compose, contains, countDecimalPlaces, cx, dataAttr, detectBrowser, detectDeviceType, detectOS, detectTouch, determineLazyBehavior, distance, error, extractEventInfo, filterUndefined, flatten, focus, focusNextTabbable, focusPreviousTabbable, fromEntries, get, getActiveElement, getAllFocusable, getAllTabbable, getCSSVar, getEventWindow, getFirstFocusable, getFirstItem, getFirstTabbableIn, getLastItem, getLastTabbableIn, getNextIndex, getNextItem, getNextItemFromSearch, getNextTabbable, getOwnerDocument, getOwnerWindow, getPointerEventName, getPrevIndex, getPrevItem, getPreviousTabbable, getRelatedTarget, getViewportPointFromEvent, getWithDefault, hasDisplayNone, hasFocusWithin, hasNegativeTabIndex, hasTabIndex, isActiveElement, isArray, isBrowser, isContentEditable, isCssVar, isCustomBreakpoint, isDefined, isDisabled, isElement, isEmpty, isEmptyArray, isEmptyObject, isFocusable, isFunction, isHTMLElement, isHidden, isInputElement, isInputEvent, isMouseEvent, isMultiTouchEvent, isNotEmptyObject, isNotNumber, isNull, isNumber, isNumeric, isObject, isRefObject, isResponsiveObjectLike, isRightClick, isString, isTabbable, isTouchEvent, isUndefined, mapResponsive, maxSafeInteger, memoize, memoizedGet, minSafeInteger, noop, normalizeEventKey, objectFilter, objectKeys, objectToArrayNotation, omit, once, percentToValue, pick, pipe, px, removeIndex, removeItem, roundValueToStep, runIfFn, split, toPrecision, valueToPercent, walkObject, warn, wrapPointerEventHandler };\n","import * as z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { get } from '@chakra-ui/utils'\nimport { FieldProps } from '@saas-ui/forms'\nimport { FieldTypes } from '../../src'\n\nexport { zodResolver }\n\nexport type Options = {\n min?: number\n max?: number\n}\n\nconst getType = (field: z.ZodTypeAny) => {\n switch (field._def.typeName) {\n case 'ZodArray':\n return 'array'\n case 'ZodObject':\n return 'object'\n case 'ZodNumber':\n return 'number'\n case 'ZodDate':\n return 'date'\n case 'ZodString':\n default:\n return 'text'\n }\n}\n\nconst getArrayOption = (field: any, name: string) => {\n return field._def[name]?.value\n}\n\n/**\n * A helper function to render forms automatically based on a Yup schema\n *\n * @param schema The Yup schema\n * @returns {FieldProps[]}\n */\nexport const getFieldsFromSchema = (schema: z.ZodTypeAny): FieldProps[] => {\n const fields: FieldProps[] = []\n\n let schemaFields: Record<string, any> = {}\n if (schema._def.typeName === 'ZodArray') {\n schemaFields = schema._def.type.shape\n } else if (schema._def.typeName === 'ZodObject') {\n schemaFields = schema._def.shape()\n } else {\n return fields\n }\n\n for (const name in schemaFields) {\n const field = schemaFields[name]\n\n const options: Options = {}\n if (field._def.typeName === 'ZodArray') {\n options.min = getArrayOption(field, 'minLength')\n options.max = getArrayOption(field, 'maxLength')\n }\n\n const meta = field.description && zodParseMeta(field.description)\n\n fields.push({\n name,\n label: meta.label || field.description || name,\n type: meta.type || getType(field),\n ...options,\n })\n }\n return fields\n}\n\nexport const getNestedSchema = (schema: z.ZodTypeAny, path: string) => {\n return get(schema._def.shape(), path)\n}\n\nexport const zodFieldResolver = <T extends z.ZodTypeAny>(schema: T) => {\n return {\n getFields() {\n return getFieldsFromSchema(schema)\n },\n getNestedFields(name: string) {\n return getFieldsFromSchema(getNestedSchema(schema, name))\n },\n }\n}\n\nexport const zodForm = <T extends z.ZodTypeAny>(\n schema: T,\n schemaOptions = {},\n resolverOptions = {}\n) => {\n return {\n schema,\n resolver: zodResolver(schema, schemaOptions, resolverOptions),\n fieldResolver: zodFieldResolver(schema),\n }\n}\n\nexport interface ZodMeta {\n label: string\n type?: FieldTypes\n}\n\nexport const zodMeta = (meta: ZodMeta) => {\n return JSON.stringify(meta)\n}\n\nexport const zodParseMeta = (meta: string) => {\n try {\n return JSON.parse(meta)\n } catch (e) {\n return meta\n }\n}\n"],"names":["HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","funcTag","objectTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","global","Object","freeSelf","self","root","Function","freeExports","exports","nodeType","freeModule","module","moduleExports","freeProcess","process","nodeUtil","require","types","binding","e","nodeIsTypedArray","isTypedArray","apply","func","thisArg","args","length","call","uid","transform","arrayProto","Array","prototype","objectProto","coreJsData","funcToString","toString","hasOwnProperty","maskSrcKey","exec","keys","IE_PROTO","nativeObjectToString","objectCtorString","reIsNative","RegExp","replace","Buffer","undefined","Symbol","Uint8Array","getPrototype","getPrototypeOf","arg","objectCreate","create","propertyIsEnumerable","splice","symToStringTag","toStringTag","defineProperty","getNative","nativeIsBuffer","isBuffer","nativeMax","Math","max","nativeNow","Date","now","Map","nativeCreate","baseCreate","object","proto","isObject","result","Hash","entries","index","this","clear","entry","set","ListCache","MapCache","Stack","data","__data__","size","assignMergeValue","key","value","eq","baseAssignValue","assignValue","objValue","assocIndexOf","array","configurable","enumerable","writable","baseGetTag","isOwn","tag","unmasked","getRawTag","objectToString","baseIsArguments","isObjectLike","baseMerge","source","srcIndex","customizer","stack","iteratee","keysFunc","iterable","props","baseFor","srcValue","mergeFunc","safeGet","stacked","get","typedArray","arrayBuffer","newValue","isCommon","isArr","isArray","isBuff","isTyped","isArrayLike","copyArray","slice","buffer","constructor","byteLength","byteOffset","Ctor","isPlainObject","isArguments","isNew","copyObject","keysIn","toPlainObject","isFunction","isPrototype","initCloneObject","baseMergeDeep","has","pop","push","hash","map","string","getMapData","pairs","LARGE_ARRAY_SIZE","baseSetToString","identity","type","getValue","isMasked","test","toSource","baseIsNative","isIndex","setToString","count","lastCalled","stamp","remaining","arguments","shortOut","other","isLength","baseUnary","inherited","isArg","isType","skipIndexes","n","baseTimes","String","arrayLikeKeys","nativeKeysIn","isProto","baseKeysIn","assigner","mergeWith","start","otherArgs","overRest","baseRest","sources","guard","isIterateeCall","freeze","getType","field","_def","typeName","getArrayOption","name","_field$_def$name","getFieldsFromSchema","schema","fields","schemaFields","shape","options","min","meta","description","zodParseMeta","label","getNestedSchema","path","obj","fallback","split","zodFieldResolver","getFields","getNestedFields","zodForm","schemaOptions","resolverOptions","resolver","zodResolver","fieldResolver","zodMeta","JSON","stringify","parse"],"mappings":"geAUA,IAGIA,EAAiB,4BAOjBC,EAAmB,iBAGnBC,EAAU,qBAMVC,EAAU,oBAKVC,E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C,EAAQC,IACxBW,IAGP,OAAOH,GAGIS,EAAkB,CAACV,EAAsBW,IDgMtD,SAAaC,EAAKD,EAAME,EAAU9I,GAChC,IAAIY,EAAsB,iBAATgI,EAAoBA,EAAKG,MAAM,KAAO,CAACH,GAExD,IAAK5I,EAAQ,EAAGA,EAAQY,EAAIjE,QACrBkM,EAD6B7I,GAAS,EAE3C6I,EAAMA,EAAIjI,EAAIZ,IAGhB,YAAe/B,IAAR4K,OCvMAhG,EDuM+BgG,ECvM/BhG,CAAIoF,EAAON,KAAKS,QAASQ,GAGrBI,EAA4Cf,IAChD,CACLgB,UAAS,IACAjB,EAAoBC,GAE7BiB,gBAAgBpB,GACPE,EAAoBW,EAAgBV,EAAQH,MAK5CqB,EAAU,CACrBlB,EACAmB,EAAgB,GAChBC,EAAkB,MAEX,CACLpB,OAAAA,EACAqB,SAAUC,EAAYtB,EAAQmB,EAAeC,GAC7CG,cAAeR,EAAiBf,KASvBwB,EAAWlB,GACfmB,KAAKC,UAAUpB,GAGXE,EAAgBF,IAC3B,IACE,OAAOmB,KAAKE,MAAMrB,GAClB,MAAOnM,GACP,OAAOmM"}
1
+ {"version":3,"file":"index.modern.js","sources":["../../zod/src/zod-resolver.ts"],"sourcesContent":["import * as z from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { get } from '@chakra-ui/utils'\nimport { FieldProps, FieldTypes } from '@saas-ui/forms'\n\nexport { zodResolver }\n\nexport type Options = {\n min?: number\n max?: number\n}\n\nconst getType = (field: z.ZodTypeAny) => {\n switch (field._def.typeName) {\n case 'ZodArray':\n return 'array'\n case 'ZodObject':\n return 'object'\n case 'ZodNumber':\n return 'number'\n case 'ZodDate':\n return 'date'\n case 'ZodString':\n default:\n return 'text'\n }\n}\n\nconst getArrayOption = (field: any, name: string) => {\n return field._def[name]?.value\n}\n\n/**\n * A helper function to render forms automatically based on a Yup schema\n *\n * @param schema The Yup schema\n * @returns {FieldProps[]}\n */\nexport const getFieldsFromSchema = (schema: z.ZodTypeAny): FieldProps[] => {\n const fields: FieldProps[] = []\n\n let schemaFields: Record<string, any> = {}\n if (schema._def.typeName === 'ZodArray') {\n schemaFields = schema._def.type.shape\n } else if (schema._def.typeName === 'ZodObject') {\n schemaFields = schema._def.shape()\n } else {\n return fields\n }\n\n for (const name in schemaFields) {\n const field = schemaFields[name]\n\n const options: Options = {}\n if (field._def.typeName === 'ZodArray') {\n options.min = getArrayOption(field, 'minLength')\n options.max = getArrayOption(field, 'maxLength')\n }\n\n const meta = field.description && zodParseMeta(field.description)\n\n fields.push({\n name,\n label: meta.label || field.description || name,\n type: meta.type || getType(field),\n ...options,\n })\n }\n return fields\n}\n\nexport const getNestedSchema = (schema: z.ZodTypeAny, path: string) => {\n return get(schema._def.shape(), path)\n}\n\nexport const zodFieldResolver = <T extends z.ZodTypeAny>(schema: T) => {\n return {\n getFields() {\n return getFieldsFromSchema(schema)\n },\n getNestedFields(name: string) {\n return getFieldsFromSchema(getNestedSchema(schema, name))\n },\n }\n}\n\nexport const zodForm = <T extends z.ZodTypeAny>(\n schema: T,\n schemaOptions = {},\n resolverOptions = {}\n) => {\n return {\n schema,\n resolver: zodResolver(schema, schemaOptions, resolverOptions),\n fieldResolver: zodFieldResolver(schema),\n }\n}\n\nexport interface ZodMeta {\n label: string\n type?: FieldTypes\n}\n\nexport const zodMeta = (meta: ZodMeta) => {\n return JSON.stringify(meta)\n}\n\nexport const zodParseMeta = (meta: string) => {\n try {\n return JSON.parse(meta)\n } catch (e) {\n return meta\n }\n}\n"],"names":["getType","field","_def","typeName","getArrayOption","name","_field$_def$name","value","getFieldsFromSchema","schema","fields","schemaFields","type","shape","options","min","max","meta","description","zodParseMeta","push","label","getNestedSchema","path","get","zodFieldResolver","getFields","getNestedFields","zodForm","schemaOptions","resolverOptions","resolver","zodResolver","fieldResolver","zodMeta","JSON","stringify","parse","e"],"mappings":"8VAYA,MAAMA,EAAWC,IACf,OAAQA,EAAMC,KAAKC,UACjB,IAAK,WACH,MAAO,QACT,IAAK,YACH,MAAO,SACT,IAAK,YACH,MAAO,SACT,IAAK,UACH,MAAO,OAET,QACE,MAAO,SAIPC,EAAiB,CAACH,EAAYI,WAClC,gBAAOJ,EAAMC,KAAKG,WAAXC,EAAkBC,OASdC,EAAuBC,IAClC,MAAMC,EAAuB,GAE7B,IAAIC,EAAoC,GACxC,GAA6B,aAAzBF,EAAOP,KAAKC,SACdQ,EAAeF,EAAOP,KAAKU,KAAKC,cACE,cAAzBJ,EAAOP,KAAKC,SAGrB,OAAOO,EAFPC,EAAeF,EAAOP,KAAKW,QAK7B,IAAK,MAAMR,KAAQM,EAAc,CAC/B,MAAMV,EAAQU,EAAaN,GAErBS,EAAmB,GACG,aAAxBb,EAAMC,KAAKC,WACbW,EAAQC,IAAMX,EAAeH,EAAO,aACpCa,EAAQE,IAAMZ,EAAeH,EAAO,cAGtC,MAAMgB,EAAOhB,EAAMiB,aAAeC,EAAalB,EAAMiB,aAErDR,EAAOU,QACLf,KAAAA,EACAgB,MAAOJ,EAAKI,OAASpB,EAAMiB,aAAeb,EAC1CO,KAAMK,EAAKL,MAAQZ,EAAQC,IACxBa,IAGP,OAAOJ,GAGIY,EAAkB,CAACb,EAAsBc,IAC7CC,EAAIf,EAAOP,KAAKW,QAASU,GAGrBE,EAA4ChB,IAChD,CACLiB,UAAS,IACAlB,EAAoBC,GAE7BkB,gBAAgBtB,GACPG,EAAoBc,EAAgBb,EAAQJ,MAK5CuB,EAAU,CACrBnB,EACAoB,EAAgB,GAChBC,EAAkB,MAEX,CACLrB,OAAAA,EACAsB,SAAUC,EAAYvB,EAAQoB,EAAeC,GAC7CG,cAAeR,EAAiBhB,KASvByB,EAAWjB,GACfkB,KAAKC,UAAUnB,GAGXE,EAAgBF,IAC3B,IACE,OAAOkB,KAAKE,MAAMpB,GAClB,MAAOqB,GACP,OAAOrB"}
File without changes
@@ -1,7 +1,6 @@
1
1
  import * as z from 'zod';
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
- import { FieldProps } from '@saas-ui/forms';
4
- import { FieldTypes } from '../../src';
3
+ import { FieldProps, FieldTypes } from '@saas-ui/forms';
5
4
  export { zodResolver };
6
5
  export declare type Options = {
7
6
  min?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"zod-resolver.d.ts","sourceRoot":"","sources":["../../../../zod/src/zod-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,oBAAY,OAAO,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAsBD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,4BAA2B,UAAU,EA+BpE,CAAA;AAED,eAAO,MAAM,eAAe,+BAAgC,MAAM,QAEjE,CAAA;AAED,eAAO,MAAM,gBAAgB;;0BAKH,MAAM;CAI/B,CAAA;AAED,eAAO,MAAM,OAAO;;;;;8BANM,MAAM;;CAgB/B,CAAA;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,eAAO,MAAM,OAAO,SAAU,OAAO,WAEpC,CAAA;AAED,eAAO,MAAM,YAAY,SAAU,MAAM,QAMxC,CAAA"}
1
+ {"version":3,"file":"zod-resolver.d.ts","sourceRoot":"","sources":["../../zod/src/zod-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,oBAAY,OAAO,GAAG;IACpB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAsBD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,4BAA2B,UAAU,EA+BpE,CAAA;AAED,eAAO,MAAM,eAAe,+BAAgC,MAAM,QAEjE,CAAA;AAED,eAAO,MAAM,gBAAgB;;0BAKH,MAAM;CAI/B,CAAA;AAED,eAAO,MAAM,OAAO;;;;;8BANM,MAAM;;CAgB/B,CAAA;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,eAAO,MAAM,OAAO,SAAU,OAAO,WAEpC,CAAA;AAED,eAAO,MAAM,YAAY,SAAU,MAAM,QAMxC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/forms",
3
- "version": "0.7.2",
3
+ "version": "0.7.6",
4
4
  "description": "Theme and components agnostic SaasProvider",
5
5
  "source": "src/index.ts",
6
6
  "exports": {
@@ -42,7 +42,9 @@
42
42
  "files": [
43
43
  "dist",
44
44
  "src",
45
+ "yup/package.json",
45
46
  "yup/src",
47
+ "zod/package.json",
46
48
  "zod/src"
47
49
  ],
48
50
  "sideEffects": false,
@@ -89,6 +91,7 @@
89
91
  "@saas-ui/radio": "0.3.0",
90
92
  "@saas-ui/react-utils": "0.1.0",
91
93
  "@saas-ui/select": "0.4.0",
94
+ "@saas-ui/stepper": "0.2.2",
92
95
  "react-hook-form": "^7.22.0"
93
96
  },
94
97
  "peerDependencies": {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react'
2
2
 
3
3
  import { chakra, ResponsiveValue } from '@chakra-ui/system'
4
-
4
+ import { __DEV__ } from '@chakra-ui/utils'
5
5
  import { AddIcon, MinusIcon } from '@chakra-ui/icons'
6
6
  import { IconButton, ButtonProps } from '@saas-ui/button'
7
7
 
@@ -59,6 +59,10 @@ export const ArrayFieldRow: React.FC<ArrayFieldRowProps> = ({
59
59
  )
60
60
  }
61
61
 
62
+ if (__DEV__) {
63
+ ArrayFieldRow.displayName = 'ArrayFieldRow'
64
+ }
65
+
62
66
  export interface ArrayFieldRowFieldsProps {
63
67
  /**
64
68
  * Amount of field columns
@@ -90,6 +94,10 @@ export const ArrayFieldRowFields: React.FC<ArrayFieldRowFieldsProps> = ({
90
94
  )
91
95
  }
92
96
 
97
+ if (__DEV__) {
98
+ ArrayFieldRowFields.displayName = 'ArrayFieldRowFields'
99
+ }
100
+
93
101
  export const ArrayFieldRowContainer: React.FC<ArrayFieldRowProps> = ({
94
102
  children,
95
103
  index,
@@ -111,6 +119,10 @@ export const ArrayFieldRowContainer: React.FC<ArrayFieldRowProps> = ({
111
119
  )
112
120
  }
113
121
 
122
+ if (__DEV__) {
123
+ ArrayFieldRowContainer.displayName = 'ArrayFieldRowContainer'
124
+ }
125
+
114
126
  export const ArrayFieldRemoveButton: React.FC<ButtonProps> = (props) => {
115
127
  return (
116
128
  <IconButton
@@ -122,6 +134,10 @@ export const ArrayFieldRemoveButton: React.FC<ButtonProps> = (props) => {
122
134
  )
123
135
  }
124
136
 
137
+ if (__DEV__) {
138
+ ArrayFieldRemoveButton.displayName = 'ArrayFieldRemoveButton'
139
+ }
140
+
125
141
  export const ArrayFieldAddButton: React.FC<ButtonProps> = (props) => {
126
142
  return (
127
143
  <IconButton
@@ -134,6 +150,10 @@ export const ArrayFieldAddButton: React.FC<ButtonProps> = (props) => {
134
150
  )
135
151
  }
136
152
 
153
+ if (__DEV__) {
154
+ ArrayFieldAddButton.displayName = 'ArrayFieldAddButton'
155
+ }
156
+
137
157
  export interface ArrayFieldProps
138
158
  extends ArrayFieldOptions,
139
159
  Omit<FieldProps, 'defaultValue'> {}
@@ -161,6 +181,10 @@ export const ArrayField = React.forwardRef(
161
181
  }
162
182
  )
163
183
 
184
+ if (__DEV__) {
185
+ ArrayField.displayName = 'ArrayField'
186
+ }
187
+
164
188
  export interface ArrayFieldRowsProps {
165
189
  children: (fields: ArrayField[]) => React.ReactElement | null
166
190
  }
@@ -172,6 +196,10 @@ export const ArrayFieldRows = ({
172
196
  return children(fields)
173
197
  }
174
198
 
199
+ if (__DEV__) {
200
+ ArrayFieldRows.displayName = 'ArrayFieldRows'
201
+ }
202
+
175
203
  export const ArrayFieldContainer = React.forwardRef(
176
204
  (
177
205
  {
@@ -205,3 +233,7 @@ export const ArrayFieldContainer = React.forwardRef(
205
233
  )
206
234
  }
207
235
  )
236
+
237
+ if (__DEV__) {
238
+ ArrayFieldContainer.displayName = 'ArrayFieldContainer'
239
+ }
package/src/auto-form.tsx CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
  import { FieldValues, UseFormReturn } from 'react-hook-form'
3
3
  import { forwardRef } from '@chakra-ui/react'
4
+ import { __DEV__ } from '@chakra-ui/utils'
4
5
 
5
6
  import { Form, FormProps } from './form'
6
7
  import { FormLayout } from './layout'
@@ -38,4 +39,11 @@ export const AutoForm = forwardRef(
38
39
  props: AutoFormProps<TFieldValues> & {
39
40
  ref?: React.ForwardedRef<UseFormReturn<TFieldValues>>
40
41
  }
41
- ) => React.ReactElement) & { getFieldResolver?: (schema: any) => FieldResolver }
42
+ ) => React.ReactElement) & {
43
+ displayName?: string
44
+ getFieldResolver?: (schema: any) => FieldResolver
45
+ }
46
+
47
+ if (__DEV__) {
48
+ AutoForm.displayName = 'AutoForm'
49
+ }
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react'
2
+ import { __DEV__ } from '@chakra-ui/utils'
2
3
  import { useFormContext } from 'react-hook-form'
3
4
 
4
5
  import {
@@ -30,7 +31,15 @@ export const DisplayField: React.FC<DisplayFieldProps> = ({
30
31
  )
31
32
  }
32
33
 
34
+ if (__DEV__) {
35
+ DisplayField.displayName = 'DisplayField'
36
+ }
37
+
33
38
  export const FormValue: React.FC<{ name: string }> = ({ name }) => {
34
39
  const { getValues } = useFormContext()
35
40
  return getValues(name) || null
36
41
  }
42
+
43
+ if (__DEV__) {
44
+ FormValue.displayName = 'FormValue'
45
+ }
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react'
2
+ import { __DEV__ } from '@chakra-ui/utils'
2
3
  import {
3
4
  useFormContext,
4
5
  useWatch,
@@ -32,3 +33,7 @@ export const DisplayIf = <TFieldValues extends FieldValues = FieldValues>({
32
33
  const context = useFormContext<TFieldValues>()
33
34
  return condition(value, context) ? children : null
34
35
  }
36
+
37
+ if (__DEV__) {
38
+ DisplayIf.displayName = 'DisplayIf'
39
+ }
package/src/field.tsx CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  Switch,
24
24
  useMergeRefs,
25
25
  } from '@chakra-ui/react'
26
+ import { __DEV__ } from '@chakra-ui/utils'
26
27
 
27
28
  import { NumberInput } from '@saas-ui/number-input'
28
29
  import { PasswordInput } from '@saas-ui/password-input'
@@ -154,6 +155,11 @@ export const BaseField: React.FC<FieldProps> = (props) => {
154
155
  </FormControl>
155
156
  )
156
157
  }
158
+
159
+ if (__DEV__) {
160
+ BaseField.displayName = 'BaseField'
161
+ }
162
+
157
163
  export const Field = forwardRef(
158
164
  <TFieldValues extends FieldValues = FieldValues>(
159
165
  props: FieldProps<TFieldValues> & {
package/src/fields.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react'
2
+ import { __DEV__ } from '@chakra-ui/utils'
2
3
 
3
4
  import { Form } from './form'
4
5
  import { FormLayout } from './layout'
@@ -64,3 +65,7 @@ export const Fields: React.FC<FieldsProps> = ({
64
65
  </FormLayout>
65
66
  )
66
67
  }
68
+
69
+ if (__DEV__) {
70
+ Fields.displayName = 'Fields'
71
+ }
package/src/form.tsx CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
 
3
3
  import { chakra, HTMLChakraProps, forwardRef } from '@chakra-ui/react'
4
+ import { cx, __DEV__ } from '@chakra-ui/utils'
4
5
 
5
6
  import {
6
7
  useForm,
@@ -15,6 +16,7 @@ import {
15
16
  ResolverResult,
16
17
  } from 'react-hook-form'
17
18
  import { objectFieldResolver, FieldResolver } from './field-resolver'
19
+ import { css } from '@emotion/react'
18
20
 
19
21
  export type { UseFormReturn, FieldValues, SubmitHandler }
20
22
 
@@ -97,6 +99,7 @@ export const Form = forwardRef(
97
99
  ref={formRef}
98
100
  onSubmit={handleSubmit(onSubmit, onError)}
99
101
  {...rest}
102
+ className={cx('saas-form', props.className)}
100
103
  >
101
104
  {children}
102
105
  </chakra.form>
@@ -108,12 +111,17 @@ export const Form = forwardRef(
108
111
  ref?: React.ForwardedRef<UseFormReturn<TFieldValues>>
109
112
  }
110
113
  ) => React.ReactElement) & {
114
+ displayName?: string
111
115
  getResolver?: GetResolver
112
116
  getFieldResolver: GetFieldResolver
113
117
  }
114
118
 
115
119
  Form.getFieldResolver = objectFieldResolver
116
120
 
121
+ if (__DEV__) {
122
+ Form.displayName = 'Form'
123
+ }
124
+
117
125
  export type GetResolver = (
118
126
  schema: any
119
127
  ) => <TFieldValues extends FieldValues, TContext>(
package/src/layout.tsx CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react'
2
2
 
3
3
  import { chakra, SimpleGrid, SimpleGridProps, useTheme } from '@chakra-ui/react'
4
+ import { cx, __DEV__ } from '@chakra-ui/utils'
4
5
 
5
6
  export type FormLayoutProps = SimpleGridProps
6
7
 
@@ -12,6 +13,10 @@ const FormLayoutItem: React.FC<FormLayoutItemProps> = ({ children }) => {
12
13
  return <chakra.div>{children}</chakra.div>
13
14
  }
14
15
 
16
+ if (__DEV__) {
17
+ FormLayoutItem.displayName = 'FormLayoutItem'
18
+ }
19
+
15
20
  /**
16
21
  * FormLayout
17
22
  *
@@ -31,7 +36,10 @@ export const FormLayout = ({ children, ...props }: FormLayoutProps) => {
31
36
  }
32
37
 
33
38
  return (
34
- <SimpleGrid {...gridProps}>
39
+ <SimpleGrid
40
+ {...gridProps}
41
+ className={cx('saas-form__layout', props.className)}
42
+ >
35
43
  {React.Children.map(children, (child) => {
36
44
  if (React.isValidElement(child)) {
37
45
  return <FormLayoutItem>{child}</FormLayoutItem>
@@ -41,3 +49,7 @@ export const FormLayout = ({ children, ...props }: FormLayoutProps) => {
41
49
  </SimpleGrid>
42
50
  )
43
51
  }
52
+
53
+ if (__DEV__) {
54
+ FormLayout.displayName = 'FormLayout'
55
+ }