mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
132 KiB
Plaintext
1 line
132 KiB
Plaintext
{"version":3,"file":"formik.esm.js","sources":["../src/utils.ts","../src/FormikContext.tsx","../src/Formik.tsx","../src/Field.tsx","../src/Form.tsx","../src/withFormik.tsx","../src/connect.tsx","../src/FieldArray.tsx","../src/ErrorMessage.tsx","../src/FastField.tsx"],"sourcesContent":["import clone from 'lodash/clone';\nimport toPath from 'lodash/toPath';\nimport * as React from 'react';\n\n// Assertions\n\n/** @private is the value an empty array? */\nexport const isEmptyArray = (value?: any) =>\n Array.isArray(value) && value.length === 0;\n\n/** @private is the given object a Function? */\nexport const isFunction = (obj: any): obj is Function =>\n typeof obj === 'function';\n\n/** @private is the given object an Object? */\nexport const isObject = (obj: any): obj is Object =>\n obj !== null && typeof obj === 'object';\n\n/** @private is the given object an integer? */\nexport const isInteger = (obj: any): boolean =>\n String(Math.floor(Number(obj))) === obj;\n\n/** @private is the given object a string? */\nexport const isString = (obj: any): obj is string =>\n Object.prototype.toString.call(obj) === '[object String]';\n\n/** @private is the given object a NaN? */\n// eslint-disable-next-line no-self-compare\nexport const isNaN = (obj: any): boolean => obj !== obj;\n\n/** @private Does a React component have exactly 0 children? */\nexport const isEmptyChildren = (children: any): boolean =>\n React.Children.count(children) === 0;\n\n/** @private is the given object/value a promise? */\nexport const isPromise = (value: any): value is PromiseLike<any> =>\n isObject(value) && isFunction(value.then);\n\n/** @private is the given object/value a type of synthetic event? */\nexport const isInputEvent = (value: any): value is React.SyntheticEvent<any> =>\n value && isObject(value) && isObject(value.target);\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n *\n * The activeElement will be null only if the document or document body is not\n * yet defined.\n *\n * @param {?Document} doc Defaults to current document.\n * @return {Element | null}\n * @see https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/dom/getActiveElement.js\n */\nexport function getActiveElement(doc?: Document): Element | null {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n if (typeof doc === 'undefined') {\n return null;\n }\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\n/**\n * Deeply get a value from an object via its path.\n */\nexport function getIn(\n obj: any,\n key: string | string[],\n def?: any,\n p: number = 0\n) {\n const path = toPath(key);\n while (obj && p < path.length) {\n obj = obj[path[p++]];\n }\n return obj === undefined ? def : obj;\n}\n\n/**\n * Deeply set a value from in object via it's path. If the value at `path`\n * has changed, return a shallow copy of obj with `value` set at `path`.\n * If `value` has not changed, return the original `obj`.\n *\n * Existing objects / arrays along `path` are also shallow copied. Sibling\n * objects along path retain the same internal js reference. Since new\n * objects / arrays are only created along `path`, we can test if anything\n * changed in a nested structure by comparing the object's reference in\n * the old and new object, similar to how russian doll cache invalidation\n * works.\n *\n * In earlier versions of this function, which used cloneDeep, there were\n * issues whereby settings a nested value would mutate the parent\n * instead of creating a new object. `clone` avoids that bug making a\n * shallow copy of the objects along the update path\n * so no object is mutated in place.\n *\n * Before changing this function, please read through the following\n * discussions.\n *\n * @see https://github.com/developit/linkstate\n * @see https://github.com/jaredpalmer/formik/pull/123\n */\nexport function setIn(obj: any, path: string, value: any): any {\n let res: any = clone(obj); // this keeps inheritance when obj is a class\n let resVal: any = res;\n let i = 0;\n let pathArray = toPath(path);\n\n for (; i < pathArray.length - 1; i++) {\n const currentPath: string = pathArray[i];\n let currentObj: any = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = clone(currentObj);\n } else {\n const nextPath: string = pathArray[i + 1];\n resVal = resVal[currentPath] =\n isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n }\n\n // Return original object if new value is the same as current\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n }\n\n // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}\n\n/**\n * Recursively a set the same value for all keys and arrays nested object, cloning\n * @param object\n * @param value\n * @param visited\n * @param response\n */\nexport function setNestedObjectValues<T>(\n object: any,\n value: any,\n visited: any = new WeakMap(),\n response: any = {}\n): T {\n for (let k of Object.keys(object)) {\n const val = object[k];\n if (isObject(val)) {\n if (!visited.get(val)) {\n visited.set(val, true);\n // In order to keep array values consistent for both dot path and\n // bracket syntax, we need to check if this is an array so that\n // this will output { friends: [true] } and not { friends: { \"0\": true } }\n response[k] = Array.isArray(val) ? [] : {};\n setNestedObjectValues(val, value, visited, response[k]);\n }\n } else {\n response[k] = value;\n }\n }\n\n return response;\n}\n","import * as React from 'react';\nimport { FormikContextType } from './types';\nimport invariant from 'tiny-warning';\n\nexport const FormikContext = React.createContext<FormikContextType<any>>(\n undefined as any\n);\nFormikContext.displayName = 'FormikContext';\n\nexport const FormikProvider = FormikContext.Provider;\nexport const FormikConsumer = FormikContext.Consumer;\n\nexport function useFormikContext<Values>() {\n const formik = React.useContext<FormikContextType<Values>>(FormikContext);\n\n invariant(\n !!formik,\n `Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component.`\n );\n\n return formik;\n}\n","import * as React from 'react';\nimport isEqual from 'react-fast-compare';\nimport deepmerge from 'deepmerge';\nimport isPlainObject from 'lodash/isPlainObject';\nimport {\n FormikConfig,\n FormikErrors,\n FormikState,\n FormikTouched,\n FormikValues,\n FormikProps,\n FieldMetaProps,\n FieldHelperProps,\n FieldInputProps,\n FormikHelpers,\n FormikHandlers,\n} from './types';\nimport {\n isFunction,\n isString,\n setIn,\n isEmptyChildren,\n isPromise,\n setNestedObjectValues,\n getActiveElement,\n getIn,\n isObject,\n} from './utils';\nimport { FormikProvider } from './FormikContext';\nimport invariant from 'tiny-warning';\n\ntype FormikMessage<Values> =\n | { type: 'SUBMIT_ATTEMPT' }\n | { type: 'SUBMIT_FAILURE' }\n | { type: 'SUBMIT_SUCCESS' }\n | { type: 'SET_ISVALIDATING'; payload: boolean }\n | { type: 'SET_ISSUBMITTING'; payload: boolean }\n | { type: 'SET_VALUES'; payload: Values }\n | { type: 'SET_FIELD_VALUE'; payload: { field: string; value?: any } }\n | { type: 'SET_FIELD_TOUCHED'; payload: { field: string; value?: boolean } }\n | { type: 'SET_FIELD_ERROR'; payload: { field: string; value?: string } }\n | { type: 'SET_TOUCHED'; payload: FormikTouched<Values> }\n | { type: 'SET_ERRORS'; payload: FormikErrors<Values> }\n | { type: 'SET_STATUS'; payload: any }\n | {\n type: 'SET_FORMIK_STATE';\n payload: (s: FormikState<Values>) => FormikState<Values>;\n }\n | {\n type: 'RESET_FORM';\n payload: FormikState<Values>;\n };\n\n// State reducer\nfunction formikReducer<Values>(\n state: FormikState<Values>,\n msg: FormikMessage<Values>\n) {\n switch (msg.type) {\n case 'SET_VALUES':\n return { ...state, values: msg.payload };\n case 'SET_TOUCHED':\n return { ...state, touched: msg.payload };\n case 'SET_ERRORS':\n if (isEqual(state.errors, msg.payload)) {\n return state;\n }\n\n return { ...state, errors: msg.payload };\n case 'SET_STATUS':\n return { ...state, status: msg.payload };\n case 'SET_ISSUBMITTING':\n return { ...state, isSubmitting: msg.payload };\n case 'SET_ISVALIDATING':\n return { ...state, isValidating: msg.payload };\n case 'SET_FIELD_VALUE':\n return {\n ...state,\n values: setIn(state.values, msg.payload.field, msg.payload.value),\n };\n case 'SET_FIELD_TOUCHED':\n return {\n ...state,\n touched: setIn(state.touched, msg.payload.field, msg.payload.value),\n };\n case 'SET_FIELD_ERROR':\n return {\n ...state,\n errors: setIn(state.errors, msg.payload.field, msg.payload.value),\n };\n case 'RESET_FORM':\n return { ...state, ...msg.payload };\n case 'SET_FORMIK_STATE':\n return msg.payload(state);\n case 'SUBMIT_ATTEMPT':\n return {\n ...state,\n touched: setNestedObjectValues<FormikTouched<Values>>(\n state.values,\n true\n ),\n isSubmitting: true,\n submitCount: state.submitCount + 1,\n };\n case 'SUBMIT_FAILURE':\n return {\n ...state,\n isSubmitting: false,\n };\n case 'SUBMIT_SUCCESS':\n return {\n ...state,\n isSubmitting: false,\n };\n default:\n return state;\n }\n}\n\n// Initial empty states // objects\nconst emptyErrors: FormikErrors<unknown> = {};\nconst emptyTouched: FormikTouched<unknown> = {};\n\n// This is an object that contains a map of all registered fields\n// and their validate functions\ninterface FieldRegistry {\n [field: string]: {\n validate: (value: any) => string | Promise<string> | undefined;\n };\n}\n\nexport function useFormik<Values extends FormikValues = FormikValues>({\n validateOnChange = true,\n validateOnBlur = true,\n validateOnMount = false,\n isInitialValid,\n enableReinitialize = false,\n onSubmit,\n ...rest\n}: FormikConfig<Values>) {\n const props = {\n validateOnChange,\n validateOnBlur,\n validateOnMount,\n onSubmit,\n ...rest,\n };\n const initialValues = React.useRef(props.initialValues);\n const initialErrors = React.useRef(props.initialErrors || emptyErrors);\n const initialTouched = React.useRef(props.initialTouched || emptyTouched);\n const initialStatus = React.useRef(props.initialStatus);\n const isMounted = React.useRef<boolean>(false);\n const fieldRegistry = React.useRef<FieldRegistry>({});\n if (__DEV__) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n invariant(\n typeof isInitialValid === 'undefined',\n 'isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead.'\n );\n // eslint-disable-next-line\n }, []);\n }\n\n React.useEffect(() => {\n isMounted.current = true;\n\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const [state, dispatch] = React.useReducer<\n React.Reducer<FormikState<Values>, FormikMessage<Values>>\n >(formikReducer, {\n values: props.initialValues,\n errors: props.initialErrors || emptyErrors,\n touched: props.initialTouched || emptyTouched,\n status: props.initialStatus,\n isSubmitting: false,\n isValidating: false,\n submitCount: 0,\n });\n\n const runValidateHandler = React.useCallback(\n (values: Values, field?: string): Promise<FormikErrors<Values>> => {\n return new Promise((resolve, reject) => {\n const maybePromisedErrors = (props.validate as any)(values, field);\n if (maybePromisedErrors == null) {\n // use loose null check here on purpose\n resolve(emptyErrors);\n } else if (isPromise(maybePromisedErrors)) {\n (maybePromisedErrors as Promise<any>).then(\n errors => {\n resolve(errors || emptyErrors);\n },\n actualException => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: An unhandled error was caught during validation in <Formik validate />`,\n actualException\n );\n }\n\n reject(actualException);\n }\n );\n } else {\n resolve(maybePromisedErrors);\n }\n });\n },\n [props.validate]\n );\n\n /**\n * Run validation against a Yup schema and optionally run a function if successful\n */\n const runValidationSchema = React.useCallback(\n (values: Values, field?: string): Promise<FormikErrors<Values>> => {\n const validationSchema = props.validationSchema;\n const schema = isFunction(validationSchema)\n ? validationSchema(field)\n : validationSchema;\n const promise =\n field && schema.validateAt\n ? schema.validateAt(field, values)\n : validateYupSchema(values, schema);\n return new Promise((resolve, reject) => {\n promise.then(\n () => {\n resolve(emptyErrors);\n },\n (err: any) => {\n // Yup will throw a validation error if validation fails. We catch those and\n // resolve them into Formik errors. We can sniff if something is a Yup error\n // by checking error.name.\n // @see https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n if (err.name === 'ValidationError') {\n resolve(yupToFormErrors(err));\n } else {\n // We throw any other errors\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: An unhandled error was caught during validation in <Formik validationSchema />`,\n err\n );\n }\n\n reject(err);\n }\n }\n );\n });\n },\n [props.validationSchema]\n );\n\n const runSingleFieldLevelValidation = React.useCallback(\n (field: string, value: void | string): Promise<string> => {\n return new Promise(resolve =>\n resolve(fieldRegistry.current[field].validate(value) as string)\n );\n },\n []\n );\n\n const runFieldLevelValidations = React.useCallback(\n (values: Values): Promise<FormikErrors<Values>> => {\n const fieldKeysWithValidation: string[] = Object.keys(\n fieldRegistry.current\n ).filter(f => isFunction(fieldRegistry.current[f].validate));\n\n // Construct an array with all of the field validation functions\n const fieldValidations: Promise<string>[] =\n fieldKeysWithValidation.length > 0\n ? fieldKeysWithValidation.map(f =>\n runSingleFieldLevelValidation(f, getIn(values, f))\n )\n : [Promise.resolve('DO_NOT_DELETE_YOU_WILL_BE_FIRED')]; // use special case ;)\n\n return Promise.all(fieldValidations).then((fieldErrorsList: string[]) =>\n fieldErrorsList.reduce((prev, curr, index) => {\n if (curr === 'DO_NOT_DELETE_YOU_WILL_BE_FIRED') {\n return prev;\n }\n if (curr) {\n prev = setIn(prev, fieldKeysWithValidation[index], curr);\n }\n return prev;\n }, {})\n );\n },\n [runSingleFieldLevelValidation]\n );\n\n // Run all validations and return the result\n const runAllValidations = React.useCallback(\n (values: Values) => {\n return Promise.all([\n runFieldLevelValidations(values),\n props.validationSchema ? runValidationSchema(values) : {},\n props.validate ? runValidateHandler(values) : {},\n ]).then(([fieldErrors, schemaErrors, validateErrors]) => {\n const combinedErrors = deepmerge.all<FormikErrors<Values>>(\n [fieldErrors, schemaErrors, validateErrors],\n { arrayMerge }\n );\n return combinedErrors;\n });\n },\n [\n props.validate,\n props.validationSchema,\n runFieldLevelValidations,\n runValidateHandler,\n runValidationSchema,\n ]\n );\n\n // Run all validations methods and update state accordingly\n const validateFormWithHighPriority = useEventCallback(\n (values: Values = state.values) => {\n dispatch({ type: 'SET_ISVALIDATING', payload: true });\n return runAllValidations(values).then(combinedErrors => {\n if (!!isMounted.current) {\n dispatch({ type: 'SET_ISVALIDATING', payload: false });\n dispatch({ type: 'SET_ERRORS', payload: combinedErrors });\n }\n return combinedErrors;\n });\n }\n );\n\n React.useEffect(() => {\n if (\n validateOnMount &&\n isMounted.current === true &&\n isEqual(initialValues.current, props.initialValues)\n ) {\n validateFormWithHighPriority(initialValues.current);\n }\n }, [validateOnMount, validateFormWithHighPriority]);\n\n const resetForm = React.useCallback(\n (nextState?: Partial<FormikState<Values>>) => {\n const values =\n nextState && nextState.values\n ? nextState.values\n : initialValues.current;\n const errors =\n nextState && nextState.errors\n ? nextState.errors\n : initialErrors.current\n ? initialErrors.current\n : props.initialErrors || {};\n const touched =\n nextState && nextState.touched\n ? nextState.touched\n : initialTouched.current\n ? initialTouched.current\n : props.initialTouched || {};\n const status =\n nextState && nextState.status\n ? nextState.status\n : initialStatus.current\n ? initialStatus.current\n : props.initialStatus;\n initialValues.current = values;\n initialErrors.current = errors;\n initialTouched.current = touched;\n initialStatus.current = status;\n\n const dispatchFn = () => {\n dispatch({\n type: 'RESET_FORM',\n payload: {\n isSubmitting: !!nextState && !!nextState.isSubmitting,\n errors,\n touched,\n status,\n values,\n isValidating: !!nextState && !!nextState.isValidating,\n submitCount:\n !!nextState &&\n !!nextState.submitCount &&\n typeof nextState.submitCount === 'number'\n ? nextState.submitCount\n : 0,\n },\n });\n };\n\n if (props.onReset) {\n const maybePromisedOnReset = (props.onReset as any)(\n state.values,\n imperativeMethods\n );\n\n if (isPromise(maybePromisedOnReset)) {\n (maybePromisedOnReset as Promise<any>).then(dispatchFn);\n } else {\n dispatchFn();\n }\n } else {\n dispatchFn();\n }\n },\n [props.initialErrors, props.initialStatus, props.initialTouched]\n );\n\n React.useEffect(() => {\n if (\n isMounted.current === true &&\n !isEqual(initialValues.current, props.initialValues)\n ) {\n if (enableReinitialize) {\n initialValues.current = props.initialValues;\n resetForm();\n }\n\n if (validateOnMount) {\n validateFormWithHighPriority(initialValues.current);\n }\n }\n }, [\n enableReinitialize,\n props.initialValues,\n resetForm,\n validateOnMount,\n validateFormWithHighPriority,\n ]);\n\n React.useEffect(() => {\n if (\n enableReinitialize &&\n isMounted.current === true &&\n !isEqual(initialErrors.current, props.initialErrors)\n ) {\n initialErrors.current = props.initialErrors || emptyErrors;\n dispatch({\n type: 'SET_ERRORS',\n payload: props.initialErrors || emptyErrors,\n });\n }\n }, [enableReinitialize, props.initialErrors]);\n\n React.useEffect(() => {\n if (\n enableReinitialize &&\n isMounted.current === true &&\n !isEqual(initialTouched.current, props.initialTouched)\n ) {\n initialTouched.current = props.initialTouched || emptyTouched;\n dispatch({\n type: 'SET_TOUCHED',\n payload: props.initialTouched || emptyTouched,\n });\n }\n }, [enableReinitialize, props.initialTouched]);\n\n React.useEffect(() => {\n if (\n enableReinitialize &&\n isMounted.current === true &&\n !isEqual(initialStatus.current, props.initialStatus)\n ) {\n initialStatus.current = props.initialStatus;\n dispatch({\n type: 'SET_STATUS',\n payload: props.initialStatus,\n });\n }\n }, [enableReinitialize, props.initialStatus, props.initialTouched]);\n\n const validateField = useEventCallback((name: string) => {\n // This will efficiently validate a single field by avoiding state\n // changes if the validation function is synchronous. It's different from\n // what is called when using validateForm.\n\n if (\n fieldRegistry.current[name] &&\n isFunction(fieldRegistry.current[name].validate)\n ) {\n const value = getIn(state.values, name);\n const maybePromise = fieldRegistry.current[name].validate(value);\n if (isPromise(maybePromise)) {\n // Only flip isValidating if the function is async.\n dispatch({ type: 'SET_ISVALIDATING', payload: true });\n return maybePromise\n .then((x: any) => x)\n .then((error: string) => {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: name, value: error },\n });\n dispatch({ type: 'SET_ISVALIDATING', payload: false });\n });\n } else {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: maybePromise as string | undefined,\n },\n });\n return Promise.resolve(maybePromise as string | undefined);\n }\n } else if (props.validationSchema) {\n dispatch({ type: 'SET_ISVALIDATING', payload: true });\n return runValidationSchema(state.values, name)\n .then((x: any) => x)\n .then((error: any) => {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field: name, value: error[name] },\n });\n dispatch({ type: 'SET_ISVALIDATING', payload: false });\n });\n }\n\n return Promise.resolve();\n });\n\n const registerField = React.useCallback((name: string, { validate }: any) => {\n fieldRegistry.current[name] = {\n validate,\n };\n }, []);\n\n const unregisterField = React.useCallback((name: string) => {\n delete fieldRegistry.current[name];\n }, []);\n\n const setTouched = useEventCallback(\n (touched: FormikTouched<Values>, shouldValidate?: boolean) => {\n dispatch({ type: 'SET_TOUCHED', payload: touched });\n const willValidate =\n shouldValidate === undefined ? validateOnBlur : shouldValidate;\n return willValidate\n ? validateFormWithHighPriority(state.values)\n : Promise.resolve();\n }\n );\n\n const setErrors = React.useCallback((errors: FormikErrors<Values>) => {\n dispatch({ type: 'SET_ERRORS', payload: errors });\n }, []);\n\n const setValues = useEventCallback(\n (values: React.SetStateAction<Values>, shouldValidate?: boolean) => {\n const resolvedValues = isFunction(values) ? values(state.values) : values;\n\n dispatch({ type: 'SET_VALUES', payload: resolvedValues });\n const willValidate =\n shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate\n ? validateFormWithHighPriority(resolvedValues)\n : Promise.resolve();\n }\n );\n\n const setFieldError = React.useCallback(\n (field: string, value: string | undefined) => {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: { field, value },\n });\n },\n []\n );\n\n const setFieldValue = useEventCallback(\n (field: string, value: any, shouldValidate?: boolean) => {\n dispatch({\n type: 'SET_FIELD_VALUE',\n payload: {\n field,\n value,\n },\n });\n const willValidate =\n shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate\n ? validateFormWithHighPriority(setIn(state.values, field, value))\n : Promise.resolve();\n }\n );\n\n const executeChange = React.useCallback(\n (eventOrTextValue: string | React.ChangeEvent<any>, maybePath?: string) => {\n // By default, assume that the first argument is a string. This allows us to use\n // handleChange with React Native and React Native Web's onChangeText prop which\n // provides just the value of the input.\n let field = maybePath;\n let val = eventOrTextValue;\n let parsed;\n // If the first argument is not a string though, it has to be a synthetic React Event (or a fake one),\n // so we handle like we would a normal HTML change event.\n if (!isString(eventOrTextValue)) {\n // If we can, persist the event\n // @see https://reactjs.org/docs/events.html#event-pooling\n if ((eventOrTextValue as any).persist) {\n (eventOrTextValue as React.ChangeEvent<any>).persist();\n }\n const target = eventOrTextValue.target\n ? (eventOrTextValue as React.ChangeEvent<any>).target\n : (eventOrTextValue as React.ChangeEvent<any>).currentTarget;\n\n const {\n type,\n name,\n id,\n value,\n checked,\n outerHTML,\n options,\n multiple,\n } = target;\n\n field = maybePath ? maybePath : name ? name : id;\n if (!field && __DEV__) {\n warnAboutMissingIdentifier({\n htmlContent: outerHTML,\n documentationAnchorLink: 'handlechange-e-reactchangeeventany--void',\n handlerName: 'handleChange',\n });\n }\n val = /number|range/.test(type)\n ? ((parsed = parseFloat(value)), isNaN(parsed) ? '' : parsed)\n : /checkbox/.test(type) // checkboxes\n ? getValueForCheckbox(getIn(state.values, field!), checked, value)\n : options && multiple // <select multiple>\n ? getSelectedValues(options)\n : value;\n }\n\n if (field) {\n // Set form fields by name\n setFieldValue(field, val);\n }\n },\n [setFieldValue, state.values]\n );\n\n const handleChange = useEventCallback<FormikHandlers['handleChange']>(\n (\n eventOrPath: string | React.ChangeEvent<any>\n ): void | ((eventOrTextValue: string | React.ChangeEvent<any>) => void) => {\n if (isString(eventOrPath)) {\n return event => executeChange(event, eventOrPath);\n } else {\n executeChange(eventOrPath);\n }\n }\n );\n\n const setFieldTouched = useEventCallback(\n (field: string, touched: boolean = true, shouldValidate?: boolean) => {\n dispatch({\n type: 'SET_FIELD_TOUCHED',\n payload: {\n field,\n value: touched,\n },\n });\n const willValidate =\n shouldValidate === undefined ? validateOnBlur : shouldValidate;\n return willValidate\n ? validateFormWithHighPriority(state.values)\n : Promise.resolve();\n }\n );\n\n const executeBlur = React.useCallback(\n (e: any, path?: string) => {\n if (e.persist) {\n e.persist();\n }\n const { name, id, outerHTML } = e.target;\n const field = path ? path : name ? name : id;\n\n if (!field && __DEV__) {\n warnAboutMissingIdentifier({\n htmlContent: outerHTML,\n documentationAnchorLink: 'handleblur-e-any--void',\n handlerName: 'handleBlur',\n });\n }\n\n setFieldTouched(field, true);\n },\n [setFieldTouched]\n );\n\n const handleBlur = useEventCallback<FormikHandlers['handleBlur']>(\n (eventOrString: any): void | ((e: any) => void) => {\n if (isString(eventOrString)) {\n return event => executeBlur(event, eventOrString);\n } else {\n executeBlur(eventOrString);\n }\n }\n );\n\n const setFormikState = React.useCallback(\n (\n stateOrCb:\n | FormikState<Values>\n | ((state: FormikState<Values>) => FormikState<Values>)\n ): void => {\n if (isFunction(stateOrCb)) {\n dispatch({ type: 'SET_FORMIK_STATE', payload: stateOrCb });\n } else {\n dispatch({ type: 'SET_FORMIK_STATE', payload: () => stateOrCb });\n }\n },\n []\n );\n\n const setStatus = React.useCallback((status: any) => {\n dispatch({ type: 'SET_STATUS', payload: status });\n }, []);\n\n const setSubmitting = React.useCallback((isSubmitting: boolean) => {\n dispatch({ type: 'SET_ISSUBMITTING', payload: isSubmitting });\n }, []);\n\n const submitForm = useEventCallback(() => {\n dispatch({ type: 'SUBMIT_ATTEMPT' });\n return validateFormWithHighPriority().then(\n (combinedErrors: FormikErrors<Values>) => {\n // In case an error was thrown and passed to the resolved Promise,\n // `combinedErrors` can be an instance of an Error. We need to check\n // that and abort the submit.\n // If we don't do that, calling `Object.keys(new Error())` yields an\n // empty array, which causes the validation to pass and the form\n // to be submitted.\n\n const isInstanceOfError = combinedErrors instanceof Error;\n const isActuallyValid =\n !isInstanceOfError && Object.keys(combinedErrors).length === 0;\n if (isActuallyValid) {\n // Proceed with submit...\n //\n // To respect sync submit fns, we can't simply wrap executeSubmit in a promise and\n // _always_ dispatch SUBMIT_SUCCESS because isSubmitting would then always be false.\n // This would be fine in simple cases, but make it impossible to disable submit\n // buttons where people use callbacks or promises as side effects (which is basically\n // all of v1 Formik code). Instead, recall that we are inside of a promise chain already,\n // so we can try/catch executeSubmit(), if it returns undefined, then just bail.\n // If there are errors, throw em. Otherwise, wrap executeSubmit in a promise and handle\n // cleanup of isSubmitting on behalf of the consumer.\n let promiseOrUndefined;\n try {\n promiseOrUndefined = executeSubmit();\n // Bail if it's sync, consumer is responsible for cleaning up\n // via setSubmitting(false)\n if (promiseOrUndefined === undefined) {\n return;\n }\n } catch (error) {\n throw error;\n }\n\n return Promise.resolve(promiseOrUndefined)\n .then(result => {\n if (!!isMounted.current) {\n dispatch({ type: 'SUBMIT_SUCCESS' });\n }\n return result;\n })\n .catch(_errors => {\n if (!!isMounted.current) {\n dispatch({ type: 'SUBMIT_FAILURE' });\n // This is a legit error rejected by the onSubmit fn\n // so we don't want to break the promise chain\n throw _errors;\n }\n });\n } else if (!!isMounted.current) {\n // ^^^ Make sure Formik is still mounted before updating state\n dispatch({ type: 'SUBMIT_FAILURE' });\n // throw combinedErrors;\n if (isInstanceOfError) {\n throw combinedErrors;\n }\n }\n return;\n }\n );\n });\n\n const handleSubmit = useEventCallback(\n (e?: React.FormEvent<HTMLFormElement>) => {\n if (e && e.preventDefault && isFunction(e.preventDefault)) {\n e.preventDefault();\n }\n\n if (e && e.stopPropagation && isFunction(e.stopPropagation)) {\n e.stopPropagation();\n }\n\n // Warn if form submission is triggered by a <button> without a\n // specified `type` attribute during development. This mitigates\n // a common gotcha in forms with both reset and submit buttons,\n // where the dev forgets to add type=\"button\" to the reset button.\n if (__DEV__ && typeof document !== 'undefined') {\n // Safely get the active element (works with IE)\n const activeElement = getActiveElement();\n if (\n activeElement !== null &&\n activeElement instanceof HTMLButtonElement\n ) {\n invariant(\n activeElement.attributes &&\n activeElement.attributes.getNamedItem('type'),\n 'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type=\"submit\"`. If this is not a submit button, please add `type=\"button\"`.'\n );\n }\n }\n\n submitForm().catch(reason => {\n console.warn(\n `Warning: An unhandled error was caught from submitForm()`,\n reason\n );\n });\n }\n );\n\n const imperativeMethods: FormikHelpers<Values> = {\n resetForm,\n validateForm: validateFormWithHighPriority,\n validateField,\n setErrors,\n setFieldError,\n setFieldTouched,\n setFieldValue,\n setStatus,\n setSubmitting,\n setTouched,\n setValues,\n setFormikState,\n submitForm,\n };\n\n const executeSubmit = useEventCallback(() => {\n return onSubmit(state.values, imperativeMethods);\n });\n\n const handleReset = useEventCallback(e => {\n if (e && e.preventDefault && isFunction(e.preventDefault)) {\n e.preventDefault();\n }\n\n if (e && e.stopPropagation && isFunction(e.stopPropagation)) {\n e.stopPropagation();\n }\n\n resetForm();\n });\n\n const getFieldMeta = React.useCallback(\n (name: string): FieldMetaProps<any> => {\n return {\n value: getIn(state.values, name),\n error: getIn(state.errors, name),\n touched: !!getIn(state.touched, name),\n initialValue: getIn(initialValues.current, name),\n initialTouched: !!getIn(initialTouched.current, name),\n initialError: getIn(initialErrors.current, name),\n };\n },\n [state.errors, state.touched, state.values]\n );\n\n const getFieldHelpers = React.useCallback(\n (name: string): FieldHelperProps<any> => {\n return {\n setValue: (value: any, shouldValidate?: boolean) =>\n setFieldValue(name, value, shouldValidate),\n setTouched: (value: boolean, shouldValidate?: boolean) =>\n setFieldTouched(name, value, shouldValidate),\n setError: (value: any) => setFieldError(name, value),\n };\n },\n [setFieldValue, setFieldTouched, setFieldError]\n );\n\n const getFieldProps = React.useCallback(\n (nameOrOptions): FieldInputProps<any> => {\n const isAnObject = isObject(nameOrOptions);\n const name = isAnObject ? nameOrOptions.name : nameOrOptions;\n const valueState = getIn(state.values, name);\n\n const field: FieldInputProps<any> = {\n name,\n value: valueState,\n onChange: handleChange,\n onBlur: handleBlur,\n };\n if (isAnObject) {\n const {\n type,\n value: valueProp, // value is special for checkboxes\n as: is,\n multiple,\n } = nameOrOptions;\n\n if (type === 'checkbox') {\n if (valueProp === undefined) {\n field.checked = !!valueState;\n } else {\n field.checked = !!(\n Array.isArray(valueState) && ~valueState.indexOf(valueProp)\n );\n field.value = valueProp;\n }\n } else if (type === 'radio') {\n field.checked = valueState === valueProp;\n field.value = valueProp;\n } else if (is === 'select' && multiple) {\n field.value = field.value || [];\n field.multiple = true;\n }\n }\n return field;\n },\n [handleBlur, handleChange, state.values]\n );\n\n const dirty = React.useMemo(\n () => !isEqual(initialValues.current, state.values),\n [initialValues.current, state.values]\n );\n\n const isValid = React.useMemo(\n () =>\n typeof isInitialValid !== 'undefined'\n ? dirty\n ? state.errors && Object.keys(state.errors).length === 0\n : isInitialValid !== false && isFunction(isInitialValid)\n ? (isInitialValid as (props: FormikConfig<Values>) => boolean)(props)\n : (isInitialValid as boolean)\n : state.errors && Object.keys(state.errors).length === 0,\n [isInitialValid, dirty, state.errors, props]\n );\n\n const ctx = {\n ...state,\n initialValues: initialValues.current,\n initialErrors: initialErrors.current,\n initialTouched: initialTouched.current,\n initialStatus: initialStatus.current,\n handleBlur,\n handleChange,\n handleReset,\n handleSubmit,\n resetForm,\n setErrors,\n setFormikState,\n setFieldTouched,\n setFieldValue,\n setFieldError,\n setStatus,\n setSubmitting,\n setTouched,\n setValues,\n submitForm,\n validateForm: validateFormWithHighPriority,\n validateField,\n isValid,\n dirty,\n unregisterField,\n registerField,\n getFieldProps,\n getFieldMeta,\n getFieldHelpers,\n validateOnBlur,\n validateOnChange,\n validateOnMount,\n };\n\n return ctx;\n}\n\nexport function Formik<\n Values extends FormikValues = FormikValues,\n ExtraProps = {}\n>(props: FormikConfig<Values> & ExtraProps) {\n const formikbag = useFormik<Values>(props);\n const { component, children, render, innerRef } = props;\n\n // This allows folks to pass a ref to <Formik />\n React.useImperativeHandle(innerRef, () => formikbag);\n\n if (__DEV__) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n invariant(\n !props.render,\n `<Formik render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Formik render={(props) => ...} /> with <Formik>{(props) => ...}</Formik>`\n );\n // eslint-disable-next-line\n }, []);\n }\n return (\n <FormikProvider value={formikbag}>\n {component\n ? React.createElement(component as any, formikbag)\n : render\n ? render(formikbag)\n : children // children come last, always called\n ? isFunction(children)\n ? (children as (bag: FormikProps<Values>) => React.ReactNode)(\n formikbag as FormikProps<Values>\n )\n : !isEmptyChildren(children)\n ? React.Children.only(children)\n : null\n : null}\n </FormikProvider>\n );\n}\n\nfunction warnAboutMissingIdentifier({\n htmlContent,\n documentationAnchorLink,\n handlerName,\n}: {\n htmlContent: string;\n documentationAnchorLink: string;\n handlerName: string;\n}) {\n console.warn(\n `Warning: Formik called \\`${handlerName}\\`, but you forgot to pass an \\`id\\` or \\`name\\` attribute to your input:\n ${htmlContent}\n Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#${documentationAnchorLink}\n `\n );\n}\n\n/**\n * Transform Yup ValidationError to a more usable object\n */\nexport function yupToFormErrors<Values>(yupError: any): FormikErrors<Values> {\n let errors: FormikErrors<Values> = {};\n if (yupError.inner) {\n if (yupError.inner.length === 0) {\n return setIn(errors, yupError.path, yupError.message);\n }\n for (let err of yupError.inner) {\n if (!getIn(errors, err.path)) {\n errors = setIn(errors, err.path, err.message);\n }\n }\n }\n return errors;\n}\n\n/**\n * Validate a yup schema.\n */\nexport function validateYupSchema<T extends FormikValues>(\n values: T,\n schema: any,\n sync: boolean = false,\n context: any = {}\n): Promise<Partial<T>> {\n const validateData: FormikValues = prepareDataForValidation(values);\n return schema[sync ? 'validateSync' : 'validate'](validateData, {\n abortEarly: false,\n context: context,\n });\n}\n\n/**\n * Recursively prepare values.\n */\nexport function prepareDataForValidation<T extends FormikValues>(\n values: T\n): FormikValues {\n let data: FormikValues = Array.isArray(values) ? [] : {};\n for (let k in values) {\n if (Object.prototype.hasOwnProperty.call(values, k)) {\n const key = String(k);\n if (Array.isArray(values[key]) === true) {\n data[key] = values[key].map((value: any) => {\n if (Array.isArray(value) === true || isPlainObject(value)) {\n return prepareDataForValidation(value);\n } else {\n return value !== '' ? value : undefined;\n }\n });\n } else if (isPlainObject(values[key])) {\n data[key] = prepareDataForValidation(values[key]);\n } else {\n data[key] = values[key] !== '' ? values[key] : undefined;\n }\n }\n }\n return data;\n}\n\n/**\n * deepmerge array merging algorithm\n * https://github.com/KyleAMathews/deepmerge#combine-array\n */\nfunction arrayMerge(target: any[], source: any[], options: any): any[] {\n const destination = target.slice();\n\n source.forEach(function merge(e: any, i: number) {\n if (typeof destination[i] === 'undefined') {\n const cloneRequested = options.clone !== false;\n const shouldClone = cloneRequested && options.isMergeableObject(e);\n destination[i] = shouldClone\n ? deepmerge(Array.isArray(e) ? [] : {}, e, options)\n : e;\n } else if (options.isMergeableObject(e)) {\n destination[i] = deepmerge(target[i], e, options);\n } else if (target.indexOf(e) === -1) {\n destination.push(e);\n }\n });\n return destination;\n}\n\n/** Return multi select values based on an array of options */\nfunction getSelectedValues(options: any[]) {\n return Array.from(options)\n .filter(el => el.selected)\n .map(el => el.value);\n}\n\n/** Return the next value for a checkbox */\nfunction getValueForCheckbox(\n currentValue: string | any[],\n checked: boolean,\n valueProp: any\n) {\n // If the current value was a boolean, return a boolean\n if (typeof currentValue === 'boolean') {\n return Boolean(checked);\n }\n\n // If the currentValue was not a boolean we want to return an array\n let currentArrayOfValues = [];\n let isValueInArray = false;\n let index = -1;\n\n if (!Array.isArray(currentValue)) {\n // eslint-disable-next-line eqeqeq\n if (!valueProp || valueProp == 'true' || valueProp == 'false') {\n return Boolean(checked);\n }\n } else {\n // If the current value is already an array, use it\n currentArrayOfValues = currentValue;\n index = currentValue.indexOf(valueProp);\n isValueInArray = index >= 0;\n }\n\n // If the checkbox was checked and the value is not already present in the aray we want to add the new value to the array of values\n if (checked && valueProp && !isValueInArray) {\n return currentArrayOfValues.concat(valueProp);\n }\n\n // If the checkbox was unchecked and the value is not in the array, simply return the already existing array of values\n if (!isValueInArray) {\n return currentArrayOfValues;\n }\n\n // If the checkbox was unchecked and the value is in the array, remove the value and return the array\n return currentArrayOfValues\n .slice(0, index)\n .concat(currentArrayOfValues.slice(index + 1));\n}\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\n// @see https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined'\n ? React.useLayoutEffect\n : React.useEffect;\n\nfunction useEventCallback<T extends (...args: any[]) => any>(fn: T): T {\n const ref: any = React.useRef(fn);\n\n // we copy a ref to the callback scoped to the current state/props on each render\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n });\n\n return React.useCallback(\n (...args: any[]) => ref.current.apply(void 0, args),\n []\n ) as T;\n}\n","import * as React from 'react';\nimport {\n FormikProps,\n GenericFieldHTMLAttributes,\n FieldMetaProps,\n FieldHelperProps,\n FieldInputProps,\n FieldValidator,\n} from './types';\nimport { useFormikContext } from './FormikContext';\nimport { isFunction, isEmptyChildren, isObject } from './utils';\nimport invariant from 'tiny-warning';\n\nexport interface FieldProps<V = any, FormValues = any> {\n field: FieldInputProps<V>;\n form: FormikProps<FormValues>; // if ppl want to restrict this for a given form, let them.\n meta: FieldMetaProps<V>;\n}\n\nexport interface FieldConfig<V = any> {\n /**\n * Field component to render. Can either be a string like 'select' or a component.\n */\n component?:\n | string\n | React.ComponentType<FieldProps<V>>\n | React.ComponentType\n | React.ForwardRefExoticComponent<any>;\n\n /**\n * Component to render. Can either be a string e.g. 'select', 'input', or 'textarea', or a component.\n */\n as?:\n | React.ComponentType<FieldProps<V>['field']>\n | string\n | React.ComponentType\n | React.ForwardRefExoticComponent<any>;\n\n /**\n * Render prop (works like React router's <Route render={props =>} />)\n * @deprecated\n */\n render?: (props: FieldProps<V>) => React.ReactNode;\n\n /**\n * Children render function <Field name>{props => ...}</Field>)\n */\n children?: ((props: FieldProps<V>) => React.ReactNode) | React.ReactNode;\n\n /**\n * Validate a single field value independently\n */\n validate?: FieldValidator;\n\n /**\n * Field name\n */\n name: string;\n\n /** HTML input type */\n type?: string;\n\n /** Field value */\n value?: any;\n\n /** Inner ref */\n innerRef?: (instance: any) => void;\n}\n\nexport type FieldAttributes<T> = GenericFieldHTMLAttributes &\n FieldConfig<T> &\n T & { name: string };\n\nexport type FieldHookConfig<T> = GenericFieldHTMLAttributes & FieldConfig<T>;\n\nexport function useField<Val = any>(\n propsOrFieldName: string | FieldHookConfig<Val>\n): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>] {\n const formik = useFormikContext();\n const {\n getFieldProps,\n getFieldMeta,\n getFieldHelpers,\n registerField,\n unregisterField,\n } = formik;\n\n const isAnObject = isObject(propsOrFieldName);\n\n // Normalize propsOrFieldName to FieldHookConfig<Val>\n const props: FieldHookConfig<Val> = isAnObject\n ? (propsOrFieldName as FieldHookConfig<Val>)\n : { name: propsOrFieldName as string };\n\n const { name: fieldName, validate: validateFn } = props;\n\n React.useEffect(() => {\n if (fieldName) {\n registerField(fieldName, {\n validate: validateFn,\n });\n }\n return () => {\n if (fieldName) {\n unregisterField(fieldName);\n }\n };\n }, [registerField, unregisterField, fieldName, validateFn]);\n\n if (__DEV__) {\n invariant(\n formik,\n 'useField() / <Field /> must be used underneath a <Formik> component or withFormik() higher order component'\n );\n }\n\n invariant(\n fieldName,\n 'Invalid field name. Either pass `useField` a string or an object containing a `name` key.'\n );\n\n return [\n getFieldProps(props),\n getFieldMeta(fieldName),\n getFieldHelpers(fieldName),\n ];\n}\n\nexport function Field({\n validate,\n name,\n render,\n children,\n as: is, // `as` is reserved in typescript lol\n component,\n ...props\n}: FieldAttributes<any>) {\n const {\n validate: _validate,\n validationSchema: _validationSchema,\n\n ...formik\n } = useFormikContext();\n\n if (__DEV__) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n invariant(\n !render,\n `<Field render> has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace <Field name=\"${name}\" render={({field, form}) => ...} /> with <Field name=\"${name}\">{({field, form, meta}) => ...}</Field>`\n );\n\n invariant(\n !(is && children && isFunction(children)),\n 'You should not use <Field as> and <Field children> as a function in the same <Field> component; <Field as> will be ignored.'\n );\n\n invariant(\n !(component && children && isFunction(children)),\n 'You should not use <Field component> and <Field children> as a function in the same <Field> component; <Field component> will be ignored.'\n );\n\n invariant(\n !(render && children && !isEmptyChildren(children)),\n 'You should not use <Field render> and <Field children> in the same <Field> component; <Field children> will be ignored'\n );\n // eslint-disable-next-line\n }, []);\n }\n\n // Register field and field-level validation with parent <Formik>\n const { registerField, unregisterField } = formik;\n React.useEffect(() => {\n registerField(name, {\n validate: validate,\n });\n return () => {\n unregisterField(name);\n };\n }, [registerField, unregisterField, name, validate]);\n const field = formik.getFieldProps({ name, ...props });\n const meta = formik.getFieldMeta(name);\n const legacyBag = { field, form: formik };\n\n if (render) {\n return render({ ...legacyBag, meta });\n }\n\n if (isFunction(children)) {\n return children({ ...legacyBag, meta });\n }\n\n if (component) {\n // This behavior is backwards compat with earlier Formik 0.9 to 1.x\n if (typeof component === 'string') {\n const { innerRef, ...rest } = props;\n return React.createElement(\n component,\n { ref: innerRef, ...field, ...rest },\n children\n );\n }\n // We don't pass `meta` for backwards compat\n return React.createElement(\n component,\n { field, form: formik, ...props },\n children\n );\n }\n\n // default to input here so we can check for both `as` and `children` above\n const asElement = is || 'input';\n\n if (typeof asElement === 'string') {\n const { innerRef, ...rest } = props;\n return React.createElement(\n asElement,\n { ref: innerRef, ...field, ...rest },\n children\n );\n }\n\n return React.createElement(asElement, { ...field, ...props }, children);\n}\n","import * as React from 'react';\nimport { useFormikContext } from './FormikContext';\n\nexport type FormikFormProps = Pick<\n React.FormHTMLAttributes<HTMLFormElement>,\n Exclude<\n keyof React.FormHTMLAttributes<HTMLFormElement>,\n 'onReset' | 'onSubmit'\n >\n>;\n\ntype FormProps = React.ComponentPropsWithoutRef<'form'>;\n\n// @todo tests\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props: FormikFormProps, ref) => {\n // iOS needs an \"action\" attribute for nice input: https://stackoverflow.com/a/39485162/406725\n // We default the action to \"#\" in case the preventDefault fails (just updates the URL hash)\n const { action, ...rest } = props;\n const _action = action ?? '#';\n const { handleReset, handleSubmit } = useFormikContext();\n return (\n <form\n onSubmit={handleSubmit}\n ref={ref}\n onReset={handleReset}\n action={_action}\n {...rest}\n />\n );\n }\n);\n\nForm.displayName = 'Form';\n","import hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { Formik } from './Formik';\nimport {\n FormikHelpers,\n FormikProps,\n FormikSharedConfig,\n FormikValues,\n FormikTouched,\n FormikErrors,\n} from './types';\nimport { isFunction } from './utils';\n\n/**\n * State, handlers, and helpers injected as props into the wrapped form component.\n * Used with withFormik()\n *\n * @deprecated Use `OuterProps & FormikProps<Values>` instead.\n */\nexport type InjectedFormikProps<Props, Values> = Props & FormikProps<Values>;\n\n/**\n * Formik helpers + { props }\n */\nexport type FormikBag<P, V> = { props: P } & FormikHelpers<V>;\n\n/**\n * withFormik() configuration options. Backwards compatible.\n */\nexport interface WithFormikConfig<\n Props,\n Values extends FormikValues = FormikValues,\n DeprecatedPayload = Values\n> extends FormikSharedConfig<Props> {\n /**\n * Set the display name of the component. Useful for React DevTools.\n */\n displayName?: string;\n\n /**\n * Submission handler\n */\n handleSubmit: (values: Values, formikBag: FormikBag<Props, Values>) => void;\n\n /**\n * Map props to the form values\n */\n mapPropsToValues?: (props: Props) => Values;\n\n /**\n * Map props to the form status\n */\n mapPropsToStatus?: (props: Props) => any;\n\n /**\n * Map props to the form touched state\n */\n mapPropsToTouched?: (props: Props) => FormikTouched<Values>;\n\n /**\n * Map props to the form errors state\n */\n mapPropsToErrors?: (props: Props) => FormikErrors<Values>;\n\n /**\n * @deprecated in 0.9.0 (but needed to break TS types)\n */\n mapValuesToPayload?: (values: Values) => DeprecatedPayload;\n\n /**\n * A Yup Schema or a function that returns a Yup schema\n */\n validationSchema?: any | ((props: Props) => any);\n\n /**\n * Validation function. Must return an error object or promise that\n * throws an error object where that object keys map to corresponding value.\n */\n validate?: (values: Values, props: Props) => void | object | Promise<any>;\n}\n\nexport type CompositeComponent<P> =\n | React.ComponentClass<P>\n | React.StatelessComponent<P>;\n\nexport interface ComponentDecorator<TOwnProps, TMergedProps> {\n (component: CompositeComponent<TMergedProps>): React.ComponentType<TOwnProps>;\n}\n\nexport interface InferableComponentDecorator<TOwnProps> {\n <T extends CompositeComponent<TOwnProps>>(component: T): T;\n}\n\n/**\n * A public higher-order component to access the imperative API\n */\nexport function withFormik<\n OuterProps extends object,\n Values extends FormikValues,\n Payload = Values\n>({\n mapPropsToValues = (vanillaProps: OuterProps): Values => {\n let val: Values = {} as Values;\n for (let k in vanillaProps) {\n if (\n vanillaProps.hasOwnProperty(k) &&\n typeof vanillaProps[k] !== 'function'\n ) {\n // @todo TypeScript fix\n (val as any)[k] = vanillaProps[k];\n }\n }\n return val as Values;\n },\n ...config\n}: WithFormikConfig<OuterProps, Values, Payload>): ComponentDecorator<\n OuterProps,\n OuterProps & FormikProps<Values>\n> {\n return function createFormik(\n Component: CompositeComponent<OuterProps & FormikProps<Values>>\n ): React.ComponentClass<OuterProps> {\n const componentDisplayName =\n Component.displayName ||\n Component.name ||\n (Component.constructor && Component.constructor.name) ||\n 'Component';\n /**\n * We need to use closures here for to provide the wrapped component's props to\n * the respective withFormik config methods.\n */\n class C extends React.Component<OuterProps, {}> {\n static displayName = `WithFormik(${componentDisplayName})`;\n\n validate = (values: Values): void | object | Promise<any> => {\n return config.validate!(values, this.props);\n };\n\n validationSchema = () => {\n return isFunction(config.validationSchema)\n ? config.validationSchema!(this.props)\n : config.validationSchema;\n };\n\n handleSubmit = (values: Values, actions: FormikHelpers<Values>) => {\n return config.handleSubmit(values, {\n ...actions,\n props: this.props,\n });\n };\n\n /**\n * Just avoiding a render callback for perf here\n */\n renderFormComponent = (formikProps: FormikProps<Values>) => {\n return <Component {...this.props} {...formikProps} />;\n };\n\n render() {\n const { children, ...props } = this.props as any;\n return (\n <Formik\n {...props}\n {...config}\n validate={config.validate && this.validate}\n validationSchema={config.validationSchema && this.validationSchema}\n initialValues={mapPropsToValues(this.props)}\n initialStatus={\n config.mapPropsToStatus && config.mapPropsToStatus(this.props)\n }\n initialErrors={\n config.mapPropsToErrors && config.mapPropsToErrors(this.props)\n }\n initialTouched={\n config.mapPropsToTouched && config.mapPropsToTouched(this.props)\n }\n onSubmit={this.handleSubmit as any}\n children={this.renderFormComponent}\n />\n );\n }\n }\n\n return hoistNonReactStatics(\n C,\n Component as React.ComponentClass<OuterProps & FormikProps<Values>> // cast type to ComponentClass (even if SFC)\n ) as React.ComponentClass<OuterProps>;\n };\n}\n","import * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { FormikContextType } from './types';\nimport { FormikConsumer } from './FormikContext';\nimport invariant from 'tiny-warning';\n\n/**\n * Connect any component to Formik context, and inject as a prop called `formik`;\n * @param Comp React Component\n */\nexport function connect<OuterProps, Values = {}>(\n Comp: React.ComponentType<OuterProps & { formik: FormikContextType<Values> }>\n) {\n const C: React.FC<OuterProps> = (props: OuterProps) => (\n <FormikConsumer>\n {formik => {\n invariant(\n !!formik,\n `Formik context is undefined, please verify you are rendering <Form>, <Field>, <FastField>, <FieldArray>, or your custom context-using component as a child of a <Formik> component. Component name: ${Comp.name}`\n );\n return <Comp {...props} formik={formik} />;\n }}\n </FormikConsumer>\n );\n const componentDisplayName =\n Comp.displayName ||\n Comp.name ||\n (Comp.constructor && Comp.constructor.name) ||\n 'Component';\n\n // Assign Comp to C.WrappedComponent so we can access the inner component in tests\n // For example, <Field.WrappedComponent /> gets us <FieldInner/>\n (C as React.FC<OuterProps> & {\n WrappedComponent: React.ReactNode;\n }).WrappedComponent = Comp;\n\n C.displayName = `FormikConnect(${componentDisplayName})`;\n\n return hoistNonReactStatics(\n C,\n Comp as React.ComponentClass<\n OuterProps & { formik: FormikContextType<Values> }\n > // cast type to ComponentClass (even if SFC)\n ) as React.ComponentType<OuterProps>;\n}\n","import * as React from 'react';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { connect } from './connect';\nimport {\n FormikContextType,\n FormikState,\n SharedRenderProps,\n FormikProps,\n} from './types';\nimport {\n getIn,\n isEmptyChildren,\n isFunction,\n setIn,\n isEmptyArray,\n} from './utils';\nimport isEqual from 'react-fast-compare';\n\nexport type FieldArrayRenderProps = ArrayHelpers & {\n form: FormikProps<any>;\n name: string;\n};\n\nexport type FieldArrayConfig = {\n /** Really the path to the array field to be updated */\n name: string;\n /** Should field array validate the form AFTER array updates/changes? */\n validateOnChange?: boolean;\n} & SharedRenderProps<FieldArrayRenderProps>;\nexport interface ArrayHelpers {\n /** Imperatively add a value to the end of an array */\n push: (obj: any) => void;\n /** Curried fn to add a value to the end of an array */\n handlePush: (obj: any) => () => void;\n /** Imperatively swap two values in an array */\n swap: (indexA: number, indexB: number) => void;\n /** Curried fn to swap two values in an array */\n handleSwap: (indexA: number, indexB: number) => () => void;\n /** Imperatively move an element in an array to another index */\n move: (from: number, to: number) => void;\n /** Imperatively move an element in an array to another index */\n handleMove: (from: number, to: number) => () => void;\n /** Imperatively insert an element at a given index into the array */\n insert: (index: number, value: any) => void;\n /** Curried fn to insert an element at a given index into the array */\n handleInsert: (index: number, value: any) => () => void;\n /** Imperatively replace a value at an index of an array */\n replace: (index: number, value: any) => void;\n /** Curried fn to replace an element at a given index into the array */\n handleReplace: (index: number, value: any) => () => void;\n /** Imperatively add an element to the beginning of an array and return its length */\n unshift: (value: any) => number;\n /** Curried fn to add an element to the beginning of an array */\n handleUnshift: (value: any) => () => void;\n /** Curried fn to remove an element at an index of an array */\n handleRemove: (index: number) => () => void;\n /** Curried fn to remove a value from the end of the array */\n handlePop: () => () => void;\n /** Imperatively remove and element at an index of an array */\n remove<T>(index: number): T | undefined;\n /** Imperatively remove and return value from the end of the array */\n pop<T>(): T | undefined;\n}\n\n/**\n * Some array helpers!\n */\nexport const move = (array: any[], from: number, to: number) => {\n const copy = copyArrayLike(array);\n const value = copy[from];\n copy.splice(from, 1);\n copy.splice(to, 0, value);\n return copy;\n};\n\nexport const swap = (\n arrayLike: ArrayLike<any>,\n indexA: number,\n indexB: number\n) => {\n const copy = copyArrayLike(arrayLike);\n const a = copy[indexA];\n copy[indexA] = copy[indexB];\n copy[indexB] = a;\n return copy;\n};\n\nexport const insert = (\n arrayLike: ArrayLike<any>,\n index: number,\n value: any\n) => {\n const copy = copyArrayLike(arrayLike);\n copy.splice(index, 0, value);\n return copy;\n};\n\nexport const replace = (\n arrayLike: ArrayLike<any>,\n index: number,\n value: any\n) => {\n const copy = copyArrayLike(arrayLike);\n copy[index] = value;\n return copy;\n};\n\nconst copyArrayLike = (arrayLike: ArrayLike<any>) => {\n if (!arrayLike) {\n return [];\n } else if (Array.isArray(arrayLike)) {\n return [...arrayLike];\n } else {\n const maxIndex = Object.keys(arrayLike)\n .map(key => parseInt(key))\n .reduce((max, el) => (el > max ? el : max), 0);\n return Array.from({ ...arrayLike, length: maxIndex + 1 });\n }\n};\n\nclass FieldArrayInner<Values = {}> extends React.Component<\n FieldArrayConfig & { formik: FormikContextType<Values> },\n {}\n> {\n static defaultProps = {\n validateOnChange: true,\n };\n\n constructor(props: FieldArrayConfig & { formik: FormikContextType<Values> }) {\n super(props);\n // We need TypeScript generics on these, so we'll bind them in the constructor\n // @todo Fix TS 3.2.1\n this.remove = this.remove.bind(this) as any;\n this.pop = this.pop.bind(this) as any;\n }\n\n componentDidUpdate(\n prevProps: FieldArrayConfig & { formik: FormikContextType<Values> }\n ) {\n if (\n this.props.validateOnChange &&\n this.props.formik.validateOnChange &&\n !isEqual(\n getIn(prevProps.formik.values, prevProps.name),\n getIn(this.props.formik.values, this.props.name)\n )\n ) {\n this.props.formik.validateForm(this.props.formik.values);\n }\n }\n\n updateArrayField = (\n fn: Function,\n alterTouched: boolean | Function,\n alterErrors: boolean | Function\n ) => {\n const {\n name,\n\n formik: { setFormikState },\n } = this.props;\n setFormikState((prevState: FormikState<any>) => {\n let updateErrors = typeof alterErrors === 'function' ? alterErrors : fn;\n let updateTouched =\n typeof alterTouched === 'function' ? alterTouched : fn;\n\n // values fn should be executed before updateErrors and updateTouched,\n // otherwise it causes an error with unshift.\n let values = setIn(\n prevState.values,\n name,\n fn(getIn(prevState.values, name))\n );\n\n let fieldError = alterErrors\n ? updateErrors(getIn(prevState.errors, name))\n : undefined;\n let fieldTouched = alterTouched\n ? updateTouched(getIn(prevState.touched, name))\n : undefined;\n\n if (isEmptyArray(fieldError)) {\n fieldError = undefined;\n }\n if (isEmptyArray(fieldTouched)) {\n fieldTouched = undefined;\n }\n\n return {\n ...prevState,\n values,\n errors: alterErrors\n ? setIn(prevState.errors, name, fieldError)\n : prevState.errors,\n touched: alterTouched\n ? setIn(prevState.touched, name, fieldTouched)\n : prevState.touched,\n };\n });\n };\n\n push = (value: any) =>\n this.updateArrayField(\n (arrayLike: ArrayLike<any>) => [\n ...copyArrayLike(arrayLike),\n cloneDeep(value),\n ],\n false,\n false\n );\n\n handlePush = (value: any) => () => this.push(value);\n\n swap = (indexA: number, indexB: number) =>\n this.updateArrayField(\n (array: any[]) => swap(array, indexA, indexB),\n true,\n true\n );\n\n handleSwap = (indexA: number, indexB: number) => () =>\n this.swap(indexA, indexB);\n\n move = (from: number, to: number) =>\n this.updateArrayField((array: any[]) => move(array, from, to), true, true);\n\n handleMove = (from: number, to: number) => () => this.move(from, to);\n\n insert = (index: number, value: any) =>\n this.updateArrayField(\n (array: any[]) => insert(array, index, value),\n (array: any[]) => insert(array, index, null),\n (array: any[]) => insert(array, index, null)\n );\n\n handleInsert = (index: number, value: any) => () => this.insert(index, value);\n\n replace = (index: number, value: any) =>\n this.updateArrayField(\n (array: any[]) => replace(array, index, value),\n false,\n false\n );\n\n handleReplace = (index: number, value: any) => () =>\n this.replace(index, value);\n\n unshift = (value: any) => {\n let length = -1;\n this.updateArrayField(\n (array: any[]) => {\n const arr = array ? [value, ...array] : [value];\n if (length < 0) {\n length = arr.length;\n }\n return arr;\n },\n (array: any[]) => {\n const arr = array ? [null, ...array] : [null];\n if (length < 0) {\n length = arr.length;\n }\n return arr;\n },\n (array: any[]) => {\n const arr = array ? [null, ...array] : [null];\n if (length < 0) {\n length = arr.length;\n }\n return arr;\n }\n );\n return length;\n };\n\n handleUnshift = (value: any) => () => this.unshift(value);\n\n remove<T>(index: number): T {\n // We need to make sure we also remove relevant pieces of `touched` and `errors`\n let result: any;\n this.updateArrayField(\n // so this gets call 3 times\n (array?: any[]) => {\n const copy = array ? copyArrayLike(array) : [];\n if (!result) {\n result = copy[index];\n }\n if (isFunction(copy.splice)) {\n copy.splice(index, 1);\n }\n return copy;\n },\n true,\n true\n );\n\n return result as T;\n }\n\n handleRemove = (index: number) => () => this.remove<any>(index);\n\n pop<T>(): T {\n // Remove relevant pieces of `touched` and `errors` too!\n let result: any;\n this.updateArrayField(\n // so this gets call 3 times\n (array: any[]) => {\n const tmp = array;\n if (!result) {\n result = tmp && tmp.pop && tmp.pop();\n }\n return tmp;\n },\n true,\n true\n );\n\n return result as T;\n }\n\n handlePop = () => () => this.pop<any>();\n\n render() {\n const arrayHelpers: ArrayHelpers = {\n push: this.push,\n pop: this.pop,\n swap: this.swap,\n move: this.move,\n insert: this.insert,\n replace: this.replace,\n unshift: this.unshift,\n remove: this.remove,\n handlePush: this.handlePush,\n handlePop: this.handlePop,\n handleSwap: this.handleSwap,\n handleMove: this.handleMove,\n handleInsert: this.handleInsert,\n handleReplace: this.handleReplace,\n handleUnshift: this.handleUnshift,\n handleRemove: this.handleRemove,\n };\n\n const {\n component,\n render,\n children,\n name,\n formik: {\n validate: _validate,\n validationSchema: _validationSchema,\n ...restOfFormik\n },\n } = this.props;\n\n const props: FieldArrayRenderProps = {\n ...arrayHelpers,\n form: restOfFormik,\n name,\n };\n\n return component\n ? React.createElement(component as any, props)\n : render\n ? (render as any)(props)\n : children // children come last, always called\n ? typeof children === 'function'\n ? (children as any)(props)\n : !isEmptyChildren(children)\n ? React.Children.only(children)\n : null\n : null;\n }\n}\n\nexport const FieldArray = connect<FieldArrayConfig, any>(FieldArrayInner);\n","import * as React from 'react';\nimport { FormikContextType } from './types';\nimport { getIn, isFunction } from './utils';\nimport { connect } from './connect';\n\nexport interface ErrorMessageProps {\n name: string;\n className?: string;\n component?: string | React.ComponentType;\n children?: (errorMessage: string) => React.ReactNode;\n render?: (errorMessage: string) => React.ReactNode;\n}\n\nclass ErrorMessageImpl extends React.Component<\n ErrorMessageProps & { formik: FormikContextType<any> }\n> {\n shouldComponentUpdate(\n props: ErrorMessageProps & { formik: FormikContextType<any> }\n ) {\n if (\n getIn(this.props.formik.errors, this.props.name) !==\n getIn(props.formik.errors, this.props.name) ||\n getIn(this.props.formik.touched, this.props.name) !==\n getIn(props.formik.touched, this.props.name) ||\n Object.keys(this.props).length !== Object.keys(props).length\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n render() {\n let { component, formik, render, children, name, ...rest } = this.props;\n\n const touch = getIn(formik.touched, name);\n const error = getIn(formik.errors, name);\n\n return !!touch && !!error\n ? render\n ? isFunction(render)\n ? render(error)\n : null\n : children\n ? isFunction(children)\n ? children(error)\n : null\n : component\n ? React.createElement(component, rest as any, error)\n : error\n : null;\n }\n}\n\nexport const ErrorMessage = connect<\n ErrorMessageProps,\n ErrorMessageProps & { formik: FormikContextType<any> }\n>(ErrorMessageImpl);\n","import * as React from 'react';\n\nimport {\n FormikProps,\n GenericFieldHTMLAttributes,\n FormikContextType,\n FieldMetaProps,\n FieldInputProps,\n} from './types';\nimport invariant from 'tiny-warning';\nimport { getIn, isEmptyChildren, isFunction } from './utils';\nimport { FieldConfig } from './Field';\nimport { connect } from './connect';\n\ntype $FixMe = any;\n\nexport interface FastFieldProps<V = any> {\n field: FieldInputProps<V>;\n meta: FieldMetaProps<V>;\n form: FormikProps<V>; // if ppl want to restrict this for a given form, let them.\n}\n\nexport type FastFieldConfig<T> = FieldConfig & {\n /** Override FastField's default shouldComponentUpdate */\n shouldUpdate?: (\n nextProps: T & GenericFieldHTMLAttributes,\n props: {}\n ) => boolean;\n};\n\nexport type FastFieldAttributes<T> = GenericFieldHTMLAttributes &\n FastFieldConfig<T> &\n T;\n\ntype FastFieldInnerProps<Values = {}, Props = {}> = FastFieldAttributes<\n Props\n> & { formik: FormikContextType<Values> };\n\n/**\n * Custom Field component for quickly hooking into Formik\n * context and wiring up forms.\n */\nclass FastFieldInner<Values = {}, Props = {}> extends React.Component<\n FastFieldInnerProps<Values, Props>,\n {}\n> {\n constructor(props: FastFieldInnerProps<Values, Props>) {\n super(props);\n const { render, children, component, as: is, name } = props;\n invariant(\n !render,\n `<FastField render> has been deprecated. Please use a child callback function instead: <FastField name={${name}}>{props => ...}</FastField> instead.`\n );\n invariant(\n !(component && render),\n 'You should not use <FastField component> and <FastField render> in the same <FastField> component; <FastField component> will be ignored'\n );\n\n invariant(\n !(is && children && isFunction(children)),\n 'You should not use <FastField as> and <FastField children> as a function in the same <FastField> component; <FastField as> will be ignored.'\n );\n\n invariant(\n !(component && children && isFunction(children)),\n 'You should not use <FastField component> and <FastField children> as a function in the same <FastField> component; <FastField component> will be ignored.'\n );\n\n invariant(\n !(render && children && !isEmptyChildren(children)),\n 'You should not use <FastField render> and <FastField children> in the same <FastField> component; <FastField children> will be ignored'\n );\n }\n\n shouldComponentUpdate(props: FastFieldInnerProps<Values, Props>) {\n if (this.props.shouldUpdate) {\n return this.props.shouldUpdate(props, this.props);\n } else if (\n props.name !== this.props.name ||\n getIn(props.formik.values, this.props.name) !==\n getIn(this.props.formik.values, this.props.name) ||\n getIn(props.formik.errors, this.props.name) !==\n getIn(this.props.formik.errors, this.props.name) ||\n getIn(props.formik.touched, this.props.name) !==\n getIn(this.props.formik.touched, this.props.name) ||\n Object.keys(this.props).length !== Object.keys(props).length ||\n props.formik.isSubmitting !== this.props.formik.isSubmitting\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n componentDidMount() {\n // Register the Field with the parent Formik. Parent will cycle through\n // registered Field's validate fns right prior to submit\n this.props.formik.registerField(this.props.name, {\n validate: this.props.validate,\n });\n }\n\n componentDidUpdate(prevProps: FastFieldAttributes<Props>) {\n if (this.props.name !== prevProps.name) {\n this.props.formik.unregisterField(prevProps.name);\n this.props.formik.registerField(this.props.name, {\n validate: this.props.validate,\n });\n }\n\n if (this.props.validate !== prevProps.validate) {\n this.props.formik.registerField(this.props.name, {\n validate: this.props.validate,\n });\n }\n }\n\n componentWillUnmount() {\n this.props.formik.unregisterField(this.props.name);\n }\n\n render() {\n const {\n validate,\n name,\n render,\n as: is,\n children,\n component,\n shouldUpdate,\n formik,\n ...props\n } = this.props as FastFieldInnerProps<Values, Props>;\n\n const {\n validate: _validate,\n validationSchema: _validationSchema,\n ...restOfFormik\n } = formik;\n const field = formik.getFieldProps({ name, ...props });\n const meta = {\n value: getIn(formik.values, name),\n error: getIn(formik.errors, name),\n touched: !!getIn(formik.touched, name),\n initialValue: getIn(formik.initialValues, name),\n initialTouched: !!getIn(formik.initialTouched, name),\n initialError: getIn(formik.initialErrors, name),\n };\n\n const bag = { field, meta, form: restOfFormik };\n\n if (render) {\n return (render as any)(bag);\n }\n\n if (isFunction(children)) {\n return (children as (props: FastFieldProps<any>) => React.ReactNode)(bag);\n }\n\n if (component) {\n // This behavior is backwards compat with earlier Formik 0.9 to 1.x\n if (typeof component === 'string') {\n const { innerRef, ...rest } = props;\n return React.createElement(\n component,\n { ref: innerRef, ...field, ...(rest as $FixMe) },\n children\n );\n }\n // We don't pass `meta` for backwards compat\n return React.createElement(\n component as React.ComponentClass<$FixMe>,\n { field, form: formik, ...props },\n children\n );\n }\n\n // default to input here so we can check for both `as` and `children` above\n const asElement = is || 'input';\n\n if (typeof asElement === 'string') {\n const { innerRef, ...rest } = props;\n return React.createElement(\n asElement,\n { ref: innerRef, ...field, ...(rest as $FixMe) },\n children\n );\n }\n\n return React.createElement(\n asElement as React.ComponentClass,\n { ...field, ...props },\n children\n );\n }\n}\n\nexport const FastField = connect<FastFieldAttributes<any>, any>(FastFieldInner);\n"],"names":["isEmptyArray","value","Array","isArray","length","isFunction","obj","isObject","isInteger","String","Math","floor","Number","isString","Object","prototype","toString","call","isNaN","isEmptyChildren","children","React","count","isPromise","then","isInputEvent","target","getActiveElement","doc","document","undefined","activeElement","body","e","getIn","key","def","p","path","toPath","setIn","res","clone","resVal","i","pathArray","currentPath","currentObj","slice","nextPath","setNestedObjectValues","object","visited","response","WeakMap","keys","k","val","get","set","FormikContext","displayName","FormikProvider","Provider","FormikConsumer","Consumer","useFormikContext","formik","invariant","formikReducer","state","msg","type","values","payload","touched","isEqual","errors","status","isSubmitting","isValidating","field","submitCount","emptyErrors","emptyTouched","useFormik","validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit","rest","props","initialValues","initialErrors","initialTouched","initialStatus","isMounted","fieldRegistry","current","dispatch","runValidateHandler","Promise","resolve","reject","maybePromisedErrors","validate","actualException","process","env","NODE_ENV","console","warn","runValidationSchema","validationSchema","schema","promise","validateAt","validateYupSchema","err","name","yupToFormErrors","runSingleFieldLevelValidation","runFieldLevelValidations","fieldKeysWithValidation","filter","f","fieldValidations","map","all","fieldErrorsList","reduce","prev","curr","index","runAllValidations","fieldErrors","schemaErrors","validateErrors","combinedErrors","deepmerge","arrayMerge","validateFormWithHighPriority","useEventCallback","resetForm","nextState","dispatchFn","onReset","maybePromisedOnReset","imperativeMethods","validateField","maybePromise","x","error","registerField","unregisterField","setTouched","shouldValidate","willValidate","setErrors","setValues","resolvedValues","setFieldError","setFieldValue","executeChange","eventOrTextValue","maybePath","parsed","persist","currentTarget","id","checked","outerHTML","options","multiple","warnAboutMissingIdentifier","htmlContent","documentationAnchorLink","handlerName","test","parseFloat","getValueForCheckbox","getSelectedValues","handleChange","eventOrPath","event","setFieldTouched","executeBlur","handleBlur","eventOrString","setFormikState","stateOrCb","setStatus","setSubmitting","submitForm","isInstanceOfError","Error","isActuallyValid","promiseOrUndefined","executeSubmit","result","_errors","handleSubmit","preventDefault","stopPropagation","HTMLButtonElement","attributes","getNamedItem","reason","validateForm","handleReset","getFieldMeta","initialValue","initialError","getFieldHelpers","setValue","setError","getFieldProps","nameOrOptions","isAnObject","valueState","onChange","onBlur","valueProp","is","as","indexOf","dirty","isValid","ctx","Formik","formikbag","component","render","innerRef","only","yupError","inner","message","sync","context","validateData","prepareDataForValidation","abortEarly","data","hasOwnProperty","isPlainObject","source","destination","forEach","merge","cloneRequested","shouldClone","isMergeableObject","push","from","el","selected","currentValue","Boolean","currentArrayOfValues","isValueInArray","concat","useIsomorphicLayoutEffect","window","createElement","fn","ref","args","apply","useField","propsOrFieldName","fieldName","validateFn","Field","_validate","meta","legacyBag","form","asElement","Form","action","_action","withFormik","mapPropsToValues","vanillaProps","config","createFormik","Component","componentDisplayName","constructor","C","actions","formikProps","mapPropsToStatus","mapPropsToErrors","mapPropsToTouched","renderFormComponent","hoistNonReactStatics","connect","Comp","WrappedComponent","move","array","to","copy","copyArrayLike","splice","swap","arrayLike","indexA","indexB","a","insert","replace","maxIndex","parseInt","max","FieldArrayInner","alterTouched","alterErrors","prevState","updateErrors","updateTouched","fieldError","fieldTouched","updateArrayField","cloneDeep","arr","unshift","remove","pop","bind","componentDidUpdate","prevProps","tmp","arrayHelpers","handlePush","handlePop","handleSwap","handleMove","handleInsert","handleReplace","handleUnshift","handleRemove","restOfFormik","FieldArray","ErrorMessageImpl","shouldComponentUpdate","touch","ErrorMessage","FastFieldInner","shouldUpdate","componentDidMount","componentWillUnmount","bag","FastField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;IACaA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD;AAAA,SAC1BC,KAAK,CAACC,OAAN,CAAcF,KAAd,KAAwBA,KAAK,CAACG,MAAN,KAAiB,CADf;AAAA;AAG5B;;IACaC,UAAU,GAAG,SAAbA,UAAa,CAACC,GAAD;AAAA,SACxB,OAAOA,GAAP,KAAe,UADS;AAAA;AAG1B;;IACaC,QAAQ,GAAG,SAAXA,QAAW,CAACD,GAAD;AAAA,SACtBA,GAAG,KAAK,IAAR,IAAgB,OAAOA,GAAP,KAAe,QADT;AAAA;AAGxB;;IACaE,SAAS,GAAG,SAAZA,SAAY,CAACF,GAAD;AAAA,SACvBG,MAAM,CAACC,IAAI,CAACC,KAAL,CAAWC,MAAM,CAACN,GAAD,CAAjB,CAAD,CAAN,KAAoCA,GADb;AAAA;AAGzB;;IACaO,QAAQ,GAAG,SAAXA,QAAW,CAACP,GAAD;AAAA,SACtBQ,MAAM,CAACC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BX,GAA/B,MAAwC,iBADlB;AAAA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