UNPKG

ez-formbecauseican

Version:

Forms made Ez

181 lines (158 loc) 123 kB
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./dist/index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./dist/EzForm.js": /*!************************!*\ !*** ./dist/EzForm.js ***! \************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar react_1 = tslib_1.__importDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar InputGenerator_1 = __webpack_require__(/*! ./InputGenerator */ \"./dist/InputGenerator.js\");\nvar EzForm = (function (_super) {\n tslib_1.__extends(EzForm, _super);\n function EzForm(props) {\n var _this = _super.call(this, props) || this;\n _this.track = function (keyName, val, index) {\n if (_this.state.schema[keyName].tracked !== false) {\n var fieldValues = _this.state.fieldValues;\n fieldValues[index][keyName] = val;\n _this.setState(fieldValues);\n }\n };\n _this.validateField = function (keyName, index) {\n var schemaValue = _this.props.schema[keyName];\n var values = _this.state.fieldValues[index];\n if ((schemaValue.required != true && values[keyName] == \"\") ||\n values[keyName] == null) {\n _this.setErrors(keyName, index, null);\n return null;\n }\n if (\"visibleIf\" in schemaValue &&\n !schemaValue.visibleIf(_this.state.fieldValues[index])) {\n _this.setErrors(keyName, index, null);\n }\n if (!(\"visibleIf\" in schemaValue) ||\n schemaValue.visibleIf(_this.state.fieldValues[index])) {\n var validate = schemaValue.validate(values[keyName], values);\n if (validate && typeof validate !== \"string\") {\n throw new Error(\"All validate functions must return a string. please fix key: \" + keyName);\n }\n _this.setErrors(keyName, index, validate);\n }\n return null;\n };\n _this.onChangeEvent = function (e, keyName, index) {\n var value;\n if (_this.props.multiForm) {\n value = _this.state.fieldValues;\n }\n else {\n value = _this.state.fieldValues[0];\n }\n _this.props.onChange && _this.props.onChange(value);\n if (keyName in _this.props.schema && _this.props.schema[keyName].onChange) {\n var changeVals = _this.props.schema[keyName].onChange(e, _this.state.fieldValues[keyName], _this.state.fieldValues);\n if (changeVals) {\n _this.track(keyName, changeVals, index);\n }\n }\n };\n _this.onBlurEvent = function (e, keyName, index) {\n var fieldValues = _this.state.fieldValues;\n var value;\n if (_this.props.multiForm) {\n value = fieldValues;\n }\n else {\n value = fieldValues[0];\n }\n _this.props.onBlur && _this.props.onBlur(value);\n if (keyName in _this.props.schema && _this.props.schema[keyName].onBlur) {\n var blurVals = _this.props.schema[keyName].onBlur(e, _this.state.fieldValues[index][keyName], _this.state.fieldValues[index]);\n if (blurVals) {\n _this.track(keyName, blurVals, index);\n }\n }\n };\n _this.addFields = function () {\n var _a = _this.state, schema = _a.schema, fieldValues = _a.fieldValues, errors = _a.errors;\n var values = {};\n for (var _i = 0, _b = Object.keys(_this.props.schema); _i < _b.length; _i++) {\n var key = _b[_i];\n if (schema[key].tracked === false)\n break;\n if (_this.props.schemaModifier && key in _this.props.schemaModifier) {\n schema[key] = tslib_1.__assign({}, schema[key], _this.props.schemaModifier[key]);\n }\n values[key] = schema[key].initialValue || null;\n }\n _this.setState({\n fieldValues: fieldValues.concat([values]),\n errors: errors.concat([{}])\n }, function () {\n _this.props.onBlur && _this.props.onBlur(_this.state.fieldValues);\n });\n };\n _this.removeFields = function (index) {\n var fieldValues = _this.state.fieldValues;\n var values = fieldValues.filter(function (_, i) { return i !== index; });\n _this.setState({ fieldValues: values.slice() }, function () {\n _this.props.onBlur && _this.props.onBlur(_this.state.fieldValues);\n });\n };\n _this.clearForm = function (index) {\n var fieldValues;\n var resetIndex = function (index) {\n var values = {};\n for (var _i = 0, _a = Object.keys(_this.state.fieldValues[index]); _i < _a.length; _i++) {\n var key = _a[_i];\n values[key] = \"\";\n }\n return values;\n };\n if (index) {\n fieldValues = _this.state.fieldValues;\n fieldValues[index] = resetIndex(index);\n }\n else {\n fieldValues = _this.state.fieldValues.map(function (_, i) {\n return resetIndex(i);\n });\n }\n _this.setState({ fieldValues: fieldValues });\n };\n _this.state = {\n formInited: false,\n fieldValues: [],\n errors: [],\n hasErrors: false,\n schema: {}\n };\n return _this;\n }\n EzForm.prototype.setErrors = function (keyName, index, validate) {\n var errors = this.state.errors;\n var hasErrors = false;\n if (validate != undefined) {\n errors[index][keyName] = validate;\n }\n else if (keyName in errors[index]) {\n delete errors[index][keyName];\n }\n for (var index_1 in errors) {\n if (Object.keys(errors[index_1]).length > 0) {\n hasErrors = true;\n break;\n }\n }\n this.setState({ errors: errors, hasErrors: hasErrors });\n };\n EzForm.prototype.validateAll = function (vals) {\n var _this = this;\n return new Promise(function (resolve) {\n for (var index in vals) {\n for (var _i = 0, _a = Object.keys(vals[index]); _i < _a.length; _i++) {\n var key = _a[_i];\n var schemaVal = _this.props.schema[key];\n schemaVal && schemaVal.validate && _this.validateField(key, index);\n }\n }\n resolve(\"done\");\n });\n };\n EzForm.prototype.onSubmitEvent = function (e) {\n var _this = this;\n e.preventDefault();\n var values = this.state.fieldValues;\n for (var index in values) {\n for (var _i = 0, _a = Object.keys(this.props.schema); _i < _a.length; _i++) {\n var key = _a[_i];\n if (this.props.schema[key].onSubmit) {\n values[index][key] =\n this.props.schema[key].onSubmit(values[index][key], values[index]) || values[index][key];\n }\n }\n }\n this.validateAll(values).then(function () {\n if (_this.state.hasErrors) {\n return false;\n }\n if (_this.props.multiForm) {\n _this.props.onSubmit && _this.props.onSubmit(values);\n }\n else {\n _this.props.onSubmit && _this.props.onSubmit(values[0]);\n }\n return null;\n });\n };\n EzForm.prototype.initForm = function () {\n var _this = this;\n var schema = this.props.schema;\n var errors = [];\n var values;\n if (this.props.multiForm && Array.isArray(this.props.initialValues)) {\n values = this.props.initialValues.slice();\n }\n else if (this.props.initialValues &&\n this.props.multiForm &&\n Array.isArray(this.props.initialValues) != true) {\n throw new Error(\"initialValues must be an Array of objects if multiForm is set true\");\n }\n else {\n values = [tslib_1.__assign({}, this.props.initialValues)];\n }\n for (var index in values) {\n errors.push({});\n for (var _i = 0, _a = Object.keys(this.props.schema); _i < _a.length; _i++) {\n var key = _a[_i];\n if (schema[key].tracked === false)\n break;\n if (this.props.schemaModifier && key in this.props.schemaModifier) {\n schema[key] = tslib_1.__assign({}, schema[key], this.props.schemaModifier[key]);\n }\n if (!(key in values[index]) || values[index][key] === undefined) {\n values[index][key] =\n schema[key].initialValue !== undefined\n ? schema[key].initialValue\n : \"\";\n }\n }\n }\n this.setState({ fieldValues: values, schema: schema, errors: errors, formInited: true }, function () {\n if (_this.props.validateInitialValues) {\n _this.validateAll(values);\n }\n });\n };\n EzForm.prototype.componentDidMount = function () {\n this.initForm();\n };\n EzForm.prototype.componentDidUpdate = function (prevProps) {\n if (this.props.viewMode != prevProps.viewMode) {\n this.initForm();\n }\n };\n EzForm.prototype.renderInputs = function (index) {\n return InputGenerator_1.InputGenerator(this.props, this.state.schema, this.track, this.validateField, this.onBlurEvent, this.onChangeEvent, this.props.initialValues, this.state.fieldValues, this.state.errors, this.props.disabled, index, this.props.featureFlags, this.props.viewMode, this.props.viewModeDefaultText || \"N/A\");\n };\n EzForm.prototype.resetForm = function () {\n this.initForm();\n };\n EzForm.prototype.generateNewInput = function (obj) {\n var schema = tslib_1.__assign({}, this.state.schema, obj);\n this.setState({ schema: schema });\n };\n EzForm.prototype.render = function () {\n var _this = this;\n var inputs = this.state.fieldValues.map(function (obj, i) { return obj && _this.renderInputs(i); });\n var form = this.props.inputsOnly ? (this.props.multiForm === true ? (inputs) : (inputs[0])) : (react_1.default.createElement(react_1.default.Fragment, null, !this.props.inputsOnly &&\n inputs.map(function (input) {\n return input &&\n Object.keys(input).map(function (key) { return (react_1.default.createElement(react_1.default.Fragment, { key: key }, input[key].html)); });\n })));\n var FormComponent = this.props.formComponent\n ? this.props.formComponent\n : \"form\";\n return (react_1.default.createElement(react_1.default.Fragment, null, this.state.formInited && (react_1.default.createElement(FormComponent, { className: this.props.className ? this.props.className : \"\", onSubmit: function (e) { return _this.onSubmitEvent(e); } },\n this.props.children({\n form: form,\n fieldValues: this.state.fieldValues,\n errors: this.state.errors,\n clearForm: this.clearForm,\n resetForm: function () { return _this.resetForm(); },\n addFields: this.addFields,\n removeFields: this.removeFields\n }),\n this.props.showSubmitButton != false && !this.props.viewMode && (react_1.default.createElement(\"button\", { type: \"submit\", disabled: this.props.disabled }, \"submit\"))))));\n };\n return EzForm;\n}(react_1.default.Component));\nexports.EzForm = EzForm;\n//# sourceMappingURL=EzForm.js.map\n\n//# sourceURL=webpack:///./dist/EzForm.js?"); /***/ }), /***/ "./dist/Field.js": /*!***********************!*\ !*** ./dist/Field.js ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar react_1 = tslib_1.__importDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nexports.Field = function (props) {\n var input;\n if (props.type === \"textarea\") {\n input = react_1.default.createElement(\"textarea\", tslib_1.__assign({}, props));\n }\n else if (props.type === \"select\") {\n input = (react_1.default.createElement(\"select\", tslib_1.__assign({}, props), props.options.map(function (obj) { return (react_1.default.createElement(\"option\", tslib_1.__assign({ key: obj.value, value: obj.value }, obj), obj.label)); })));\n }\n else {\n input = react_1.default.createElement(\"input\", tslib_1.__assign({}, props));\n }\n return input;\n};\n//# sourceMappingURL=Field.js.map\n\n//# sourceURL=webpack:///./dist/Field.js?"); /***/ }), /***/ "./dist/InputGenerator.js": /*!********************************!*\ !*** ./dist/InputGenerator.js ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar react_1 = tslib_1.__importDefault(__webpack_require__(/*! react */ \"./node_modules/react/index.js\"));\nvar Field_1 = __webpack_require__(/*! ./Field */ \"./dist/Field.js\");\nvar removeKeys = function (obj, removeKeysArray) {\n var clonedObject = tslib_1.__assign({}, obj);\n for (var _i = 0, removeKeysArray_1 = removeKeysArray; _i < removeKeysArray_1.length; _i++) {\n var key = removeKeysArray_1[_i];\n delete clonedObject[key];\n }\n return clonedObject;\n};\nvar omitArray = [\n \"customComponent\",\n \"prependHtml\",\n \"appendHtml\",\n \"validate\",\n \"initialValue\",\n \"visibleIf\",\n \"tracked\",\n \"groupClassName\",\n \"label\",\n \"initialValue\",\n \"onChange\",\n \"onBlur\",\n \"onSubmit\",\n \"featureFlag\",\n \"required\",\n \"viewModeComponent\"\n];\nvar createInput = function (formProps, schemaValue, keyName, track, validateField, onBlurEvent, onChangeEvent, values, errors, disabled, index, initialValues, featureFlags, viewMode, viewModeDefaultText) {\n var required = typeof schemaValue.required === \"function\"\n ? schemaValue.required(values[index])\n : schemaValue.required;\n var componentVisibleIf = function (component) {\n var jsx = component;\n if (!isVisible()) {\n jsx = null;\n }\n return jsx;\n };\n var isVisible = function () {\n var visibleIfCheck = \"visibleIf\" in schemaValue ? schemaValue.visibleIf(values[index]) : true;\n var featureFlagCheck = featureFlags && \"featureFlag\" in schemaValue\n ? featureFlags[schemaValue.featureFlag]\n : true;\n if (visibleIfCheck && featureFlagCheck) {\n return true;\n }\n return false;\n };\n var label = react_1.default.isValidElement(schemaValue.label) ? (schemaValue.label) : (react_1.default.createElement(\"label\", { htmlFor: keyName },\n schemaValue.label,\n required && \" *\"));\n var error = (react_1.default.createElement(\"div\", { className: formProps.errorClass + \" ez-form-error\" }, errors[index][keyName]));\n var input;\n if (schemaValue.functionalComponent) {\n var params = {\n submit: function (obj) {\n track(keyName, obj, index);\n return null;\n },\n keyName: keyName,\n initialValues: initialValues,\n index: index\n };\n input = schemaValue.functionalComponent(params);\n }\n else {\n var omitArrayBlocked = omitArray.slice();\n var InputFieldComponent = schemaValue.customComponent || Field_1.Field;\n if (schemaValue.customComponent) {\n InputFieldComponent = schemaValue.customComponent;\n }\n if (disabled) {\n omitArrayBlocked.push(\"disabled\");\n }\n input = (react_1.default.createElement(InputFieldComponent, tslib_1.__assign({ key: keyName + \"-\" + index, name: keyName + \"-\" + index, id: keyName + \"-\" + index, error: errors[index][keyName], value: values[index][keyName], onChange: function (e) {\n if (schemaValue.tracked === false)\n return false;\n var value;\n try {\n value = e.target.value;\n }\n catch (_a) {\n value = e;\n }\n track(keyName, value, index);\n onChangeEvent(e, keyName, index);\n return null;\n }, onBlur: function (e) {\n onBlurEvent(e, keyName, index);\n schemaValue.onBlur && onBlurEvent(e, keyName, index);\n schemaValue[\"validate\"] && validateField(keyName, index);\n return null;\n }, disabled: disabled, required: required }, removeKeys(schemaValue, omitArrayBlocked))));\n }\n var getString = function () {\n if (values[index][keyName] || values[index][keyName] === false) {\n return String(values[index][keyName]);\n }\n return String(viewModeDefaultText);\n };\n var viewModeComponent = function () {\n return componentVisibleIf(schemaValue.viewModeComponent ? (react_1.default.createElement(\"div\", { className: schemaValue.groupClassName },\n label,\n schemaValue.viewModeComponent(values[index][keyName], values[index]))) : (react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"div\", { className: schemaValue.groupClassName },\n label,\n react_1.default.createElement(\"div\", { className: schemaValue.viewModeClass }, getString())))));\n };\n return {\n index: index,\n label: componentVisibleIf(label),\n input: componentVisibleIf(input),\n error: componentVisibleIf(error),\n prependHtml: componentVisibleIf(schemaValue.prependHtml),\n appendHtml: componentVisibleIf(schemaValue.appendHtml),\n visible: isVisible(),\n html: viewMode\n ? viewModeComponent()\n : componentVisibleIf(react_1.default.createElement(react_1.default.Fragment, null,\n react_1.default.createElement(\"div\", { className: schemaValue.groupClassName },\n label,\n react_1.default.createElement(\"div\", null,\n schemaValue.prependHtml,\n input,\n schemaValue.appendHtml),\n error))),\n viewMode: viewModeComponent()\n };\n};\nexports.InputGenerator = function (formProps, schema, track, validateField, onBlurEvent, onChangeEvent, initialValues, values, errors, disabled, index, featureFlags, viewMode, viewModeDefaultText) {\n if (disabled === void 0) { disabled = false; }\n var inputs = {};\n for (var _i = 0, _a = Object.keys(schema); _i < _a.length; _i++) {\n var key = _a[_i];\n inputs[key] = createInput(formProps, schema[key], key, track, validateField, onBlurEvent, onChangeEvent, values, errors, disabled, index, initialValues, featureFlags, viewMode, viewModeDefaultText);\n }\n return inputs;\n};\n//# sourceMappingURL=InputGenerator.js.map\n\n//# sourceURL=webpack:///./dist/InputGenerator.js?"); /***/ }), /***/ "./dist/index.js": /*!***********************!*\ !*** ./dist/index.js ***! \***********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\ntslib_1.__exportStar(__webpack_require__(/*! ./EzForm */ \"./dist/EzForm.js\"), exports);\ntslib_1.__exportStar(__webpack_require__(/*! ./Field */ \"./dist/Field.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./dist/index.js?"); /***/ }), /***/ "./node_modules/object-assign/index.js": /*!*********************************************!*\ !*** ./node_modules/object-assign/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack:///./node_modules/object-assign/index.js?"); /***/ }), /***/ "./node_modules/prop-types/checkPropTypes.js": /*!***************************************************!*\ !*** ./node_modules/prop-types/checkPropTypes.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar printWarning = function() {};\n\nif (true) {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (true) {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (true) {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/checkPropTypes.js?"); /***/ }), /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": /*!*************************************************************!*\ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js?"); /***/ }), /***/ "./node_modules/react/cjs/react.development.js": /*!*****************************************************!*\ !*** ./node_modules/react/cjs/react.development.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/** @license React v16.9.0\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n\n\nif (true) {\n (function() {\n'use strict';\n\nvar _assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\nvar checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\n\n// TODO: this is special because it gets imported during build.\n\nvar ReactVersion = '16.9.0';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\n\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;\n// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n return null;\n}\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\n\nfunction ReactError(error) {\n error.name = 'Invariant Violation';\n return error;\n}\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\n/**\n * Forked from fbjs/warning:\n * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js\n *\n * Only change is we use console.warn instead of console.error,\n * and do nothing when 'console' is not supported.\n * This really simplifies the code.\n * ---\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar lowPriorityWarning = function () {};\n\n{\n var printWarning = function (format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.warn(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n lowPriorityWarning = function (condition, format) {\n if (format === undefined) {\n throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nvar lowPriorityWarning$1 = lowPriorityWarning;\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warningWithoutStack = function () {};\n\n{\n warningWithoutStack = function (condition, format) {\n for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n if (format === undefined) {\n throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n if (args.length > 8) {\n // Check before the condition to catch violations early.\n throw new Error('warningWithoutStack() currently supports at most 8 arguments.');\n }\n if (condition) {\n return;\n }\n if (typeof console !== 'undefined') {\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n });\n argsWithFormat.unshift('Warning: ' + format);\n\n // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n Function.prototype.apply.call(console.error, console, argsWithFormat);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nvar warningWithoutStack$1 = warningWithoutStack;\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + '.' + callerName;\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n warningWithoutStack$1(false, \"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n\n/**\n * This is the abstract API for an update queue.\n */\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar emptyObject = {};\n{\n Object.freeze(emptyObject);\n}\n\n/**\n * Base class helpers for the updating state of a component.\n */\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n // If a component has string refs, we will assign a different object later.\n this.refs = emptyObject;\n // We initialize the default updater but the real one gets injected by the\n // renderer.\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\nComponent.prototype.setState = function (partialState, callback) {\n (function () {\n if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {\n {\n throw ReactError(Error('setState(...): takes an object of state variables to update or a function which returns an object of state variables.'));\n }\n }\n })();\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n return undefined;\n }\n });\n };\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\n\n/**\n * Convenience component with default shallow equality check for sCU.\n */\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n // If a component has string refs, we will assign a different object later.\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent;\n// Avoid an extra prototype jump for these methods.\n_assign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n suspense: null\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\n\nvar describeComponentFrame = function (name, source, ownerName) {\n var sourceInfo = '';\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n if (match) {\n var pathBeforeSlash = match[1];\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n return '\\n in ' + (name ||