/******/ (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] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = 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; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "http://localhost:8080/"; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { eval("'use strict';\n\n__webpack_require__(1);\n\n__webpack_require__(6);\n\n__webpack_require__(10);//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYXBwL2RyYWdkcm9wd2F5L2luZGV4LmpzPzQ1NmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7QUFDQTs7QUFDQSIsImZpbGUiOiIwLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICcuL3ZlbmRvcnMnO1xuaW1wb3J0ICcuL3N0eWxlL2RyYWdfYW5kX2Ryb3Auc2Nzcyc7XG5pbXBvcnQgJy4vbWFpbic7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9zcmMvYXBwL2RyYWdkcm9wd2F5L2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ=="); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { eval("'use strict';\n\n__webpack_require__(2);\n\n__webpack_require__(3);\n\n__webpack_require__(5);//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvYXBwL2RyYWdkcm9wd2F5L3ZlbmRvcnMuanM/YjcxMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBOztBQUNBOztBQUNBIiwiZmlsZSI6IjEuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgJ2FwaS1jaGVjayc7IC8vIE5PVEU6IGFsd2F5cyBpbXBvcnRlZCBiZWZvcmUgYW5ndWxhci1mb3JtbHkhXG5pbXBvcnQgJ2FuZ3VsYXItZm9ybWx5JztcbmltcG9ydCAnYW5ndWxhci1mb3JtbHktdGVtcGxhdGVzLWJvb3RzdHJhcCc7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gLi9zcmMvYXBwL2RyYWdkcm9wd2F5L3ZlbmRvcnMuanMiXSwic291cmNlUm9vdCI6IiJ9"); /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { eval("//! api-check version 7.5.5 built with ♥ by Kent C. Dodds (http://kent.doddsfamily.us) (ó ì_í)=óò=(ì_í ò)\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apiCheck\"] = factory();\n\telse\n\t\troot[\"apiCheck\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n\tvar _apiCheck = __webpack_require__(1);\n\n\tvar _apiCheck2 = _interopRequireDefault(_apiCheck);\n\n\texports['default'] = _apiCheck2['default'];\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar stringify = __webpack_require__(2);\n\tvar apiCheckUtil = __webpack_require__(3);\n\tvar each = apiCheckUtil.each;\n\tvar isError = apiCheckUtil.isError;\n\tvar t = apiCheckUtil.t;\n\tvar arrayify = apiCheckUtil.arrayify;\n\tvar getCheckerDisplay = apiCheckUtil.getCheckerDisplay;\n\tvar typeOf = apiCheckUtil.typeOf;\n\tvar getError = apiCheckUtil.getError;\n\n\tvar checkers = __webpack_require__(4);\n\tvar apiCheckApis = getApiCheckApis();\n\n\tmodule.exports = getApiCheckInstance;\n\tmodule.exports.VERSION = (\"7.5.5\");\n\tmodule.exports.utils = apiCheckUtil;\n\tmodule.exports.globalConfig = {\n\t verbose: false,\n\t disabled: false\n\t};\n\n\tvar apiCheckApiCheck = getApiCheckInstance({\n\t output: { prefix: 'apiCheck' }\n\t});\n\tmodule.exports.internalChecker = apiCheckApiCheck;\n\n\teach(checkers, function (checker, name) {\n\t return module.exports[name] = checker;\n\t});\n\n\tfunction getApiCheckInstance() {\n\t var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t var extraCheckers = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n\t /* eslint complexity:[2, 6] */\n\t if (apiCheckApiCheck && arguments.length) {\n\t apiCheckApiCheck['throw'](apiCheckApis.getApiCheckInstanceCheckers, arguments, {\n\t prefix: 'creating an apiCheck instance'\n\t });\n\t }\n\n\t var additionalProperties = {\n\t 'throw': getApiCheck(true),\n\t warn: getApiCheck(false),\n\t getErrorMessage: getErrorMessage,\n\t handleErrorMessage: handleErrorMessage,\n\t config: {\n\t output: config.output || {\n\t prefix: '',\n\t suffix: '',\n\t docsBaseUrl: ''\n\t },\n\t verbose: config.verbose || false,\n\t disabled: config.disabled || false\n\t },\n\t utils: apiCheckUtil\n\t };\n\n\t each(additionalProperties, function (wrapper, name) {\n\t return apiCheck[name] = wrapper;\n\t });\n\n\t var disabled = apiCheck.disabled || module.exports.globalConfig.disabled;\n\t each(checkers.getCheckers(disabled), function (checker, name) {\n\t return apiCheck[name] = checker;\n\t });\n\t each(extraCheckers, function (checker, name) {\n\t return apiCheck[name] = checker;\n\t });\n\n\t return apiCheck;\n\n\t /**\n\t * This is the instance function. Other things are attached to this see additional properties above.\n\t * @param {Array} api - the checkers to check with\n\t * @param {Array} args - the args to check\n\t * @param {Object} output - output options\n\t * @returns {Object} - if this has a failed = true property, then it failed\n\t */\n\t function apiCheck(api, args, output) {\n\t /* eslint complexity:[2, 8] */\n\t if (apiCheck.config.disabled || module.exports.globalConfig.disabled) {\n\t return {\n\t apiTypes: {}, argTypes: {},\n\t passed: true, message: '',\n\t failed: false\n\t }; // empty version of what is normally returned\n\t }\n\t checkApiCheckApi(arguments);\n\t if (!Array.isArray(api)) {\n\t api = [api];\n\t args = [args];\n\t } else {\n\t // turn arguments into an array\n\t args = Array.prototype.slice.call(args);\n\t }\n\t var messages = checkEnoughArgs(api, args);\n\t if (!messages.length) {\n\t // this is where we actually go perform the checks.\n\t messages = checkApiWithArgs(api, args);\n\t }\n\n\t var returnObject = getTypes(api, args);\n\t returnObject.args = args;\n\t if (messages.length) {\n\t returnObject.message = apiCheck.getErrorMessage(api, args, messages, output);\n\t returnObject.failed = true;\n\t returnObject.passed = false;\n\t } else {\n\t returnObject.message = '';\n\t returnObject.failed = false;\n\t returnObject.passed = true;\n\t }\n\t return returnObject;\n\t }\n\n\t /**\n\t * checkApiCheckApi, should be read like: check apiCheck api. As in, check the api for apiCheck :-)\n\t * @param {Array} checkApiArgs - args provided to apiCheck function\n\t */\n\t function checkApiCheckApi(checkApiArgs) {\n\t var api = checkApiArgs[0];\n\t var args = checkApiArgs[1];\n\t var isArrayOrArgs = Array.isArray(args) || args && typeof args === 'object' && typeof args.length === 'number';\n\n\t if (Array.isArray(api) && !isArrayOrArgs) {\n\t throw new Error(getErrorMessage(api, [args], ['If an array is provided for the api, an array must be provided for the args as well.'], { prefix: 'apiCheck' }));\n\t }\n\t // dog fooding here\n\t var errors = checkApiWithArgs(apiCheckApis.checkApiCheckApi, checkApiArgs);\n\t if (errors.length) {\n\t var message = apiCheck.getErrorMessage(apiCheckApis.checkApiCheckApi, checkApiArgs, errors, {\n\t prefix: 'apiCheck'\n\t });\n\t apiCheck.handleErrorMessage(message, true);\n\t }\n\t }\n\n\t function getApiCheck(shouldThrow) {\n\t return function apiCheckWrapper(api, args, output) {\n\t var result = apiCheck(api, args, output);\n\t apiCheck.handleErrorMessage(result.message, shouldThrow);\n\t return result; // wont get here if an error is thrown\n\t };\n\t }\n\n\t function handleErrorMessage(message, shouldThrow) {\n\t if (shouldThrow && message) {\n\t throw new Error(message);\n\t } else if (message) {\n\t /* eslint no-console:0 */\n\t console.warn(message);\n\t }\n\t }\n\n\t function getErrorMessage(api, args) {\n\t var messages = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2];\n\t var output = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3];\n\n\t var gOut = apiCheck.config.output || {};\n\t var prefix = getPrefix();\n\t var suffix = getSuffix();\n\t var url = getUrl();\n\t var message = 'apiCheck failed! ' + messages.join(', ');\n\t var passedAndShouldHavePassed = '\\n\\n' + buildMessageFromApiAndArgs(api, args);\n\t return (prefix + ' ' + message + ' ' + suffix + ' ' + (url || '') + passedAndShouldHavePassed).trim();\n\n\t function getPrefix() {\n\t var p = output.onlyPrefix;\n\t if (!p) {\n\t p = ((gOut.prefix || '') + ' ' + (output.prefix || '')).trim();\n\t }\n\t return p;\n\t }\n\n\t function getSuffix() {\n\t var s = output.onlySuffix;\n\t if (!s) {\n\t s = ((output.suffix || '') + ' ' + (gOut.suffix || '')).trim();\n\t }\n\t return s;\n\t }\n\n\t function getUrl() {\n\t var u = output.url;\n\t if (!u) {\n\t u = gOut.docsBaseUrl && output.urlSuffix && ('' + gOut.docsBaseUrl + output.urlSuffix).trim();\n\t }\n\t return u;\n\t }\n\t }\n\n\t function buildMessageFromApiAndArgs(api, args) {\n\t var _getTypes = getTypes(api, args);\n\n\t var apiTypes = _getTypes.apiTypes;\n\t var argTypes = _getTypes.argTypes;\n\n\t var copy = Array.prototype.slice.call(args || []);\n\t var replacedItems = [];\n\t replaceFunctionWithName(copy);\n\t var passedArgs = getObjectString(copy);\n\t argTypes = getObjectString(argTypes);\n\t apiTypes = getObjectString(apiTypes);\n\n\t return generateMessage();\n\n\t // functions\n\n\t function replaceFunctionWithName(obj) {\n\t each(obj, function (val, name) {\n\t /* eslint complexity:[2, 6] */\n\t if (replacedItems.indexOf(val) === -1) {\n\t // avoid recursive problems\n\t replacedItems.push(val);\n\t if (typeof val === 'object') {\n\t replaceFunctionWithName(obj);\n\t } else if (typeof val === 'function') {\n\t obj[name] = val.displayName || val.name || 'anonymous function';\n\t }\n\t }\n\t });\n\t }\n\n\t function getObjectString(types) {\n\t if (!types || !types.length) {\n\t return 'nothing';\n\t } else if (types && types.length === 1) {\n\t types = types[0];\n\t }\n\t return stringify(types, null, 2);\n\t }\n\n\t function generateMessage() {\n\t var n = '\\n';\n\t var useS = true;\n\t if (args && args.length === 1) {\n\t if (typeof args[0] === 'object' && args[0] !== null) {\n\t useS = !!Object.keys(args[0]).length;\n\t } else {\n\t useS = false;\n\t }\n\t }\n\t var types = 'type' + (useS ? 's' : '');\n\t var newLine = n + n;\n\t return 'You passed:' + n + passedArgs + newLine + ('With the ' + types + ':' + n + argTypes + newLine) + ('The API calls for:' + n + apiTypes);\n\t }\n\t }\n\n\t function getTypes(api, args) {\n\t api = arrayify(api);\n\t args = arrayify(args);\n\t var apiTypes = api.map(function (checker, index) {\n\t var specified = module.exports.globalConfig.hasOwnProperty('verbose');\n\t return getCheckerDisplay(checker, {\n\t terse: specified ? !module.exports.globalConfig.verbose : !apiCheck.config.verbose,\n\t obj: args[index],\n\t addHelpers: true\n\t });\n\t });\n\t var argTypes = args.map(function (arg) {\n\t return getArgDisplay(arg, []);\n\t });\n\t return { argTypes: argTypes, apiTypes: apiTypes };\n\t }\n\t}\n\n\t// STATELESS FUNCTIONS\n\n\t/**\n\t * This is where the magic happens for actually checking the arguments with the api.\n\t * @param {Array} api - checkers\n\t * @param {Array} args - and arguments object\n\t * @returns {Array} - the error messages\n\t */\n\tfunction checkApiWithArgs(api, args) {\n\t /* eslint complexity:[2, 7] */\n\t var messages = [];\n\t var failed = false;\n\t var checkerIndex = 0;\n\t var argIndex = 0;\n\t var arg = undefined,\n\t checker = undefined,\n\t res = undefined,\n\t lastChecker = undefined,\n\t argName = undefined,\n\t argFailed = undefined,\n\t skipPreviousChecker = undefined;\n\t /* jshint -W084 */\n\t while ((checker = api[checkerIndex++]) && argIndex < args.length) {\n\t arg = args[argIndex++];\n\t argName = 'Argument ' + argIndex + (checker.isOptional ? ' (optional)' : '');\n\t res = checker(arg, 'value', argName);\n\t argFailed = isError(res);\n\t lastChecker = checkerIndex >= api.length;\n\t skipPreviousChecker = checkerIndex > 1 && api[checkerIndex - 1].isOptional;\n\t if (argFailed && lastChecker || argFailed && !lastChecker && !checker.isOptional && !skipPreviousChecker) {\n\t failed = true;\n\t messages.push(getCheckerErrorMessage(res, checker, arg));\n\t } else if (argFailed && checker.isOptional) {\n\t argIndex--;\n\t } else {\n\t messages.push(t(argName) + ' passed');\n\t }\n\t }\n\t return failed ? messages : [];\n\t}\n\n\tcheckerTypeType.type = 'function with __apiCheckData property and `${function.type}` property';\n\tfunction checkerTypeType(checkerType, name, location) {\n\t var apiCheckDataChecker = checkers.shape({\n\t type: checkers.string,\n\t optional: checkers.bool\n\t });\n\t var asFunc = checkers.func.withProperties({ __apiCheckData: apiCheckDataChecker });\n\t var asShape = checkers.shape({ __apiCheckData: apiCheckDataChecker });\n\t var wrongShape = checkers.oneOfType([asFunc, asShape])(checkerType, name, location);\n\t if (isError(wrongShape)) {\n\t return wrongShape;\n\t }\n\t if (typeof checkerType !== 'function' && !checkerType.hasOwnProperty(checkerType.__apiCheckData.type)) {\n\t return getError(name, location, checkerTypeType.type);\n\t }\n\t}\n\n\tfunction getCheckerErrorMessage(res, checker, val) {\n\t var checkerHelp = getCheckerHelp(checker, val);\n\t checkerHelp = checkerHelp ? ' - ' + checkerHelp : '';\n\t return res.message + checkerHelp;\n\t}\n\n\tfunction getCheckerHelp(_ref, val) {\n\t var help = _ref.help;\n\n\t if (!help) {\n\t return '';\n\t }\n\t if (typeof help === 'function') {\n\t help = help(val);\n\t }\n\t return help;\n\t}\n\n\tfunction checkEnoughArgs(api, args) {\n\t var requiredArgs = api.filter(function (a) {\n\t return !a.isOptional;\n\t });\n\t if (args.length < requiredArgs.length) {\n\t return ['Not enough arguments specified. Requires `' + requiredArgs.length + '`, you passed `' + args.length + '`'];\n\t } else {\n\t return [];\n\t }\n\t}\n\n\tfunction getArgDisplay(arg, gottenArgs) {\n\t /* eslint complexity:[2, 7] */\n\t var cName = arg && arg.constructor && arg.constructor.name;\n\t var type = typeOf(arg);\n\t if (type === 'function') {\n\t if (hasKeys()) {\n\t var properties = stringify(getDisplayIfNotGotten());\n\t return cName + ' (with properties: ' + properties + ')';\n\t }\n\t return cName;\n\t }\n\n\t if (arg === null) {\n\t return 'null';\n\t }\n\n\t if (type !== 'array' && type !== 'object') {\n\t return type;\n\t }\n\n\t if (hasKeys()) {\n\t return getDisplayIfNotGotten();\n\t }\n\n\t return cName;\n\n\t // utility functions\n\t function hasKeys() {\n\t return arg && Object.keys(arg).length;\n\t }\n\n\t function getDisplayIfNotGotten() {\n\t if (gottenArgs.indexOf(arg) !== -1) {\n\t return '[Circular]';\n\t }\n\t gottenArgs.push(arg);\n\t return getDisplay(arg, gottenArgs);\n\t }\n\t}\n\n\tfunction getDisplay(obj, gottenArgs) {\n\t var argDisplay = {};\n\t each(obj, function (v, k) {\n\t return argDisplay[k] = getArgDisplay(v, gottenArgs);\n\t });\n\t return argDisplay;\n\t}\n\n\tfunction getApiCheckApis() {\n\t var os = checkers.string.optional;\n\n\t var checkerFnChecker = checkers.func.withProperties({\n\t type: checkers.oneOfType([checkers.string, checkerTypeType]).optional,\n\t displayName: checkers.string.optional,\n\t shortType: checkers.string.optional,\n\t notOptional: checkers.bool.optional,\n\t notRequired: checkers.bool.optional\n\t });\n\n\t var getApiCheckInstanceCheckers = [checkers.shape({\n\t output: checkers.shape({\n\t prefix: checkers.string.optional,\n\t suffix: checkers.string.optional,\n\t docsBaseUrl: checkers.string.optional\n\t }).strict.optional,\n\t verbose: checkers.bool.optional,\n\t disabled: checkers.bool.optional\n\t }).strict.optional, checkers.objectOf(checkerFnChecker).optional];\n\n\t var checkApiCheckApi = [checkers.typeOrArrayOf(checkerFnChecker), checkers.any.optional, checkers.shape({\n\t prefix: os, suffix: os, urlSuffix: os, // appended case\n\t onlyPrefix: os, onlySuffix: os, url: os // override case\n\t }).strict.optional];\n\n\t return {\n\t checkerFnChecker: checkerFnChecker,\n\t getApiCheckInstanceCheckers: getApiCheckInstanceCheckers,\n\t checkApiCheckApi: checkApiCheckApi\n\t };\n\t}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = stringify;\n\n\tfunction getSerialize (fn, decycle) {\n\t var seen = [], keys = [];\n\t decycle = decycle || function(key, value) {\n\t return '[Circular ' + getPath(value, seen, keys) + ']'\n\t };\n\t return function(key, value) {\n\t var ret = value;\n\t if (typeof value === 'object' && value) {\n\t if (seen.indexOf(value) !== -1)\n\t ret = decycle(key, value);\n\t else {\n\t seen.push(value);\n\t keys.push(key);\n\t }\n\t }\n\t if (fn) ret = fn(key, ret);\n\t return ret;\n\t }\n\t}\n\n\tfunction getPath (value, seen, keys) {\n\t var index = seen.indexOf(value);\n\t var path = [ keys[index] ];\n\t for (index--; index >= 0; index--) {\n\t if (seen[index][ path[0] ] === value) {\n\t value = seen[index];\n\t path.unshift(keys[index]);\n\t }\n\t }\n\t return '~' + path.join('.');\n\t}\n\n\tfunction stringify(obj, fn, spaces, decycle) {\n\t return JSON.stringify(obj, getSerialize(fn, decycle), spaces);\n\t}\n\n\tstringify.getSerialize = getSerialize;\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n\tvar stringify = __webpack_require__(2);\n\tvar checkerHelpers = {\n\t addOptional: addOptional, getRequiredVersion: getRequiredVersion, setupChecker: setupChecker, addNullable: addNullable\n\t};\n\n\tmodule.exports = {\n\t each: each, copy: copy, typeOf: typeOf, arrayify: arrayify, getCheckerDisplay: getCheckerDisplay,\n\t isError: isError, list: list, getError: getError, nAtL: nAtL, t: t, undef: undef, checkerHelpers: checkerHelpers,\n\t noop: noop\n\t};\n\n\tfunction copy(obj) {\n\t var type = typeOf(obj);\n\t var daCopy = undefined;\n\t if (type === 'array') {\n\t daCopy = [];\n\t } else if (type === 'object') {\n\t daCopy = {};\n\t } else {\n\t return obj;\n\t }\n\t each(obj, function (val, key) {\n\t daCopy[key] = val; // cannot single-line this because we don't want to abort the each\n\t });\n\t return daCopy;\n\t}\n\n\tfunction typeOf(obj) {\n\t if (Array.isArray(obj)) {\n\t return 'array';\n\t } else if (obj instanceof RegExp) {\n\t return 'object';\n\t } else {\n\t return typeof obj;\n\t }\n\t}\n\n\tfunction getCheckerDisplay(checker, options) {\n\t /* eslint complexity:[2, 7] */\n\t var display = undefined;\n\t var short = options && options.short;\n\t if (short && checker.shortType) {\n\t display = checker.shortType;\n\t } else if (!short && typeof checker.type === 'object' || checker.type === 'function') {\n\t display = getCheckerType(checker, options);\n\t } else {\n\t display = getCheckerType(checker, options) || checker.displayName || checker.name;\n\t }\n\t return display;\n\t}\n\n\tfunction getCheckerType(_ref, options) {\n\t var type = _ref.type;\n\n\t if (typeof type === 'function') {\n\t var __apiCheckData = type.__apiCheckData;\n\t var typeTypes = type(options);\n\t type = _defineProperty({\n\t __apiCheckData: __apiCheckData\n\t }, __apiCheckData.type, typeTypes);\n\t }\n\t return type;\n\t}\n\n\tfunction arrayify(obj) {\n\t if (!obj) {\n\t return [];\n\t } else if (Array.isArray(obj)) {\n\t return obj;\n\t } else {\n\t return [obj];\n\t }\n\t}\n\n\tfunction each(obj, iterator, context) {\n\t if (Array.isArray(obj)) {\n\t return eachArry(obj, iterator, context);\n\t } else {\n\t return eachObj(obj, iterator, context);\n\t }\n\t}\n\n\tfunction eachObj(obj, iterator, context) {\n\t var ret = undefined;\n\t var hasOwn = Object.prototype.hasOwnProperty;\n\t /* eslint prefer-const:0 */ // some weird eslint bug?\n\t for (var key in obj) {\n\t if (hasOwn.call(obj, key)) {\n\t ret = iterator.call(context, obj[key], key, obj);\n\t if (ret === false) {\n\t return ret;\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\n\tfunction eachArry(obj, iterator, context) {\n\t var ret = undefined;\n\t var length = obj.length;\n\t for (var i = 0; i < length; i++) {\n\t ret = iterator.call(context, obj[i], i, obj);\n\t if (ret === false) {\n\t return ret;\n\t }\n\t }\n\t return true;\n\t}\n\n\tfunction isError(obj) {\n\t return obj instanceof Error;\n\t}\n\n\tfunction list(arry, join, finalJoin) {\n\t arry = arrayify(arry);\n\t var copy = arry.slice();\n\t var last = copy.pop();\n\t if (copy.length === 1) {\n\t join = ' ';\n\t }\n\t return copy.join(join) + ('' + (copy.length ? join + finalJoin : '') + last);\n\t}\n\n\tfunction getError(name, location, checkerType) {\n\t if (typeof checkerType === 'function') {\n\t checkerType = checkerType({ short: true });\n\t }\n\t var stringType = typeof checkerType !== 'object' ? checkerType : stringify(checkerType);\n\t return new Error(nAtL(name, location) + ' must be ' + t(stringType));\n\t}\n\n\tfunction nAtL(name, location) {\n\t var tName = t(name || 'value');\n\t var tLocation = !location ? '' : ' at ' + t(location);\n\t return '' + tName + tLocation;\n\t}\n\n\tfunction t(thing) {\n\t return '`' + thing + '`';\n\t}\n\n\tfunction undef(thing) {\n\t return typeof thing === 'undefined';\n\t}\n\n\t/**\n\t * This will set up the checker with all of the defaults that most checkers want like required by default and an\n\t * optional version\n\t *\n\t * @param {Function} checker - the checker to setup with properties\n\t * @param {Object} properties - properties to add to the checker\n\t * @param {boolean} disabled - when set to true, this will set the checker to a no-op function\n\t * @returns {Function} checker - the setup checker\n\t */\n\tfunction setupChecker(checker, properties, disabled) {\n\t /* eslint complexity:[2, 9] */\n\t if (disabled) {\n\t // swap out the checker for its own copy of noop\n\t checker = getNoop();\n\t checker.isNoop = true;\n\t }\n\n\t if (typeof checker.type === 'string') {\n\t checker.shortType = checker.type;\n\t }\n\n\t // assign all properties given\n\t each(properties, function (prop, name) {\n\t return checker[name] = prop;\n\t });\n\n\t if (!checker.displayName) {\n\t checker.displayName = 'apiCheck ' + t(checker.shortType || checker.type || checker.name) + ' type checker';\n\t }\n\n\t if (!checker.notRequired) {\n\t checker = getRequiredVersion(checker, disabled);\n\t }\n\n\t if (!checker.notNullable) {\n\t addNullable(checker, disabled);\n\t }\n\n\t if (!checker.notOptional) {\n\t addOptional(checker, disabled);\n\t }\n\n\t return checker;\n\t}\n\n\tfunction getRequiredVersion(checker, disabled) {\n\t var requiredChecker = disabled ? getNoop() : function requiredChecker(val, name, location, obj) {\n\t if (undef(val) && !checker.isOptional) {\n\t var tLocation = location ? ' in ' + t(location) : '';\n\t var type = getCheckerDisplay(checker, { short: true });\n\t var stringType = typeof type !== 'object' ? type : stringify(type);\n\t return new Error('Required ' + t(name) + ' not specified' + tLocation + '. Must be ' + t(stringType));\n\t } else {\n\t return checker(val, name, location, obj);\n\t }\n\t };\n\t copyProps(checker, requiredChecker);\n\t requiredChecker.originalChecker = checker;\n\t return requiredChecker;\n\t}\n\n\tfunction addOptional(checker, disabled) {\n\t var optionalCheck = disabled ? getNoop() : function optionalCheck(val, name, location, obj) {\n\t if (!undef(val)) {\n\t return checker(val, name, location, obj);\n\t }\n\t };\n\t // inherit all properties on the original checker\n\t copyProps(checker, optionalCheck);\n\n\t optionalCheck.isOptional = true;\n\t optionalCheck.displayName = checker.displayName + ' (optional)';\n\t optionalCheck.originalChecker = checker;\n\n\t // the magic line that allows you to add .optional to the end of the checkers\n\t checker.optional = optionalCheck;\n\n\t fixType(checker, checker.optional);\n\t}\n\n\tfunction addNullable(checker, disabled) {\n\t var nullableCheck = disabled ? getNoop() : function nullableCheck(val, name, location, obj) {\n\t if (val !== null) {\n\t return checker(val, name, location, obj);\n\t }\n\t };\n\t // inherit all properties on the original checker\n\t copyProps(checker, nullableCheck);\n\n\t nullableCheck.isNullable = true;\n\t nullableCheck.displayName = checker.displayName + ' (nullable)';\n\t nullableCheck.originalChecker = checker;\n\n\t // the magic line that allows you to add .nullable to the end of the checkers\n\t checker.nullable = nullableCheck;\n\n\t fixType(checker, checker.nullable);\n\t if (!checker.notOptional) {\n\t addOptional(checker.nullable, disabled);\n\t }\n\t}\n\n\tfunction fixType(checker, checkerCopy) {\n\t // fix type, because it's not a straight copy...\n\t // the reason is we need to specify type.__apiCheckData.optional as true for the terse/verbose option.\n\t // we also want to add \"(optional)\" to the types with a string\n\t if (typeof checkerCopy.type === 'object') {\n\t checkerCopy.type = copy(checkerCopy.type); // make our own copy of this\n\t } else if (typeof checkerCopy.type === 'function') {\n\t checkerCopy.type = function () {\n\t return checker.type.apply(checker, arguments);\n\t };\n\t } else {\n\t checkerCopy.type += ' (optional)';\n\t return;\n\t }\n\t checkerCopy.type.__apiCheckData = copy(checker.type.__apiCheckData) || {}; // and this\n\t checkerCopy.type.__apiCheckData.optional = true;\n\t}\n\n\t// UTILS\n\n\tfunction copyProps(src, dest) {\n\t each(Object.keys(src), function (key) {\n\t return dest[key] = src[key];\n\t });\n\t}\n\n\tfunction noop() {}\n\n\tfunction getNoop() {\n\t /* eslint no-shadow:0 */\n\t /* istanbul ignore next */\n\t return function noop() {};\n\t}\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\n\tvar stringify = __webpack_require__(2);\n\n\tvar _require = __webpack_require__(3);\n\n\tvar typeOf = _require.typeOf;\n\tvar each = _require.each;\n\tvar copy = _require.copy;\n\tvar getCheckerDisplay = _require.getCheckerDisplay;\n\tvar isError = _require.isError;\n\tvar arrayify = _require.arrayify;\n\tvar list = _require.list;\n\tvar getError = _require.getError;\n\tvar nAtL = _require.nAtL;\n\tvar t = _require.t;\n\tvar checkerHelpers = _require.checkerHelpers;\n\tvar undef = _require.undef;\n\tvar setupChecker = checkerHelpers.setupChecker;\n\n\tvar checkers = module.exports = getCheckers();\n\tmodule.exports.getCheckers = getCheckers;\n\n\tfunction getCheckers(disabled) {\n\t return {\n\t array: typeOfCheckGetter('Array'),\n\t bool: typeOfCheckGetter('Boolean'),\n\t number: typeOfCheckGetter('Number'),\n\t string: typeOfCheckGetter('String'),\n\t func: funcCheckGetter(),\n\t object: objectCheckGetter(),\n\n\t emptyObject: emptyObjectCheckGetter(),\n\n\t instanceOf: instanceCheckGetter,\n\t oneOf: oneOfCheckGetter,\n\t oneOfType: oneOfTypeCheckGetter,\n\n\t arrayOf: arrayOfCheckGetter,\n\t objectOf: objectOfCheckGetter,\n\t typeOrArrayOf: typeOrArrayOfCheckGetter,\n\n\t range: rangeCheckGetter,\n\t lessThan: lessThanCheckGetter,\n\t greaterThan: greaterThanCheckGetter,\n\n\t shape: getShapeCheckGetter(),\n\t args: argumentsCheckerGetter(),\n\n\t any: anyCheckGetter(),\n\t 'null': nullCheckGetter()\n\n\t };\n\n\t function typeOfCheckGetter(type) {\n\t var lType = type.toLowerCase();\n\t return setupChecker(function typeOfCheckerDefinition(val, name, location) {\n\t if (typeOf(val) !== lType) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function funcCheckGetter() {\n\t var type = 'Function';\n\t var functionChecker = setupChecker(function functionCheckerDefinition(val, name, location) {\n\t if (typeOf(val) !== 'function') {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\n\t functionChecker.withProperties = function getWithPropertiesChecker(properties) {\n\t var apiError = checkers.objectOf(checkers.func)(properties, 'properties', 'apiCheck.func.withProperties');\n\t if (isError(apiError)) {\n\t throw apiError;\n\t }\n\t var shapeChecker = checkers.shape(properties, true);\n\t shapeChecker.type.__apiCheckData.type = 'func.withProperties';\n\n\t return setupChecker(function functionWithPropertiesChecker(val, name, location) {\n\t var notFunction = checkers.func(val, name, location);\n\t if (isError(notFunction)) {\n\t return notFunction;\n\t }\n\t return shapeChecker(val, name, location);\n\t }, { type: shapeChecker.type, shortType: 'func.withProperties' }, disabled);\n\t };\n\t return functionChecker;\n\t }\n\n\t function objectCheckGetter() {\n\t var type = 'Object';\n\t var nullType = 'Object (null ok)';\n\t var objectNullOkChecker = setupChecker(function objectNullOkCheckerDefinition(val, name, location) {\n\t if (typeOf(val) !== 'object') {\n\t return getError(name, location, nullType);\n\t }\n\t }, { type: nullType }, disabled);\n\n\t var objectChecker = setupChecker(function objectCheckerDefinition(val, name, location) {\n\t if (val === null || isError(objectNullOkChecker(val, name, location))) {\n\t return getError(name, location, objectChecker.type);\n\t }\n\t }, { type: type, nullOk: objectNullOkChecker }, disabled);\n\n\t return objectChecker;\n\t }\n\n\t function instanceCheckGetter(classToCheck) {\n\t return setupChecker(function instanceCheckerDefinition(val, name, location) {\n\t if (!(val instanceof classToCheck)) {\n\t return getError(name, location, classToCheck.name);\n\t }\n\t }, { type: classToCheck.name }, disabled);\n\t }\n\n\t function oneOfCheckGetter(enums) {\n\t var type = {\n\t __apiCheckData: { optional: false, type: 'enum' },\n\t 'enum': enums\n\t };\n\t var shortType = 'oneOf[' + enums.map(function (enm) {\n\t return stringify(enm);\n\t }).join(', ') + ']';\n\t return setupChecker(function oneOfCheckerDefinition(val, name, location) {\n\t if (!enums.some(function (enm) {\n\t return enm === val;\n\t })) {\n\t return getError(name, location, shortType);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t }\n\n\t function oneOfTypeCheckGetter(typeCheckers) {\n\t var checkersDisplay = typeCheckers.map(function (checker) {\n\t return getCheckerDisplay(checker, { short: true });\n\t });\n\t var shortType = 'oneOfType[' + checkersDisplay.join(', ') + ']';\n\t function type(options) {\n\t if (options && options.short) {\n\t return shortType;\n\t }\n\t return typeCheckers.map(function (checker) {\n\t return getCheckerDisplay(checker, options);\n\t });\n\t }\n\t type.__apiCheckData = { optional: false, type: 'oneOfType' };\n\t return setupChecker(function oneOfTypeCheckerDefinition(val, name, location) {\n\t if (!typeCheckers.some(function (checker) {\n\t return !isError(checker(val, name, location));\n\t })) {\n\t return getError(name, location, shortType);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t }\n\n\t function arrayOfCheckGetter(checker) {\n\t var shortCheckerDisplay = getCheckerDisplay(checker, { short: true });\n\t var shortType = 'arrayOf[' + shortCheckerDisplay + ']';\n\n\t function type(options) {\n\t if (options && options.short) {\n\t return shortType;\n\t }\n\t return getCheckerDisplay(checker, options);\n\t }\n\t type.__apiCheckData = { optional: false, type: 'arrayOf' };\n\n\t return setupChecker(function arrayOfCheckerDefinition(val, name, location) {\n\t if (isError(checkers.array(val)) || !val.every(function (item) {\n\t return !isError(checker(item));\n\t })) {\n\t return getError(name, location, shortType);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t }\n\n\t function objectOfCheckGetter(checker) {\n\t var checkerDisplay = getCheckerDisplay(checker, { short: true });\n\t var shortType = 'objectOf[' + checkerDisplay + ']';\n\n\t function type(options) {\n\t if (options && options.short) {\n\t return shortType;\n\t }\n\t return getCheckerDisplay(checker, options);\n\t }\n\t type.__apiCheckData = { optional: false, type: 'objectOf' };\n\n\t return setupChecker(function objectOfCheckerDefinition(val, name, location) {\n\t var notObject = checkers.object(val, name, location);\n\t if (isError(notObject)) {\n\t return notObject;\n\t }\n\t var allTypesSuccess = each(val, function (item, key) {\n\t if (isError(checker(item, key, name))) {\n\t return false;\n\t }\n\t });\n\t if (!allTypesSuccess) {\n\t return getError(name, location, shortType);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t }\n\n\t function typeOrArrayOfCheckGetter(checker) {\n\t var checkerDisplay = getCheckerDisplay(checker, { short: true });\n\t var shortType = 'typeOrArrayOf[' + checkerDisplay + ']';\n\n\t function type(options) {\n\t if (options && options.short) {\n\t return shortType;\n\t }\n\t return getCheckerDisplay(checker, options);\n\t }\n\n\t type.__apiCheckData = { optional: false, type: 'typeOrArrayOf' };\n\t return setupChecker(function typeOrArrayOfDefinition(val, name, location, obj) {\n\t if (isError(checkers.oneOfType([checker, checkers.arrayOf(checker)])(val, name, location, obj))) {\n\t return getError(name, location, shortType);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t }\n\n\t function getShapeCheckGetter() {\n\t function shapeCheckGetter(shape, nonObject) {\n\t var shapeTypes = {};\n\t each(shape, function (checker, prop) {\n\t shapeTypes[prop] = getCheckerDisplay(checker);\n\t });\n\t function type() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t var ret = {};\n\t var terse = options.terse;\n\t var obj = options.obj;\n\t var addHelpers = options.addHelpers;\n\n\t var parentRequired = options.required;\n\t each(shape, function (checker, prop) {\n\t /* eslint complexity:[2, 6] */\n\t var specified = obj && obj.hasOwnProperty(prop);\n\t var required = undef(parentRequired) ? !checker.isOptional : parentRequired;\n\t if (!terse || (specified || !checker.isOptional)) {\n\t ret[prop] = getCheckerDisplay(checker, { terse: terse, obj: obj && obj[prop], required: required, addHelpers: addHelpers });\n\t }\n\t if (addHelpers) {\n\t modifyTypeDisplayToHelpOut(ret, prop, specified, checker, required);\n\t }\n\t });\n\t return ret;\n\n\t function modifyTypeDisplayToHelpOut(theRet, prop, specified, checker, required) {\n\t if (!specified && required && !checker.isOptional) {\n\t var item = 'ITEM';\n\t if (checker.type && checker.type.__apiCheckData) {\n\t item = checker.type.__apiCheckData.type.toUpperCase();\n\t }\n\t addHelper('missing', 'MISSING THIS ' + item, ' <-- YOU ARE MISSING THIS');\n\t } else if (specified) {\n\t var error = checker(obj[prop], prop, null, obj);\n\t if (isError(error)) {\n\t addHelper('error', 'THIS IS THE PROBLEM: ' + error.message, ' <-- THIS IS THE PROBLEM: ' + error.message);\n\t }\n\t }\n\n\t function addHelper(property, objectMessage, stringMessage) {\n\t if (typeof theRet[prop] === 'string') {\n\t theRet[prop] += stringMessage;\n\t } else {\n\t theRet[prop].__apiCheckData[property] = objectMessage;\n\t }\n\t }\n\t }\n\t }\n\n\t type.__apiCheckData = { strict: false, optional: false, type: 'shape' };\n\t var shapeChecker = setupChecker(function shapeCheckerDefinition(val, name, location) {\n\t /* eslint complexity:[2, 6] */\n\t var isObject = !nonObject && checkers.object(val, name, location);\n\t if (isError(isObject)) {\n\t return isObject;\n\t }\n\t var shapePropError = undefined;\n\t location = location ? location + (name ? '/' : '') : '';\n\t name = name || '';\n\t each(shape, function (checker, prop) {\n\t if (val.hasOwnProperty(prop) || !checker.isOptional) {\n\t shapePropError = checker(val[prop], prop, '' + location + name, val);\n\t return !isError(shapePropError);\n\t }\n\t });\n\t if (isError(shapePropError)) {\n\t return shapePropError;\n\t }\n\t }, { type: type, shortType: 'shape' }, disabled);\n\n\t function strictType() {\n\t return type.apply(undefined, arguments);\n\t }\n\n\t strictType.__apiCheckData = copy(shapeChecker.type.__apiCheckData);\n\t strictType.__apiCheckData.strict = true;\n\t shapeChecker.strict = setupChecker(function strictShapeCheckerDefinition(val, name, location) {\n\t var shapeError = shapeChecker(val, name, location);\n\t if (isError(shapeError)) {\n\t return shapeError;\n\t }\n\t var allowedProperties = Object.keys(shape);\n\t var extraProps = Object.keys(val).filter(function (prop) {\n\t return allowedProperties.indexOf(prop) === -1;\n\t });\n\t if (extraProps.length) {\n\t return new Error(nAtL(name, location) + ' cannot have extra properties: ' + t(extraProps.join('`, `')) + '.' + ('It is limited to ' + t(allowedProperties.join('`, `'))));\n\t }\n\t }, { type: strictType, shortType: 'strict shape' }, disabled);\n\n\t return shapeChecker;\n\t }\n\n\t shapeCheckGetter.ifNot = function ifNot(otherProps, propChecker) {\n\t if (!Array.isArray(otherProps)) {\n\t otherProps = [otherProps];\n\t }\n\t var description = undefined;\n\t if (otherProps.length === 1) {\n\t description = 'specified only if ' + otherProps[0] + ' is not specified';\n\t } else {\n\t description = 'specified only if none of the following are specified: [' + list(otherProps, ', ', 'and ') + ']';\n\t }\n\t var shortType = 'ifNot[' + otherProps.join(', ') + ']';\n\t var type = getTypeForShapeChild(propChecker, description, shortType);\n\t return setupChecker(function ifNotChecker(prop, propName, location, obj) {\n\t var propExists = obj && obj.hasOwnProperty(propName);\n\t var otherPropsExist = otherProps.some(function (otherProp) {\n\t return obj && obj.hasOwnProperty(otherProp);\n\t });\n\t if (propExists === otherPropsExist) {\n\t return getError(propName, location, type);\n\t } else if (propExists) {\n\t return propChecker(prop, propName, location, obj);\n\t }\n\t }, { notRequired: true, type: type, shortType: shortType }, disabled);\n\t };\n\n\t shapeCheckGetter.onlyIf = function onlyIf(otherProps, propChecker) {\n\t otherProps = arrayify(otherProps);\n\t var description = undefined;\n\t if (otherProps.length === 1) {\n\t description = 'specified only if ' + otherProps[0] + ' is also specified';\n\t } else {\n\t description = 'specified only if all of the following are specified: [' + list(otherProps, ', ', 'and ') + ']';\n\t }\n\t var shortType = 'onlyIf[' + otherProps.join(', ') + ']';\n\t var type = getTypeForShapeChild(propChecker, description, shortType);\n\t return setupChecker(function onlyIfCheckerDefinition(prop, propName, location, obj) {\n\t var othersPresent = otherProps.every(function (property) {\n\t return obj.hasOwnProperty(property);\n\t });\n\t if (!othersPresent) {\n\t return getError(propName, location, type);\n\t } else {\n\t return propChecker(prop, propName, location, obj);\n\t }\n\t }, { type: type, shortType: shortType }, disabled);\n\t };\n\n\t shapeCheckGetter.requiredIfNot = function shapeRequiredIfNot(otherProps, propChecker) {\n\t if (!Array.isArray(otherProps)) {\n\t otherProps = [otherProps];\n\t }\n\t return getRequiredIfNotChecker(false, otherProps, propChecker);\n\t };\n\n\t shapeCheckGetter.requiredIfNot.all = function shapeRequiredIfNotAll(otherProps, propChecker) {\n\t if (!Array.isArray(otherProps)) {\n\t throw new Error('requiredIfNot.all must be passed an array');\n\t }\n\t return getRequiredIfNotChecker(true, otherProps, propChecker);\n\t };\n\n\t function getRequiredIfNotChecker(all, otherProps, propChecker) {\n\t var props = t(otherProps.join(', '));\n\t var ifProps = 'if ' + (all ? 'all of' : 'at least one of');\n\t var description = 'specified ' + ifProps + ' these are not specified: ' + props + ' (otherwise it\\'s optional)';\n\t var shortType = 'requiredIfNot' + (all ? '.all' : '') + '[' + otherProps.join(', ') + '}]';\n\t var type = getTypeForShapeChild(propChecker, description, shortType);\n\t return setupChecker(function shapeRequiredIfNotDefinition(prop, propName, location, obj) {\n\t var propExists = obj && obj.hasOwnProperty(propName);\n\t var iteration = all ? 'every' : 'some';\n\t var otherPropsExist = otherProps[iteration](function (otherProp) {\n\t return obj && obj.hasOwnProperty(otherProp);\n\t });\n\t if (!otherPropsExist && !propExists) {\n\t return getError(propName, location, type);\n\t } else if (propExists) {\n\t return propChecker(prop, propName, location, obj);\n\t }\n\t }, { type: type, notRequired: true }, disabled);\n\t }\n\n\t return shapeCheckGetter;\n\n\t function getTypeForShapeChild(propChecker, description, shortType) {\n\t function type(options) {\n\t if (options && options.short) {\n\t return shortType;\n\t }\n\t return getCheckerDisplay(propChecker);\n\t }\n\t type.__apiCheckData = { optional: false, type: 'ifNot', description: description };\n\t return type;\n\t }\n\t }\n\n\t function argumentsCheckerGetter() {\n\t var type = 'function arguments';\n\t return setupChecker(function argsCheckerDefinition(val, name, location) {\n\t if (Array.isArray(val) || isError(checkers.object(val)) || isError(checkers.number(val.length))) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function anyCheckGetter() {\n\t return setupChecker(function anyCheckerDefinition() {\n\t // don't do anything\n\t }, { type: 'any' }, disabled);\n\t }\n\n\t function nullCheckGetter() {\n\t var type = 'null';\n\t return setupChecker(function nullChecker(val, name, location) {\n\t if (val !== null) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function rangeCheckGetter(min, max) {\n\t var type = 'Range (' + min + ' - ' + max + ')';\n\t return setupChecker(function rangeChecker(val, name, location) {\n\t if (typeof val !== 'number' || val < min || val > max) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function lessThanCheckGetter(min) {\n\t var type = 'lessThan[' + min + ']';\n\t return setupChecker(function lessThanChecker(val, name, location) {\n\t if (typeof val !== 'number' || val > min) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function greaterThanCheckGetter(max) {\n\t var type = 'greaterThan[' + max + ']';\n\t return setupChecker(function greaterThanChecker(val, name, location) {\n\t if (typeof val !== 'number' || val < max) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\n\t function emptyObjectCheckGetter() {\n\t var type = 'empty object';\n\t return setupChecker(function emptyObjectChecker(val, name, location) {\n\t if (typeOf(val) !== 'object' || val === null || Object.keys(val).length) {\n\t return getError(name, location, type);\n\t }\n\t }, { type: type }, disabled);\n\t }\n\t}\n\n/***/ }\n/******/ ])\n});\n;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9+L2FwaS1jaGVjay9kaXN0L2FwaS1jaGVjay5qcz83ZWE5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7QUFDRCxvQ0FBb0M7QUFDcEM7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsdUJBQXVCO0FBQ3ZCO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7QUFHQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsVUFBVTtBQUNWO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxFQUFFOztBQUVGLHVDQUF1Qyx1Q0FBdUMsa0JBQWtCOztBQUVoRzs7QUFFQTs7QUFFQTtBQUNBOztBQUVBLE9BQU87QUFDUDtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsWUFBWTtBQUNaLEVBQUU7QUFDRjs7QUFFQTtBQUNBO0FBQ0EsRUFBRTs7QUFFRjtBQUNBLHdFQUF3RTtBQUN4RSwrRUFBK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ZXR1cm4gZ2V0RXJyb3IobmFtZSwgbG9jYXRpb24sIHR5cGUpO1xuXHQgICAgICB9XG5cdCAgICB9LCB7IHR5cGU6IHR5cGUgfSwgZGlzYWJsZWQpO1xuXHQgIH1cblxuXHQgIGZ1bmN0aW9uIGVtcHR5T2JqZWN0Q2hlY2tHZXR0ZXIoKSB7XG5cdCAgICB2YXIgdHlwZSA9ICdlbXB0eSBvYmplY3QnO1xuXHQgICAgcmV0dXJuIHNldHVwQ2hlY2tlcihmdW5jdGlvbiBlbXB0eU9iamVjdENoZWNrZXIodmFsLCBuYW1lLCBsb2NhdGlvbikge1xuXHQgICAgICBpZiAodHlwZU9mKHZhbCkgIT09ICdvYmplY3QnIHx8IHZhbCA9PT0gbnVsbCB8fCBPYmplY3Qua2V5cyh2YWwpLmxlbmd0aCkge1xuXHQgICAgICAgIHJldHVybiBnZXRFcnJvcihuYW1lLCBsb2NhdGlvbiwgdHlwZSk7XG5cdCAgICAgIH1cblx0ICAgIH0sIHsgdHlwZTogdHlwZSB9LCBkaXNhYmxlZCk7XG5cdCAgfVxuXHR9XG5cbi8qKiovIH1cbi8qKioqKiovIF0pXG59KTtcbjtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL34vYXBpLWNoZWNrL2Rpc3QvYXBpLWNoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0="); /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { eval("// angular-formly version 6.8.2 built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò)\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(2), __webpack_require__(4));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"api-check\", \"angular\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ngFormly\"] = factory(require(\"api-check\"), require(\"angular\"));\n\telse\n\t\troot[\"ngFormly\"] = factory(root[\"apiCheck\"], root[\"angular\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_16__, __WEBPACK_EXTERNAL_MODULE_17__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar index = _interopRequire(__webpack_require__(1));\n\n\tmodule.exports = index;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tvar formlyApiCheck = _interopRequire(__webpack_require__(2));\n\n\tvar formlyErrorAndWarningsUrlPrefix = _interopRequire(__webpack_require__(3));\n\n\tvar formlyUsability = _interopRequire(__webpack_require__(4));\n\n\tvar formlyConfig = _interopRequire(__webpack_require__(5));\n\n\tvar formlyValidationMessages = _interopRequire(__webpack_require__(6));\n\n\tvar formlyUtil = _interopRequire(__webpack_require__(7));\n\n\tvar formlyWarn = _interopRequire(__webpack_require__(8));\n\n\tvar formlyCustomValidation = _interopRequire(__webpack_require__(9));\n\n\tvar formlyField = _interopRequire(__webpack_require__(10));\n\n\tvar formlyFocus = _interopRequire(__webpack_require__(11));\n\n\tvar formlyForm = _interopRequire(__webpack_require__(12));\n\n\tvar formlyNgModelAttrsManipulator = _interopRequire(__webpack_require__(13));\n\n\tvar formlyCustomTags = _interopRequire(__webpack_require__(14));\n\n\tvar ngModuleName = \"formly\";\n\n\tmodule.exports = ngModuleName;\n\n\tvar ngModule = angular.module(ngModuleName, []);\n\n\tngModule.constant(\"formlyApiCheck\", formlyApiCheck);\n\tngModule.constant(\"formlyErrorAndWarningsUrlPrefix\", formlyErrorAndWarningsUrlPrefix);\n\tngModule.constant(\"formlyVersion\", (\"6.8.2\")); // <-- webpack variable\n\n\tngModule.provider(\"formlyUsability\", formlyUsability);\n\tngModule.provider(\"formlyConfig\", formlyConfig);\n\n\tngModule.factory(\"formlyValidationMessages\", formlyValidationMessages);\n\tngModule.factory(\"formlyUtil\", formlyUtil);\n\tngModule.factory(\"formlyWarn\", formlyWarn);\n\n\tngModule.directive(\"formlyCustomValidation\", formlyCustomValidation);\n\tngModule.directive(\"formlyField\", formlyField);\n\tngModule.directive(\"formlyFocus\", formlyFocus);\n\tngModule.directive(\"formlyForm\", formlyForm);\n\n\tngModule.run(formlyNgModelAttrsManipulator);\n\tngModule.run(formlyCustomTags);\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar apiCheckFactory = _interopRequire(__webpack_require__(16));\n\n\tvar apiCheck = apiCheckFactory({\n\t output: {\n\t prefix: \"angular-formly:\",\n\t docsBaseUrl: __webpack_require__(3)\n\t }\n\t});\n\n\tfunction shapeRequiredIfNot(otherProps, propChecker) {\n\t if (!angular.isArray(otherProps)) {\n\t otherProps = [otherProps];\n\t }\n\t var type = \"specified if these are not specified: `\" + otherProps.join(\", \") + \"` (otherwise it's optional)\";\n\t function shapeRequiredIfNotDefinition(prop, propName, location, obj) {\n\t var propExists = obj && obj.hasOwnProperty(propName);\n\t var otherPropsExist = otherProps.some(function (otherProp) {\n\t return obj && obj.hasOwnProperty(otherProp);\n\t });\n\t if (!otherPropsExist && !propExists) {\n\t return apiCheck.utils.getError(propName, location, type);\n\t } else if (propExists) {\n\t return propChecker(prop, propName, location, obj);\n\t }\n\t }\n\t shapeRequiredIfNotDefinition.type = type;\n\t return apiCheck.utils.checkerHelpers.setupChecker(shapeRequiredIfNotDefinition);\n\t}\n\n\tvar formlyExpression = apiCheck.oneOfType([apiCheck.string, apiCheck.func]);\n\tvar specifyWrapperType = apiCheck.oneOfType([apiCheck.oneOf([null]), apiCheck.typeOrArrayOf(apiCheck.string)]);\n\n\tvar apiCheckProperty = apiCheck.objectOf(apiCheck.func);\n\n\tvar apiCheckInstanceProperty = apiCheck.shape.onlyIf(\"apiCheck\", apiCheck.func.withProperties({\n\t warn: apiCheck.func,\n\t \"throw\": apiCheck.func,\n\t shape: apiCheck.func\n\t}));\n\n\tvar apiCheckFunctionProperty = apiCheck.shape.onlyIf(\"apiCheck\", apiCheck.oneOf([\"throw\", \"warn\"]));\n\n\tvar formlyWrapperType = apiCheck.shape({\n\t name: shapeRequiredIfNot(\"types\", apiCheck.string).optional,\n\t template: apiCheck.shape.ifNot(\"templateUrl\", apiCheck.string).optional,\n\t templateUrl: apiCheck.shape.ifNot(\"template\", apiCheck.string).optional,\n\t types: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n\t overwriteOk: apiCheck.bool.optional,\n\t validateOptions: apiCheck.func.optional,\n\t apiCheck: apiCheckProperty.optional,\n\t apiCheckInstance: apiCheckInstanceProperty.optional,\n\t apiCheckFunction: apiCheckFunctionProperty.optional,\n\t apiCheckOptions: apiCheck.object.optional\n\t}).strict;\n\n\tvar expressionProperties = apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n\t expression: formlyExpression,\n\t message: formlyExpression.optional\n\t}).strict]));\n\n\tvar modelChecker = apiCheck.oneOfType([apiCheck.oneOf([\"formState\"]), apiCheck.object]);\n\n\tvar fieldOptionsApiShape = {\n\t $$hashKey: apiCheck.any.optional,\n\t type: apiCheck.shape.ifNot([\"template\", \"templateUrl\"], apiCheck.string).optional,\n\t template: apiCheck.shape.ifNot([\"type\", \"templateUrl\"], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t templateUrl: apiCheck.shape.ifNot([\"type\", \"template\"], apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t key: apiCheck.oneOfType([apiCheck.string, apiCheck.number]).optional,\n\t model: modelChecker.optional,\n\t className: apiCheck.string.optional,\n\t id: apiCheck.string.optional,\n\t expressionProperties: expressionProperties.optional,\n\t data: apiCheck.object.optional,\n\t templateOptions: apiCheck.object.optional,\n\t wrapper: specifyWrapperType.optional,\n\t modelOptions: apiCheck.shape({\n\t updateOn: apiCheck.string.optional,\n\t debounce: apiCheck.oneOfType([apiCheck.objectOf(apiCheck.number), apiCheck.number]).optional,\n\t allowInvalid: apiCheck.bool.optional,\n\t getterSetter: apiCheck.bool.optional,\n\t timezone: apiCheck.string.optional\n\t }).optional,\n\t watcher: apiCheck.typeOrArrayOf(apiCheck.shape({\n\t expression: formlyExpression.optional,\n\t listener: formlyExpression\n\t })).optional,\n\t validators: apiCheck.objectOf(apiCheck.oneOfType([formlyExpression, apiCheck.shape({\n\t expression: formlyExpression,\n\t message: formlyExpression.optional\n\t }).strict])).optional,\n\t noFormControl: apiCheck.bool.optional,\n\t hide: apiCheck.bool.optional,\n\t hideExpression: formlyExpression.optional,\n\t ngModelAttrs: apiCheck.objectOf(apiCheck.shape({\n\t expression: apiCheck.shape.ifNot([\"value\", \"attribute\", \"bound\"], apiCheck.any).optional,\n\t value: apiCheck.shape.ifNot(\"expression\", apiCheck.any).optional,\n\t attribute: apiCheck.shape.ifNot(\"expression\", apiCheck.any).optional,\n\t bound: apiCheck.shape.ifNot(\"expression\", apiCheck.any).optional\n\t }).strict).optional,\n\t elementAttributes: apiCheck.objectOf(apiCheck.string).optional,\n\t optionsTypes: apiCheck.typeOrArrayOf(apiCheck.string).optional,\n\t link: apiCheck.func.optional,\n\t controller: apiCheck.oneOfType([apiCheck.string, apiCheck.func, apiCheck.array]).optional,\n\t validation: apiCheck.shape({\n\t show: apiCheck.oneOfType([apiCheck.bool, apiCheck.oneOf([null])]).optional,\n\t messages: apiCheck.objectOf(formlyExpression).optional,\n\t errorExistsAndShouldBeVisible: apiCheck.bool.optional\n\t }).optional,\n\t formControl: apiCheck.object.optional,\n\t value: apiCheck.func.optional,\n\t runExpressions: apiCheck.func.optional,\n\t resetModel: apiCheck.func.optional,\n\t updateInitialValue: apiCheck.func.optional,\n\t initialValue: apiCheck.any.optional,\n\t defaultValue: apiCheck.any.optional\n\t};\n\n\tvar formlyFieldOptions = apiCheck.shape(fieldOptionsApiShape).strict;\n\n\tvar formOptionsApi = apiCheck.shape({\n\t formState: apiCheck.object.optional,\n\t resetModel: apiCheck.func.optional,\n\t updateInitialValue: apiCheck.func.optional,\n\t removeChromeAutoComplete: apiCheck.bool.optional\n\t}).strict;\n\n\tvar fieldGroup = apiCheck.shape({\n\t $$hashKey: apiCheck.any.optional,\n\t // danger. Nested field groups wont get api-checked...\n\t fieldGroup: apiCheck.arrayOf(apiCheck.oneOfType([formlyFieldOptions, apiCheck.object])),\n\t className: apiCheck.string.optional,\n\t options: formOptionsApi.optional,\n\t hide: apiCheck.bool.optional,\n\t hideExpression: formlyExpression.optional,\n\t model: modelChecker.optional,\n\t form: apiCheck.object.optional,\n\t elementAttributes: apiCheck.objectOf(apiCheck.string).optional\n\t}).strict;\n\n\tvar typeOptionsDefaultOptions = angular.copy(fieldOptionsApiShape);\n\ttypeOptionsDefaultOptions.key = apiCheck.string.optional;\n\n\tvar formlyTypeOptions = apiCheck.shape({\n\t name: apiCheck.string,\n\t template: apiCheck.shape.ifNot(\"templateUrl\", apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t templateUrl: apiCheck.shape.ifNot(\"template\", apiCheck.oneOfType([apiCheck.string, apiCheck.func])).optional,\n\t controller: apiCheck.oneOfType([apiCheck.func, apiCheck.string, apiCheck.array]).optional,\n\t link: apiCheck.func.optional,\n\t defaultOptions: apiCheck.oneOfType([apiCheck.func, apiCheck.shape(typeOptionsDefaultOptions)]).optional,\n\t \"extends\": apiCheck.string.optional,\n\t wrapper: specifyWrapperType.optional,\n\t data: apiCheck.object.optional,\n\t validateOptions: apiCheck.func.optional,\n\t apiCheck: apiCheckProperty.optional,\n\t apiCheckInstance: apiCheckInstanceProperty.optional,\n\t apiCheckFunction: apiCheckFunctionProperty.optional,\n\t apiCheckOptions: apiCheck.object.optional,\n\t overwriteOk: apiCheck.bool.optional\n\t}).strict;\n\tangular.extend(apiCheck, {\n\t formlyTypeOptions: formlyTypeOptions, formlyFieldOptions: formlyFieldOptions, formlyExpression: formlyExpression, formlyWrapperType: formlyWrapperType, fieldGroup: fieldGroup, formOptionsApi: formOptionsApi\n\t});\n\n\tmodule.exports = apiCheck;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tmodule.exports = \"https://github.com/formly-js/angular-formly/blob/\" + (\"6.8.2\") + \"/other/ERRORS_AND_WARNINGS.md#\";\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tmodule.exports = formlyUsability;\n\n\t// @ngInject\n\tfunction formlyUsability(formlyApiCheck, formlyErrorAndWarningsUrlPrefix) {\n\t var _this = this;\n\n\t angular.extend(this, {\n\t getFormlyError: getFormlyError,\n\t getFieldError: getFieldError,\n\t checkWrapper: checkWrapper,\n\t checkWrapperTemplate: checkWrapperTemplate,\n\t $get: function () {\n\t return _this;\n\t }\n\t });\n\n\t function getFieldError(errorInfoSlug, message, field) {\n\t if (arguments.length < 3) {\n\t field = message;\n\t message = errorInfoSlug;\n\t errorInfoSlug = null;\n\t }\n\t return new Error(getErrorMessage(errorInfoSlug, message) + (\" Field definition: \" + angular.toJson(field)));\n\t }\n\n\t function getFormlyError(errorInfoSlug, message) {\n\t if (!message) {\n\t message = errorInfoSlug;\n\t errorInfoSlug = null;\n\t }\n\t return new Error(getErrorMessage(errorInfoSlug, message));\n\t }\n\n\t function getErrorMessage(errorInfoSlug, message) {\n\t var url = \"\";\n\t if (errorInfoSlug !== null) {\n\t url = \"\" + formlyErrorAndWarningsUrlPrefix + \"\" + errorInfoSlug;\n\t }\n\t return \"Formly Error: \" + message + \". \" + url;\n\t }\n\n\t function checkWrapper(wrapper) {\n\t formlyApiCheck[\"throw\"](formlyApiCheck.formlyWrapperType, wrapper, {\n\t prefix: \"formlyConfig.setWrapper\",\n\t urlSuffix: \"setwrapper-validation-failed\"\n\t });\n\t }\n\n\t function checkWrapperTemplate(template, additionalInfo) {\n\t var formlyTransclude = \"\";\n\t if (template.indexOf(formlyTransclude) === -1) {\n\t throw getFormlyError(\"Template wrapper templates must use \\\"\" + formlyTransclude + \"\\\" somewhere in them. \" + (\"This one does not have \\\"\\\" in it: \" + template) + \"\\n\" + (\"Additional information: \" + JSON.stringify(additionalInfo)));\n\t }\n\t }\n\t}\n\tformlyUsability.$inject = [\"formlyApiCheck\", \"formlyErrorAndWarningsUrlPrefix\"];\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tvar utils = _interopRequire(__webpack_require__(18));\n\n\tmodule.exports = formlyConfig;\n\n\t// @ngInject\n\tfunction formlyConfig(formlyUsabilityProvider, formlyApiCheck) {\n\t var _this2 = this;\n\n\t var typeMap = {};\n\t var templateWrappersMap = {};\n\t var defaultWrapperName = \"default\";\n\t var _this = this;\n\t var getError = formlyUsabilityProvider.getFormlyError;\n\n\t angular.extend(this, {\n\t setType: setType,\n\t getType: getType,\n\t setWrapper: setWrapper,\n\t getWrapper: getWrapper,\n\t getWrapperByType: getWrapperByType,\n\t removeWrapperByName: removeWrapperByName,\n\t removeWrappersForType: removeWrappersForType,\n\t disableWarnings: false,\n\t extras: {\n\t disableNgModelAttrsManipulator: false,\n\t ngModelAttrsManipulatorPreferUnbound: false,\n\t removeChromeAutoComplete: false,\n\t defaultHideDirective: \"ng-if\",\n\t getFieldId: null\n\t },\n\t templateManipulators: {\n\t preWrapper: [],\n\t postWrapper: []\n\t },\n\t $get: function () {\n\t return _this2;\n\t }\n\t });\n\n\t function setType(options) {\n\t if (angular.isArray(options)) {\n\t angular.forEach(options, setType);\n\t } else if (angular.isObject(options)) {\n\t checkType(options);\n\t if (options[\"extends\"]) {\n\t extendTypeOptions(options);\n\t }\n\t typeMap[options.name] = options;\n\t } else {\n\t throw getError(\"You must provide an object or array for setType. You provided: \" + JSON.stringify(arguments));\n\t }\n\t }\n\n\t function checkType(options) {\n\t formlyApiCheck[\"throw\"](formlyApiCheck.formlyTypeOptions, options, {\n\t prefix: \"formlyConfig.setType\",\n\t url: \"settype-validation-failed\"\n\t });\n\t if (!options.overwriteOk) {\n\t checkOverwrite(options.name, typeMap, options, \"types\");\n\t } else {\n\t options.overwriteOk = undefined;\n\t }\n\t }\n\n\t function extendTypeOptions(options) {\n\t var extendsType = getType(options[\"extends\"], true, options);\n\t extendTypeControllerFunction(options, extendsType);\n\t extendTypeLinkFunction(options, extendsType);\n\t extendTypeValidateOptionsFunction(options, extendsType);\n\t extendTypeDefaultOptions(options, extendsType);\n\t utils.reverseDeepMerge(options, extendsType);\n\t extendTemplate(options, extendsType);\n\t }\n\n\t function extendTemplate(options, extendsType) {\n\t if (options.template && extendsType.templateUrl) {\n\t delete options.templateUrl;\n\t } else if (options.templateUrl && extendsType.template) {\n\t delete options.template;\n\t }\n\t }\n\n\t function extendTypeControllerFunction(options, extendsType) {\n\t var extendsCtrl = extendsType.controller;\n\t if (!angular.isDefined(extendsCtrl)) {\n\t return;\n\t }\n\t var optionsCtrl = options.controller;\n\t if (angular.isDefined(optionsCtrl)) {\n\t options.controller = function ($scope, $controller) {\n\t $controller(extendsCtrl, { $scope: $scope });\n\t $controller(optionsCtrl, { $scope: $scope });\n\t };\n\t options.controller.$inject = [\"$scope\", \"$controller\"];\n\t } else {\n\t options.controller = extendsCtrl;\n\t }\n\t }\n\n\t function extendTypeLinkFunction(options, extendsType) {\n\t var extendsFn = extendsType.link;\n\t if (!angular.isDefined(extendsFn)) {\n\t return;\n\t }\n\t var optionsFn = options.link;\n\t if (angular.isDefined(optionsFn)) {\n\t options.link = function () {\n\t extendsFn.apply(undefined, arguments);\n\t optionsFn.apply(undefined, arguments);\n\t };\n\t } else {\n\t options.link = extendsFn;\n\t }\n\t }\n\n\t function extendTypeValidateOptionsFunction(options, extendsType) {\n\t var extendsFn = extendsType.validateOptions;\n\t if (!angular.isDefined(extendsFn)) {\n\t return;\n\t }\n\t var optionsFn = options.validateOptions;\n\t var originalDefaultOptions = options.defaultOptions;\n\t if (angular.isDefined(optionsFn)) {\n\t options.validateOptions = function (options) {\n\t optionsFn(options);\n\t var mergedOptions = angular.copy(options);\n\t var defaultOptions = originalDefaultOptions;\n\t if (defaultOptions) {\n\t if (angular.isFunction(defaultOptions)) {\n\t defaultOptions = defaultOptions(mergedOptions);\n\t }\n\t utils.reverseDeepMerge(mergedOptions, defaultOptions);\n\t }\n\t extendsFn(mergedOptions);\n\t };\n\t } else {\n\t options.validateOptions = extendsFn;\n\t }\n\t }\n\n\t function extendTypeDefaultOptions(options, extendsType) {\n\t var extendsDO = extendsType.defaultOptions;\n\t if (!angular.isDefined(extendsDO)) {\n\t return;\n\t }\n\t var optionsDO = options.defaultOptions;\n\t var optionsDOIsFn = angular.isFunction(optionsDO);\n\t var extendsDOIsFn = angular.isFunction(extendsDO);\n\t if (extendsDOIsFn) {\n\t options.defaultOptions = function defaultOptions(options) {\n\t var extendsDefaultOptions = extendsDO(options);\n\t var mergedDefaultOptions = {};\n\t utils.reverseDeepMerge(mergedDefaultOptions, options, extendsDefaultOptions);\n\t var extenderOptionsDefaultOptions = optionsDO;\n\t if (optionsDOIsFn) {\n\t extenderOptionsDefaultOptions = extenderOptionsDefaultOptions(mergedDefaultOptions);\n\t }\n\t utils.reverseDeepMerge(extendsDefaultOptions, extenderOptionsDefaultOptions);\n\t return extendsDefaultOptions;\n\t };\n\t } else if (optionsDOIsFn) {\n\t options.defaultOptions = function defaultOptions(options) {\n\t var newDefaultOptions = {};\n\t utils.reverseDeepMerge(newDefaultOptions, options, extendsDO);\n\t return optionsDO(newDefaultOptions);\n\t };\n\t }\n\t }\n\n\t function getType(name, throwError, errorContext) {\n\t if (!name) {\n\t return undefined;\n\t }\n\t var type = typeMap[name];\n\t if (!type && throwError === true) {\n\t throw getError(\"There is no type by the name of \\\"\" + name + \"\\\": \" + JSON.stringify(errorContext));\n\t } else {\n\t return type;\n\t }\n\t }\n\n\t function setWrapper(_x, _x2) {\n\t var _again = true;\n\n\t _function: while (_again) {\n\t _again = false;\n\t var options = _x,\n\t name = _x2;\n\n\t if (angular.isArray(options)) {\n\t return options.map(function (wrapperOptions) {\n\t return setWrapper(wrapperOptions);\n\t });\n\t } else if (angular.isObject(options)) {\n\t options.types = getOptionsTypes(options);\n\t options.name = getOptionsName(options, name);\n\t checkWrapperAPI(options);\n\t templateWrappersMap[options.name] = options;\n\t return options;\n\t } else if (angular.isString(options)) {\n\t _x = {\n\t template: options,\n\t name: name\n\t };\n\t _again = true;\n\t continue _function;\n\t }\n\t }\n\t }\n\n\t function getOptionsTypes(options) {\n\t if (angular.isString(options.types)) {\n\t return [options.types];\n\t }\n\t if (!angular.isDefined(options.types)) {\n\t return [];\n\t } else {\n\t return options.types;\n\t }\n\t }\n\n\t function getOptionsName(options, name) {\n\t return options.name || name || options.types.join(\" \") || defaultWrapperName;\n\t }\n\n\t function checkWrapperAPI(options) {\n\t formlyUsabilityProvider.checkWrapper(options);\n\t if (options.template) {\n\t formlyUsabilityProvider.checkWrapperTemplate(options.template, options);\n\t }\n\t if (!options.overwriteOk) {\n\t checkOverwrite(options.name, templateWrappersMap, options, \"templateWrappers\");\n\t } else {\n\t delete options.overwriteOk;\n\t }\n\t checkWrapperTypes(options);\n\t }\n\n\t function checkWrapperTypes(options) {\n\t var shouldThrow = !angular.isArray(options.types) || !options.types.every(angular.isString);\n\t if (shouldThrow) {\n\t throw getError(\"Attempted to create a template wrapper with types that is not a string or an array of strings\");\n\t }\n\t }\n\n\t function checkOverwrite(property, object, newValue, objectName) {\n\t if (object.hasOwnProperty(property)) {\n\t warn([\"Attempting to overwrite \" + property + \" on \" + objectName + \" which is currently\", \"\" + JSON.stringify(object[property]) + \" with \" + JSON.stringify(newValue), \"To supress this warning, specify the property \\\"overwriteOk: true\\\"\"].join(\" \"));\n\t }\n\t }\n\n\t function getWrapper(name) {\n\t return templateWrappersMap[name || defaultWrapperName];\n\t }\n\n\t function getWrapperByType(type) {\n\t /* jshint maxcomplexity:6 */\n\t var wrappers = [];\n\t for (var name in templateWrappersMap) {\n\t if (templateWrappersMap.hasOwnProperty(name)) {\n\t if (templateWrappersMap[name].types && templateWrappersMap[name].types.indexOf(type) !== -1) {\n\t wrappers.push(templateWrappersMap[name]);\n\t }\n\t }\n\t }\n\t return wrappers;\n\t }\n\n\t function removeWrapperByName(name) {\n\t var wrapper = templateWrappersMap[name];\n\t delete templateWrappersMap[name];\n\t return wrapper;\n\t }\n\n\t function removeWrappersForType(type) {\n\t var wrappers = getWrapperByType(type);\n\t if (!wrappers) {\n\t return;\n\t }\n\t if (!angular.isArray(wrappers)) {\n\t return removeWrapperByName(wrappers.name);\n\t } else {\n\t wrappers.forEach(function (wrapper) {\n\t return removeWrapperByName(wrapper.name);\n\t });\n\t return wrappers;\n\t }\n\t }\n\n\t function warn() {\n\t if (!_this.disableWarnings) {\n\t console.warn.apply(console, arguments);\n\t }\n\t }\n\t}\n\tformlyConfig.$inject = [\"formlyUsabilityProvider\", \"formlyApiCheck\"];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tmodule.exports = formlyValidationMessages;\n\n\t// @ngInject\n\tfunction formlyValidationMessages() {\n\n\t var validationMessages = {\n\t addTemplateOptionValueMessage: addTemplateOptionValueMessage,\n\t addStringMessage: addStringMessage,\n\t messages: {}\n\t };\n\n\t return validationMessages;\n\n\t function addTemplateOptionValueMessage(name, prop, prefix, suffix, alternate) {\n\t validationMessages.messages[name] = templateOptionValue(prop, prefix, suffix, alternate);\n\t }\n\n\t function addStringMessage(name, string) {\n\t validationMessages.messages[name] = function () {\n\t return string;\n\t };\n\t }\n\n\t function templateOptionValue(prop, prefix, suffix, alternate) {\n\t return function getValidationMessage(viewValue, modelValue, scope) {\n\t if (scope.options.templateOptions[prop]) {\n\t return \"\" + prefix + \" \" + scope.options.templateOptions[prop] + \" \" + suffix;\n\t } else {\n\t return alternate;\n\t }\n\t };\n\t }\n\t}\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar utils = _interopRequire(__webpack_require__(18));\n\n\tmodule.exports = formlyUtil;\n\n\t// @ngInject\n\tfunction formlyUtil() {\n\t return utils;\n\t}\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };\n\n\tmodule.exports = formlyWarn;\n\n\t// @ngInject\n\tfunction formlyWarn(formlyConfig, formlyErrorAndWarningsUrlPrefix, $log) {\n\t return function warn() {\n\t if (!formlyConfig.disableWarnings) {\n\t var args = Array.prototype.slice.call(arguments);\n\t var warnInfoSlug = args.shift();\n\t args.unshift(\"Formly Warning:\");\n\t args.push(\"\" + formlyErrorAndWarningsUrlPrefix + \"\" + warnInfoSlug);\n\t $log.warn.apply($log, _toConsumableArray(args));\n\t }\n\t };\n\t}\n\tformlyWarn.$inject = [\"formlyConfig\", \"formlyErrorAndWarningsUrlPrefix\", \"$log\"];\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tmodule.exports = formlyCustomValidation;\n\n\t// @ngInject\n\tfunction formlyCustomValidation(formlyUtil, $q) {\n\t return {\n\t restrict: \"A\",\n\t require: \"ngModel\",\n\t link: function formlyCustomValidationLink(scope, el, attrs, ctrl) {\n\t var opts = scope.options;\n\t if (opts.validators) {\n\t checkValidators(opts.validators);\n\t }\n\t opts.validation.messages = opts.validation.messages || {};\n\t angular.forEach(opts.validation.messages, function (message, key) {\n\t opts.validation.messages[key] = function () {\n\t return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n\t };\n\t });\n\n\t var useNewValidatorsApi = ctrl.hasOwnProperty(\"$validators\") && !attrs.hasOwnProperty(\"useParsers\");\n\t angular.forEach(opts.validators, function addValidatorToPipeline(validator, name) {\n\t var message = validator.message;\n\t if (message) {\n\t opts.validation.messages[name] = function () {\n\t return formlyUtil.formlyEval(scope, message, ctrl.$modelValue, ctrl.$viewValue);\n\t };\n\t }\n\t validator = angular.isObject(validator) ? validator.expression : validator;\n\t var isPossiblyAsync = !angular.isString(validator);\n\t if (useNewValidatorsApi) {\n\t setupWithValidators();\n\t } else {\n\t setupWithParsers();\n\t }\n\n\t function setupWithValidators() {\n\t var validatorCollection = isPossiblyAsync ? \"$asyncValidators\" : \"$validators\";\n\t ctrl[validatorCollection][name] = function evalValidity(modelValue, viewValue) {\n\t var value = formlyUtil.formlyEval(scope, validator, modelValue, viewValue);\n\t if (isPossiblyAsync) {\n\t return isPromiseLike(value) ? value : value ? $q.when(value) : $q.reject(value);\n\t } else {\n\t return value;\n\t }\n\t };\n\t }\n\n\t function setupWithParsers() {\n\t var inFlightValidator = undefined;\n\t ctrl.$parsers.unshift(function evalValidityOfParser(viewValue) {\n\t var isValid = formlyUtil.formlyEval(scope, validator, ctrl.$modelValue, viewValue);\n\t if (isPromiseLike(isValid)) {\n\t ctrl.$pending = ctrl.$pending || {};\n\t ctrl.$pending[name] = true;\n\t inFlightValidator = isValid;\n\t isValid.then(function () {\n\t if (inFlightValidator === isValid) {\n\t ctrl.$setValidity(name, true);\n\t }\n\t })[\"catch\"](function () {\n\t if (inFlightValidator === isValid) {\n\t ctrl.$setValidity(name, false);\n\t }\n\t })[\"finally\"](function () {\n\t if (Object.keys(ctrl.$pending).length === 1) {\n\t delete ctrl.$pending;\n\t } else {\n\t delete ctrl.$pending[name];\n\t }\n\t });\n\t } else {\n\t ctrl.$setValidity(name, isValid);\n\t }\n\t return viewValue;\n\t });\n\t }\n\t });\n\t }\n\t };\n\n\t function isPromiseLike(obj) {\n\t return obj && angular.isFunction(obj.then);\n\t }\n\n\t function checkValidators(validators) {\n\t var allowedProperties = [\"expression\", \"message\"];\n\t var validatorsWithExtraProps = {};\n\t angular.forEach(validators, function (validator, name) {\n\t if (angular.isString(validator)) {\n\t return;\n\t }\n\t var extraProps = [];\n\t angular.forEach(validator, function (v, key) {\n\t if (allowedProperties.indexOf(key) === -1) {\n\t extraProps.push(key);\n\t }\n\t });\n\t if (extraProps.length) {\n\t validatorsWithExtraProps[name] = extraProps;\n\t }\n\t });\n\t if (Object.keys(validatorsWithExtraProps).length) {\n\t throw new Error([\"Validators are only allowed to be functions or objects that have \" + allowedProperties.join(\", \") + \".\", \"You provided some extra properties: \" + JSON.stringify(validatorsWithExtraProps)].join(\" \"));\n\t }\n\t }\n\t}\n\tformlyCustomValidation.$inject = [\"formlyUtil\", \"$q\"];\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tmodule.exports = formlyField;\n\n\t/**\n\t * @ngdoc directive\n\t * @name formlyField\n\t * @restrict AE\n\t */\n\t// @ngInject\n\tfunction formlyField($http, $q, $compile, $templateCache, formlyConfig, formlyValidationMessages, formlyApiCheck, formlyUtil, formlyUsability, formlyWarn) {\n\t var arrayify = formlyUtil.arrayify;\n\n\t FormlyFieldController.$inject = [\"$scope\", \"$timeout\", \"$parse\", \"$controller\"];\n\t return {\n\t restrict: \"AE\",\n\t transclude: true,\n\t scope: {\n\t options: \"=\",\n\t model: \"=\",\n\t formId: \"@\", // TODO remove formId in a breaking release\n\t index: \"=?\",\n\t fields: \"=?\",\n\t formState: \"=?\",\n\t form: \"=?\" // TODO require form in a breaking release\n\t },\n\t controller: FormlyFieldController,\n\t link: fieldLink\n\t };\n\n\t // @ngInject\n\t function FormlyFieldController($scope, $timeout, $parse, $controller) {\n\t /* jshint maxstatements:31 */\n\t if ($scope.options.fieldGroup) {\n\t setupFieldGroup();\n\t return;\n\t }\n\n\t var fieldType = getFieldType($scope.options);\n\t simplifyLife($scope.options);\n\t mergeFieldOptionsWithTypeDefaults($scope.options, fieldType);\n\t extendOptionsWithDefaults($scope.options, $scope.index);\n\t checkApi($scope.options);\n\t // set field id to link labels and fields\n\n\t // initalization\n\t setFieldId();\n\t setDefaultValue();\n\t setInitialValue();\n\t runExpressions();\n\t addModelWatcher($scope, $scope.options);\n\t addValidationMessages($scope.options);\n\t invokeControllers($scope, $scope.options, fieldType);\n\n\t // function definitions\n\t function runExpressions() {\n\t // must run on next tick to make sure that the current value is correct.\n\t $timeout(function runExpressionsOnNextTick() {\n\t var field = $scope.options;\n\t var currentValue = valueGetterSetter();\n\t angular.forEach(field.expressionProperties, function runExpression(expression, prop) {\n\t var setter = $parse(prop).assign;\n\t var promise = $q.when(formlyUtil.formlyEval($scope, expression, currentValue));\n\t promise.then(function setFieldValue(value) {\n\t setter(field, value);\n\t });\n\t });\n\t });\n\t }\n\n\t function valueGetterSetter(newVal) {\n\t if (!$scope.model || !$scope.options.key) {\n\t return;\n\t }\n\t if (angular.isDefined(newVal)) {\n\t $scope.model[$scope.options.key] = newVal;\n\t }\n\t return $scope.model[$scope.options.key];\n\t }\n\n\t function simplifyLife(options) {\n\t // add a few empty objects (if they don't already exist) so you don't have to undefined check everywhere\n\t formlyUtil.reverseDeepMerge(options, {\n\t data: {},\n\t templateOptions: {},\n\t validation: {}\n\t });\n\t // create $scope.to so template authors can reference to instead of $scope.options.templateOptions\n\t $scope.to = $scope.options.templateOptions;\n\t }\n\n\t function setFieldId() {\n\t if (angular.isFunction(formlyConfig.extras.getFieldId)) {\n\t $scope.id = formlyConfig.extras.getFieldId($scope.options, $scope.model, $scope);\n\t } else {\n\t var formName = $scope.form && $scope.form.$name || $scope.formId;\n\t $scope.id = formlyUtil.getFieldId(formName, $scope.options, $scope.index);\n\t }\n\t $scope.options.id = $scope.id;\n\t }\n\n\t function setDefaultValue() {\n\t if (angular.isDefined($scope.options.defaultValue) && !angular.isDefined($scope.model[$scope.options.key])) {\n\t $scope.model[$scope.options.key] = $scope.options.defaultValue;\n\t }\n\t }\n\n\t function setInitialValue() {\n\t $scope.options.initialValue = $scope.model && $scope.model[$scope.options.key];\n\t }\n\n\t function mergeFieldOptionsWithTypeDefaults(options, type) {\n\t if (type) {\n\t mergeOptions(options, type.defaultOptions);\n\t }\n\t var properOrder = arrayify(options.optionsTypes).reverse(); // so the right things are overridden\n\t angular.forEach(properOrder, function (typeName) {\n\t mergeOptions(options, formlyConfig.getType(typeName, true, options).defaultOptions);\n\t });\n\t }\n\n\t function mergeOptions(options, extraOptions) {\n\t if (extraOptions) {\n\t if (angular.isFunction(extraOptions)) {\n\t extraOptions = extraOptions(options);\n\t }\n\t formlyUtil.reverseDeepMerge(options, extraOptions);\n\t }\n\t }\n\n\t function extendOptionsWithDefaults(options, index) {\n\t var key = options.key || index || 0;\n\t angular.extend(options, {\n\t // attach the key in case the formly-field directive is used directly\n\t key: key,\n\t value: valueGetterSetter,\n\t runExpressions: runExpressions,\n\t resetModel: resetModel,\n\t updateInitialValue: updateInitialValue\n\t });\n\t }\n\n\t // initialization functions\n\t function addModelWatcher(scope, options) {\n\t if (options.model) {\n\t scope.$watch(\"options.model\", runExpressions, true);\n\t }\n\t }\n\n\t function resetModel() {\n\t $scope.model[$scope.options.key] = $scope.options.initialValue;\n\t if ($scope.options.formControl) {\n\t $scope.options.formControl.$setViewValue($scope.model[$scope.options.key]);\n\t $scope.options.formControl.$render();\n\t $scope.options.formControl.$setUntouched();\n\t $scope.options.formControl.$setPristine();\n\t }\n\t }\n\n\t function updateInitialValue() {\n\t $scope.options.initialValue = $scope.model[$scope.options.key];\n\t }\n\n\t function addValidationMessages(options) {\n\t options.validation.messages = options.validation.messages || {};\n\t angular.forEach(formlyValidationMessages.messages, function createFunctionForMessage(expression, name) {\n\t if (!options.validation.messages[name]) {\n\t options.validation.messages[name] = function evaluateMessage(viewValue, modelValue, scope) {\n\t return formlyUtil.formlyEval(scope, expression, modelValue, viewValue);\n\t };\n\t }\n\t });\n\t }\n\n\t function invokeControllers(scope) {\n\t var options = arguments[1] === undefined ? {} : arguments[1];\n\t var type = arguments[2] === undefined ? {} : arguments[2];\n\n\t angular.forEach([type.controller, options.controller], function (controller) {\n\t if (controller) {\n\t $controller(controller, { $scope: scope });\n\t }\n\t });\n\t }\n\n\t function setupFieldGroup() {\n\t $scope.options.options = $scope.options.options || {};\n\t $scope.options.options.formState = $scope.formState;\n\t }\n\t }\n\n\t // link function\n\t function fieldLink(scope, el) {\n\t if (scope.options.fieldGroup) {\n\t setFieldGroupTemplate();\n\t return;\n\t }\n\n\t addAttributes();\n\t addClasses();\n\n\t var type = getFieldType(scope.options);\n\t var args = arguments;\n\t var thusly = this;\n\t getFieldTemplate(scope.options).then(runManipulators(formlyConfig.templateManipulators.preWrapper)).then(transcludeInWrappers(scope.options)).then(runManipulators(formlyConfig.templateManipulators.postWrapper)).then(setElementTemplate).then(watchFormControl).then(callLinkFunctions)[\"catch\"](function (error) {\n\t formlyWarn(\"there-was-a-problem-setting-the-template-for-this-field\", \"There was a problem setting the template for this field \", scope.options, error);\n\t });\n\n\t function setFieldGroupTemplate() {\n\t checkFieldGroupApi(scope.options);\n\t el.addClass(\"formly-field-group\");\n\t var extraAttributes = \"\";\n\t if (scope.options.elementAttributes) {\n\t extraAttributes = Object.keys(scope.options.elementAttributes).map(function (key) {\n\t return \"\" + key + \"=\\\"\" + scope.options.elementAttributes[key] + \"\\\"\";\n\t }).join(\" \");\n\t }\n\t setElementTemplate(\"\\n \\n \\n \");\n\t }\n\n\t function addAttributes() {\n\t if (scope.options.elementAttributes) {\n\t el.attr(scope.options.elementAttributes);\n\t }\n\t }\n\n\t function addClasses() {\n\t if (scope.options.className) {\n\t el.addClass(scope.options.className);\n\t }\n\t if (scope.options.type) {\n\t el.addClass(\"formly-field-\" + scope.options.type);\n\t }\n\t }\n\n\t function setElementTemplate(templateString) {\n\t el.html(asHtml(templateString));\n\t $compile(el.contents())(scope);\n\t return templateString;\n\t }\n\n\t function watchFormControl(templateString) {\n\t var stopWatchingField = angular.noop;\n\t var stopWatchingShowError = angular.noop;\n\t if (scope.options.noFormControl) {\n\t return;\n\t }\n\t var templateEl = angular.element(\"
\" + templateString + \"
\");\n\t var ngModelNode = templateEl[0].querySelector(\"[ng-model],[data-ng-model]\");\n\t if (ngModelNode && ngModelNode.getAttribute(\"name\")) {\n\t watchFieldNameOrExistence(ngModelNode.getAttribute(\"name\"));\n\t }\n\n\t function watchFieldNameOrExistence(name) {\n\t var nameExpressionRegex = /\\{\\{(.*?)}}/;\n\t var nameExpression = nameExpressionRegex.exec(name);\n\t if (nameExpression) {\n\t watchFieldName(nameExpression[1]);\n\t } else {\n\t watchFieldExistence(name);\n\t }\n\t }\n\n\t function watchFieldName(expression) {\n\t scope.$watch(expression, function oneFieldNameChange(name) {\n\t if (name) {\n\t stopWatchingField();\n\t watchFieldExistence(name);\n\t }\n\t });\n\t }\n\n\t function watchFieldExistence(name) {\n\t stopWatchingField = scope.$watch(\"form[\\\"\" + name + \"\\\"]\", function formControlChange(formControl) {\n\t if (formControl) {\n\t scope.fc = formControl; // shortcut for template authors\n\t scope.options.formControl = formControl;\n\t stopWatchingShowError();\n\t addShowMessagesWatcher();\n\t }\n\t });\n\t }\n\n\t function addShowMessagesWatcher() {\n\t stopWatchingShowError = scope.$watch(function watchShowValidationChange() {\n\t var customExpression = formlyConfig.extras.errorExistsAndShouldBeVisibleExpression;\n\t var options = scope.options;\n\t var fc = scope.fc;\n\n\t if (!fc.$invalid) {\n\t return false;\n\t } else if (typeof options.validation.show === \"boolean\") {\n\t return options.validation.show;\n\t } else if (customExpression) {\n\t return formlyUtil.formlyEval(scope, customExpression, fc.$modelValue, fc.$viewValue);\n\t } else {\n\t var noTouchedButDirty = angular.isUndefined(fc.$touched) && fc.$dirty;\n\t return scope.fc.$touched || noTouchedButDirty;\n\t }\n\t }, function onShowValidationChange(show) {\n\t scope.options.validation.errorExistsAndShouldBeVisible = show;\n\t scope.showError = show; // shortcut for template authors\n\t });\n\t }\n\t }\n\n\t function callLinkFunctions() {\n\t if (type && type.link) {\n\t type.link.apply(thusly, args);\n\t }\n\t if (scope.options.link) {\n\t scope.options.link.apply(thusly, args);\n\t }\n\t }\n\n\t function runManipulators(manipulators) {\n\t return function runManipulatorsOnTemplate(template) {\n\t var chain = $q.when(template);\n\t angular.forEach(manipulators, function (manipulator) {\n\t chain = chain.then(function (template) {\n\t return $q.when(manipulator(template, scope.options, scope)).then(function (newTemplate) {\n\t return angular.isString(newTemplate) ? newTemplate : asHtml(newTemplate);\n\t });\n\t });\n\t });\n\t return chain;\n\t };\n\t }\n\t }\n\n\t // stateless util functions\n\t function asHtml(el) {\n\t var wrapper = angular.element(\"\");\n\t return wrapper.append(el).html();\n\t }\n\n\t function getFieldType(options) {\n\t return options.type && formlyConfig.getType(options.type);\n\t }\n\n\t function getFieldTemplate(options) {\n\t function fromOptionsOrType(key, type) {\n\t if (angular.isDefined(options[key])) {\n\t return options[key];\n\t } else if (type && angular.isDefined(type[key])) {\n\t return type[key];\n\t }\n\t }\n\n\t var type = formlyConfig.getType(options.type, true, options);\n\t var template = fromOptionsOrType(\"template\", type);\n\t var templateUrl = fromOptionsOrType(\"templateUrl\", type);\n\t if (angular.isUndefined(template) && !templateUrl) {\n\t throw formlyUsability.getFieldError(\"type-type-has-no-template\", \"Type '\" + options.type + \"' has not template. On element:\", options);\n\t }\n\n\t return getTemplate(templateUrl || template, angular.isUndefined(template), options);\n\t }\n\n\t function getTemplate(template, isUrl, options) {\n\t var templatePromise = undefined;\n\t if (angular.isFunction(template)) {\n\t templatePromise = $q.when(template(options));\n\t } else {\n\t templatePromise = $q.when(template);\n\t }\n\n\t if (!isUrl) {\n\t return templatePromise;\n\t } else {\n\t var _ret = (function () {\n\t var httpOptions = { cache: $templateCache };\n\t return {\n\t v: templatePromise.then(function (url) {\n\t return $http.get(url, httpOptions);\n\t }).then(function (response) {\n\t return response.data;\n\t })[\"catch\"](function handleErrorGettingATemplate(error) {\n\t formlyWarn(\"problem-loading-template-for-templateurl\", \"Problem loading template for \" + template, error);\n\t })\n\t };\n\t })();\n\n\t if (typeof _ret === \"object\") {\n\t return _ret.v;\n\t }\n\t }\n\t }\n\n\t function transcludeInWrappers(options) {\n\t var wrapper = getWrapperOption(options);\n\n\t return function transcludeTemplate(template) {\n\t if (!wrapper.length) {\n\t return $q.when(template);\n\t }\n\n\t wrapper.forEach(function (wrapper) {\n\t formlyUsability.checkWrapper(wrapper, options);\n\t wrapper.validateOptions && wrapper.validateOptions(options);\n\t runApiCheck(wrapper, options);\n\t });\n\t var promises = wrapper.map(function (w) {\n\t return getTemplate(w.template || w.templateUrl, !w.template);\n\t });\n\t return $q.all(promises).then(function (wrappersTemplates) {\n\t wrappersTemplates.forEach(function (wrapperTemplate, index) {\n\t formlyUsability.checkWrapperTemplate(wrapperTemplate, wrapper[index]);\n\t });\n\t wrappersTemplates.reverse(); // wrapper 0 is wrapped in wrapper 1 and so on...\n\t var totalWrapper = wrappersTemplates.shift();\n\t wrappersTemplates.forEach(function (wrapperTemplate) {\n\t totalWrapper = doTransclusion(totalWrapper, wrapperTemplate);\n\t });\n\t return doTransclusion(totalWrapper, template);\n\t });\n\t };\n\t }\n\n\t function doTransclusion(wrapper, template) {\n\t var superWrapper = angular.element(\"\"); // this allows people not have to have a single root in wrappers\n\t superWrapper.append(wrapper);\n\t var transcludeEl = superWrapper.find(\"formly-transclude\");\n\t if (!transcludeEl.length) {\n\t //try it using our custom find function\n\t transcludeEl = formlyUtil.findByNodeName(superWrapper, \"formly-transclude\");\n\t }\n\t transcludeEl.replaceWith(template);\n\t return superWrapper.html();\n\t }\n\n\t function getWrapperOption(options) {\n\t var wrapper = options.wrapper;\n\t // explicit null means no wrapper\n\t if (wrapper === null) {\n\t return [];\n\t }\n\n\t // nothing specified means use the default wrapper for the type\n\t if (!wrapper) {\n\t // get all wrappers that specify they apply to this type\n\t wrapper = arrayify(formlyConfig.getWrapperByType(options.type));\n\t } else {\n\t wrapper = arrayify(wrapper).map(formlyConfig.getWrapper);\n\t }\n\n\t // get all wrappers for that this type specified that it uses.\n\t var type = formlyConfig.getType(options.type, true, options);\n\t if (type && type.wrapper) {\n\t var typeWrappers = arrayify(type.wrapper).map(formlyConfig.getWrapper);\n\t wrapper = wrapper.concat(typeWrappers);\n\t }\n\n\t // add the default wrapper last\n\t var defaultWrapper = formlyConfig.getWrapper();\n\t if (defaultWrapper) {\n\t wrapper.push(defaultWrapper);\n\t }\n\t return wrapper;\n\t }\n\n\t function checkApi(options) {\n\t formlyApiCheck[\"throw\"](formlyApiCheck.formlyFieldOptions, options, {\n\t prefix: \"formly-field directive\",\n\t url: \"formly-field-directive-validation-failed\"\n\t });\n\t // validate with the type\n\t var type = options.type && formlyConfig.getType(options.type);\n\t if (type) {\n\t if (type.validateOptions) {\n\t type.validateOptions(options);\n\t }\n\t runApiCheck(type, options);\n\t }\n\t }\n\n\t function checkFieldGroupApi(options) {\n\t formlyApiCheck[\"throw\"](formlyApiCheck.fieldGroup, options, {\n\t prefix: \"formly-field directive\",\n\t url: \"formly-field-directive-validation-failed\"\n\t });\n\t }\n\n\t function runApiCheck(_ref, options) {\n\t var apiCheck = _ref.apiCheck;\n\t var apiCheckInstance = _ref.apiCheckInstance;\n\t var apiCheckFunction = _ref.apiCheckFunction;\n\t var apiCheckOptions = _ref.apiCheckOptions;\n\n\t if (!apiCheck) {\n\t return;\n\t }\n\t var instance = apiCheckInstance || formlyApiCheck;\n\t var fn = apiCheckFunction || \"warn\";\n\t var shape = instance.shape(apiCheck);\n\t instance[fn](shape, options, apiCheckOptions || {\n\t prefix: \"formly-field \" + name,\n\t url: formlyApiCheck.config.output.docsBaseUrl + \"formly-field-type-apicheck-failed\"\n\t });\n\t }\n\t}\n\tformlyField.$inject = [\"$http\", \"$q\", \"$compile\", \"$templateCache\", \"formlyConfig\", \"formlyValidationMessages\", \"formlyApiCheck\", \"formlyUtil\", \"formlyUsability\", \"formlyWarn\"];\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tmodule.exports = formlyFocus;\n\n\t// @ngInject\n\tfunction formlyFocus($timeout, $document) {\n\t /* jshint -W052 */\n\t return {\n\t restrict: \"A\",\n\t link: function formlyFocusLink(scope, element, attrs) {\n\t var previousEl = null;\n\t var el = element[0];\n\t var doc = $document[0];\n\t attrs.$observe(\"formlyFocus\", function respondToFocusExpressionChange(value) {\n\t if (value === \"true\") {\n\t $timeout(function setElementFocus() {\n\t previousEl = doc.activeElement;\n\t el.focus();\n\t }, ~ ~attrs.focusWait);\n\t } else if (value === \"false\") {\n\t if (doc.activeElement === el) {\n\t el.blur();\n\t if (attrs.hasOwnProperty(\"refocus\") && previousEl) {\n\t previousEl.focus();\n\t }\n\t }\n\t }\n\t });\n\t }\n\t };\n\t}\n\tformlyFocus.$inject = [\"$timeout\", \"$document\"];\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };\n\n\tvar _slice = Array.prototype.slice;\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tmodule.exports = formlyForm;\n\n\t/**\n\t * @ngdoc directive\n\t * @name formlyForm\n\t * @restrict E\n\t */\n\t// @ngInject\n\tfunction formlyForm(formlyUsability, $parse, formlyApiCheck, formlyConfig) {\n\t var currentFormId = 1;\n\t return {\n\t restrict: \"E\",\n\t template: function formlyFormGetTemplate(el, attrs) {\n\t /* jshint -W033 */ // this because jshint is broken I guess...\n\t var rootEl = getRootEl();\n\t var fieldRootEl = getFieldRootEl();\n\t var formId = \"formly_\" + currentFormId++;\n\t var parentFormAttributes = \"\";\n\t if (attrs.hasOwnProperty(\"isFieldGroup\") && el.parent().parent().hasClass(\"formly\")) {\n\t parentFormAttributes = copyAttributes(el.parent().parent()[0].attributes);\n\t }\n\t return \"\\n <\" + rootEl + \" class=\\\"formly\\\"\\n name=\\\"\" + getFormName() + \"\\\"\\n role=\\\"form\\\" \" + parentFormAttributes + \">\\n <\" + fieldRootEl + \" formly-field\\n ng-repeat=\\\"field in fields \" + getTrackBy() + \"\\\"\\n \" + getHideDirective() + \"=\\\"!field.hide\\\"\\n class=\\\"formly-field\\\"\\n options=\\\"field\\\"\\n model=\\\"field.model || model\\\"\\n fields=\\\"fields\\\"\\n form=\\\"theFormlyForm\\\"\\n form-id=\\\"\" + getFormName() + \"\\\"\\n form-state=\\\"options.formState\\\"\\n index=\\\"$index\\\">\\n \\n
\\n \\n \";\n\n\t function getRootEl() {\n\t return attrs.rootEl || \"ng-form\";\n\t }\n\n\t function getFieldRootEl() {\n\t return attrs.fieldRootEl || \"div\";\n\t }\n\n\t function getHideDirective() {\n\t return attrs.hideDirective || formlyConfig.extras.defaultHideDirective || \"ng-if\";\n\t }\n\n\t function getTrackBy() {\n\t if (!attrs.trackBy) {\n\t return \"\";\n\t } else {\n\t return \"track by \" + attrs.trackBy;\n\t }\n\t }\n\n\t function getFormName() {\n\t var formName = formId;\n\t var bindName = attrs.bindName;\n\t if (bindName) {\n\t if (angular.version.minor < 3) {\n\t throw formlyUsability.getFormlyError(\"bind-name attribute on formly-form not allowed in > angular 1.3\");\n\t }\n\t // we can do a one-time binding here because we know we're in 1.3.x territory\n\t formName = \"{{::'formly_' + \" + bindName + \"}}\";\n\t }\n\t return formName;\n\t }\n\n\t function copyAttributes(attributes) {\n\t var excluded = [\"model\", \"form\", \"fields\", \"options\", \"name\", \"role\", \"class\"];\n\t var arrayAttrs = [];\n\t angular.forEach(attributes, function (_ref) {\n\t var nodeName = _ref.nodeName;\n\t var nodeValue = _ref.nodeValue;\n\n\t if (nodeName !== \"undefined\" && excluded.indexOf(nodeName) === -1) {\n\t arrayAttrs.push(\"\" + toKebabCase(nodeName) + \"=\\\"\" + nodeValue + \"\\\"\");\n\t }\n\t });\n\t return arrayAttrs.join(\" \");\n\t }\n\n\t function toKebabCase(string) {\n\t if (string) {\n\t return string.replace(/([A-Z])/g, function ($1) {\n\t return \"-\" + $1.toLowerCase();\n\t });\n\t } else {\n\t return \"\";\n\t }\n\t }\n\t },\n\t replace: true,\n\t transclude: true,\n\t scope: {\n\t fields: \"=\",\n\t model: \"=\",\n\t form: \"=?\",\n\t options: \"=?\"\n\t },\n\t controller: /* @ngInject */[\"$scope\", \"formlyUtil\", function FormlyFormController($scope, formlyUtil) {\n\t setupOptions();\n\t $scope.model = $scope.model || {};\n\t $scope.fields = $scope.fields || [];\n\n\t angular.forEach($scope.fields, initModel); // initializes the model property if set to 'formState'\n\t angular.forEach($scope.fields, attachKey); // attaches a key based on the index if a key isn't specified\n\t angular.forEach($scope.fields, setupWatchers); // setup watchers for all fields\n\n\t // watch the model and evaluate watch expressions that depend on it.\n\t $scope.$watch(\"model\", onModelOrFormStateChange, true);\n\t if ($scope.options.formState) {\n\t $scope.$watch(\"options.formState\", onModelOrFormStateChange, true);\n\t }\n\n\t function onModelOrFormStateChange() {\n\t angular.forEach($scope.fields, function runFieldExpressionProperties(field, index) {\n\t /*jshint -W030 */\n\t var model = field.model || $scope.model;\n\t field.runExpressions && field.runExpressions(model);\n\t if (field.hideExpression) {\n\t // can't use hide with expressionProperties reliably\n\t var val = model[field.key];\n\t // this makes it closer to what a regular expressionProperty would be\n\t var extraLocals = {\n\t options: field,\n\t index: index,\n\t formState: $scope.options.formState,\n\t formId: $scope.formId\n\t };\n\t field.hide = formlyUtil.formlyEval($scope, field.hideExpression, val, val, extraLocals);\n\t }\n\t });\n\t }\n\n\t function setupOptions() {\n\t formlyApiCheck[\"throw\"]([formlyApiCheck.formOptionsApi.optional], [$scope.options], { prefix: \"formly-form options check\" });\n\t $scope.options = $scope.options || {};\n\t $scope.options.formState = $scope.options.formState || {};\n\n\t angular.extend($scope.options, {\n\t updateInitialValue: updateInitialValue,\n\t resetModel: resetModel\n\t });\n\t }\n\n\t function updateInitialValue() {\n\t angular.forEach($scope.fields, function (field) {\n\t if (isFieldGroup(field)) {\n\t field.options.updateInitialValue();\n\t } else {\n\t field.updateInitialValue();\n\t }\n\t });\n\t }\n\n\t function resetModel() {\n\t angular.forEach($scope.fields, function (field) {\n\t if (isFieldGroup(field)) {\n\t field.options.resetModel();\n\t } else {\n\t field.resetModel();\n\t }\n\t });\n\t }\n\n\t function initModel(field) {\n\t if (field.model && field.model === \"formState\") {\n\t field.model = $scope.options.formState;\n\t }\n\t }\n\n\t function attachKey(field, index) {\n\t if (!isFieldGroup(field)) {\n\t field.key = field.key || index || 0;\n\t }\n\t }\n\n\t function setupWatchers(field, index) {\n\t if (isFieldGroup(field) || !angular.isDefined(field.watcher)) {\n\t return;\n\t }\n\t var watchers = field.watcher;\n\t if (!angular.isArray(watchers)) {\n\t watchers = [watchers];\n\t }\n\t angular.forEach(watchers, function setupWatcher(watcher) {\n\t if (!angular.isDefined(watcher.listener)) {\n\t throw formlyUsability.getFieldError(\"all-field-watchers-must-have-a-listener\", \"All field watchers must have a listener\", field);\n\t }\n\t var watchExpression = getWatchExpression(watcher, field, index);\n\t var watchListener = getWatchListener(watcher, field, index);\n\n\t var type = watcher.type || \"$watch\";\n\t watcher.stopWatching = $scope[type](watchExpression, watchListener, watcher.watchDeep);\n\t });\n\t }\n\n\t function getWatchExpression(watcher, field, index) {\n\t var watchExpression = watcher.expression || \"model['\" + field.key + \"']\";\n\t if (angular.isFunction(watchExpression)) {\n\t // wrap the field's watch expression so we can call it with the field as the first arg\n\t // and the stop function as the last arg as a helper\n\t var originalExpression = watchExpression;\n\t watchExpression = function formlyWatchExpression() {\n\t var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t return originalExpression.apply(undefined, _toConsumableArray(args));\n\t };\n\t watchExpression.displayName = \"Formly Watch Expression for field for \" + field.key;\n\t }\n\t return watchExpression;\n\t }\n\n\t function getWatchListener(watcher, field, index) {\n\t var watchListener = watcher.listener;\n\t if (angular.isFunction(watchListener)) {\n\t // wrap the field's watch listener so we can call it with the field as the first arg\n\t // and the stop function as the last arg as a helper\n\t var originalListener = watchListener;\n\t watchListener = function formlyWatchListener() {\n\t var args = modifyArgs.apply(undefined, [watcher, index].concat(_slice.call(arguments)));\n\t return originalListener.apply(undefined, _toConsumableArray(args));\n\t };\n\t watchListener.displayName = \"Formly Watch Listener for field for \" + field.key;\n\t }\n\t return watchListener;\n\t }\n\n\t function modifyArgs(watcher, index) {\n\t for (var _len = arguments.length, originalArgs = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n\t originalArgs[_key - 2] = arguments[_key];\n\t }\n\n\t return [$scope.fields[index]].concat(originalArgs, [watcher.stopWatching]);\n\t }\n\n\t function isFieldGroup(field) {\n\t return field && !!field.fieldGroup;\n\t }\n\t }],\n\t link: function link(scope, el, attrs) {\n\t var formId = attrs.name;\n\t scope.formId = formId;\n\t scope.theFormlyForm = scope[formId];\n\t if (attrs.form) {\n\t $parse(attrs.form).assign(scope.$parent, scope[formId]);\n\t }\n\n\t // chrome autocomplete lameness\n\t // see https://code.google.com/p/chromium/issues/detail?id=468153#c14\n\t // ლ(ಠ益ಠლ) (╯°□°)╯︵ ┻━┻ (◞‸◟;)\n\t var global = formlyConfig.extras.removeChromeAutoComplete === true;\n\t var offInstance = scope.options && scope.options.removeChromeAutoComplete === false;\n\t var onInstance = scope.options && scope.options.removeChromeAutoComplete === true;\n\t if (global && !offInstance || onInstance) {\n\t var input = document.createElement(\"input\");\n\t input.setAttribute(\"autocomplete\", \"address-level4\");\n\t input.setAttribute(\"hidden\", true);\n\t el[0].appendChild(input);\n\t }\n\t }\n\t };\n\t}\n\tformlyForm.$inject = [\"formlyUsability\", \"$parse\", \"formlyApiCheck\", \"formlyConfig\"];\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tmodule.exports = addFormlyNgModelAttrsManipulator;\n\n\t// @ngInject\n\tfunction addFormlyNgModelAttrsManipulator(formlyConfig) {\n\t if (formlyConfig.extras.disableNgModelAttrsManipulator) {\n\t return;\n\t }\n\t formlyConfig.templateManipulators.preWrapper.push(ngModelAttrsManipulator);\n\n\t function ngModelAttrsManipulator(template, options, scope) {\n\t /* jshint maxcomplexity:6 */\n\t var el = document.createElement(\"div\");\n\t var data = options.data;\n\t if (data.skipNgModelAttrsManipulator === true) {\n\t return template;\n\t }\n\t el.innerHTML = template;\n\t var modelNodes = el.querySelectorAll(\"[ng-model], [data-ng-model]\");\n\t if (!modelNodes || !modelNodes.length) {\n\t return template;\n\t }\n\n\t addIfNotPresent(modelNodes, \"id\", scope.id);\n\t addIfNotPresent(modelNodes, \"name\", scope.id);\n\n\t addValidation();\n\t addModelOptions();\n\t addTemplateOptionsAttrs();\n\n\t return el.innerHTML;\n\n\t function addValidation() {\n\t if (angular.isDefined(options.validators) || angular.isDefined(options.validation.messages)) {\n\t addIfNotPresent(modelNodes, \"formly-custom-validation\", \"\");\n\t }\n\t }\n\n\t function addModelOptions() {\n\t if (angular.isDefined(options.modelOptions)) {\n\t addIfNotPresent(modelNodes, \"ng-model-options\", \"options.modelOptions\");\n\t if (options.modelOptions.getterSetter) {\n\t angular.forEach(modelNodes, function (node) {\n\t node.setAttribute(\"ng-model\", \"options.value\");\n\t });\n\t }\n\t }\n\t }\n\n\t function addTemplateOptionsAttrs() {\n\t if (!options.templateOptions && !options.expressionProperties) {\n\t // no need to run these if there are no templateOptions or expressionProperties\n\t return;\n\t }\n\t var to = options.templateOptions || {};\n\t var ep = options.expressionProperties || {};\n\n\t var ngModelAttributes = getBuiltInAttributes();\n\n\t // extend with the user's specifications winning\n\t angular.extend(ngModelAttributes, options.ngModelAttrs);\n\n\t // Feel free to make this more simple :-)\n\t angular.forEach(ngModelAttributes, function (val, name) {\n\t /* jshint maxcomplexity:14 */\n\t var attrVal = undefined;\n\t var attrName = undefined;\n\t var ref = \"options.templateOptions['\" + name + \"']\";\n\t var toVal = to[name];\n\t var epVal = getEpValue(ep, name);\n\n\t var inTo = angular.isDefined(toVal);\n\t var inEp = angular.isDefined(epVal);\n\t if (val.value) {\n\t // I realize this looks backwards, but it's right, trust me...\n\t attrName = val.value;\n\t attrVal = name;\n\t } else if (val.expression && inTo) {\n\t attrName = val.expression;\n\t if (angular.isString(to[name])) {\n\t attrVal = \"$eval(\" + ref + \")\";\n\t } else if (angular.isFunction(to[name])) {\n\t attrVal = \"\" + ref + \"(model[options.key], options, this, $event)\";\n\t } else {\n\t throw new Error(\"options.templateOptions.\" + name + \" must be a string or function: \" + JSON.stringify(options));\n\t }\n\t } else if (val.bound && inEp) {\n\t attrName = val.bound;\n\t attrVal = ref;\n\t } else if ((val.attribute || val.boolean) && inEp) {\n\t attrName = val.attribute || val.boolean;\n\t attrVal = \"{{\" + ref + \"}}\";\n\t } else if (val.attribute && inTo) {\n\t attrName = val.attribute;\n\t attrVal = toVal;\n\t } else if (val.boolean) {\n\t if (inTo && !inEp && toVal) {\n\t attrName = val.boolean;\n\t attrVal = true;\n\t } else {}\n\t } else if (val.bound && inTo) {\n\t attrName = val.bound;\n\t attrVal = ref;\n\t }\n\n\t if (angular.isDefined(attrName) && angular.isDefined(attrVal)) {\n\t addIfNotPresent(modelNodes, attrName, attrVal);\n\t }\n\t });\n\t }\n\t }\n\n\t // Utility functions\n\t function getBuiltInAttributes() {\n\t var ngModelAttributes = {\n\t focus: {\n\t attribute: \"formly-focus\"\n\t }\n\t };\n\t var boundOnly = [];\n\t var bothBooleanAndBound = [\"required\", \"disabled\"];\n\t var bothAttributeAndBound = [\"pattern\", \"minlength\"];\n\t var expressionOnly = [\"change\", \"keydown\", \"keyup\", \"keypress\", \"click\", \"focus\", \"blur\"];\n\t var attributeOnly = [\"placeholder\", \"min\", \"max\", \"tabindex\", \"type\"];\n\t if (formlyConfig.extras.ngModelAttrsManipulatorPreferUnbound) {\n\t bothAttributeAndBound.push(\"maxlength\");\n\t } else {\n\t boundOnly.push(\"maxlength\");\n\t }\n\n\t angular.forEach(boundOnly, function (item) {\n\t ngModelAttributes[item] = { bound: \"ng-\" + item };\n\t });\n\n\t angular.forEach(bothBooleanAndBound, function (item) {\n\t ngModelAttributes[item] = { boolean: item, bound: \"ng-\" + item };\n\t });\n\n\t angular.forEach(bothAttributeAndBound, function (item) {\n\t ngModelAttributes[item] = { attribute: item, bound: \"ng-\" + item };\n\t });\n\n\t angular.forEach(expressionOnly, function (item) {\n\t var propName = \"on\" + item.substr(0, 1).toUpperCase() + item.substr(1);\n\t ngModelAttributes[propName] = { expression: \"ng-\" + item };\n\t });\n\n\t angular.forEach(attributeOnly, function (item) {\n\t ngModelAttributes[item] = { attribute: item };\n\t });\n\t return ngModelAttributes;\n\t }\n\n\t function getEpValue(ep, name) {\n\t return ep[\"templateOptions.\" + name] || ep[\"templateOptions['\" + name + \"']\"] || ep[\"templateOptions[\\\"\" + name + \"\\\"]\"];\n\t }\n\n\t function addIfNotPresent(nodes, attr, val) {\n\t angular.forEach(nodes, function (node) {\n\t if (!node.getAttribute(attr)) {\n\t node.setAttribute(attr, val);\n\t }\n\t });\n\t }\n\t}\n\taddFormlyNgModelAttrsManipulator.$inject = [\"formlyConfig\"];\n\n\t// jshint -W035\n\t// empty to illustrate that a boolean will not be added via val.bound\n\t// if you want it added via val.bound, then put it in expressionProperties\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tmodule.exports = addCustomTags;\n\n\t// @ngInject\n\tfunction addCustomTags($document) {\n\t if ($document && $document.get) {\n\t (function () {\n\t //IE8 check ->\n\t // http://stackoverflow.com/questions/10964966/detect-ie-version-prior-to-v9-in-javascript/10965203#10965203\n\t var document = $document.get(0);\n\t var div = document.createElement(\"div\");\n\t div.innerHTML = \"\";\n\t var isIeLessThan9 = div.getElementsByTagName(\"i\").length === 1;\n\n\t if (isIeLessThan9) {\n\t //add the custom elements that we need for formly\n\t var customElements = [\"formly-field\", \"formly-form\", \"formly-custom-validation\", \"formly-focus\", \"formly-transpose\"];\n\t angular.forEach(customElements, function (el) {\n\t document.createElement(el);\n\t });\n\t }\n\t })();\n\t }\n\t}\n\taddCustomTags.$inject = [\"$document\"];\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\t// some versions of angular don't export the angular module properly,\n\t// so we get it from window in this case.\n\n\tvar angular = _interopRequire(__webpack_require__(17));\n\n\tif (!angular.version) {\n\t angular = window.angular;\n\t}\n\tmodule.exports = angular;\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_16__;\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_17__;\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\n\tvar _interopRequire = function (obj) { return obj && obj.__esModule ? obj[\"default\"] : obj; };\n\n\tvar angular = _interopRequire(__webpack_require__(15));\n\n\tmodule.exports = { formlyEval: formlyEval, getFieldId: getFieldId, reverseDeepMerge: reverseDeepMerge, findByNodeName: findByNodeName, arrayify: arrayify, extendFunction: extendFunction };\n\n\tfunction formlyEval(scope, expression, $modelValue, $viewValue, extraLocals) {\n\t if (angular.isFunction(expression)) {\n\t return expression($viewValue, $modelValue, scope, extraLocals);\n\t } else {\n\t return scope.$eval(expression, angular.extend({ $viewValue: $viewValue, $modelValue: $modelValue }, extraLocals));\n\t }\n\t}\n\n\tfunction getFieldId(formId, options, index) {\n\t if (options.id) {\n\t return options.id;\n\t }\n\t var type = options.type;\n\t if (!type && options.template) {\n\t type = \"template\";\n\t } else if (!type && options.templateUrl) {\n\t type = \"templateUrl\";\n\t }\n\n\t return [formId, type, options.key, index].join(\"_\");\n\t}\n\n\tfunction reverseDeepMerge(dest) {\n\t angular.forEach(arguments, function (src, index) {\n\t if (!index) {\n\t return;\n\t }\n\t angular.forEach(src, function (val, prop) {\n\t if (!angular.isDefined(dest[prop])) {\n\t dest[prop] = angular.copy(val);\n\t } else if (objAndSameType(dest[prop], val)) {\n\t reverseDeepMerge(dest[prop], val);\n\t }\n\t });\n\t });\n\t}\n\n\tfunction objAndSameType(obj1, obj2) {\n\t return angular.isObject(obj1) && angular.isObject(obj2) && Object.getPrototypeOf(obj1) === Object.getPrototypeOf(obj2);\n\t}\n\n\t//recurse down a node tree to find a node with matching nodeName, for custom tags jQuery.find doesn't work in IE8\n\tfunction findByNodeName(el, nodeName) {\n\t if (!el.prop) {\n\t // not a jQuery or jqLite object -> wrap it\n\t el = angular.element(el);\n\t }\n\n\t if (el.prop(\"nodeName\") === nodeName.toUpperCase()) {\n\t return el;\n\t }\n\n\t var c = el.children();\n\t for (var i = 0; c && i < c.length; i++) {\n\t var node = findByNodeName(c[i], nodeName);\n\t if (node) {\n\t return node;\n\t }\n\t }\n\t}\n\n\tfunction arrayify(obj) {\n\t if (obj && !angular.isArray(obj)) {\n\t obj = [obj];\n\t } else if (!obj) {\n\t obj = [];\n\t }\n\t return obj;\n\t}\n\n\tfunction extendFunction() {\n\t for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) {\n\t fns[_key] = arguments[_key];\n\t }\n\n\t return function extendedFunction() {\n\t var args = arguments;\n\t fns.forEach(function (fn) {\n\t return fn.apply(null, args);\n\t });\n\t };\n\t}\n\n/***/ }\n/******/ ])\n});\n;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9+L2FuZ3VsYXItZm9ybWx5L2Rpc3QvZm9ybWx5LmpzPzUxZmEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELG9DQUFvQztBQUNwQztBQUNBOztBQUVBO0FBQ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dH1cblxuXHRmdW5jdGlvbiBleHRlbmRGdW5jdGlvbigpIHtcblx0ICBmb3IgKHZhciBfbGVuID0gYXJndW1lbnRzLmxlbmd0aCwgZm5zID0gQXJyYXkoX2xlbiksIF9rZXkgPSAwOyBfa2V5IDwgX2xlbjsgX2tleSsrKSB7XG5cdCAgICBmbnNbX2tleV0gPSBhcmd1bWVudHNbX2tleV07XG5cdCAgfVxuXG5cdCAgcmV0dXJuIGZ1bmN0aW9uIGV4dGVuZGVkRnVuY3Rpb24oKSB7XG5cdCAgICB2YXIgYXJncyA9IGFyZ3VtZW50cztcblx0ICAgIGZucy5mb3JFYWNoKGZ1bmN0aW9uIChmbikge1xuXHQgICAgICByZXR1cm4gZm4uYXBwbHkobnVsbCwgYXJncyk7XG5cdCAgICB9KTtcblx0ICB9O1xuXHR9XG5cbi8qKiovIH1cbi8qKioqKiovIF0pXG59KTtcbjtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL34vYW5ndWxhci1mb3JtbHkvZGlzdC9mb3JtbHkuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ=="); /***/ }, /* 4 */ /***/ function(module, exports) { eval("module.exports = angular;//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vZXh0ZXJuYWwgXCJhbmd1bGFyXCI/MTFkMiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiI0LmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBhbmd1bGFyO1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIGV4dGVybmFsIFwiYW5ndWxhclwiXG4vLyBtb2R1bGUgaWQgPSA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0="); /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { eval("// angular-formly-templates-bootstrap version 4.3.2 built with ♥ by Astrism , Kent C. Dodds (ó ì_í)=óò=(ì_í ò)\n\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(3), __webpack_require__(2), __webpack_require__(4));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"angular-formly\", \"api-check\", \"angular\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ngFormlyTemplatesBootstrap\"] = factory(require(\"angular-formly\"), require(\"api-check\"), require(\"angular\"));\n\telse\n\t\troot[\"ngFormlyTemplatesBootstrap\"] = factory(root[\"ngFormly\"], root[\"apiCheck\"], root[\"angular\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_8__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tmodule.exports = __webpack_require__(11);\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addCheckboxType);\n\t\n\t function addCheckboxType(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setType({\n\t name: 'multiCheckbox',\n\t template: __webpack_require__(21),\n\t wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t options: c.arrayOf(c.object),\n\t labelProp: c.string.optional,\n\t valueProp: c.string.optional\n\t })\n\t },\n\t defaultOptions: {\n\t noFormControl: false,\n\t ngModelAttrs: {\n\t required: {\n\t attribute: '',\n\t bound: ''\n\t }\n\t }\n\t },\n\t apiCheckInstance: c,\n\t controller: /* @ngInject */[\"$scope\", function controller($scope) {\n\t var to = $scope.to;\n\t var opts = $scope.options;\n\t $scope.multiCheckbox = {\n\t checked: [],\n\t change: setModel\n\t };\n\t\n\t // initialize the checkboxes check property\n\t var modelValue = $scope.model[opts.key];\n\t if (angular.isArray(modelValue)) {\n\t (function () {\n\t var valueProp = to.valueProp || 'value';\n\t angular.forEach(to.options, function (v, index) {\n\t $scope.multiCheckbox.checked[index] = modelValue.indexOf(v[valueProp]) !== -1;\n\t });\n\t })();\n\t }\n\t\n\t function checkValidity(expressionValue) {\n\t var valid = angular.isArray($scope.model[opts.key]) && $scope.model[opts.key].length > 0 && expressionValue;\n\t\n\t $scope.fc.$setValidity('required', valid);\n\t }\n\t\n\t function setModel() {\n\t $scope.model[opts.key] = [];\n\t angular.forEach($scope.multiCheckbox.checked, function (checkbox, index) {\n\t if (checkbox) {\n\t $scope.model[opts.key].push(to.options[index][to.valueProp || 'value']);\n\t }\n\t });\n\t\n\t // Must make sure we mark as touched because only the last checkbox due to a bug in angular.\n\t $scope.fc.$setTouched();\n\t checkValidity(true);\n\t }\n\t\n\t if (opts.expressionProperties && opts.expressionProperties.required) {\n\t $scope.$watch($scope.options.expressionProperties.required, function (newValue) {\n\t checkValidity(newValue);\n\t });\n\t }\n\t\n\t if ($scope.to.required) {\n\t var unwatchFormControl = $scope.$watch('fc', function (newValue) {\n\t if (!newValue) {\n\t return;\n\t }\n\t checkValidity(true);\n\t unwatchFormControl;\n\t });\n\t }\n\t }]\n\t });\n\t }\n\t addCheckboxType.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// some versions of angular don't export the angular module properly,\n\t// so we get it from window in this case.\n\t'use strict';\n\t\n\tvar angular = __webpack_require__(8);\n\tif (!angular.version) {\n\t angular = window.angular;\n\t}\n\tmodule.exports = angular;\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addWrappers);\n\t\n\t function addWrappers(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setWrapper([{\n\t name: 'bootstrapLabel',\n\t template: __webpack_require__(17),\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t label: c.string,\n\t required: c.bool.optional\n\t })\n\t },\n\t apiCheckInstance: c\n\t }, { name: 'bootstrapHasError', template: __webpack_require__(18) }]);\n\t }\n\t addWrappers.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 6 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t __webpack_require__(10)(ngModule);\n\t __webpack_require__(1)(ngModule);\n\t __webpack_require__(12)(ngModule);\n\t __webpack_require__(9)(ngModule);\n\t __webpack_require__(13)(ngModule);\n\t __webpack_require__(14)(ngModule);\n\t};\n\t\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar _addons = __webpack_require__(15);\n\t\n\tvar _addons2 = _interopRequireDefault(_addons);\n\t\n\tvar _description = __webpack_require__(16);\n\t\n\tvar _description2 = _interopRequireDefault(_description);\n\t\n\texports['default'] = function (ngModule) {\n\t (0, _addons2['default'])(ngModule);\n\t (0, _description2['default'])(ngModule);\n\t};\n\t\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addRadioType);\n\t\n\t function addRadioType(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setType({\n\t name: 'radio',\n\t template: __webpack_require__(19),\n\t wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n\t defaultOptions: {\n\t noFormControl: false\n\t },\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t options: c.arrayOf(c.object),\n\t labelProp: c.string.optional,\n\t valueProp: c.string.optional\n\t })\n\t },\n\t apiCheckInstance: c\n\t });\n\t }\n\t addRadioType.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 10 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addCheckboxType);\n\t\n\t function addCheckboxType(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setType({\n\t name: 'checkbox',\n\t template: __webpack_require__(20),\n\t wrapper: ['bootstrapHasError'],\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t label: c.string\n\t })\n\t },\n\t apiCheckInstance: c\n\t });\n\t }\n\t addCheckboxType.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\tvar ngModuleName = 'formlyBootstrap';\n\tvar angular = __webpack_require__(4);\n\tvar ngModule = angular.module(ngModuleName, [__webpack_require__(2)]);\n\tngModule.constant('formlyBootstrapApiCheck', __webpack_require__(3)({\n\t output: {\n\t prefix: 'angular-formly-bootstrap'\n\t }\n\t}));\n\tngModule.constant('formlyBootstrapVersion', (\"4.3.2\"));\n\t\n\t__webpack_require__(5)(ngModule);\n\t__webpack_require__(6)(ngModule);\n\t__webpack_require__(7)(ngModule);\n\t\n\texports['default'] = ngModuleName;\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addInputType);\n\t\n\t function addInputType(formlyConfigProvider) {\n\t formlyConfigProvider.setType({\n\t name: 'input',\n\t template: '',\n\t wrapper: ['bootstrapLabel', 'bootstrapHasError']\n\t });\n\t }\n\t addInputType.$inject = [\"formlyConfigProvider\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 13 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\tfunction _defineProperty(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addSelectType);\n\t\n\t var template = '';\n\t\n\t function addSelectType(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setType({\n\t name: 'select',\n\t template: template,\n\t wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n\t defaultOptions: function defaultOptions(options) {\n\t /* jshint maxlen:195 */\n\t var ngOptions = options.templateOptions.ngOptions || 'option[to.valueProp || \\'value\\'] as option[to.labelProp || \\'name\\'] group by option[to.groupProp || \\'group\\'] for option in to.options';\n\t return {\n\t ngModelAttrs: _defineProperty({}, ngOptions, {\n\t value: 'ng-options'\n\t })\n\t };\n\t },\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t options: c.arrayOf(c.object),\n\t labelProp: c.string.optional,\n\t valueProp: c.string.optional,\n\t groupProp: c.string.optional\n\t })\n\t },\n\t apiCheckInstance: c\n\t });\n\t }\n\t addSelectType.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 14 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.config(addTextareaType);\n\t\n\t function addTextareaType(formlyConfigProvider, formlyBootstrapApiCheck) {\n\t var c = formlyBootstrapApiCheck;\n\t formlyConfigProvider.setType({\n\t name: 'textarea',\n\t template: '',\n\t wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n\t defaultOptions: {\n\t ngModelAttrs: {\n\t rows: { attribute: 'rows' },\n\t cols: { attribute: 'cols' }\n\t }\n\t },\n\t apiCheck: {\n\t templateOptions: c.shape({\n\t rows: c.number.optional,\n\t cols: c.number.optional\n\t })\n\t },\n\t apiCheckInstance: c\n\t });\n\t }\n\t addTextareaType.$inject = [\"formlyConfigProvider\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 15 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.run(addAddonsManipulator);\n\t\n\t function addAddonsManipulator(formlyConfig, formlyBootstrapApiCheck) {\n\t var addonTemplate = __webpack_require__(22);\n\t var addonChecker = formlyBootstrapApiCheck.shape({\n\t 'class': formlyBootstrapApiCheck.string.optional,\n\t text: formlyBootstrapApiCheck.string.optional,\n\t onClick: formlyBootstrapApiCheck.func.optional\n\t }).strict.optional;\n\t var api = formlyBootstrapApiCheck.shape({\n\t templateOptions: formlyBootstrapApiCheck.shape({\n\t addonLeft: addonChecker,\n\t addonRight: addonChecker\n\t })\n\t });\n\t formlyConfig.templateManipulators.preWrapper.push(function (template, options) {\n\t if (!options.templateOptions.addonLeft && !options.templateOptions.addonRight) {\n\t return template;\n\t }\n\t formlyBootstrapApiCheck.warn([api], [options]);\n\t return addonTemplate.replace('', template);\n\t });\n\t }\n\t addAddonsManipulator.$inject = [\"formlyConfig\", \"formlyBootstrapApiCheck\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, '__esModule', {\n\t value: true\n\t});\n\t\n\texports['default'] = function (ngModule) {\n\t ngModule.run(addDescriptionManipulator);\n\t\n\t function addDescriptionManipulator(formlyConfig) {\n\t formlyConfig.templateManipulators.preWrapper.push(function ariaDescribedBy(template, options, scope) {\n\t if (angular.isDefined(options.templateOptions.description)) {\n\t var el = document.createElement('div');\n\t el.appendChild(angular.element(template)[0]);\n\t el.appendChild(angular.element('

' + '{{to.description}}' + '

')[0]);\n\t var modelEls = angular.element(el.querySelectorAll('[ng-model]'));\n\t if (modelEls) {\n\t modelEls.attr('aria-describedby', scope.id + '_description');\n\t }\n\t return el.innerHTML;\n\t } else {\n\t return template;\n\t }\n\t });\n\t }\n\t addDescriptionManipulator.$inject = [\"formlyConfig\"];\n\t};\n\n\tmodule.exports = exports['default'];\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = \"
\\n \\n \\n
\\n\"\n\n/***/ },\n/* 18 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = \"
\\n \\n
\\n\"\n\n/***/ },\n/* 19 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = \"
\\n
\\n \\n
\\n
\\n\"\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = \"
\\n\\t\\n
\\n\"\n\n/***/ },\n/* 21 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tmodule.exports = \"
\\n
\\n \\n
\\n
\\n\"\n\n/***/ },\n/* 22 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tm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FxcIlxcbiAgICAgICAgIG5nLWlmPVxcXCJ0by5hZGRvblJpZ2h0XFxcIlxcbiAgICAgICAgIG5nLXN0eWxlPVxcXCJ7Y3Vyc29yOiB0by5hZGRvblJpZ2h0Lm9uQ2xpY2sgPyAncG9pbnRlcicgOiAnaW5oZXJpdCd9XFxcIlxcbiAgICAgICAgIG5nLWNsaWNrPVxcXCJ0by5hZGRvblJpZ2h0Lm9uQ2xpY2sob3B0aW9ucywgdGhpcylcXFwiPlxcbiAgICAgICAgPGkgY2xhc3M9XFxcInt7dG8uYWRkb25SaWdodC5jbGFzc319XFxcIiBuZy1pZj1cXFwidG8uYWRkb25SaWdodC5jbGFzc1xcXCI+PC9pPlxcbiAgICAgICAgPHNwYW4gbmctaWY9XFxcInRvLmFkZG9uUmlnaHQudGV4dFxcXCI+e3t0by5hZGRvblJpZ2h0LnRleHR9fTwvc3Bhbj5cXG4gICAgPC9kaXY+XFxuPC9kaXY+XFxuXCJcblxuLyoqKi8gfVxuLyoqKioqKi8gXSlcbn0pO1xuO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9YW5ndWxhci1mb3JtbHktdGVtcGxhdGVzLWJvb3RzdHJhcC5qcy5tYXBcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL34vYW5ndWxhci1mb3JtbHktdGVtcGxhdGVzLWJvb3RzdHJhcC9kaXN0L2FuZ3VsYXItZm9ybWx5LXRlbXBsYXRlcy1ib290c3RyYXAuanNcbi8vIG1vZHVsZSBpZCA9IDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sInNvdXJjZVJvb3QiOiIifQ=="); /***/ }, /* 6 */ /***/ function(module, exports, __webpack_require__) { eval("// style-loader: Adds some css to the DOM by adding a